Closed Bug 899389 Opened 11 years ago Closed 11 years ago

null checking of NS_NewStyleContext is unnecessary

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla25

People

(Reporter: heycam, Assigned: heycam)

Details

Attachments

(1 file)

Since nsPresArena allocations are infallible, we can avoid null checking the result of NS_NewStyleContext.
Attached patch patchSplinter Review
Assignee: nobody → cam
Status: NEW → ASSIGNED
Attachment #782880 - Flags: review?(dbaron)
Comment on attachment 782880 [details] [diff] [review]
patch

r=dbaron.

It would be great to fix some of the other places that null check frame style contexts too (especially things that are documentation-like, such as nsIFrame::SetStyleContext[WithoutNotification] and nsFrame:~nsFrame).
Attachment #782880 - Flags: review?(dbaron) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/0261e8137818

Yeah I'll look into more null checks that can be removed.
https://hg.mozilla.org/mozilla-central/rev/0261e8137818
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: