script_thread: HTML parser doesn't set relevant option#36622
Conversation
|
Hello @jdm I have been trying to figure out #35478 but i don't really know what exactly you mean #35478 (comment) and how do go about it. see servo/components/script/dom/document.rs Line 363 in 436dee8 servo/components/script/dom/document.rs Line 915 in 436dee8 |
components/script/script_thread.rs
Outdated
| document.set_referrer_policy(referrer_policy); | ||
| document.scripting_enabled.set(true); | ||
| if final_url.as_str() == "about:srcdoc" { | ||
| document.iframe_src.set(origin); |
There was a problem hiding this comment.
i don't know what to do here but there is Setsrcdoc
|
We need to set the options of the HTML parser in , which means making sure we have the information we need in . We shouldn't need to set any properties of the document. |
177f0ae to
7371cac
Compare
|
the quirk mode expected by servo/components/script/dom/document.rs Line 66 in 436dee8 |
Yes, you will need to match on the document's value and provide the equivalent one from html5ever. |
7371cac to
f71d930
Compare
f71d930 to
be01ba6
Compare
|
🔨 Triggering try run (#14584548533) for Linux (WPT) |
|
Test results for linux-wpt from try job (#14584548533): Flaky unexpected result (17)
Stable unexpected results that are known to be intermittent (20)
|
|
✨ Try run (#14584548533) succeeded. |
|
hello @jdm should i mark this PR as ready for review, OR what's next should I do |
|
Yes, this no longer needs to be a draft! |
|
Testing the impact of these changes is complicated—the only impact I can see from the specification is whether the parsed document will use quirks mode or not in various situations, and so any test has to set up the right preconditions, start a new parser, then verify the quirks mode status by checking if some particular quirk is applied. I don't think that effort is worthwhile, so we can go ahead and merge this once the |
be01ba6 to
26a19eb
Compare
Signed-off-by: Emmanuel Elom <elomemmanuel007@gmail.com>
26a19eb to
ed8e4b1
Compare
This patch ensures that the Servo HTML parser uses the appropriate `TreeBuilderOpts` settings as specified by the HTML specification. Changes: - **iframe_srcdoc:** Detect if the parsed document's URL scheme is `about:srcdoc`, and set the parser’s iframe_srcdoc option accordingly. - **quirks_mode:** Use the associated Document's quirks mode to set the parser’s quirks mode flag, improving fragment parsing behavior. - **scripting_enabled:** Add a `scripting_enabled` method to Document, based on whether it has a browsing context, and set this flag for the parser. These updates align Servo's parsing behavior more closely with the specification: https://html.spec.whatwg.org/multipage/parsing.html#the-initial-insertion-mode --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #35478 <!-- Either: --> - [ ] There are tests for these changes Signed-off-by: Emmanuel Elom <elomemmanuel007@gmail.com>
This patch ensures that the Servo HTML parser uses the appropriate
TreeBuilderOptssettingsas specified by the HTML specification.
Changes:
about:srcdoc, and set the parser’s iframe_srcdoc option accordingly.scripting_enabledmethod to Document, based on whether it has a browsing context, and set this flag for the parser.These updates align Servo's parsing behavior more closely with the specification:
https://html.spec.whatwg.org/multipage/parsing.html#the-initial-insertion-mode
./mach build -ddoes not report any errors./mach test-tidydoes not report any errors