Closed Bug 383488 Opened 17 years ago Closed 15 years ago

style.setProperty(prop,value,"important") accepts trailing tokens in value

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: MatsPalmgren_bugz, Assigned: zwol)

Details

(Keywords: testcase)

Attachments

(2 files, 2 obsolete files)

Attached file Testcase (obsolete) —
style.setProperty(prop,value,"important") accepts trailing tokens in value. (Followup from bug 383075)
Flags: in-testsuite?
Attached file Testcase
Attachment #267469 - Attachment is obsolete: true
Attached patch Patch rev. 1 (obsolete) — Splinter Review
This seems to work but the comment makes me worried I'm missing something.
Attachment #267475 - Flags: superreview?(dbaron)
Attachment #267475 - Flags: review?(dbaron)
... should have bumped the IID on nsICSSParser too ...
Also, out-params should generally go at the end, so your new aIsImportant should go before the existing aChanged. Hopefully a more complete review to follow shortly...
Comment on attachment 267475 [details] [diff] [review] Patch rev. 1 Given comment 3, comment 4, and > if (aPriority.IsEmpty()) { >- return ParsePropertyValue(propID, aValue); >+ return ParsePropertyValue(propID, aValue, PR_FALSE); >+ } >+ else if (aPriority.EqualsLiteral("important")) { >+ return ParsePropertyValue(propID, aValue, PR_TRUE); > } Change the "else if" here to an "if". And maybe add at least an XXX comment below that we should put a CSS parser error on the error console if the priority is unknown? Maybe even a followup bug/patch? r+sr=dbaron with that, and sorry for the delay
Attachment #267475 - Flags: superreview?(dbaron)
Attachment #267475 - Flags: superreview+
Attachment #267475 - Flags: review?(dbaron)
Attachment #267475 - Flags: review+
I noticed this bug while filing bug 556661. I've taken the liberty of updating the patch to the latest tree and converting the original test case into a reftest. Very few changes to the code were required so I feel fairly comfortable carrying dbaron's old r+ forward, but I shan't land it immediately in case someone disagrees with me.
Assignee: matspal → zweinberg
Attachment #267475 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Landed http://hg.mozilla.org/mozilla-central/rev/60360c37c700 I'm going to bed - don't hesitate to back out if it causes trouble.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: