<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>7211</bug_id>
          
          <creation_ts>2006-02-11 23:33:05 -0800</creation_ts>
          <short_desc>Support save as &quot;Web page, complete&quot; into a directory with separate files for resources</short_desc>
          <delta_ts>2012-10-08 11:43:34 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Misc.</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Kilzer (:ddkilzer)">ddkilzer</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>beidson</cc>
    
    <cc>emacemac7</cc>
    
    <cc>jasonliuwebkit</cc>
    
    <cc>jmalonzo</cc>
    
    <cc>joost</cc>
    
    <cc>marco.barisione</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>32212</commentid>
    <comment_count>0</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2006-02-11 23:33:05 -0800</bug_when>
    <thetext>It would be nice if WebKit supported saving a web page as &quot;Web page, complete&quot; in the same way that Firefox saves web pages (storing the HTML file with a similarly-named directory for resources from the original page).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32221</commentid>
    <comment_count>1</comment_count>
    <who name="Joost de Valk (AlthA)">joost</who>
    <bug_when>2006-02-12 02:53:54 -0800</bug_when>
    <thetext>Agreed, this would make the life of bug reducers a LOT easier, now i have to fire up Firefox to do these things :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84413</commentid>
    <comment_count>2</comment_count>
    <who name="Marco Barisione">marco.barisione</who>
    <bug_when>2008-06-25 09:31:35 -0700</bug_when>
    <thetext>I&apos;m interested in fixing this for the GTK port but I suspect that most of the code would be shared with other ports.

Did someone already try to do this? Do you have implementation suggestions?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84418</commentid>
    <comment_count>3</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-06-25 09:51:50 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; Did someone already try to do this?

No, not that I&apos;m aware of.

&gt; Do you have implementation suggestions?

Basically the code will need to walk (or somehow traverse) the HTML DOM looking for references to external resources (like images, CSS files, JavaScript files, etc.) and (1) modify the references to point to (new) local copies that will be saved on disk and (2) queue the resources for later saving to disk.  And this will have to be done &quot;recursively&quot; for all resources since the outer HTML file could reference an &lt;iframe&gt;, which could reference another &lt;iframe&gt;, etc.

Note that you&apos;ll have to walk the CSS object model (CSS OM) as well since references such as other CSS files and images may be included in CSS source.  (Firefox 2.0.0.x currently doesn&apos;t do this, so you don&apos;t truly get a complete web page with this feature.  Haven&apos;t tried Firefox 3 yet.)

Finally, I&apos;d use Firefox 2/3 as a guide for how to structure the output (it saves the top level HTML file with a &quot;_files&quot; directory beside it, but any subresources that are HTML pages use a &quot;_data&quot; suffix for their corresponding directory), and then improve on the design as needed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84419</commentid>
    <comment_count>4</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-06-25 09:53:58 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; Do you have implementation suggestions?

Also the current WebArchive code in WebCore walks the HTML DOM and CSS OM in a similar fashion today, so that code may be reused or at least act as a starting point.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89919</commentid>
    <comment_count>5</comment_count>
    <who name="Marco Barisione">marco.barisione</who>
    <bug_when>2008-09-02 10:34:24 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; I&apos;m interested in fixing this for the GTK port but I suspect that most of the
&gt; code would be shared with other ports.

In the end we decided that MHTML was better for our requirements, so I implemented that instead. As a user I hope that somebody else will fix this :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97127</commentid>
    <comment_count>6</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-10-30 09:51:40 -0700</bug_when>
    <thetext>In &lt;https://lists.webkit.org/pipermail/webkit-dev/2008-October/005537.html&gt;, Darin Fisher wrote:

We have code to support this feature in the Chromium code base.  You can find it here:
http://src.chromium.org/viewvc/chrome/trunk/src/webkit/glue/dom_serializer.h?view=markup
http://src.chromium.org/viewvc/chrome/trunk/src/webkit/glue/dom_serializer.cc?view=markup

It is something we would love to one day see as part of WebKit.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>736860</commentid>
    <comment_count>7</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-10-08 11:43:34 -0700</bug_when>
    <thetext>Renaming, since this enhancement request is not about Firefox compatibility at all.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>