New issue
Advanced search Search tips

Issue 591468 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

synchronizedPaint() causes painting when outside of BeginMainFrame

Project Member Reported by esprehn@chromium.org, Mar 2 2016

Issue description

updateAllLifecyclePhases now executes synchronizedPaint, but we actually call into updateAllLifecyclePhases for many reasons that are not related to producing a frame, ex. inside EventHandler.cpp, inside the CheckedPreferredSize machinery on Mac and WebView, and many other places. This means that we end up re-recording the skp's for the entire page potentially over and over again while events dispatch or other things happen in the page. I've seen this in a number of traces recently though I don't have one on hand.
 
Cc: ojan@chromium.org
Status: Available (was: Untriaged)
FYI paint should only be doing a non-trivial amount of work if paint is actually dirty during the frame. But I agree that call sites should only advance the lifecycle as far as their use case requires.
Paint is almost always dirty though, if the page mutates the DOM and then dispatches an event, then mutates the DOM again, we record the skps twice.
Owner: chrishtr@chromium.org
Status: Assigned (was: Available)
In such cases, yes. The whole lifecycle is dirty. I also agree that this bug is
pretty easy to fix in the M51 timeframe.

Comment 5 by ojan@chromium.org, Mar 2 2016

Cc: wangxianzhu@chromium.org
Direct callers of FrameView::updateAllLifecyclePhases other than PageAnimator:

1. LocalFrame::nodeImage
2. LocalFrame::LocalFrame::dragImageForSelection
3. EventHandler::handleGestureTap
4. SVGImage::imagePicture
5. SVGImageChromeClient::animationTimerFired
6. InspectorOverlay::updateAllLifecyclePhases
7. WebAXObject::updateLayoutAndCheckValidity
8. ChromePrintContext::spoolSinglePage
9. ChromePrintContext::spoolAllPagesWithBoundaries
Direct callers of PageWidgetDelegate::updateAllLifecyclePhases:

Three WebWidget subclasses: WebViewImpl, WebPagePopupImpl, and WebFrameWidgetImpl.

Direct callers of WebViewImpl::updateAllLifecyclePhases:

1. WebViewImpl::enableTapHighlights
2. WebViewImpl::resizeViewWhileAnchored
3. WebViewImpl::contentsPreferredMinimumSize
4. WebViewImpl::setBaseBackgroundColor

Direct callers of WebFrameWidgetImpl::updateAllLifecyclePhases:

1. WebFrameWidgetImpl::setBaseBackgroundColor

No callers of WebPagePopupImpl::updateAllLifecyclePhases.

Callers of WebWidget::updateAllLifecyclePhases:

1. WebViewPlugin::updateAllLifecyclePhases
2. WebViewPlugin::updateGeometry
3. RenderWidget::UpdateVisualState
The only call sites that really want paint are these:

WebViewImpl::enableTapHighlights
WebViewImpl::resizeViewWhileAnchored
WebViewImpl::contentsPreferredMinimumSize
WebViewImpl::setBaseBackgroundColor
WebFrameWidgetImpl::setBaseBackgroundColor
WebViewPlugin::updateAllLifecyclePhases
WebViewPlugin::updateGeometry
RenderWidget::UpdateVisualState

The others probably just want FrameView::updateLifecycleToCompositingCleanPlusScrolling

Comment 9 by ojan@chromium.org, Apr 5 2016

Why do these want to paint?

WebViewImpl::enableTapHighlights
WebViewImpl::resizeViewWhileAnchored
WebViewImpl::contentsPreferredMinimumSize
WebViewImpl::setBaseBackgroundColor
WebFrameWidgetImpl::setBaseBackgroundColor
WebViewPlugin::updateGeometry


And r386304 is causing  bug 602961 . Fix? Revert?
Thanks for the report. I'll look into  bug 602961  today.
Project Member

Comment 13 by bugdroid1@chromium.org, Apr 14 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f07d9b4a2ebb30cb77d3cca7d59e1f3c674e81eb

commit f07d9b4a2ebb30cb77d3cca7d59e1f3c674e81eb
Author: wangxianzhu <wangxianzhu@chromium.org>
Date: Thu Apr 14 00:50:00 2016

Partly revert https://codereview.chromium.org/1860273003/ where paint follows

Restored updateLifecycleToCompositingCleanPlusScrolling() to
updateAllLifecyclePhases() where paint follows, because some paint
code may depend on the result of lifecycle phases between
CompositingUpdateClean and InPaint. For example, we update
table collapsed borders and layer empty phase information during
paint invalidtion, which are needed by paint.

BUG= 602961 , 591468 , 603230 

Review URL: https://codereview.chromium.org/1890603002

Cr-Commit-Position: refs/heads/master@{#387178}

[modify] https://crrev.com/f07d9b4a2ebb30cb77d3cca7d59e1f3c674e81eb/third_party/WebKit/Source/core/frame/LocalFrame.cpp
[modify] https://crrev.com/f07d9b4a2ebb30cb77d3cca7d59e1f3c674e81eb/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
[modify] https://crrev.com/f07d9b4a2ebb30cb77d3cca7d59e1f3c674e81eb/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

 Issue 603230  has been merged into this issue.
Project Member

Comment 15 by bugdroid1@chromium.org, Apr 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/04e4faa37b382d13044fa6ceb41fc5308dbc8c2c

commit 04e4faa37b382d13044fa6ceb41fc5308dbc8c2c
Author: chrishtr <chrishtr@chromium.org>
Date: Fri Apr 22 03:48:23 2016

Add FrameView::updateAllLifecyclePhasesExceptPaint and use it in a few cases.

BUG= 591468 

Review URL: https://codereview.chromium.org/1909033003

Cr-Commit-Position: refs/heads/master@{#389010}

[modify] https://crrev.com/04e4faa37b382d13044fa6ceb41fc5308dbc8c2c/third_party/WebKit/Source/core/dom/DocumentLifecycle.cpp
[modify] https://crrev.com/04e4faa37b382d13044fa6ceb41fc5308dbc8c2c/third_party/WebKit/Source/core/frame/FrameView.cpp
[modify] https://crrev.com/04e4faa37b382d13044fa6ceb41fc5308dbc8c2c/third_party/WebKit/Source/core/frame/FrameView.h
[modify] https://crrev.com/04e4faa37b382d13044fa6ceb41fc5308dbc8c2c/third_party/WebKit/Source/core/frame/LocalFrame.cpp
[modify] https://crrev.com/04e4faa37b382d13044fa6ceb41fc5308dbc8c2c/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.h
[modify] https://crrev.com/04e4faa37b382d13044fa6ceb41fc5308dbc8c2c/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
[modify] https://crrev.com/04e4faa37b382d13044fa6ceb41fc5308dbc8c2c/third_party/WebKit/Source/core/paint/TableCellPainterTest.cpp
[modify] https://crrev.com/04e4faa37b382d13044fa6ceb41fc5308dbc8c2c/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
[modify] https://crrev.com/04e4faa37b382d13044fa6ceb41fc5308dbc8c2c/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Project Member

Comment 16 by bugdroid1@chromium.org, Aug 2 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/eca522bb64cb9a44646a8d2749ec00b768d3490b

commit eca522bb64cb9a44646a8d2749ec00b768d3490b
Author: chrishtr <chrishtr@chromium.org>
Date: Tue Aug 02 22:32:58 2016

Schedule animation when setting base background color, rather than forcing an update.

Also, small cleanup to make FrameView::scheduleRelayoutOfSubtree match
FrameView::scheduleRelayout.

BUG= 591468 

Review-Url: https://codereview.chromium.org/2194423002
Cr-Commit-Position: refs/heads/master@{#409352}

[modify] https://crrev.com/eca522bb64cb9a44646a8d2749ec00b768d3490b/third_party/WebKit/Source/core/frame/FrameView.cpp
[modify] https://crrev.com/eca522bb64cb9a44646a8d2749ec00b768d3490b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
[modify] https://crrev.com/eca522bb64cb9a44646a8d2749ec00b768d3490b/third_party/WebKit/Source/web/WebViewImpl.cpp

Labels: -Pri-1 Pri-2
Status: Fixed (was: Assigned)
Project Member

Comment 19 by bugdroid1@chromium.org, Aug 12 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f66f629cc6107328e6a445d158e7a27fa91668df

commit f66f629cc6107328e6a445d158e7a27fa91668df
Author: chrishtr <chrishtr@chromium.org>
Date: Fri Aug 12 21:59:21 2016

Remove apparently redundant uses of updatePageOverlays in WebViewImpl.
BUG= 591468 

Review-Url: https://codereview.chromium.org/2238343002
Cr-Commit-Position: refs/heads/master@{#411792}

[modify] https://crrev.com/f66f629cc6107328e6a445d158e7a27fa91668df/third_party/WebKit/Source/web/WebViewImpl.cpp

Sign in to add a comment