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

Unified Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 2322213002: Refactor ElementShadow by separating v0 related features as ElementShadowV0 (Closed)
Patch Set: addressed Created 4 years, 3 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
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLContentElement.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/testing/Internals.cpp
diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp
index 6b46d0bc19e7a980307a5ff053ccfbc35979c890..d1c86963cca7d3e5375da5107164133beaa3df5e 100644
--- a/third_party/WebKit/Source/core/testing/Internals.cpp
+++ b/third_party/WebKit/Source/core/testing/Internals.cpp
@@ -60,6 +60,7 @@
#include "core/dom/TreeScope.h"
#include "core/dom/ViewportDescription.h"
#include "core/dom/shadow/ElementShadow.h"
+#include "core/dom/shadow/ElementShadowV0.h"
#include "core/dom/shadow/FlatTreeTraversal.h"
#include "core/dom/shadow/SelectRuleFeatureSet.h"
#include "core/dom/shadow/ShadowRoot.h"
@@ -440,34 +441,34 @@ Node* Internals::parentTreeScope(Node* node)
bool Internals::hasSelectorForIdInShadow(Element* host, const AtomicString& idValue, ExceptionState& exceptionState)
{
ASSERT(host);
- if (!host->shadow()) {
- exceptionState.throwDOMException(InvalidAccessError, "The host element does not have a shadow.");
+ if (!host->shadow() || host->shadow()->isV1()) {
+ exceptionState.throwDOMException(InvalidAccessError, "The host element does not have a v0 shadow.");
return false;
}
- return host->shadow()->ensureSelectFeatureSet().hasSelectorForId(idValue);
+ return host->shadow()->v0().ensureSelectFeatureSet().hasSelectorForId(idValue);
}
bool Internals::hasSelectorForClassInShadow(Element* host, const AtomicString& className, ExceptionState& exceptionState)
{
ASSERT(host);
- if (!host->shadow()) {
- exceptionState.throwDOMException(InvalidAccessError, "The host element does not have a shadow.");
+ if (!host->shadow() || host->shadow()->isV1()) {
+ exceptionState.throwDOMException(InvalidAccessError, "The host element does not have a v0 shadow.");
return false;
}
- return host->shadow()->ensureSelectFeatureSet().hasSelectorForClass(className);
+ return host->shadow()->v0().ensureSelectFeatureSet().hasSelectorForClass(className);
}
bool Internals::hasSelectorForAttributeInShadow(Element* host, const AtomicString& attributeName, ExceptionState& exceptionState)
{
ASSERT(host);
- if (!host->shadow()) {
- exceptionState.throwDOMException(InvalidAccessError, "The host element does not have a shadow.");
+ if (!host->shadow() || host->shadow()->isV1()) {
+ exceptionState.throwDOMException(InvalidAccessError, "The host element does not have a v0 shadow.");
return false;
}
- return host->shadow()->ensureSelectFeatureSet().hasSelectorForAttribute(attributeName);
+ return host->shadow()->v0().ensureSelectFeatureSet().hasSelectorForAttribute(attributeName);
}
unsigned short Internals::compareTreeScopePosition(const Node* node1, const Node* node2, ExceptionState& exceptionState) const
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLContentElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698