Title: [153591] trunk/Source/WebCore
Revision
153591
Author
timothy_hor...@apple.com
Date
2013-08-01 10:59:44 -0700 (Thu, 01 Aug 2013)

Log Message

Unavailable plug-in indicator arrow should be inside the rounded rect, not in its own circle
https://bugs.webkit.org/show_bug.cgi?id=119400
<rdar://problem/14616012>

Reviewed by Anders Carlsson.

* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
Shift the arrow in by 9px, and make the text's rounded rect include it,
instead of having the arrow in a separate circle.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (153590 => 153591)


--- trunk/Source/WebCore/ChangeLog	2013-08-01 17:39:43 UTC (rev 153590)
+++ trunk/Source/WebCore/ChangeLog	2013-08-01 17:59:44 UTC (rev 153591)
@@ -1,3 +1,16 @@
+2013-08-01  Tim Horton  <timothy_hor...@apple.com>
+
+        Unavailable plug-in indicator arrow should be inside the rounded rect, not in its own circle
+        https://bugs.webkit.org/show_bug.cgi?id=119400
+        <rdar://problem/14616012>
+
+        Reviewed by Anders Carlsson.
+
+        * rendering/RenderEmbeddedObject.cpp:
+        (WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
+        Shift the arrow in by 9px, and make the text's rounded rect include it,
+        instead of having the arrow in a separate circle.
+
 2013-08-01  Patrick Gansterer  <par...@webkit.org>
 
         Merge FrameWinCE into FrameWin

Modified: trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp (153590 => 153591)


--- trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp	2013-08-01 17:39:43 UTC (rev 153590)
+++ trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp	2013-08-01 17:59:44 UTC (rev 153591)
@@ -71,7 +71,7 @@
 static const float replacementTextRoundedRectBottomTextPadding = 1;
 static const float replacementTextRoundedRectOpacity = 0.8f;
 static const float replacementTextRoundedRectRadius = 5;
-static const float replacementArrowLeftMargin = 5;
+static const float replacementArrowLeftMargin = -4;
 static const float replacementArrowPadding = 4;
 
 static const Color& replacementTextRoundedRectPressedColor()
@@ -325,17 +325,22 @@
 
     replacementTextRect.setHeight(replacementTextRect.height() + replacementTextRoundedRectBottomTextPadding);
 
-    path.addRoundedRect(replacementTextRect, FloatSize(replacementTextRoundedRectRadius, replacementTextRoundedRectRadius));
+    FloatRect indicatorRect(replacementTextRect);
 
+    // Expand the background rect to include the arrow, if it will be used.
     if (shouldUnavailablePluginMessageBeButton(document(), m_pluginUnavailabilityReason)) {
-        arrowRect = path.boundingRect();
+        arrowRect = indicatorRect;
         arrowRect.setX(ceilf(arrowRect.maxX() + replacementArrowLeftMargin));
         arrowRect.setWidth(arrowRect.height());
+        indicatorRect.unite(arrowRect);
         arrowRect.inflate(-0.5);
-        path.addEllipse(arrowRect);
-        addReplacementArrowPath(path, arrowRect);
     }
 
+    path.addRoundedRect(indicatorRect, FloatSize(replacementTextRoundedRectRadius, replacementTextRoundedRectRadius));
+
+    if (shouldUnavailablePluginMessageBeButton(document(), m_pluginUnavailabilityReason))
+        addReplacementArrowPath(path, arrowRect);
+
     return true;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to