Intent to Ship: Spec compliant specificity for :host, :host-context, and ::slotted for Shadow DOM v1.

Visto 80 veces
Saltar al primer mensaje no leído

Rune Lillesveen

no leída,
5 oct 2018, 3:51:115/10/18
a blink-dev
Resolved with subsequent spec edits in https://github.com/w3c/csswg-drafts/issues/1915

Summary

Change the specificity of :host(), :host-context(), and ::slotted() to match the specification and other implementations for Shadow DOM v1.


We currently do not count the :host/:host-context pseudo class as part of specificity, but we including the specificity of its arguments. The change is adding pseudo class specificity for :host.

We currently do not count the arguments to ::slotted() as part of specificity. The change is to add the specificity of ::slotted() arguments.


So, for a div with #id, the first will start applying after this change:


::slotted(#id) { color: green }

::slotted(div) { color: red }


Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes.


Risks

Interoperability and Compatibility

Shipping this will ensure interoperability between browsers since Safari and Firefox has, or is about to ship this in their stable releases (see wpt.fyi links below) which means it's a risk not shipping it.


Compatibility with sites relying on this bug can be an issue. We tried landing this for :host/:host-context in Shadow DOM v0 which broke Polymer 1.0 components in WebUI. The version of WebUI using Shadow DOM v1 does not have the same issues when testing for what was failing with v0, so shipping this for Shadow DOM v1 looks OK for WebUI. The proposal is to land this for Shadow DOM v1 only (::slotted is just in v1 anyway).


A closer look at what failed in WebUI for v0 shows that it relies on a bug in the cascading order for v0 in Blink where we end up comparing specificity of selectors from two different shadow trees. That can not happen in Shadow DOM v1.


If there is existing content affected by this change, it would have already been discovered and worked around when tested in Safari. This is confirmed by the Polymer team. The Polymer team could not come up with cases where they knew this could be an issue. There is a risk for Chrome-only content.


https://wpt.fyi/results/css/css-scoping/host-specificity-002.html?label=experimental

https://wpt.fyi/results/css/css-scoping/host-specificity-002.html

https://wpt.fyi/results/css/css-scoping/slotted-specificity.html?label=experimental

https://wpt.fyi/results/css/css-scoping/slotted-specificity.html


Edge: Does not ship Shadow DOM at all

Firefox: Firefox 63

Safari: Shipped


Is this feature fully tested by web-platform-tests? Link to test suite results from wpt.fyi.

https://wpt.fyi/results/css/css-scoping?label=experimental


In particular the tests mentioned in the interop section.



Entry on the feature dashboard

This is a bug fix for an existing feature which does not have an entry.


Philip Jägenstedt

no leída,
5 oct 2018, 4:36:575/10/18
a Rune Lillesveen,blink-dev
LGTM1

Thank you for making sure this is well tested, great to see Firefox and Safari already passing.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACuPfeSE05kYgrPELB0CqEb1fwoQd0aDVHhjj_T5a8sK4ziihw%40mail.gmail.com.

Hayato Ito

no leída,
5 oct 2018, 4:39:485/10/18
a Rune Lillesveen,blink-dev
Non-owner LGTM.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACuPfeSE05kYgrPELB0CqEb1fwoQd0aDVHhjj_T5a8sK4ziihw%40mail.gmail.com.


--
Hayato

Daniel Bratell

no leída,
5 oct 2018, 12:56:025/10/18
a Rune Lillesveen,Philip Jägenstedt,blink-dev
LGTM2

Good analysis. 

chromestatus also acts as a source for chromium beta blog posts about changes to the web platform so that could be a reason for giving this an entry. Your call.

/Daniel
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/CAARdPYcmDOUxj4gDmX6pM08-D4V3%2B6uRbMpHWcAVjvr5mZ9z0w%40mail.gmail.com.



--
/* Opera Software, Linköping, Sweden: CEST (UTC+2) */

Chris Harrelson

no leída,
5 oct 2018, 13:04:085/10/18
a Daniel Bratell,Rune Lillesveen,Philip Jägenstedt,blink-dev
LGTM3

Please add an entry to the chromestatus dashboard, so that developers can more easily find answers to questions about this change.

Rune Lillesveen

no leída,
10 oct 2018, 9:40:2110/10/18
a Chris Harrelson,Daniel Bratell,Philip Jägenstedt,blink-dev
On Fri, Oct 5, 2018 at 7:04 PM Chris Harrelson <chri...@chromium.org> wrote:
LGTM3

Please add an entry to the chromestatus dashboard, so that developers can more easily find answers to questions about this change.

Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos