diff options
Diffstat (limited to 'src/3rdparty/webkit/WebCore/editing/htmlediting.cpp')
-rw-r--r-- | src/3rdparty/webkit/WebCore/editing/htmlediting.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/3rdparty/webkit/WebCore/editing/htmlediting.cpp b/src/3rdparty/webkit/WebCore/editing/htmlediting.cpp index 7b51295..c0bf009 100644 --- a/src/3rdparty/webkit/WebCore/editing/htmlediting.cpp +++ b/src/3rdparty/webkit/WebCore/editing/htmlediting.cpp @@ -84,6 +84,7 @@ bool canHaveChildrenForEditing(const Node* node) !node->hasTagName(embedTag) && !node->hasTagName(appletTag) && !node->hasTagName(selectTag) && + !node->hasTagName(datagridTag) && #if ENABLE(WML) !node->hasTagName(WMLNames::doTag) && #endif @@ -664,7 +665,7 @@ HTMLElement* enclosingList(Node* node) return 0; } -Node* enclosingListChild(Node *node) +HTMLElement* enclosingListChild(Node *node) { if (!node) return 0; @@ -675,7 +676,7 @@ Node* enclosingListChild(Node *node) // FIXME: This function is inappropriately named if it starts with node instead of node->parentNode() for (Node* n = node; n && n->parentNode(); n = n->parentNode()) { if (n->hasTagName(liTag) || isListElement(n->parentNode())) - return n; + return static_cast<HTMLElement*>(n); if (n == root || isTableCell(n)) return 0; } @@ -737,6 +738,18 @@ HTMLElement* outermostEnclosingList(Node* node) return list; } +bool canMergeLists(Element* firstList, Element* secondList) +{ + if (!firstList || !secondList) + return false; + + return firstList->hasTagName(secondList->tagQName())// make sure the list types match (ol vs. ul) + && isContentEditable(firstList) && isContentEditable(secondList)// both lists are editable + && firstList->rootEditableElement() == secondList->rootEditableElement()// don't cross editing boundaries + && isVisibilyAdjacent(positionAfterNode(firstList), positionBeforeNode(secondList)); + // Make sure there is no visible content between this li and the previous list +} + Node* highestAncestor(Node* node) { ASSERT(node); @@ -970,6 +983,11 @@ int indexForVisiblePosition(VisiblePosition& visiblePosition) return TextIterator::rangeLength(range.get(), true); } +bool isVisibilyAdjacent(const Position& first, const Position& second) +{ + return VisiblePosition(first) == VisiblePosition(second.upstream()); +} + PassRefPtr<Range> avoidIntersectionWithNode(const Range* range, Node* node) { if (!range) |