Re: [csswg-drafts] [css-logical-1] [css-cascade-3] The all longhand probably shouldn't set logical properties.

I've retagged this as just a CSSOM issue, and marked it as a f2f issue, because it's kinda complicated. Retag the other specs if you disagree and think that there is something they should do.

-----

As far as I can tell, the problem is:

* when you set `el.style`, it just manipulates some data structure, that tracks whether a value is set for each property and what it's set to
* this is then serialized to the style attribute in a *predefined* order (the order you set the properties in doesn't matter)
* thus, if the logicals appear after the physicals, then setting `el.style.fooBlockStart="one"; el.style.fooTop="two";` will serialize to `style="foo-top: two; foo-block-start: one;", and the logical value will end up winning, per the Cascade rules for how to resolve coinciding logical/physical declarations.  (Same applies in reverse if logicals appear before the physicals.)
* so this appears to be a CSSOM issue with it not respecting the same rules as the cascade does.

Right?

So Xidorn and Oriol have suggestions:

1. Xidorn suggests that when you set a property with phys/log counterparts, unset the corresponding other property from the el.style data structure.
2. Oriol suggests preserving the order the properties are set in when serializing to the style attribute.

(1) seems hard to do - you need to know the final computed value of writing-mode, direction, and maybe text-orientation to figure out the corresponding property, and those might be set by a completely different stylesheet.

(2) seems to cleanly fit in with the Cascade machinery, tho it would require tracking more information in the element.

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

Received on Friday, 27 October 2017 18:42:23 UTC