[New Multicolumn] fast/multicol/fixed-column-percent-logical-height-orthogonal-writin...
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Apr 2014 22:19:19 +0000 (22:19 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Apr 2014 22:19:19 +0000 (22:19 +0000)
https://bugs.webkit.org/show_bug.cgi?id=132078

Reviewed by Anders Carlsson.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation):
Add a parameter to test for orthogonal writing modes. If we're perpendicular,
then we should not skip the flow thread, since we resolve relative to the column width,
and that is always set.

(WebCore::RenderBox::computePercentageLogicalHeight):
Patched to pass in whether or not the box and the ancestor block are perpendicular.

* rendering/RenderBox.h:
Patched the signature of skipContainingBlockForPercentHeightCalculation

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h

index 41b06e6..51cc7d5 100644 (file)
@@ -1,3 +1,22 @@
+2014-04-23  David Hyatt  <hyatt@apple.com>
+
+        [New Multicolumn] fast/multicol/fixed-column-percent-logical-height-orthogonal-writing-mode.html fails
+        https://bugs.webkit.org/show_bug.cgi?id=132078
+
+        Reviewed by Anders Carlsson.
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation):
+        Add a parameter to test for orthogonal writing modes. If we're perpendicular,
+        then we should not skip the flow thread, since we resolve relative to the column width,
+        and that is always set.
+
+        (WebCore::RenderBox::computePercentageLogicalHeight):
+        Patched to pass in whether or not the box and the ancestor block are perpendicular.
+
+        * rendering/RenderBox.h:
+        Patched the signature of skipContainingBlockForPercentHeightCalculation
+
 2014-04-23  Myles C. Maxfield  <mmaxfield@apple.com>
 
         [OS X] Make checking if a font is the system font more robust
index 6f297d3..3b8c249 100644 (file)
@@ -2712,11 +2712,11 @@ LayoutUnit RenderBox::computeContentAndScrollbarLogicalHeightUsing(const Length&
     return -1;
 }
 
-bool RenderBox::skipContainingBlockForPercentHeightCalculation(const RenderBox* containingBlock) const
+bool RenderBox::skipContainingBlockForPercentHeightCalculation(const RenderBox* containingBlock, bool isPerpendicularWritingMode) const
 {
     // Flow threads for multicol or paged overflow should be skipped. They are invisible to the DOM,
     // and percent heights of children should be resolved against the multicol or paged container.
-    if (containingBlock->isInFlowRenderFlowThread())
+    if (containingBlock->isInFlowRenderFlowThread() && !isPerpendicularWritingMode)
         return true;
 
     // For quirks mode and anonymous blocks, we skip auto-height containingBlocks when computing percentages.
@@ -2734,7 +2734,8 @@ LayoutUnit RenderBox::computePercentageLogicalHeight(const Length& height) const
     RenderBlock* cb = containingBlock();
     const RenderBox* containingBlockChild = this;
     LayoutUnit rootMarginBorderPaddingHeight = 0;
-    while (!cb->isRenderView() && skipContainingBlockForPercentHeightCalculation(cb)) {
+    bool isHorizontal = isHorizontalWritingMode();
+    while (!cb->isRenderView() && skipContainingBlockForPercentHeightCalculation(cb, isHorizontal != cb->isHorizontalWritingMode())) {
         if (cb->isBody() || cb->isRoot())
             rootMarginBorderPaddingHeight += cb->marginBefore() + cb->marginAfter() + cb->borderAndPaddingLogicalHeight();
         skippedAutoHeightContainingBlock = true;
@@ -2751,7 +2752,7 @@ LayoutUnit RenderBox::computePercentageLogicalHeight(const Length& height) const
 
     bool includeBorderPadding = isTable();
 
-    if (isHorizontalWritingMode() != cb->isHorizontalWritingMode())
+    if (isHorizontal != cb->isHorizontalWritingMode())
         availableHeight = containingBlockChild->containingBlockLogicalWidthForContent();
     else if (hasOverrideContainingBlockLogicalHeight())
         availableHeight = overrideContainingBlockContentLogicalHeight();
index 6087c77..12181e6 100644 (file)
@@ -669,7 +669,7 @@ private:
     // Returns true if we did a full repaint
     bool repaintLayerRectsForImage(WrappedImagePtr image, const FillLayer* layers, bool drawingBackground);
 
-    bool skipContainingBlockForPercentHeightCalculation(const RenderBox* containingBlock) const;
+    bool skipContainingBlockForPercentHeightCalculation(const RenderBox* containingBlock, bool isPerpendicularWritingMode) const;
    
     LayoutUnit containingBlockLogicalWidthForPositioned(const RenderBoxModelObject* containingBlock, RenderRegion* = 0, bool checkForPerpendicularWritingMode = true) const;
     LayoutUnit containingBlockLogicalHeightForPositioned(const RenderBoxModelObject* containingBlock, bool checkForPerpendicularWritingMode = true) const;