haikuwebkit/LayoutTests/fast/css/center-align-absolute-posit...

25 lines
582 B
HTML
Raw Permalink Normal View History

REGRESSION (r94492): Unstable layout of static block inside text-align: center div https://bugs.webkit.org/show_bug.cgi?id=77754 Reviewed by David Hyatt. Source/WebCore: Text-align of 'center' on an out-of-flow element determines its x-position in the line - it doesn't mean that the element should be centred in the line as though it were a block of text. This is a partial revert of http://trac.webkit.org/changeset/113584 and a correction to http://trac.webkit.org/changeset/94492. Tests: fast/css/center-align-absolute-position-inline-block.html fast/css/center-align-absolute-position.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::layoutPositionedObjects): Remove an update to the static position when it depended on the child's width. Reverts code added in r113584. * rendering/RenderBlock.h: (RenderBlock): Remove child parameter from startAlignedOffsetForLine() * rendering/RenderBlockLineLayout.cpp: (WebCore::setStaticPositions): ditto (WebCore::RenderBlock::startAlignedOffsetForLine): No need to account for the child's width when calculating the offset for the line. LayoutTests: * fast/css/align-positioned-object-on-resize-expected.txt: Removed. * fast/css/align-positioned-object-on-resize.html: Removed. * fast/css/bug4860-absolute-inline-child-inherits-alignment-expected.png: Removed. * fast/css/bug4860-absolute-inline-child-inherits-alignment-expected.txt: Removed. * fast/css/bug4860-absolute-inline-child-inherits-alignment.html: Removed. These tests are no longer valid. They expect an out-of-flow block to align with the center of their parent. The valid behaviour for an out-of-flow element with a center-align parent is take the center of the parent as their start position. The expected behaviour is now covered by center-align-absolute-position.html below. * fast/css/center-align-absolute-position-expected.html: Added. * fast/css/center-align-absolute-position-inline-block-expected.html: Added. * fast/css/center-align-absolute-position-inline-block.html: Added. * fast/css/center-align-absolute-position.html: Added. * fast/inline/left-right-center-inline-alignment-in-ltr-and-rtl-blocks.html: * platform/chromium-linux/fast/inline/absolute-positioned-inline-in-centred-block-expected.png: * platform/chromium-linux/fast/inline/left-right-center-inline-alignment-in-ltr-and-rtl-blocks-expected.png: This isn't a very helpful test - but note that the alignment of LTR-RTL centers on an axis. The behaviour now matches FF. * platform/chromium-mac/fast/css/bug4860-absolute-inline-child-inherits-alignment-expected.png: Removed. * platform/chromium-win/fast/css/absolute-child-with-percent-height-inside-relative-parent-expected.png: * platform/chromium-win/fast/css/bug4860-absolute-inline-child-inherits-alignment-expected.png: Removed. * platform/chromium-win/fast/inline/absolute-positioned-inline-in-centred-block-expected.txt: * platform/chromium-win/fast/inline/left-right-center-inline-alignment-in-ltr-and-rtl-blocks-expected.txt: * platform/chromium/TestExpectations: * platform/chromium/fast/css/absolute-child-with-percent-height-inside-relative-parent-expected.txt: * platform/chromium/fast/css/bug4860-absolute-inline-child-inherits-alignment-expected.txt: Removed. * platform/efl/TestExpectations: * platform/gtk/TestExpectations: * platform/mac/TestExpectations: * platform/qt/TestExpectations: * platform/qt/fast/css/bug4860-absolute-inline-child-inherits-alignment-expected.png: Removed. * platform/qt/fast/css/bug4860-absolute-inline-child-inherits-alignment-expected.txt: Removed. The rebaselined results on each of these now matches FF. Canonical link: https://commits.webkit.org/113088@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@126911 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-28 19:18:40 +00:00
<html>
<head>
<style>
#block {
margin: 0px;
padding: 0px;
position: absolute;
width: 200px;
background: blue;
height: 20px;
display: inline-block;
}
</style>
</head>
<body style="width: 800px;">
<p> The two blue bars should be aligned with each other. </p>
<div style="text-align: center" >
<span style="position: absolute; top: 44px;">
REGRESSION (r94492): Unstable layout of static block inside text-align: center div https://bugs.webkit.org/show_bug.cgi?id=77754 Reviewed by David Hyatt. Source/WebCore: Text-align of 'center' on an out-of-flow element determines its x-position in the line - it doesn't mean that the element should be centred in the line as though it were a block of text. This is a partial revert of http://trac.webkit.org/changeset/113584 and a correction to http://trac.webkit.org/changeset/94492. Tests: fast/css/center-align-absolute-position-inline-block.html fast/css/center-align-absolute-position.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::layoutPositionedObjects): Remove an update to the static position when it depended on the child's width. Reverts code added in r113584. * rendering/RenderBlock.h: (RenderBlock): Remove child parameter from startAlignedOffsetForLine() * rendering/RenderBlockLineLayout.cpp: (WebCore::setStaticPositions): ditto (WebCore::RenderBlock::startAlignedOffsetForLine): No need to account for the child's width when calculating the offset for the line. LayoutTests: * fast/css/align-positioned-object-on-resize-expected.txt: Removed. * fast/css/align-positioned-object-on-resize.html: Removed. * fast/css/bug4860-absolute-inline-child-inherits-alignment-expected.png: Removed. * fast/css/bug4860-absolute-inline-child-inherits-alignment-expected.txt: Removed. * fast/css/bug4860-absolute-inline-child-inherits-alignment.html: Removed. These tests are no longer valid. They expect an out-of-flow block to align with the center of their parent. The valid behaviour for an out-of-flow element with a center-align parent is take the center of the parent as their start position. The expected behaviour is now covered by center-align-absolute-position.html below. * fast/css/center-align-absolute-position-expected.html: Added. * fast/css/center-align-absolute-position-inline-block-expected.html: Added. * fast/css/center-align-absolute-position-inline-block.html: Added. * fast/css/center-align-absolute-position.html: Added. * fast/inline/left-right-center-inline-alignment-in-ltr-and-rtl-blocks.html: * platform/chromium-linux/fast/inline/absolute-positioned-inline-in-centred-block-expected.png: * platform/chromium-linux/fast/inline/left-right-center-inline-alignment-in-ltr-and-rtl-blocks-expected.png: This isn't a very helpful test - but note that the alignment of LTR-RTL centers on an axis. The behaviour now matches FF. * platform/chromium-mac/fast/css/bug4860-absolute-inline-child-inherits-alignment-expected.png: Removed. * platform/chromium-win/fast/css/absolute-child-with-percent-height-inside-relative-parent-expected.png: * platform/chromium-win/fast/css/bug4860-absolute-inline-child-inherits-alignment-expected.png: Removed. * platform/chromium-win/fast/inline/absolute-positioned-inline-in-centred-block-expected.txt: * platform/chromium-win/fast/inline/left-right-center-inline-alignment-in-ltr-and-rtl-blocks-expected.txt: * platform/chromium/TestExpectations: * platform/chromium/fast/css/absolute-child-with-percent-height-inside-relative-parent-expected.txt: * platform/chromium/fast/css/bug4860-absolute-inline-child-inherits-alignment-expected.txt: Removed. * platform/efl/TestExpectations: * platform/gtk/TestExpectations: * platform/mac/TestExpectations: * platform/qt/TestExpectations: * platform/qt/fast/css/bug4860-absolute-inline-child-inherits-alignment-expected.png: Removed. * platform/qt/fast/css/bug4860-absolute-inline-child-inherits-alignment-expected.txt: Removed. The rebaselined results on each of these now matches FF. Canonical link: https://commits.webkit.org/113088@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@126911 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-08-28 19:18:40 +00:00
<div id="block"></div>
</span>
</div>
<div id="block" style="position: absolute; top: 80px; left: 408px;"></div>
</body>
</html>