Closed Bug 475214 Opened 16 years ago Closed 15 years ago

CSS serialization uses "-x-system-font"

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: jruderman, Assigned: dbaron)

References

Details

Attachments

(4 files, 1 obsolete file)

Attached file testcase
The parser won't accept -x-system-font, so the serializer shouldn't emit it.
I'm guessing the behavior changed with bug 376075, but I'm also guessing it wasn't that great before either.
Attached patch patch (obsolete) — Splinter Review
New test passes, whereas it failed 3 of 8 (the second and fourth serialization tests, and the fourth getter test) without the patch.

Full layout/style mochitests pass.
Attachment #360658 - Flags: superreview?(bzbarsky)
Attachment #360658 - Flags: review?(bzbarsky)
Comment on attachment 360658 [details] [diff] [review]
patch

Looks ok, but since no one looks at the return value of GetValueOrImportantValue, do we want to just make it return |const nsCSSValue&| so you don't have to do the comma operator thing here?
Attachment #360658 - Flags: superreview?(bzbarsky)
Attachment #360658 - Flags: superreview+
Attachment #360658 - Flags: review?(bzbarsky)
Attachment #360658 - Flags: review+
Returning |const nsCSSValue&| rather than |nsCSSValue| doesn't make much sense unless we're returning the same thing that's input (which is dangerous, see 420069) or we just stop checking for the branch that currently has an NS_ERROR in it.  I guess I'd lean towards the latter, but I also wouldn't want to do that as part of this patch; it's not a small change.
Yeah, I was assuming we'd return the value input...

Let's not worry about it; I'd forgotten the PGO thing.  :(
Hmm, actually, I also need to check consistence of !important in the ToString code here.
Attached patch patchSplinter Review
Here's a revised patch that also checks consistency of importance, and adds four additional tests, one of which the old patch failed.

It also doesn't use GetValueOrImportantValue.
Attachment #360658 - Attachment is obsolete: true
Attachment #360739 - Flags: superreview?(bzbarsky)
Attachment #360739 - Flags: review?(bzbarsky)
And here's a patch to remove GetValueOrImportantValue entirely.
Attachment #360740 - Flags: superreview?(bzbarsky)
Attachment #360740 - Flags: review?(bzbarsky)
... and make the replacement for GetValueOrImportantValue a little less ugly.

(The replacement is also faster since the caller always knows the desired importance, and the replacement depends on that whereas GetValueOrImportantValue figured it out.)
Attachment #360741 - Flags: superreview?(bzbarsky)
Attachment #360741 - Flags: review?(bzbarsky)
Note also that a few more of these typesafe wrappers end up used in my multiple-backgrounds patch (bug 322475).
Attachment #360739 - Flags: superreview?(bzbarsky)
Attachment #360739 - Flags: superreview+
Attachment #360739 - Flags: review?(bzbarsky)
Attachment #360739 - Flags: review+
Attachment #360740 - Flags: superreview?(bzbarsky)
Attachment #360740 - Flags: superreview+
Attachment #360740 - Flags: review?(bzbarsky)
Attachment #360740 - Flags: review+
Attachment #360741 - Flags: superreview?(bzbarsky)
Attachment #360741 - Flags: superreview+
Attachment #360741 - Flags: review?(bzbarsky)
Attachment #360741 - Flags: review+
http://hg.mozilla.org/mozilla-central/rev/768c8c967b0d
http://hg.mozilla.org/mozilla-central/rev/461bf98a6426
http://hg.mozilla.org/mozilla-central/rev/cfc21a608dcd
Status: NEW → RESOLVED
Closed: 15 years ago
OS: Mac OS X → All
Priority: -- → P4
Hardware: x86 → All
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
Assignee: nobody → dbaron
Blocks: 523755
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: