| OLD | NEW |
| 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 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 static PassRefPtrWillBeRawPtr<Range> create(Document&, Node* startContainer,
int startOffset, Node* endContainer, int endOffset); | 54 static PassRefPtrWillBeRawPtr<Range> create(Document&, Node* startContainer,
int startOffset, Node* endContainer, int endOffset); |
| 55 static PassRefPtrWillBeRawPtr<Range> create(Document&, const Position&, cons
t Position&); | 55 static PassRefPtrWillBeRawPtr<Range> create(Document&, const Position&, cons
t Position&); |
| 56 ~Range(); | 56 ~Range(); |
| 57 | 57 |
| 58 Document& ownerDocument() const { ASSERT(m_ownerDocument); return *m_ownerDo
cument.get(); } | 58 Document& ownerDocument() const { ASSERT(m_ownerDocument); return *m_ownerDo
cument.get(); } |
| 59 Node* startContainer() const { return m_start.container(); } | 59 Node* startContainer() const { return m_start.container(); } |
| 60 int startOffset() const { return m_start.offset(); } | 60 int startOffset() const { return m_start.offset(); } |
| 61 Node* endContainer() const { return m_end.container(); } | 61 Node* endContainer() const { return m_end.container(); } |
| 62 int endOffset() const { return m_end.offset(); } | 62 int endOffset() const { return m_end.offset(); } |
| 63 | 63 |
| 64 Node* startContainer(ExceptionState&) const; | 64 bool collapsed() const { return m_start == m_end; } |
| 65 int startOffset(ExceptionState&) const; | |
| 66 Node* endContainer(ExceptionState&) const; | |
| 67 int endOffset(ExceptionState&) const; | |
| 68 bool collapsed(ExceptionState&) const; | |
| 69 | 65 |
| 70 Node* commonAncestorContainer(ExceptionState&) const; | 66 Node* commonAncestorContainer() const; |
| 71 static Node* commonAncestorContainer(Node* containerA, Node* containerB); | 67 static Node* commonAncestorContainer(Node* containerA, Node* containerB); |
| 72 void setStart(PassRefPtr<Node> container, int offset, ExceptionState& = ASSE
RT_NO_EXCEPTION); | 68 void setStart(PassRefPtr<Node> container, int offset, ExceptionState& = ASSE
RT_NO_EXCEPTION); |
| 73 void setEnd(PassRefPtr<Node> container, int offset, ExceptionState& = ASSERT
_NO_EXCEPTION); | 69 void setEnd(PassRefPtr<Node> container, int offset, ExceptionState& = ASSERT
_NO_EXCEPTION); |
| 74 void collapse(bool toStart, ExceptionState&); | 70 void collapse(bool toStart); |
| 75 bool isPointInRange(Node* refNode, int offset, ExceptionState&); | 71 bool isPointInRange(Node* refNode, int offset, ExceptionState&); |
| 76 short comparePoint(Node* refNode, int offset, ExceptionState&) const; | 72 short comparePoint(Node* refNode, int offset, ExceptionState&) const; |
| 77 enum CompareResults { NODE_BEFORE, NODE_AFTER, NODE_BEFORE_AND_AFTER, NODE_I
NSIDE }; | 73 enum CompareResults { NODE_BEFORE, NODE_AFTER, NODE_BEFORE_AND_AFTER, NODE_I
NSIDE }; |
| 78 CompareResults compareNode(Node* refNode, ExceptionState&) const; | 74 CompareResults compareNode(Node* refNode, ExceptionState&) const; |
| 79 enum CompareHow { START_TO_START, START_TO_END, END_TO_END, END_TO_START }; | 75 enum CompareHow { START_TO_START, START_TO_END, END_TO_END, END_TO_START }; |
| 80 short compareBoundaryPoints(CompareHow, const Range* sourceRange, ExceptionS
tate&) const; | 76 short compareBoundaryPoints(CompareHow, const Range* sourceRange, ExceptionS
tate&) const; |
| 81 static short compareBoundaryPoints(Node* containerA, int offsetA, Node* cont
ainerB, int offsetB, ExceptionState&); | 77 static short compareBoundaryPoints(Node* containerA, int offsetA, Node* cont
ainerB, int offsetB, ExceptionState&); |
| 82 static short compareBoundaryPoints(const RangeBoundaryPoint& boundaryA, cons
t RangeBoundaryPoint& boundaryB, ExceptionState&); | 78 static short compareBoundaryPoints(const RangeBoundaryPoint& boundaryA, cons
t RangeBoundaryPoint& boundaryB, ExceptionState&); |
| 83 bool boundaryPointsValid() const; | 79 bool boundaryPointsValid() const; |
| 84 bool intersectsNode(Node* refNode, ExceptionState&); | 80 bool intersectsNode(Node* refNode, ExceptionState&); |
| 85 void deleteContents(ExceptionState&); | 81 void deleteContents(ExceptionState&); |
| 86 PassRefPtr<DocumentFragment> extractContents(ExceptionState&); | 82 PassRefPtr<DocumentFragment> extractContents(ExceptionState&); |
| 87 PassRefPtr<DocumentFragment> cloneContents(ExceptionState&); | 83 PassRefPtr<DocumentFragment> cloneContents(ExceptionState&); |
| 88 void insertNode(PassRefPtr<Node>, ExceptionState&); | 84 void insertNode(PassRefPtr<Node>, ExceptionState&); |
| 89 String toString(ExceptionState&) const; | 85 String toString() const; |
| 90 | 86 |
| 91 String toHTML() const; | 87 String toHTML() const; |
| 92 String text() const; | 88 String text() const; |
| 93 | 89 |
| 94 PassRefPtr<DocumentFragment> createContextualFragment(const String& html, Ex
ceptionState&); | 90 PassRefPtr<DocumentFragment> createContextualFragment(const String& html, Ex
ceptionState&); |
| 95 | 91 |
| 96 void detach(ExceptionState&); | 92 void detach(); |
| 97 PassRefPtrWillBeRawPtr<Range> cloneRange(ExceptionState&) const; | 93 PassRefPtrWillBeRawPtr<Range> cloneRange() const; |
| 98 | 94 |
| 99 void setStartAfter(Node*, ExceptionState& = ASSERT_NO_EXCEPTION); | 95 void setStartAfter(Node*, ExceptionState& = ASSERT_NO_EXCEPTION); |
| 100 void setEndBefore(Node*, ExceptionState& = ASSERT_NO_EXCEPTION); | 96 void setEndBefore(Node*, ExceptionState& = ASSERT_NO_EXCEPTION); |
| 101 void setEndAfter(Node*, ExceptionState& = ASSERT_NO_EXCEPTION); | 97 void setEndAfter(Node*, ExceptionState& = ASSERT_NO_EXCEPTION); |
| 102 void selectNode(Node*, ExceptionState& = ASSERT_NO_EXCEPTION); | 98 void selectNode(Node*, ExceptionState& = ASSERT_NO_EXCEPTION); |
| 103 void selectNodeContents(Node*, ExceptionState&); | 99 void selectNodeContents(Node*, ExceptionState&); |
| 104 void surroundContents(PassRefPtr<Node>, ExceptionState&); | 100 void surroundContents(PassRefPtr<Node>, ExceptionState&); |
| 105 void setStartBefore(Node*, ExceptionState& = ASSERT_NO_EXCEPTION); | 101 void setStartBefore(Node*, ExceptionState& = ASSERT_NO_EXCEPTION); |
| 106 | 102 |
| 107 const Position startPosition() const { return m_start.toPosition(); } | 103 const Position startPosition() const { return m_start.toPosition(); } |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 bool areRangesEqual(const Range*, const Range*); | 175 bool areRangesEqual(const Range*, const Range*); |
| 180 | 176 |
| 181 } // namespace | 177 } // namespace |
| 182 | 178 |
| 183 #ifndef NDEBUG | 179 #ifndef NDEBUG |
| 184 // Outside the WebCore namespace for ease of invocation from gdb. | 180 // Outside the WebCore namespace for ease of invocation from gdb. |
| 185 void showTree(const WebCore::Range*); | 181 void showTree(const WebCore::Range*); |
| 186 #endif | 182 #endif |
| 187 | 183 |
| 188 #endif | 184 #endif |
| OLD | NEW |