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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2761863002: Add StyleDifference::needsVisualRectUpdate (Closed)
Patch Set: Still keep visibility change detection for full paint invalidation. Will optimize in later CLs 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index f1a02b92ae994f4d8b3b39d222de81e8fa5572c3..8be3e614b7f42a11aa43f40bd9a364464c2847c7 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -1736,6 +1736,9 @@ void LayoutObject::setStyle(PassRefPtr<ComputedStyle> style) {
setShouldDoFullPaintInvalidationWithoutGeometryChange();
}
+ if (diff.needsVisualRectUpdate())
+ setMayNeedPaintInvalidation();
+
// Text nodes share style with their parents but the paint properties don't
// apply to them, hence the !isText() check.
if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && !isText() &&
@@ -1757,20 +1760,18 @@ void LayoutObject::setStyle(PassRefPtr<ComputedStyle> style) {
void LayoutObject::styleWillChange(StyleDifference diff,
const ComputedStyle& newStyle) {
if (m_style) {
+ bool visibilityChanged = m_style->visibility() != newStyle.visibility();
// If our z-index changes value or our visibility changes,
// we need to dirty our stacking context's z-order list.
- bool visibilityChanged =
- m_style->visibility() != newStyle.visibility() ||
- m_style->zIndex() != newStyle.zIndex() ||
- m_style->isStackingContext() != newStyle.isStackingContext();
- if (visibilityChanged) {
+ if (visibilityChanged || m_style->zIndex() != newStyle.zIndex() ||
+ m_style->isStackingContext() != newStyle.isStackingContext()) {
document().setAnnotatedRegionsDirty(true);
if (AXObjectCache* cache = document().existingAXObjectCache())
cache->childrenChanged(parent());
}
// Keep layer hierarchy visibility bits up to date if visibility changes.
- if (m_style->visibility() != newStyle.visibility()) {
+ if (visibilityChanged) {
// We might not have an enclosing layer yet because we might not be in the
// tree.
if (PaintLayer* layer = enclosingLayer())

Powered by Google App Engine
This is Rietveld 408576698