Index: Source/core/dom/Element.cpp |
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp |
index 023c8502de685fe77ee043a506c635694f3f268a..5877c81cc497b088872d9e214e07f35ecc22bff3 100644 |
--- a/Source/core/dom/Element.cpp |
+++ b/Source/core/dom/Element.cpp |
@@ -2532,6 +2532,14 @@ bool Element::matches(const String& selectors, ExceptionState& exceptionState) |
return selectorQuery->matches(*this); |
} |
+Element* Element::closest(const String& selectors, ExceptionState& exceptionState) |
+{ |
+ SelectorQuery* selectorQuery = document().selectorQueryCache().add(AtomicString(selectors), document(), exceptionState); |
+ if (!selectorQuery) |
+ return nullptr; |
+ return selectorQuery->closest(*this); |
+} |
+ |
DOMTokenList& Element::classList() |
{ |
ElementRareData& rareData = ensureElementRareData(); |