Source/WebCore/ChangeLog

 12011-11-29 Fady Samuel <fsamuel@chromium.org>
 2
 3 -webkit-aspect-ratio Layout Implementation
 4 https://bugs.webkit.org/show_bug.cgi?id=73277
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Tests: css3/aspect-ratio/absolute-ratio-absolute-left-right.html
 9 css3/aspect-ratio/aspect-ratio-absolute-height.html
 10 css3/aspect-ratio/aspect-ratio-absolute-width.html
 11 css3/aspect-ratio/aspect-ratio-auto-height.html
 12 css3/aspect-ratio/aspect-ratio-float.html
 13 css3/aspect-ratio/aspect-ratio-inherit.html
 14 css3/aspect-ratio/aspect-ratio-stretch-to-fill.html
 15
 16 * rendering/RenderBlock.cpp:
 17 (WebCore::RenderBlock::layoutBlock):
 18 (WebCore::RenderBlock::layoutBlockChildren):
 19 * rendering/RenderBox.cpp:
 20 (WebCore::RenderBox::isWidthDeterminedUsing):
 21 (WebCore::RenderBox::isHeightDeterminedUsing):
 22 (WebCore::RenderBox::useAspectRatioForWidth):
 23 (WebCore::RenderBox::useAspectRatioForHeight):
 24 (WebCore::RenderBox::computeLogicalWidthInRegion):
 25 (WebCore::RenderBox::computeLogicalWidthUsing):
 26 (WebCore::RenderBox::computeLogicalHeight):
 27 (WebCore::RenderBox::computeLogicalHeightUsing):
 28 (WebCore::RenderBox::computePositionedLogicalWidth):
 29 (WebCore::RenderBox::computePositionedLogicalWidthUsing):
 30 (WebCore::RenderBox::computePositionedLogicalHeight):
 31 (WebCore::RenderBox::computePositionedLogicalHeightUsing):
 32 * rendering/RenderBox.h:
 33 * rendering/style/RenderStyle.cpp:
 34 (WebCore::RenderStyle::diff):
 35
1362011-11-28 Vsevolod Vlasov <vsevik@chromium.org>
237
338 Web Inspector: TextPrompt should show suggest above or under so that it has maximal height.

Source/WebCore/rendering/RenderBlock.cpp

@@void RenderBlock::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeigh
12031203
12041204 LayoutUnit oldWidth = logicalWidth();
12051205 LayoutUnit oldColumnWidth = desiredColumnWidth();
 1206
 1207 LayoutUnit previousHeight = logicalHeight();
 1208 setLogicalHeight(0);
12061209
12071210 computeLogicalWidth();
12081211 calcColumnWidth();

@@void RenderBlock::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeigh
12191222 floatsLayoutPass = PositionedFloatLayoutPass;
12201223 clearFloats(floatsLayoutPass);
12211224
1222  LayoutUnit previousHeight = logicalHeight();
1223  setLogicalHeight(0);
12241225 bool hasSpecifiedPageLogicalHeight = false;
12251226 bool pageLogicalHeightChanged = false;
12261227 ColumnInfo* colInfo = columnInfo();

@@void RenderBlock::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeigh
13221323 LayoutUnit oldClientAfterEdge = clientLogicalBottom();
13231324 computeLogicalHeight();
13241325 LayoutUnit newHeight = logicalHeight();
 1326
13251327 if (oldHeight != newHeight) {
13261328 if (oldHeight > newHeight && maxFloatLogicalBottom > newHeight && !childrenInline()) {
13271329 // One of our children's floats may have become an overhanging float for us. We need to look for it.

@@void RenderBlock::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeigh
13381340 if (previousHeight != newHeight)
13391341 relayoutChildren = true;
13401342
 1343 // FIXME: Only recompute logical width if aspect ratio is not satisfied
 1344 oldWidth = logicalWidth();
 1345 if (style()->hasAspectRatio())
 1346 computeLogicalWidth();
 1347 if (oldWidth != logicalWidth())
 1348 relayoutChildren = true;
 1349
13411350 bool needAnotherLayoutPass = layoutPositionedObjects(relayoutChildren || isRoot());
13421351
13431352 if (inRenderFlowThread())

@@void RenderBlock::layoutBlockChildren(bool relayoutChildren, LayoutUnit& maxFloa
19691978 }
19701979 }
19711980 }
1972 
19731981 LayoutUnit beforeEdge = borderBefore() + paddingBefore();
19741982 LayoutUnit afterEdge = borderAfter() + paddingAfter() + scrollbarLogicalHeight();
19751983

@@void RenderBlock::layoutBlockChildren(bool relayoutChildren, LayoutUnit& maxFloa
19982006 // Make sure we layout children if they need it.
19992007 // FIXME: Technically percentage height objects only need a relayout if their percentage isn't going to be turned into
20002008 // an auto value. Add a method to determine this, so that we can avoid the relayout.
2001  if (relayoutChildren || ((child->style()->logicalHeight().isPercent() || child->style()->logicalMinHeight().isPercent() || child->style()->logicalMaxHeight().isPercent()) && !isRenderView()))
 2009 if (relayoutChildren || ((child->style()->hasAspectRatio() || child->style()->logicalHeight().isPercent() || child->style()->logicalMinHeight().isPercent() || child->style()->logicalMaxHeight().isPercent()) && !isRenderView()))
20022010 child->setChildNeedsLayout(true, false);
20032011
20042012 // If relayoutChildren is set and the child has percentage padding or an embedded content box, we also need to invalidate the childs pref widths.

Source/WebCore/rendering/RenderBox.cpp

@@void RenderBox::repaintDuringLayoutIfMoved(const LayoutRect& rect)
16581658 }
16591659}
16601660
 1661bool RenderBox::isWidthDeterminedUsing(const Length& logicalWidth, const Length& logicalLeft, const Length& logicalRight) const
 1662{
 1663 bool widthIsAuto = logicalWidth.isAuto();
 1664 bool logicalMinWidthIsSpecified = !style()->logicalMinWidth().isAuto() && style()->logicalMinWidth().isPositive();
 1665 bool leftIsAuto = logicalLeft.isAuto();
 1666 bool rightIsAuto = logicalRight.isAuto();
 1667 bool hasAspectRatio = style()->hasAspectRatio();
 1668 // Width is determined if the width is specified or left and right are specified on a positioned box.
 1669 return !widthIsAuto || logicalMinWidthIsSpecified || (!leftIsAuto && widthIsAuto && !rightIsAuto && !hasAspectRatio && isPositioned());
 1670}
 1671
 1672bool RenderBox::isHeightDeterminedUsing(const Length& logicalHeight, const Length& logicalTop, const Length& logicalBottom) const
 1673{
 1674 bool heightIsAuto = logicalHeight.isAuto();
 1675 bool logicalMinHeightIsSpecified = !style()->logicalMinHeight().isAuto() && style()->logicalMinHeight().isPositive();
 1676 bool topIsAuto = logicalTop.isAuto();
 1677 bool bottomIsAuto = logicalBottom.isAuto();
 1678 bool hasAspectRatio = style()->hasAspectRatio();
 1679 // Height is determined if height is specificed or top and bottom are specified on a positioned box.
 1680 return !heightIsAuto || logicalMinHeightIsSpecified || (!topIsAuto && heightIsAuto && !bottomIsAuto && !hasAspectRatio && isPositioned());
 1681}
 1682
 1683bool RenderBox::useAspectRatioForWidth(const Length& logicalWidth, const Length& logicalLeft, const Length& logicalRight) const
 1684{
 1685 return !isWidthDeterminedUsing(logicalWidth, logicalLeft, logicalRight) && style()->hasAspectRatio();
 1686}
 1687
 1688bool RenderBox::useAspectRatioForHeight(const Length& logicalHeight, const Length& logicalTop, const Length& logicalBottom) const
 1689{
 1690 return !isHeightDeterminedUsing(logicalHeight, logicalTop, logicalBottom) && style()->hasAspectRatio();
 1691}
 1692
16611693void RenderBox::computeLogicalWidth()
16621694{
16631695 computeLogicalWidthInRegion();

@@void RenderBox::computeLogicalWidthInRegion(RenderRegion* region, LayoutUnit off
17401772 }
17411773
17421774 // Margin calculations.
1743  if (logicalWidthLength.isAuto() || hasPerpendicularContainingBlock) {
 1775 if ((logicalWidthLength.isAuto() && !style()->hasAspectRatio()) || hasPerpendicularContainingBlock) {
17441776 setMarginStart(style()->marginStart().calcMinValue(containerLogicalWidth));
17451777 setMarginEnd(style()->marginEnd().calcMinValue(containerLogicalWidth));
17461778 } else

@@void RenderBox::computeLogicalWidthInRegion(RenderRegion* region, LayoutUnit off
17541786LayoutUnit RenderBox::computeLogicalWidthUsing(LogicalWidthType widthType, LayoutUnit availableLogicalWidth)
17551787{
17561788 LayoutUnit logicalWidthResult = logicalWidth();
 1789 const LayoutUnit bordersPlusPadding = borderAndPaddingLogicalWidth();
17571790 Length logicalWidth;
1758  if (widthType == LogicalWidth)
 1791 switch (widthType) {
 1792 case LogicalWidth:
17591793 logicalWidth = style()->logicalWidth();
1760  else if (widthType == MinLogicalWidth)
 1794 break;
 1795 case MinLogicalWidth:
17611796 logicalWidth = style()->logicalMinWidth();
1762  else
 1797 break;
 1798 case MaxLogicalWidth:
17631799 logicalWidth = style()->logicalMaxWidth();
 1800 break;
 1801 case MinPreferredLogicalWidth:
 1802 ASSERT_NOT_REACHED();
 1803 logicalWidth = Length(minPreferredLogicalWidth() - bordersPlusPadding, Fixed);
 1804 break;
 1805 }
17641806
17651807 if (logicalWidth.isIntrinsicOrAuto()) {
17661808 LayoutUnit marginStart = style()->marginStart().calcMinValue(availableLogicalWidth);
17671809 LayoutUnit marginEnd = style()->marginEnd().calcMinValue(availableLogicalWidth);
17681810 logicalWidthResult = availableLogicalWidth - marginStart - marginEnd;
 1811 bool useAspectRatio = style()->hasAspectRatio();
 1812 if (useAspectRatio) {
 1813 float requiredRatio = style()->aspectRatio();
 1814 if (logicalHeight()) {
 1815 int widthForAspectRatio = static_cast<int>(logicalHeight() * requiredRatio);
 1816 if (widthType == LogicalWidth)
 1817 logicalWidthResult = min(widthForAspectRatio, logicalWidthResult);
 1818 }
 1819 }
17691820
17701821 if (sizesToIntrinsicLogicalWidth(widthType)) {
17711822 logicalWidthResult = max(logicalWidthResult, minPreferredLogicalWidth());

@@void RenderBox::computeLogicalHeight()
20092060
20102061 LayoutUnit heightResult;
20112062 if (checkMinMaxHeight) {
2012  heightResult = computeLogicalHeightUsing(style()->logicalHeight());
 2063 heightResult = computeLogicalHeightUsing(LogicalHeight);
20132064 // FIXME: Use < 0 or roughlyEquals when we move to float, see https://bugs.webkit.org/show_bug.cgi?id=66148
20142065 if (heightResult == -1)
20152066 heightResult = logicalHeight();
2016  LayoutUnit minH = computeLogicalHeightUsing(style()->logicalMinHeight()); // Leave as -1 if unset.
2017  LayoutUnit maxH = style()->logicalMaxHeight().isUndefined() ? heightResult : computeLogicalHeightUsing(style()->logicalMaxHeight());
 2067 LayoutUnit minH = computeLogicalHeightUsing(MinLogicalHeight); // Leave as -1 if unset.
 2068 LayoutUnit maxH = style()->logicalMaxHeight().isUndefined() ? heightResult : computeLogicalHeightUsing(MaxLogicalHeight);
20182069 if (maxH == -1)
20192070 maxH = heightResult;
20202071 heightResult = min(maxH, heightResult);

@@void RenderBox::computeLogicalHeight()
20612112 }
20622113}
20632114
2064 LayoutUnit RenderBox::computeLogicalHeightUsing(const Length& h)
 2115LayoutUnit RenderBox::computeLogicalHeightUsing(LogicalHeightType heightType)
20652116{
2066  LayoutUnit logicalHeight = -1;
 2117 Length h;
 2118 switch (heightType) {
 2119 case LogicalHeight:
 2120 h = style()->logicalHeight();
 2121 break;
 2122 case MinLogicalHeight:
 2123 h = style()->logicalMinHeight();
 2124 break;
 2125 case MaxLogicalHeight:
 2126 h = style()->logicalMaxHeight();
 2127 break;
 2128 }
 2129
 2130 LayoutUnit logicalHeightValue = -1;
20672131 if (!h.isAuto()) {
20682132 if (h.isFixed())
2069  logicalHeight = h.value();
 2133 logicalHeightValue = h.value();
20702134 else if (h.isPercent())
2071  logicalHeight = computePercentageLogicalHeight(h);
 2135 logicalHeightValue = computePercentageLogicalHeight(h);
20722136 // FIXME: Use < 0 or roughlyEquals when we move to float, see https://bugs.webkit.org/show_bug.cgi?id=66148
2073  if (logicalHeight != -1) {
2074  logicalHeight = computeBorderBoxLogicalHeight(logicalHeight);
2075  return logicalHeight;
 2137 if (logicalHeightValue != -1) {
 2138 logicalHeightValue = computeBorderBoxLogicalHeight(logicalHeightValue);
 2139 return logicalHeightValue;
 2140 }
 2141 } else if (style()->hasAspectRatio() && !logicalHeight() && heightType == LogicalHeight) {
 2142 if (logicalWidth()) {
 2143 float requiredRatio = style()->aspectRatioDenominator() / style()->aspectRatioNumerator();
 2144 int heightForAspectRatio = static_cast<int>(logicalWidth() * requiredRatio);
 2145 logicalHeightValue = heightForAspectRatio;
20762146 }
20772147 }
2078  return logicalHeight;
 2148 return logicalHeightValue;
20792149}
20802150
20812151LayoutUnit RenderBox::computePercentageLogicalHeight(const Length& height)

@@void RenderBox::computePositionedLogicalWidth(RenderRegion* region, LayoutUnit o
25352605 // Calculate constraint equation values for 'width' case.
25362606 LayoutUnit logicalWidthResult;
25372607 LayoutUnit logicalLeftResult;
2538  computePositionedLogicalWidthUsing(style()->logicalWidth(), containerBlock, containerDirection,
 2608 computePositionedLogicalWidthUsing(LogicalWidth, containerBlock, containerDirection,
25392609 containerLogicalWidth, bordersPlusPadding,
25402610 logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalRight,
25412611 logicalWidthResult, marginLogicalLeftAlias, marginLogicalRightAlias, logicalLeftResult);
 2612
25422613 setLogicalWidth(logicalWidthResult);
25432614 setLogicalLeft(logicalLeftResult);
25442615

@@void RenderBox::computePositionedLogicalWidth(RenderRegion* region, LayoutUnit o
25492620 LayoutUnit maxMarginLogicalRight;
25502621 LayoutUnit maxLogicalLeftPos;
25512622
2552  computePositionedLogicalWidthUsing(style()->logicalMaxWidth(), containerBlock, containerDirection,
 2623 computePositionedLogicalWidthUsing(MaxLogicalWidth, containerBlock, containerDirection,
25532624 containerLogicalWidth, bordersPlusPadding,
25542625 logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalRight,
25552626 maxLogicalWidth, maxMarginLogicalLeft, maxMarginLogicalRight, maxLogicalLeftPos);
25562627
 2628
25572629 if (logicalWidth() > maxLogicalWidth) {
25582630 setLogicalWidth(maxLogicalWidth);
25592631 marginLogicalLeftAlias = maxMarginLogicalLeft;

@@void RenderBox::computePositionedLogicalWidth(RenderRegion* region, LayoutUnit o
25692641 LayoutUnit minMarginLogicalRight;
25702642 LayoutUnit minLogicalLeftPos;
25712643
2572  computePositionedLogicalWidthUsing(style()->logicalMinWidth(), containerBlock, containerDirection,
 2644 computePositionedLogicalWidthUsing(MinLogicalWidth, containerBlock, containerDirection,
25732645 containerLogicalWidth, bordersPlusPadding,
25742646 logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalRight,
25752647 minLogicalWidth, minMarginLogicalLeft, minMarginLogicalRight, minLogicalLeftPos);

@@void RenderBox::computePositionedLogicalWidth(RenderRegion* region, LayoutUnit o
25832655 }
25842656
25852657 if (stretchesToMinIntrinsicLogicalWidth() && logicalWidth() < minPreferredLogicalWidth() - bordersPlusPadding) {
2586  computePositionedLogicalWidthUsing(Length(minPreferredLogicalWidth() - bordersPlusPadding, Fixed), containerBlock, containerDirection,
 2658 computePositionedLogicalWidthUsing(MinPreferredLogicalWidth, containerBlock, containerDirection,
25872659 containerLogicalWidth, bordersPlusPadding,
25882660 logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalRight,
25892661 logicalWidthResult, marginLogicalLeftAlias, marginLogicalRightAlias, logicalLeftResult);

@@static void computeLogicalLeftPositionedOffset(LayoutUnit& logicalLeftPos, const
26202692 logicalLeftPos += (child->isHorizontalWritingMode() ? containerBlock->borderLeft() : containerBlock->borderTop());
26212693}
26222694
2623 void RenderBox::computePositionedLogicalWidthUsing(Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
 2695void RenderBox::computePositionedLogicalWidthUsing(LogicalWidthType widthType, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
26242696 LayoutUnit containerLogicalWidth, LayoutUnit bordersPlusPadding,
26252697 Length logicalLeft, Length logicalRight, Length marginLogicalLeft, Length marginLogicalRight,
26262698 LayoutUnit& logicalWidthValue, LayoutUnit& marginLogicalLeftValue, LayoutUnit& marginLogicalRightValue, LayoutUnit& logicalLeftPos)

@@void RenderBox::computePositionedLogicalWidthUsing(Length logicalWidth, const Re
26282700 // 'left' and 'right' cannot both be 'auto' because one would of been
26292701 // converted to the static position already
26302702 ASSERT(!(logicalLeft.isAuto() && logicalRight.isAuto()));
 2703 Length logicalWidth;
 2704 switch (widthType) {
 2705 case LogicalWidth:
 2706 logicalWidth = style()->logicalWidth();
 2707 break;
 2708 case MinLogicalWidth:
 2709 logicalWidth = style()->logicalMinWidth();
 2710 break;
 2711 case MaxLogicalWidth:
 2712 logicalWidth = style()->logicalMaxWidth();
 2713 break;
 2714 case MinPreferredLogicalWidth:
 2715 logicalWidth = Length(minPreferredLogicalWidth() - bordersPlusPadding, Fixed);
 2716 break;
 2717 }
26312718
26322719 LayoutUnit logicalLeftValue = 0;
26332720
2634  bool logicalWidthIsAuto = logicalWidth.isIntrinsicOrAuto();
2635  bool logicalLeftIsAuto = logicalLeft.isAuto();
2636  bool logicalRightIsAuto = logicalRight.isAuto();
 2721 bool useAspectRatio = useAspectRatioForWidth(logicalWidth, logicalLeft, logicalRight);
 2722 // If we are using aspect-ratio for width then there is a constraint on width.
 2723 bool logicalWidthIsUnconstrained = logicalWidth.isIntrinsicOrAuto() && !useAspectRatio;
 2724 bool logicalLeftIsUnconstrained = logicalLeft.isAuto();
 2725 bool logicalRightIsUnconstrained = logicalRight.isAuto();
26372726
2638  if (!logicalLeftIsAuto && !logicalWidthIsAuto && !logicalRightIsAuto) {
 2727 if (!logicalLeftIsUnconstrained && !logicalWidthIsUnconstrained && !logicalRightIsUnconstrained) {
26392728 /*-----------------------------------------------------------------------*\
26402729 * If none of the three is 'auto': If both 'margin-left' and 'margin-
26412730 * right' are 'auto', solve the equation under the extra constraint that

@@void RenderBox::computePositionedLogicalWidthUsing(Length logicalWidth, const Re
26532742
26542743 logicalLeftValue = logicalLeft.calcValue(containerLogicalWidth);
26552744 logicalWidthValue = computeContentBoxLogicalWidth(logicalWidth.calcValue(containerLogicalWidth));
 2745 if (useAspectRatio) {
 2746 float requiredRatio = style()->aspectRatio();
 2747 if (logicalHeight()) {
 2748 int widthForAspectRatio = static_cast<int>(logicalHeight() * requiredRatio);
 2749 if (widthType == LogicalWidth)
 2750 logicalWidthValue = widthForAspectRatio;
 2751 } else {
 2752 // Height is not determined so LogicalWidth is the container's content width.
 2753 // widthType will be LogicalMinWidth or LogicalMaxWidth only if they are specified in which
 2754 // case they have to be respected.
 2755 if (widthType == LogicalWidth) {
 2756 LayoutUnit availableContainerWidth = containerLogicalWidth - (logicalLeftValue + bordersPlusPadding);
 2757 logicalWidthValue = availableContainerWidth;
 2758 }
 2759
 2760 }
 2761 }
26562762
26572763 const LayoutUnit availableSpace = containerLogicalWidth - (logicalLeftValue + logicalWidthValue + logicalRight.calcValue(containerLogicalWidth) + bordersPlusPadding);
26582764

@@void RenderBox::computePositionedLogicalWidthUsing(Length logicalWidth, const Re
27412847
27422848 // FIXME: Is there a faster way to find the correct case?
27432849 // Use rule/case that applies.
2744  if (logicalLeftIsAuto && logicalWidthIsAuto && !logicalRightIsAuto) {
 2850 if (logicalLeftIsUnconstrained && logicalWidthIsUnconstrained && !logicalRightIsUnconstrained) {
27452851 // RULE 1: (use shrink-to-fit for width, and solve of left)
27462852 LayoutUnit logicalRightValue = logicalRight.calcValue(containerLogicalWidth);
27472853

@@void RenderBox::computePositionedLogicalWidthUsing(Length logicalWidth, const Re
27512857 LayoutUnit availableWidth = availableSpace - logicalRightValue;
27522858 logicalWidthValue = min(max(preferredMinWidth, availableWidth), preferredWidth);
27532859 logicalLeftValue = availableSpace - (logicalWidthValue + logicalRightValue);
2754  } else if (!logicalLeftIsAuto && logicalWidthIsAuto && logicalRightIsAuto) {
 2860 } else if (!logicalLeftIsUnconstrained && logicalWidthIsUnconstrained && logicalRightIsUnconstrained) {
27552861 // RULE 3: (use shrink-to-fit for width, and no need solve of right)
27562862 logicalLeftValue = logicalLeft.calcValue(containerLogicalWidth);
27572863

@@void RenderBox::computePositionedLogicalWidthUsing(Length logicalWidth, const Re
27602866 LayoutUnit preferredMinWidth = minPreferredLogicalWidth() - bordersPlusPadding;
27612867 LayoutUnit availableWidth = availableSpace - logicalLeftValue;
27622868 logicalWidthValue = min(max(preferredMinWidth, availableWidth), preferredWidth);
2763  } else if (logicalLeftIsAuto && !logicalWidthIsAuto && !logicalRightIsAuto) {
 2869 } else if (logicalLeftIsUnconstrained && !logicalWidthIsUnconstrained && !logicalRightIsUnconstrained) {
27642870 // RULE 4: (solve for left)
27652871 logicalWidthValue = computeContentBoxLogicalWidth(logicalWidth.calcValue(containerLogicalWidth));
 2872 if (useAspectRatio) {
 2873 float requiredRatio = style()->aspectRatio();
 2874 // FIXME: Refactor this.
 2875 if (logicalHeight()) {
 2876 int widthForAspectRatio = static_cast<int>(logicalHeight() * requiredRatio);
 2877 if (widthType == LogicalWidth)
 2878 logicalWidthValue = widthForAspectRatio;
 2879 } else {
 2880 // Height is not determined so LogicalWidth is the container's content width.
 2881 // widthType will be LogicalMinWidth or LogicalMaxWidth only if they are specified in which
 2882 // case they have to be respected.
 2883 if (widthType == LogicalWidth) {
 2884 LayoutUnit availableContainerWidth = containerLogicalWidth - (logicalRight.calcMinValue(containerLogicalWidth) + bordersPlusPadding);
 2885 logicalWidthValue = availableContainerWidth;
 2886 }
 2887
 2888 }
 2889 }
27662890 logicalLeftValue = availableSpace - (logicalWidthValue + logicalRight.calcValue(containerLogicalWidth));
2767  } else if (!logicalLeftIsAuto && logicalWidthIsAuto && !logicalRightIsAuto) {
 2891 } else if (!logicalLeftIsUnconstrained && logicalWidthIsUnconstrained && !logicalRightIsUnconstrained) {
27682892 // RULE 5: (solve for width)
27692893 logicalLeftValue = logicalLeft.calcValue(containerLogicalWidth);
27702894 logicalWidthValue = availableSpace - (logicalLeftValue + logicalRight.calcValue(containerLogicalWidth));
2771  } else if (!logicalLeftIsAuto && !logicalWidthIsAuto && logicalRightIsAuto) {
 2895 } else if (!logicalLeftIsUnconstrained && !logicalWidthIsUnconstrained && logicalRightIsUnconstrained) {
27722896 // RULE 6: (no need solve for right)
27732897 logicalLeftValue = logicalLeft.calcValue(containerLogicalWidth);
27742898 logicalWidthValue = computeContentBoxLogicalWidth(logicalWidth.calcValue(containerLogicalWidth));
 2899 if (useAspectRatio) {
 2900 float requiredRatio = style()->aspectRatio();
 2901 if (logicalHeight()) {
 2902 int widthForAspectRatio = static_cast<int>(logicalHeight() * requiredRatio);
 2903 if (widthType == LogicalWidth)
 2904 logicalWidthValue = widthForAspectRatio;
 2905 } else {
 2906 // Height is not determined so LogicalWidth is the container's content width.
 2907 // widthType will be LogicalMinWidth or LogicalMaxWidth only if they are specified in which
 2908 // case they have to be respected.
 2909 if (widthType == LogicalWidth) {
 2910 LayoutUnit availableContainerWidth = containerLogicalWidth - (logicalLeftValue + bordersPlusPadding);
 2911 logicalWidthValue = availableContainerWidth;
 2912 }
 2913
 2914 }
 2915 }
27752916 }
27762917 }
27772918

@@void RenderBox::computePositionedLogicalHeight()
28643005 LayoutUnit logicalTopPos;
28653006
28663007 // Calculate constraint equation values for 'height' case.
2867  computePositionedLogicalHeightUsing(style()->logicalHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding,
 3008 computePositionedLogicalHeightUsing(LogicalHeight, containerBlock, containerLogicalHeight, bordersPlusPadding,
28683009 logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
28693010 logicalHeightResult, marginBeforeAlias, marginAfterAlias, logicalTopPos);
28703011 setLogicalTop(logicalTopPos);

@@void RenderBox::computePositionedLogicalHeight()
28793020 LayoutUnit maxMarginAfter;
28803021 LayoutUnit maxLogicalTopPos;
28813022
2882  computePositionedLogicalHeightUsing(style()->logicalMaxHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding,
 3023 computePositionedLogicalHeightUsing(MaxLogicalHeight, containerBlock, containerLogicalHeight, bordersPlusPadding,
28833024 logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
28843025 maxLogicalHeight, maxMarginBefore, maxMarginAfter, maxLogicalTopPos);
28853026

@@void RenderBox::computePositionedLogicalHeight()
28983039 LayoutUnit minMarginAfter;
28993040 LayoutUnit minLogicalTopPos;
29003041
2901  computePositionedLogicalHeightUsing(style()->logicalMinHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding,
 3042 computePositionedLogicalHeightUsing(MinLogicalHeight, containerBlock, containerLogicalHeight, bordersPlusPadding,
29023043 logicalTopLength, logicalBottomLength, marginBefore, marginAfter,
29033044 minLogicalHeight, minMarginBefore, minMarginAfter, minLogicalTopPos);
29043045

@@static void computeLogicalTopPositionedOffset(LayoutUnit& logicalTopPos, const R
29503091 }
29513092}
29523093
2953 void RenderBox::computePositionedLogicalHeightUsing(Length logicalHeightLength, const RenderBoxModelObject* containerBlock,
 3094void RenderBox::computePositionedLogicalHeightUsing(LogicalHeightType heightType, const RenderBoxModelObject* containerBlock,
29543095 LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding,
29553096 Length logicalTop, Length logicalBottom, Length marginBefore, Length marginAfter,
29563097 LayoutUnit& logicalHeightValue, LayoutUnit& marginBeforeValue, LayoutUnit& marginAfterValue, LayoutUnit& logicalTopPos)

@@void RenderBox::computePositionedLogicalHeightUsing(Length logicalHeightLength,
29583099 // 'top' and 'bottom' cannot both be 'auto' because 'top would of been
29593100 // converted to the static position in computePositionedLogicalHeight()
29603101 ASSERT(!(logicalTop.isAuto() && logicalBottom.isAuto()));
 3102 Length logicalHeightLength;
 3103 switch (heightType) {
 3104 case LogicalHeight:
 3105 logicalHeightLength = style()->logicalHeight();
 3106 break;
 3107 case MinLogicalHeight:
 3108 logicalHeightLength = style()->logicalMinHeight();
 3109 break;
 3110 case MaxLogicalHeight:
 3111 logicalHeightLength = style()->logicalMaxHeight();
 3112 break;
 3113 }
29613114
29623115 LayoutUnit contentLogicalHeight = logicalHeight() - bordersPlusPadding;
29633116
29643117 LayoutUnit logicalTopValue = 0;
29653118
2966  bool logicalHeightIsAuto = logicalHeightLength.isAuto();
2967  bool logicalTopIsAuto = logicalTop.isAuto();
2968  bool logicalBottomIsAuto = logicalBottom.isAuto();
 3119 bool useAspectRatio = useAspectRatioForHeight(logicalHeightLength, logicalTop, logicalBottom);
 3120 bool logicalHeightIsUnconstrained = logicalHeightLength.isAuto() && !useAspectRatio;
 3121 bool logicalTopIsUnconstrained = logicalTop.isAuto();
 3122 bool logicalBottomIsUnconstrained = logicalBottom.isAuto();
29693123
29703124 // Height is never unsolved for tables.
29713125 if (isTable()) {
29723126 logicalHeightLength.setValue(Fixed, contentLogicalHeight);
2973  logicalHeightIsAuto = false;
 3127 logicalHeightIsUnconstrained = false;
29743128 }
29753129
2976  if (!logicalTopIsAuto && !logicalHeightIsAuto && !logicalBottomIsAuto) {
 3130 if (!logicalTopIsUnconstrained && !logicalHeightIsUnconstrained && !logicalBottomIsUnconstrained) {
29773131 /*-----------------------------------------------------------------------*\
29783132 * If none of the three are 'auto': If both 'margin-top' and 'margin-
29793133 * bottom' are 'auto', solve the equation under the extra constraint that

@@void RenderBox::computePositionedLogicalHeightUsing(Length logicalHeightLength,
29853139 // NOTE: It is not necessary to solve for 'bottom' in the over constrained
29863140 // case because the value is not used for any further calculations.
29873141
2988  logicalHeightValue = computeContentBoxLogicalHeight(logicalHeightLength.calcValue(containerLogicalHeight));
29893142 logicalTopValue = logicalTop.calcValue(containerLogicalHeight);
2990 
 3143 logicalHeightValue = computeContentBoxLogicalHeight(logicalHeightLength.calcValue(containerLogicalHeight));
 3144 if (useAspectRatio) {
 3145 float requiredRatio = style()->aspectRatioDenominator() / style()->aspectRatioNumerator();
 3146 if (logicalWidth()) {
 3147 int heightForAspectRatio = static_cast<int>(logicalWidth() * requiredRatio);
 3148 if (heightType == LogicalHeight)
 3149 logicalHeightValue = heightForAspectRatio;
 3150 } else {
 3151 if (heightType == LogicalHeight) {
 3152 LayoutUnit availableContainerHeight = containerLogicalHeight - (logicalTopValue + logicalBottom.calcValue(containerLogicalHeight) + bordersPlusPadding);
 3153 logicalHeightValue = availableContainerHeight;
 3154 }
 3155 }
 3156 }
29913157 const LayoutUnit availableSpace = containerLogicalHeight - (logicalTopValue + logicalHeightValue + logicalBottom.calcValue(containerLogicalHeight) + bordersPlusPadding);
29923158
29933159 // Margins are now the only unknown

@@void RenderBox::computePositionedLogicalHeightUsing(Length logicalHeightLength,
30423208 const LayoutUnit availableSpace = containerLogicalHeight - (marginBeforeValue + marginAfterValue + bordersPlusPadding);
30433209
30443210 // Use rule/case that applies.
3045  if (logicalTopIsAuto && logicalHeightIsAuto && !logicalBottomIsAuto) {
 3211 if (logicalTopIsUnconstrained && logicalHeightIsUnconstrained && !logicalBottomIsUnconstrained) {
30463212 // RULE 1: (height is content based, solve of top)
30473213 logicalHeightValue = contentLogicalHeight;
30483214 logicalTopValue = availableSpace - (logicalHeightValue + logicalBottom.calcValue(containerLogicalHeight));
3049  } else if (!logicalTopIsAuto && logicalHeightIsAuto && logicalBottomIsAuto) {
 3215 } else if (!logicalTopIsUnconstrained && logicalHeightIsUnconstrained && logicalBottomIsUnconstrained) {
30503216 // RULE 3: (height is content based, no need solve of bottom)
30513217 logicalTopValue = logicalTop.calcValue(containerLogicalHeight);
30523218 logicalHeightValue = contentLogicalHeight;
3053  } else if (logicalTopIsAuto && !logicalHeightIsAuto && !logicalBottomIsAuto) {
 3219 } else if (logicalTopIsUnconstrained && !logicalHeightIsUnconstrained && !logicalBottomIsUnconstrained) {
30543220 // RULE 4: (solve of top)
30553221 logicalHeightValue = computeContentBoxLogicalHeight(logicalHeightLength.calcValue(containerLogicalHeight));
30563222 logicalTopValue = availableSpace - (logicalHeightValue + logicalBottom.calcValue(containerLogicalHeight));
3057  } else if (!logicalTopIsAuto && logicalHeightIsAuto && !logicalBottomIsAuto) {
 3223 if (useAspectRatio) {
 3224 float requiredRatio = style()->aspectRatioDenominator() / style()->aspectRatioNumerator();
 3225 if (logicalWidth()) {
 3226 int heightForAspectRatio = static_cast<int>(logicalWidth() * requiredRatio);
 3227 if (heightType == LogicalHeight)
 3228 logicalHeightValue = heightForAspectRatio;
 3229 } else {
 3230 if (heightType == LogicalHeight) {
 3231 LayoutUnit availableContainerHeight = containerLogicalHeight - (logicalTopValue + logicalBottom.calcValue(containerLogicalHeight) + bordersPlusPadding);
 3232 logicalHeightValue = availableContainerHeight;
 3233 }
 3234 }
 3235 }
 3236 } else if (!logicalTopIsUnconstrained && logicalHeightIsUnconstrained && !logicalBottomIsUnconstrained) {
30583237 // RULE 5: (solve of height)
30593238 logicalTopValue = logicalTop.calcValue(containerLogicalHeight);
30603239 logicalHeightValue = max<LayoutUnit>(0, availableSpace - (logicalTopValue + logicalBottom.calcValue(containerLogicalHeight)));
3061  } else if (!logicalTopIsAuto && !logicalHeightIsAuto && logicalBottomIsAuto) {
 3240 } else if (!logicalTopIsUnconstrained && !logicalHeightIsUnconstrained && logicalBottomIsUnconstrained) {
30623241 // RULE 6: (no need solve of bottom)
30633242 logicalHeightValue = computeContentBoxLogicalHeight(logicalHeightLength.calcValue(containerLogicalHeight));
30643243 logicalTopValue = logicalTop.calcValue(containerLogicalHeight);
 3244 if (useAspectRatio) {
 3245 float requiredRatio = style()->aspectRatioDenominator() / style()->aspectRatioNumerator();
 3246 if (logicalWidth()) {
 3247 int heightForAspectRatio = static_cast<int>(logicalWidth() * requiredRatio);
 3248 if (heightType == LogicalHeight)
 3249 logicalHeightValue = heightForAspectRatio;
 3250 } else {
 3251 if (heightType == LogicalHeight) {
 3252 LayoutUnit availableContainerHeight = containerLogicalHeight - (logicalTopValue + logicalBottom.calcValue(containerLogicalHeight) + bordersPlusPadding);
 3253 logicalHeightValue = availableContainerHeight;
 3254 }
 3255 }
 3256 }
30653257 }
30663258 }
30673259

Source/WebCore/rendering/RenderBox.h

@@class RenderBoxRegionInfo;
3333class RenderRegion;
3434struct PaintInfo;
3535
36 enum LogicalWidthType { LogicalWidth, MinLogicalWidth, MaxLogicalWidth };
 36enum LogicalWidthType { LogicalWidth, MinLogicalWidth, MaxLogicalWidth, MinPreferredLogicalWidth };
 37enum LogicalHeightType { LogicalHeight, MinLogicalHeight, MaxLogicalHeight };
3738
3839enum OverlayScrollbarSizeRelevancy { IgnoreOverlayScrollbarSize, IncludeOverlayScrollbarSize };
3940

@@public:
298299 LayoutUnit containingBlockLogicalWidthForContentInRegion(RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage) const;
299300 LayoutUnit perpendicularContainingBlockLogicalHeight() const;
300301
 302 virtual bool isWidthDeterminedUsing(const Length& logicalWidth, const Length& logicalLeft, const Length& logicalRight) const;
 303 virtual bool isHeightDeterminedUsing(const Length& logicalHeight, const Length& logicalTop, const Length& logicalBottom) const;
 304
 305 bool useAspectRatioForWidth(const Length& logicalWidth, const Length& logicalLeft, const Length& logicalRight) const;
 306 bool useAspectRatioForHeight(const Length& logicalHeight, const Length& logicalTop, const Length& logicalBottom) const;
 307
301308 virtual void computeLogicalWidth();
302309 virtual void computeLogicalHeight();
303310

@@public:
319326 virtual bool stretchesToMinIntrinsicLogicalWidth() const { return false; }
320327
321328 LayoutUnit computeLogicalWidthUsing(LogicalWidthType, LayoutUnit availableLogicalWidth);
322  LayoutUnit computeLogicalHeightUsing(const Length& height);
 329 LayoutUnit computeLogicalHeightUsing(LogicalHeightType);
323330 LayoutUnit computeReplacedLogicalWidthUsing(Length width) const;
324331 LayoutUnit computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit logicalWidth, bool includeMaxWidth = true) const;
325332 LayoutUnit computeReplacedLogicalHeightUsing(Length height) const;

@@private:
473480 LayoutUnit containingBlockLogicalHeightForPositioned(const RenderBoxModelObject* containingBlock, bool checkForPerpendicularWritingMode = true) const;
474481
475482 void computePositionedLogicalHeight();
476  void computePositionedLogicalWidthUsing(Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
 483 void computePositionedLogicalWidthUsing(LogicalWidthType, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
477484 LayoutUnit containerLogicalWidth, LayoutUnit bordersPlusPadding,
478485 Length logicalLeft, Length logicalRight, Length marginLogicalLeft, Length marginLogicalRight,
479486 LayoutUnit& logicalWidthValue, LayoutUnit& marginLogicalLeftValue, LayoutUnit& marginLogicalRightValue, LayoutUnit& logicalLeftPos);
480  void computePositionedLogicalHeightUsing(Length logicalHeight, const RenderBoxModelObject* containerBlock,
 487 void computePositionedLogicalHeightUsing(LogicalHeightType, const RenderBoxModelObject* containerBlock,
481488 LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding,
482489 Length logicalTop, Length logicalBottom, Length marginLogicalTop, Length marginLogicalBottom,
483490 LayoutUnit& logicalHeightValue, LayoutUnit& marginLogicalTopValue, LayoutUnit& marginLogicalBottomValue, LayoutUnit& logicalTopPos);

Source/WebCore/rendering/style/RenderStyle.cpp

@@StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon
385385 || rareNonInheritedData->textOverflow != other->rareNonInheritedData->textOverflow)
386386 return StyleDifferenceLayout;
387387
 388 if (rareNonInheritedData->m_hasAspectRatio != other->rareNonInheritedData->m_hasAspectRatio)
 389 return StyleDifferenceLayout;
 390
 391 if (rareNonInheritedData->m_hasAspectRatio) {
 392 float aspectRatio = rareNonInheritedData->m_aspectRatioNumerator / rareNonInheritedData->m_aspectRatioDenominator;
 393 float otherAspectRatio = other->rareNonInheritedData->m_aspectRatioNumerator / other->rareNonInheritedData->m_aspectRatioDenominator;
 394 if (aspectRatio != otherAspectRatio)
 395 return StyleDifferenceLayout;
 396 }
 397
388398 if (rareNonInheritedData->m_regionOverflow != other->rareNonInheritedData->m_regionOverflow)
389399 return StyleDifferenceLayout;
390400

LayoutTests/ChangeLog

 12011-11-29 Fady Samuel <fsamuel@chromium.org>
 2
 3 -webkit-aspect-ratio Layout Implementation
 4 https://bugs.webkit.org/show_bug.cgi?id=73277
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * css3/aspect-ratio/absolute-ratio-absolute-left-right.html: Added.
 9 * css3/aspect-ratio/aspect-ratio-absolute-height.html: Added.
 10 * css3/aspect-ratio/aspect-ratio-absolute-width.html: Added.
 11 * css3/aspect-ratio/aspect-ratio-auto-height.html: Added.
 12 * css3/aspect-ratio/aspect-ratio-float.html: Added.
 13 * css3/aspect-ratio/aspect-ratio-inherit.html: Added.
 14 * css3/aspect-ratio/aspect-ratio-stretch-to-fill.html: Added.
 15 * platform/chromium-linux/css3/aspect-ratio/absolute-ratio-absolute-left-right-expected.png: Added.
 16 * platform/chromium-linux/css3/aspect-ratio/absolute-ratio-absolute-left-right-expected.txt: Added.
 17 * platform/chromium-linux/css3/aspect-ratio/aspect-ratio-absolute-height-expected.png: Added.
 18 * platform/chromium-linux/css3/aspect-ratio/aspect-ratio-absolute-height-expected.txt: Added.
 19 * platform/chromium-linux/css3/aspect-ratio/aspect-ratio-absolute-width-expected.png: Added.
 20 * platform/chromium-linux/css3/aspect-ratio/aspect-ratio-absolute-width-expected.txt: Added.
 21 * platform/chromium-linux/css3/aspect-ratio/aspect-ratio-auto-height-expected.png: Added.
 22 * platform/chromium-linux/css3/aspect-ratio/aspect-ratio-auto-height-expected.txt: Added.
 23 * platform/chromium-linux/css3/aspect-ratio/aspect-ratio-float-expected.png: Added.
 24 * platform/chromium-linux/css3/aspect-ratio/aspect-ratio-float-expected.txt: Added.
 25 * platform/chromium-linux/css3/aspect-ratio/aspect-ratio-inherit-expected.png: Added.
 26 * platform/chromium-linux/css3/aspect-ratio/aspect-ratio-inherit-expected.txt: Added.
 27 * platform/chromium-linux/css3/aspect-ratio/aspect-ratio-stretch-to-fill-expected.png: Added.
 28 * platform/chromium-linux/css3/aspect-ratio/aspect-ratio-stretch-to-fill-expected.txt: Added.
 29
1302011-11-29 Csaba Osztrogonác <ossy@webkit.org>
231
332 [Qt] Unreviewed evening gardening.

LayoutTests/css3/aspect-ratio/absolute-ratio-absolute-left-right.html

 1<html>
 2 <head>
 3 </head>
 4 <body>
 5 <div style="position: absolute; top: 10px; left: 10px; right: 10px; -webkit-aspect-ratio: 16 / 9; background-color: green;"></div>
 6 </body>
 7</html>

LayoutTests/css3/aspect-ratio/aspect-ratio-absolute-height.html

 1<html>
 2 <head>
 3 </head>
 4 <body>
 5 <div style="position: absolute; height: 50px; top: 10px; left:10px; -webkit-aspect-ratio: 9/16; background-color: green;"></div>
 6 </body>
 7</html>

LayoutTests/css3/aspect-ratio/aspect-ratio-absolute-width.html

 1<html>
 2 <head>
 3 </head>
 4 <body>
 5 <div style="position: absolute; width: 50px; top: 10px; left:10px; -webkit-aspect-ratio: 9/16; background-color: green;"></div>
 6 </body>
 7</html>

LayoutTests/css3/aspect-ratio/aspect-ratio-auto-height.html

 1<html>
 2 <head>
 3 </head>
 4 <body>
 5 <div style="position: absolute; left: 10px; width: 200px; -webkit-aspect-ratio: 16 / 9; background-color: green;"></div>
 6 </body>
 7</html>

LayoutTests/css3/aspect-ratio/aspect-ratio-float.html

 1<div style="width: 600px; height: 200px; background-color: red;">
 2 <div style="float: right; width: 50px; -webkit-aspect-ratio: 1/4; background-color: green;"></div>
 3</div>

LayoutTests/css3/aspect-ratio/aspect-ratio-inherit.html

 1<html>
 2 <head>
 3 </head>
 4 <body>
 5 <div style="position: fixed; top: 10px; bottom: 10px; left: 10px; right: 10px; -webkit-aspect-ratio: 20 / 9; background-color: red;">
 6 <div style="position: relative; left: 50px; top: 50px; width: 300px; background-color: green; -webkit-aspect-ratio: inherit;"></div>
 7 </div>
 8 </body>
 9</html>

LayoutTests/css3/aspect-ratio/aspect-ratio-stretch-to-fill.html

 1<html>
 2 <head>
 3 </head>
 4 <body>
 5 <div style="position:absolute; top: 0px; bottom: 0px; left: 0px; right: 0px; -webkit-aspect-ratio: 16 / 9; margin: auto; background-color: green; max-height: 640px;"></div>
 6 </body>
 7</html>

LayoutTests/platform/chromium-linux/css3/aspect-ratio/absolute-ratio-absolute-left-right-expected.png

Exception raised during decoding git binary patch:
Error: git binary content does not match index 0000000000000000000000000000000000000000
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:1023:in `extract_contents_from_git_binary_literal_chunk'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:1042:in `extract_contents_from_remote'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:717:in `initialize'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `new'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `block in parse'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `collect'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `parse'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:25:in `prettify'
/var/www/html/PrettyPatch/prettify.rb:30:in `<main>'

LayoutTests/platform/chromium-linux/css3/aspect-ratio/absolute-ratio-absolute-left-right-expected.txt

 1layer at (0,0) size 800x600
 2 RenderView at (0,0) size 800x600
 3layer at (0,0) size 800x600
 4 RenderBlock {HTML} at (0,0) size 800x600
 5 RenderBody {BODY} at (8,8) size 784x584
 6layer at (10,10) size 789x444
 7 RenderBlock (positioned) {DIV} at (10,10) size 789x444 [bgcolor=#008000]

LayoutTests/platform/chromium-linux/css3/aspect-ratio/aspect-ratio-absolute-height-expected.png

Exception raised during decoding git binary patch:
Error: git binary content does not match index 0000000000000000000000000000000000000000
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:1023:in `extract_contents_from_git_binary_literal_chunk'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:1042:in `extract_contents_from_remote'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:717:in `initialize'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `new'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `block in parse'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `collect'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `parse'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:25:in `prettify'
/var/www/html/PrettyPatch/prettify.rb:30:in `<main>'

LayoutTests/platform/chromium-linux/css3/aspect-ratio/aspect-ratio-absolute-height-expected.txt

 1layer at (0,0) size 800x600
 2 RenderView at (0,0) size 800x600
 3layer at (0,0) size 800x600
 4 RenderBlock {HTML} at (0,0) size 800x600
 5 RenderBody {BODY} at (8,8) size 784x584
 6layer at (10,10) size 28x50
 7 RenderBlock (positioned) {DIV} at (10,10) size 28x50 [bgcolor=#008000]

LayoutTests/platform/chromium-linux/css3/aspect-ratio/aspect-ratio-absolute-width-expected.png

Exception raised during decoding git binary patch:
Error: git binary content does not match index 0000000000000000000000000000000000000000
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:1023:in `extract_contents_from_git_binary_literal_chunk'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:1042:in `extract_contents_from_remote'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:717:in `initialize'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `new'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `block in parse'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `collect'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `parse'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:25:in `prettify'
/var/www/html/PrettyPatch/prettify.rb:30:in `<main>'

LayoutTests/platform/chromium-linux/css3/aspect-ratio/aspect-ratio-absolute-width-expected.txt

 1layer at (0,0) size 800x600
 2 RenderView at (0,0) size 800x600
 3layer at (0,0) size 800x600
 4 RenderBlock {HTML} at (0,0) size 800x600
 5 RenderBody {BODY} at (8,8) size 784x584
 6layer at (10,10) size 50x88
 7 RenderBlock (positioned) {DIV} at (10,10) size 50x88 [bgcolor=#008000]

LayoutTests/platform/chromium-linux/css3/aspect-ratio/aspect-ratio-auto-height-expected.png

Exception raised during decoding git binary patch:
Error: git binary content does not match index 0000000000000000000000000000000000000000
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:1023:in `extract_contents_from_git_binary_literal_chunk'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:1042:in `extract_contents_from_remote'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:717:in `initialize'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `new'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `block in parse'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `collect'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `parse'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:25:in `prettify'
/var/www/html/PrettyPatch/prettify.rb:30:in `<main>'

LayoutTests/platform/chromium-linux/css3/aspect-ratio/aspect-ratio-auto-height-expected.txt

 1layer at (0,0) size 800x600
 2 RenderView at (0,0) size 800x600
 3layer at (0,0) size 800x600
 4 RenderBlock {HTML} at (0,0) size 800x600
 5 RenderBody {BODY} at (8,8) size 784x584
 6layer at (10,8) size 200x112
 7 RenderBlock (positioned) {DIV} at (10,8) size 200x112 [bgcolor=#008000]

LayoutTests/platform/chromium-linux/css3/aspect-ratio/aspect-ratio-float-expected.png

Exception raised during decoding git binary patch:
Error: git binary content does not match index 0000000000000000000000000000000000000000
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:1023:in `extract_contents_from_git_binary_literal_chunk'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:1042:in `extract_contents_from_remote'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:717:in `initialize'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `new'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `block in parse'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `collect'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `parse'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:25:in `prettify'
/var/www/html/PrettyPatch/prettify.rb:30:in `<main>'

LayoutTests/platform/chromium-linux/css3/aspect-ratio/aspect-ratio-float-expected.txt

 1layer at (0,0) size 800x600
 2 RenderView at (0,0) size 800x600
 3layer at (0,0) size 800x600
 4 RenderBlock {HTML} at (0,0) size 800x600
 5 RenderBody {BODY} at (8,8) size 784x584
 6 RenderBlock {DIV} at (0,0) size 600x200 [bgcolor=#FF0000]
 7 RenderBlock (floating) {DIV} at (550,0) size 50x200 [bgcolor=#008000]

LayoutTests/platform/chromium-linux/css3/aspect-ratio/aspect-ratio-inherit-expected.png

Exception raised during decoding git binary patch:
Error: git binary content does not match index 0000000000000000000000000000000000000000
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:1023:in `extract_contents_from_git_binary_literal_chunk'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:1042:in `extract_contents_from_remote'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:717:in `initialize'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `new'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `block in parse'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `collect'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `parse'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:25:in `prettify'
/var/www/html/PrettyPatch/prettify.rb:30:in `<main>'

LayoutTests/platform/chromium-linux/css3/aspect-ratio/aspect-ratio-inherit-expected.txt

 1layer at (0,0) size 800x600
 2 RenderView at (0,0) size 800x600
 3layer at (0,0) size 800x600
 4 RenderBlock {HTML} at (0,0) size 800x600
 5 RenderBody {BODY} at (8,8) size 784x584
 6layer at (10,10) size 788x355
 7 RenderBlock (positioned) {DIV} at (10,10) size 788x355 [bgcolor=#FF0000]
 8layer at (60,60) size 300x135
 9 RenderBlock (relative positioned) {DIV} at (0,0) size 300x135 [bgcolor=#008000]

LayoutTests/platform/chromium-linux/css3/aspect-ratio/aspect-ratio-stretch-to-fill-expected.png

Exception raised during decoding git binary patch:
Error: git binary content does not match index 0000000000000000000000000000000000000000
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:1023:in `extract_contents_from_git_binary_literal_chunk'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:1042:in `extract_contents_from_remote'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:717:in `initialize'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `new'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `block in parse'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `collect'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:850:in `parse'
/var/www/bugs.webkit.org/Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb:25:in `prettify'
/var/www/html/PrettyPatch/prettify.rb:30:in `<main>'

LayoutTests/platform/chromium-linux/css3/aspect-ratio/aspect-ratio-stretch-to-fill-expected.txt

 1layer at (0,0) size 800x600
 2 RenderView at (0,0) size 800x600
 3layer at (0,0) size 800x600
 4 RenderBlock {HTML} at (0,0) size 800x600
 5 RenderBody {BODY} at (8,8) size 784x584
 6layer at (0,75) size 800x450
 7 RenderBlock (positioned) {DIV} at (0,75) size 800x450 [bgcolor=#008000]