Title: [159166] trunk/Source/WebCore
Revision
159166
Author
[email protected]
Date
2013-11-12 17:32:33 -0800 (Tue, 12 Nov 2013)

Log Message

Make the placed floats tree use LayoutUnit instead of int
https://bugs.webkit.org/show_bug.cgi?id=124207

Reviewed by Alexandru Chiculita.

The dimensions of floats are in LayoutUnits, so it doesn't make sense
to be converting to ints for use in the placed floats tree.

Also add missed "explicit" to single argument FloatingObjects
constructor.

No new tests, no behavior change.

* rendering/FloatingObjects.cpp:
(WebCore::rangesIntersect):
(WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter):
(WebCore::ComputeFloatOffsetAdapter::lowValue):
(WebCore::ComputeFloatOffsetAdapter::highValue):
(WebCore::FindNextFloatLogicalBottomAdapter::FindNextFloatLogicalBottomAdapter):
(WebCore::FindNextFloatLogicalBottomAdapter::lowValue):
(WebCore::FindNextFloatLogicalBottomAdapter::highValue):
* rendering/FloatingObjects.h:
* rendering/RenderFlowThread.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (159165 => 159166)


--- trunk/Source/WebCore/ChangeLog	2013-11-13 01:24:54 UTC (rev 159165)
+++ trunk/Source/WebCore/ChangeLog	2013-11-13 01:32:33 UTC (rev 159166)
@@ -1,3 +1,29 @@
+2013-11-12  Bem Jones-Bey  <[email protected]>
+
+        Make the placed floats tree use LayoutUnit instead of int
+        https://bugs.webkit.org/show_bug.cgi?id=124207
+
+        Reviewed by Alexandru Chiculita.
+
+        The dimensions of floats are in LayoutUnits, so it doesn't make sense
+        to be converting to ints for use in the placed floats tree.
+
+        Also add missed "explicit" to single argument FloatingObjects
+        constructor.
+
+        No new tests, no behavior change.
+
+        * rendering/FloatingObjects.cpp:
+        (WebCore::rangesIntersect):
+        (WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter):
+        (WebCore::ComputeFloatOffsetAdapter::lowValue):
+        (WebCore::ComputeFloatOffsetAdapter::highValue):
+        (WebCore::FindNextFloatLogicalBottomAdapter::FindNextFloatLogicalBottomAdapter):
+        (WebCore::FindNextFloatLogicalBottomAdapter::lowValue):
+        (WebCore::FindNextFloatLogicalBottomAdapter::highValue):
+        * rendering/FloatingObjects.h:
+        * rendering/RenderFlowThread.h:
+
 2013-11-12  Alexey Proskuryakov  <[email protected]>
 
         Implement key generation and JWK import for RSASSA-PKCS1-v1_5

Modified: trunk/Source/WebCore/rendering/FloatingObjects.cpp (159165 => 159166)


--- trunk/Source/WebCore/rendering/FloatingObjects.cpp	2013-11-13 01:24:54 UTC (rev 159165)
+++ trunk/Source/WebCore/rendering/FloatingObjects.cpp	2013-11-13 01:32:33 UTC (rev 159166)
@@ -99,7 +99,7 @@
     return cloneObject;
 }
 
