Closed
Bug 978001
Opened 11 years ago
Closed 11 years ago
make nsViewManager::ProcessPendingUpdatesForView look at the local view manager instead of always the root one
Categories
(Core :: Web Painting, defect)
Tracking
()
RESOLVED
FIXED
mozilla30
People
(Reporter: tnikkel, Assigned: tnikkel)
Details
Attachments
(2 files, 1 obsolete file)
|
3.68 KB,
patch
|
MatsPalmgren_bugz
:
review+
|
Details | Diff | Splinter Review |
|
1.61 KB,
patch
|
MatsPalmgren_bugz
:
review+
abillings
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
Attachment #8383529 -
Flags: review?(matspal)
Comment 1•11 years ago
|
||
Comment on attachment 8383529 [details] [diff] [review]
patch
># HG changeset patch
>Make nsViewManager::ProcessPendingUpdatesForView look at the local view manager instead of always the root one where it makes sense to do so.
Don't forget to add the bug number.
>- if (mPresShell && mPresShell->IsNeverPainting()) {
>+ nsIPresShell* presShell = viewManager->mPresShell;
>+ if (presShell && presShell->IsNeverPainting()) {
> return;
Why not return when the shell is null? Like so:
if (!presShell || presShell->IsNeverPainting()) {
> nsAutoScriptBlocker scriptBlocker;
> NS_ASSERTION(aView->HasWidget(), "Must have a widget!");
Not your fault, but there are two of these assertions with nothing
significant in-between, please remove the one above.
Attachment #8383529 -
Flags: review?(matspal) → review+
| Assignee | ||
Comment 2•11 years ago
|
||
(In reply to Mats Palmgren (:mats) from comment #1)
> Don't forget to add the bug number.
Yep, ddded it immediately after filing, hard to get the bug number in the patch when you attach a patch at filing time. :)
> Why not return when the shell is null? Like so:
> if (!presShell || presShell->IsNeverPainting()) {
We can still ResetWidgetBounds without a presshell fine, that path never looks at the presshell. So if it's okay with you I'll leave this as is.
> Not your fault, but there are two of these assertions with nothing
> significant in-between, please remove the one above.
Okay.
And just now I noticed a silly mistake: I forget to change mPresShell && mPresShell->IsVisible() inside the for loop. I'll fix and re-upload.
| Assignee | ||
Comment 3•11 years ago
|
||
Attachment #8383529 -
Attachment is obsolete: true
Attachment #8384233 -
Flags: review?(matspal)
Comment 4•11 years ago
|
||
(In reply to Timothy Nikkel (:tn) from comment #2)
> We can still ResetWidgetBounds without a presshell fine, that path never
> looks at the presshell. So if it's okay with you I'll leave this as is.
It's okay to leave as is for now. (I'm not totally convinced that
state is even valid though.)
> And just now I noticed a silly mistake: I forget to change mPresShell &&
> mPresShell->IsVisible() inside the for loop. I'll fix and re-upload.
Oops, right, I should have caught that. That's a good indication that
this method with its two principal vm's is error prone, so it's probably
a good idea to split up this method so that the root vm is 'this' in one
method and the view's vm is 'this' in another. Not necessarily in this
bug though.
Comment 5•11 years ago
|
||
Comment on attachment 8384233 [details] [diff] [review]
patch v2
r=mats
>- NS_ASSERTION(aView->HasWidget(), "Must have a widget!");
I think I prefer to keep this one and remove the latter one
instead. This code is inside a "if (widget..." block so
I think the intention is to catch the FlushDelayedResize
loop doing bad things. So having it right after that loop
seems more appropriate. Perhaps indicate that intention in the
assertion message? ("FlushDelayedResize removed our widget!")
Attachment #8384233 -
Flags: review?(matspal) → review+
| Assignee | ||
Comment 6•11 years ago
|
||
(In reply to Mats Palmgren (:mats) from comment #4)
> (In reply to Timothy Nikkel (:tn) from comment #2)
> > We can still ResetWidgetBounds without a presshell fine, that path never
> > looks at the presshell. So if it's okay with you I'll leave this as is.
>
> It's okay to leave as is for now. (I'm not totally convinced that
> state is even valid though.)
You're right, it may not matter at all, but I was able to string together a plausible path. I think view managers get created before presshells, and the presshell on the viewmanager is set in PresShell::Init. So the presshell may be null on a viewmanager for a short period. nsViewManager::WillPaintWindow is called from widget code, and it calls ProcessPendingUpdates. So there is a slim chance we could hit that case.
| Assignee | ||
Comment 7•11 years ago
|
||
(In reply to Mats Palmgren (:mats) from comment #5)
> I think I prefer to keep this one and remove the latter one
> instead. This code is inside a "if (widget..." block so
> I think the intention is to catch the FlushDelayedResize
> loop doing bad things. So having it right after that loop
> seems more appropriate. Perhaps indicate that intention in the
> assertion message? ("FlushDelayedResize removed our widget!")
Done.
Comment 8•11 years ago
|
||
(In reply to Timothy Nikkel (:tn) from comment #6)
OK, it seems plausible, but then...
> ... and it calls ProcessPendingUpdates
which calls ProcessPendingUpdatesForView with aFlushDirtyRegion==true so
then we might crash on the unchecked "presShell->Paint" call?
| Assignee | ||
Comment 9•11 years ago
|
||
| landing | ||
| Assignee | ||
Comment 10•11 years ago
|
||
(In reply to Mats Palmgren (:mats) from comment #8)
> (In reply to Timothy Nikkel (:tn) from comment #6)
>
> OK, it seems plausible, but then...
>
> > ... and it calls ProcessPendingUpdates
>
> which calls ProcessPendingUpdatesForView with aFlushDirtyRegion==true so
> then we might crash on the unchecked "presShell->Paint" call?
Oh, whoops, I intended to guard that, but forgot. I'll do a quick fix up.
| Assignee | ||
Comment 11•11 years ago
|
||
Attachment #8384241 -
Flags: review?(matspal)
Comment 12•11 years ago
|
||
Comment on attachment 8384241 [details] [diff] [review]
null check presshell
Please move the "if (presShell) {" up a few lines so it also
includes the first MOZ_DUMP_PAINTING block.
Attachment #8384241 -
Flags: review?(matspal) → review+
| Assignee | ||
Comment 13•11 years ago
|
||
| landing | ||
Moved the if up and landed
https://hg.mozilla.org/integration/mozilla-inbound/rev/5b678e143116
Thanks.
Comment 14•11 years ago
|
||
| landing | ||
https://hg.mozilla.org/mozilla-central/rev/984bd72d320c
https://hg.mozilla.org/mozilla-central/rev/5b678e143116
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
Comment 15•11 years ago
|
||
Comment on attachment 8384241 [details] [diff] [review]
null check presshell
[Approval Request Comment]
Bug caused by (feature/regressing bug #): -
User impact if declined: possible null-pointer crash?
Testing completed (on m-c, etc.): on m-c since 2014-03-03
Risk to taking this patch (and alternatives if risky): low
String or IDL/UUID changes made by this patch: none
The request is for both patches. I want this on Aurora so that my patch
in bug 946658 applies.
Attachment #8384241 -
Flags: approval-mozilla-aurora?
Updated•11 years ago
|
Attachment #8384241 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 16•11 years ago
|
||
| landing | ||
https://hg.mozilla.org/releases/mozilla-aurora/rev/3af224d9f248
https://hg.mozilla.org/releases/mozilla-aurora/rev/ab90efe51b6e
status-firefox29:
--- → fixed
Updated•11 years ago
|
status-firefox30:
--- → fixed
Comment 17•11 years ago
|
||
Updated•11 years ago
|
status-b2g-v1.3T:
--- → fixed
Updated•7 years ago
|
Component: Layout: View Rendering → Layout: Web Painting
You need to log in
before you can comment on or make changes to this bug.
Description
•