[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:58:30 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 09edf1d80afe0c691986c0d96ccf1264cbcfc441
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Sep 30 18:54:16 2010 +0000
https://bugs.webkit.org/show_bug.cgi?id=46923
Reviewed by Simon Fraser.
Make determineLogicalLeftPositionForChild block-flow-aware. Rewrite the function so that there aren't
completely separate LTR/RTL cases.
Added fast/blockflow/inline-direction-positioning.html
WebCore:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::determineLogicalLeftPositionForChild):
(WebCore::RenderBlock::setLogicalLeftForChild):
* rendering/RenderBlock.h:
(WebCore::RenderBlock::logicalWidthForChild):
(WebCore::RenderBlock::logicalRightOffsetForContent):
(WebCore::RenderBlock::logicalLeftOffsetForContent):
LayoutTests:
* fast/blockflow/inline-direction-positioning.html: Added.
* platform/mac/fast/blockflow/inline-direction-positioning-expected.checksum: Added.
* platform/mac/fast/blockflow/inline-direction-positioning-expected.png: Added.
* platform/mac/fast/blockflow/inline-direction-positioning-expected.txt: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68814 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index e64a476..904e0fd 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,19 @@
+2010-09-30 David Hyatt <hyatt at apple.com>
+
+ Reviewed by Simon Fraser.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46923
+
+ Make determineLogicalLeftPositionForChild block-flow-aware. Rewrite the function so that there aren't
+ completely separate LTR/RTL cases.
+
+ Added fast/blockflow/inline-direction-positioning.html
+
+ * fast/blockflow/inline-direction-positioning.html: Added.
+ * platform/mac/fast/blockflow/inline-direction-positioning-expected.checksum: Added.
+ * platform/mac/fast/blockflow/inline-direction-positioning-expected.png: Added.
+ * platform/mac/fast/blockflow/inline-direction-positioning-expected.txt: Added.
+
2010-09-29 Adam Roben <aroben at apple.com>
Add test for color:8 media queries
diff --git a/LayoutTests/fast/blockflow/inline-direction-positioning.html b/LayoutTests/fast/blockflow/inline-direction-positioning.html
new file mode 100644
index 0000000..65f8fdf
--- /dev/null
+++ b/LayoutTests/fast/blockflow/inline-direction-positioning.html
@@ -0,0 +1,9 @@
+<html>
+<body>
+<div style="border:2px solid black;width:600px;">
+<div style="-webkit-writing-mode: tb-lr; writing-mode:tb-lr; width:100px; height:100px; margin-left:50px; background-color:green"></div>
+</div>
+
+<div style="border:2px solid black;width:600px;direction:rtl">
+<div style="-webkit-writing-mode: tb-lr; writing-mode:tb-lr; width:100px; height:100px; margin-right:50px; background-color:green"></div>
+</div>
diff --git a/LayoutTests/platform/mac/fast/blockflow/inline-direction-positioning-expected.checksum b/LayoutTests/platform/mac/fast/blockflow/inline-direction-positioning-expected.checksum
new file mode 100644
index 0000000..15f7527
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/blockflow/inline-direction-positioning-expected.checksum
@@ -0,0 +1 @@
+1355ed7c54d51dc216c8de007897aa7e
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/blockflow/inline-direction-positioning-expected.png b/LayoutTests/platform/mac/fast/blockflow/inline-direction-positioning-expected.png
new file mode 100644
index 0000000..00e44b3
Binary files /dev/null and b/LayoutTests/platform/mac/fast/blockflow/inline-direction-positioning-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/blockflow/inline-direction-positioning-expected.txt b/LayoutTests/platform/mac/fast/blockflow/inline-direction-positioning-expected.txt
new file mode 100644
index 0000000..60392c8
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/blockflow/inline-direction-positioning-expected.txt
@@ -0,0 +1,9 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {DIV} at (0,0) size 604x154 [border: (2px solid #000000)]
+ RenderBlock {DIV} at (52,52) size 100x100 [bgcolor=#008000]
+ RenderBlock {DIV} at (0,154) size 604x154 [border: (2px solid #000000)]
+ RenderBlock {DIV} at (452,2) size 100x100 [bgcolor=#008000]
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 4f0bbfc..c087e27 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-09-30 David Hyatt <hyatt at apple.com>
+
+ Reviewed by Simon Fraser.
+
+ https://bugs.webkit.org/show_bug.cgi?id=46923
+
+ Make determineLogicalLeftPositionForChild block-flow-aware. Rewrite the function so that there aren't
+ completely separate LTR/RTL cases.
+
+ Added fast/blockflow/inline-direction-positioning.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::determineLogicalLeftPositionForChild):
+ (WebCore::RenderBlock::setLogicalLeftForChild):
+ * rendering/RenderBlock.h:
+ (WebCore::RenderBlock::logicalWidthForChild):
+ (WebCore::RenderBlock::logicalRightOffsetForContent):
+ (WebCore::RenderBlock::logicalLeftOffsetForContent):
+
2010-09-29 Adam Roben <aroben at apple.com>
Fix color media queries on Windows
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index ba2d9c9..6119af7 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -1645,54 +1645,33 @@ int RenderBlock::estimateLogicalTopPosition(RenderBox* child, const MarginInfo&
void RenderBlock::determineLogicalLeftPositionForChild(RenderBox* child)
{
- int xPos = borderLeft() + paddingLeft();
- if (style()->direction() == LTR) {
- // Add in our left margin.
- int chPos = xPos + child->marginLeft();
+ int startPosition = borderStart() + paddingStart();
+ int totalAvailableLogicalWidth = borderAndPaddingLogicalWidth() + availableLogicalWidth();
+
+ // Add in our start margin.
+ int childMarginStart = marginStartForChild(child);
+ int newPosition = startPosition + childMarginStart;
- // Some objects (e.g., tables, horizontal rules, overflow:auto blocks) avoid floats. They need
- // to shift over as necessary to dodge any floats that might get in the way.
- if (child->avoidsFloats()) {
- int leftOff = logicalLeftOffsetForLine(height(), false);
- if (style()->textAlign() != WEBKIT_CENTER && child->style()->marginLeft().type() != Auto) {
- if (child->marginLeft() < 0)
- leftOff += child->marginLeft();
- chPos = max(chPos, leftOff); // Let the float sit in the child's margin if it can fit.
- }
- else if (leftOff != xPos) {
- // The object is shifting right. The object might be centered, so we need to
- // recalculate our horizontal margins. Note that the containing block content
- // width computation will take into account the delta between |leftOff| and |xPos|
- // so that we can just pass the content width in directly to the |computeMarginsInContainingBlockInlineDirection|
- // function.
- child->computeInlineDirectionMargins(this, availableLogicalWidthForLine(child->y(), false), child->width());
- chPos = leftOff + child->marginLeft();
- }
- }
- view()->addLayoutDelta(IntSize(child->x() - chPos, 0));
- child->setLocation(chPos, child->y());
- } else {
- xPos += availableLogicalWidth();
- int chPos = xPos - (child->width() + child->marginRight());
- if (child->avoidsFloats()) {
- int rightOff = logicalRightOffsetForLine(height(), false);
- if (style()->textAlign() != WEBKIT_CENTER && child->style()->marginRight().type() != Auto) {
- if (child->marginRight() < 0)
- rightOff -= child->marginRight();
- chPos = min(chPos, rightOff - child->width()); // Let the float sit in the child's margin if it can fit.
- } else if (rightOff != xPos) {
- // The object is shifting left. The object might be centered, so we need to
- // recalculate our horizontal margins. Note that the containing block content
- // width computation will take into account the delta between |rightOff| and |xPos|
- // so that we can just pass the content width in directly to the |computeInlineDirectionMargins|
- // function.
- child->computeInlineDirectionMargins(this, availableLogicalWidthForLine(child->y(), false), child->width());
- chPos = rightOff - child->marginRight() - child->width();
- }
+ // Some objects (e.g., tables, horizontal rules, overflow:auto blocks) avoid floats. They need
+ // to shift over as necessary to dodge any floats that might get in the way.
+ if (child->avoidsFloats()) {
+ int startOff = style()->direction() == LTR ? logicalLeftOffsetForLine(logicalHeight(), false) : totalAvailableLogicalWidth - logicalRightOffsetForLine(logicalHeight(), false);
+ if (style()->textAlign() != WEBKIT_CENTER && !child->style()->marginStartUsing(style()).isAuto()) {
+ if (childMarginStart < 0)
+ startOff += childMarginStart;
+ newPosition = max(newPosition, startOff); // Let the float sit in the child's margin if it can fit.
+ } else if (startOff != startPosition) {
+ // The object is shifting to the "end" side of the block. The object might be centered, so we need to
+ // recalculate our inline direction margins. Note that the containing block content
+ // width computation will take into account the delta between |startOff| and |startPosition|
+ // so that we can just pass the content width in directly to the |computeMarginsInContainingBlockInlineDirection|
+ // function.
+ child->computeInlineDirectionMargins(this, availableLogicalWidthForLine(logicalTopForChild(child), false), logicalWidthForChild(child));
+ newPosition = startOff + marginStartForChild(child);
}
- view()->addLayoutDelta(IntSize(child->x() - chPos, 0));
- child->setLocation(chPos, child->y());
}
+
+ setLogicalLeftForChild(child, style()->direction() == LTR ? newPosition : totalAvailableLogicalWidth - newPosition - logicalWidthForChild(child));
}
void RenderBlock::setCollapsedBottomMargin(const MarginInfo& marginInfo)
@@ -1733,6 +1712,17 @@ void RenderBlock::handleAfterSideOfBlock(int top, int bottom, MarginInfo& margin
setCollapsedBottomMargin(marginInfo);
}
+void RenderBlock::setLogicalLeftForChild(RenderBox* child, int logicalLeft)
+{
+ if (style()->isVerticalBlockFlow()) {
+ view()->addLayoutDelta(IntSize(child->x() - logicalLeft, 0));
+ child->setLocation(logicalLeft, child->y());
+ } else {
+ view()->addLayoutDelta(IntSize(0, child->y() - logicalLeft));
+ child->setLocation(child->x(), logicalLeft);
+ }
+}
+
void RenderBlock::setLogicalTopForChild(RenderBox* child, int logicalTop)
{
if (style()->isVerticalBlockFlow()) {
@@ -3219,11 +3209,6 @@ HashSet<RenderBox*>* RenderBlock::percentHeightDescendants() const
return gPercentHeightDescendantsMap ? gPercentHeightDescendantsMap->get(this) : 0;
}
-int RenderBlock::logicalLeftOffsetForContent() const
-{
- return borderLeft() + paddingLeft();
-}
-
int RenderBlock::logicalLeftOffsetForLine(int y, int fixedOffset, bool applyTextIndent, int* heightRemaining) const
{
int left = fixedOffset;
@@ -3252,11 +3237,6 @@ int RenderBlock::logicalLeftOffsetForLine(int y, int fixedOffset, bool applyText
return left;
}
-int RenderBlock::logicalRightOffsetForContent() const
-{
- return borderLeft() + paddingLeft() + availableLogicalWidth();
-}
-
int RenderBlock::logicalRightOffsetForLine(int y, int fixedOffset, bool applyTextIndent, int* heightRemaining) const
{
int right = fixedOffset;
diff --git a/WebCore/rendering/RenderBlock.h b/WebCore/rendering/RenderBlock.h
index 5926e7e..752dc73 100644
--- a/WebCore/rendering/RenderBlock.h
+++ b/WebCore/rendering/RenderBlock.h
@@ -105,7 +105,7 @@ public:
int availableLogicalWidthForLine(int position, bool firstLine) const;
int logicalRightOffsetForLine(int position, bool firstLine) const { return logicalRightOffsetForLine(position, logicalRightOffsetForContent(), firstLine); }
int logicalLeftOffsetForLine(int position, bool firstLine) const { return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(), firstLine); }
-
+
virtual int lowestPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
virtual int rightmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
virtual int leftmostPosition(bool includeOverflowInterior = true, bool includeSelf = true) const;
@@ -170,8 +170,11 @@ public:
void setPageY(int y);
// Accessors for logical width/height and margins in the containing block's block-flow direction.
+ int logicalWidthForChild(RenderBox* child) { return style()->isVerticalBlockFlow() ? child->width() : child->height(); }
int logicalHeightForChild(RenderBox* child) { return style()->isVerticalBlockFlow() ? child->height() : child->width(); }
int logicalTopForChild(RenderBox* child) { return style()->isVerticalBlockFlow() ? child->y() : child->x(); }
+ void setLogicalLeftForChild(RenderBox* child, int logicalLeft);
+ void setLogicalTopForChild(RenderBox* child, int logicalTop);
int marginBeforeForChild(RenderBoxModelObject* child) const;
int marginAfterForChild(RenderBoxModelObject* child) const;
int marginStartForChild(RenderBoxModelObject* child) const;
@@ -234,8 +237,8 @@ protected:
virtual void paint(PaintInfo&, int tx, int ty);
virtual void paintObject(PaintInfo&, int tx, int ty);
- int logicalRightOffsetForContent() const;
- int logicalLeftOffsetForContent() const;
+ int logicalRightOffsetForContent() const { return style()->isVerticalBlockFlow() ? borderLeft() + paddingLeft() + availableLogicalWidth() : borderTop() + paddingTop() + availableLogicalWidth(); }
+ int logicalLeftOffsetForContent() const { return style()->isVerticalBlockFlow() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); }
int logicalRightOffsetForLine(int position, int fixedOffset, bool applyTextIndent = true, int* logicalHeightRemaining = 0) const;
int logicalLeftOffsetForLine(int position, int fixedOffset, bool applyTextIndent = true, int* logicalHeightRemaining = 0) const;
@@ -584,7 +587,6 @@ private:
void determineLogicalLeftPositionForChild(RenderBox* child);
void handleAfterSideOfBlock(int top, int bottom, MarginInfo&);
void setCollapsedBottomMargin(const MarginInfo&);
- void setLogicalTopForChild(RenderBox* child, int logicalTop);
// End helper functions and structs used by layoutBlockChildren.
// Pagination routines.
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list