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

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

Issue 2776413002: Reland of Add StyleDifference::needsVisualRectUpdate (Closed)
Patch Set: Fix webkit_unit_tests 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/style/ComputedStyle.cpp
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
index 12a1ffac605679b1800ce9203b106515813337db..a53868d5208a2a2d950d3bc3f2f1dc5cc91b81b5 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -556,6 +556,9 @@ StyleDifference ComputedStyle::visualInvalidationDiff(
else if (diffNeedsPaintInvalidationObject(other))
diff.setNeedsPaintInvalidationObject();
+ if (diffNeedsVisualRectUpdate(other))
+ diff.setNeedsVisualRectUpdate();
+
updatePropertySpecificDifferences(other, diff);
// The following condition needs to be at last, because it may depend on
@@ -997,6 +1000,21 @@ bool ComputedStyle::diffNeedsPaintInvalidationObjectForPaintImage(
return false;
}
+// This doesn't include conditions needing layout or overflow recomputation
+// which implies visual rect update.
+bool ComputedStyle::diffNeedsVisualRectUpdate(
+ const ComputedStyle& other) const {
+ // Visual rect is empty if visibility is hidden.
+ if (visibility() != other.visibility())
+ return true;
+
+ // Need to update visual rect of the resizer.
+ if (resize() != other.resize())
+ return true;
+
+ return false;
+}
+
void ComputedStyle::updatePropertySpecificDifferences(
const ComputedStyle& other,
StyleDifference& diff) const {
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | third_party/WebKit/Source/core/style/StyleDifference.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698