It is possible, although unlikely. The bug has a 23 stars (meaning people are running into it) and this fix makes us behave the same way as Webkit and Gecko. If someone wants to make text inside a shadow DOM not selectable, they can still set the CSS user-select property to none. It would be bad practice for them to depend on the (erroneous) delegatesFocus behavior. As we rollout this fix, I will pay attention to potential regression reports.
On Tuesday, December 3, 2024 at 10:09:39 AM UTC-5 Stephen Chenney wrote: > I agree this should be fixed. Thanks. > > I';m wondering if there is any situation in which developers might be > relying on the existing behavior? That is, using this "bug" to render > content not-selectable. > > Stephen. > > On Mon, Nov 25, 2024 at 2:01 PM Di Zhang <dizha...@chromium.org> wrote: > >> Contact emailsdizha...@chromium.org >> >> Specificationhttps://dom.spec.whatwg.org/#shadowroot-delegates-focus >> >> Summary >> >> A shadow host with delegatesFocus set to true will delegate its focus to >> its first focusable child. On a mouse click event, the child will receive >> focus and the event will be marked as handled. This is a problem because >> the steps to handle text selection afterward are not run and the selection >> does not recognize the focused element as part of the selection. We fix >> this by continuing event handling even after an element was delegate >> focused and update how selection recognizes having focus in a shadow tree. >> >> >> Blink componentBlink>DOM>ShadowDOM >> <https://bugs.chromium.org/p/chromium/issues/list?q=component:Blink%3EDOM%3EShadowDOM> >> >> TAG reviewNone >> >> TAG review statusNot applicable >> >> Risks >> >> >> Interoperability and Compatibility >> >> None >> >> >> *Gecko*: Shipped/Shipping Can select text in shadow host with >> delegatesFocus = true. >> >> *WebKit*: Shipped/Shipping Can select text in shadow host with >> delegatesFocus = true. >> >> *Web developers*: Positive [1] >> https://stackoverflow.com/q/60260078/864715 [2] >> https://stackoverflow.com/q/62766250/864715 >> >> *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 >> >> >> Will this feature be supported on all six Blink platforms (Windows, Mac, >> Linux, ChromeOS, Android, and Android WebView)?No >> >> Is this feature fully tested by web-platform-tests >> <https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md> >> ?Yes >> >> >> https://wpt.fyi/results/shadow-dom/focus/text-selection-with-delegatesFocus.html?label=experimental&label=master&aligned >> >> >> Flag name on about://flagsSelectionOnShadowDOMWithDelegatesFocus >> >> Finch feature nameNone >> >> Non-finch justificationNone >> >> Requires code in //chrome?False >> >> Tracking bughttps://issues.chromium.org/issues/40622041 >> >> Sample links >> http://lopsided-motion.glitch.me/text-select-bug.html >> https://codepen.io/JRJurman/pen/gOqvxXz >> >> Estimated milestones >> Shipping on desktop 133 >> Shipping on Android 133 >> Shipping on WebView 133 >> >> Anticipated spec changes >> >> Open questions about a feature may be a source of future web compat or >> interop issues. Please list open issues (e.g. links to known github issues >> in the project for the feature specification) whose resolution may >> introduce web compat/interop risk (e.g., changing to naming or structure of >> the API in a non-backward-compatible way). >> None >> >> Link to entry on the Chrome Platform Status >> https://chromestatus.com/feature/5134341540413440?gate=5134678561128448 >> >> 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 visit >> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CA%2BSS7eAVZOnENNhVUMEUU%2Bh2qEp8ZE13cTjnKR8wRLPstgxHaQ%40mail.gmail.com >> >> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CA%2BSS7eAVZOnENNhVUMEUU%2Bh2qEp8ZE13cTjnKR8wRLPstgxHaQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- 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 visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/2d40a01a-1b9c-46f8-921c-7f44f694cb6fn%40chromium.org.