Title: [119644] trunk
Revision
119644
Author
[email protected]
Date
2012-06-06 17:10:59 -0700 (Wed, 06 Jun 2012)

Log Message

<rdar://problem/11575112> and https://bugs.webkit.org/show_bug.cgi?id=88428
REGRESSION (r115654): Opening many non-English WebArchives shows obvious encoding issues

Reviewed by Nate Chapin.

Source/WebCore:

Test: fast/loader/webarchive-encoding-respected.html

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData): Properly set the main resource encoding from the webarchive.

LayoutTests:

* fast/loader/resources/utf8-encoded.webarchive: Added.
* fast/loader/webarchive-encoding-respected-expected.txt: Added.
* fast/loader/webarchive-encoding-respected.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (119643 => 119644)


--- trunk/LayoutTests/ChangeLog	2012-06-07 00:10:39 UTC (rev 119643)
+++ trunk/LayoutTests/ChangeLog	2012-06-07 00:10:59 UTC (rev 119644)
@@ -1,3 +1,14 @@
+2012-06-06  Brady Eidson  <[email protected]>
+
+        <rdar://problem/11575112> and https://bugs.webkit.org/show_bug.cgi?id=88428
+        REGRESSION (r115654): Opening many non-English WebArchives shows obvious encoding issues
+
+        Reviewed by Nate Chapin.
+
+        * fast/loader/resources/utf8-encoded.webarchive: Added.
+        * fast/loader/webarchive-encoding-respected-expected.txt: Added.
+        * fast/loader/webarchive-encoding-respected.html: Added.
+
 2012-06-06  Ryosuke Niwa  <[email protected]>
 
         Chromium rebaseline after r119617 part 3.

Added: trunk/LayoutTests/fast/loader/resources/utf8-encoded.webarchive (0 => 119644)


--- trunk/LayoutTests/fast/loader/resources/utf8-encoded.webarchive	                        (rev 0)
+++ trunk/LayoutTests/fast/loader/resources/utf8-encoded.webarchive	2012-06-07 00:10:59 UTC (rev 119644)
@@ -0,0 +1,4 @@
+bplist00\xD1_WebMainResource\xD5	
+_WebResourceMIMEType_WebResourceTextEncodingName_WebResourceFrameName^WebResourceURL_WebResourceDataYtext/htmlUUTF-8P_http://127.0.0.1:8000/utf-8.cgiOs<html><head></head><body>This content is UTF-8 encoded and includes a Hebrew Resh character -&gt; ר
+</body></html>(>\s\x82\x94\x9E\xA4\xA5\xC7
+=
\ No newline at end of file

Added: trunk/LayoutTests/fast/loader/webarchive-encoding-respected-expected.txt (0 => 119644)


--- trunk/LayoutTests/fast/loader/webarchive-encoding-respected-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/loader/webarchive-encoding-respected-expected.txt	2012-06-07 00:10:59 UTC (rev 119644)
@@ -0,0 +1,7 @@
+The webarchive in this iframe is utf-8 encoded and will only display properly if the webarchive's encoding is respected.
+
+
+--------
+Frame: '<!--framePath //<!--frame0-->-->'
+--------
+This content is UTF-8 encoded and includes a Hebrew Resh character -> ר

Added: trunk/LayoutTests/fast/loader/webarchive-encoding-respected.html (0 => 119644)


--- trunk/LayoutTests/fast/loader/webarchive-encoding-respected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/loader/webarchive-encoding-respected.html	2012-06-07 00:10:59 UTC (rev 119644)
@@ -0,0 +1,8 @@
+<script>
+if (window.layoutTestController) {
+	layoutTestController.dumpAsText();
+	layoutTestController.dumpChildFramesAsText();
+}
+</script>
+The webarchive in this iframe is utf-8 encoded and will only display properly if the webarchive's encoding is respected.<br>
+<iframe src=""

Modified: trunk/Source/WebCore/ChangeLog (119643 => 119644)


--- trunk/Source/WebCore/ChangeLog	2012-06-07 00:10:39 UTC (rev 119643)
+++ trunk/Source/WebCore/ChangeLog	2012-06-07 00:10:59 UTC (rev 119644)
@@ -1,3 +1,15 @@
+2012-06-06  Brady Eidson  <[email protected]>
+
+        <rdar://problem/11575112> and https://bugs.webkit.org/show_bug.cgi?id=88428
+        REGRESSION (r115654): Opening many non-English WebArchives shows obvious encoding issues
+
+        Reviewed by Nate Chapin.
+
+        Test: fast/loader/webarchive-encoding-respected.html
+
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::commitData): Properly set the main resource encoding from the webarchive.
+
 2012-06-06  Mark Hahnenberg  <[email protected]>
 
         Worker tear-down can re-enter JSC during GC finalization

Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (119643 => 119644)


--- trunk/Source/WebCore/loader/DocumentLoader.cpp	2012-06-07 00:10:39 UTC (rev 119643)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp	2012-06-07 00:10:59 UTC (rev 119644)
@@ -342,6 +342,10 @@
         if (encoding.isNull()) {
             userChosen = false;
             encoding = response().textEncodingName();
+#if ENABLE(WEB_ARCHIVE)
+            if (m_archive && m_archive->type() == Archive::WebArchive)
+                encoding = m_archive->mainResource()->textEncoding();
+#endif
         }
         m_writer.setEncoding(encoding, userChosen);
     }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to