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

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

Issue 772743004: Remove more Node API. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « sky/engine/core/dom/Node.cpp ('k') | sky/engine/core/editing/DeleteSelectionCommand.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no) 3 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no)
4 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no) 4 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no)
5 * (C) 2001 Peter Kelly (pmk@post.com) 5 * (C) 2001 Peter Kelly (pmk@post.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
7 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 7 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
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 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 case Node::TEXT_NODE: 1089 case Node::TEXT_NODE:
1090 break; 1090 break;
1091 } 1091 }
1092 1092
1093 // Raise a HierarchyRequestError if m_start.container() doesn't accept child ren like newParent. 1093 // Raise a HierarchyRequestError if m_start.container() doesn't accept child ren like newParent.
1094 Node* parentOfNewParent = m_start.container(); 1094 Node* parentOfNewParent = m_start.container();
1095 1095
1096 // If m_start.container() is a character data node, it will be split and it will be its parent that will 1096 // If m_start.container() is a character data node, it will be split and it will be its parent that will
1097 // need to accept newParent (or in the case of a comment, it logically "woul d" be inserted into the parent, 1097 // need to accept newParent (or in the case of a comment, it logically "woul d" be inserted into the parent,
1098 // although this will fail below for another reason). 1098 // although this will fail below for another reason).
1099 if (parentOfNewParent->isCharacterDataNode()) 1099 if (parentOfNewParent->isTextNode())
1100 parentOfNewParent = parentOfNewParent->parentNode(); 1100 parentOfNewParent = parentOfNewParent->parentNode();
1101 1101
1102 if (!parentOfNewParent) { 1102 if (!parentOfNewParent) {
1103 exceptionState.throwDOMException(HierarchyRequestError, "The container n ode is a detached character data node; no parent node is available for insertion ."); 1103 exceptionState.throwDOMException(HierarchyRequestError, "The container n ode is a detached character data node; no parent node is available for insertion .");
1104 return; 1104 return;
1105 } 1105 }
1106 1106
1107 if (newParent->contains(m_start.container())) { 1107 if (newParent->contains(m_start.container())) {
1108 exceptionState.throwDOMException(HierarchyRequestError, "The node provid ed contains the insertion point; it may not be inserted into itself."); 1108 exceptionState.throwDOMException(HierarchyRequestError, "The node provid ed contains the insertion point; it may not be inserted into itself.");
1109 return; 1109 return;
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 1514
1515 void showTree(const blink::Range* range) 1515 void showTree(const blink::Range* range)
1516 { 1516 {
1517 if (range && range->boundaryPointsValid()) { 1517 if (range && range->boundaryPointsValid()) {
1518 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r ange->endContainer(), "E"); 1518 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r ange->endContainer(), "E");
1519 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset (), range->endOffset()); 1519 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset (), range->endOffset());
1520 } 1520 }
1521 } 1521 }
1522 1522
1523 #endif 1523 #endif
OLDNEW
« no previous file with comments | « sky/engine/core/dom/Node.cpp ('k') | sky/engine/core/editing/DeleteSelectionCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698