W3C home > Mailing lists > Public > www-style@w3.org > January 2012

RE: [css3-values] RE: CSSStyleDeclaration#length and shorthands.

From: Brian Manthos <brianman@microsoft.com>
Date: Tue, 31 Jan 2012 19:07:40 +0000
To: Alexis Menard <alexis.menard@openbossa.org>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <9710FCC2E88860489239BE0308AC5D170EB2EE06@TK5EX14MBXC264.redmond.corp.microsoft.com>
W3C Working Draft
Editor's Draft

A lot is unclear regardless of which draft is referred to.

For example:
1. Should "inherit" ever be returned as all or part of the output from an OM query?  Or, instead, is in an input-only thing?
2. Should the internal state after inherit be like the unset state or different?  More specifically, should the OM state of stylesheets .A and .B be the same?  I suspect the answer is no so that if you apply rule .B after another rule, it should have an impact whereas .A would not.

.A { } .B { box-shadow: 1px 1px red; box-shadow: -prefix-inherit; }

Having made it clear that the expected behavior is very underspecified, I'll try to help nonetheless.

Alexis Menard:
> Should we expand the longhands when initial or inherit is set on a shorthand?
I'm not sure what you mean here, but I'll try to guess.

Example C:
<span style="border: 7px dashed red;">s<div style="border: inherit;">D</div>s</span>

Example D:
<span style="border: 7px dashed red;">s<div style="border: -prefix-initial;">D</div>s</span>

In example C, I would expect OM queries for style on the DIV to report "border: inherit".
In example D, I would expect OM queries for style on the DIV to report one of the following depending upon which "less than CR" specs you want to incorporate:
a. ""
b. "border: -prefix-initial"
c. "border: medium none currentColor"
d. "border: medium"

a: most compatible with 2.1
b: one interpretation of Values
c: another interpretation of Values, ignoring OM
d: same as c, but respecting minimization rules of OM

Alexis Menard:
> Should the shorthands be part of the list of properties of the style,
> so part of the count/length?

In the examples above, I would expect only the shorthand to be including in the style response as shown above.  If "border-width: 1px 2px 3px 4px;" was added to the specified inline style, then the shorthand becomes can no longer be constructed and thus longhand values would be included in the style output instead.

Alexis Menard:
> When I set initial to a shorthand will it mean that the longhands will
> have initial implicitly set or would it be explicitly?

Using examples C & D again above, these are all explicitly setting all of the (sub-)properties (border-width, border-style, and border-color).

Hopefully useful and correct guidance.  If failing either, I'm confident Elika and Tab will jump in swiftly to bring justice.

- Brian
Received on Tuesday, 31 January 2012 19:08:54 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 16:28:37 UTC