• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/WebCore-7537.78.1/dom/

Lines Matching defs:container

132     if (!m_start.container()) {
137 return m_start.container();
142 if (!m_start.container()) {
152 if (!m_start.container()) {
157 return m_end.container();
162 if (!m_start.container()) {
172 if (!m_start.container()) {
177 return commonAncestorContainer(m_start.container(), m_end.container());
193 if (!m_start.container()) {
203 Node* endRootContainer = end.container();
206 Node* startRootContainer = start.container();
215 if (!m_start.container()) {
244 if (!m_start.container()) {
285 if (!m_start.container()) {
298 if (!m_start.container()) {
317 return compareBoundaryPoints(refNode, offset, m_start.container(), m_start.offset(), ec) >= 0 && !ec
318 && compareBoundaryPoints(refNode, offset, m_end.container(), m_end.offset(), ec) <= 0 && !ec;
327 if (!m_start.container()) {
348 if (compareBoundaryPoints(refNode, offset, m_start.container(), m_start.offset(), ec) < 0)
355 if (compareBoundaryPoints(refNode, offset, m_end.container(), m_end.offset(), ec) > 0 && !ec)
373 if (!m_start.container() && refNode->attached()) {
378 if (m_start.container() && !refNode->attached()) {
411 if (!m_start.container()) {
472 // case 1: both points have the same container
482 // case 2: node C (container B or an ancestor) is a child node of A
500 // case 3: node C (container A or an ancestor) is a child node of B
555 return compareBoundaryPoints(boundaryA.container(), boundaryA.offset(), boundaryB.container(), boundaryB.offset(), ec);
561 return m_start.container() && compareBoundaryPoints(m_start, m_end, ec) <= 0 && !ec;
579 if (!m_start.container()) {
627 static inline Node* childOfCommonRootBeforeOffset(Node* container, unsigned offset, Node* commonRoot)
629 ASSERT(container);
632 if (!commonRoot->contains(container))
635 if (container == commonRoot) {
636 container = container->firstChild();
637 for (unsigned i = 0; container && i < offset; i++)
638 container = container->nextSibling();
640 while (container->parentNode() != commonRoot)
641 container = container->parentNode();
644 return container;
691 if (m_start.container() == m_end.container()) {
692 processContentsBetweenOffsets(action, fragment, m_start.container(), m_start.offset(), m_end.offset(), ec);
697 RefPtr<Node> partialStart = highestAncestorUnderCommonRoot(m_start.container(), commonRoot.get());
698 RefPtr<Node> partialEnd = highestAncestorUnderCommonRoot(m_end.container(), commonRoot.get());
702 // 1. Start container == commonRoot (End container must be a descendant)
703 // 2. End container == commonRoot (Start container must be a descendant)
721 if (m_start.container() != commonRoot && commonRoot->contains(m_start.container())) {
722 leftContents = processContentsBetweenOffsets(action, 0, m_start.container(), m_start.offset(), lengthOfContentsInNode(m_start.container()), ec);
723 leftContents = processAncestorsAndTheirSiblings(action, m_start.container(), ProcessContentsForward, leftContents, commonRoot.get(), ec);
727 if (m_end.container() != commonRoot && commonRoot->contains(m_end.container())) {
728 rightContents = processContentsBetweenOffsets(action, 0, m_end.container(), 0, m_end.offset(), ec);
729 rightContents = processAncestorsAndTheirSiblings(action, m_end.container(), ProcessContentsBackward, rightContents, commonRoot.get(), ec);
732 // delete all children of commonRoot between the start and end container
733 RefPtr<Node> processStart = childOfCommonRootBeforeOffset(m_start.container(), m_start.offset(), commonRoot.get());
734 if (processStart && m_start.container() != commonRoot) // processStart contains nodes before m_start.
736 RefPtr<Node> processEnd = childOfCommonRootBeforeOffset(m_end.container(), m_end.offset(), commonRoot.get());
777 Node* container, unsigned startOffset, unsigned endOffset, ExceptionCode& ec)
779 ASSERT(container);
784 switch (container->nodeType()) {
788 ASSERT(endOffset <= static_cast<CharacterData*>(container)->length());
790 RefPtr<CharacterData> c = static_pointer_cast<CharacterData>(container->cloneNode(true));
799 static_cast<CharacterData*>(container)->deleteData(startOffset, endOffset - startOffset, ec);
802 ASSERT(endOffset <= static_cast<ProcessingInstruction*>(container)->data().length());
804 RefPtr<ProcessingInstruction> c = static_pointer_cast<ProcessingInstruction>(container->cloneNode(true));
813 ProcessingInstruction* pi = static_cast<ProcessingInstruction*>(container);
833 result = container->cloneNode(false);
836 Node* n = container->firstChild();
843 processNodes(action, nodes, container, result, ec);
867 PassRefPtr<Node> Range::processAncestorsAndTheirSiblings(ActionType action, Node* container, ContentsProcessDirection direction, PassRefPtr<Node> passedClonedContainer, Node* commonRoot, ExceptionCode& ec)
873 for (ContainerNode* n = container->parentNode(); n && n != commonRoot; n = n->parentNode())
876 RefPtr<Node> firstChildInAncestorToProcess = direction == ProcessContentsForward ? container->nextSibling() : container->previousSibling();
933 if (!m_start.container()) {
947 if (!m_start.container()) {
957 // NO_MODIFICATION_ALLOWED_ERR: Raised if an ancestor container of either boundary-point of
964 // HIERARCHY_REQUEST_ERR: Raised if the container of the start of the Range is of a type that
965 // does not allow children of the type of newNode or if newNode is an ancestor of the container.
968 bool startIsText = m_start.container()->isTextNode();
969 if (startIsText && !m_start.container()->parentNode()) {
974 // In the case where the container is a text node, we check against the container's parent, because
978 checkAgainst = m_start.container()->parentNode();
980 checkAgainst = m_start.container();
1002 for (Node* n = m_start.container(); n; n = n->parentNode()) {
1027 RefPtr<Node> container;
1029 container = m_start.container();
1030 RefPtr<Text> newText = toText(container.get())->splitText(m_start.offset(), ec);
1034 container = m_start.container();
1035 container->parentNode()->insertBefore(newNode.release(), newText.get(), ec);
1047 container = m_start.container();
1048 container->insertBefore(newNode.release(), container->childNode(startOffset), ec);
1053 m_end.set(m_start.container(), startOffset + numNewChildren, lastChild.get());
1059 if (!m_start.container()) {
1071 int start = (n == m_start.container()) ? min(max(0, m_start.offset()), length) : 0;
1072 int end = (n == m_end.container()) ? min(max(start, m_end.offset()), length) : length;
1087 if (!m_start.container())
1092 m_start.container()->document()->updateLayout();
1099 if (!m_start.container()) {
1104 Node* element = m_start.container()->isElementNode() ? m_start.container() : m_start.container()->parentNode();
1121 if (!m_start.container()) {
1170 // INVALID_NODE_TYPE_ERR: Raised if the root container of refNode is not an
1219 if (!m_start.container()) {
1224 return Range::create(m_ownerDocument, m_start.container(), m_start.offset(), m_end.container(), m_end.offset());
1229 if (!m_start.container()) {
1249 if (!m_start.container()) {
1269 if (!m_start.container()) {
1289 if (!m_start.container()) {
1354 if (!m_start.container()) {
1398 if (!m_start.container()) {
1429 // NO_MODIFICATION_ALLOWED_ERR: Raised if an ancestor container of either boundary-point of
1436 // Raise a HIERARCHY_REQUEST_ERR if m_start.container() doesn't accept children like newParent.
1437 Node* parentOfNewParent = m_start.container();
1439 // If m_start.container() is a character data node, it will be split and it will be its parent that will
1449 if (newParent->contains(m_start.container())) {
1458 Node* startNonTextContainer = m_start.container();
1461 Node* endNonTextContainer = m_end.container();
1489 if (!m_start.container()) {
1509 if (!m_start.container()) {
1538 for (Node* n = m_start.container(); n; n = n->parentNode()) {
1542 for (Node* n = m_end.container(); n; n = n->parentNode()) {
1551 if (!m_start.container())
1553 if (m_start.container()->offsetInCharacters())
1554 return m_start.container();
1555 if (isRendererReplacedElement(m_start.container()->renderer()))
1556 return m_start.container();
1557 if (Node* child = m_start.container()->childNode(m_start.offset()))
1560 return m_start.container();
1561 return NodeTraversal::nextSkippingChildren(m_start.container());
1571 if (!m_start.container() || !m_end.container())
1573 if (m_end.container()->offsetInCharacters())
1574 return NodeTraversal::nextSkippingChildren(m_end.container());
1575 if (Node* child = m_end.container()->childNode(m_end.offset()))
1577 return NodeTraversal::nextSkippingChildren(m_end.container());
1593 Node* startContainer = m_start.container();
1594 Node* endContainer = m_end.container();
1625 Node* startContainer = m_start.container();
1626 Node* endContainer = m_end.container();
1661 if (!m_start.container() || !m_end.container())
1669 m_start.container()->formatForDebugger(s, FormatBufferSize);
1674 m_end.container()->formatForDebugger(s, FormatBufferSize);
1702 if (!m_start.container())
1704 if (!m_start.container()->offsetInCharacters())
1705 return m_start.container()->childNodeCount();
1706 return m_start.container()->maxCharacterOffset();
1711 if (!m_end.container())
1713 if (!m_end.container()->offsetInCharacters())
1714 return m_end.container()->childNodeCount();
1715 return m_end.container()->maxCharacterOffset();
1718 static inline void boundaryNodeChildrenChanged(RangeBoundaryPoint& boundary, ContainerNode* container)
1722 if (boundary.container() != container)
1727 void Range::nodeChildrenChanged(ContainerNode* container)
1729 ASSERT(container);
1730 ASSERT(container->document() == m_ownerDocument);
1731 boundaryNodeChildrenChanged(m_start, container);
1732 boundaryNodeChildrenChanged(m_end, container);
1735 static inline void boundaryNodeChildrenWillBeRemoved(RangeBoundaryPoint& boundary, ContainerNode* container)
1737 for (Node* nodeToBeRemoved = container->firstChild(); nodeToBeRemoved; nodeToBeRemoved = nodeToBeRemoved->nextSibling()) {
1739 boundary.setToStartOfNode(container);
1743 for (Node* n = boundary.container(); n; n = n->parentNode()) {
1745 boundary.setToStartOfNode(container);
1752 void Range::nodeChildrenWillBeRemoved(ContainerNode* container)
1754 ASSERT(container);
1755 ASSERT(container->document() == m_ownerDocument);
1756 boundaryNodeChildrenWillBeRemoved(m_start, container);
1757 boundaryNodeChildrenWillBeRemoved(m_end, container);
1767 for (Node* n = boundary.container(); n; n = n->parentNode()) {
1787 if (boundary.container() != text)
1805 if (boundary.container() != text)
1826 if (boundary.container() == oldNode.node())
1828 else if (boundary.container() == oldNode.node()->parentNode() && boundary.offset() == oldNode.index())
1846 if (boundary.container() != oldNode)
1890 if (!m_start.container())
1908 Node* startContainer = m_start.container();
1909 Node* endContainer = m_end.container();
1950 if (!m_start.container())