Closed Bug 521198 Opened 15 years ago Closed 15 years ago

forced widget update while view refresh is disabled

Categories

(Core :: Web Painting, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.3a1

People

(Reporter: karlt, Assigned: karlt)

Details

Attachments

(1 file)

STR (from bug 509278 comment 16):

1) Click this link...
https://developer.mozilla.org/en/Build_Documentation#Get_the_source
2) If the page loads (it should) navigate back here and click the link again

Expected results:
New page is painted in tab.

Actual results:
Tab page is painted blank.
If it weren't for bug 509278, the page would then be painted correctly, but
blank paint should not be necessary, which is why I'm filing this bug.
Painting is unsuppressed and the widget is invalidated:

(gdb) bt
#0  nsWindow::Invalidate (this=0x7f4a053e49b0, aRect=@0x7fff505e12f0, 
    aIsSynchronous=0) at /home/karl/moz/dev/widget/src/gtk2/nsWindow.cpp:1683
#1  0x00007f4a26619ab0 in nsViewManager::UpdateWidgetArea (
    this=0x7f4a0512c670, aWidgetView=0x7f4a04ff6c00, aWidget=0x7f4a053e49b0, 
    aDamagedRegion=@0x7fff505e1450, aIgnoreWidgetView=0x0)
    at /home/karl/moz/dev/view/src/nsViewManager.cpp:785
#2  0x00007f4a26619c21 in nsViewManager::UpdateView (this=0x7f4a0512c670, 
    aView=0x7f4a04ff6c00, aRect=@0x7fff505e1530, aUpdateFlags=0)
    at /home/karl/moz/dev/view/src/nsViewManager.cpp:815
#3  0x00007f4a26145769 in nsIFrame::InvalidateRoot (this=0x7f4a05544320, 
    aDamageRect=@0x7fff505e1530, aFlags=0)
    at /home/karl/moz/dev/layout/generic/nsFrame.cpp:3814
#4  0x00007f4a261d51d4 in ViewportFrame::InvalidateInternal (
    this=0x7f4a05544320, aDamageRect=@0x7fff505e15e0, aX=0, aY=0, 
    aForChild=0x0, aFlags=0)
    at /home/karl/moz/dev/layout/generic/nsViewportFrame.cpp:362
#5  0x00007f4a2613bd54 in nsIFrame::InvalidateWithFlags (this=0x7f4a05544320, 
    aDamageRect=@0x7fff505e15e0, aFlags=0)
    at /home/karl/moz/dev/layout/generic/nsFrame.cpp:3656
#6  0x00007f4a2608f48e in nsIFrame::Invalidate (this=0x7f4a05544320, 
    aDamageRect=@0x7fff505e15e0)
    at /home/karl/moz/dev/layout/svg/base/src/../../../generic/nsIFrame.h:1759
#7  0x00007f4a260f4b2d in PresShell::UnsuppressAndInvalidate (
    this=0x7f4a05261400)
    at /home/karl/moz/dev/layout/base/nsPresShell.cpp:4512
#8  0x00007f4a260f4c80 in PresShell::UnsuppressPainting (this=0x7f4a05261400)
    at /home/karl/moz/dev/layout/base/nsPresShell.cpp:4544
#9  0x00007f4a260e90f4 in PresShell::sPaintSuppressionCallback (
    aTimer=0x7f4a2d403d00, aPresShell=0x7f4a05261400)
    at /home/karl/moz/dev/layout/base/nsPresShell.cpp:2673
#10 0x00007f4a4771ea64 in nsTimerImpl::Fire (this=0x7f4a2d403d00)
    at /home/karl/moz/dev/xpcom/threads/nsTimerImpl.cpp:427
#11 0x00007f4a4771ec82 in nsTimerEvent::Run (this=0x7f4a1d148f10)
    at /home/karl/moz/dev/xpcom/threads/nsTimerImpl.cpp:519
#12 0x00007f4a47717c8e in nsThread::ProcessNextEvent (this=0x7f4a40449e90, 
    mayWait=1, result=0x7fff505e180c)
    at /home/karl/moz/dev/xpcom/threads/nsThread.cpp:527
#13 0x00007f4a476a2f86 in NS_ProcessNextEvent_P (thread=0x7f4a40449e90, 
    mayWait=1) at nsThreadUtils.cpp:230
#14 0x00007f4a3b6d3890 in nsBaseAppShell::Run (this=0x7f4a40420580)
    at /home/karl/moz/dev/widget/src/xpwidgets/nsBaseAppShell.cpp:170
(gdb) p aRect
$23 = (const nsIntRect &) @0x7fff505e12f0: {x = 0, y = 0, width = 851, 
  height = 623}

Then we get a forced nsIWidget::Update() while
PresShell::FlushPendingNotifications() holds an
nsIViewManager::UpdateViewBatch, so nsViewManager::mRefreshEnabled is false
when nsViewManager::DispatchEvent() handles the NS_PAINT event.

(gdb) bt
#0  nsViewManager::DispatchEvent (this=0x7f4a0512c670, aEvent=0x7fff505df9f0, 
    aView=0x7f4a04ff6c00, aStatus=0x7fff505df914)
    at /home/karl/moz/dev/view/src/nsViewManager.cpp:986
#1  0x00007f4a26610e56 in HandleEvent (aEvent=0x7fff505df9f0)
    at /home/karl/moz/dev/view/src/nsView.cpp:167
#2  0x00007f4a3b6a3508 in nsWindow::DispatchEvent (this=0x7f4a053e49b0, 
    aEvent=0x7fff505df9f0, aStatus=@0x7fff505dfaec)
    at /home/karl/moz/dev/widget/src/gtk2/nsWindow.cpp:573
#3  0x00007f4a3b69fff9 in nsWindow::OnExposeEvent (this=0x7f4a053e49b0, 
    aWidget=0x7f4a27fafc80, aEvent=0x7fff505e0250)
    at /home/karl/moz/dev/widget/src/gtk2/nsWindow.cpp:2331
#4  0x00007f4a3b6a046f in expose_event_cb (widget=0x7f4a27fafc80, 
    event=0x7fff505e0250)
    at /home/karl/moz/dev/widget/src/gtk2/nsWindow.cpp:5370
#5  0x00007f4a469581e5 in _gtk_marshal_BOOLEAN__BOXED (
    closure=0x7f4a27fcd820, return_value=0x7fff505dff30, 
    n_param_values=<value optimized out>, param_values=0x7f4a1ed6a610, 
    invocation_hint=<value optimized out>, marshal_data=0x7f4a3b6a0411)
    at gtkmarshalers.c:84
#6  0x00007f4a44ef7d92 in IA__g_closure_invoke ()
   from /usr/lib64/libgobject-2.0.so.0
#7  0x00007f4a44f0b3cc in signal_emit_unlocked_R ()
   from /usr/lib64/libgobject-2.0.so.0
#8  0x00007f4a44f0c8d0 in IA__g_signal_emit_valist ()
   from /usr/lib64/libgobject-2.0.so.0
#9  0x00007f4a44f0cf54 in IA__g_signal_emit ()
   from /usr/lib64/libgobject-2.0.so.0
#10 0x00007f4a46a4a05a in gtk_widget_event_internal (widget=0x7f4a27fafc80, 
    event=0x7fff505e0250) at gtkwidget.c:4764
#11 0x00007f4a46953709 in IA__gtk_main_do_event (event=0x7fff505e0250)
    at gtkmain.c:1562
#12 0x00007f4a45a48eb0 in gdk_window_process_updates_internal (
    window=0x7f4a05a78b60) at gdkwindow.c:2611
#13 0x00007f4a45a49616 in IA__gdk_window_process_updates (
    window=0x7f4a05a78b60, update_children=0) at gdkwindow.c:2726
#14 0x00007f4a3b6a0cb3 in nsWindow::Update (this=0x7f4a053e49b0)
    at /home/karl/moz/dev/widget/src/gtk2/nsWindow.cpp:1710
#15 0x00007f4a266189df in nsViewManager::UpdateWidgetsForView (
    this=0x7f4a0512c670, aView=0x7f4a04ff6c00)
    at /home/karl/moz/dev/view/src/nsViewManager.cpp:1574
#16 0x00007f4a26618afd in nsViewManager::ForceUpdate (this=0x7f4a0512c670)
    at /home/karl/moz/dev/view/src/nsViewManager.cpp:1837
#17 0x00007f4a26616d81 in nsViewManager::Composite (this=0x7f4a0512c670)
    at /home/karl/moz/dev/view/src/nsViewManager.cpp:572