-inline static bool rangesIntersect(int floatTop, int floatBottom, int objectTop, int objectBottom)
+inline static bool rangesIntersect(LayoutUnit floatTop, LayoutUnit floatBottom, LayoutUnit objectTop, LayoutUnit objectBottom)
 {
     if (objectTop >= floatBottom || objectBottom < floatTop)
         return false;
@@ -126,15 +126,15 @@
 
     ComputeFloatOffsetAdapter(const RenderBlockFlow& renderer, LayoutUnit lineTop, LayoutUnit lineBottom, LayoutUnit offset)
         : m_renderer(renderer)
-        , m_lineTop(roundToInt(lineTop))
-        , m_lineBottom(roundToInt(lineBottom))
+        , m_lineTop(lineTop)
+        , m_lineBottom(lineBottom)
         , m_offset(offset)
         , m_outermostFloat(0)
     {
     }
 
-    int lowValue() const { return m_lineTop; }
-    int highValue() const { return m_lineBottom; }
+    LayoutUnit lowValue() const { return m_lineTop; }
+    LayoutUnit highValue() const { return m_lineBottom; }
     void collectIfNeeded(const IntervalType&);
 
     LayoutUnit offset() const { return m_offset; }
@@ -145,8 +145,8 @@
     bool updateOffsetIfNeeded(const FloatingObject*);
 
     const RenderBlockFlow& m_renderer;
-    int m_lineTop;
-    int m_lineBottom;
+    LayoutUnit m_lineTop;
+    LayoutUnit m_lineBottom;
     LayoutUnit m_offset;
     const FloatingObject* m_outermostFloat;
 };
@@ -157,15 +157,15 @@
 
     FindNextFloatLogicalBottomAdapter(const RenderBlockFlow& renderer, LayoutUnit belowLogicalHeight)
         : m_renderer(renderer)
-        , m_belowLogicalHeight(floorToInt(belowLogicalHeight))
-        , m_aboveLogicalHeight(roundToInt(LayoutUnit::max()))
+        , m_belowLogicalHeight(belowLogicalHeight)
+        , m_aboveLogicalHeight(LayoutUnit::max())
         , m_nextLogicalBottom(LayoutUnit::max())
         , m_nextShapeLogicalBottom(LayoutUnit::max())
     {
     }
 
-    int lowValue() const { return m_belowLogicalHeight; }
-    int highValue() const { return m_aboveLogicalHeight; }
+    LayoutUnit lowValue() const { return m_belowLogicalHeight; }
+    LayoutUnit highValue() const { return m_aboveLogicalHeight; }
     void collectIfNeeded(const IntervalType&);
 
     LayoutUnit nextLogicalBottom() { return m_nextLogicalBottom == LayoutUnit::max() ? LayoutUnit() : m_nextLogicalBottom; }
@@ -173,8 +173,8 @@
 
 private:
     const RenderBlockFlow& m_renderer;
-    int m_belowLogicalHeight;
-    int m_aboveLogicalHeight;
+    LayoutUnit m_belowLogicalHeight;
+    LayoutUnit m_aboveLogicalHeight;
     LayoutUnit m_nextLogicalBottom;
     LayoutUnit m_nextShapeLogicalBottom;
 };

Modified: trunk/Source/WebCore/rendering/FloatingObjects.h (159165 => 159166)


--- trunk/Source/WebCore/rendering/FloatingObjects.h	2013-11-13 01:24:54 UTC (rev 159165)
+++ trunk/Source/WebCore/rendering/FloatingObjects.h	2013-11-13 01:32:33 UTC (rev 159166)
@@ -113,8 +113,8 @@
 
 typedef ListHashSet<std::unique_ptr<FloatingObject>, 4, FloatingObjectHashFunctions> FloatingObjectSet;
 
-typedef PODInterval<int, FloatingObject*> FloatingObjectInterval;
-typedef PODIntervalTree<int, FloatingObject*> FloatingObjectTree;
+typedef PODInterval<LayoutUnit, FloatingObject*> FloatingObjectInterval;
+typedef PODIntervalTree<LayoutUnit, FloatingObject*> FloatingObjectTree;
 typedef PODFreeListArena<PODRedBlackTree<FloatingObjectInterval>::Node> IntervalArena;
 
 // FIXME: This is really the same thing as FloatingObjectSet.
@@ -124,7 +124,7 @@
 class FloatingObjects {
     WTF_MAKE_NONCOPYABLE(FloatingObjects); WTF_MAKE_FAST_ALLOCATED;
 public:
-    FloatingObjects(const RenderBlockFlow&);
+    explicit FloatingObjects(const RenderBlockFlow&);
     ~FloatingObjects();
 
     void clear();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to