Changeset 266671 in webkit


Ignore:
Timestamp:
Sep 5, 2020, 1:54:42 PM (5 years ago)
Author:
achristensen@apple.com
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):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r266668 r266671  
     12020-09-05  Alex Christensen  <achristensen@webkit.org>
     2
     3        XML documents in iframes should not inherit encoding from parent frame
     4        https://bugs.webkit.org/show_bug.cgi?id=216216
     5
     6        Reviewed by Darin Adler.
     7
     8        * web-platform-tests/encoding/utf-32-from-win1252-expected.txt:
     9
    1102020-09-05  Alex Christensen  <achristensen@webkit.org>
    211
  • trunk/LayoutTests/imported/w3c/web-platform-tests/encoding/utf-32-from-win1252-expected.txt

    r256730 r266671  
    11
    22PASS Expect resources/utf-32-big-endian-bom.html to parse as windows-1252
    3 FAIL Expect resources/utf-32-big-endian-bom.xml to parse as UTF-8 assert_equals: expected "UTF-8" but got "windows-1252"
     3PASS Expect resources/utf-32-big-endian-bom.xml to parse as UTF-8
    44PASS Expect resources/utf-32-big-endian-nobom.html to parse as windows-1252
    5 FAIL Expect resources/utf-32-big-endian-nobom.xml to parse as UTF-8 assert_equals: expected "UTF-8" but got "windows-1252"
     5PASS Expect resources/utf-32-big-endian-nobom.xml to parse as UTF-8
    66PASS Expect resources/utf-32-little-endian-bom.html to parse as UTF-16LE
    77PASS Expect resources/utf-32-little-endian-bom.xml to parse as UTF-16LE
    88PASS Expect resources/utf-32-little-endian-nobom.html to parse as windows-1252
    9 FAIL Expect resources/utf-32-little-endian-nobom.xml to parse as UTF-8 assert_equals: expected "UTF-8" but got "windows-1252"
     9PASS Expect resources/utf-32-little-endian-nobom.xml to parse as UTF-8
    1010
  • trunk/Source/WebCore/ChangeLog

    r266669 r266671  
     12020-09-05  Alex Christensen  <achristensen@webkit.org>
     2
     3        XML documents in iframes should not inherit encoding from parent frame
     4        https://bugs.webkit.org/show_bug.cgi?id=216216
     5
     6        Reviewed by Darin Adler.
     7
     8        This seems to match the behavior of Chrome and Firefox.
     9        Covered by newly passing web platform tests, which other browsers already pass.
     10
     11        * loader/DocumentWriter.cpp:
     12        (WebCore::canReferToParentFrameEncoding):
     13
    1142020-09-05  Devin Rousso  <drousso@apple.com>
    215
  • trunk/Source/WebCore/loader/DocumentWriter.cpp

    r263422 r266671  
    5656static inline bool canReferToParentFrameEncoding(const Frame* frame, const Frame* parentFrame)
    5757{
     58    if (is<XMLDocument>(frame->document()))
     59        return false;
    5860    return parentFrame && parentFrame->document()->securityOrigin().canAccess(frame->document()->securityOrigin());
    5961}
Note: See TracChangeset for help on using the changeset viewer.