Skip to content
Permalink
Browse files
Handling of text documents does not comply with modern HTML spec
https://bugs.webkit.org/show_bug.cgi?id=244950
<rdar://problem/99719728>

Reviewed by Chris Dumez.

The spec language in https://html.spec.whatwg.org/multipage/browsing-the-web.html#read-text, indicates that Text documents
must be in no-quirks mode: (7.11.4.3 Set document's mode to "no-quirks".)

This is in conflict with the source code in the TextDocument constructor:

  setCompatibilityMode(DocumentCompatibilityMode::QuirksMode);

This causes the following WPT failure:

wpt /html/browsers/browsing-the-web/read-text/load-text-plain.html

* LayoutTests/imported/w3c/web-platform-tests/html/browsers/browsing-the-web/read-text/load-text-plain-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_putall.tentative.any-expected.txt
* LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_putall.tentative.any.worker-expected.txt
* LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any-expected.txt
* LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.worker-expected.txt
* LayoutTests/platform/glib/fast/loader/text-document-wrapping-expected.txt
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/WebCryptoAPI/import_export/rsa_importKey.https.worker-expected.txt
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any-expected.txt
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/wasm/jsapi/global/value-set.any.worker-expected.txt
* LayoutTests/platform/gtk/fast/forms/targeted-frame-submission-expected.txt
* LayoutTests/platform/ios-wk2/fast/forms/targeted-frame-submission-expected.txt
* LayoutTests/platform/ios-wk2/fast/loader/text-document-wrapping-expected.txt
* LayoutTests/platform/ios/fast/forms/targeted-frame-submission-expected.txt
* LayoutTests/platform/ios/fast/loader/text-document-wrapping-expected.txt
* LayoutTests/platform/mac/fast/forms/targeted-frame-submission-expected.txt
* LayoutTests/platform/mac/fast/loader/text-document-wrapping-expected.txt
* LayoutTests/platform/mac/http/tests/misc/acid3-expected.txt
* LayoutTests/platform/win/fast/loader/text-document-wrapping-expected.txt
* LayoutTests/platform/wincairo/fast/loader/text-document-wrapping-expected.txt
* Source/WebCore/html/TextDocument.cpp:

Canonical link: https://commits.webkit.org/254389@main
  • Loading branch information
brentfulgham authored and Brent Fulgham committed Sep 12, 2022
1 parent db0b786 commit e30caa272fe6d8f18f34521fe30ef5c9d97125a8
Show file tree
Hide file tree
Showing 20 changed files with 57 additions and 57 deletions.
@@ -1,8 +1,8 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x579
layer at (0,0) size 800x41
RenderBlock {HTML} at (0,0) size 800x41
RenderBody {BODY} at (8,13) size 784x15
RenderBlock {PRE} at (0,0) size 784x15
RenderText {#text} at (0,0) size 328x15
text run at (0,0) width 328: "{\"error\": {\"code\": 404, \"message\": \"404\"}}"
@@ -1,8 +1,8 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x579
layer at (0,0) size 800x41
RenderBlock {HTML} at (0,0) size 800x41
RenderBody {BODY} at (8,13) size 784x15
RenderBlock {PRE} at (0,0) size 784x15
RenderText {#text} at (0,0) size 328x15
text run at (0,0) width 328: "{\"error\": {\"code\": 404, \"message\": \"404\"}}"
@@ -1,5 +1,5 @@

FAIL Checking document metadata for text file assert_equals: expected "CSS1Compat" but got "BackCompat"
PASS Checking document metadata for text file
PASS Checking DOM for text file
PASS Checking contents for text file

@@ -1,8 +1,8 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x579
layer at (0,0) size 800x41
RenderBlock {HTML} at (0,0) size 800x41
RenderBody {BODY} at (8,13) size 784x15
RenderBlock {PRE} at (0,0) size 784x15
RenderText {#text} at (0,0) size 328x15
text run at (0,0) width 328: "{\"error\": {\"code\": 404, \"message\": \"404\"}}"
@@ -1,8 +1,8 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x579
layer at (0,0) size 800x41
RenderBlock {HTML} at (0,0) size 800x41
RenderBody {BODY} at (8,13) size 784x15
RenderBlock {PRE} at (0,0) size 784x15
RenderText {#text} at (0,0) size 328x15
text run at (0,0) width 328: "{\"error\": {\"code\": 404, \"message\": \"404\"}}"
@@ -6,9 +6,9 @@ layer at (0,0) size 800x600
RenderFrame {FRAME} at (0,0) size 800x600
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x579
layer at (0,0) size 800x101
RenderBlock {HTML} at (0,0) size 800x101
RenderBody {BODY} at (8,13) size 784x75
RenderBlock {PRE} at (0,0) size 784x75
RenderText {#text} at (0,0) size 784x75
text run at (0,0) width 416: "This line should wrap with no horizontal scroll bar:"
@@ -1,8 +1,8 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x579
layer at (0,0) size 800x41
RenderBlock {HTML} at (0,0) size 800x41
RenderBody {BODY} at (8,13) size 784x15
RenderBlock {PRE} at (0,0) size 784x15
RenderText {#text} at (0,0) size 336x15
text run at (0,0) width 336: "{\"error\": {\"code\": 404, \"message\": \"404\"}}"
@@ -1,8 +1,8 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x579
layer at (0,0) size 800x41
RenderBlock {HTML} at (0,0) size 800x41
RenderBody {BODY} at (8,13) size 784x15
RenderBlock {PRE} at (0,0) size 784x15
RenderText {#text} at (0,0) size 336x15
text run at (0,0) width 336: "{\"error\": {\"code\": 404, \"message\": \"404\"}}"
@@ -1,8 +1,8 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x579
layer at (0,0) size 800x41
RenderBlock {HTML} at (0,0) size 800x41
RenderBody {BODY} at (8,13) size 784x15
RenderBlock {PRE} at (0,0) size 784x15
RenderText {#text} at (0,0) size 336x15
text run at (0,0) width 336: "{\"error\": {\"code\": 404, \"message\": \"404\"}}"
@@ -18,9 +18,9 @@ layer at (0,0) size 800x600
RenderIFrame {IFRAME} at (0,0) size 304x154 [border: (2px inset #000000)]
layer at (0,0) size 300x150
RenderView at (0,0) size 300x150
layer at (0,0) size 300x150
RenderBlock {HTML} at (0,0) size 300x150
RenderBody {BODY} at (8,8) size 284x129
layer at (0,0) size 300x41
RenderBlock {HTML} at (0,0) size 300x41
RenderBody {BODY} at (8,13) size 284x15
RenderBlock {PRE} at (0,0) size 284x15
RenderText {#text} at (0,0) size 56x15
text run at (0,0) width 56: "SUCCESS"
@@ -18,9 +18,9 @@ layer at (0,0) size 800x600
RenderIFrame {IFRAME} at (0,0) size 304x154 [border: (2px inset #000000)]
layer at (0,0) size 300x150
RenderView at (0,0) size 300x150
layer at (0,0) size 300x150
RenderBlock {HTML} at (0,0) size 300x150
RenderBody {BODY} at (8,8) size 284x129
layer at (0,0) size 300x40
RenderBlock {HTML} at (0,0) size 300x40
RenderBody {BODY} at (8,13) size 284x14
RenderBlock {PRE} at (0,0) size 284x14
RenderText {#text} at (0,0) size 55x14
text run at (0,0) width 55: "SUCCESS"
@@ -6,9 +6,9 @@ layer at (0,0) size 800x600
RenderFrame {FRAME} at (0,0) size 800x600
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x579
layer at (0,0) size 800x96
RenderBlock {HTML} at (0,0) size 800x96
RenderBody {BODY} at (8,13) size 784x70
RenderBlock {PRE} at (0,0) size 784x70
RenderText {#text} at (0,0) size 781x70
text run at (0,0) width 406: "This line should wrap with no horizontal scroll bar:"
@@ -18,9 +18,9 @@ layer at (0,0) size 800x600
RenderIFrame {IFRAME} at (0,0) size 304x154 [border: (2px inset #000000)]
layer at (0,0) size 300x150
RenderView at (0,0) size 300x150
layer at (0,0) size 300x150
RenderBlock {HTML} at (0,0) size 300x150
RenderBody {BODY} at (8,8) size 284x129
layer at (0,0) size 300x40
RenderBlock {HTML} at (0,0) size 300x40
RenderBody {BODY} at (8,13) size 284x14
RenderBlock {PRE} at (0,0) size 284x14
RenderText {#text} at (0,0) size 55x14
text run at (0,0) width 55: "SUCCESS"
@@ -6,9 +6,9 @@ layer at (0,0) size 800x600
RenderFrame {FRAME} at (0,0) size 800x600
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x579
layer at (0,0) size 800x101
RenderBlock {HTML} at (0,0) size 800x101
RenderBody {BODY} at (8,13) size 784x70
RenderBlock {PRE} at (0,0) size 784x70
RenderText {#text} at (0,0) size 781x70
text run at (0,0) width 406: "This line should wrap with no horizontal scroll bar:"
@@ -18,9 +18,9 @@ layer at (0,0) size 800x600
RenderIFrame {IFRAME} at (0,0) size 304x154 [border: (2px inset #000000)]
layer at (0,0) size 300x150
RenderView at (0,0) size 300x150
layer at (0,0) size 300x150
RenderBlock {HTML} at (0,0) size 300x150
RenderBody {BODY} at (8,8) size 284x129
layer at (0,0) size 300x41
RenderBlock {HTML} at (0,0) size 300x41
RenderBody {BODY} at (8,13) size 284x15
RenderBlock {PRE} at (0,0) size 284x15
RenderText {#text} at (0,0) size 55x15
text run at (0,0) width 55: "SUCCESS"
@@ -6,9 +6,9 @@ layer at (0,0) size 800x600
RenderFrame {FRAME} at (0,0) size 800x600
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x579
layer at (0,0) size 800x101
RenderBlock {HTML} at (0,0) size 800x101
RenderBody {BODY} at (8,13) size 784x75
RenderBlock {PRE} at (0,0) size 784x75
RenderText {#text} at (0,0) size 781x75
text run at (0,0) width 406: "This line should wrap with no horizontal scroll bar:"
@@ -38,11 +38,11 @@ layer at (20,20) size 644x433
RenderBody {BODY} at (0,0) size 0x1
RenderImage {IMG} at (0,0) size 1x1
RenderIFrame {IFRAME} at (0,0) size 0x0
layer at (0,0) size 16x2166
layer at (0,0) size 16x2171
RenderView at (0,0) size 0x0
layer at (0,0) size 0x2166
RenderBlock {HTML} at (0,0) size 0x2166
RenderBody {BODY} at (8,8) size 0x2145
layer at (0,0) size 0x2171
RenderBlock {HTML} at (0,0) size 0x2171
RenderBody {BODY} at (8,13) size 0x2145
RenderBlock {PRE} at (0,0) size 0x2145
RenderText {#text} at (0,0) size 8x2145
text run at (0,0) width 8: "<"
@@ -6,9 +6,9 @@ layer at (0,0) size 800x600
RenderFrame {FRAME} at (0,0) size 800x600
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x579
layer at (0,0) size 800x101
RenderBlock {HTML} at (0,0) size 800x101
RenderBody {BODY} at (8,13) size 784x75
RenderBlock {PRE} at (0,0) size 784x75
RenderText {#text} at (0,0) size 784x75
text run at (0,0) width 416: "This line should wrap with no horizontal scroll bar:"
@@ -6,9 +6,9 @@ layer at (0,0) size 800x600
RenderFrame {FRAME} at (0,0) size 800x600
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x579
layer at (0,0) size 800x101
RenderBlock {HTML} at (0,0) size 800x101
RenderBody {BODY} at (8,13) size 784x80
RenderBlock {PRE} at (0,0) size 784x80
RenderText {#text} at (0,0) size 784x80
text run at (0,0) width 416: "This line should wrap with no horizontal scroll bar:"
@@ -35,7 +35,7 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(TextDocument);
TextDocument::TextDocument(Frame* frame, const Settings& settings, const URL& url, ScriptExecutionContextIdentifier identifier)
: HTMLDocument(frame, settings, url, identifier, { DocumentClass::Text })
{
setCompatibilityMode(DocumentCompatibilityMode::QuirksMode);
setCompatibilityMode(DocumentCompatibilityMode::NoQuirksMode);
lockCompatibilityMode();
}

0 comments on commit e30caa2

Please sign in to comment.