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

Unified Diff: Source/WebCore/html/parser/HTMLElementStack.cpp

Issue 12518024: Merge 144128 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 years, 9 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 | « no previous file | Source/WebCore/html/parser/HTMLTreeBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/html/parser/HTMLElementStack.cpp
===================================================================
--- Source/WebCore/html/parser/HTMLElementStack.cpp (revision 145466)
+++ Source/WebCore/html/parser/HTMLElementStack.cpp (working copy)
@@ -459,6 +459,20 @@
return false;
}
+template <bool isMarker(HTMLStackItem*)>
+bool inScopeCommon(HTMLElementStack::ElementRecord* top, const QualifiedName& targetTag)
+{
+ for (HTMLElementStack::ElementRecord* pos = top; pos; pos = pos->next()) {
+ HTMLStackItem* item = pos->stackItem().get();
+ if (item->hasTagName(targetTag))
+ return true;
+ if (isMarker(item))
+ return false;
+ }
+ ASSERT_NOT_REACHED(); // <html> is always on the stack and is a scope marker.
+ return false;
+}
+
bool HTMLElementStack::hasNumberedHeaderElementInScope() const
{
for (ElementRecord* record = m_top.get(); record; record = record->next()) {
@@ -514,8 +528,7 @@
bool HTMLElementStack::inTableScope(const QualifiedName& tagName) const
{
- // FIXME: Is localName() right for non-html elements?
- return inTableScope(tagName.localName());
+ return inScopeCommon<isTableScopeMarker>(m_top.get(), tagName);
}
bool HTMLElementStack::inButtonScope(const AtomicString& targetTag) const
« no previous file with comments | « no previous file | Source/WebCore/html/parser/HTMLTreeBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698