Home | History | Annotate | Download | only in dom

Lines Matching refs:Position

27 #include "Position.h"
76 Position::Position(PassRefPtr<Node> anchorNode, int offset)
84 Position::Position(PassRefPtr<Node> anchorNode, AnchorType anchorType)
93 Position::Position(PassRefPtr<Node> anchorNode, int offset, AnchorType anchorType)
102 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 Node* Position::computeNodeBeforePosition() const
168 Node* Position::computeNodeAfterPosition() const
185 Position::AnchorType Position::anchorTypeForLegacyEditingPosition(Node* anchorNode, int offset)
189 return Position::PositionIsBeforeAnchor;
190 return Position::PositionIsAfterAnchor;
192 return Position::PositionIsOffsetInAnchor;
196 Element* Position::element() const
204 PassRefPtr<CSSComputedStyleDeclaration> Position::computedStyle() const
212 Position Position::previous(PositionMoveType moveType) const
234 return Position(n, o - 1);
236 return Position(n, uncheckedPreviousOffset(n, o));
238 return Position(n, uncheckedPreviousOffsetForBackwardDeletion(n, o));
246 return Position(parent, n->nodeIndex());
249 Position Position::next(PositionMoveType moveType) const
271 return Position(n, (moveType == Character) ? uncheckedNextOffset(n, o) : o + 1);
278 return Position(parent, n->nodeIndex() + 1);
281 int Position::uncheckedPreviousOffset(const Node* n, int current)
286 int Position::uncheckedPreviousOffsetForBackwardDeletion(const Node* n, int current)
291 int Position::uncheckedNextOffset(const Node* n, int current)
296 bool Position::atFirstEditingPositionForNode() const
303 bool Position::atLastEditingPositionForNode() const
310 // A position is considered at editing boundary if one of the following is true:
311 // 1. It is the first position in the node and the next visually equivalent position
313 // 2. It is the last position in the node and the previous visually equivalent position
315 // 3. It is an editable position and both the next and previous visually equivalent
317 bool Position::atEditingBoundary() const
319 Position nextPosition = downstream(CanCrossEditingBoundary);
323 Position prevPosition = upstream(CanCrossEditingBoundary);
331 bool Position::atStartOfTree() const
338 bool Position::atEndOfTree() const
345 int Position::renderedOffset() const
369 // return first preceding DOM position rendered at a different location, or "this"
370 Position Position::previousCharacterPosition(EAffinity affinity) const
373 return Position();
380 Position currentPos = *this;
397 // return first following position rendered at a different location, or "this"
398 Position Position::nextCharacterPosition(EAffinity affinity) const
401 return Position();
408 Position currentPos = *this;
472 Position Position::upstream(EditingBoundaryCrossingRule rule) const
476 return Position();
478 // iterate backward from there, looking for a qualified position
501 // If we've moved to a position that is visually distinct, return the last saved position. There
502 position.
506 // skip position in unrendered or invisible node
516 // track last visible streamer position
520 // Don't move past a position that is visually distinct. We could rely on code above to terminate and
525 // Return position after tables and nodes which have content that can be ignored.
532 // return current position if it is in rendered text
540 return Position(currentNode, renderer->caretMaxOffset());
591 // Also, downstream() will return the last position in the last atomic node in boundary for all of the positions
593 Position Position::downstream(EditingBoundaryCrossingRule rule) const
597 return Position();
599 // iterate forward from there, looking for a qualified position
624 // return the last visible streamer position
628 // Do not move to a visually distinct position.
631 // Do not move past a visually disinct position.
632 // Note: The first position after the last in a node whose ends are visually distinct
637 // skip position in unrendered or invisible node
647 // track last visible streamer position
651 // Return position before tables and nodes which have content that can be ignored.
654 return Position(currentNode, renderer->caretMinOffset());
658 // return current position if it is in rendered text
662 return Position(currentNode, renderer->caretMinOffset());
709 bool Position::hasRenderedNonAnonymousDescendantsWithHeight(RenderObject* renderer)
721 bool Position::nodeIsUserSelectNone(Node* node)
726 bool Position::isCandidate() const
752 if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(renderer))
753 return atFirstEditingPositionForNode() && !Position::nodeIsUserSelectNone(node());
754 return m_anchorNode->isContentEditable() && !Position::nodeIsUserSelectNone(node()) && atEditingBoundary();
757 return m_anchorNode->isContentEditable() && !Position::nodeIsUserSelectNone(node()) && atEditingBoundary();
762 bool Position::inRenderedText() const
798 bool Position::isRenderedCharacter() const
822 bool Position::rendersInDifferentPosition(const Position &pos) const
909 Position Position::leadingWhitespacePosition(EAffinity affinity, bool considerNonCollapsibleWhitespace) const
913 return Position();
916 return Position();
918 Position prev = previousCharacterPosition(affinity);
927 return Position();
931 Position Position::trailingWhitespacePosition(EAffinity, bool considerNonCollapsibleWhitespace) const
935 return Position();
944 return Position();
947 void Position::getInlineBoxAndOffset(EAffinity affinity, InlineBox*& inlineBox, int& caretOffset) const
996 void Position::getInlineBoxAndOffset(EAffinity affinity, TextDirection primaryDirection, InlineBox*& inlineBox, int& caretOffset) const
1008 Position pos(startNode, 0);
1022 Position pos = positionInParentBeforeNode(node()).upstream();
1149 void Position::debugPosition(const char* msg) const
1152 fprintf(stderr, "Position [%s]: null\n", msg);
1154 fprintf(stderr, "Position [%s]: %s [%p] at %d\n", msg, node()->nodeName().utf8().data(), node(), m_offset);
1159 void Position::formatForDebugger(char* buffer, unsigned length) const
1177 void Position::showTreeForThis() const
1193 void showTree(const WebCore::Position& pos)
1198 void showTree(const WebCore::Position* pos)