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

Unified Diff: sky/engine/core/dom/Element.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/dom/Element.h ('k') | sky/engine/core/dom/Node.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/Element.cpp
diff --git a/sky/engine/core/dom/Element.cpp b/sky/engine/core/dom/Element.cpp
index 54d9b46b1d269ed875a743756fb25aeca8f7ae44..282eafa9b2a962da180cd5b7f1b2566831d1e282 100644
--- a/sky/engine/core/dom/Element.cpp
+++ b/sky/engine/core/dom/Element.cpp
@@ -905,7 +905,7 @@ PassRefPtr<RenderStyle> Element::styleForRenderer()
return style.release();
}
-void Element::recalcStyle(StyleRecalcChange change, Text* nextTextSibling)
+void Element::recalcStyle(StyleRecalcChange change)
{
ASSERT(document().inStyleRecalc());
ASSERT(!parentOrShadowHostNode()->needsStyleRecalc());
@@ -933,9 +933,6 @@ void Element::recalcStyle(StyleRecalcChange change, Text* nextTextSibling)
recalcChildStyle(change);
clearChildNeedsStyleRecalc();
}
-
- if (change == Reattach)
- reattachWhitespaceSiblings(nextTextSibling);
}
StyleRecalcChange Element::recalcOwnStyle(StyleRecalcChange change)
@@ -954,11 +951,8 @@ StyleRecalcChange Element::recalcOwnStyle(StyleRecalcChange change)
if (localChange == Reattach) {
AttachContext reattachContext;
reattachContext.resolvedStyle = newStyle.get();
- bool rendererWillChange = needsAttach() || renderer();
reattach(reattachContext);
- if (rendererWillChange || renderer())
- return Reattach;
- return ReattachNoRenderer;
+ return Reattach;
}
ASSERT(oldStyle);
@@ -994,19 +988,15 @@ void Element::recalcChildStyle(StyleRecalcChange change)
// child and work our way back means in the common case, we'll find the insertion point in O(1) time.
// See crbug.com/288225
StyleResolver& styleResolver = document().styleResolver();
- Text* lastTextNode = 0;
for (Node* child = lastChild(); child; child = child->previousSibling()) {
if (child->isTextNode()) {
- toText(child)->recalcTextStyle(change, lastTextNode);
- lastTextNode = toText(child);
+ toText(child)->recalcTextStyle(change);
} else if (child->isElementNode()) {
Element* element = toElement(child);
if (element->shouldCallRecalcStyle(change))
- element->recalcStyle(change, lastTextNode);
+ element->recalcStyle(change);
else if (element->supportsStyleSharing())
styleResolver.addToStyleSharingList(*element);
- if (element->renderer())
- lastTextNode = 0;
}
}
}
« no previous file with comments | « sky/engine/core/dom/Element.h ('k') | sky/engine/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698