Closed Bug 160403 Opened 22 years ago Closed 16 years ago

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

Categories

(Core :: DOM: CSS Object Model, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.1b2

People

(Reporter: vladimire, Assigned: dbaron)

References

(Blocks 2 open bugs)

Details

Attachments

(4 files, 1 obsolete file)

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>
Attached 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
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.
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".
Blocks: 120943
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)
Blocks: 158722
Summary: Inherit property is quadrippled (breaks roundtripping of border-color) → Inherit property is quadrupled (breaks roundtripping of border-color)
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)
Attached 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.
Blocks: 442630
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 #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.

Attachment

General

Created:
Updated:
Size: