Title: [266671] trunk
Revision
266671
Author
achristen...@apple.com
Date
2020-09-05 13:54:42 -0700 (Sat, 05 Sep 2020)

Log Message

XML documents in iframes should not inherit encoding from parent frame
https://bugs.webkit.org/show_bug.cgi?id=216216

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/encoding/utf-32-from-win1252-expected.txt:

Source/WebCore:

This seems to match the behavior of Chrome and Firefox.
Covered by newly passing web platform tests, which other browsers already pass.

* loader/DocumentWriter.cpp:
(WebCore::canReferToParentFrameEncoding):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (266670 => 266671)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2020-09-05 20:10:54 UTC (rev 266670)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2020-09-05 20:54:42 UTC (rev 266671)
@@ -1,5 +1,14 @@
 2020-09-05  Alex Christensen  <achristen...@webkit.org>
 
+        XML documents in iframes should not inherit encoding from parent frame
+        https://bugs.webkit.org/show_bug.cgi?id=216216
+
+        Reviewed by Darin Adler.
+
+        * web-platform-tests/encoding/utf-32-from-win1252-expected.txt:
+
+2020-09-05  Alex Christensen  <achristen...@webkit.org>
+
         TextDecoder should properly handle streams
         https://bugs.webkit.org/show_bug.cgi?id=216202
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/encoding/utf-32-from-win1252-expected.txt (266670 => 266671)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/encoding/utf-32-from-win1252-expected.txt	2020-09-05 20:10:54 UTC (rev 266670)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/encoding/utf-32-from-win1252-expected.txt	2020-09-05 20:54:42 UTC (rev 266671)
@@ -1,10 +1,10 @@
 
 PASS Expect resources/utf-32-big-endian-bom.html to parse as windows-1252 
-FAIL Expect resources/utf-32-big-endian-bom.xml to parse as UTF-8 assert_equals: expected "UTF-8" but got "windows-1252"
+PASS Expect resources/utf-32-big-endian-bom.xml to parse as UTF-8 
 PASS Expect resources/utf-32-big-endian-nobom.html to parse as windows-1252 
-FAIL Expect resources/utf-32-big-endian-nobom.xml to parse as UTF-8 assert_equals: expected "UTF-8" but got "windows-1252"
+PASS Expect resources/utf-32-big-endian-nobom.xml to parse as UTF-8 
 PASS Expect resources/utf-32-little-endian-bom.html to parse as UTF-16LE 
 PASS Expect resources/utf-32-little-endian-bom.xml to parse as UTF-16LE 
 PASS Expect resources/utf-32-little-endian-nobom.html to parse as windows-1252 
-FAIL Expect resources/utf-32-little-endian-nobom.xml to parse as UTF-8 assert_equals: expected "UTF-8" but got "windows-1252"
+PASS Expect resources/utf-32-little-endian-nobom.xml to parse as UTF-8 
 

Modified: trunk/Source/WebCore/ChangeLog (266670 => 266671)


--- trunk/Source/WebCore/ChangeLog	2020-09-05 20:10:54 UTC (rev 266670)
+++ trunk/Source/WebCore/ChangeLog	2020-09-05 20:54:42 UTC (rev 266671)
@@ -1,3 +1,16 @@
+2020-09-05  Alex Christensen  <achristen...@webkit.org>
+
+        XML documents in iframes should not inherit encoding from parent frame
+        https://bugs.webkit.org/show_bug.cgi?id=216216
+
+        Reviewed by Darin Adler.
+
+        This seems to match the behavior of Chrome and Firefox.
+        Covered by newly passing web platform tests, which other browsers already pass.
+
+        * loader/DocumentWriter.cpp:
+        (WebCore::canReferToParentFrameEncoding):
+
 2020-09-05  Devin Rousso  <drou...@apple.com>
 
         Web Inspector: allow DOM breakpoints to be configured

Modified: trunk/Source/WebCore/loader/DocumentWriter.cpp (266670 => 266671)


--- trunk/Source/WebCore/loader/DocumentWriter.cpp	2020-09-05 20:10:54 UTC (rev 266670)
+++ trunk/Source/WebCore/loader/DocumentWriter.cpp	2020-09-05 20:54:42 UTC (rev 266671)
@@ -55,6 +55,8 @@
 
 static inline bool canReferToParentFrameEncoding(const Frame* frame, const Frame* parentFrame) 
 {
+    if (is<XMLDocument>(frame->document()))
+        return false;
     return parentFrame && parentFrame->document()->securityOrigin().canAccess(frame->document()->securityOrigin());
 }
     
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to