Closed
Bug 965897
Opened 10 years ago
Closed 10 years ago
Make nsHTMLReflowState verify its "aPresContext Must be equal to aFrame->PresContext()" precondition
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla30
People
(Reporter: dholbert, Assigned: dholbert)
Details
Attachments
(1 file)
2.01 KB,
patch
|
MatsPalmgren_bugz
:
review+
|
Details | Diff | Splinter Review |
nsHTMLReflowState has this documentation on its constructor and its ::Init method: > 468 * @param aPresContext Must be equal to aFrame->PresContext(). http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsHTMLReflowState.h#468 http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsHTMLReflowState.h#486 But we don't actually verify that anywhere, aside from a NS_PRECONDITION that checks that it's non-null. Might as well add an explicit NS_PRECONDITION to enforce that documentation.
Assignee | ||
Comment 1•10 years ago
|
||
Sorry, by "on its constructor and its ::Init method" I meant "on its constructors".
Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8368072 -
Flags: review?(matspal)
Assignee | ||
Comment 3•10 years ago
|
||
Sanity-check try run, to be sure we don't violate this (at least, not in crashtests/reftests): https://tbpl.mozilla.org/?tree=Try&rev=622c501e0070
Comment 4•10 years ago
|
||
Comment on attachment 8368072 [details] [diff] [review] fix This is such a fundamental precondition that it should use MOZ_ASSERT. r=mats with that. The null-checks before it could also use MOZ_ASSERT but I suspect you wouldn't get very far anyway :-)
Attachment #8368072 -
Flags: review?(matspal) → review+
Assignee | ||
Comment 5•10 years ago
|
||
(In reply to Mats Palmgren (:mats) from comment #4) > The null-checks before it could also use MOZ_ASSERT but I suspect you > wouldn't get very far anyway :-) I took the liberty of converting the aFrame and aPresContext null-checks to be MOZ_ASSERTS, because we literally wouldn't be able to make it past my new MOZ_ASSERT if either of those values were null. Landed, with that change: https://hg.mozilla.org/integration/mozilla-inbound/rev/84b6f0aba30d
Flags: in-testsuite-
Comment 6•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/84b6f0aba30d
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in
before you can comment on or make changes to this bug.
Description
•