Title: [114568] trunk/Source/WebCore
Revision
114568
Author
[email protected]
Date
2012-04-18 15:03:44 -0700 (Wed, 18 Apr 2012)

Log Message

Add explicit template instantiation to chromium/PopupListBox.cpp to prepare for sub-pixel layout
https://bugs.webkit.org/show_bug.cgi?id=84264

Reviewed by Eric Seidel.

Explicitly instantiating integer max and min templates to fix compilation in Chromium. We
intentionally truncated these values in platform code, which matches earlier behavior.
See https://trac.webkit.org/wiki/LayoutUnit for details.

No new tests. No change in behavior.

* platform/chromium/PopupListBox.cpp:
(WebCore::PopupListBox::paintRow):
(WebCore::PopupListBox::layout):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (114567 => 114568)


--- trunk/Source/WebCore/ChangeLog	2012-04-18 21:53:50 UTC (rev 114567)
+++ trunk/Source/WebCore/ChangeLog	2012-04-18 22:03:44 UTC (rev 114568)
@@ -1,3 +1,20 @@
+2012-04-18  Levi Weintraub  <[email protected]>
+
+        Add explicit template instantiation to chromium/PopupListBox.cpp to prepare for sub-pixel layout
+        https://bugs.webkit.org/show_bug.cgi?id=84264
+
+        Reviewed by Eric Seidel.
+
+        Explicitly instantiating integer max and min templates to fix compilation in Chromium. We
+        intentionally truncated these values in platform code, which matches earlier behavior.
+        See https://trac.webkit.org/wiki/LayoutUnit for details.
+
+        No new tests. No change in behavior.
+
+        * platform/chromium/PopupListBox.cpp:
+        (WebCore::PopupListBox::paintRow):
+        (WebCore::PopupListBox::layout):
+
 2012-04-18  Luke Macpherson  <[email protected]>
 
         Prevent potential null pointer dereference in CSSStyleSelector::applyProperty().

Modified: trunk/Source/WebCore/platform/chromium/PopupListBox.cpp (114567 => 114568)


--- trunk/Source/WebCore/platform/chromium/PopupListBox.cpp	2012-04-18 21:53:50 UTC (rev 114567)
+++ trunk/Source/WebCore/platform/chromium/PopupListBox.cpp	2012-04-18 22:03:44 UTC (rev 114568)
@@ -453,9 +453,9 @@
     int textX = 0;
     int maxWidth = 0;
     if (rightAligned)
-        maxWidth = rowRect.width() - max(0, m_popupClient->clientPaddingRight() - m_popupClient->clientInsetRight());
+        maxWidth = rowRect.width() - max<int>(0, m_popupClient->clientPaddingRight() - m_popupClient->clientInsetRight());
     else {
-        textX = max(0, m_popupClient->clientPaddingLeft() - m_popupClient->clientInsetLeft());
+        textX = max<int>(0, m_popupClient->clientPaddingLeft() - m_popupClient->clientInsetLeft());
         maxWidth = rowRect.width() - textX;
     }
     // Prepare text to be drawn.
@@ -491,7 +491,7 @@
 
     // We are using the left padding as the right padding includes room for the scroll-bar which
     // does not show in this case.
-    int rightPadding = max(0, m_popupClient->clientPaddingLeft() - m_popupClient->clientInsetLeft());
+    int rightPadding = max<int>(0, m_popupClient->clientPaddingLeft() - m_popupClient->clientInsetLeft());
     int remainingWidth = rowRect.width() - rightPadding;
 
     // Draw the icon if applicable.
@@ -519,7 +519,7 @@
 
     TextRun labelTextRun(itemLabel.characters(), itemLabel.length(), false, 0, 0, TextRun::AllowTrailingExpansion, style.textDirection(), style.hasTextDirectionOverride());
     if (rightAligned)
-        textX = max(0, m_popupClient->clientPaddingLeft() - m_popupClient->clientInsetLeft());
+        textX = max<int>(0, m_popupClient->clientPaddingLeft() - m_popupClient->clientInsetLeft());
     else
         textX = remainingWidth - itemFont.width(labelTextRun);
 
@@ -848,9 +848,9 @@
 
         baseWidth = max(baseWidth, width);
         // FIXME: http://b/1210481 We should get the padding of individual option elements.
-        paddingWidth = max(paddingWidth,
+        paddingWidth = max<int>(paddingWidth,
             m_popupClient->clientPaddingLeft() + m_popupClient->clientPaddingRight());
-        lineEndPaddingWidth = max(lineEndPaddingWidth,
+        lineEndPaddingWidth = max<int>(lineEndPaddingWidth,
             isRightAligned ? m_popupClient->clientPaddingLeft() : m_popupClient->clientPaddingRight());
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to