Lines Matching refs:Range
25 #include "Range.h"
50 static WTF::RefCountedLeakCounter rangeCounter("Range");
53 inline Range::Range(PassRefPtr<Document> ownerDocument)
65 PassRefPtr<Range> Range::create(PassRefPtr<Document> ownerDocument)
67 return adoptRef(new Range(ownerDocument));
70 inline Range::Range(PassRefPtr<Document> ownerDocument, PassRefPtr<Node> startContainer, int startOffset, PassRefPtr<Node> endContainer, int endOffset)
90 PassRefPtr<Range> Range::create(PassRefPtr<Document> ownerDocument, PassRefPtr<Node> startContainer, int startOffset, PassRefPtr<Node> endContainer, int endOffset)
92 return adoptRef(new Range(ownerDocument, startContainer, startOffset, endContainer, endOffset));
95 PassRefPtr<Range> Range::create(PassRefPtr<Document> ownerDocument, const Position& start, const Position& end)
98 return adoptRef(new Range(ownerDocument, start.node(), start.deprecatedEditingOffset(), end.node(), end.deprecatedEditingOffset()));
101 Range::~Range()
111 Node* Range::startContainer(ExceptionCode& ec) const
121 int Range::startOffset(ExceptionCode& ec) const
131 Node* Range::endContainer(ExceptionCode& ec) const
141 int Range::endOffset(ExceptionCode& ec) const
151 Node* Range::commonAncestorContainer(ExceptionCode& ec) const
161 Node* Range::commonAncestorContainer(Node* containerA, Node* containerB)
172 bool Range::collapsed(ExceptionCode& ec) const
182 void Range::setStart(PassRefPtr<Node> refNode, int offset, ExceptionCode& ec)
220 void Range::setEnd(PassRefPtr<Node> refNode, int offset, ExceptionCode& ec)
258 void Range::collapse(bool toStart, ExceptionCode& ec)
271 bool Range::isPointInRange(Node* refNode, int offset, ExceptionCode& ec)
302 short Range::comparePoint(Node* refNode, int offset, ExceptionCode& ec) const
304 // http://developer.mozilla.org/en/docs/DOM:range.comparePoint
306 // refNode node and an offset within the node is before, same as, or after the range respectively.
336 // point is in the middle of this range, or on the boundary points
340 Range::CompareResults Range::compareNode(Node* refNode, ExceptionCode& ec) const
342 // http://developer.mozilla.org/en/docs/DOM:range.compareNode
344 // before and after(surrounds), or inside the range, respectively
377 if (comparePoint(parentNode, nodeIndex + 1, ec) > 0) // ends after the range
379 return NODE_BEFORE; // ends before or in the range
380 } else { // starts at or after the range start
381 if (comparePoint(parentNode, nodeIndex + 1, ec) > 0) // ends after the range
383 return NODE_INSIDE; // ends inside the range
387 short Range::compareBoundaryPoints(CompareHow how, const Range* sourceRange, ExceptionCode& ec) const
438 short Range::compareBoundaryPoints(Node* containerA, int offsetA, Node* containerB, int offsetB)
448 // see DOM2 traversal & range section 2.5
529 short Range::compareBoundaryPoints(const RangeBoundaryPoint& boundaryA, const RangeBoundaryPoint& boundaryB)
534 bool Range::boundaryPointsValid() const
539 void Range::deleteContents(ExceptionCode& ec)
548 bool Range::intersectsNode(Node* refNode, ExceptionCode& ec)
550 // http://developer.mozilla.org/en/docs/DOM:range.intersectsNode
551 // Returns a bool if the node intersects the range.
586 PassRefPtr<DocumentFragment> Range::processContents(ActionType action, ExceptionCode& ec)
606 // what is the highest node that partially selects the start of the range?
614 // what is the highest node that partially selects the end of the range?
687 // process the left-hand side of the range, up until the last ancestor of
753 // delete the right-hand side of the range, up until the last ancestor of
844 // Collapse the range, making sure that the result is not within a node that was partially selected.
881 PassRefPtr<DocumentFragment> Range::extractContents(ExceptionCode& ec)
890 PassRefPtr<DocumentFragment> Range::cloneContents(ExceptionCode& ec)
900 void Range::insertNode(PassRefPtr<Node> prpNewNode, ExceptionCode& ec)
917 // the Range is read-only.
923 // WRONG_DOCUMENT_ERR: Raised if newParent and the container of the start of the Range were
930 // HIERARCHY_REQUEST_ERR: Raised if the container of the start of the Range is of a type that
1012 String Range::toString(ExceptionCode& ec) const
1035 String Range::toHTML() const
1040 String Range::text() const
1052 PassRefPtr<DocumentFragment> Range::createContextualFragment(const String& markup, ExceptionCode& ec) const
1075 void Range::detach(ExceptionCode& ec)
1089 Node* Range::checkNodeWOffset(Node* n, int offset, ExceptionCode& ec) const
1125 void Range::checkNodeBA(Node* n, ExceptionCode& ec) const
1176 PassRefPtr<Range> Range::cloneRange(ExceptionCode& ec) const
1183 return Range::create(m_ownerDocument, m_start.container(), m_start.offset(), m_end.container(), m_end.offset());
1186 void Range::setStartAfter(Node* refNode, ExceptionCode& ec)
1211 void Range::setEndBefore(Node* refNode, ExceptionCode& ec)
1236 void Range::setEndAfter(Node* refNode, ExceptionCode& ec)
1262 void Range::selectNode(Node* refNode, ExceptionCode& ec)
1324 void Range::selectNodeContents(Node* refNode, ExceptionCode& ec)
1363 void Range::surroundContents(PassRefPtr<Node> passNewParent, ExceptionCode& ec)
1399 // the Range is read-only.
1405 // WRONG_DOCUMENT_ERR: Raised if newParent and the container of the start of the Range were
1433 // BAD_BOUNDARYPOINTS_ERR: Raised if the Range partially selects a non-Text node.
1463 void Range::setStartBefore(Node* refNode, ExceptionCode& ec)
1488 void Range::checkDeleteExtract(ExceptionCode& ec)
1517 bool Range::containedByReadOnly() const
1530 Node* Range::firstNode() const
1543 Position Range::editingStartPosition() const
1545 // This function is used by range style computations to avoid bugs like:
1569 Node* Range::shadowTreeRootNode() const
1574 Node* Range::pastLastNode() const
1585 IntRect Range::boundingBox()
1596 void Range::textRects(Vector<IntRect>& rects, bool useSelectionHeight)
1616 void Range::textQuads(Vector<FloatQuad>& quads, bool useSelectionHeight)
1638 void Range::formatForDebugger(char* buffer, unsigned length) const
1664 bool operator==(const Range& a, const Range& b)
1675 PassRefPtr<Range> rangeOfContents(Node* node)
1678 RefPtr<Range> range = Range::create(node->document());
1680 range->selectNodeContents(node, exception);
1681 return range.release();
1684 int Range::maxStartOffset() const
1693 int Range::maxEndOffset() const
1711 void Range::nodeChildrenChanged(ContainerNode* container)
1734 void Range::nodeWillBeRemoved(Node* node)
1754 void Range::textInserted(Node* text, unsigned offset, unsigned length)
1775 void Range::textRemoved(Node* text, unsigned offset, unsigned length)
1791 void Range::textNodesMerged(NodeWithIndex& oldNode, unsigned offset)
1813 void Range::textNodeSplit(Text* oldNode)
1825 void Range::expand(const String& unit, ExceptionCode& ec)
1847 PassRefPtr<ClientRectList> Range::getClientRects() const
1860 PassRefPtr<ClientRect> Range::getBoundingClientRect() const
1893 void Range::getBorderAndTextQuads(Vector<FloatQuad>& quads) const
1936 void showTree(const WebCore::Range* range)
1938 if (range && range->boundaryPointsValid()) {
1939 WebCore::Position start = range->startPosition();
1940 WebCore::Position end = range->endPosition();