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

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

Issue 289273002: Oilpan: make DocumentFragment a heap allocated object. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased + add WillBeGarbageCollected FIXME. Created 6 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 unified diff | Download patch
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/dom/Range.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 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 short comparePoint(Node* refNode, int offset, ExceptionState&) const; 72 short comparePoint(Node* refNode, int offset, ExceptionState&) const;
73 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 };
74 CompareResults compareNode(Node* refNode, ExceptionState&) const; 74 CompareResults compareNode(Node* refNode, ExceptionState&) const;
75 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 };
76 short compareBoundaryPoints(CompareHow, const Range* sourceRange, ExceptionS tate&) const; 76 short compareBoundaryPoints(CompareHow, const Range* sourceRange, ExceptionS tate&) const;
77 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&);
78 static short compareBoundaryPoints(const RangeBoundaryPoint& boundaryA, cons t RangeBoundaryPoint& boundaryB, ExceptionState&); 78 static short compareBoundaryPoints(const RangeBoundaryPoint& boundaryA, cons t RangeBoundaryPoint& boundaryB, ExceptionState&);
79 bool boundaryPointsValid() const; 79 bool boundaryPointsValid() const;
80 bool intersectsNode(Node* refNode, ExceptionState&); 80 bool intersectsNode(Node* refNode, ExceptionState&);
81 void deleteContents(ExceptionState&); 81 void deleteContents(ExceptionState&);
82 PassRefPtr<DocumentFragment> extractContents(ExceptionState&); 82 PassRefPtrWillBeRawPtr<DocumentFragment> extractContents(ExceptionState&);
83 PassRefPtr<DocumentFragment> cloneContents(ExceptionState&); 83 PassRefPtrWillBeRawPtr<DocumentFragment> cloneContents(ExceptionState&);
84 void insertNode(PassRefPtr<Node>, ExceptionState&); 84 void insertNode(PassRefPtr<Node>, ExceptionState&);
85 String toString() const; 85 String toString() const;
86 86
87 String toHTML() const; 87 String toHTML() const;
88 String text() const; 88 String text() const;
89 89
90 PassRefPtr<DocumentFragment> createContextualFragment(const String& html, Ex ceptionState&); 90 PassRefPtrWillBeRawPtr<DocumentFragment> createContextualFragment(const Stri ng& html, ExceptionState&);
91 91
92 void detach(); 92 void detach();
93 PassRefPtrWillBeRawPtr<Range> cloneRange() const; 93 PassRefPtrWillBeRawPtr<Range> cloneRange() const;
94 94
95 void setStartAfter(Node*, ExceptionState& = ASSERT_NO_EXCEPTION); 95 void setStartAfter(Node*, ExceptionState& = ASSERT_NO_EXCEPTION);
96 void setEndBefore(Node*, ExceptionState& = ASSERT_NO_EXCEPTION); 96 void setEndBefore(Node*, ExceptionState& = ASSERT_NO_EXCEPTION);
97 void setEndAfter(Node*, ExceptionState& = ASSERT_NO_EXCEPTION); 97 void setEndAfter(Node*, ExceptionState& = ASSERT_NO_EXCEPTION);
98 void selectNode(Node*, ExceptionState& = ASSERT_NO_EXCEPTION); 98 void selectNode(Node*, ExceptionState& = ASSERT_NO_EXCEPTION);
99 void selectNodeContents(Node*, ExceptionState&); 99 void selectNodeContents(Node*, ExceptionState&);
100 void surroundContents(PassRefPtr<Node>, ExceptionState&); 100 void surroundContents(PassRefPtr<Node>, ExceptionState&);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 explicit Range(Document&); 152 explicit Range(Document&);
153 Range(Document&, Node* startContainer, int startOffset, Node* endContainer, int endOffset); 153 Range(Document&, Node* startContainer, int startOffset, Node* endContainer, int endOffset);
154 154
155 void setDocument(Document&); 155 void setDocument(Document&);
156 156
157 Node* checkNodeWOffset(Node*, int offset, ExceptionState&) const; 157 Node* checkNodeWOffset(Node*, int offset, ExceptionState&) const;
158 void checkNodeBA(Node*, ExceptionState&) const; 158 void checkNodeBA(Node*, ExceptionState&) const;
159 void checkDeleteExtract(ExceptionState&); 159 void checkDeleteExtract(ExceptionState&);
160 160
161 enum ActionType { DELETE_CONTENTS, EXTRACT_CONTENTS, CLONE_CONTENTS }; 161 enum ActionType { DELETE_CONTENTS, EXTRACT_CONTENTS, CLONE_CONTENTS };
162 PassRefPtr<DocumentFragment> processContents(ActionType, ExceptionState&); 162 PassRefPtrWillBeRawPtr<DocumentFragment> processContents(ActionType, Excepti onState&);
163 static PassRefPtr<Node> processContentsBetweenOffsets(ActionType, PassRefPtr <DocumentFragment>, Node*, unsigned startOffset, unsigned endOffset, ExceptionSt ate&); 163 static PassRefPtr<Node> processContentsBetweenOffsets(ActionType, PassRefPtr WillBeRawPtr<DocumentFragment>, Node*, unsigned startOffset, unsigned endOffset, ExceptionState&);
164 static void processNodes(ActionType, Vector<RefPtr<Node> >&, PassRefPtr<Node > oldContainer, PassRefPtr<Node> newContainer, ExceptionState&); 164 static void processNodes(ActionType, Vector<RefPtr<Node> >&, PassRefPtr<Node > oldContainer, PassRefPtr<Node> newContainer, ExceptionState&);
165 enum ContentsProcessDirection { ProcessContentsForward, ProcessContentsBackw ard }; 165 enum ContentsProcessDirection { ProcessContentsForward, ProcessContentsBackw ard };
166 static PassRefPtr<Node> processAncestorsAndTheirSiblings(ActionType, Node* c ontainer, ContentsProcessDirection, PassRefPtr<Node> clonedContainer, Node* comm onRoot, ExceptionState&); 166 static PassRefPtr<Node> processAncestorsAndTheirSiblings(ActionType, Node* c ontainer, ContentsProcessDirection, PassRefPtr<Node> clonedContainer, Node* comm onRoot, ExceptionState&);
167 167
168 RefPtr<Document> m_ownerDocument; // Cannot be null. 168 RefPtr<Document> m_ownerDocument; // Cannot be null.
169 RangeBoundaryPoint m_start; 169 RangeBoundaryPoint m_start;
170 RangeBoundaryPoint m_end; 170 RangeBoundaryPoint m_end;
171 }; 171 };
172 172
173 PassRefPtrWillBeRawPtr<Range> rangeOfContents(Node*); 173 PassRefPtrWillBeRawPtr<Range> rangeOfContents(Node*);
174 174
175 bool areRangesEqual(const Range*, const Range*); 175 bool areRangesEqual(const Range*, const Range*);
176 176
177 } // namespace 177 } // namespace
178 178
179 #ifndef NDEBUG 179 #ifndef NDEBUG
180 // Outside the WebCore namespace for ease of invocation from gdb. 180 // Outside the WebCore namespace for ease of invocation from gdb.
181 void showTree(const WebCore::Range*); 181 void showTree(const WebCore::Range*);
182 #endif 182 #endif
183 183
184 #endif 184 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | Source/core/dom/Range.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698