[Webkit-unassigned] [Bug 16440] ER: file replacement support

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Dec 15 07:35:19 PST 2007


http://bugs.webkit.org/show_bug.cgi?id=16440


ddkilzer at webkit.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ddkilzer at webkit.org
           Severity|Normal                      |Enhancement




------- Comment #3 from ddkilzer at webkit.org  2007-12-15 07:35 PDT -------
(In reply to comment #0)
> The ability to load locally modified subresources would make it a lot easier to
> isolate problems in web pages, and come up with reductions and test cases.

This enhancement request raises some really interesting points.

I think what you're asking for (please correct me if I'm wrong) is to be able
to save the state (DOM) of the current HTML page (as opposed to the original
HTML loaded) with local copies of external resources (such as JavaScript source
and stylesheets, in addition to images).

New "Save As..." Formats

It would be nice to support Firefox's "Web page, complete" format (Bug 7211),
with an option to save the original HTML or the current DOM.  Supporting the
reading (Bug 7168) and writing (Bug 7169) of MSIE's MHTML format would work as
well, although it's not in a form that's easily modifiable locally.

Saving Original HTML

The only current options for saving the original HTML (from Safari) are as Page
Source and as a WebArchive file.  Page Source does not include any external
resources, and the WebArchive file has known bugs about saving external
resources (Bug 11839, Bug 11850, Bug 12025) and is not an easy format to modify
locally (Bug 7241 could provide a helper script).  The WebArchive format isn't
cross-platform, either.

Alternative Approaches

Another approach to saving external JavaScript or CSS stylesheets resources is
to "flatten" (or "inline") them into the DOM, then save the current DOM to
disk.  (You could optionally turn images and other external resources into
data: URLs, but that would clutter the HTML quite a bit.)

JavaScript and CSS stylesheet flattening could be accomplished with JavaScript
bookmarklets.  (I have written JavaScript code to flatten CSS stylesheets into
the DOM as part of a test case reduction tool, although it's not in the form of
a bookmarklet.)

Once the resources are flattened, you still need to save the current DOM to
disk.  There is no nice way to do this today, although you can accomplish that
task using a JavaScript alert() dialog with Safari because it lets you copy the
contents of the alert sheet using Cmd-A and Cmd-C, even if the content is too
big to fit on the sheet:

javascript:alert(document.documentElemenet.outerHTML)


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list