Index: Source/core/html/parser/HTMLTreeBuilder.cpp |
diff --git a/Source/core/html/parser/HTMLTreeBuilder.cpp b/Source/core/html/parser/HTMLTreeBuilder.cpp |
index a79d14de285309ccdc727ae894e169da10b32c47..2c2bf920db72442114442757b0bc0a83ed71a16c 100644 |
--- a/Source/core/html/parser/HTMLTreeBuilder.cpp |
+++ b/Source/core/html/parser/HTMLTreeBuilder.cpp |
@@ -867,7 +867,7 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken* token) |
m_tree.insertHTMLElement(token); |
return; |
} |
- if (token->name() == rpTag || token->name() == rtTag) { |
+ if (token->name() == rbTag || token->name() == rtcTag) { |
if (m_tree.openElements()->inScope(rubyTag.localName())) { |
m_tree.generateImpliedEndTags(); |
if (!m_tree.currentStackItem()->hasTagName(rubyTag)) |
@@ -876,6 +876,15 @@ void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken* token) |
m_tree.insertHTMLElement(token); |
return; |
} |
+ if (token->name() == rtTag || token->name() == rpTag) { |
+ if (m_tree.openElements()->inScope(rubyTag.localName())) { |
+ m_tree.generateImpliedEndTagsWithExclusion(rtcTag.localName()); |
+ if (!m_tree.currentStackItem()->hasTagName(rubyTag) && !m_tree.currentStackItem()->hasTagName(rtcTag)) |
+ parseError(token); |
+ } |
+ m_tree.insertHTMLElement(token); |
+ return; |
+ } |
if (token->name() == MathMLNames::mathTag.localName()) { |
m_tree.reconstructTheActiveFormattingElements(); |
adjustMathMLAttributes(token); |