[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

kocienda kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:43:26 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 035660a5a408017650f7b8ab940b5475bd0542a0
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jun 3 14:38:25 2004 +0000

            Reviewed by Hyatt
    
            Fix for layout regression I caused when fixing:
    
            <rdar://problem/3668619>: "REGRESSION: text placed on pasteboard by WebKit is offset by one character"
    
            Extra height is added to empty blocks that are editable, so we can click to place
            the caret in them. This extra height was erroneously being added to non-editable
            blocks as a result of my earlier change. After looking at this and doing some
            code review, there are the following changes:
    
            Change away from "containingBlock" terminology in the NodeImpl class. The
            operation we are doing in NodeImpl is not the same as what is done in CSS
            when it uses the term "containingBlock" so:
                containingBlock changes to enclosingBlockFlowElement, and
                rootEditableBlock changes to rootEditableElement
    
            The vast majority of changes here are to make these name changes. The other
            significant piece of work, and the fix for the regression, is to change
            bidi.cpp to only include this extra line height if a block is empty
            and is content-editable.
    
            * khtml/editing/htmlediting_impl.cpp:
            (khtml::leadingWhitespacePosition):
            (khtml::trailingWhitespacePosition):
            (khtml::DeleteSelectionCommandImpl::doApply):
            (khtml::InputNewlineCommandImpl::doApply):
            (khtml::RemoveNodeAndPruneCommandImpl::doApply):
            (khtml::TypingCommandImpl::issueCommandForDeleteKey):
            * khtml/rendering/bidi.cpp:
            (khtml::RenderBlock::layoutInlineChildren):
            * khtml/xml/dom_docimpl.cpp:
            (DocumentImpl::relinquishesEditingFocus):
            (DocumentImpl::acceptsEditingFocus):
            * khtml/xml/dom_nodeimpl.cpp:
            * khtml/xml/dom_nodeimpl.h:
            * khtml/xml/dom_position.cpp:
            (DOM::Position::equivalentLeafPosition):
            (DOM::Position::previousCharacterPosition):
            (DOM::Position::nextCharacterPosition):
            (DOM::Position::previousLinePosition):
            (DOM::Position::nextLinePosition):
            (DOM::Position::equivalentUpstreamPosition):
            (DOM::Position::equivalentDownstreamPosition):
            (DOM::Position::atStartOfRootEditableElement):
            (DOM::Position::inRenderedContent):
            (DOM::Position::rendersOnSameLine):
            (DOM::Position::rendersInDifferentPosition):
            (DOM::Position::isLastRenderedPositionInEditableBlock):
            (DOM::Position::inFirstEditableInRootEditableElement):
            (DOM::Position::inLastEditableInRootEditableElement):
            (DOM::Position::inFirstEditableInContainingEditableBlock):
            (DOM::Position::inLastEditableInContainingEditableBlock):
            * khtml/xml/dom_position.h:
            * khtml/xml/dom_selection.cpp:
            (DOM::Selection::moveToRenderedContent):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6752 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index d9a807b..b8d5942 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,62 @@
+2004-06-03  Ken Kocienda  <kocienda at apple.com>
+
+        Reviewed by Hyatt
+
+        Fix for layout regression I caused when fixing:
+
+        <rdar://problem/3668619>: "REGRESSION: text placed on pasteboard by WebKit is offset by one character"
+
+        Extra height is added to empty blocks that are editable, so we can click to place
+        the caret in them. This extra height was erroneously being added to non-editable
+        blocks as a result of my earlier change. After looking at this and doing some
+        code review, there are the following changes:
+        
+        Change away from "containingBlock" terminology in the NodeImpl class. The
+        operation we are doing in NodeImpl is not the same as what is done in CSS
+        when it uses the term "containingBlock" so:
+            containingBlock changes to enclosingBlockFlowElement, and
+            rootEditableBlock changes to rootEditableElement
+        
+        The vast majority of changes here are to make these name changes. The other
+        significant piece of work, and the fix for the regression, is to change 
+        bidi.cpp to only include this extra line height if a block is empty
+        and is content-editable.    
+
+        * khtml/editing/htmlediting_impl.cpp:
+        (khtml::leadingWhitespacePosition):
+        (khtml::trailingWhitespacePosition):
+        (khtml::DeleteSelectionCommandImpl::doApply):
+        (khtml::InputNewlineCommandImpl::doApply):
+        (khtml::RemoveNodeAndPruneCommandImpl::doApply):
+        (khtml::TypingCommandImpl::issueCommandForDeleteKey):
+        * khtml/rendering/bidi.cpp:
+        (khtml::RenderBlock::layoutInlineChildren):
+        * khtml/xml/dom_docimpl.cpp:
+        (DocumentImpl::relinquishesEditingFocus):
+        (DocumentImpl::acceptsEditingFocus):
+        * khtml/xml/dom_nodeimpl.cpp:
+        * khtml/xml/dom_nodeimpl.h:
+        * khtml/xml/dom_position.cpp:
+        (DOM::Position::equivalentLeafPosition):
+        (DOM::Position::previousCharacterPosition):
+        (DOM::Position::nextCharacterPosition):
+        (DOM::Position::previousLinePosition):
+        (DOM::Position::nextLinePosition):
+        (DOM::Position::equivalentUpstreamPosition):
+        (DOM::Position::equivalentDownstreamPosition):
+        (DOM::Position::atStartOfRootEditableElement):
+        (DOM::Position::inRenderedContent):
+        (DOM::Position::rendersOnSameLine):
+        (DOM::Position::rendersInDifferentPosition):
+        (DOM::Position::isLastRenderedPositionInEditableBlock):
+        (DOM::Position::inFirstEditableInRootEditableElement):
+        (DOM::Position::inLastEditableInRootEditableElement):
+        (DOM::Position::inFirstEditableInContainingEditableBlock):
+        (DOM::Position::inLastEditableInContainingEditableBlock):
+        * khtml/xml/dom_position.h:
+        * khtml/xml/dom_selection.cpp:
+        (DOM::Selection::moveToRenderedContent):
+
 2004-06-02  Trey Matteson  <trey at apple.com>
 
 	Added types property to JS clipboard object.
diff --git a/WebCore/khtml/editing/SelectionController.cpp b/WebCore/khtml/editing/SelectionController.cpp
index 98fa08d..178f9fb 100644
--- a/WebCore/khtml/editing/SelectionController.cpp
+++ b/WebCore/khtml/editing/SelectionController.cpp
@@ -641,14 +641,14 @@ bool Selection::moveToRenderedContent()
         
     // not currently rendered, try moving to prev
     Position prev = pos.previousCharacterPosition();
-    if (prev != pos && prev.node()->inSameContainingEditableBlock(pos.node())) {
+    if (prev != pos && prev.node()->inSameContainingBlockFlowElement(pos.node())) {
         moveTo(prev);
         return true;
     }
 
     // could not be moved to prev, try next
     Position next = pos.nextCharacterPosition();
-    if (next != pos && next.node()->inSameContainingEditableBlock(pos.node())) {
+    if (next != pos && next.node()->inSameContainingBlockFlowElement(pos.node())) {
         moveTo(next);
         return true;
     }
diff --git a/WebCore/khtml/editing/htmlediting_impl.cpp b/WebCore/khtml/editing/htmlediting_impl.cpp
index 58335d3..3fd19f3 100644
--- a/WebCore/khtml/editing/htmlediting_impl.cpp
+++ b/WebCore/khtml/editing/htmlediting_impl.cpp
@@ -164,7 +164,7 @@ static Position leadingWhitespacePosition(const Position &pos)
 
     Selection selection(pos);
     Position prev = pos.previousCharacterPosition();
-    if (prev != pos && prev.node()->inSameContainingEditableBlock(pos.node()) && prev.node()->isTextNode()) {
+    if (prev != pos && prev.node()->inSameContainingBlockFlowElement(pos.node()) && prev.node()->isTextNode()) {
         DOMString string = static_cast<TextImpl *>(prev.node())->data();
         if (isWS(string[prev.offset()]))
             return prev;
@@ -181,7 +181,7 @@ static Position trailingWhitespacePosition(const Position &pos)
         TextImpl *textNode = static_cast<TextImpl *>(pos.node());
         if (pos.offset() >= (long)textNode->length()) {
             Position next = pos.nextCharacterPosition();
-            if (next != pos && next.node()->inSameContainingEditableBlock(pos.node()) && next.node()->isTextNode()) {
+            if (next != pos && next.node()->inSameContainingBlockFlowElement(pos.node()) && next.node()->isTextNode()) {
                 DOMString string = static_cast<TextImpl *>(next.node())->data();
                 if (isWS(string[0]))
                     return next;
@@ -1377,8 +1377,8 @@ void DeleteSelectionCommandImpl::doApply()
 
     unsigned long startRenderedOffset = downstreamStart.renderedOffset();
     
-    bool startAtStartOfRootEditableBlock = startRenderedOffset == 0 && downstreamStart.inFirstEditableInRootEditableBlock();
-    bool startAtStartOfBlock = startAtStartOfRootEditableBlock || 
+    bool startAtStartOfRootEditableElement = startRenderedOffset == 0 && downstreamStart.inFirstEditableInRootEditableElement();
+    bool startAtStartOfBlock = startAtStartOfRootEditableElement || 
         (startRenderedOffset == 0 && downstreamStart.inFirstEditableInContainingEditableBlock());
     bool endAtEndOfBlock = downstreamEnd.isLastRenderedPositionInEditableBlock();
 
@@ -1388,14 +1388,14 @@ void DeleteSelectionCommandImpl::doApply()
     debugPosition("downstreamEnd:       ", downstreamEnd);
     LOG(Editing,  "start selected:      %s", startCompletelySelected ? "YES" : "NO");
     LOG(Editing,  "at start block:      %s", startAtStartOfBlock ? "YES" : "NO");
-    LOG(Editing,  "at start root block: %s", startAtStartOfRootEditableBlock ? "YES" : "NO");
+    LOG(Editing,  "at start root block: %s", startAtStartOfRootEditableElement ? "YES" : "NO");
     LOG(Editing,  "at end block:        %s", endAtEndOfBlock ? "YES" : "NO");
     LOG(Editing,  "only whitespace:     %s", onlyWhitespace ? "YES" : "NO");
 
     // Start is not completely selected
     if (startAtStartOfBlock) {
         LOG(Editing,  "ending position case 1");
-        endingPosition = Position(downstreamStart.node()->containingBlock(), 1);
+        endingPosition = Position(downstreamStart.node()->enclosingBlockFlowElement(), 1);
         adjustEndingPositionDownstream = true;
     }
     else if (!startCompletelySelected) {
@@ -1602,7 +1602,7 @@ void InputNewlineCommandImpl::doApply()
     
     if (atEndOfBlock) {
         LOG(Editing, "input newline case 1");
-        NodeImpl *cb = pos.node()->containingBlock();
+        NodeImpl *cb = pos.node()->enclosingBlockFlowElement();
         appendNode(cb, breakNode);
         
         // Insert an "extra" BR at the end of the block. This makes the "real" BR we want
@@ -2271,12 +2271,12 @@ int RemoveNodeAndPruneCommandImpl::commandID() const
 
 void RemoveNodeAndPruneCommandImpl::doApply()
 {
-    NodeImpl *editableBlock = m_removeChild->containingBlock();
+    NodeImpl *editableBlock = m_removeChild->enclosingBlockFlowElement();
     NodeImpl *pruneNode = m_removeChild;
     NodeImpl *node = pruneNode->traversePreviousNode();
     removeNode(pruneNode);
     while (1) {
-        if (editableBlock != node->containingBlock() || !shouldPruneNode(node))
+        if (editableBlock != node->enclosingBlockFlowElement() || !shouldPruneNode(node))
             break;
         pruneNode = node;
         node = node->traversePreviousNode();
@@ -2496,7 +2496,7 @@ void TypingCommandImpl::issueCommandForDeleteKey()
     
     if (selectionToDelete.state() == Selection::CARET) {
         Position pos(selectionToDelete.start());
-        if (pos.inFirstEditableInRootEditableBlock() && pos.offset() <= pos.node()->caretMinOffset()) {
+        if (pos.inFirstEditableInRootEditableElement() && pos.offset() <= pos.node()->caretMinOffset()) {
             // we're at the start of a root editable block...do nothing
             return;
         }
diff --git a/WebCore/khtml/editing/selection.cpp b/WebCore/khtml/editing/selection.cpp
index 98fa08d..178f9fb 100644
--- a/WebCore/khtml/editing/selection.cpp
+++ b/WebCore/khtml/editing/selection.cpp
@@ -641,14 +641,14 @@ bool Selection::moveToRenderedContent()
         
     // not currently rendered, try moving to prev
     Position prev = pos.previousCharacterPosition();
-    if (prev != pos && prev.node()->inSameContainingEditableBlock(pos.node())) {
+    if (prev != pos && prev.node()->inSameContainingBlockFlowElement(pos.node())) {
         moveTo(prev);
         return true;
     }
 
     // could not be moved to prev, try next
     Position next = pos.nextCharacterPosition();
-    if (next != pos && next.node()->inSameContainingEditableBlock(pos.node())) {
+    if (next != pos && next.node()->inSameContainingBlockFlowElement(pos.node())) {
         moveTo(next);
         return true;
     }
diff --git a/WebCore/khtml/rendering/bidi.cpp b/WebCore/khtml/rendering/bidi.cpp
index 9cc4f6f..88001fb 100644
--- a/WebCore/khtml/rendering/bidi.cpp
+++ b/WebCore/khtml/rendering/bidi.cpp
@@ -1554,9 +1554,8 @@ QRect RenderBlock::layoutInlineChildren(bool relayoutChildren)
     
     setLinesAppended(false);
     
-    if (!firstLineBox() && element() && element()->containingBlock() == element()) {
+    if (!firstLineBox() && element() && element()->isContentEditable())
         m_height += lineHeight(true);
-    }
     
     return repaintRect;
 
diff --git a/WebCore/khtml/xml/dom_docimpl.cpp b/WebCore/khtml/xml/dom_docimpl.cpp
index 2320469..f3d31a5 100644
--- a/WebCore/khtml/xml/dom_docimpl.cpp
+++ b/WebCore/khtml/xml/dom_docimpl.cpp
@@ -2285,7 +2285,7 @@ bool DocumentImpl::relinquishesEditingFocus(NodeImpl *node)
     if (!part())
         return true;
     
-    NodeImpl *rootImpl = node->rootEditableBlock();
+    NodeImpl *rootImpl = node->rootEditableElement();
     Node root(rootImpl);
     Range range(root, 0, root, rootImpl->childNodeCount());
     return part()->shouldEndEditing(range);
@@ -2299,7 +2299,7 @@ bool DocumentImpl::acceptsEditingFocus(NodeImpl *node)
     if (!part())
         return true;
 
-    NodeImpl *rootImpl = node->rootEditableBlock();
+    NodeImpl *rootImpl = node->rootEditableElement();
     Node root(rootImpl);
     Range range(root, 0, root, rootImpl->childNodeCount());
     return part()->shouldBeginEditing(range);
diff --git a/WebCore/khtml/xml/dom_nodeimpl.cpp b/WebCore/khtml/xml/dom_nodeimpl.cpp
index bfaee0a..a2b4ff7 100644
--- a/WebCore/khtml/xml/dom_nodeimpl.cpp
+++ b/WebCore/khtml/xml/dom_nodeimpl.cpp
@@ -1321,23 +1321,23 @@ bool NodeImpl::isEditableBlock() const
     return isContentEditable() && isBlockFlow();
 }
 
-NodeImpl *NodeImpl::containingBlock() const
+ElementImpl *NodeImpl::enclosingBlockFlowElement() const
 {
     NodeImpl *n = const_cast<NodeImpl *>(this);
     if (isBlockFlow())
-        return n;
+        return static_cast<ElementImpl *>(n);
 
     while (1) {
         n = n->parentNode();
         if (!n)
             break;
         if (n->isBlockFlow() || n->id() == ID_BODY)
-            return n;
+            return static_cast<ElementImpl *>(n);
     }
     return 0;
 }
 
-NodeImpl *NodeImpl::rootEditableBlock() const
+ElementImpl *NodeImpl::rootEditableElement() const
 {
     if (!isContentEditable())
         return 0;
@@ -1355,17 +1355,17 @@ NodeImpl *NodeImpl::rootEditableBlock() const
         if (n->isBlockFlow())
             result = n;
     }
-    return result;
+    return static_cast<ElementImpl *>(result);
 }
 
-bool NodeImpl::inSameRootEditableBlock(NodeImpl *n)
+bool NodeImpl::inSameRootEditableElement(NodeImpl *n)
 {
-    return n ? rootEditableBlock() == n->rootEditableBlock() : false;
+    return n ? rootEditableElement() == n->rootEditableElement() : false;
 }
 
-bool NodeImpl::inSameContainingEditableBlock(NodeImpl *n)
+bool NodeImpl::inSameContainingBlockFlowElement(NodeImpl *n)
 {
-    return n ? containingBlock() == n->containingBlock() : false;
+    return n ? enclosingBlockFlowElement() == n->enclosingBlockFlowElement() : false;
 }
 
 #if APPLE_CHANGES
diff --git a/WebCore/khtml/xml/dom_nodeimpl.h b/WebCore/khtml/xml/dom_nodeimpl.h
index 4e9fd45..3faebc7 100644
--- a/WebCore/khtml/xml/dom_nodeimpl.h
+++ b/WebCore/khtml/xml/dom_nodeimpl.h
@@ -49,15 +49,16 @@ namespace khtml {
 
 namespace DOM {
 
-class NodeListImpl;
-class NamedNodeMapImpl;
-class DocumentImpl;
 class CSSStyleDeclarationImpl;
+class DocumentImpl;
+class ElementImpl;
+class EventImpl;
+class NamedNodeMapImpl;
+class NodeListImpl;
+class Position;
 class Range;
 class RangeImpl;
 class RegisteredEventListener;
-class EventImpl;
-class Position;
 
 // The namespace used for XHTML elements
 #define XHTML_NAMESPACE "http://www.w3.org/1999/xhtml"
@@ -162,11 +163,11 @@ public:
     NodeImpl *previousLeafNode() const;
 
     bool isEditableBlock() const;
-    NodeImpl *containingBlock() const;
-    NodeImpl *rootEditableBlock() const;
+    ElementImpl *enclosingBlockFlowElement() const;
+    ElementImpl *rootEditableElement() const;
     
-    bool inSameRootEditableBlock(NodeImpl *);
-    bool inSameContainingEditableBlock(NodeImpl *);
+    bool inSameRootEditableElement(NodeImpl *);
+    bool inSameContainingBlockFlowElement(NodeImpl *);
     
     Position positionForCoordinates(int x, int y);
 
diff --git a/WebCore/khtml/xml/dom_position.cpp b/WebCore/khtml/xml/dom_position.cpp
index 3773284..19f412d 100644
--- a/WebCore/khtml/xml/dom_position.cpp
+++ b/WebCore/khtml/xml/dom_position.cpp
@@ -177,7 +177,7 @@ Position Position::equivalentLeafPosition() const
     int count = 0;
     while (1) {
         n = n->nextLeafNode();
-        if (!n || !n->inSameContainingEditableBlock(node()))
+        if (!n || !n->inSameContainingBlockFlowElement(node()))
             return *this;
         if (count + n->maxOffset() >= offset()) {
             count = offset() - count;
@@ -233,7 +233,7 @@ Position Position::previousCharacterPosition() const
     if (isEmpty())
         return Position();
 
-    NodeImpl *fromRootEditableBlock = node()->rootEditableBlock();
+    NodeImpl *fromRootEditableElement = node()->rootEditableElement();
     PositionIterator it(*this);
 
     bool atStartOfLine = isFirstRenderedPositionOnLine();
@@ -241,7 +241,7 @@ Position Position::previousCharacterPosition() const
     while (!it.atStart()) {
         Position pos = it.previous();
 
-        if (pos.node()->rootEditableBlock() != fromRootEditableBlock)
+        if (pos.node()->rootEditableElement() != fromRootEditableElement)
             return *this;
 
         if (atStartOfLine) {
@@ -260,7 +260,7 @@ Position Position::nextCharacterPosition() const
     if (isEmpty())
         return Position();
 
-    NodeImpl *fromRootEditableBlock = node()->rootEditableBlock();
+    NodeImpl *fromRootEditableElement = node()->rootEditableElement();
     PositionIterator it(*this);
 
     bool atEndOfLine = isLastRenderedPositionOnLine();
@@ -268,7 +268,7 @@ Position Position::nextCharacterPosition() const
     while (!it.atEnd()) {
         Position pos = it.next();
 
-        if (pos.node()->rootEditableBlock() != fromRootEditableBlock)
+        if (pos.node()->rootEditableElement() != fromRootEditableElement)
             return *this;
 
         if (atEndOfLine) {
@@ -355,14 +355,14 @@ Position Position::previousLinePosition(int x) const
         // This containing editable block does not have a previous line.
         // Need to move back to previous containing editable block in this root editable
         // block and find the last root line box in that block.
-        NodeImpl *startBlock = node()->containingBlock();
+        NodeImpl *startBlock = node()->enclosingBlockFlowElement();
         NodeImpl *n = node()->previousEditable();
-        while (n && startBlock == n->containingBlock())
+        while (n && startBlock == n->enclosingBlockFlowElement())
             n = n->previousEditable();
         if (n) {
             while (n && !Position(n, n->caretMaxOffset()).inRenderedContent())
                 n = n->previousEditable();
-            if (n && n->inSameRootEditableBlock(node())) {
+            if (n && n->inSameRootEditableElement(node())) {
                 ASSERT(n->renderer());
                 box = n->renderer()->inlineBox(n->caretMaxOffset());
                 ASSERT(box);
@@ -404,14 +404,14 @@ Position Position::nextLinePosition(int x) const
         // This containing editable block does not have a next line.
         // Need to move forward to next containing editable block in this root editable
         // block and find the first root line box in that block.
-        NodeImpl *startBlock = node()->containingBlock();
+        NodeImpl *startBlock = node()->enclosingBlockFlowElement();
         NodeImpl *n = node()->nextEditable();
-        while (n && startBlock == n->containingBlock())
+        while (n && startBlock == n->enclosingBlockFlowElement())
             n = n->nextEditable();
         if (n) {
             while (n && !Position(n, n->caretMinOffset()).inRenderedContent())
                 n = n->nextEditable();
-            if (n && n->inSameRootEditableBlock(node())) {
+            if (n && n->inSameRootEditableElement(node())) {
                 ASSERT(n->renderer());
                 box = n->renderer()->inlineBox(n->caretMinOffset());
                 ASSERT(box);
@@ -437,11 +437,11 @@ Position Position::equivalentUpstreamPosition() const
     if (!node())
         return Position();
 
-    NodeImpl *block = node()->containingBlock();
+    NodeImpl *block = node()->enclosingBlockFlowElement();
     
     PositionIterator it(*this);            
     for (; !it.atStart(); it.previous()) {   
-        NodeImpl *currentBlock = it.current().node()->containingBlock();
+        NodeImpl *currentBlock = it.current().node()->enclosingBlockFlowElement();
         if (block != currentBlock)
             return it.next();
 
@@ -483,11 +483,11 @@ Position Position::equivalentDownstreamPosition() const
     if (!node())
         return Position();
 
-    NodeImpl *block = node()->containingBlock();
+    NodeImpl *block = node()->enclosingBlockFlowElement();
     
     PositionIterator it(*this);            
     for (; !it.atEnd(); it.next()) {   
-        NodeImpl *currentBlock = it.current().node()->containingBlock();
+        NodeImpl *currentBlock = it.current().node()->enclosingBlockFlowElement();
         if (block != currentBlock)
             return it.previous();
 
@@ -563,9 +563,9 @@ bool Position::atStartOfContainingEditableBlock() const
     return renderedOffset() == 0 && inFirstEditableInContainingEditableBlock();
 }
 
-bool Position::atStartOfRootEditableBlock() const
+bool Position::atStartOfRootEditableElement() const
 {
-    return renderedOffset() == 0 && inFirstEditableInRootEditableBlock();
+    return renderedOffset() == 0 && inFirstEditableInRootEditableElement();
 }
 
 bool Position::inRenderedContent() const
@@ -599,7 +599,7 @@ bool Position::inRenderedContent() const
     }
     else if (offset() >= renderer->caretMinOffset() && offset() <= renderer->caretMaxOffset()) {
         // don't return containing editable blocks unless they are empty
-        if (node()->containingBlock() == node() && node()->firstChild())
+        if (node()->enclosingBlockFlowElement() == node() && node()->firstChild())
             return false;
         return true;
     }
@@ -639,7 +639,7 @@ bool Position::rendersOnSameLine(const Position &pos) const
     if (node() == pos.node() && offset() == pos.offset())
         return true;
 
-    if (node()->containingBlock() != pos.node()->containingBlock())
+    if (node()->enclosingBlockFlowElement() != pos.node()->enclosingBlockFlowElement())
         return false;
 
     RenderObject *renderer = node()->renderer();
@@ -693,7 +693,7 @@ bool Position::rendersInDifferentPosition(const Position &pos) const
     if (pos.node()->id() == ID_BR && inRenderedContent())
         return true;
                 
-    if (node()->containingBlock() != pos.node()->containingBlock())
+    if (node()->enclosingBlockFlowElement() != pos.node()->enclosingBlockFlowElement())
         return true;
 
     if (node()->isTextNode() && !inRenderedText())
@@ -809,7 +809,7 @@ bool Position::isLastRenderedPositionInEditableBlock() const
     PositionIterator it(pos);
     while (!it.atEnd()) {
         it.next();
-        if (!it.current().node()->inSameContainingEditableBlock(node()))
+        if (!it.current().node()->inSameContainingBlockFlowElement(node()))
             return true;
         if (it.current().inRenderedContent())
             return false;
@@ -817,7 +817,7 @@ bool Position::isLastRenderedPositionInEditableBlock() const
     return true;
 }
 
-bool Position::inFirstEditableInRootEditableBlock() const
+bool Position::inFirstEditableInRootEditableElement() const
 {
     if (isEmpty() || !inRenderedContent())
         return false;
@@ -831,7 +831,7 @@ bool Position::inFirstEditableInRootEditableBlock() const
     return true;
 }
 
-bool Position::inLastEditableInRootEditableBlock() const
+bool Position::inLastEditableInRootEditableElement() const
 {
     if (isEmpty() || !inRenderedContent())
         return false;
@@ -850,14 +850,14 @@ bool Position::inFirstEditableInContainingEditableBlock() const
     if (isEmpty() || !inRenderedContent())
         return false;
     
-    NodeImpl *block = node()->containingBlock();
+    NodeImpl *block = node()->enclosingBlockFlowElement();
 
     PositionIterator it(*this);
     while (!it.atStart()) {
         it.previous();
         if (!it.current().inRenderedContent())
             continue;
-        return block != it.current().node()->containingBlock();
+        return block != it.current().node()->enclosingBlockFlowElement();
     }
 
     return true;
@@ -868,14 +868,14 @@ bool Position::inLastEditableInContainingEditableBlock() const
     if (isEmpty() || !inRenderedContent())
         return false;
     
-    NodeImpl *block = node()->containingBlock();
+    NodeImpl *block = node()->enclosingBlockFlowElement();
 
     PositionIterator it(*this);
     while (!it.atEnd()) {
         it.next();
         if (!it.current().inRenderedContent())
             continue;
-        return block != it.current().node()->containingBlock();
+        return block != it.current().node()->enclosingBlockFlowElement();
     }
 
     return true;
diff --git a/WebCore/khtml/xml/dom_position.h b/WebCore/khtml/xml/dom_position.h
index 6b8c64a..58c87bc 100644
--- a/WebCore/khtml/xml/dom_position.h
+++ b/WebCore/khtml/xml/dom_position.h
@@ -63,7 +63,7 @@ public:
     Position equivalentRangeCompliantPosition() const;
     Position equivalentShallowPosition() const;
     bool atStartOfContainingEditableBlock() const;
-    bool atStartOfRootEditableBlock() const;
+    bool atStartOfRootEditableElement() const;
     bool inRenderedContent() const;
     bool inRenderedText() const;
     bool rendersOnSameLine(const Position &pos) const;
@@ -71,8 +71,8 @@ public:
     bool isFirstRenderedPositionOnLine() const;
     bool isLastRenderedPositionOnLine() const;
     bool isLastRenderedPositionInEditableBlock() const;
-    bool inFirstEditableInRootEditableBlock() const;
-    bool inLastEditableInRootEditableBlock() const;
+    bool inFirstEditableInRootEditableElement() const;
+    bool inLastEditableInRootEditableElement() const;
     bool inFirstEditableInContainingEditableBlock() const;
     bool inLastEditableInContainingEditableBlock() const;
     
diff --git a/WebCore/khtml/xml/dom_selection.cpp b/WebCore/khtml/xml/dom_selection.cpp
index 98fa08d..178f9fb 100644
--- a/WebCore/khtml/xml/dom_selection.cpp
+++ b/WebCore/khtml/xml/dom_selection.cpp
@@ -641,14 +641,14 @@ bool Selection::moveToRenderedContent()
         
     // not currently rendered, try moving to prev
     Position prev = pos.previousCharacterPosition();
-    if (prev != pos && prev.node()->inSameContainingEditableBlock(pos.node())) {
+    if (prev != pos && prev.node()->inSameContainingBlockFlowElement(pos.node())) {
         moveTo(prev);
         return true;
     }
 
     // could not be moved to prev, try next
     Position next = pos.nextCharacterPosition();
-    if (next != pos && next.node()->inSameContainingEditableBlock(pos.node())) {
+    if (next != pos && next.node()->inSameContainingBlockFlowElement(pos.node())) {
         moveTo(next);
         return true;
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list