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

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

Issue 14990005: Remove ENTITY_REFERENCE_NODE (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove some empty lines Created 7 years, 7 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 | « Source/core/dom/Range.h ('k') | Source/core/dom/ShadowRoot.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Range.cpp
diff --git a/Source/core/dom/Range.cpp b/Source/core/dom/Range.cpp
index af491c35b833e04c9b2db6160c7c1fd78a5e1dd9..125cab1787f832aad22373403c8ef4bf338652f9 100644
--- a/Source/core/dom/Range.cpp
+++ b/Source/core/dom/Range.cpp
@@ -659,7 +659,6 @@ static inline unsigned lengthOfContentsInNode(Node* node)
return static_cast<ProcessingInstruction*>(node)->data().length();
case Node::ELEMENT_NODE:
case Node::ATTRIBUTE_NODE:
- case Node::ENTITY_REFERENCE_NODE:
case Node::ENTITY_NODE:
case Node::DOCUMENT_NODE:
case Node::DOCUMENT_TYPE_NODE:
@@ -821,7 +820,6 @@ PassRefPtr<Node> Range::processContentsBetweenOffsets(ActionType action, PassRef
break;
case Node::ELEMENT_NODE:
case Node::ATTRIBUTE_NODE:
- case Node::ENTITY_REFERENCE_NODE:
case Node::ENTITY_NODE:
case Node::DOCUMENT_NODE:
case Node::DOCUMENT_TYPE_NODE:
@@ -957,13 +955,6 @@ void Range::insertNode(PassRefPtr<Node> prpNewNode, ExceptionCode& ec)
return;
}
- // NO_MODIFICATION_ALLOWED_ERR: Raised if an ancestor container of either boundary-point of
- // the Range is read-only.
- if (containedByReadOnly()) {
- ec = NO_MODIFICATION_ALLOWED_ERR;
- return;
- }
-
// HIERARCHY_REQUEST_ERR: Raised if the container of the start of the Range is of a type that
// does not allow children of the type of newNode or if newNode is an ancestor of the container.
@@ -1157,7 +1148,6 @@ Node* Range::checkNodeWOffset(Node* n, int offset, ExceptionCode& ec) const
case Node::DOCUMENT_FRAGMENT_NODE:
case Node::DOCUMENT_NODE:
case Node::ELEMENT_NODE:
- case Node::ENTITY_REFERENCE_NODE:
case Node::XPATH_NAMESPACE_NODE: {
if (!offset)
return 0;
@@ -1189,7 +1179,6 @@ void Range::checkNodeBA(Node* n, ExceptionCode& ec) const
case Node::COMMENT_NODE:
case Node::DOCUMENT_TYPE_NODE:
case Node::ELEMENT_NODE:
- case Node::ENTITY_REFERENCE_NODE:
case Node::PROCESSING_INSTRUCTION_NODE:
case Node::TEXT_NODE:
case Node::XPATH_NAMESPACE_NODE:
@@ -1210,7 +1199,6 @@ void Range::checkNodeBA(Node* n, ExceptionCode& ec) const
case Node::DOCUMENT_TYPE_NODE:
case Node::ELEMENT_NODE:
case Node::ENTITY_NODE:
- case Node::ENTITY_REFERENCE_NODE:
case Node::NOTATION_NODE:
case Node::PROCESSING_INSTRUCTION_NODE:
case Node::TEXT_NODE:
@@ -1313,7 +1301,6 @@ void Range::selectNode(Node* refNode, ExceptionCode& ec)
case Node::DOCUMENT_FRAGMENT_NODE:
case Node::DOCUMENT_NODE:
case Node::ELEMENT_NODE:
- case Node::ENTITY_REFERENCE_NODE:
case Node::PROCESSING_INSTRUCTION_NODE:
case Node::TEXT_NODE:
case Node::XPATH_NAMESPACE_NODE:
@@ -1331,7 +1318,6 @@ void Range::selectNode(Node* refNode, ExceptionCode& ec)
case Node::COMMENT_NODE:
case Node::DOCUMENT_TYPE_NODE:
case Node::ELEMENT_NODE:
- case Node::ENTITY_REFERENCE_NODE:
case Node::PROCESSING_INSTRUCTION_NODE:
case Node::TEXT_NODE:
case Node::XPATH_NAMESPACE_NODE:
@@ -1377,7 +1363,6 @@ void Range::selectNodeContents(Node* refNode, ExceptionCode& ec)
case Node::DOCUMENT_FRAGMENT_NODE:
case Node::DOCUMENT_NODE:
case Node::ELEMENT_NODE:
- case Node::ENTITY_REFERENCE_NODE:
case Node::PROCESSING_INSTRUCTION_NODE:
case Node::TEXT_NODE:
case Node::XPATH_NAMESPACE_NODE:
@@ -1425,20 +1410,12 @@ void Range::surroundContents(PassRefPtr<Node> passNewParent, ExceptionCode& ec)
case Node::CDATA_SECTION_NODE:
case Node::COMMENT_NODE:
case Node::ELEMENT_NODE:
- case Node::ENTITY_REFERENCE_NODE:
case Node::PROCESSING_INSTRUCTION_NODE:
case Node::TEXT_NODE:
case Node::XPATH_NAMESPACE_NODE:
break;
}
- // NO_MODIFICATION_ALLOWED_ERR: Raised if an ancestor container of either boundary-point of
- // the Range is read-only.
- if (containedByReadOnly()) {
- ec = NO_MODIFICATION_ALLOWED_ERR;
- return;
- }
-
// Raise a HIERARCHY_REQUEST_ERR if m_start.container() doesn't accept children like newParent.
Node* parentOfNewParent = m_start.container();
@@ -1523,33 +1500,11 @@ void Range::checkDeleteExtract(ExceptionCode& ec)
Node* pastLast = pastLastNode();
for (Node* n = firstNode(); n != pastLast; n = NodeTraversal::next(n)) {
- if (n->isReadOnlyNode()) {
- ec = NO_MODIFICATION_ALLOWED_ERR;
- return;
- }
if (n->nodeType() == Node::DOCUMENT_TYPE_NODE) {
ec = HIERARCHY_REQUEST_ERR;
return;
}
}
-
- if (containedByReadOnly()) {
- ec = NO_MODIFICATION_ALLOWED_ERR;
- return;
- }
-}
-
-bool Range::containedByReadOnly() const
-{
- for (Node* n = m_start.container(); n; n = n->parentNode()) {
- if (n->isReadOnlyNode())
- return true;
- }
- for (Node* n = m_end.container(); n; n = n->parentNode()) {
- if (n->isReadOnlyNode())
- return true;
- }
- return false;
}
Node* Range::firstNode() const
« no previous file with comments | « Source/core/dom/Range.h ('k') | Source/core/dom/ShadowRoot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698