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

Side by Side Diff: Source/core/dom/Range.cpp

Issue 22417002: Rename ASSERT_NO_EXCEPTION_STATE and IGNORE_EXCEPTION_STATE (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Range.h ('k') | Source/core/dom/Text.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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 198
199 static inline bool checkForDifferentRootContainer(const RangeBoundaryPoint& star t, const RangeBoundaryPoint& end) 199 static inline bool checkForDifferentRootContainer(const RangeBoundaryPoint& star t, const RangeBoundaryPoint& end)
200 { 200 {
201 Node* endRootContainer = end.container(); 201 Node* endRootContainer = end.container();
202 while (endRootContainer->parentNode()) 202 while (endRootContainer->parentNode())
203 endRootContainer = endRootContainer->parentNode(); 203 endRootContainer = endRootContainer->parentNode();
204 Node* startRootContainer = start.container(); 204 Node* startRootContainer = start.container();
205 while (startRootContainer->parentNode()) 205 while (startRootContainer->parentNode())
206 startRootContainer = startRootContainer->parentNode(); 206 startRootContainer = startRootContainer->parentNode();
207 207
208 return startRootContainer != endRootContainer || (Range::compareBoundaryPoin ts(start, end, ASSERT_NO_EXCEPTION_STATE) > 0); 208 return startRootContainer != endRootContainer || (Range::compareBoundaryPoin ts(start, end, ASSERT_NO_EXCEPTION) > 0);
209 } 209 }
210 210
211 void Range::setStart(PassRefPtr<Node> refNode, int offset, ExceptionState& es) 211 void Range::setStart(PassRefPtr<Node> refNode, int offset, ExceptionState& es)
212 { 212 {
213 if (!m_start.container()) { 213 if (!m_start.container()) {
214 es.throwDOMException(InvalidStateError); 214 es.throwDOMException(InvalidStateError);
215 return; 215 return;
216 } 216 }
217 217
218 if (!refNode) { 218 if (!refNode) {
(...skipping 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1645 return true; 1645 return true;
1646 if (!a || !b) 1646 if (!a || !b)
1647 return false; 1647 return false;
1648 return a->startPosition() == b->startPosition() && a->endPosition() == b->en dPosition(); 1648 return a->startPosition() == b->startPosition() && a->endPosition() == b->en dPosition();
1649 } 1649 }
1650 1650
1651 PassRefPtr<Range> rangeOfContents(Node* node) 1651 PassRefPtr<Range> rangeOfContents(Node* node)
1652 { 1652 {
1653 ASSERT(node); 1653 ASSERT(node);
1654 RefPtr<Range> range = Range::create(node->document()); 1654 RefPtr<Range> range = Range::create(node->document());
1655 range->selectNodeContents(node, IGNORE_EXCEPTION_STATE); 1655 range->selectNodeContents(node, IGNORE_EXCEPTION);
1656 return range.release(); 1656 return range.release();
1657 } 1657 }
1658 1658
1659 int Range::maxStartOffset() const 1659 int Range::maxStartOffset() const
1660 { 1660 {
1661 if (!m_start.container()) 1661 if (!m_start.container())
1662 return 0; 1662 return 0;
1663 if (!m_start.container()->offsetInCharacters()) 1663 if (!m_start.container()->offsetInCharacters())
1664 return m_start.container()->childNodeCount(); 1664 return m_start.container()->childNodeCount();
1665 return m_start.container()->maxCharacterOffset(); 1665 return m_start.container()->maxCharacterOffset();
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
1926 1926
1927 void showTree(const WebCore::Range* range) 1927 void showTree(const WebCore::Range* range)
1928 { 1928 {
1929 if (range && range->boundaryPointsValid()) { 1929 if (range && range->boundaryPointsValid()) {
1930 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r ange->endContainer(), "E"); 1930 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r ange->endContainer(), "E");
1931 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset (), range->endOffset()); 1931 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset (), range->endOffset());
1932 } 1932 }
1933 } 1933 }
1934 1934
1935 #endif 1935 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Range.h ('k') | Source/core/dom/Text.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698