Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / rendering / FloatingObjects.cpp
index d455f53..e05422a 100644 (file)
 #include "core/rendering/RenderBox.h"
 #include "core/rendering/RenderView.h"
 
-using namespace std;
 using namespace WTF;
 
-namespace WebCore {
+namespace blink {
 
 struct SameSizeAsFloatingObject {
     void* pointers[2];
@@ -49,7 +48,7 @@ FloatingObject::FloatingObject(RenderBox* renderer)
     , m_shouldPaint(true)
     , m_isDescendant(false)
     , m_isPlaced(false)
-#ifndef NDEBUG
+#if ENABLE(ASSERT)
     , m_isInPlacedTree(false)
 #endif
 {
@@ -70,7 +69,7 @@ FloatingObject::FloatingObject(RenderBox* renderer, Type type, const LayoutRect&
     , m_shouldPaint(shouldPaint)
     , m_isDescendant(isDescendant)
     , m_isPlaced(true)
-#ifndef NDEBUG
+#if ENABLE(ASSERT)
     , m_isInPlacedTree(false)
 #endif
 {
@@ -201,7 +200,7 @@ LayoutUnit FloatingObjects::lowestFloatLogicalBottom(FloatingObject::Type floatT
             return getCachedlowestFloatLogicalBottom(floatType);
     } else {
         if (hasLowestFloatLogicalBottomCached(isInHorizontalWritingMode, FloatingObject::FloatLeft) && hasLowestFloatLogicalBottomCached(isInHorizontalWritingMode, FloatingObject::FloatRight)) {
-            return max(getCachedlowestFloatLogicalBottom(FloatingObject::FloatLeft),
+            return std::max(getCachedlowestFloatLogicalBottom(FloatingObject::FloatLeft),
                 getCachedlowestFloatLogicalBottom(FloatingObject::FloatRight));
         }
     }
@@ -218,19 +217,19 @@ LayoutUnit FloatingObjects::lowestFloatLogicalBottom(FloatingObject::Type floatT
                 FloatingObject::Type curType = floatingObject->type();
                 LayoutUnit curFloatLogicalBottom = m_renderer->logicalBottomForFloat(floatingObject);
                 if (curType & FloatingObject::FloatLeft)
-                    lowestFloatBottomLeft = max(lowestFloatBottomLeft, curFloatLogicalBottom);
+                    lowestFloatBottomLeft = std::max(lowestFloatBottomLeft, curFloatLogicalBottom);
                 if (curType & FloatingObject::FloatRight)
-                    lowestFloatBottomRight = max(lowestFloatBottomRight, curFloatLogicalBottom);
+                    lowestFloatBottomRight = std::max(lowestFloatBottomRight, curFloatLogicalBottom);
             }
         }
-        lowestFloatBottom = max(lowestFloatBottomLeft, lowestFloatBottomRight);
+        lowestFloatBottom = std::max(lowestFloatBottomLeft, lowestFloatBottomRight);
         setCachedLowestFloatLogicalBottom(isInHorizontalWritingMode, FloatingObject::FloatLeft, lowestFloatBottomLeft);
         setCachedLowestFloatLogicalBottom(isInHorizontalWritingMode, FloatingObject::FloatRight, lowestFloatBottomRight);
     } else {
         for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) {
             FloatingObject* floatingObject = it->get();
             if (floatingObject->isPlaced() && floatingObject->type() == floatType)
-                lowestFloatBottom = max(lowestFloatBottom, m_renderer->logicalBottomForFloat(floatingObject));
+                lowestFloatBottom = std::max(lowestFloatBottom, m_renderer->logicalBottomForFloat(floatingObject));
         }
         setCachedLowestFloatLogicalBottom(isInHorizontalWritingMode, floatType, lowestFloatBottom);
     }
@@ -311,7 +310,7 @@ void FloatingObjects::addPlacedObject(FloatingObject* floatingObject)
     if (m_placedFloatsTree.isInitialized())
         m_placedFloatsTree.add(intervalForFloatingObject(floatingObject));
 
-#ifndef NDEBUG
+#if ENABLE(ASSERT)
     floatingObject->setIsInPlacedTree(true);
 #endif
     markLowestFloatLogicalBottomCacheAsDirty();
@@ -327,7 +326,7 @@ void FloatingObjects::removePlacedObject(FloatingObject* floatingObject)
     }
 
     floatingObject->setIsPlaced(false);
-#ifndef NDEBUG
+#if ENABLE(ASSERT)
     floatingObject->setIsInPlacedTree(false);
 #endif
     markLowestFloatLogicalBottomCacheAsDirty();
@@ -391,7 +390,7 @@ LayoutUnit FloatingObjects::logicalRightOffsetForPositioningFloat(LayoutUnit fix
     if (heightRemaining)
         *heightRemaining = adapter.heightRemaining();
 
-    return min(fixedOffset, adapter.offset());
+    return std::min(fixedOffset, adapter.offset());
 }
 
 LayoutUnit FloatingObjects::logicalLeftOffset(LayoutUnit fixedOffset, LayoutUnit logicalTop, LayoutUnit logicalHeight)
@@ -407,7 +406,7 @@ LayoutUnit FloatingObjects::logicalRightOffset(LayoutUnit fixedOffset, LayoutUni
     ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight> adapter(m_renderer, roundToInt(logicalTop), roundToInt(logicalTop + logicalHeight), fixedOffset);
     placedFloatsTree().allOverlapsWithAdapter(adapter);
 
-    return min(fixedOffset, adapter.offset());
+    return std::min(fixedOffset, adapter.offset());
 }
 
 FloatingObjects::FloatBottomCachedValue::FloatBottomCachedValue()
@@ -543,4 +542,4 @@ String ValueToString<FloatingObject*>::string(const FloatingObject* floatingObje
 #endif
 
 
-} // namespace WebCore
+} // namespace blink