X-Git-Url: http://git.webkit.org/?p=WebKit-https.git;a=blobdiff_plain;f=WebCore%2Fhtml%2FHTMLElementStack.cpp;h=d1a1752bd3c457d32a3ed686e8d81263ab7eff28;hp=a20525c61929c5abe2d9b558ff37f7262d9e64b6;hb=6eff49aa6ffcab45490fa065bc041b14046f968e;hpb=34ca4bd342672b82a6053b63602a95d848b17ee1 diff --git a/WebCore/html/HTMLElementStack.cpp b/WebCore/html/HTMLElementStack.cpp index a20525c..d1a1752 100644 --- a/WebCore/html/HTMLElementStack.cpp +++ b/WebCore/html/HTMLElementStack.cpp @@ -143,6 +143,12 @@ void HTMLElementStack::pop() popCommon(); } +void HTMLElementStack::popUntilElementWithNamespace(const AtomicString& namespaceURI) +{ + while (top()->namespaceURI() != namespaceURI) + pop(); +} + void HTMLElementStack::popUntil(const AtomicString& tagName) { while (!top()->hasLocalName(tagName)) { @@ -333,6 +339,19 @@ bool inScopeCommon(HTMLElementStack::ElementRecord* top, const AtomicString& tar return false; } +bool HTMLElementStack::hasOnlyHTMLElementsInScope() const +{ + for (ElementRecord* record = m_top.get(); record; record = record->next()) { + Element* element = record->element(); + if (element->namespaceURI() != xhtmlNamespaceURI) + return false; + if (isScopeMarker(element)) + return true; + } + ASSERT_NOT_REACHED(); // is always on the stack and is a scope marker. + return true; +} + bool HTMLElementStack::inScope(Element* targetElement) const { for (ElementRecord* pos = m_top.get(); pos; pos = pos->next()) {