| Index: sky/engine/core/dom/TreeScope.cpp
|
| diff --git a/sky/engine/core/dom/TreeScope.cpp b/sky/engine/core/dom/TreeScope.cpp
|
| index 446fc244d49a66d4aaed9e8f7a53ff8b0c68bd81..b4cd28df9e8f01fa2a1bb1c9b842f8a38dc6f5ef 100644
|
| --- a/sky/engine/core/dom/TreeScope.cpp
|
| +++ b/sky/engine/core/dom/TreeScope.cpp
|
| @@ -28,6 +28,7 @@
|
| #include "sky/engine/core/dom/TreeScope.h"
|
|
|
| #include "gen/sky/core/HTMLNames.h"
|
| +#include "sky/engine/core/css/StyleSheetList.h"
|
| #include "sky/engine/core/css/resolver/ScopedStyleResolver.h"
|
| #include "sky/engine/core/dom/ContainerNode.h"
|
| #include "sky/engine/core/dom/Document.h"
|
| @@ -420,4 +421,22 @@ void TreeScope::setNeedsStyleRecalcForViewportUnits()
|
| }
|
| }
|
|
|
| +bool TreeScope::hasSameStyles(TreeScope& other)
|
| +{
|
| + if (this == &other)
|
| + return true;
|
| + const Vector<RefPtr<blink::CSSStyleSheet> >& list = document().styleEngine()->styleSheetsForStyleSheetList(*this);
|
| + const Vector<RefPtr<blink::CSSStyleSheet> >& otherList = document().styleEngine()->styleSheetsForStyleSheetList(other);
|
| +
|
| + if (list.size() != otherList.size())
|
| + return false;
|
| +
|
| + for (size_t i = 0; i < list.size(); i++) {
|
| + if (list[i]->contents() != otherList[i]->contents())
|
| + return false;
|
| + }
|
| +
|
| + return true;
|
| +}
|
| +
|
| } // namespace blink
|
|
|