inherit and -moz-initial repeated when serializing shorthands (breaks roundtripping)

RESOLVED FIXED in mozilla1.9.1b2

Status

()

defect
RESOLVED FIXED
17 years ago
11 years ago

People

(Reporter: vladimire, Assigned: dbaron)

Tracking

(Blocks 2 bugs)

Trunk
mozilla1.9.1b2
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments, 1 obsolete attachment)

Reporter

Description

17 years ago
When a property is set to inherit value, the value reported in the dom is
quadrippled: "inherit inherit inherit inherit"

Attaching the following testcase.
<div id="test" style="border-color: inherit;"></div>
<script>
   alert(document.getElementById('test').style.borderColor);
</script>
Reporter

Comment 1

17 years ago
Posted file testcase
This is a canonicalization issue, not a correctness one....  Basically, it would
be nice to have a version of TryFourSidesShorthand that took eCSSPropertyFoo
instead of indices into mOrder....
OS: Windows 2000 → All
Hardware: PC → All
damn !!! c14n is my hell...
Assignee: jst → glazman
Reporter

Comment 4

17 years ago
This behaviour is sumilar to what happens with shorthand properties, but
border-color is not a shorthand...
border-color _is_ a shorthand.  It sets border-top-color, border-right-color, etc.
Reporter

Comment 6

17 years ago
then perhaps this is not a bug, the border-color property is outputing values of
the properties it is a shorthand for. There is 4 of them
(top,left,right,bottom), and they are all inherit because that is what
border-color was set to...
Right.  That's why I said it's not a correctness issue in comment 2.  But we
_should_ canonicalize the whole thing to a single "inherit".
It is a correctness issue. 'inherit inherit inherit inherit' is not a valid CSS
value for the 'border-color' property.
Summary: Inherit property is quadrippled → Inherit property is quadrippled (breaks roundtripping of border-color)
Reporter

Updated

17 years ago
Blocks: 158722
Summary: Inherit property is quadrippled (breaks roundtripping of border-color) → Inherit property is quadrupled (breaks roundtripping of border-color)
Duplicate of this bug: 377519
Assignee: daniel → dbaron
Status: NEW → ASSIGNED
QA Contact: ian → general
Summary: Inherit property is quadrupled (breaks roundtripping of border-color) → inherit and -moz-initial repeated when serializing shorthands (breaks roundtripping)
Posted patch work in progress (obsolete) — Splinter Review
Here's some work in progress which, unfortunately, makes things worse for the direction-sensitive box properties with *-start and *-end variants to match *-right and *-left.
No longer blocks: 376075
I'm sure this will bitrot quickly, but it's also trivial to rewrite.  (And, thanks to mq, easy to keep separate and thus rewrite when needed.)

This may be useful for other things, too (like the always-use-my-colors pref).
Attachment #341973 - Flags: superreview?(bzbarsky)
Attachment #341973 - Flags: review?(bzbarsky)
This adds a flag for the *-{ltr,rtl}-source properties.
Attachment #341974 - Flags: superreview?(bzbarsky)
Attachment #341974 - Flags: review?(bzbarsky)
Attachment #341357 - Attachment is obsolete: true
Attachment #341975 - Flags: superreview?(bzbarsky)
Attachment #341975 - Flags: review?(bzbarsky)
Attachment #341974 - Attachment description: add a flag for the *-source properties → patch 2: add a flag for the *-source properties
Attachment #341973 - Flags: superreview?(bzbarsky)
Attachment #341973 - Flags: superreview+
Attachment #341973 - Flags: review?(bzbarsky)
Attachment #341973 - Flags: review+
Attachment #341974 - Flags: superreview?(bzbarsky)
Attachment #341974 - Flags: superreview+
Attachment #341974 - Flags: review?(bzbarsky)
Attachment #341974 - Flags: review+
Comment on attachment 341975 [details] [diff] [review]
patch 3: fix serialization of inherit and -moz-initial on shorthands

Looks good, assuming that the existing code in those tests you change caught the issue with background-clip and so on.

This doesn't help GetCSSText, but that can be handled in bug 442630.
Attachment #341975 - Flags: superreview?(bzbarsky)
Attachment #341975 - Flags: superreview+
Attachment #341975 - Flags: review?(bzbarsky)
Attachment #341975 - Flags: review+
(In reply to comment #14)
> (From update of attachment 341975 [details] [diff] [review])
> Looks good, assuming that the existing code in those tests you change caught
> the issue with background-clip and so on.

Yes, the existing tests caught that (and also the issue with the *-source subproperties).
You need to log in before you can comment on or make changes to this bug.