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

Unified Diff: sky/engine/core/html/parser/HTMLElementStack.cpp

Issue 867963006: Add the <t> element and ignore whitespace outside it. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Do it for a whole subtree. Created 5 years, 11 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 | « sky/engine/core/html/parser/HTMLElementStack.h ('k') | sky/examples/city-list/city-list.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/html/parser/HTMLElementStack.cpp
diff --git a/sky/engine/core/html/parser/HTMLElementStack.cpp b/sky/engine/core/html/parser/HTMLElementStack.cpp
index db88829f6ad33980db9e5c56f009af7e5ff06cfe..38e3825d3ce67ceda957c5c43b36b0eba510c678 100644
--- a/sky/engine/core/html/parser/HTMLElementStack.cpp
+++ b/sky/engine/core/html/parser/HTMLElementStack.cpp
@@ -46,6 +46,7 @@ HTMLElementStack::ElementRecord::~ElementRecord()
HTMLElementStack::HTMLElementStack()
: m_rootNode(nullptr)
, m_stackDepth(0)
+ , m_preserveWhiteSpaceCount(0)
{
}
@@ -57,6 +58,7 @@ void HTMLElementStack::popAll()
{
m_rootNode = nullptr;
m_stackDepth = 0;
+ m_preserveWhiteSpaceCount = 0;
while (m_top)
m_top = m_top->releaseNext();
}
@@ -102,12 +104,18 @@ void HTMLElementStack::pushCommon(PassRefPtr<ContainerNode> node)
{
ASSERT(m_rootNode);
+ if (isHTMLTElement(node))
+ ++m_preserveWhiteSpaceCount;
m_stackDepth++;
m_top = adoptPtr(new ElementRecord(node, m_top.release()));
}
void HTMLElementStack::popCommon()
{
+ if (isHTMLTElement(topNode())) {
+ ASSERT(m_preserveWhiteSpaceCount);
+ --m_preserveWhiteSpaceCount;
+ }
m_top = m_top->releaseNext();
m_stackDepth--;
}
« no previous file with comments | « sky/engine/core/html/parser/HTMLElementStack.h ('k') | sky/examples/city-list/city-list.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698