Contact emails
hay...@chromium.org, ta...@chromium.org (kenji...@chromium.org)
Spec
http://dev.w3.org/csswg/css-cascade/#all-shorthand
Summary
The all property is a shorthand that resets all CSS properties except direction and unicode-bidi. It only accepts the CSS-wide keywords.
Motivation
resetStyleInheritance has been removed from Shadow DOM. Folks have taken notice and are asking for the CSS all shorthand as an alternative.
Compatibility Risk
I believe that the risk is fairly low:
The CSS Level 3 specification is a candidate recommendation.
Firefox is shipping an implementation of the all shorthand.
The API surface is small.
Firefox: Shipped (27)
Internet Explorer: No public signals (*)
Safari: No public signals (*)
Web developers: Positive
*: didn’t find anything major from a quick search => defaulting to “no signals”.
OWP launch tracking bug
https://code.google.com/p/chromium/issues/detail?id=172051
Ongoing technical constraints
None.
Will this feature be supported on all five Blink platforms (Windows, Mac, Linux, Chrome OS and Android)?
Yes.
OWP launch tracking bug?
None has been filed.
Entry in Chromium Dashboard
http://www.chromestatus.com/admin/features/edit/6178222542684160
Requesting approval to ship?
Yes.
On May 12, 2014, at 11:03 AM, 'Adam Barth' via blink-dev <blin...@chromium.org> wrote:
> Pardon my ignorance, but how would this constrain our ability to change the data structure we use for RenderStyle. For example, I can imagine that setting "all: inherit" would require that we reify a RenderStyle that contained every possible property, which could make it difficult to switch to a RenderStyle data structure that optimizes for the common case of not every property existing on most RenderStyles.
>
> Relatedly, are there use cases for "all" besides "all: initial" ? It's unclear to me why it would be useful to set "all: inherit"…
For scripting 'all: inherit' can be useful. Consider that one encapsulate content into a new wrapper element but wants the content to be consistent to its previous behavior — including inheritance from parents.
Sounds obscure, but there are use cases like embedding HTML text into a new created <svg> element for styling purposes with fill and stroke. One wants the text within the <svg> element to have the same font and text settings as it had before wrapping.
Today, users work around it by setting all necessary properties manually to inherit. Since new properties appear in the future, ‘all: inherit’ is more future proof and you would just set it on <svg>.
resetStyleInheritance has been removed from Shadow DOM. Folks have taken notice and are asking for the CSS all shorthand as an alternative.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
Doesn't it cause every sub-object of RenderStyle to become reified? In the future, we might want to change RenderStyle to optimize for the normal case of most RenderStyles not having many non-initial property values. If we do that, reifying every possible property in RenderStyle could become prohibitively expensive.
I'm interested in the new RenderStyle. I would like to know whether "all" blocks implementing the new RenderStyle or not.2014-05-12 18:43 GMT+02:00 Adam Barth <aba...@google.com>:Doesn't it cause every sub-object of RenderStyle to become reified? In the future, we might want to change RenderStyle to optimize for the normal case of most RenderStyles not having many non-initial property values. If we do that, reifying every possible property in RenderStyle could become prohibitively expensive.I would like to know how the new RenderStyle treats the following normal "initial"s:color: initial;background-color: initial;...border-left-width: initial;...I think, we still need to support the case that we have many properties with initial values."all: initial" is converted into such many properties with initial values in CSS property parser.So from the viewpoint of StyleResolver, StyleBuilder, and so on, no "all" is found. Just many properties with initial value are found.
On Mon, May 12, 2014 at 2:08 PM, Takashi Sakamoto <ta...@google.com> wrote:
I'm interested in the new RenderStyle. I would like to know whether "all" blocks implementing the new RenderStyle or not.2014-05-12 18:43 GMT+02:00 Adam Barth <aba...@google.com>:Doesn't it cause every sub-object of RenderStyle to become reified? In the future, we might want to change RenderStyle to optimize for the normal case of most RenderStyles not having many non-initial property values. If we do that, reifying every possible property in RenderStyle could become prohibitively expensive.I would like to know how the new RenderStyle treats the following normal "initial"s:color: initial;background-color: initial;...border-left-width: initial;...I think, we still need to support the case that we have many properties with initial values."all: initial" is converted into such many properties with initial values in CSS property parser.So from the viewpoint of StyleResolver, StyleBuilder, and so on, no "all" is found. Just many properties with initial value are found.I don't think we want that, it means that the "all" property is super expensive. Normally we go through applyMatchedProperties with only a few properties for each element. A custom element that uses "all" would go through it for hundreds of properties. It also means the StylePropertySet for that rule will be massive.
I think we need to figure out how to implement this in a way that does't involve O(N) space and property application where N is the ever increasing number of CSS properties in the whole platform.
I don't think we should ship this until we figure out how this can be implemented in constant time. If it can't, we need to rethink the feature.
On Tue, May 13, 2014 at 10:36 AM, 'Takashi Sakamoto' via blink-devI strongly disagree. The fact that 'all' is a shorthand has nothing
<blin...@chromium.org> wrote:
> However, "all" is just shorthand. If we need special code for "all", I
> think, the design is not good.
to do with the fact that it might require special code to handle -
it's a very special kind of shorthand which expands out to 400+
properties, whereas no other shorthand expands to more than a dozen or
so properties. While saying "it's a shorthand!" is very simple
conceptually and easy for authors, it's violates internal assumptions
sufficiently that I think it's rather normal for it to not be handled
by the existing shorthand code.
No, it's useful any time you're doing an *independent* custom element,
which is supposed to have its own style or "look" rather than
integrating with the surrounding page, such as the Facebook Like
button.
> - "all" is proposed to replace "resetStyleInheritance".Yes.
> - So custom elements rarely use "all".
>
> If we have no "all", instead, web developers need to write many properties.
> If they write, StylePropertySet will be massive. So we have the same
> problem, I think.
On 5/20/14, 2:27 PM, Eric Seidel wrote:
Would it make sense to have a stylesheet which set * { all: initial;
}? Presumably then the 100 stylesheets earlier in the cascade order
are then completely wasted work
[...]
No tricks. We just expand "all: initial" as if it were an actual shorthand by looping over every single longhand property except 'direction' and 'unicode-bidi' and setting them all to "initial". If this starts getting used enough that it matters, we'll think about something more efficient, but if you just have a few uses per page it's not worth worrying about.
It might be useful to the discussion to understand what tricks mozilla
employed to implement this.