[CTTE] Hide nonPseudoNode and generatingNode, replace with Element versions
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Sep 2013 13:36:02 +0000 (13:36 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Sep 2013 13:36:02 +0000 (13:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=121606

Reviewed by Andreas Kling.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156093 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderLayerModelObject.h
Source/WebCore/rendering/RenderRegion.h

index a2182e660beb328e0f58e9178974dc56735e6418..c863afeb3f09c1b1d5a81dc6d85e64c1f6ad7109 100644 (file)
@@ -1,3 +1,10 @@
+2013-09-19  Antti Koivisto  <antti@apple.com>
+
+        [CTTE] Hide nonPseudoNode and generatingNode, replace with Element versions
+        https://bugs.webkit.org/show_bug.cgi?id=121606
+
+        Reviewed by Andreas Kling.
+
 2013-09-19  Andreas Kling  <akling@apple.com>
 
         CTTE: Tighten renderer types for InlineFlowBox and SVGInlineFlowBox.
index 4eb3bf38a329eed6226cfc6c737e604175778582..08a94cfa97d17f21a29fe74aeea3d651e3bc727d 100644 (file)
@@ -4315,7 +4315,7 @@ Position RenderBlock::positionForBox(InlineBox *box, bool start) const
         return Position();
 
     if (!box->renderer().nonPseudoNode())
-        return createLegacyEditingPosition(nonPseudoNode(), start ? caretMinOffset() : caretMaxOffset());
+        return createLegacyEditingPosition(nonPseudoElement(), start ? caretMinOffset() : caretMaxOffset());
 
     if (!box->isInlineTextBox())
         return createLegacyEditingPosition(box->renderer().nonPseudoNode(), start ? box->renderer().caretMinOffset() : box->renderer().caretMaxOffset());
@@ -4345,8 +4345,8 @@ static VisiblePosition positionForPointRespectingEditingBoundaries(RenderBlock*
     LayoutPoint pointInChildCoordinates(toLayoutPoint(pointInParentCoordinates - childLocation));
 
     // If this is an anonymous renderer, we just recur normally
-    Node* childNode = child->nonPseudoNode();
-    if (!childNode)
+    Element* childElement= child->nonPseudoElement();
+    if (!childElement)
         return child->positionForPoint(pointInChildCoordinates);
 
     // Otherwise, first make sure that the editability of the parent and child agree.
@@ -4363,8 +4363,8 @@ static VisiblePosition positionForPointRespectingEditingBoundaries(RenderBlock*
     LayoutUnit childMiddle = parent->logicalWidthForChild(child) / 2;
     LayoutUnit logicalLeft = parent->isHorizontalWritingMode() ? pointInChildCoordinates.x() : pointInChildCoordinates.y();
     if (logicalLeft < childMiddle)
-        return ancestor->createVisiblePosition(childNode->nodeIndex(), DOWNSTREAM);
-    return ancestor->createVisiblePosition(childNode->nodeIndex() + 1, UPSTREAM);
+        return ancestor->createVisiblePosition(childElement->nodeIndex(), DOWNSTREAM);
+    return ancestor->createVisiblePosition(childElement->nodeIndex() + 1, UPSTREAM);
 }
 
 VisiblePosition RenderBlock::positionForPointWithInlineChildren(const LayoutPoint& pointInLogicalContents)
index 1ede45ea9fe3fa76244cd798da43b214cc3a8bf3..729abf3f458da3ab810eff201a85faafc69d9214 100644 (file)
@@ -4071,16 +4071,16 @@ VisiblePosition RenderBox::positionForPoint(const LayoutPoint& point)
 {
     // no children...return this render object's element, if there is one, and offset 0
     if (!firstChild())
-        return createVisiblePosition(nonPseudoNode() ? firstPositionInOrBeforeNode(nonPseudoNode()) : Position());
+        return createVisiblePosition(nonPseudoElement() ? firstPositionInOrBeforeNode(nonPseudoElement()) : Position());
 
-    if (isTable() && nonPseudoNode()) {
+    if (isTable() && nonPseudoElement()) {
         LayoutUnit right = contentWidth() + borderAndPaddingWidth();
         LayoutUnit bottom = contentHeight() + borderAndPaddingHeight();
         
         if (point.x() < 0 || point.x() > right || point.y() < 0 || point.y() > bottom) {
             if (point.x() <= right / 2)
-                return createVisiblePosition(firstPositionInOrBeforeNode(nonPseudoNode()));
-            return createVisiblePosition(lastPositionInOrAfterNode(nonPseudoNode()));
+                return createVisiblePosition(firstPositionInOrBeforeNode(nonPseudoElement()));
+            return createVisiblePosition(lastPositionInOrAfterNode(nonPseudoElement()));
         }
     }
 
@@ -4148,7 +4148,7 @@ VisiblePosition RenderBox::positionForPoint(const LayoutPoint& point)
     if (closestRenderer)
         return closestRenderer->positionForPoint(adjustedPoint - closestRenderer->locationOffset());
     
-    return createVisiblePosition(firstPositionInOrBeforeNode(nonPseudoNode()));
+    return createVisiblePosition(firstPositionInOrBeforeNode(nonPseudoElement()));
 }
 
 bool RenderBox::shrinkToAvoidFloats() const
index ded6df08baeb9d6aeaecab38dc29dde1048518e2..9030d512119831fc5c5312ad2d9294ce92a66f49 100644 (file)
@@ -52,6 +52,8 @@ public:
 
     // This is null for anonymous renderers.
     Element* element() const { return toElement(RenderObject::node()); }
+    Element* nonPseudoElement() const { return toElement(RenderObject::nonPseudoNode()); }
+    Element* generatingElement() const { return toElement(RenderObject::generatingNode()); }
 
 protected:
     void ensureLayer();
@@ -63,6 +65,8 @@ private:
     virtual bool isLayerModelObject() const OVERRIDE FINAL { return true; }
 
     void node() const WTF_DELETED_FUNCTION;
+    void nonPseudoNode() const WTF_DELETED_FUNCTION;
+    void generatingNode() const WTF_DELETED_FUNCTION;
 
     RenderLayer* m_layer;
 
index df05391f917077608bc5353fc3678587a95f2f83..f6c1328764cc17200ac1fd90898532371f02acb8 100644 (file)
@@ -153,8 +153,6 @@ public:
 
     LayoutRect rectFlowPortionForBox(const RenderBox*, const LayoutRect&) const;
 
-    Element* generatingElement() const { return toElement(RenderObject::generatingNode()); }
-
 protected:
     RenderOverflow* ensureOverflowForBox(const RenderBox*);