Title: [146308] trunk
- Revision
- 146308
- Author
- rob...@webkit.org
- Date
- 2013-03-20 00:16:08 -0700 (Wed, 20 Mar 2013)
Log Message
Absolute position div without width specified does not reflow its text when it is moved (and computed width changes)
https://bugs.webkit.org/show_bug.cgi?id=112052
Source/WebCore:
Reviewed by Emil A Eklund.
If a positioned block has auto width then any movement means the block needs to be resized.
Test: fast/block/positioned-block-auto-width-movement.html
* rendering/style/RenderStyle.cpp:
(WebCore::positionedObjectMoved):
(WebCore::RenderStyle::diff):
LayoutTests:
Reviewed by Emil A Eklund.
* fast/block/positioned-block-auto-width-movement-expected.html: Added.
* fast/block/positioned-block-auto-width-movement.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (146307 => 146308)
--- trunk/LayoutTests/ChangeLog 2013-03-20 07:08:29 UTC (rev 146307)
+++ trunk/LayoutTests/ChangeLog 2013-03-20 07:16:08 UTC (rev 146308)
@@ -1,3 +1,13 @@
+2013-03-20 Robert Hogan <rob...@webkit.org>
+
+ Absolute position div without width specified does not reflow its text when it is moved (and computed width changes)
+ https://bugs.webkit.org/show_bug.cgi?id=112052
+
+ Reviewed by Emil A Eklund.
+
+ * fast/block/positioned-block-auto-width-movement-expected.html: Added.
+ * fast/block/positioned-block-auto-width-movement.html: Added.
+
2013-03-19 Mike West <mk...@chromium.org>
CSP 1.1: Stub out SecurityPolicyViolationEvent interface.
Added: trunk/LayoutTests/fast/block/positioned-block-auto-width-movement-expected.html (0 => 146308)
--- trunk/LayoutTests/fast/block/positioned-block-auto-width-movement-expected.html (rev 0)
+++ trunk/LayoutTests/fast/block/positioned-block-auto-width-movement-expected.html 2013-03-20 07:16:08 UTC (rev 146308)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <style>
+ #d {
+ position: absolute;
+ top: 50px;
+ left: 200px;
+ }
+ </style>
+</head>
+<body>
+ <p> Bug webkit.org/b/112052: A positioned block with auto width should resize when moved left or right. There should be no horizontal scrollbars below.</p>
+ <div id="d">
+ Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah
+ </div>
+</body>
+</html>
+
+
Added: trunk/LayoutTests/fast/block/positioned-block-auto-width-movement.html (0 => 146308)
--- trunk/LayoutTests/fast/block/positioned-block-auto-width-movement.html (rev 0)
+++ trunk/LayoutTests/fast/block/positioned-block-auto-width-movement.html 2013-03-20 07:16:08 UTC (rev 146308)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <style>
+ #d {
+ position: absolute;
+ top: 50px;
+ left: 10px;
+ }
+ </style>
+</head>
+<body>
+ <p> Bug webkit.org/b/112052: A positioned block with auto width should resize when moved left or right. There should be no horizontal scrollbars below.</p>
+ <div id="d">
+ Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah Blah blah blah blah
+ </div>
+ <script type='text/_javascript_'>
+ document.body.offsetHeight;
+ var d = document.getElementById("d");
+ d.style.left = "200px";
+ </script>
+</body>
+</html>
+
+
Modified: trunk/Source/WebCore/ChangeLog (146307 => 146308)
--- trunk/Source/WebCore/ChangeLog 2013-03-20 07:08:29 UTC (rev 146307)
+++ trunk/Source/WebCore/ChangeLog 2013-03-20 07:16:08 UTC (rev 146308)
@@ -1,3 +1,18 @@
+2013-03-20 Robert Hogan <rob...@webkit.org>
+
+ Absolute position div without width specified does not reflow its text when it is moved (and computed width changes)
+ https://bugs.webkit.org/show_bug.cgi?id=112052
+
+ Reviewed by Emil A Eklund.
+
+ If a positioned block has auto width then any movement means the block needs to be resized.
+
+ Test: fast/block/positioned-block-auto-width-movement.html
+
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::positionedObjectMoved):
+ (WebCore::RenderStyle::diff):
+
2013-03-19 Sheriff Bot <webkit.review....@gmail.com>
Unreviewed, rolling out r146301.
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (146307 => 146308)
--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2013-03-20 07:08:29 UTC (rev 146307)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp 2013-03-20 07:16:08 UTC (rev 146308)
@@ -343,7 +343,7 @@
&& rareInheritedData.get() == other->rareInheritedData.get();
}
-static bool positionedObjectMoved(const LengthBox& a, const LengthBox& b)
+static bool positionedObjectMoved(const LengthBox& a, const LengthBox& b, const Length& width)
{
// If any unit types are different, then we can't guarantee
// that this was just a movement.
@@ -360,6 +360,10 @@
return false;
if (!a.top().isIntrinsicOrAuto() && !a.bottom().isIntrinsicOrAuto())
return false;
+ // If our width is auto and left or right is specified then this
+ // is not just a movement - we need to resize to our container.
+ if ((!a.left().isIntrinsicOrAuto() || !a.right().isIntrinsicOrAuto()) && width.isIntrinsicOrAuto())
+ return false;
// One of the units is fixed or percent in both directions and stayed
// that way in the new style. Therefore all we are doing is moving.
@@ -626,7 +630,8 @@
if (position() != StaticPosition) {
if (surround->offset != other->surround->offset) {
// Optimize for the case where a positioned layer is moving but not changing size.
- if (position() == AbsolutePosition && positionedObjectMoved(surround->offset, other->surround->offset))
+ if (position() == AbsolutePosition && positionedObjectMoved(surround->offset, other->surround->offset, m_box->width()))
+
return StyleDifferenceLayoutPositionedMovementOnly;
// FIXME: We would like to use SimplifiedLayout for relative positioning, but we can't quite do that yet.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes