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
Now that there is a standardized version of this API, it makes sense to remove the non-standard, Chrome-only version of the API.
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
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
None
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.
Shipping on desktop | 129 |
DevTrial on desktop | 125 |
Shipping on Android | 129 |
DevTrial on Android | 125 |
Shipping on WebView | 129 |
Hi Mason,
Would you mind requesting reviews for the various shipping gates (privacy, security, enterprise, etc.) in your chromestatus entry?
--
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+...@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.
Hi Mason,
Would you mind requesting reviews for the various shipping gates (privacy, security, enterprise, etc.) in your chromestatus entry?
I don't think we, in general, want open ended deprecations. Nowadays they are a bit more hidden in DevTools, but they used to be a source of console spam and cause warning fatigue. Many also don't react to deprecations unless there is some kind of timeline so I really prefer there to be a set point in the future where we plan to remove something.
I will also admit to being a bit mislead by the way chromestatus generates mail titles, thinking you had already planned for a removal.
/Daniel
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM%3DNeDjAZX70dA6rRjASo%3D70sPstaGn4WJEyMrQud0PdFG8Gug%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/66900d83-e291-4a49-a132-aa6fbbb5b04b%40gmail.com.
On 3/19/24 6:51 PM, Mason Freed wrote:
On Tue, Mar 19, 2024 at 1:44 PM Mike Taylor <mike...@chromium.org> wrote:
Hi Mason,
Would you mind requesting reviews for the various shipping gates (privacy, security, enterprise, etc.) in your chromestatus entry?
Definitely! But I only need to do that before I ship this, right? I.e. not required yet, while I’m just deprecating but not yet removing the feature?
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/ed23f647-4779-4a1a-a7d9-5a6447ae099d%40chromium.org.
LGTM1 to remove without deprecation
I looked through all 24 sites listed in https://chromestatus.com/metrics/feature/timeline/popularity/4455. 23 of them are the code from client-shim.js minified in various ways, and one site no longer has includeShadowRoots.
(resending to list)
LGTM2 to go directly to removal (with a flag of course). Also,
keep an eye on enterprise feedback since they are a blind area.
I took a look at code in github, and there was mostly just documentation, including the Portuguese chrome.com, and I also saw a page from someone named mfreednumber. Hmm.
/Daniel
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAARdPYeXL6xj0oUcAyCaGzgcW%2Btkg%3DGR2i7tMr%3Duxw%2Be6bMLqQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/a1dbd108-c4fc-4d61-b038-4e1b32ce99d2%40gmail.com.