Fwd: Re: /deep/ combinator

-------- Forwarded Message --------
Subject: Re: /deep/ combinator
Date: Thu, 11 Jan 2018 21:40:59 +0100
From: Bert Bos <bert@w3.org>
To: Shadi Abou-Zahra <shadi@w3.org>

Hello Shadi,

> Ref: https://www.w3.org/TR/css-scoping-1/#deep-combinator
> 
> Are you aware of why this feature was deprecated from CSS? Some people
> in the accessibility community want to use this mas pseudo pointers
> to elements in a shadow DOM or iFrame, for conformance testing
> purposes. Are there any issues you foresee with using that format
> (even if it is not implemented by browsers, just as an expression
> format)?

The idea was to replace it by ">>>", but Tab Atkins presented something 
he's been working on that seems to work better:

     https://drafts.csswg.org/css-shadow-parts/index.html

It is not an official CSS draft yet, but the WG seemed to like it. 
Basically, Tab's argument is that the outer document (and the style 
sheet of the outer document) should not know anything about the internal 
structure of the shadow tree. Indeed, you should not think of it as a 
tree at all. It's a black box. It may or may not have have any stylable 
parts.

If the shadow tree has any parts that can be styled, it exports an 
unordered list of identifiers, each of which represents one or more 
stylable elements. The outer document's style sheet can style those 
elements and only those. Thus you can say, in Tab's proposal:

     button::part(flag) {color: red}

to make the element called "flag" inside the shadow tree of the button 
red. You don't know where in the shadow tree that element is. Indeed, 
you don't know if there is one element or several.



Bert
-- 
   Bert Bos                                ( W 3 C ) http://www.w3.org/
   http://www.w3.org/people/bos                               W3C/ERCIM
   bert@w3.org                             2004 Rt des Lucioles / BP 93
   +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France


-- 
Shadi Abou-Zahra - http://www.w3.org/People/shadi/
Accessibility Strategy and Technology Specialist
Web Accessibility Initiative (WAI)
World Wide Web Consortium (W3C)

Received on Friday, 12 January 2018 12:33:30 UTC