#18 0x00007f4a26619d87 in nsViewManager::UpdateViewAfterScroll (
    this=0x7f4a0512c670, aView=0x7f4a05777110, aUpdateRegion=@0x7fff505e0510)
    at /home/karl/moz/dev/view/src/nsViewManager.cpp:662
#19 0x00007f4a26614d08 in nsScrollPortView::Scroll (this=0x7f4a05777110, 
    aScrolledView=0x7f4a05704000, aTwipsDelta={x = 1348339440, y = 32767}, 
    aPixDelta={x = 1348339424, y = 32767}, aP2A=60, 
    aConfigurations=@0x7fff505e06a0)
    at /home/karl/moz/dev/view/src/nsScrollPortView.cpp:721
#20 0x00007f4a26615214 in nsScrollPortView::ScrollToImpl (
    this=0x7f4a05777110, aX=0, aY=82200)
    at /home/karl/moz/dev/view/src/nsScrollPortView.cpp:798
#21 0x00007f4a26615461 in nsScrollPortView::ScrollTo (this=0x7f4a05777110, 
    aDestinationX=0, aDestinationY=82199, aUpdateFlags=0)
    at /home/karl/moz/dev/view/src/nsScrollPortView.cpp:243
#22 0x00007f4a260f2e61 in ScrollViewToShowRect (
    aScrollingView=0x7f4a05777188, aRect=@0x7fff505e0890, aVPercent=0, 
    aHPercent=-1) at /home/karl/moz/dev/layout/base/nsPresShell.cpp:4131
#23 0x00007f4a260f6bab in PresShell::DoScrollContentIntoView (
    this=0x7f4a05261400, aContent=0x7f4a405ce240, aVPercent=0, aHPercent=-1)
    at /home/karl/moz/dev/layout/base/nsPresShell.cpp:4207
#24 0x00007f4a260fd2d1 in PresShell::FlushPendingNotifications (
    this=0x7f4a05261400, aType=Flush_InterruptibleLayout)
    at /home/karl/moz/dev/layout/base/nsPresShell.cpp:4765
#25 0x00007f4a2638a1ae in nsDocument::FlushPendingNotifications (
    this=0x7f4a04975800, aType=Flush_InterruptibleLayout)
    at /home/karl/moz/dev/content/base/src/nsDocument.cpp:6299
#26 0x00007f4a260f6d05 in PresShell::ScrollContentIntoView (
    this=0x7f4a05261400, aContent=0x7f4a405ce240, aVPercent=0, aHPercent=-1)
    at /home/karl/moz/dev/layout/base/nsPresShell.cpp:4149
#27 0x00007f4a260eaa80 in PresShell::ScrollToAnchor (this=0x7f4a05261400)
    at /home/karl/moz/dev/layout/base/nsPresShell.cpp:3925
#28 0x00007f4a260bbb34 in DocumentViewerImpl::LoadComplete (
    this=0x7f4a05193500, aStatus=0)
    at /home/karl/moz/dev/layout/base/nsDocumentViewer.cpp:1065
#29 0x00007f4a276116ec in nsDocShell::EndPageLoad (this=0x7f4a1f7c2400, 
    aProgress=0x7f4a1f7c2428, aChannel=0x7f4a04fc5050, aStatus=0)
    at /home/karl/moz/dev/docshell/base/nsDocShell.cpp:5720
#30 0x00007f4a2760c694 in nsDocShell::OnStateChange (this=0x7f4a1f7c2400, 
    aProgress=0x7f4a1f7c2428, aRequest=0x7f4a04fc5050, aStateFlags=131088, 
    aStatus=0) at /home/karl/moz/dev/docshell/base/nsDocShell.cpp:5598
#31 0x00007f4a2764959a in nsDocLoader::FireOnStateChange (
    this=0x7f4a1f7c2400, aProgress=0x7f4a1f7c2428, aRequest=0x7f4a04fc5050, 
    aStateFlags=131088, aStatus=0)
    at /home/karl/moz/dev/uriloader/base/nsDocLoader.cpp:1314
#32 0x00007f4a27649eec in nsDocLoader::doStopDocumentLoad (
    this=0x7f4a1f7c2400, request=0x7f4a04fc5050, aStatus=0)
    at /home/karl/moz/dev/uriloader/base/nsDocLoader.cpp:926
#33 0x00007f4a2764a200 in nsDocLoader::DocLoaderIsEmpty (this=0x7f4a1f7c2400, 
    aFlushLayout=1) at /home/karl/moz/dev/uriloader/base/nsDocLoader.cpp:802
