Commit 83f864f8 authored by robert@webkit.org's avatar robert@webkit.org

Abspos Inline block not positioned correctly in text-aligned container

https://bugs.webkit.org/show_bug.cgi?id=105695

Reviewed by Ojan Vafai.

Source/WebCore:

Inline positioned elements should still obey the text-alignment of their container
even when we don't do a line layout.

Test: fast/text/container-align-with-inlines.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::adjustPositionedBlock):
(WebCore::RenderBlock::updateStaticInlinePositionForChild):
(WebCore):
* rendering/RenderBlock.h:
(RenderBlock):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::setStaticPositions):

LayoutTests:

* fast/text/container-align-with-inlines-expected.txt: Added.
* fast/text/container-align-with-inlines.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140570 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3dba811f
2013-01-23 Robert Hogan <robert@webkit.org>
Abspos Inline block not positioned correctly in text-aligned container
https://bugs.webkit.org/show_bug.cgi?id=105695
Reviewed by Ojan Vafai.
* fast/text/container-align-with-inlines-expected.txt: Added.
* fast/text/container-align-with-inlines.html: Added.
2013-01-23 Alexis Menard <alexis@webkit.org>
transition-property accepts incorrect "all, none" as value
The blue box should be right-aligned. You will need to scroll right to see it.
https://bugs.webkit.org/show_bug.cgi?id=105695
XXX
XXX
Success
<!DOCTYPE html>
<html>
<head>
<style>
p {background:black; }
div.reference {position: absolute; display: inline; background: blue; color: blue;}
body {margin: 0px;}
</style>
</head>
<body>
The blue box should be right-aligned. You will need to scroll right to see it.<br>
https://bugs.webkit.org/show_bug.cgi?id=105695
<div id='container' style="text-align: right">
<p>XXX</p><div id="test" class="reference">XXX</div>
</div>
<div id="output">Failure</div>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
}
var testEl = document.getElementById('test');
if (testEl.offsetLeft == document.getElementById('container').offsetWidth)
output.innerHTML = 'Success';
</script>
</body>
</html>
2013-01-23 Robert Hogan <robert@webkit.org>
Abspos Inline block not positioned correctly in text-aligned container
https://bugs.webkit.org/show_bug.cgi?id=105695
Reviewed by Ojan Vafai.
Inline positioned elements should still obey the text-alignment of their container
even when we don't do a line layout.
Test: fast/text/container-align-with-inlines.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::adjustPositionedBlock):
(WebCore::RenderBlock::updateStaticInlinePositionForChild):
(WebCore):
* rendering/RenderBlock.h:
(RenderBlock):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::setStaticPositions):
2013-01-23 Eric Seidel <eric@webkit.org>
Remove DocType support from MarkupTokenBase now that NEW_XML is gone
......@@ -1751,7 +1751,7 @@ void RenderBlock::adjustPositionedBlock(RenderBox* child, const MarginInfo& marg
bool hasStaticBlockPosition = child->style()->hasStaticBlockPosition(isHorizontal);
LayoutUnit logicalTop = logicalHeight();
setStaticInlinePositionForChild(child, logicalTop, startOffsetForContent(logicalTop));
updateStaticInlinePositionForChild(child, logicalTop);
if (!marginInfo.canCollapseWithMarginBefore()) {
// Positioned blocks don't collapse margins, so add the margin provided by
......@@ -7408,6 +7408,14 @@ RenderRegion* RenderBlock::regionAtBlockOffset(LayoutUnit blockOffset) const
return flowThread->regionAtBlockOffset(offsetFromLogicalTopOfFirstPage() + blockOffset, true);
}
void RenderBlock::updateStaticInlinePositionForChild(RenderBox* child, LayoutUnit logicalTop)
{
if (child->style()->isOriginalDisplayInlineType())
setStaticInlinePositionForChild(child, logicalTop, startAlignedOffsetForLine(logicalTop, false));
else
setStaticInlinePositionForChild(child, logicalTop, startOffsetForContent(logicalTop));
}
void RenderBlock::setStaticInlinePositionForChild(RenderBox* child, LayoutUnit blockOffset, LayoutUnit inlinePosition)
{
if (inRenderFlowThread()) {
......
......@@ -424,6 +424,7 @@ public:
LayoutUnit endOffsetForContent() const { return !style()->isLeftToRightDirection() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForContent(); }
void setStaticInlinePositionForChild(RenderBox*, LayoutUnit blockOffset, LayoutUnit inlinePosition);
void updateStaticInlinePositionForChild(RenderBox*, LayoutUnit logicalTop);
LayoutUnit computeStartPositionDeltaForChildAvoidingFloats(const RenderBox* child, LayoutUnit childMarginStart, RenderRegion* = 0, LayoutUnit offsetFromLogicalTopOfFirstPage = 0);
......
......@@ -1071,11 +1071,7 @@ static void setStaticPositions(RenderBlock* block, RenderBox* child)
toRenderInline(containerBlock)->layer()->setStaticInlinePosition(block->startAlignedOffsetForLine(blockHeight, false));
toRenderInline(containerBlock)->layer()->setStaticBlockPosition(blockHeight);
}
if (child->style()->isOriginalDisplayInlineType())
block->setStaticInlinePositionForChild(child, blockHeight, block->startAlignedOffsetForLine(blockHeight, false));
else
block->setStaticInlinePositionForChild(child, blockHeight, block->startOffsetForContent(blockHeight));
block->updateStaticInlinePositionForChild(child, blockHeight);
child->layer()->setStaticBlockPosition(blockHeight);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment