Bug 244950 - Handling of text documents does not comply with modern HTML spec
Summary: Handling of text documents does not comply with modern HTML spec
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks: 228832
  Show dependency treegraph
 
Reported: 2022-09-08 16:12 PDT by Brent Fulgham
Modified: 2022-09-12 11:46 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2022-09-08 16:12:16 PDT
Given the spec language in https://html.spec.whatwg.org/multipage/browsing-the-web.html#read-text, the setCompatibilityMode code here seems out-of-spec to me:
(7.11.4.3 Set document's mode to "no-quirks".)

From: Source/WebCore/html/parser/TextDocument.cpp:

TextDocument::TextDocument(Frame* frame, const Settings& settings, const URL& url, ScriptExecutionContextIdentifier identifier)
  : HTMLDocument(frame, settings, url, identifier, { DocumentClass::Text })
{
  setCompatibilityMode(DocumentCompatibilityMode::QuirksMode);
  lockCompatibilityMode();
}

This causes the following WPT failure:

wpt /html/browsers/browsing-the-web/read-text/load-text-plain.html
Comment 1 Radar WebKit Bug Importer 2022-09-08 16:12:37 PDT
<rdar://problem/99719728>
Comment 2 Brent Fulgham 2022-09-08 16:20:47 PDT
Pull request: https://github.com/WebKit/WebKit/pull/4143
Comment 3 Brent Fulgham 2022-09-08 16:26:47 PDT
It looks like Chris started on a larger version of this change here: Bug 228832.
Comment 4 Brent Fulgham 2022-09-09 14:14:35 PDT
Pull request: https://github.com/Webkit/WebKit/pull/4143
Comment 5 EWS 2022-09-12 09:55:45 PDT
Committed 254389@main (e30caa272fe6): <https://commits.webkit.org/254389@main>

Reviewed commits have been landed. Closing PR #4143 and removing active labels.