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

Side by Side Diff: sky/engine/core/dom/Node.cpp

Issue 698213002: Remove lots of Text APIs. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 exceptionState.throwDOMException(HierarchyRequestError, "This node type does not support this method."); 374 exceptionState.throwDOMException(HierarchyRequestError, "This node type does not support this method.");
375 return nullptr; 375 return nullptr;
376 } 376 }
377 377
378 void Node::remove(ExceptionState& exceptionState) 378 void Node::remove(ExceptionState& exceptionState)
379 { 379 {
380 if (ContainerNode* parent = parentNode()) 380 if (ContainerNode* parent = parentNode())
381 parent->removeChild(this, exceptionState); 381 parent->removeChild(this, exceptionState);
382 } 382 }
383 383
384 void Node::normalize()
385 {
386 // Go through the subtree beneath us, normalizing all nodes. This means that
387 // any two adjacent text nodes are merged and any empty text nodes are remov ed.
388
389 RefPtr<Node> node = this;
390 while (Node* firstChild = node->firstChild())
391 node = firstChild;
392 while (node) {
393 if (node == this)
394 break;
395
396 if (node->nodeType() == TEXT_NODE)
397 node = toText(node)->mergeNextSiblingNodesIfPossible();
398 else
399 node = NodeTraversal::nextPostOrder(*node);
400 }
401 }
402
403 const AtomicString& Node::localName() const 384 const AtomicString& Node::localName() const
404 { 385 {
405 return nullAtom; 386 return nullAtom;
406 } 387 }
407 388
408 bool Node::isContentEditable(UserSelectAllTreatment treatment) 389 bool Node::isContentEditable(UserSelectAllTreatment treatment)
409 { 390 {
410 document().updateRenderTreeIfNeeded(); 391 document().updateRenderTreeIfNeeded();
411 return hasEditableStyle(Editable, treatment); 392 return hasEditableStyle(Editable, treatment);
412 } 393 }
(...skipping 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after
1918 node->showTreeForThis(); 1899 node->showTreeForThis();
1919 } 1900 }
1920 1901
1921 void showNodePath(const blink::Node* node) 1902 void showNodePath(const blink::Node* node)
1922 { 1903 {
1923 if (node) 1904 if (node)
1924 node->showNodePathForThis(); 1905 node->showNodePathForThis();
1925 } 1906 }
1926 1907
1927 #endif 1908 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698