W3C home > Mailing lists > Public > public-css-archive@w3.org > October 2017

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

From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
Date: Tue, 24 Oct 2017 19:32:23 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-339105322-1508873542-sysbot+gh@w3.org>
> Probably what we can do is:
> - define the expand order for shorthands
> - have CSSOM remove all longhands including their corresponding logical properties from the declaration block when it is setting a shorthand

But this wouldn't fix the following, would it?

elem.style.marginTop = "1px";
elem.style.marginBlockStart = "2px";
elem.style.marginTop = "0px";
getComputedStyle(elem).marginTop; // "2px" :(

A basic cascading rule is that the last declaration wins when there is a tie. So I really think that by default CSSOM should move the declaration to the end when you assign a value (but a method that preserves the order could be added). If this is not backwards-compatible, please add a note in the spec warning about this misbehavior, and recommend to use `removeProperty` before setting a property. 

GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1898#issuecomment-339105322 using your GitHub account
Received on Tuesday, 24 October 2017 19:32:24 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:19 UTC