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

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 1809643008: Adding or changing any of box-shadow, outline, or border-image-outset does not need a layout.. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Created 4 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/style/ComputedStyle.cpp
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
index adb73a602df75ebd5d50748f5c497c90c5da03b8..cd0d49939b05876d3d49eba692cd252a3cb526d7 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -535,10 +535,6 @@ bool ComputedStyle::diffNeedsFullLayoutAndPaintInvalidation(const ComputedStyle&
&& *rareNonInheritedData->m_flexibleBox.get() != *other.rareNonInheritedData->m_flexibleBox.get())
return true;
- // FIXME: We should add an optimized form of layout that just recomputes visual overflow.
- if (!rareNonInheritedData->shadowDataEquivalent(*other.rareNonInheritedData.get()))
- return true;
-
if (!rareNonInheritedData->reflectionDataEquivalent(*other.rareNonInheritedData.get()))
return true;
@@ -659,11 +655,6 @@ bool ComputedStyle::diffNeedsFullLayoutAndPaintInvalidation(const ComputedStyle&
if ((visibility() == COLLAPSE) != (other.visibility() == COLLAPSE))
return true;
- if (!m_background->outline().visuallyEqual(other.m_background->outline())) {
- // FIXME: We only really need to recompute the overflow but we don't have an optimized layout for it.
- return true;
- }
-
if (hasPseudoStyle(PseudoIdScrollbar) != other.hasPseudoStyle(PseudoIdScrollbar))
return true;
@@ -733,6 +724,8 @@ bool ComputedStyle::diffNeedsPaintInvalidationLayer(const ComputedStyle& other)
bool ComputedStyle::diffNeedsPaintInvalidationObject(const ComputedStyle& other) const
{
+ if (!m_background->outline().visuallyEqual(other.m_background->outline()))
+ return true;
Xianzhu 2016/03/22 17:02:05 We can avoid this check by adjusting visualOverflo
Xianzhu 2016/03/23 20:28:26 Please ignore this comment if you take the StyleDi
if (inherited_flags._visibility != other.inherited_flags._visibility
|| inherited_flags.m_printColorAdjust != other.inherited_flags.m_printColorAdjust
|| inherited_flags._insideLink != other.inherited_flags._insideLink
@@ -751,6 +744,7 @@ bool ComputedStyle::diffNeedsPaintInvalidationObject(const ComputedStyle& other)
if (rareNonInheritedData->userDrag != other.rareNonInheritedData->userDrag
|| rareNonInheritedData->m_objectFit != other.rareNonInheritedData->m_objectFit
|| rareNonInheritedData->m_objectPosition != other.rareNonInheritedData->m_objectPosition
+ || !rareNonInheritedData->shadowDataEquivalent(*other.rareNonInheritedData.get())
Xianzhu 2016/03/22 17:02:05 Ditto.
|| !rareNonInheritedData->shapeOutsideDataEquivalent(*other.rareNonInheritedData.get())
|| !rareNonInheritedData->clipPathDataEquivalent(*other.rareNonInheritedData.get())
|| (visitedLinkBorderLeftColor() != other.visitedLinkBorderLeftColor() && borderLeftWidth())
@@ -784,10 +778,16 @@ void ComputedStyle::updatePropertySpecificDifferences(const ComputedStyle& other
if (rareNonInheritedData->m_filter != other.rareNonInheritedData->m_filter)
diff.setFilterChanged();
+ if (!rareNonInheritedData->shadowDataEquivalent(*other.rareNonInheritedData.get()))
+ diff.setVisualOverflowChanged();
Xianzhu 2016/03/23 20:28:26 Move this to diffNeedsRecomputeOverflow() if you t
+
if (rareNonInheritedData->m_backdropFilter != other.rareNonInheritedData->m_backdropFilter)
diff.setBackdropFilterChanged();
}
+ if (!m_background->outline().visuallyEqual(other.m_background->outline()) || !surround->border.visualOverflowEqual(other.surround->border))
+ diff.setVisualOverflowChanged();
Xianzhu 2016/03/23 20:28:26 Ditto.
+
if (!diff.needsPaintInvalidation()) {
if (inherited->color != other.inherited->color
|| inherited->visitedLinkColor != other.inherited->visitedLinkColor

Powered by Google App Engine
This is Rietveld 408576698