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

Unified Diff: third_party/WebKit/Source/core/style/CollapsedBorderValue.h

Issue 1549693002: Optimize collapsed border painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Field instead of global HashMap Created 5 years 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/CollapsedBorderValue.h
diff --git a/third_party/WebKit/Source/core/style/CollapsedBorderValue.h b/third_party/WebKit/Source/core/style/CollapsedBorderValue.h
index f780d7d0756ba66f6b30ba189ae823c51ea7fa41..9abf8db6b2469bd6c013edeb9cbcc86d41f80783 100644
--- a/third_party/WebKit/Source/core/style/CollapsedBorderValue.h
+++ b/third_party/WebKit/Source/core/style/CollapsedBorderValue.h
@@ -70,9 +70,21 @@ public:
return color() == o.color() && isTransparent() == o.isTransparent() && isSameIgnoringColor(o);
}
+ bool isVisible() const
+ {
+ return style() > BHIDDEN && !isTransparent() && exists();
+ }
+
bool shouldPaint(const CollapsedBorderValue& tableCurrentBorderValue) const
{
- return style() > BHIDDEN && !isTransparent() && exists() && isSameIgnoringColor(tableCurrentBorderValue);
+ return isVisible() && isSameIgnoringColor(tableCurrentBorderValue);
Julien - ping for review 2016/01/08 14:18:15 Shouldn't this be ASSERT(isVisible()) as we don't
Xianzhu 2016/01/08 17:50:45 A cell may have e.g. 2 visible borders and 2 invis
Julien - ping for review 2016/01/11 18:11:36 OK!
+ }
+
+ bool isEquivalentForPainting(const CollapsedBorderValue& o) const
+ {
+ if (!isVisible() && !o.isVisible())
+ return true;
+ return equals(o);
}
private:

Powered by Google App Engine
This is Rietveld 408576698