-
Notifications
You must be signed in to change notification settings - Fork 715
[css-tables] Spec should probably be clearer about how, and whether, inheritance happens for table anonymous boxes #1059
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Good point. I would assume so, like all generated content they get their style from their parent element. I didn't write a test case though so I don't know how interoperable that is. |
Fwiw, in Gecko's implementation they get it from their parent box, which may have the same effect. I've been trying to figure out whether this is even observable for row-groups, rows, columns, and column-groups. It's definitely observable for cells and tables. |
I am not sure we need any spec text though. CSS Cascade mentions that pseudo-elements inherit their style based on the fictional markup representation where they would be actual elements. The table spec defines that sequence via the fixup rules so the inheritance of properties shouldn't need any more clarification. I can add some more text if people still feel it is a good idea but adding text is like adding code, it create maintenance burden. Is i worth it? |
The real question is what you need to do for elements. What do we do for inheritance of properties like "border" on the span if it had "border:inherit":
Depending on what we do, this might or might not need some clarification as it overrules what css-cascade says. I'll write some tests to be sure what each browser does. |
https://jsfiddle.net/1wLo3zo7/ If you can think of something, let me know. I wondered if the new currentColor behavior might do something but since color inherits I don't think so. |
Yes, but various anon boxes are not pseudo-elements. (And note that pseudo-elements may have style but no box, even; they're just a totally distinct concept.)
There is no "generated content" here. In any case, this part is well-specified: inheritance happens on the element tree, and anon boxes do not contribute to that tree in any way. So they don't affect inheritance of elements. I think we all agree on the behavior. And that it's not observable whether you inherit from your "parent" or the nearest "ancestor element". But the spec doesn't even have a concept of style for these boxes at the moment! (Note that I think ruby has all the same issues, for the same reasons.) |
Ok no reason no to make this explicit then, I'll do it. Is this slightly improved version of the text used for "missing cells fixup" ok to you? (pretend I edit this to apply to all generated boxes not just missing cells)
|
s/who inherit/which inherit/. With that, looks good, I think. |
Don't assume the gender of my properties :D |
Consider this testcase:
What should the rendering look like and why? Per https://drafts.csswg.org/css-tables-3/#fixup-algorithm or https://www.w3.org/TR/CSS21/tables.html#anonymous-boxes we generate an anonymous table box here, but does it inherit the
border-spacing
value from thediv
? Is that even a meaningful thing to say, given that inheritance happens on elements, not boxes, and styles are attached to elements, not boxes, as far as I can tell?Similar for various inherited properties that can affect anonymous table cells (e.g. text-indent).
@fantasai @tabatkins @FremyCompany
The text was updated successfully, but these errors were encountered: