Contact emailsmas...@chromium.org ExplainerNone
Specificationhttps://github.com/whatwg/html/pull/10139 Summary The includeShadowRoots argument was a never-standardized argument to the DOMParser.parseFromString() function, which was there to allow imperative parsing of HTML content that contains declarative shadow DOM. This was shipped in M90 [1] as part of the initial shipment of declarative shadow DOM. Since the standards discussion rematerialized in 2023, the shape of DSD APIs changed, including this feature for imperative parsing. (See [2] for more context on the standards situation and recent changes, and see [3] and [4] for other related deprecations.) Now that a standardized version of this API, in the form of setHTMLUnsafe() and parseHTMLUnsafe() will ship in M124 ([5]), the non-standard includeShadowRoots argument needs to be deprecated and removed. All usage should shift accordingly: Instead of: (new DOMParser()).parseFromString(html,'text/html',{includeShadowRoots: true}); this can be used instead: document.parseHTMLUnsafe(html); [1] https://chromestatus.com/feature/5191745052606464 [2] https://chromestatus.com/feature/5161240576393216 [3] https://chromestatus.com/feature/5081733588582400 [4] https://chromestatus.com/feature/6239658726391808 [5] https://chromestatus.com/feature/6560361081995264 Blink componentBlink>DOM>ShadowDOM <https://bugs.chromium.org/p/chromium/issues/list?q=component:Blink%3EDOM%3EShadowDOM> Motivation Now that there is a standardized version of this API, it makes sense to remove the non-standard, Chrome-only version of the API. Initial public proposalNone TAG reviewNone TAG review statusNot applicable Risks Interoperability and Compatibility Because this is a removal of an API, there is some compat risk if sites use the API without feature detection. Additionally, feature detection is a bit difficult for this feature directly, and typical usage would instead feature-detect the old `shadowroot` attribute. In that case, there should be no breakage, since that attribute has since been removed. The use counter [1] for this feature has unfortunately had a recent spike in usage, peaking at just over 0.01% of page loads as of March, 2024. However, I analyzed 8 of the top sites, and 8 of 8 are due to the exact same code snippet, from AstroJS/Lit [2]. And that code amounts to feature detection, which as-written will properly detect the lack of `includeShadowRoots` and fall back to other behavior. This, plus the lack of support in other browsers, makes me less concerned about the compat risk here. [1] https://chromestatus.com/metrics/feature/timeline/popularity/4455 [2] https://github.com/withastro/astro/blob/main/packages/integrations/lit/client-shim.js *Gecko*: No signal *WebKit*: No signal *Web developers*: No signals *Other signals*: WebView application risks Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications? None Debuggability None Is this feature fully tested by web-platform-tests <https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md> ?Yes Tested via this WPT: https://wpt.fyi/results/shadow-dom/declarative/declarative-shadow-dom-opt-in.html which fails because `includeShadowRoots` is non-standard. This is the only test failing within the Interop2024 Declarative Shadow DOM section, due to this deprecation not being completed yet. Flag name on chrome://flags Finch feature nameNone Non-finch justificationNone Requires code in //chrome?False Estimated milestones Shipping on desktop 129 DevTrial on desktop 125 Shipping on Android 129 DevTrial on Android 125 Shipping on WebView 129 Link to entry on the Chrome Platform Status https://chromestatus.com/feature/5116094370283520 This intent message was generated by Chrome Platform Status <https://chromestatus.com/>. -- You received this message because you are subscribed to the Google Groups "blink-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscr...@chromium.org. To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM%3DNeDhoX1h-FiR6p9tjuOCxhb1iXVciuQ%2BH4%3DHnzdb9M4rGKQ%40mail.gmail.com.