Modified: trunk/Source/WebCore/ChangeLog (158211 => 158212)
--- trunk/Source/WebCore/ChangeLog 2013-10-29 19:49:31 UTC (rev 158211)
+++ trunk/Source/WebCore/ChangeLog 2013-10-29 19:52:06 UTC (rev 158212)
@@ -1,5 +1,14 @@
2013-10-29 Andreas Kling <[email protected]>
+ RenderObject::outlineStyleForRepaint() should return a reference.
+ <https://webkit.org/b/123453>
+
+ Kill a FIXME and make outlineStyleForRepaint() return a RenderStyle&.
+
+ Reviewed by Antti Koivisto.
+
+2013-10-29 Andreas Kling <[email protected]>
+
Move more of SVG resources cache to using RenderElement.
<https://webkit.org/b/123452>
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (158211 => 158212)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2013-10-29 19:49:31 UTC (rev 158211)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2013-10-29 19:52:06 UTC (rev 158212)
@@ -4984,9 +4984,9 @@
continuation->updateDragState(dragOn);
}
-RenderStyle* RenderBlock::outlineStyleForRepaint() const
+const RenderStyle& RenderBlock::outlineStyleForRepaint() const
{
- return isAnonymousBlockContinuation() ? &continuation()->style() : &style();
+ return isAnonymousBlockContinuation() ? continuation()->style() : style();
}
void RenderBlock::childBecameNonInline(RenderObject*)
Modified: trunk/Source/WebCore/rendering/RenderBlock.h (158211 => 158212)
--- trunk/Source/WebCore/rendering/RenderBlock.h 2013-10-29 19:49:31 UTC (rev 158211)
+++ trunk/Source/WebCore/rendering/RenderBlock.h 2013-10-29 19:52:06 UTC (rev 158212)
@@ -582,7 +582,7 @@
virtual RenderBlock* firstLineBlock() const OVERRIDE;
virtual LayoutRect rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const OVERRIDE FINAL;
- virtual RenderStyle* outlineStyleForRepaint() const OVERRIDE FINAL;
+ virtual const RenderStyle& outlineStyleForRepaint() const OVERRIDE FINAL;
virtual RenderElement* hoverAncestor() const OVERRIDE FINAL;
virtual void updateDragState(bool dragOn) OVERRIDE FINAL;
Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (158211 => 158212)
--- trunk/Source/WebCore/rendering/RenderObject.cpp 2013-10-29 19:49:31 UTC (rev 158211)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp 2013-10-29 19:52:06 UTC (rev 158212)
@@ -1412,8 +1412,8 @@
// We didn't move, but we did change size. Invalidate the delta, which will consist of possibly
// two rectangles (but typically only one).
- RenderStyle* outlineStyle = outlineStyleForRepaint();
- LayoutUnit outlineWidth = outlineStyle->outlineSize();
+ const RenderStyle& outlineStyle = outlineStyleForRepaint();
+ LayoutUnit outlineWidth = outlineStyle.outlineSize();
LayoutBoxExtent insetShadowExtent = style().getBoxShadowInsetExtent();
LayoutUnit width = absoluteValue(newOutlineBox.width() - oldOutlineBox.width());
if (width) {
@@ -1424,7 +1424,7 @@
LayoutUnit boxWidth = isBox() ? toRenderBox(this)->width() : LayoutUnit();
LayoutUnit minInsetRightShadowExtent = min<LayoutUnit>(-insetShadowExtent.right(), min<LayoutUnit>(newBounds.width(), oldBounds.width()));
LayoutUnit borderWidth = max<LayoutUnit>(borderRight, max<LayoutUnit>(valueForLength(style().borderTopRightRadius().width(), boxWidth, &view()), valueForLength(style().borderBottomRightRadius().width(), boxWidth)));
- LayoutUnit decorationsWidth = max<LayoutUnit>(-outlineStyle->outlineOffset(), borderWidth + minInsetRightShadowExtent) + max<LayoutUnit>(outlineWidth, shadowRight);
+ LayoutUnit decorationsWidth = max<LayoutUnit>(-outlineStyle.outlineOffset(), borderWidth + minInsetRightShadowExtent) + max<LayoutUnit>(outlineWidth, shadowRight);
LayoutRect rightRect(newOutlineBox.x() + min(newOutlineBox.width(), oldOutlineBox.width()) - decorationsWidth,
newOutlineBox.y(),
width + decorationsWidth,
@@ -1444,7 +1444,7 @@
LayoutUnit boxHeight = isBox() ? toRenderBox(this)->height() : LayoutUnit();
LayoutUnit minInsetBottomShadowExtent = min<LayoutUnit>(-insetShadowExtent.bottom(), min<LayoutUnit>(newBounds.height(), oldBounds.height()));
LayoutUnit borderHeight = max<LayoutUnit>(borderBottom, max<LayoutUnit>(valueForLength(style().borderBottomLeftRadius().height(), boxHeight), valueForLength(style().borderBottomRightRadius().height(), boxHeight, &view())));
- LayoutUnit decorationsHeight = max<LayoutUnit>(-outlineStyle->outlineOffset(), borderHeight + minInsetBottomShadowExtent) + max<LayoutUnit>(outlineWidth, shadowBottom);
+ LayoutUnit decorationsHeight = max<LayoutUnit>(-outlineStyle.outlineOffset(), borderHeight + minInsetBottomShadowExtent) + max<LayoutUnit>(outlineWidth, shadowBottom);
LayoutRect bottomRect(newOutlineBox.x(),
min(newOutlineBox.maxY(), oldOutlineBox.maxY()) - decorationsHeight,
max(newOutlineBox.width(), oldOutlineBox.width()),
@@ -2400,7 +2400,7 @@
void RenderObject::adjustRectForOutlineAndShadow(LayoutRect& rect) const
{
- int outlineSize = outlineStyleForRepaint()->outlineSize();
+ int outlineSize = outlineStyleForRepaint().outlineSize();
if (const ShadowData* boxShadow = style().boxShadow()) {
boxShadow->adjustRectForShadow(rect, outlineSize);
return;
Modified: trunk/Source/WebCore/rendering/RenderObject.h (158211 => 158212)
--- trunk/Source/WebCore/rendering/RenderObject.h 2013-10-29 19:49:31 UTC (rev 158211)
+++ trunk/Source/WebCore/rendering/RenderObject.h 2013-10-29 19:52:06 UTC (rev 158212)
@@ -722,8 +722,7 @@
// Anonymous blocks that are part of of a continuation chain will return their inline continuation's outline style instead.
// This is typically only relevant when repainting.
- // FIXME: Return a reference.
- virtual RenderStyle* outlineStyleForRepaint() const { return &const_cast<RenderStyle&>(style()); }
+ virtual const RenderStyle& outlineStyleForRepaint() const { return style(); }
virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const;