Re: [csswg-drafts] [css-cascade][css-selectors][css-pseudo-elements] How does 'inherit' keyword behave in a child of ::first-line?

> All values of the span inherit from the div element (try `alert(getComputedStyle(document.querySelector('span')).color))`.

Yes, I noticed that. It must be like this because the span might generate multiple boxes, some not in the first line. So in general the span inherits from the div, but the part of the span in the first line inherits from `div::first-line`.

> Chrome behavior is almost certainly a bug. What would happen if the span was both on the first and second line due to wrapping? Chrome uses two different sets of values for the same span, which doesn't look the spirit of the css-cascade spec to me

Well, Firefox and Edge do the same for `color`.

![img](https://cloud.githubusercontent.com/assets/7477678/24069147/1cb02334-0ba1-11e7-8eb5-82bfc4daf971.png)

And it's OK, because being able to do this is the only point in having `::first-line` pseudo-elements, isn't it? The problem is that Chrome does it for `border`, and Firefox and Edge don't do it for `background`.

If it's not supposed to be like this, then clarify the spec.

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1097#issuecomment-287517504 using your GitHub account

Received on Saturday, 18 March 2017 05:16:32 UTC