Index: Source/WebCore/html/parser/HTMLElementStack.cpp |
=================================================================== |
--- Source/WebCore/html/parser/HTMLElementStack.cpp (revision 116143) |
+++ Source/WebCore/html/parser/HTMLElementStack.cpp (working copy) |
@@ -386,10 +386,12 @@ |
Element* HTMLElementStack::oneBelowTop() const |
{ |
- // We should never be calling this if it could be 0. |
+ // We should never call this if there are fewer than 2 elements on the stack. |
ASSERT(m_top); |
ASSERT(m_top->next()); |
- return m_top->next()->element(); |
+ if (m_top->next()->node()->isElementNode()) |
+ return m_top->next()->element(); |
+ return 0; |
} |
Element* HTMLElementStack::bottom() const |