[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
hyatt at apple.com
hyatt at apple.com
Wed Dec 22 13:44:20 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 49a753682d699275aa822a36c4951fa7b8f8895f
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Sep 24 17:23:21 2010 +0000
https://bugs.webkit.org/show_bug.cgi?id=46474
Reviewed by Sam Weinig.
Patch computeWidthUsing to be block-flow-aware. Rename the WidthType enum to LogicalWidthType. Make computeLogicalWidthUsing
query the style for logical width properties instead of width properties.
fast/css/logical-property-resolution.html now fails and gives bad results. This is expected. It will become correct
again as more layout code gets patched.
WebCore:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalWidth):
(WebCore::RenderBox::computeLogicalWidthUsing):
(WebCore::RenderBox::sizesToIntrinsicWidth):
* rendering/RenderBox.h:
LayoutTests:
* fast/css/logical-property-resolution-expected.txt:
* fast/css/logical-property-resolution.html:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68270 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 58dedb8..f304039 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2010-09-24 David Hyatt <hyatt at apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46474
+
+ Patch computeWidthUsing to be block-flow-aware. Rename the WidthType enum to LogicalWidthType. Make computeLogicalWidthUsing
+ query the style for logical width properties instead of width properties.
+
+ fast/css/logical-property-resolution.html now fails and gives bad results. This is expected. It will become correct
+ again as more layout code gets patched.
+
+ * fast/css/logical-property-resolution-expected.txt:
+ * fast/css/logical-property-resolution.html:
+
2010-09-24 Tony Chang <tony at chromium.org>
Reviewed by Kent Tamura.
diff --git a/LayoutTests/fast/css/logical-property-resolution-expected.txt b/LayoutTests/fast/css/logical-property-resolution-expected.txt
index c7945c3..e2623a7 100644
--- a/LayoutTests/fast/css/logical-property-resolution-expected.txt
+++ b/LayoutTests/fast/css/logical-property-resolution-expected.txt
@@ -1,3 +1,4 @@
+This test has incorrect results but reflects what's happening as we bring block-flow online.
Block #1:
Margins: 1px 2px 3px 4px
Padding: 4px 3px 2px 1px
@@ -14,13 +15,13 @@ Block #3:
Margins: 4px 3px 2px 1px
Padding: 1px 2px 3px 4px
Borders: 4px double rgb(128, 0, 128), 3px dashed rgb(255, 255, 0), 2px dotted rgb(0, 128, 0), 1px solid rgb(0, 0, 0)
-Width: 50px
+Width: 100px
Height: 100px
Block #4:
Margins: 4px 1px 2px 3px
Padding: 1px 4px 3px 2px
Borders: 4px double rgb(128, 0, 128), 1px solid rgb(0, 0, 0), 2px dotted rgb(0, 128, 0), 3px dashed rgb(255, 255, 0)
-Width: 50px
+Width: 100px
Height: 100px
Block #5:
Margins: 1px 4px 3px 2px
@@ -38,12 +39,12 @@ Block #7:
Margins: 2px 3px 4px 1px
Padding: 3px 2px 1px 4px
Borders: 2px dotted rgb(0, 128, 0), 3px dashed rgb(255, 255, 0), 4px double rgb(128, 0, 128), 1px solid rgb(0, 0, 0)
-Width: 50px
+Width: 100px
Height: 100px
Block #8:
Margins: 2px 1px 4px 3px
Padding: 3px 4px 1px 2px
Borders: 2px dotted rgb(0, 128, 0), 1px solid rgb(0, 0, 0), 4px double rgb(128, 0, 128), 3px dashed rgb(255, 255, 0)
-Width: 50px
+Width: 100px
Height: 100px
diff --git a/LayoutTests/fast/css/logical-property-resolution.html b/LayoutTests/fast/css/logical-property-resolution.html
index 091d320..7dd47d0 100644
--- a/LayoutTests/fast/css/logical-property-resolution.html
+++ b/LayoutTests/fast/css/logical-property-resolution.html
@@ -51,7 +51,7 @@ function dumpBlockProperties()
{
result = document.getElementById('result');
blocks = document.getElementsByTagName('div');
- resultStr = "";
+ resultStr = "This test has incorrect results but reflects what's happening as we bring block-flow online.<br>";
for (i = 0; i < blocks.length; ++i) {
resultStr += "<b>Block #" + (i+1) + ":</b><br>";
resultStr += "Margins: ";
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index fc31bdd..6f08cfa 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-09-24 David Hyatt <hyatt at apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46474
+
+ Patch computeWidthUsing to be block-flow-aware. Rename the WidthType enum to LogicalWidthType. Make computeLogicalWidthUsing
+ query the style for logical width properties instead of width properties.
+
+ fast/css/logical-property-resolution.html now fails and gives bad results. This is expected. It will become correct
+ again as more layout code gets patched.
+
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::computeLogicalWidth):
+ (WebCore::RenderBox::computeLogicalWidthUsing):
+ (WebCore::RenderBox::sizesToIntrinsicWidth):
+ * rendering/RenderBox.h:
+
2010-09-24 Andrey Kosyakov <caseq at chromium.org>
Reviewed by Pavel Feldman.
diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp
index ad0f33c..dcddebe 100644
--- a/WebCore/rendering/RenderBox.cpp
+++ b/WebCore/rendering/RenderBox.cpp
@@ -1393,11 +1393,11 @@ void RenderBox::computeLogicalWidth()
setWidth(w.value() + borderAndPaddingWidth());
else {
// Calculate Width
- setWidth(computeLogicalWidthUsing(Width, containerWidth));
+ setWidth(computeLogicalWidthUsing(LogicalWidth, containerWidth));
// Calculate MaxWidth
if (!style()->maxWidth().isUndefined()) {
- int maxW = computeLogicalWidthUsing(MaxWidth, containerWidth);
+ int maxW = computeLogicalWidthUsing(MaxLogicalWidth, containerWidth);
if (width() > maxW) {
setWidth(maxW);
w = style()->maxWidth();
@@ -1405,7 +1405,7 @@ void RenderBox::computeLogicalWidth()
}
// Calculate MinWidth
- int minW = computeLogicalWidthUsing(MinWidth, containerWidth);
+ int minW = computeLogicalWidthUsing(MinLogicalWidth, containerWidth);
if (width() < minW) {
setWidth(minW);
w = style()->minWidth();
@@ -1436,34 +1436,34 @@ void RenderBox::computeLogicalWidth()
}
}
-int RenderBox::computeLogicalWidthUsing(WidthType widthType, int cw)
+int RenderBox::computeLogicalWidthUsing(LogicalWidthType widthType, int availableLogicalWidth)
{
- int widthResult = width();
- Length w;
- if (widthType == Width)
- w = style()->width();
- else if (widthType == MinWidth)
- w = style()->minWidth();
+ int logicalWidthResult = logicalWidth();
+ Length logicalWidth;
+ if (widthType == LogicalWidth)
+ logicalWidth = style()->logicalWidth();
+ else if (widthType == MinLogicalWidth)
+ logicalWidth = style()->logicalMinWidth();
else
- w = style()->maxWidth();
+ logicalWidth = style()->logicalMaxWidth();
- if (w.isIntrinsicOrAuto()) {
- int marginLeft = style()->marginLeft().calcMinValue(cw);
- int marginRight = style()->marginRight().calcMinValue(cw);
- if (cw)
- widthResult = cw - marginLeft - marginRight;
+ if (logicalWidth.isIntrinsicOrAuto()) {
+ int marginStart = style()->marginStart().calcMinValue(availableLogicalWidth);
+ int marginEnd = style()->marginEnd().calcMinValue(availableLogicalWidth);
+ if (availableLogicalWidth)
+ logicalWidthResult = availableLogicalWidth - marginStart - marginEnd;
if (sizesToIntrinsicWidth(widthType)) {
- widthResult = max(widthResult, minPrefWidth());
- widthResult = min(widthResult, maxPrefWidth());
+ logicalWidthResult = max(logicalWidthResult, minPrefWidth());
+ logicalWidthResult = min(logicalWidthResult, maxPrefWidth());
}
- } else
- widthResult = computeBorderBoxLogicalWidth(w.calcValue(cw));
+ } else // FIXME: If the containing block flow is perpendicular to our direction we need to use the available logical height instead.
+ logicalWidthResult = computeBorderBoxLogicalWidth(logicalWidth.calcValue(availableLogicalWidth));
- return widthResult;
+ return logicalWidthResult;
}
-bool RenderBox::sizesToIntrinsicWidth(WidthType widthType) const
+bool RenderBox::sizesToIntrinsicWidth(LogicalWidthType widthType) const
{
// Marquees in WinIE are like a mixture of blocks and inline-blocks. They size as though they're blocks,
// but they allow text to sit on the same line as the marquee.
@@ -1472,12 +1472,15 @@ bool RenderBox::sizesToIntrinsicWidth(WidthType widthType) const
// This code may look a bit strange. Basically width:intrinsic should clamp the size when testing both
// min-width and width. max-width is only clamped if it is also intrinsic.
- Length width = (widthType == MaxWidth) ? style()->maxWidth() : style()->width();
- if (width.type() == Intrinsic)
+ Length logicalWidth = (widthType == MaxLogicalWidth) ? style()->logicalMaxWidth() : style()->logicalWidth();
+ if (logicalWidth.type() == Intrinsic)
return true;
// Children of a horizontal marquee do not fill the container by default.
// FIXME: Need to deal with MAUTO value properly. It could be vertical.
+ // FIXME: Think about block-flow here. Need to find out how marquee direction relates to
+ // block-flow (as well as how marquee overflow should relate to block flow).
+ // https://bugs.webkit.org/show_bug.cgi?id=46472
if (parent()->style()->overflowX() == OMARQUEE) {
EMarqueeDirection dir = parent()->style()->marqueeDirection();
if (dir == MAUTO || dir == MFORWARD || dir == MBACKWARD || dir == MLEFT || dir == MRIGHT)
@@ -1486,6 +1489,8 @@ bool RenderBox::sizesToIntrinsicWidth(WidthType widthType) const
// Flexible horizontal boxes lay out children at their intrinsic widths. Also vertical boxes
// that don't stretch their kids lay out their children at their intrinsic widths.
+ // FIXME: Think about block-flow here.
+ // https://bugs.webkit.org/show_bug.cgi?id=46473
if (parent()->isFlexibleBox()
&& (parent()->style()->boxOrient() == HORIZONTAL || parent()->style()->boxAlign() != BSTRETCH))
return true;
@@ -1493,7 +1498,9 @@ bool RenderBox::sizesToIntrinsicWidth(WidthType widthType) const
// Button, input, select, textarea, legend and datagrid treat
// width value of 'auto' as 'intrinsic' unless it's in a
// stretching vertical flexbox.
- if (width.type() == Auto && !(parent()->isFlexibleBox() && parent()->style()->boxOrient() == VERTICAL && parent()->style()->boxAlign() == BSTRETCH) && node() && (node()->hasTagName(inputTag) || node()->hasTagName(selectTag) || node()->hasTagName(buttonTag) || node()->hasTagName(textareaTag) || node()->hasTagName(legendTag) || node()->hasTagName(datagridTag)))
+ // FIXME: Think about block-flow here.
+ // https://bugs.webkit.org/show_bug.cgi?id=46473
+ if (logicalWidth.type() == Auto && !(parent()->isFlexibleBox() && parent()->style()->boxOrient() == VERTICAL && parent()->style()->boxAlign() == BSTRETCH) && node() && (node()->hasTagName(inputTag) || node()->hasTagName(selectTag) || node()->hasTagName(buttonTag) || node()->hasTagName(textareaTag) || node()->hasTagName(legendTag) || node()->hasTagName(datagridTag)))
return true;
return false;
diff --git a/WebCore/rendering/RenderBox.h b/WebCore/rendering/RenderBox.h
index 8624ef7..d4cdb04 100644
--- a/WebCore/rendering/RenderBox.h
+++ b/WebCore/rendering/RenderBox.h
@@ -29,7 +29,7 @@
namespace WebCore {
-enum WidthType { Width, MinWidth, MaxWidth };
+enum LogicalWidthType { LogicalWidth, MinLogicalWidth, MaxLogicalWidth };
class RenderBox : public RenderBoxModelObject {
public:
@@ -233,10 +233,10 @@ public:
// Whether or not the element shrinks to its intrinsic width (rather than filling the width
// of a containing block). HTML4 buttons, <select>s, <input>s, legends, and floating/compact elements do this.
- bool sizesToIntrinsicWidth(WidthType) const;
+ bool sizesToIntrinsicWidth(LogicalWidthType) const;
virtual bool stretchesToMinIntrinsicWidth() const { return false; }
- int computeLogicalWidthUsing(WidthType, int containerWidth);
+ int computeLogicalWidthUsing(LogicalWidthType, int availableLogicalWidth);
int computeLogicalHeightUsing(const Length& height);
int computeReplacedWidthUsing(Length width) const;
int computeReplacedHeightUsing(Length height) const;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list