Closed Bug 1113811 Opened 10 years ago Closed 10 years ago

Remove unnecessary null-check of "new css::Declaration" in nsCSSParser

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla37

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(3 files, 1 obsolete file)

CSSParserImpl::ParseDeclarationBlock has an unnecessary null-check after new (unnecessary because new is infallible).

Filing this bug on cleaning that up.
OS: Linux → All
Hardware: x86_64 → All
Attached patch fix v1 (obsolete) — Splinter Review
Attachment #8539487 - Flags: review?(cam)
Attachment #8539487 - Flags: review?(cam) → review+
Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/2b933356daf7 for apparently breaking all tests:

https://treeherder.mozilla.org/ui/#/jobs?repo=mozilla-inbound&revision=f22bb012bf58 

(Builds were broken on dholbert's push, so this is the most recent push that built with dholbert's changes.)
Flags: needinfo?(dholbert)
Looks like the patch moved the declaration->CompressFrom() line into the loop, when it shouldn't have.  (Should have un-indented it instead of leaving it at its current indent.)
Yup -- looks like I mistakenly deleted the wrong closing-brace. (not the one that corresponded to the "if" condition that I'm removing). (This  is equivalent to what dbaron said in comment 5)

I think I probably did this because my merge too, "meld", highlighted the wrong one for me, because it was confused about bracing-level by an extra (quoted!) closing-brace in this code: "ExpectSymbol('}', true)"

Anyway, I'm going to rebuild & briefly test with that locally, and if all is well, I'll re-push with that fixed.
Flags: needinfo?(dholbert)
Here's the fixed patch. I verified that I can open a browser and open/close tabs, with this patch applied. (I could not, with the previous patch; we crash/abort before that.)

I think that's sufficient testing for a patch of this sort (removing an unnecessary null-check).   Sorry for not performing it on the earlier patch & catching that mistake earlier. :)
Attachment #8540482 - Flags: review+
Attachment #8539487 - Attachment is obsolete: true
Depends on: 1114871
https://hg.mozilla.org/mozilla-central/rev/a28c173dbd61
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
Depends on: 1116087
No longer depends on: 1116087
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: