Changeset 284934 in webkit
- Timestamp:
- Oct 27, 2021 12:05:46 PM (9 months ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling-dynamic-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/loader/DocumentLoader.cpp (modified) (2 diffs)
-
Source/WebCore/loader/DocumentWriter.cpp (modified) (3 diffs)
-
Source/WebCore/loader/DocumentWriter.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r284901 r284934 1 2021-10-27 Chris Dumez <cdumez@apple.com> 2 3 JavaScript URL result should be treated as UTF-8 bytes 4 https://bugs.webkit.org/show_bug.cgi?id=232380 5 6 Reviewed by Darin Adler. 7 8 Rebaseline WPT test now that more checks are passing. The remaining failures are due to the fact that we ignore the JavaScript URL result 9 when the URL is set as href on an anchor (as opposed to the src of an iframe). This will be addressed separately. 10 11 * web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling-dynamic-expected.txt: 12 1 13 2021-10-26 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling-dynamic-expected.txt
r279427 r284934 1 1 2 FAIL 0041 set in src="" assert_equals: expected "UTF-8" but got "windows-1252"2 PASS 0041 set in src="" 3 3 FAIL 0041 set in href="" targeting a frame and clicked assert_equals: expected "A" but got "" 4 FAIL 0080 00FF set in src="" assert_equals: expected "UTF-8" but got "windows-1252"4 PASS 0080 00FF set in src="" 5 5 FAIL 0080 00FF set in href="" targeting a frame and clicked assert_equals: expected "ÿ" but got "" 6 FAIL 0080 00FF 0100 set in src="" assert_equals: expected "UTF-8" but got "windows-1252"6 PASS 0080 00FF 0100 set in src="" 7 7 FAIL 0080 00FF 0100 set in href="" targeting a frame and clicked assert_equals: expected "ÿĀ" but got "" 8 FAIL D83D DE0D set in src="" assert_equals: expected "UTF-8" but got "windows-1252"8 PASS D83D DE0D set in src="" 9 9 FAIL D83D DE0D set in href="" targeting a frame and clicked assert_equals: expected "😍" but got "" 10 FAIL DE0D 0041 set in src="" assert_equals: expected "\ufffdA" but got "U+de0dA"10 PASS DE0D 0041 set in src="" 11 11 FAIL DE0D 0041 set in href="" targeting a frame and clicked assert_equals: expected "\ufffdA" but got "" 12 12 -
trunk/Source/WebCore/ChangeLog
r284920 r284934 1 2021-10-27 Chris Dumez <cdumez@apple.com> 2 3 JavaScript URL result should be treated as UTF-8 bytes 4 https://bugs.webkit.org/show_bug.cgi?id=232380 5 6 Reviewed by Darin Adler. 7 8 JavaScript URL result should be treated as UTF-8 bytes: 9 - https://github.com/whatwg/html/pull/6781 10 11 No new tests, rebaselined existing test. 12 13 * loader/DocumentWriter.cpp: 14 (WebCore::DocumentWriter::replaceDocumentWithResultOfExecutingJavascriptURL): 15 1 16 2021-10-27 Martin Robinson <mrobinson@webkit.org> 2 17 -
trunk/Source/WebCore/loader/DocumentLoader.cpp
r284857 r284934 1281 1281 } 1282 1282 1283 booluserChosen;1283 DocumentWriter::IsEncodingUserChosen userChosen; 1284 1284 String encoding; 1285 1285 if (overrideEncoding().isNull()) { 1286 userChosen = false;1286 userChosen = DocumentWriter::IsEncodingUserChosen::No; 1287 1287 encoding = response().textEncodingName(); 1288 1288 #if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML) … … 1291 1291 #endif 1292 1292 } else { 1293 userChosen = true;1293 userChosen = DocumentWriter::IsEncodingUserChosen::Yes; 1294 1294 encoding = overrideEncoding(); 1295 1295 } -
trunk/Source/WebCore/loader/DocumentWriter.cpp
r284093 r284934 78 78 begin(m_frame->document()->url(), true, ownerDocument); 79 79 80 setEncoding("UTF-8"_s, IsEncodingUserChosen::No); 81 80 82 // begin() might fire an unload event, which will result in a situation where no new document has been attached, 81 83 // and the old document has been detached. Therefore, bail out if no document is attached. … … 89 91 } 90 92 91 // FIXME: This should call DocumentParser::appendBytes instead of append92 // to support RawDataDocumentParsers.93 if (DocumentParser* parser = m_frame->document()->parser())94 parser->append(source.impl());93 if (DocumentParser* parser = m_frame->document()->parser()) { 94 auto utf8Source = source.utf8(); 95 parser->appendBytes(*this, reinterpret_cast<const uint8_t*>(utf8Source.data()), utf8Source.length()); 96 } 95 97 } 96 98 … … 307 309 } 308 310 309 void DocumentWriter::setEncoding(const String& name, bool userChosen)311 void DocumentWriter::setEncoding(const String& name, IsEncodingUserChosen isUserChosen) 310 312 { 311 313 m_encoding = name; 312 m_encodingWasChosenByUser = userChosen;314 m_encodingWasChosenByUser = isUserChosen == IsEncodingUserChosen::Yes; 313 315 } 314 316 -
trunk/Source/WebCore/loader/DocumentWriter.h
r278532 r284934 54 54 void setFrame(Frame&); 55 55 56 WEBCORE_EXPORT void setEncoding(const String& encoding, bool userChosen); 56 enum class IsEncodingUserChosen : bool { No, Yes }; 57 WEBCORE_EXPORT void setEncoding(const String& encoding, IsEncodingUserChosen); 57 58 58 59 const String& mimeType() const { return m_mimeType; }
Note: See TracChangeset
for help on using the changeset viewer.