Title: [103716] branches/subpixellayout/Source/WebCore

Diff

Modified: branches/subpixellayout/Source/WebCore/platform/Length.h (103715 => 103716)


--- branches/subpixellayout/Source/WebCore/platform/Length.h	2011-12-27 18:35:22 UTC (rev 103715)
+++ branches/subpixellayout/Source/WebCore/platform/Length.h	2011-12-27 19:01:48 UTC (rev 103716)
@@ -150,6 +150,11 @@
         return 0;
     }
 
+    float calcValue(AppUnit maxValue, bool roundPercentages = false) const
+    {
+        return calcMinValue(maxValue.toFloat(), roundPercentages);
+    }
+
     float calcMinValue(float maxValue, bool roundPercentages = false) const
     {
         switch (type()) {

Modified: branches/subpixellayout/Source/WebCore/rendering/InlineFlowBox.cpp (103715 => 103716)


--- branches/subpixellayout/Source/WebCore/rendering/InlineFlowBox.cpp	2011-12-27 18:35:22 UTC (rev 103715)
+++ branches/subpixellayout/Source/WebCore/rendering/InlineFlowBox.cpp	2011-12-27 19:01:48 UTC (rev 103716)
@@ -56,9 +56,9 @@
 
 #endif
 
-int InlineFlowBox::getFlowSpacingLogicalWidth()
+LayoutUnit InlineFlowBox::getFlowSpacingLogicalWidth()
 {
-    int totWidth = marginBorderPaddingLogicalLeft() + marginBorderPaddingLogicalRight();
+    LayoutUnit totWidth = marginBorderPaddingLogicalLeft() + marginBorderPaddingLogicalRight();
     for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) {
         if (curr->isInlineFlowBox())
             totWidth += toInlineFlowBox(curr)->getFlowSpacingLogicalWidth();
@@ -389,8 +389,8 @@
             } else if (!curr->renderer()->isListMarker() || toRenderListMarker(curr->renderer())->isInside()) {
                 // The box can have a different writing-mode than the overall line, so this is a bit complicated.
                 // Just get all the physical margin and overflow values by hand based off |isVertical|.
-                int logicalLeftMargin = isHorizontal() ? curr->boxModelObject()->marginLeft() : curr->boxModelObject()->marginTop();
-                int logicalRightMargin = isHorizontal() ? curr->boxModelObject()->marginRight() : curr->boxModelObject()->marginBottom();
+                LayoutUnit logicalLeftMargin = isHorizontal() ? curr->boxModelObject()->marginLeft() : curr->boxModelObject()->marginTop();
+                LayoutUnit logicalRightMargin = isHorizontal() ? curr->boxModelObject()->marginRight() : curr->boxModelObject()->marginBottom();
                 
                 logicalLeft += logicalLeftMargin;
                 curr->setLogicalLeft(logicalLeft);

Modified: branches/subpixellayout/Source/WebCore/rendering/InlineFlowBox.h (103715 => 103716)


--- branches/subpixellayout/Source/WebCore/rendering/InlineFlowBox.h	2011-12-27 18:35:22 UTC (rev 103715)
+++ branches/subpixellayout/Source/WebCore/rendering/InlineFlowBox.h	2011-12-27 19:01:48 UTC (rev 103716)
@@ -117,8 +117,8 @@
     virtual RenderLineBoxList* rendererLineBoxes() const;
 
     // logicalLeft = left in a horizontal line and top in a vertical line.
-    int marginBorderPaddingLogicalLeft() const { return marginLogicalLeft() + borderLogicalLeft() + paddingLogicalLeft(); }
-    int marginBorderPaddingLogicalRight() const { return marginLogicalRight() + borderLogicalRight() + paddingLogicalRight(); }
+    LayoutUnit marginBorderPaddingLogicalLeft() const { return marginLogicalLeft() + borderLogicalLeft() + paddingLogicalLeft(); }
+    LayoutUnit marginBorderPaddingLogicalRight() const { return marginLogicalRight() + borderLogicalRight() + paddingLogicalRight(); }
     LayoutUnit marginLogicalLeft() const
     {
         if (!includeLogicalLeftEdge())
@@ -166,7 +166,7 @@
 
     // Helper functions used during line construction and placement.
     void determineSpacingForFlowBoxes(bool lastLine, bool isLogicallyLastRunWrapped, RenderObject* logicallyLastRunRenderer);
-    int getFlowSpacingLogicalWidth();
+    LayoutUnit getFlowSpacingLogicalWidth();
     float placeBoxesInInlineDirection(float logicalLeft, bool& needsWordSpacing, GlyphOverflowAndFallbackFontsMap&);
     void computeLogicalBoxHeights(RootInlineBox*, LayoutUnit& maxPositionTop, LayoutUnit& maxPositionBottom,
                                   LayoutUnit& maxAscent, LayoutUnit& maxDescent, bool& setMaxAscent, bool& setMaxDescent,

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderBlock.cpp (103715 => 103716)


--- branches/subpixellayout/Source/WebCore/rendering/RenderBlock.cpp	2011-12-27 18:35:22 UTC (rev 103715)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderBlock.cpp	2011-12-27 19:01:48 UTC (rev 103716)
@@ -3506,7 +3506,7 @@
 {
     positionNewFloats();
     // set y position
-    int newY = 0;
+    LayoutUnit newY = 0;
     switch (clear)
     {
         case CLEFT:
@@ -6755,13 +6755,13 @@
 
 RenderBlock::MarginValues RenderBlock::marginValuesForChild(RenderBox* child)
 {
-    int childBeforePositive = 0;
-    int childBeforeNegative = 0;
-    int childAfterPositive = 0;
-    int childAfterNegative = 0;
+    LayoutUnit childBeforePositive = 0;
+    LayoutUnit childBeforeNegative = 0;
+    LayoutUnit childAfterPositive = 0;
+    LayoutUnit childAfterNegative = 0;
 
-    int beforeMargin = 0;
-    int afterMargin = 0;
+    LayoutUnit beforeMargin = 0;
+    LayoutUnit afterMargin = 0;
 
     RenderBlock* childRenderBlock = child->isRenderBlock() ? toRenderBlock(child) : 0;
     

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderBlockLineLayout.cpp (103715 => 103716)


--- branches/subpixellayout/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2011-12-27 18:35:22 UTC (rev 103715)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2011-12-27 19:01:48 UTC (rev 103716)
@@ -98,7 +98,7 @@
 private:
     void computeAvailableWidthFromLeftAndRight()
     {
-        m_availableWidth = max(0, m_right - m_left) + m_overhangWidth;
+        m_availableWidth = max<LayoutUnit>(0, m_right - m_left) + m_overhangWidth;
     }
 
 private:
@@ -106,15 +106,15 @@
     float m_uncommittedWidth;
     float m_committedWidth;
     float m_overhangWidth; // The amount by which |m_availableWidth| has been inflated to account for possible contraction due to ruby overhang.
-    int m_left;
-    int m_right;
+    LayoutUnit m_left;
+    LayoutUnit m_right;
     float m_availableWidth;
     bool m_isFirstLine;
 };
 
 inline void LineWidth::updateAvailableWidth()
 {
-    int height = m_block->logicalHeight();
+    LayoutUnit height = m_block->logicalHeight();
     m_left = m_block->logicalLeftOffsetForLine(height, m_isFirstLine);
     m_right = m_block->logicalRightOffsetForLine(height, m_isFirstLine);
 
@@ -123,7 +123,7 @@
 
 inline void LineWidth::shrinkAvailableWidthForNewFloatIfNeeded(RenderBlock::FloatingObject* newFloat)
 {
-    int height = m_block->logicalHeight();
+    LayoutUnit height = m_block->logicalHeight();
     if (height < m_block->logicalTopForFloat(newFloat) || height >= m_block->logicalBottomForFloat(newFloat))
         return;
 
@@ -159,8 +159,8 @@
     ASSERT(!m_committedWidth);
     ASSERT(!fitsOnLine());
 
-    int floatLogicalBottom;
-    int lastFloatLogicalBottom = m_block->logicalHeight();
+    LayoutUnit floatLogicalBottom;
+    LayoutUnit lastFloatLogicalBottom = m_block->logicalHeight();
     float newLineWidth = m_availableWidth;
     float newLineLeft = m_left;
     float newLineRight = m_right;
@@ -1366,19 +1366,19 @@
         // This has to be done before adding in the bottom border/padding, or the float will
         // include the padding incorrectly. -dwh
         if (layoutState.checkForFloatsFromLastLine()) {
-            int bottomVisualOverflow = lastRootBox()->logicalBottomVisualOverflow();
-            int bottomLayoutOverflow = lastRootBox()->logicalBottomLayoutOverflow();
+            LayoutUnit bottomVisualOverflow = lastRootBox()->logicalBottomVisualOverflow();
+            LayoutUnit bottomLayoutOverflow = lastRootBox()->logicalBottomLayoutOverflow();
             TrailingFloatsRootInlineBox* trailingFloatsLineBox = new (renderArena()) TrailingFloatsRootInlineBox(this);
             m_lineBoxes.appendLineBox(trailingFloatsLineBox);
             trailingFloatsLineBox->setConstructed();
             GlyphOverflowAndFallbackFontsMap textBoxDataMap;
             VerticalPositionCache verticalPositionCache;
-            int blockLogicalHeight = logicalHeight();
+            LayoutUnit blockLogicalHeight = logicalHeight();
             trailingFloatsLineBox->alignBoxesInBlockDirection(blockLogicalHeight, textBoxDataMap, verticalPositionCache);
             trailingFloatsLineBox->setLineTopBottomPositions(blockLogicalHeight, blockLogicalHeight, blockLogicalHeight, blockLogicalHeight);
             trailingFloatsLineBox->setPaginatedLineWidth(availableLogicalWidthForContent(blockLogicalHeight));
-            IntRect logicalLayoutOverflow(0, blockLogicalHeight, 1, bottomLayoutOverflow - blockLogicalHeight);
-            IntRect logicalVisualOverflow(0, blockLogicalHeight, 1, bottomVisualOverflow - blockLogicalHeight);
+            LayoutRect logicalLayoutOverflow(0, blockLogicalHeight, 1, bottomLayoutOverflow - blockLogicalHeight);
+            LayoutRect logicalVisualOverflow(0, blockLogicalHeight, 1, bottomVisualOverflow - blockLogicalHeight);
             trailingFloatsLineBox->setOverflowFromLogicalRects(logicalLayoutOverflow, logicalVisualOverflow, trailingFloatsLineBox->lineTop(), trailingFloatsLineBox->lineBottom());
         }
 
@@ -2275,7 +2275,6 @@
                 lBreak.moveToStartOf(current.m_obj);
                 ASSERT(current.m_pos == t->textLength());
             }
-
             for (; current.m_pos < t->textLength(); current.fastIncrementInTextNode()) {
                 bool previousCharacterIsSpace = currentCharacterIsSpace;
                 bool previousCharacterIsWS = currentCharacterIsWS;

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderBox.h (103715 => 103716)


--- branches/subpixellayout/Source/WebCore/rendering/RenderBox.h	2011-12-27 18:35:22 UTC (rev 103715)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderBox.h	2011-12-27 19:01:48 UTC (rev 103716)
@@ -201,9 +201,9 @@
     LayoutUnit clientTop() const { return borderTop(); }
     LayoutUnit clientWidth() const;
     LayoutUnit clientHeight() const;
-    int clientLogicalWidth() const { return style()->isHorizontalWritingMode() ? pixelSnappedClientWidth() : pixelSnappedClientHeight(); }
-    int clientLogicalHeight() const { return style()->isHorizontalWritingMode() ? pixelSnappedClientHeight() : pixelSnappedClientWidth(); }
-    int clientLogicalBottom() const { return borderBefore() + clientLogicalHeight(); }
+    LayoutUnit clientLogicalWidth() const { return style()->isHorizontalWritingMode() ? pixelSnappedClientWidth() : pixelSnappedClientHeight(); }
+    LayoutUnit clientLogicalHeight() const { return style()->isHorizontalWritingMode() ? pixelSnappedClientHeight() : pixelSnappedClientWidth(); }
+    LayoutUnit clientLogicalBottom() const { return borderBefore() + clientLogicalHeight(); }
     IntRect clientBoxRect() const { return IntRect(pixelSnappedClientLeft(), pixelSnappedClientTop(), pixelSnappedClientWidth(), pixelSnappedClientHeight()); }
 
     // scrollWidth/scrollHeight will be the same as clientWidth/clientHeight unless the

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderEmbeddedObject.cpp (103715 => 103716)


--- branches/subpixellayout/Source/WebCore/rendering/RenderEmbeddedObject.cpp	2011-12-27 18:35:22 UTC (rev 103715)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderEmbeddedObject.cpp	2011-12-27 19:01:48 UTC (rev 103716)
@@ -237,8 +237,8 @@
     // This is required for <object> elements whose contents are rendered by WebCore (e.g. src=""
     if (node() && widget() && widget()->isFrameView()) {
         FrameView* view = static_cast<FrameView*>(widget());
-        int marginWidth = -1;
-        int marginHeight = -1;
+        LayoutUnit marginWidth = -1;
+        LayoutUnit marginHeight = -1;
         if (node()->hasTagName(iframeTag)) {
             HTMLIFrameElement* frame = static_cast<HTMLIFrameElement*>(node());
             marginWidth = frame->marginWidth();

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderFrame.cpp (103715 => 103716)


--- branches/subpixellayout/Source/WebCore/rendering/RenderFrame.cpp	2011-12-27 18:35:22 UTC (rev 103715)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderFrame.cpp	2011-12-27 19:01:48 UTC (rev 103716)
@@ -56,8 +56,8 @@
 
     FrameView* view = static_cast<FrameView*>(widget());
 
-    int marginWidth = element->marginWidth();
-    int marginHeight = element->marginHeight();
+    LayoutUnit marginWidth = element->marginWidth();
+    LayoutUnit marginHeight = element->marginHeight();
 
     if (marginWidth != -1)
         view->setMarginWidth(marginWidth);

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderInline.h (103715 => 103716)


--- branches/subpixellayout/Source/WebCore/rendering/RenderInline.h	2011-12-27 18:35:22 UTC (rev 103715)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderInline.h	2011-12-27 19:01:48 UTC (rev 103716)
@@ -123,8 +123,8 @@
 
     virtual LayoutUnit offsetLeft() const;
     virtual LayoutUnit offsetTop() const;
-    virtual LayoutUnit offsetWidth() const { return linesBoundingBox().width(); }
-    virtual LayoutUnit offsetHeight() const { return linesBoundingBox().height(); }
+    virtual LayoutUnit offsetWidth() const { return linesBoundingBox().width().ceil(); }
+    virtual LayoutUnit offsetHeight() const { return linesBoundingBox().height().ceil(); }
 
     virtual LayoutRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) const;
     virtual LayoutRect rectWithOutlineForRepaint(RenderBoxModelObject* repaintContainer, LayoutUnit outlineWidth) const;

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderListMarker.cpp (103715 => 103716)


--- branches/subpixellayout/Source/WebCore/rendering/RenderListMarker.cpp	2011-12-27 18:35:22 UTC (rev 103715)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderListMarker.cpp	2011-12-27 19:01:48 UTC (rev 103716)
@@ -1473,8 +1473,8 @@
 {
     const FontMetrics& fontMetrics = style()->fontMetrics();
 
-    int marginStart = 0;
-    int marginEnd = 0;
+    LayoutUnit marginStart = 0;
+    LayoutUnit marginEnd = 0;
 
     if (isInside()) {
         if (isImage())
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to