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

Unified Diff: sky/engine/core/html/parser/HTMLConstructionSite.h

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/HTMLTagNames.in ('k') | sky/engine/core/html/parser/HTMLConstructionSite.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/html/parser/HTMLConstructionSite.h
diff --git a/sky/engine/core/html/parser/HTMLConstructionSite.h b/sky/engine/core/html/parser/HTMLConstructionSite.h
index 9f16c298a6ac3d68bb2abf472edfae1a0e42c9a8..2e12c0f003c827c907453909a35d566f7a9b0b85 100644
--- a/sky/engine/core/html/parser/HTMLConstructionSite.h
+++ b/sky/engine/core/html/parser/HTMLConstructionSite.h
@@ -63,14 +63,6 @@ WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::HTMLConstructionSiteTa
namespace blink {
-// Note: These are intentionally ordered so that when we concatonate
-// strings and whitespaces the resulting whitespace is ws = min(ws1, ws2).
-enum WhitespaceMode {
- WhitespaceUnknown,
- NotAllWhitespace,
- AllWhitespace,
-};
-
class AtomicHTMLToken;
class Document;
class Element;
@@ -113,7 +105,7 @@ public:
void insertHTMLElement(AtomicHTMLToken*);
void insertSelfClosingHTMLElement(AtomicHTMLToken*);
void insertScriptElement(AtomicHTMLToken*);
- void insertTextNode(const String&, WhitespaceMode = WhitespaceUnknown);
+ void insertTextNode(const String&);
bool isEmpty() const { return !m_openElements.stackDepth(); }
Element* currentElement() const { return m_openElements.top(); }
@@ -148,21 +140,18 @@ private:
DISALLOW_ALLOCATION();
public:
PendingText()
- : whitespaceMode(WhitespaceUnknown)
{
}
- void append(PassRefPtr<ContainerNode> newParent, const String& newString, WhitespaceMode newWhitespaceMode)
+ void append(PassRefPtr<ContainerNode> newParent, const String& newString)
{
ASSERT(!parent || parent == newParent);
parent = newParent;
stringBuilder.append(newString);
- whitespaceMode = std::min(whitespaceMode, newWhitespaceMode);
}
void swap(PendingText& other)
{
- std::swap(whitespaceMode, other.whitespaceMode);
parent.swap(other.parent);
stringBuilder.swap(other.stringBuilder);
}
@@ -175,17 +164,15 @@ private:
bool isEmpty()
{
- // When the stringbuilder is empty, the parent and whitespace should also be "empty".
+ // When the stringbuilder is empty, the parent should also be "empty".
ASSERT(stringBuilder.isEmpty() == !parent);
ASSERT(!stringBuilder.isEmpty() || !nextChild);
- ASSERT(!stringBuilder.isEmpty() || (whitespaceMode == WhitespaceUnknown));
return stringBuilder.isEmpty();
}
RefPtr<ContainerNode> parent;
RefPtr<Node> nextChild;
StringBuilder stringBuilder;
- WhitespaceMode whitespaceMode;
};
PendingText m_pendingText;
« no previous file with comments | « sky/engine/core/html/HTMLTagNames.in ('k') | sky/engine/core/html/parser/HTMLConstructionSite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698