Closed Bug 876570 Opened 8 years ago Closed 8 years ago

missing UngetToken() when failing to parse b part of :nth-child(an+b)

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: dbaron, Assigned: dbaron)

Details

(Keywords: css3)

Attachments

(1 file)

While writing additional tests during the process of reviewing bug 750388, I found that we failed a set of tests that I wrote.  The patch was trivial -- a missing UngetToken() call that is needed because the incorrect token might be a parenthesis, bracket, or brace, and predates bug 750388.
Comment on attachment 754651 [details] [diff] [review]
Add missing UngetToken() call in an+b microsyntax parsing.

Shouldn't the UngetToken happen after the REPORT_UNEXPECTED_TOKEN?

r=me with that or with a comment explaining the nonintuitive ordering in this case.
Attachment #754651 - Flags: review?(bzbarsky) → review+
From a behavior perspective it doesn't matter, since UngetToken just sets mHavePushBack and doesn't actually change mToken.  But you're right that it makes more sense that way (and most but not all of the existing occurrences of this pattern seem to be in that order).
https://hg.mozilla.org/mozilla-central/rev/2b1b8487b6b6
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.