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

Unified Diff: sky/engine/core/dom/Element.cpp

Issue 864613002: Remove Element::textFromChildren(). (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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.cpp » ('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 cd282835c4652e80ce0715b93d519a8c454bf0b6..2a9d24f901e6ec83e82b353daeb666eab1a6eba4 100644
--- a/sky/engine/core/dom/Element.cpp
+++ b/sky/engine/core/dom/Element.cpp
@@ -1305,46 +1305,6 @@ void Element::dispatchFocusOutEvent(const AtomicString& eventType, Element* newF
dispatchScopedEventDispatchMediator(FocusOutEventDispatchMediator::create(FocusEvent::create(eventType, true, false, document().domWindow(), 0, newFocusedElement)));
}
-String Element::textFromChildren()
-{
- Text* firstTextNode = 0;
- bool foundMultipleTextNodes = false;
- unsigned totalLength = 0;
-
- for (Node* child = firstChild(); child; child = child->nextSibling()) {
- if (!child->isTextNode())
- continue;
- Text* text = toText(child);
- if (!firstTextNode)
- firstTextNode = text;
- else
- foundMultipleTextNodes = true;
- unsigned length = text->data().length();
- if (length > std::numeric_limits<unsigned>::max() - totalLength)
- return emptyString();
- totalLength += length;
- }
-
- if (!firstTextNode)
- return emptyString();
-
- if (firstTextNode && !foundMultipleTextNodes) {
- firstTextNode->atomize();
- return firstTextNode->data();
- }
-
- StringBuilder content;
- content.reserveCapacity(totalLength);
- for (Node* child = firstTextNode; child; child = child->nextSibling()) {
- if (!child->isTextNode())
- continue;
- content.append(toText(child)->data());
- }
-
- ASSERT(content.length() == totalLength);
- return content.toString();
-}
-
// FIXME(sky): Remove pseudoElementSpecifier.
RenderStyle* Element::computedStyle(PseudoId pseudoElementSpecifier)
{
« no previous file with comments | « sky/engine/core/dom/Element.h ('k') | sky/engine/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698