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

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

Issue 739433003: Remove CDATASection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 10 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/Node.cpp ('k') | Source/core/dom/Text.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 c1c195bd442d14df899dbec534871e94395c100e..550e5adeb31b9efea753fc171437d73035b36107 100644
--- a/Source/core/dom/Range.cpp
+++ b/Source/core/dom/Range.cpp
@@ -707,7 +707,6 @@ PassRefPtrWillBeRawPtr<Node> Range::processContentsBetweenOffsets(ActionType act
RefPtrWillBeRawPtr<Node> result = nullptr;
switch (container->nodeType()) {
case Node::TEXT_NODE:
- case Node::CDATA_SECTION_NODE:
case Node::COMMENT_NODE:
endOffset = std::min(endOffset, toCharacterData(container)->length());
if (action == EXTRACT_CONTENTS || action == CLONE_CONTENTS) {
@@ -977,7 +976,7 @@ String Range::toString() const
Node* pastLast = pastLastNode();
for (Node* n = firstNode(); n != pastLast; n = NodeTraversal::next(*n)) {
Node::NodeType type = n->nodeType();
- if (type == Node::TEXT_NODE || type == Node::CDATA_SECTION_NODE) {
+ if (type == Node::TEXT_NODE) {
String data = toCharacterData(n)->data();
int length = data.length();
int start = (n == m_start.container()) ? std::min(std::max(0, m_start.offset()), length) : 0;
@@ -1050,7 +1049,6 @@ Node* Range::checkNodeWOffset(Node* n, int offset, ExceptionState& exceptionStat
case Node::DOCUMENT_TYPE_NODE:
exceptionState.throwDOMException(InvalidNodeTypeError, "The node provided is of type '" + n->nodeName() + "'.");
return nullptr;
- case Node::CDATA_SECTION_NODE:
case Node::COMMENT_NODE:
case Node::TEXT_NODE:
if (static_cast<unsigned>(offset) > toCharacterData(n)->length())
@@ -1098,7 +1096,6 @@ void Range::checkNodeBA(Node* n, ExceptionState& exceptionState) const
case Node::DOCUMENT_NODE:
exceptionState.throwDOMException(InvalidNodeTypeError, "The node provided is of type '" + n->nodeName() + "'.");
return;
- case Node::CDATA_SECTION_NODE:
case Node::COMMENT_NODE:
case Node::DOCUMENT_TYPE_NODE:
case Node::ELEMENT_NODE:
@@ -1117,7 +1114,6 @@ void Range::checkNodeBA(Node* n, ExceptionState& exceptionState) const
case Node::DOCUMENT_FRAGMENT_NODE:
case Node::ELEMENT_NODE:
break;
- case Node::CDATA_SECTION_NODE:
case Node::COMMENT_NODE:
case Node::DOCUMENT_TYPE_NODE:
case Node::PROCESSING_INSTRUCTION_NODE:
@@ -1177,7 +1173,6 @@ void Range::selectNode(Node* refNode, ExceptionState& exceptionState)
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:
@@ -1192,7 +1187,6 @@ void Range::selectNode(Node* refNode, ExceptionState& exceptionState)
}
switch (refNode->nodeType()) {
- case Node::CDATA_SECTION_NODE:
case Node::COMMENT_NODE:
case Node::DOCUMENT_TYPE_NODE:
case Node::ELEMENT_NODE:
@@ -1225,7 +1219,6 @@ void Range::selectNodeContents(Node* refNode, ExceptionState& exceptionState)
for (Node* n = refNode; n; n = n->parentNode()) {
switch (n->nodeType()) {
case Node::ATTRIBUTE_NODE:
- case Node::CDATA_SECTION_NODE:
case Node::COMMENT_NODE:
case Node::DOCUMENT_FRAGMENT_NODE:
case Node::DOCUMENT_NODE:
@@ -1255,7 +1248,6 @@ bool Range::selectNodeContents(Node* refNode, Position& start, Position& end)
for (Node* n = refNode; n; n = n->parentNode()) {
switch (n->nodeType()) {
case Node::ATTRIBUTE_NODE:
- case Node::CDATA_SECTION_NODE:
case Node::COMMENT_NODE:
case Node::DOCUMENT_FRAGMENT_NODE:
case Node::DOCUMENT_NODE:
@@ -1306,7 +1298,6 @@ void Range::surroundContents(PassRefPtrWillBeRawPtr<Node> passNewParent, Excepti
case Node::DOCUMENT_TYPE_NODE:
exceptionState.throwDOMException(InvalidNodeTypeError, "The node provided is of type '" + newParent->nodeName() + "'.");
return;
- case Node::CDATA_SECTION_NODE:
case Node::COMMENT_NODE:
case Node::ELEMENT_NODE:
case Node::PROCESSING_INSTRUCTION_NODE:
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/dom/Text.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698