diff options
Diffstat (limited to 'WebCore/html/parser/HTMLElementStack.cpp')
-rw-r--r-- | WebCore/html/parser/HTMLElementStack.cpp | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/WebCore/html/parser/HTMLElementStack.cpp b/WebCore/html/parser/HTMLElementStack.cpp index b6f4111..123778d 100644 --- a/WebCore/html/parser/HTMLElementStack.cpp +++ b/WebCore/html/parser/HTMLElementStack.cpp @@ -28,6 +28,8 @@ #include "Element.h" #include "HTMLNames.h" +#include "MathMLNames.h" +#include "SVGNames.h" #include <wtf/PassOwnPtr.h> #if ENABLE(SVG) @@ -92,6 +94,19 @@ inline bool isTableRowScopeMarker(Element* element) || element->hasTagName(htmlTag); } +inline bool isForeignContentScopeMarker(Element* element) +{ + return element->hasTagName(MathMLNames::miTag) + || element->hasTagName(MathMLNames::moTag) + || element->hasTagName(MathMLNames::mnTag) + || element->hasTagName(MathMLNames::msTag) + || element->hasTagName(MathMLNames::mtextTag) + || element->hasTagName(SVGNames::foreignObjectTag) + || element->hasTagName(SVGNames::descTag) + || element->hasTagName(SVGNames::titleTag) + || element->namespaceURI() == HTMLNames::xhtmlNamespaceURI; +} + inline bool isButtonScopeMarker(Element* element) { return isScopeMarker(element) @@ -186,12 +201,6 @@ 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)) { @@ -247,6 +256,12 @@ void HTMLElementStack::popUntilTableRowScopeMarker() pop(); } +void HTMLElementStack::popUntilForeignContentScopeMarker() +{ + while (!isForeignContentScopeMarker(top())) + pop(); +} + void HTMLElementStack::pushHTMLHtmlElement(PassRefPtr<Element> element) { ASSERT(!m_top); // <html> should always be the bottom of the stack. |