Home | History | Annotate | Download | only in dom

Lines Matching defs:Position

27 #include "Position.h"
74 Position::Position(PassRefPtr<Node> anchorNode, int offset)
82 Position::Position(PassRefPtr<Node> anchorNode, AnchorType anchorType)
91 Position::Position(PassRefPtr<Node> anchorNode, int offset, AnchorType anchorType)
101 void Position::moveToPosition(PassRefPtr<Node> node, int offset)
110 void Position::moveToOffset(int offset)
118 Node* Position::containerNode() const
134 int Position::computeOffsetInContainerNode() const
151 int Position::offsetForPositionAfterAnchor() const
160 Position Position::parentAnchoredEquivalent() const
163 return Position();
176 return Position(containerNode(), computeOffsetInContainerNode(), PositionIsOffsetInAnchor);
179 Node* Position::computeNodeBeforePosition() const
196 Node* Position::computeNodeAfterPosition() const
213 Position::AnchorType Position::anchorTypeForLegacyEditingPosition(Node* anchorNode, int offset)
217 return Position::PositionIsBeforeAnchor;
218 return Position::PositionIsAfterAnchor;
220 return Position::PositionIsOffsetInAnchor;
224 Element* Position::element() const
232 PassRefPtr<CSSComputedStyleDeclaration> Position::computedStyle() const
240 Position Position::previous(PositionMoveType moveType) const
262 return Position(n, o - 1);
264 return Position(n, uncheckedPreviousOffset(n, o));
266 return Position(n, uncheckedPreviousOffsetForBackwardDeletion(n, o));
274 return Position(parent, n->nodeIndex());
277 Position Position::next(PositionMoveType moveType) const
299 return Position(n, (moveType == Character) ? uncheckedNextOffset(n, o) : o + 1);
306 return Position(parent, n->nodeIndex() + 1);
309 int Position::uncheckedPreviousOffset(const Node* n, int current)
314 int Position::uncheckedPreviousOffsetForBackwardDeletion(const Node* n, int current)
319 int Position::uncheckedNextOffset(const Node* n, int current)
324 bool Position::atFirstEditingPositionForNode() const
331 bool Position::atLastEditingPositionForNode() const
338 // A position is considered at editing boundary if one of the following is true:
339 // 1. It is the first position in the node and the next visually equivalent position
341 // 2. It is the last position in the node and the previous visually equivalent position
343 // 3. It is an editable position and both the next and previous visually equivalent
345 bool Position::atEditingBoundary() const
347 Position nextPosition = downstream(CanCrossEditingBoundary);
351 Position prevPosition = upstream(CanCrossEditingBoundary);
359 Node* Position::parentEditingBoundary() const
376 bool Position::atStartOfTree() const
383 bool Position::atEndOfTree() const
390 int Position::renderedOffset() const
414 // return first preceding DOM position rendered at a different location, or "this"
415 Position Position::previousCharacterPosition(EAffinity affinity) const
418 return Position();
425 Position currentPos = *this;
442 // return first following position rendered at a different location, or "this"
443 Position Position::nextCharacterPosition(EAffinity affinity) const
446 return Position();
453 Position currentPos = *this;
517 Position Position::upstream(EditingBoundaryCrossingRule rule) const
521 return Position();
523 // iterate backward from there, looking for a qualified position
526 PositionIterator lastVisible = m_anchorType == PositionIsAfterAnchor ? Position(m_anchorNode, caretMaxOffset(m_anchorNode.get())) : *this;
547 // If we've moved to a position that is visually distinct, return the last saved position. There
548 // is code below that terminates early if we're *about* to move to a visually distinct position.
552 // skip position in unrendered or invisible node
562 // track last visible streamer position
566 // Don't move past a position that is visually distinct. We could rely on code above to terminate and
571 // Return position after tables and nodes which have content that can be ignored.
578 // return current position if it is in rendered text
586 return Position(currentNode, renderer->caretMaxOffset());
637 // Also, downstream() will return the last position in the last atomic node in boundary for all of the positions
639 Position Position::downstream(EditingBoundaryCrossingRule rule) const
643 return Position();
645 // iterate forward from there, looking for a qualified position
648 PositionIterator lastVisible = m_anchorType == PositionIsAfterAnchor ? Position(m_anchorNode, caretMaxOffset(m_anchorNode.get())) : *this;
671 // return the last visible streamer position
675 // Do not move to a visually distinct position.
678 // Do not move past a visually disinct position.
679 // Note: The first position after the last in a node whose ends are visually distinct
684 // skip position in unrendered or invisible node
694 // track last visible streamer position
698 // Return position before tables and nodes which have content that can be ignored.
701 return Position(currentNode, renderer->caretMinOffset());
705 // return current position if it is in rendered text
709 return Position(currentNode, renderer->caretMinOffset());
756 bool Position::hasRenderedNonAnonymousDescendantsWithHeight(RenderObject* renderer)
768 bool Position::nodeIsUserSelectNone(Node* node)
773 bool Position::isCandidate() const
800 if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(renderer))
801 return atFirstEditingPositionForNode() && !Position::nodeIsUserSelectNone(deprecatedNode());
802 return m_anchorNode->rendererIsEditable() && !Position::nodeIsUserSelectNone(deprecatedNode()) && atEditingBoundary();
805 return m_anchorNode->rendererIsEditable() && !Position::nodeIsUserSelectNone(deprecatedNode()) && atEditingBoundary();
810 bool Position::inRenderedText() const
846 bool Position::isRenderedCharacter() const
870 bool Position::rendersInDifferentPosition(const Position &pos) const
957 Position Position::leadingWhitespacePosition(EAffinity affinity, bool considerNonCollapsibleWhitespace) const
961 return Position();
964 return Position();
966 Position prev = previousCharacterPosition(affinity);
975 return Position();
979 Position Position::trailingWhitespacePosition(EAffinity, bool considerNonCollapsibleWhitespace) const
983 return Position();
992 return Position();
995 void Position::getInlineBoxAndOffset(EAffinity affinity, InlineBox*& inlineBox, int& caretOffset) const
1037 static Position downstreamIgnoringEditingBoundaries(Position position)
1039 Position lastPosition;
1040 while (position != lastPosition) {
1041 lastPosition = position;
1042 position = position.downstream(CanCrossEditingBoundary);
1044 return position;
1047 static Position upstreamIgnoringEditingBoundaries(Position position)
1049 Position lastPosition;
1050 while (position != lastPosition) {
1051 lastPosition = position;
1052 position = position.upstream(CanCrossEditingBoundary);
1054 return position;
1057 void Position::getInlineBoxAndOffset(EAffinity affinity, TextDirection primaryDirection, InlineBox*& inlineBox, int& caretOffset) const
1065 // Try a visually equivalent position with possibly opposite editability. This helps in case |this| is in
1068 Position equivalent = downstreamIgnoringEditingBoundaries(*this);
1207 TextDirection Position::primaryDirection() const
1221 void Position::debugPosition(const char* msg) const
1224 fprintf(stderr, "Position [%s]: null\n", msg);
1226 fprintf(stderr, "Position [%s]: %s [%p] at %d\n", msg, deprecatedNode()->nodeName().utf8().data(), deprecatedNode(), m_offset);
1231 void Position::formatForDebugger(char* buffer, unsigned length) const
1249 void Position::showAnchorTypeAndOffset() const
1267 void Position::showTreeForThis() const
1283 void showTree(const WebCore::Position& pos)
1288 void showTree(const WebCore::Position* pos)