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

Unified Diff: sky/engine/core/dom/shadow/ElementShadow.cpp

Issue 796713002: Turn StyleSharing to 11. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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: sky/engine/core/dom/shadow/ElementShadow.cpp
diff --git a/sky/engine/core/dom/shadow/ElementShadow.cpp b/sky/engine/core/dom/shadow/ElementShadow.cpp
index 00b8079b99dd570f306e652d7906ae02bd1c9062..c2f60f6379b16b0ff3a0a996bc9f05eb8bcfb8b6 100644
--- a/sky/engine/core/dom/shadow/ElementShadow.cpp
+++ b/sky/engine/core/dom/shadow/ElementShadow.cpp
@@ -208,23 +208,11 @@ bool ElementShadow::hasSameStyles(const ElementShadow* other) const
{
ShadowRoot* root = m_shadowRoot;
ShadowRoot* otherRoot = other->shadowRoot();
- if (root || otherRoot) {
- if (!root || !otherRoot)
- return false;
-
- StyleSheetList* list = root->styleSheets();
- StyleSheetList* otherList = otherRoot->styleSheets();
-
- if (list->length() != otherList->length())
- return false;
-
- for (size_t i = 0; i < list->length(); i++) {
- if (list->item(i)->contents() != otherList->item(i)->contents())
- return false;
- }
- }
-
- return true;
+ if (!root && !otherRoot)
+ return true;
+ if (root && otherRoot)
+ return root->hasSameStyles(*otherRoot);
+ return false;
}
const InsertionPoint* ElementShadow::finalDestinationInsertionPointFor(const Node* key) const

Powered by Google App Engine
This is Rietveld 408576698