Closed
Bug 774122
Opened 12 years ago
Closed 12 years ago
limit CSS parser hashless-color and unitless-length quirks to only the properties that need them
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla17
People
(Reporter: dbaron, Assigned: dbaron)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
(Keywords: dev-doc-needed)
Attachments
(3 files, 1 obsolete file)
38.01 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
61.45 KB,
patch
|
Details | Diff | Splinter Review | |
1.80 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
The CSS parser has two quirks, for unitless lengths and for hashless colors, that we currently apply when the property parser doesn't note that it's a shorthand. That is, we apply them except when properties opt out. We should instead flip this around so that we only apply them to properties that opt in, and we should use the list of properties that need these quirks from http://dvcs.w3.org/hg/quirks-mode/raw-file/tip/Overview.html#css
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #642431 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 2•12 years ago
|
||
Attachment #642432 -
Flags: review?(bzbarsky)
Comment 3•12 years ago
|
||
Comment on attachment 642431 [details] [diff] [review] Limit the hashless color quirk to the properties where it's needed, per http://simon.html5.org/specs/quirks-mode#the-hashless-hex-color-quirk . (, patch 1) Does the first assertion in ParseVariant need updating? The "NOTE" about the next free bit in nsCSSProps.h needs to be updated. r=me with those two nits.
Attachment #642431 -
Flags: review?(bzbarsky) → review+
Comment 4•12 years ago
|
||
Comment on attachment 642432 [details] [diff] [review] Limit the unitless length quirk to the properties where it's needed, per http://simon.html5.org/specs/quirks-mode#the-unitless-length-quirk . (, patch 2) Same comments here as for the other patch. r=me
Attachment #642432 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 5•12 years ago
|
||
Attachment #642436 -
Flags: review?(bzbarsky)
Assignee | ||
Updated•12 years ago
|
Attachment #642432 -
Attachment is obsolete: true
Assignee | ||
Comment 6•12 years ago
|
||
Comment on attachment 642436 [details] [diff] [review] Limit the unitless length quirk to the properties where it's needed, per http://simon.html5.org/specs/quirks-mode#the-unitless-length-quirk . (, patch 2) Er, never mind, not worth asking for re-review for the tiny tweak (to the column-rule-color values in property_database.js).
Attachment #642436 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 7•12 years ago
|
||
(In reply to Boris Zbarsky (:bz) from comment #3) > Does the first assertion in ParseVariant need updating? My current inclination is to replace the single assertion with: NS_ASSERTION(!(mHashlessColorQuirk && (aVariantMask & VARIANT_COLOR) || !(aVariantMask & VARIANT_NUMBER), "can't distinguish colors from numbers"); NS_ASSERTION(!(mHashlessColorQuirk && (aVariantMask & VARIANT_COLOR) || !(mUnitlessLengthQuirk && (aVariantMask & VARIANT_LENGTH)), "can't distinguish colors from lengths"); NS_ASSERTION(!(mUnitlessLengthQuirk && (aVariantMask & VARIANT_LENGTH)), !(aVariantMask & VARIANT_NUMBER), "can't distinguish lengths from numbers"); > The "NOTE" about the next free bit in nsCSSProps.h needs to be updated. It should just be removed; it was there because the previous bit was used by a 2-bit construct.
Assignee | ||
Comment 8•12 years ago
|
||
Actually, compilers are rather more happy with: NS_ASSERTION(!(mHashlessColorQuirk && (aVariantMask & VARIANT_COLOR)) || !(aVariantMask & VARIANT_NUMBER), "can't distinguish colors from numbers"); NS_ASSERTION(!(mHashlessColorQuirk && (aVariantMask & VARIANT_COLOR)) || !(mUnitlessLengthQuirk && (aVariantMask & VARIANT_LENGTH)), "can't distinguish colors from lengths"); NS_ASSERTION(!(mUnitlessLengthQuirk && (aVariantMask & VARIANT_LENGTH)) || !(aVariantMask & VARIANT_NUMBER), "can't distinguish lengths from numbers");
Assignee | ||
Comment 9•12 years ago
|
||
(In reply to David Baron [:dbaron] from comment #8) > Actually, compilers are rather more happy with: > NS_ASSERTION(!(mHashlessColorQuirk && (aVariantMask & VARIANT_COLOR)) || > !(aVariantMask & VARIANT_NUMBER), > "can't distinguish colors from numbers"); > NS_ASSERTION(!(mHashlessColorQuirk && (aVariantMask & VARIANT_COLOR)) || > !(mUnitlessLengthQuirk && (aVariantMask & VARIANT_LENGTH)), > "can't distinguish colors from lengths"); > NS_ASSERTION(!(mUnitlessLengthQuirk && (aVariantMask & VARIANT_LENGTH)) || > !(aVariantMask & VARIANT_NUMBER), > "can't distinguish lengths from numbers"); The third of which actually catches an interesting bug in quirks mode: I think I need to temporarily disable these inside of calc().
Assignee | ||
Comment 10•12 years ago
|
||
Attachment #642444 -
Flags: review?(bzbarsky)
Comment 11•12 years ago
|
||
Comment on attachment 642444 [details] [diff] [review] Disable the unitless length quirk inside of calc(). (, patch 3) r=me, but the spec should say so too.
Attachment #642444 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 12•12 years ago
|
||
I honestly have no idea why the spec for these quirks is written the way it is; it has no relationship to the way we actually implement them and seems highly unlikely to match. (I thought it used to be different, though.)
Assignee | ||
Comment 13•12 years ago
|
||
Though, actually, I think does happen to be what the spec says, since the spec applies a function nesting level test. I'm still skeptical that we won't find other cases where the spec doesn't match, though.
Assignee | ||
Comment 14•12 years ago
|
||
In particular, the spec describes the quirk in terms of token-preprocessing when it's actually implemented at the parser level rather than the tokenizer. While the difference isn't detectable now, it will be once we implement CSS variables.
Assignee | ||
Comment 15•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/ac282e15dc02 https://hg.mozilla.org/integration/mozilla-inbound/rev/e3007422b989 https://hg.mozilla.org/integration/mozilla-inbound/rev/64ff8c2d37f9
Comment 16•12 years ago
|
||
I backed these patches out of inbound because they caused reftest bustage: REFTEST TEST-UNEXPECTED-FAIL | file:///c:/talos-slave/test/build/reftest/tests/layout/reftests/transform-3d/translatez-1a.html | image comparison (==) REFTEST TEST-UNEXPECTED-FAIL | file:///c:/talos-slave/test/build/reftest/tests/layout/reftests/transform-3d/translate3d-1a.html | image comparison (==) https://hg.mozilla.org/integration/mozilla-inbound/rev/33ebe0407469 https://hg.mozilla.org/integration/mozilla-inbound/rev/588ea3ebb1ef https://hg.mozilla.org/integration/mozilla-inbound/rev/e85863a0d897 (I also backed out your no-bug changeset, 0e6039a2c90a)
Assignee | ||
Comment 17•12 years ago
|
||
So the problem here is that there are two reftests depending on -moz-transform-origin's z component accepting unitless lengths in quirks mode. Is it supposed to accept unitless lengths?
Assignee | ||
Comment 18•12 years ago
|
||
(Actually, one of them has x, y, and z in quirks mode.) http://hg.mozilla.org/mozilla-central/file/4cffe2b37d0c/layout/reftests/transform-3d/translate3d-1-ref.html http://hg.mozilla.org/mozilla-central/file/4cffe2b37d0c/layout/reftests/transform-3d/translatez-1-ref.html
Assignee | ||
Comment 19•12 years ago
|
||
Anyway, I don't see any sign in the spec that these transform-origin is supposed to accept lengths, so I'm just going to fix the tests.
Assignee | ||
Comment 20•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/9cdb8f9ec426 https://hg.mozilla.org/integration/mozilla-inbound/rev/b1ffd5406ad9 https://hg.mozilla.org/integration/mozilla-inbound/rev/473df589abf1
Assignee | ||
Comment 21•12 years ago
|
||
er, make that the last 2 of those plus https://hg.mozilla.org/integration/mozilla-inbound/rev/3350e8b1618c
Comment 22•12 years ago
|
||
Didn't make it to mozilla-central before the uplift (merge was blocked on bug 774259). Adjusting milestone accordingly.
Target Milestone: --- → mozilla17
Keywords: dev-doc-needed
Comment 23•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/b1ffd5406ad9 https://hg.mozilla.org/mozilla-central/rev/473df589abf1 https://hg.mozilla.org/mozilla-central/rev/3350e8b1618c
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment 24•12 years ago
|
||
(In reply to David Baron [:dbaron] from comment #14) > In particular, the spec describes the quirk in terms of token-preprocessing > when it's actually implemented at the parser level rather than the > tokenizer. While the difference isn't detectable now, it will be once we > implement CSS variables. So with CSS variables, per spec the quirk shouldn't apply, right? Isn't that a good thing? Would it be hard to implement assuming you keep it at parser level?
Assignee | ||
Comment 25•12 years ago
|
||
I don't think it's worth switching to a much more complicated implementation of the quirk in order to make it not apply to CSS variables used in these properties. (And I expect the implementation is similar in other browsers.)
Comment 26•12 years ago
|
||
These quirks are now defined at parser-level in css3-syntax.
Assignee | ||
Updated•12 years ago
|
Blocks: quirks-mode-spec
Comment 27•12 years ago
|
||
Note that at least for text-indent and background-position this might have broken some sites. See http://stackoverflow.com/questions/14173821/firefox-17-css-issue-text-indent-ignored
Comment 28•11 years ago
|
||
@Boris: That's right, this "unquirking the quirks" has broken some sites. Even more, I suggest that Firefox from now on implements the quirks again, or it doesn't show anything anymore without a "px". This will be very interesting to watch, because the Browser user will realise how many sites rely on those "quirks", and change the browser or not. However, you should be aware that since changing above "quirks", many user stopped the use of Firefox. It's clearly visible in the statistics: Firefox is strongly loosing user since the introduction of 17.0.1. Well, I use to say: "Never change a running machine". Otherwise the machine won't run anymore. More comments on this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=844641 ("Browser must support more than the standard. Otherwise user change the browser.")
Updated•10 years ago
|
Comment 29•9 years ago
|
||
For documentation: This is partly reverted, see bug 1103000
You need to log in
before you can comment on or make changes to this bug.
Description
•