[iOS] Fix the easy half of the build errors in RenderBlock.cpp
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 11 Jan 2014 20:03:42 +0000 (20:03 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 11 Jan 2014 20:03:42 +0000 (20:03 +0000)
* rendering/RenderBlock.cpp:
(WebCore::isNonBlocksOrNonFixedHeightListItems):
(WebCore::oneLineTextMultiplier):
(WebCore::textMultiplier):
(WebCore::RenderBlock::adjustComputedFontSizes):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161774 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp

index 5ec8751c538c732e7baf732e62c681c14b6af26c..ab5d0fb0a1d275d85b945a202613dec19b684b41 100644 (file)
@@ -1,3 +1,13 @@
+2014-01-11  David Kilzer  <ddkilzer@apple.com>
+
+        [iOS] Fix the easy half of the build errors in RenderBlock.cpp
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::isNonBlocksOrNonFixedHeightListItems):
+        (WebCore::oneLineTextMultiplier):
+        (WebCore::textMultiplier):
+        (WebCore::RenderBlock::adjustComputedFontSizes):
+
 2014-01-11  Simon Fraser  <simon.fraser@apple.com>
 
         Change touch-related headers to include WebKitAdditions headers,
index f157731c25841efd0fb66bb95ea47e017602660d..cfdb9cc47ed1eedacff6bff83360c551ae739d5d 100644 (file)
@@ -5604,10 +5604,8 @@ static bool isNonBlocksOrNonFixedHeightListItems(const RenderObject* render)
 {
     if (!render->isRenderBlock())
         return true;
-    if (render->isListItem()) {
-        RenderStyle* style = render->style();
-        return style && style->height().type() != Fixed;
-    }
+    if (render->isListItem())
+        return render->style().height().type() != Fixed;
     return false;
 }
 
@@ -5615,12 +5613,12 @@ static bool isNonBlocksOrNonFixedHeightListItems(const RenderObject* render)
 //  We've been experimenting with low values for single lines of text.
 static inline float oneLineTextMultiplier(float specifiedSize)
 {
-    return max((1.0f / log10f(specifiedSize) * 1.7f), 1.0f);
+    return std::max((1.0f / log10f(specifiedSize) * 1.7f), 1.0f);
 }
 
 static inline float textMultiplier(float specifiedSize)
 {
-    return max((1.0f / log10f(specifiedSize) * 1.95f), 1.0f);
+    return std::max((1.0f / log10f(specifiedSize) * 1.95f), 1.0f);
 }
 
 void RenderBlock::adjustComputedFontSizes(float size, float visibleWidth)
@@ -5652,8 +5650,8 @@ void RenderBlock::adjustComputedFontSizes(float size, float visibleWidth)
     for (RenderObject* descendent = traverseNext(this, isNonBlocksOrNonFixedHeightListItems); descendent; descendent = descendent->traverseNext(this, isNonBlocksOrNonFixedHeightListItems)) {
         if (isVisibleRenderText(descendent) && resizeTextPermitted(descendent)) {
             RenderText* text = toRenderText(descendent);
-            RenderStyle* oldStyle = text->style();
-            FontDescription fontDescription = oldStyle->fontDescription();
+            RenderStyle& oldStyle = text->style();
+            FontDescription fontDescription = oldStyle.fontDescription();
             float specifiedSize = fontDescription.specifiedSize();
             float scaledSize = roundf(specifiedSize * scale);
             if (scaledSize > 0 && scaledSize < minFontSize) {
@@ -5666,8 +5664,8 @@ void RenderBlock::adjustComputedFontSizes(float size, float visibleWidth)
 
                 float candidateNewSize = 0;
                 float lineTextMultiplier = lineCount == ONE_LINE ? oneLineTextMultiplier(specifiedSize) : textMultiplier(specifiedSize);
-                candidateNewSize = roundf(min(minFontSize, specifiedSize * lineTextMultiplier));
-                if (candidateNewSize > specifiedSize && candidateNewSize != fontDescription.computedSize() && text->node() && (!oldStyle || oldStyle->textSizeAdjust().isAuto()))
+                candidateNewSize = roundf(std::min(minFontSize, specifiedSize * lineTextMultiplier));
+                if (candidateNewSize > specifiedSize && candidateNewSize != fontDescription.computedSize() && text->node() && oldStyle.textSizeAdjust().isAuto())
                     document().addAutoSizingNode(text->node(), candidateNewSize);
             }
         }