CTTE: EllipsisBox::renderer() should return RenderBlock&.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Sep 2013 13:51:31 +0000 (13:51 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Sep 2013 13:51:31 +0000 (13:51 +0000)
<https://webkit.org/b/121604>

Reviewed by Antti Koivisto.

I missed adding a renderer() overload when fixing up EllipsisBox.
Flushed out one unnecessary type check.

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/EllipsisBox.cpp
Source/WebCore/rendering/EllipsisBox.h
Source/WebCore/rendering/RenderBlock.h

index 7b9321383056ec5ce130c2e4f62c48b58c305331..046eb89a4b3ac7353d2824c397f84ac7526bb50c 100644 (file)
@@ -1,3 +1,13 @@
+2013-09-19  Andreas Kling  <akling@apple.com>
+
+        CTTE: EllipsisBox::renderer() should return RenderBlock&.
+        <https://webkit.org/b/121604>
+
+        Reviewed by Antti Koivisto.
+
+        I missed adding a renderer() overload when fixing up EllipsisBox.
+        Flushed out one unnecessary type check.
+
 2013-09-19  Andreas Kling  <akling@apple.com>
 
         CTTE: Tighten renderer types for InlineTextBox and SVGInlineTextBox.
index acccd1701b4f375b82a54b789a58e3cfba58041f..3184594738e1580c9574bb8a75ea3489c16c3403 100644 (file)
@@ -80,11 +80,10 @@ void EllipsisBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, La
 
 InlineBox* EllipsisBox::markupBox() const
 {
-    if (!m_shouldPaintMarkupBox || !renderer().isRenderBlock())
+    if (!m_shouldPaintMarkupBox)
         return 0;
 
-    RenderBlock& block = toRenderBlock(renderer());
-    RootInlineBox* lastLine = block.lineAtIndex(block.lineCount() - 1);
+    RootInlineBox* lastLine = renderer().lineAtIndex(renderer().lineCount() - 1);
     if (!lastLine)
         return 0;
 
@@ -160,7 +159,7 @@ bool EllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu
     LayoutRect boundsRect(adjustedLocation, LayoutSize(m_logicalWidth, m_height));
     if (visibleToHitTesting() && boundsRect.intersects(HitTestLocation::rectForPoint(locationInContainer.point(), 0, 0, 0, 0))) {
         renderer().updateHitTestResult(result, locationInContainer.point() - toLayoutSize(adjustedLocation));
-        if (!result.addNodeToRectBasedTestResult(renderer().node(), request, locationInContainer, boundsRect))
+        if (!result.addNodeToRectBasedTestResult(renderer().element(), request, locationInContainer, boundsRect))
             return true;
     }
 
index 80aed836b1fcc0b33b76eb8c6bf4db95293c8ff0..bf7f8682f40bc4d38dd19970b79608973e7aa746 100644 (file)
@@ -21,6 +21,7 @@
 #define EllipsisBox_h
 
 #include "InlineBox.h"
+#include "RenderBlock.h"
 
 namespace WebCore {
 
@@ -35,6 +36,8 @@ public:
     void setSelectionState(RenderObject::SelectionState s) { m_selectionState = s; }
     IntRect selectionRect();
 
+    RenderBlock& renderer() const { return toRenderBlock(InlineBox::renderer()); }
+
 private:
     void paintMarkupBox(PaintInfo&, const LayoutPoint& paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom, RenderStyle*);
     virtual int height() const { return m_height; }
index 5a6bf3ea650b6e111e905d999f549691ab52aeee..5c68d5a8643a2369546e520e417a2388f07c1f32 100644 (file)
@@ -462,6 +462,8 @@ public:
     virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) OVERRIDE;
 #endif
 
+    virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) OVERRIDE;
+
 protected:
     virtual void willBeDestroyed();
 
@@ -505,8 +507,6 @@ protected:
     virtual int inlineBlockBaseline(LineDirectionMode) const OVERRIDE;
     int lastLineBoxBaseline(LineDirectionMode) const;
 
-    virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&);
-
     // Delay update scrollbar until finishDelayRepaint() will be
     // called. This function is used when a flexbox is laying out its
     // descendant. If multiple calls are made to startDelayRepaint(),