Modified: trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp (218837 => 218838)
--- trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp 2017-06-27 19:11:34 UTC (rev 218837)
+++ trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp 2017-06-27 19:52:00 UTC (rev 218838)
@@ -301,8 +301,7 @@
FontCascade font;
TextRun run(emptyString());
float textWidth;
- if (!getReplacementTextGeometry(paintOffset, contentRect, indicatorRect, replacementTextRect, arrowRect, font, run, textWidth))
- return;
+ getReplacementTextGeometry(paintOffset, contentRect, indicatorRect, replacementTextRect, arrowRect, font, run, textWidth);
Path background;
background.addRoundedRect(indicatorRect, FloatSize(replacementTextRoundedRectRadius, replacementTextRoundedRectRadius));
@@ -349,8 +348,21 @@
repaint();
}
-bool RenderEmbeddedObject::getReplacementTextGeometry(const LayoutPoint& accumulatedOffset, FloatRect& contentRect, FloatRect& indicatorRect, FloatRect& replacementTextRect, FloatRect& arrowRect, FontCascade& font, TextRun& run, float& textWidth) const
+LayoutRect RenderEmbeddedObject::getReplacementTextGeometry(const LayoutPoint& accumulatedOffset) const
{
+ FloatRect contentRect;
+ FloatRect indicatorRect;
+ FloatRect replacementTextRect;
+ FloatRect arrowRect;
+ FontCascade font;
+ TextRun run(emptyString());
+ float textWidth;
+ getReplacementTextGeometry(accumulatedOffset, contentRect, indicatorRect, replacementTextRect, arrowRect, font, run, textWidth);
+ return LayoutRect(indicatorRect);
+}
+
+void RenderEmbeddedObject::getReplacementTextGeometry(const LayoutPoint& accumulatedOffset, FloatRect& contentRect, FloatRect& indicatorRect, FloatRect& replacementTextRect, FloatRect& arrowRect, FontCascade& font, TextRun& run, float& textWidth) const
+{
bool includesArrow = shouldUnavailablePluginMessageBeButton(page(), m_pluginUnavailabilityReason);
contentRect = contentBoxRect();
@@ -381,23 +393,11 @@
arrowRect.setWidth(arrowRect.height());
indicatorRect.unite(arrowRect);
}
-
- return true;
}
LayoutRect RenderEmbeddedObject::unavailablePluginIndicatorBounds(const LayoutPoint& accumulatedOffset) const
{
- FloatRect contentRect;
- FloatRect indicatorRect;
- FloatRect replacementTextRect;
- FloatRect arrowRect;
- FontCascade font;
- TextRun run(emptyString());
- float textWidth;
- if (getReplacementTextGeometry(accumulatedOffset, contentRect, indicatorRect, replacementTextRect, arrowRect, font, run, textWidth))
- return LayoutRect(indicatorRect);
-
- return LayoutRect();
+ return getReplacementTextGeometry(accumulatedOffset);
}
bool RenderEmbeddedObject::isReplacementObscured() const
@@ -580,15 +580,7 @@
bool RenderEmbeddedObject::isInUnavailablePluginIndicator(const FloatPoint& point) const
{
- FloatRect contentRect;
- FloatRect indicatorRect;
- FloatRect replacementTextRect;
- FloatRect arrowRect;
- FontCascade font;
- TextRun run(emptyString());
- float textWidth;
- return getReplacementTextGeometry(IntPoint(), contentRect, indicatorRect, replacementTextRect, arrowRect, font, run, textWidth)
- && indicatorRect.contains(point);
+ return getReplacementTextGeometry(LayoutPoint()).contains(LayoutPoint(point));
}
bool RenderEmbeddedObject::isInUnavailablePluginIndicator(const MouseEvent& event) const
Modified: trunk/Source/WebCore/rendering/RenderEmbeddedObject.h (218837 => 218838)
--- trunk/Source/WebCore/rendering/RenderEmbeddedObject.h 2017-06-27 19:11:34 UTC (rev 218837)
+++ trunk/Source/WebCore/rendering/RenderEmbeddedObject.h 2017-06-27 19:52:00 UTC (rev 218838)
@@ -86,7 +86,8 @@
void setUnavailablePluginIndicatorIsPressed(bool);
bool isInUnavailablePluginIndicator(const MouseEvent&) const;
bool isInUnavailablePluginIndicator(const FloatPoint&) const;
- bool getReplacementTextGeometry(const LayoutPoint& accumulatedOffset, FloatRect& contentRect, FloatRect& indicatorRect, FloatRect& replacementTextRect, FloatRect& arrowRect, FontCascade&, TextRun&, float& textWidth) const;
+ void getReplacementTextGeometry(const LayoutPoint& accumulatedOffset, FloatRect& contentRect, FloatRect& indicatorRect, FloatRect& replacementTextRect, FloatRect& arrowRect, FontCascade&, TextRun&, float& textWidth) const;
+ LayoutRect getReplacementTextGeometry(const LayoutPoint& accumulatedOffset) const;
LayoutRect unavailablePluginIndicatorBounds(const LayoutPoint&) const;
bool canHaveChildren() const final;