-
Notifications
You must be signed in to change notification settings - Fork 709
[css-logical] Should the mapping for logical values depend on the element or containing block? #3013
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
The containing block is a layout concept, so the style engine doesn't necessarily have that information. I'd prefer not to teach the style system about containing blocks, I think the spec should be changed here. |
We have an outstanding resolution on this, I guess it just didn't make it into the spec (which is has in general been quite neglected). I'll be spending some time on it the next few days, though, so outstanding resolutions should get edited in soonish. :) |
Oh, sorry, thought this was about the logical properties. Those compute against the element's own writing mode always, for simplicity during cascading and style computation and because it wasn't entirely clear where to draw the boundary between “this is best computed against the CB writing mode” and “this is best computed against the element's own writing mode”: at the border edge? the padding edge? the content edge? For logical values, it does depend on the property whether the containing block or the element itself is referenced. For example, the Floats are more similar to @emilio Logical values don't compute through to physical ones, so the style system doesn't need to know about it. |
That's not clear: #2821 |
@Loirooriol Yes it is, the propdef tables for those properties say “Computed value: as specified”. That means the values do not compute through. This is important because (as you point out) it would break inherited properties to do otherwise. |
I agree with @fantasai here:
It is kinda unfortunate implementations did something else here. |
@fantasai But the propdef tables for those properties don't include the logical values, so it's not clear. The partial propdef table in CSS Logical with the new values should repeat “Computed value: as specified” |
@Loirooriol Fair, fixed in f3953ed for #2821. |
The Working Group just discussed
The full IRC log of that discussion<dael> topic: Should the mapping for logical values depend on the element or containing block?<dael> github: https://github.com//issues/3013 <dael> fantasai: Question was about should hte mapping for logical values depend on element or containing block. Not about logical properties, but values like float inline start or text-inline-start <dael> fantasai: First thing is currently the spec...it was stated values compute to themselves. That's first question. Second is do you map against containing block or element. <dael> fantasai: Supposed to depend on kind of element. test-align:start needs to map against element. For alignment we use containing block so makes sense to do same for float b/c you don't want element to move based on content, but rahter context <dael> fantasai: Proposed is no change to spec but clarify the values map to themselves <dael> fantasai: I copied that in. Does anyone else have comment? <dael> Rossen: Question. There are...all properties in box model, are they defined to resolve against own writing mode? <dael> fantasai: Yes own. It was sometimes correct and because you have to do computation of writing mode with cascade it's much easier computation. <dael> fantasai: It's unfortunate that's t he case because there's a lot of cases to use containing block writing mode for something like margins but we did element's own writing mode for simplicity. <dael> fantasai: Don't have same problem for values as they resolve at layout time <dael> fantasai: We should have down issue 3 first as it talks about computed <dael> [logical properties issue 3, not agenda issue 3] <dael> Rossen: Other opinions? <fantasai> #2821 <dael> Rossen: I asked about box model props because they are used for aligning box and sometimes used to align content inside. Align self and content align properties and values are very similar in layout impact so one doing self and the other containing block is weird. <dael> fantasai: align self:start you use containing block, align-self:self-start you use your own writing mode <dael> fantasai: text-align:start your children is what's being aligned. <dael> Rossen: Get it. Not making case against it. In same virtue you can say position left and right can be used to align self and padding start and end can align content box. Fromm that PoV they are similar. <dael> Rossen: For box model all properites and values compute to writing mode of element itself <dael> Rossen: There is discontinuity here <dael> Rossen: Can live with it. <dael> Rossen: Other opinions or resolve on proposal to have values that effect alignment compute in containing block. Value effect alignment of content of a box o f an element are computed in writing mode of element itself <dael> fantasai: That's what's spec in grid, flexbox, and alignment <bradk> +1 <dael> RESOLVED: Accept proposal |
Layout 2020 does a lot of work to pass the containing block writing mode around in order to try to resolve logical box properties. This seems incorrect though, as logical box model properties use the element's writing mode to resolve to physical properties [1] [2]. This is handled correctly by the style component, but Layout 2020 does a lot of work to try to override them. This change removes that code and also tries to use more style component data structures in place of Layout 2020's custom logical geometry primitives. In particular it removes the confusingly overloaded type aliases `LengthOrAuto` and `LengthPercentageOrAuto` from Layout 2020. These aliases were very similar to the ones from the style component, but had a different definition. Since Layout 2020 does not have proper support for writing modes, this change should not modify behavior. 1. w3c/csswg-drafts#3013 2. https://drafts.csswg.org/css-logical/#box
https://drafts.csswg.org/css-logical/#float-clear says
However, on Firefox the mapping depends on the writing mode of the element itself. I didn't read the spec carefully when implementing logical values in Blink, so I ended up copying the Firefox behavior. web-platform-tests/wpt#12326 tests the implemented behavior and not the spec one.
Instead of fixing both implementations and WPT, maybe consider changing the spec?
This would be consistent with the previous change that made the mapping for logical properties depend on the writing mode of the element instead of the one of the parent element.
csswg-drafts/css-logical-1/Overview.bs
Line 731 in 206498e
The text was updated successfully, but these errors were encountered: