Index: third_party/WebKit/Source/core/frame/FrameView.cpp |
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp |
index 93a42bb40dca6076bc944a1ef652c21933171a5a..e7884d15c4b129cedef2386d557e70b13ecfb51e 100644 |
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp |
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp |
@@ -40,6 +40,7 @@ |
#include "core/dom/ResizeObserverController.h" |
#include "core/dom/StyleChangeReason.h" |
#include "core/dom/TaskRunnerHelper.h" |
+#include "core/editing/DragCaret.h" |
#include "core/editing/EditingUtilities.h" |
#include "core/editing/FrameSelection.h" |
#include "core/editing/RenderedPosition.h" |
@@ -93,6 +94,7 @@ |
#include "core/page/scrolling/RootScrollerUtil.h" |
#include "core/page/scrolling/ScrollingCoordinator.h" |
#include "core/page/scrolling/TopDocumentRootScrollerController.h" |
+#include "core/paint/BlockPaintInvalidator.h" |
#include "core/paint/FramePainter.h" |
#include "core/paint/PaintLayer.h" |
#include "core/paint/PaintTiming.h" |
@@ -1340,8 +1342,6 @@ void FrameView::invalidatePaintIfNeeded( |
RELEASE_ASSERT(!layoutViewItem().isNull()); |
if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled()) |
invalidatePaintOfScrollControlsIfNeeded(paintInvalidationState); |
- |
- m_frame->selection().invalidateCaretRect(); |
} |
void FrameView::setNeedsPaintPropertyUpdate() { |
@@ -3041,6 +3041,8 @@ void FrameView::prePaint() { |
forAllNonThrottledFrameViews([](FrameView& frameView) { |
frameView.lifecycle().advanceTo(DocumentLifecycle::InPrePaint); |
+ frameView.m_frame->selection().updateForPaintInvalidation(); |
+ frameView.m_frame->page()->dragCaret().updateForPaintInvalidation(); |
chrishtr
2017/02/07 05:29:12
How about conceptually adding this at the end of l
Xianzhu
2017/02/07 20:00:14
Done, with the functions renamed to updateStyleAnd
|
if (frameView.canThrottleRendering()) { |
// This frame can be throttled but not throttled, meaning we are not in an |
// AllowThrottlingScope. Now this frame may contain dirty paint flags, and |
@@ -3255,6 +3257,10 @@ void FrameView::invalidateTreeIfNeededRecursive() { |
{ |
// For comparison to SlimmingPaintInvalidation. |
SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PrePaint.UpdateTime"); |
+ forAllNonThrottledFrameViews([](FrameView& frameView) { |
+ frameView.m_frame->selection().updateForPaintInvalidation(); |
+ frameView.m_frame->page()->dragCaret().updateForPaintInvalidation(); |
+ }); |
invalidateTreeIfNeededRecursiveInternal(); |
} |
} |
@@ -3267,8 +3273,7 @@ void FrameView::invalidateTreeIfNeededRecursiveInternal() { |
// throttled even though we are (e.g., it didn't compute its visibility yet). |
if (shouldThrottleRendering()) |
return; |
- TRACE_EVENT1("blink", "FrameView::invalidateTreeIfNeededRecursive", "root", |
- layoutView()->debugName().ascii()); |
+ TRACE_EVENT0("blink", "FrameView::invalidateTreeIfNeededRecursiveInternal"); |
Vector<const LayoutObject*> pendingDelayedPaintInvalidations; |
PaintInvalidationState rootPaintInvalidationState( |
@@ -3281,8 +3286,8 @@ void FrameView::invalidateTreeIfNeededRecursiveInternal() { |
// because |
// - the frame is a detached frame; or |
// - it didn't need paint invalidation. |
- // We need to call invalidateTreeIfNeededRecursive() for such frames to finish |
- // required paint invalidation and advance their life cycle state. |
+ // We need to call invalidateTreeIfNeededRecursiveInternal() for such frames |
+ // to finish required paint invalidation and advance their life cycle state. |
for (Frame* child = m_frame->tree().firstChild(); child; |
child = child->tree().nextSibling()) { |
if (child->isLocalFrame()) { |