Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2737043002: Fix caret paint invalidation issue on partial lifecycle updates (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1358 #if DCHECK_IS_ON() 1358 #if DCHECK_IS_ON()
1359 layoutView()->assertSubtreeClearedPaintInvalidationFlags(); 1359 layoutView()->assertSubtreeClearedPaintInvalidationFlags();
1360 #endif 1360 #endif
1361 1361
1362 lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean); 1362 lifecycle().advanceTo(DocumentLifecycle::PaintInvalidationClean);
1363 } 1363 }
1364 1364
1365 void FrameView::invalidatePaintIfNeeded( 1365 void FrameView::invalidatePaintIfNeeded(
1366 const PaintInvalidationState& paintInvalidationState) { 1366 const PaintInvalidationState& paintInvalidationState) {
1367 RELEASE_ASSERT(!layoutViewItem().isNull()); 1367 RELEASE_ASSERT(!layoutViewItem().isNull());
1368 updateCaretsForPaintInvalidation();
1368 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled()) 1369 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled())
1369 invalidatePaintOfScrollControlsIfNeeded(paintInvalidationState); 1370 invalidatePaintOfScrollControlsIfNeeded(paintInvalidationState);
1370 } 1371 }
1371 1372
1372 void FrameView::setNeedsPaintPropertyUpdate() { 1373 void FrameView::setNeedsPaintPropertyUpdate() {
1373 m_needsPaintPropertyUpdate = true; 1374 m_needsPaintPropertyUpdate = true;
1374 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { 1375 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
1375 if (auto* layoutView = this->layoutView()) { 1376 if (auto* layoutView = this->layoutView()) {
1376 layoutView->setNeedsPaintPropertyUpdate(); 1377 layoutView->setNeedsPaintPropertyUpdate();
1377 return; 1378 return;
(...skipping 1960 matching lines...) Expand 10 before | Expand all | Expand 10 after
3338 updateWidgetGeometriesIfNeeded(); 3339 updateWidgetGeometriesIfNeeded();
3339 3340
3340 if (lifecycle().state() < DocumentLifecycle::LayoutClean) 3341 if (lifecycle().state() < DocumentLifecycle::LayoutClean)
3341 lifecycle().advanceTo(DocumentLifecycle::LayoutClean); 3342 lifecycle().advanceTo(DocumentLifecycle::LayoutClean);
3342 3343
3343 // Ensure that we become visually non-empty eventually. 3344 // Ensure that we become visually non-empty eventually.
3344 // TODO(esprehn): This should check isRenderingReady() instead. 3345 // TODO(esprehn): This should check isRenderingReady() instead.
3345 if (frame().document()->hasFinishedParsing() && 3346 if (frame().document()->hasFinishedParsing() &&
3346 frame().loader().stateMachine()->committedFirstRealDocumentLoad()) 3347 frame().loader().stateMachine()->committedFirstRealDocumentLoad())
3347 m_isVisuallyNonEmpty = true; 3348 m_isVisuallyNonEmpty = true;
3348
3349 frame().selection().updateStyleAndLayoutIfNeeded();
3350 frame().page()->dragCaret().updateStyleAndLayoutIfNeeded();
3351 } 3349 }
3352 3350
3353 void FrameView::invalidateTreeIfNeededRecursive() { 3351 void FrameView::invalidateTreeIfNeededRecursive() {
3354 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PaintInvalidation.UpdateTime"); 3352 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PaintInvalidation.UpdateTime");
3355 { 3353 {
3356 // For comparison to SlimmingPaintInvalidation. 3354 // For comparison to SlimmingPaintInvalidation.
3357 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PrePaint.UpdateTime"); 3355 SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.PrePaint.UpdateTime");
3358 invalidateTreeIfNeededRecursiveInternal(); 3356 invalidateTreeIfNeededRecursiveInternal();
3359 } 3357 }
3360 } 3358 }
(...skipping 1888 matching lines...) Expand 10 before | Expand all | Expand 10 after
5249 5247
5250 void FrameView::setAnimationHost( 5248 void FrameView::setAnimationHost(
5251 std::unique_ptr<CompositorAnimationHost> host) { 5249 std::unique_ptr<CompositorAnimationHost> host) {
5252 m_animationHost = std::move(host); 5250 m_animationHost = std::move(host);
5253 } 5251 }
5254 5252
5255 LayoutUnit FrameView::caretWidth() const { 5253 LayoutUnit FrameView::caretWidth() const {
5256 return LayoutUnit(getHostWindow()->windowToViewportScalar(1)); 5254 return LayoutUnit(getHostWindow()->windowToViewportScalar(1));
5257 } 5255 }
5258 5256
5257 void FrameView::updateCaretsForPaintInvalidation() {
5258 m_frame->selection().updateForPaintInvalidation();
5259 if (m_frame->isMainFrame())
chrishtr 2017/03/08 01:41:56 This conditional appears to be new. Is that correc
5260 m_frame->page()->dragCaret().updateForPaintInvalidation();
5261 }
5262
5259 } // namespace blink 5263 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698