#34 0x00007f4a2764befa in nsDocLoader::ChildDoneWithOnload (
    this=0x7f4a1f7c2400, aChild=0x7f4a0558e000)
    at /home/karl/moz/dev/uriloader/base/nsDocLoader.h:205
#35 0x00007f4a2764a22e in nsDocLoader::DocLoaderIsEmpty (this=0x7f4a0558e000, 
    aFlushLayout=1) at /home/karl/moz/dev/uriloader/base/nsDocLoader.cpp:805
#36 0x00007f4a2764a942 in nsDocLoader::OnStopRequest (this=0x7f4a0558e000, 
    aRequest=0x7f4a05a5c5c0, aCtxt=0x0, aStatus=0)
    at /home/karl/moz/dev/uriloader/base/nsDocLoader.cpp:697
#37 0x00007f4a3a6c1bf7 in nsLoadGroup::RemoveRequest (this=0x7f4a05c57480, 
    request=0x7f4a05a5c5c0, ctxt=0x0, aStatus=0)
    at /home/karl/moz/dev/netwerk/base/src/nsLoadGroup.cpp:680
#38 0x00007f4a26389d6c in nsDocument::DoUnblockOnload (this=0x7f4a04999800)
    at /home/karl/moz/dev/content/base/src/nsDocument.cpp:7052
#39 0x00007f4a2638bc9d in nsDocument::UnblockOnload (this=0x7f4a04999800, 
    aFireSync=1) at /home/karl/moz/dev/content/base/src/nsDocument.cpp:6999
#40 0x00007f4a26397b96 in nsDocument::DispatchContentLoadedEvents (
    this=0x7f4a04999800)
    at /home/karl/moz/dev/content/base/src/nsDocument.cpp:3978
#41 0x00007f4a263a6edc in nsRunnableMethod<nsDocument, void>::Run (
    this=0x7f4a1d15b490) at ../../../dist/include/nsThreadUtils.h:264
#42 0x00007f4a47717c8e in nsThread::ProcessNextEvent (this=0x7f4a40449e90, 
    mayWait=1, result=0x7fff505e180c)
    at /home/karl/moz/dev/xpcom/threads/nsThread.cpp:527
#43 0x00007f4a476a2f86 in NS_ProcessNextEvent_P (thread=0x7f4a40449e90, 
    mayWait=1) at nsThreadUtils.cpp:230
#44 0x00007f4a3b6d3890 in nsBaseAppShell::Run (this=0x7f4a40420580)
    at /home/karl/moz/dev/widget/src/xpwidgets/nsBaseAppShell.cpp:170
(gdb) p *this
$29 = (nsViewManager) {<nsIViewManager> = {<nsISupports> = {
      _vptr.nsISupports = 0x7f4a27094fb0}, <No data fields>}, mRefCnt = {
    mValue = 6}, _mOwningThread = {mThread = 0x7f4a40410040}, 
  mContext = 0x7f4a05a782a0, mObserver = 0x7f4a052614e8, 
  mRootScrollable = 0x7f4a05777188, mMouseLocation = {x = -2147483648, 
    y = -2147483648}, mDelayedResize = {width = -2147483648, 
    height = -2147483648}, mRegionFactory = {mRawPtr = 0x0}, 
  mRootView = 0x7f4a04ff6c00, mRootViewManager = 0x7f4a0512c670, 
  mSynthMouseMoveEvent = {mEvent = 0x0}, mInvalidateEvent = {mEvent = 0x0}, 
  mMouseGrabber = 0x0, mUpdateCnt = 8, mUpdateBatchCnt = 1, 
  mUpdateBatchFlags = 0, mScrollCnt = 1, mRefreshEnabled = 0 '\0', 
  mPainting = 0 '\0', mRecursiveRefreshPending = 0 '\0', 
  mHasPendingUpdates = 1 '\001', mInScroll = 0 '\0'}

nsViewManager::DispatchEvent() paints the default background color and then
records that the damage rect will need to be invalidated when refresh is
enabled.  Without bug 509278, this would cause the page to be painted
correctly but the extra paint should not be necessary.
I don't think there's any point forcing an update when invalidations have been
suppressed.
Attachment #405234 - Flags: review?(roc)
http://hg.mozilla.org/mozilla-central/rev/ae72c91d0b7f
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a1
Component: Layout: View Rendering → Layout: Web Painting
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: