+2013-09-19 Andreas Kling <akling@apple.com>
+
+ CTTE: Tighten renderer types for InlineFlowBox and SVGInlineFlowBox.
+ <https://webkit.org/b/121603>
+
+ Reviewed by Antti Koivisto.
+
+ Codify the following:
+
+ - InlineFlowBox always has a RenderBoxModelObject.
+ - SVGInlineFlowBox always has a RenderSVGInline.
+
+ This turns some node() accessors into element(). Neato!
+
2013-09-19 Gurpreet Kaur <k.gurpreet@samsung.com>
CSS Unit vmax and vmin in border-width not handled.
if (locationInContainer.intersects(rect)) {
renderer().updateHitTestResult(result, flipForWritingMode(locationInContainer.point() - toLayoutSize(accumulatedOffset))); // Don't add in m_x or m_y here, we want coords in the containing block's space.
- if (!result.addNodeToRectBasedTestResult(renderer().node(), request, locationInContainer, rect))
+ if (!result.addNodeToRectBasedTestResult(renderer().element(), request, locationInContainer, rect))
return true;
}
if (containingBlockPaintsContinuationOutline) {
// Add ourselves to the containing block of the entire continuation so that it can
// paint us atomically.
- cb->addContinuationWithOutline(toRenderInline(renderer().node()->renderer()));
+ cb->addContinuationWithOutline(toRenderInline(renderer().element()->renderer()));
} else if (!inlineFlow.isInlineElementContinuation())
paintInfo.outlineObjects->add(&inlineFlow);
}
class InlineFlowBox : public InlineBox {
public:
- explicit InlineFlowBox(RenderObject& renderer)
+ explicit InlineFlowBox(RenderBoxModelObject& renderer)
: InlineBox(renderer)
, m_firstChild(0)
, m_lastChild(0)
virtual const char* boxName() const;
#endif
+ RenderBoxModelObject& renderer() const { return toRenderBoxModelObject(InlineBox::renderer()); }
+
InlineFlowBox* prevLineBox() const { return m_prevLineBox; }
InlineFlowBox* nextLineBox() const { return m_nextLineBox; }
void setNextLineBox(InlineFlowBox* n) { m_nextLineBox = n; }
// Highlight acts as a selection inflation.
FloatRect rootRect(0, selectionTop(), logicalWidth(), selectionHeight());
- IntRect inflatedRect = enclosingIntRect(page->chrome().client().customHighlightRect(renderer().node(), renderer().style()->highlight(), rootRect));
+ IntRect inflatedRect = enclosingIntRect(page->chrome().client().customHighlightRect(renderer().element(), renderer().style()->highlight(), rootRect));
setOverflowFromLogicalRects(inflatedRect, inflatedRect, lineTop(), lineBottom());
}
// Get the inflated rect so that we can properly hit test.
FloatRect rootRect(paintOffset.x() + x(), paintOffset.y() + selectionTop(), logicalWidth(), selectionHeight());
- FloatRect inflatedRect = page->chrome().client().customHighlightRect(renderer().node(), highlightType, rootRect);
+ FloatRect inflatedRect = page->chrome().client().customHighlightRect(renderer().element(), highlightType, rootRect);
if (inflatedRect.intersects(paintInfo.rect))
- page->chrome().client().paintCustomHighlight(renderer().node(), highlightType, rootRect, rootRect, false, true);
+ page->chrome().client().paintCustomHighlight(renderer().element(), highlightType, rootRect, rootRect, false, true);
}
#endif
#if ENABLE(SVG)
#include "InlineFlowBox.h"
+#include "RenderSVGInline.h"
namespace WebCore {
class SVGInlineFlowBox FINAL : public InlineFlowBox {
public:
- SVGInlineFlowBox(RenderObject& renderer)
+ SVGInlineFlowBox(RenderSVGInline& renderer)
: InlineFlowBox(renderer)
, m_logicalHeight(0)
{
}
- virtual bool isSVGInlineFlowBox() const { return true; }
- virtual float virtualLogicalHeight() const { return m_logicalHeight; }
- void setLogicalHeight(float h) { m_logicalHeight = h; }
-
- void paintSelectionBackground(PaintInfo&);
- virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom);
+ RenderSVGInline& renderer() { return static_cast<RenderSVGInline&>(InlineFlowBox::renderer()); }
- virtual FloatRect calculateBoundaries() const;
+ virtual FloatRect calculateBoundaries() const OVERRIDE;
+ void setLogicalHeight(float h) { m_logicalHeight = h; }
+ void paintSelectionBackground(PaintInfo&);
static void computeTextMatchMarkerRectForRenderer(RenderSVGInlineText*);
private:
+ virtual bool isSVGInlineFlowBox() const OVERRIDE { return true; }
+ virtual float virtualLogicalHeight() const OVERRIDE { return m_logicalHeight; }
+ virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom) OVERRIDE;
+
float m_logicalHeight;
};