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

Unified Diff: third_party/WebKit/Source/core/dom/Range.cpp

Issue 1363833002: Drop unnecessary ancestor traversal in Range::selectNode() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased wrt chromium repo Created 5 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Range.cpp
diff --git a/third_party/WebKit/Source/core/dom/Range.cpp b/third_party/WebKit/Source/core/dom/Range.cpp
index 0dad7073402860febc75e698ceb6fe87a146a749..57b8ad323cf34b14fb2aabf4ba523ea58346e10d 100644
--- a/third_party/WebKit/Source/core/dom/Range.cpp
+++ b/third_party/WebKit/Source/core/dom/Range.cpp
@@ -1088,26 +1088,6 @@ void Range::selectNode(Node* refNode, ExceptionState& exceptionState)
return;
}
- // InvalidNodeTypeError: Raised if an ancestor of refNode is an Entity, Notation or
- // DocumentType node or if refNode is a Document, DocumentFragment, ShadowRoot, Attr, Entity, or Notation
- // node.
- for (ContainerNode* anc = refNode->parentNode(); anc; anc = anc->parentNode()) {
- switch (anc->nodeType()) {
- case Node::ATTRIBUTE_NODE:
- case Node::CDATA_SECTION_NODE:
- case Node::COMMENT_NODE:
- case Node::DOCUMENT_FRAGMENT_NODE:
- case Node::DOCUMENT_NODE:
- case Node::ELEMENT_NODE:
- case Node::PROCESSING_INSTRUCTION_NODE:
- case Node::TEXT_NODE:
- break;
- case Node::DOCUMENT_TYPE_NODE:
- exceptionState.throwDOMException(InvalidNodeTypeError, "The node provided has an ancestor of type '" + anc->nodeName() + "'.");
- return;
- }
- }
-
switch (refNode->nodeType()) {
case Node::CDATA_SECTION_NODE:
case Node::COMMENT_NODE:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698