Csswg-drafts: [css-logical] Should the `inset` shorthand allow quirks in their lengths like the individual properties do?

Created on 16 Jan 2019  Â·  12Comments  Â·  Source: w3c/csswg-drafts

I'd prefer if not, but the current spec doesn't say. In quirks mode, some (non-zero) lengths don't require units, so for example <div style="position: relative; top: 100"> works.

I'd prefer if we didn't have to do this for inset, given it's a new property, and that the inset- longhands don't allow this looks like.

css-logical-1

Most helpful comment

I agree with tab on that. I'd prefer to keep the quirks where we know it's needed. In this case it's clearly not needed, since the property is new.

All 12 comments

/cc @Loirooriol

I believe the unitless length quirk is applied only to properties explicitly listed in the Quirks Mode Living Standard, isn't it?

Yes, though the definition of the inset property use <'top'>.

Also the Blink implementation (though not shipped) supports this: data:text/html,<div style="position: relative; inset: 100 0 0 0">Foo.

So not sure whether the spec needs fixing and/or whether Blink needs a bug on file.

Ah, I overlooked this. Blink allows the quirk, because the easy way to parse the shorthand was using the longhands.

I don't have a strong opinion, if inset remains a shorthand of only the physical properties it may make some sense to allow the quirk in order to have a consistent syntax. But if it's going to become a shorthand of both logical or physical longhands like fantasai wants, then I wouldn't allow it.

@tabatkins was against spreading the quirk any further (but I was asking about logical longhands).

I agree with tab on that. I'd prefer to keep the quirks where we know it's needed. In this case it's clearly not needed, since the property is new.

Isn't the <top> notation in the new properties definition just a shorthand for the auto | <length-percentage>, not the literal mapping to the top property? The notation <‘top’>{1,4} in the inset shorthand definition suggests so. If it is the case and the quirk is applied in the parse time, I suppose that logical properties should be parsed without quirks, and the current Blink behavior should be considered a bug.

The CSS Working Group just discussed Should the `inset` shorthand allow quirks in their lengths like the individual properties do?, and agreed to the following:

  • RESOLVED: Do not allow quirks in 'inset' shorthand

The full IRC log of that discussion
<dael> Topic: Should the inset shorthand allow quirks in their lengths like the individual properties do?

<dael> github: https://github.com/w3c/csswg-drafts/issues/3525

<dael> fantasai: Top left bottom and right prop in quirks mode allow px without px unit. 100=100px. DO we have same quirk for logical longhands? Related is what about inset shorthand?

<fantasai> (inset shorthand shorthands the physical properties, top/left/bottom/right)

<dael> TabAtkins: I don't see a reason to allow quirks in new properties. Need to not rely on top because that imports quirks

<bradk> No quirks

<dael> fantasai: We can add a note saying this notation doesn't import quirks

<dael> astearns: I'm agreeing shorthand shouldn't have quirks and deal with that in spec definition as well as add test cases

<dael> astearns: Other opinions?

<dael> astearns: Obj to not allowing quirks in 'inset' shorthand?

<dael> RESOLVED: Do not allow quirks in 'inset' shorthand

I think we can close this unless anybody thinks the spec needs more clarification. Feel free to reopen if so. @ericwilligers added wpt tests for this (thanks!).

Blink is fixed.

WebKit is also fixed.

Was this page helpful?
0 / 5 - 0 ratings