Title: [105197] branches/subpixellayout/Source/WebCore/rendering
Revision
105197
Author
[email protected]
Date
2012-01-17 15:02:38 -0800 (Tue, 17 Jan 2012)

Log Message

Stop using pixel snapped values for x values when laying out floats. This is necessary when there are two floats on a line both at 50% width. Switching to pixel snapped values for measuring the available width when laying out bidi runs. Switching improper truncating in shrinkAvailableWidthForNewFloatIfNeeded to pixel snapped values.

Modified Paths

Diff

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderBlock.cpp (105196 => 105197)


--- branches/subpixellayout/Source/WebCore/rendering/RenderBlock.cpp	2012-01-17 22:36:37 UTC (rev 105196)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderBlock.cpp	2012-01-17 23:02:38 UTC (rev 105197)
@@ -3633,17 +3633,16 @@
     if (r->type() == FloatTypeValue && interval.low() <= m_value && m_value < interval.high()) {
         // All the objects returned from the tree should be already placed.
         ASSERT(r->isPlaced() && m_renderer->pixelSnappedLogicalTopForFloat(r) <= m_value && m_renderer->pixelSnappedLogicalBottomForFloat(r) > m_value);
-
         if (FloatTypeValue == FloatingObject::FloatLeft 
-            && m_renderer->pixelSnappedLogicalRightForFloat(r) > m_offset) {
-            m_offset = m_renderer->pixelSnappedLogicalRightForFloat(r);
+            && m_renderer->logicalRightForFloat(r) > m_offset) {
+            m_offset = m_renderer->logicalRightForFloat(r);
             if (m_heightRemaining)
                 *m_heightRemaining = m_renderer->logicalBottomForFloat(r) - m_value;
         }
 
         if (FloatTypeValue == FloatingObject::FloatRight
-            && m_renderer->pixelSnappedLogicalLeftForFloat(r) < m_offset) {
-            m_offset = m_renderer->pixelSnappedLogicalLeftForFloat(r);
+            && m_renderer->logicalLeftForFloat(r) < m_offset) {
+            m_offset = m_renderer->logicalLeftForFloat(r);
             if (m_heightRemaining)
                 *m_heightRemaining = m_renderer->logicalBottomForFloat(r) - m_value;
         }

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderBlockLineLayout.cpp (105196 => 105197)


--- branches/subpixellayout/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2012-01-17 22:36:37 UTC (rev 105196)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2012-01-17 23:02:38 UTC (rev 105197)
@@ -98,8 +98,7 @@
 private:
     void computeAvailableWidthFromLeftAndRight()
     {
-        LayoutUnit width = m_right - m_left;
-        m_availableWidth = max<LayoutUnit>(0, snapSizeToPixel(width, m_left)) + m_overhangWidth;
+        m_availableWidth = max<LayoutUnit>(0, m_right - m_left) + m_overhangWidth;
     }
 
 private:
@@ -116,8 +115,8 @@
 inline void LineWidth::updateAvailableWidth()
 {
     LayoutUnit height = m_block->logicalHeight();
-    m_left = m_block->logicalLeftOffsetForLine(height, m_isFirstLine);
-    m_right = m_block->logicalRightOffsetForLine(height, m_isFirstLine);
+    m_left = m_block->pixelSnappedLogicalLeftOffsetForLine(height, m_isFirstLine);
+    m_right = m_block->pixelSnappedLogicalRightOffsetForLine(height, m_isFirstLine);
 
     computeAvailableWidthFromLeftAndRight();
 }
@@ -129,13 +128,13 @@
         return;
 
     if (newFloat->type() == RenderBlock::FloatingObject::FloatLeft) {
-        m_left = m_block->logicalRightForFloat(newFloat).toInt();
+        m_left = m_block->pixelSnappedLogicalRightForFloat(newFloat);
         if (m_isFirstLine && m_block->style()->isLeftToRightDirection())
-            m_left += m_block->textIndentOffset().toInt();
+            m_left += m_block->textIndentOffset();
     } else {
-        m_right = m_block->logicalLeftForFloat(newFloat).toInt();
+        m_right = m_block->pixelSnappedLogicalLeftForFloat(newFloat);
         if (m_isFirstLine && !m_block->style()->isLeftToRightDirection())
-            m_right -= m_block->textIndentOffset().toInt();
+            m_right -= m_block->textIndentOffset();
     }
 
     computeAvailableWidthFromLeftAndRight();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to