DescriptionMerge 120859 - REGRESSION(r113885): Margin not properly applied to elements with align=center
https://bugs.webkit.org/show_bug.cgi?id=89515
Reviewed by Levi Weintraub.
Source/WebCore:
Tests: fast/block/negative-margin-start-positive-margin-end.html
fast/block/negative-start-margin-align-center.html
fast/block/positive-margin-block-child-align-center-rtl.html
fast/block/positive-margin-block-child-align-center.html
fast/block/positive-margin-start-align-center.html
fast/block/positive-margin-start-negative-margin-end-align-center.html
fast/table/table-cell-negative-start-margin-align-center.html
r113885 changed the code-path for elements with auto width to call computeInlineDirectionMargins.
However this uncovered an existing bug in the function when dealing with align="center" (text-align: -webkit-center)
where we would ignore the margin. This goes against what other browsers are doing and our previous behavior.
Note that align="left" and "right" are likely impacted too and will be investigated / fixed in follow-up changes.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeInlineDirectionMargins):
To match other browsers' behavior, changed the function to include margin in our computations.
LayoutTests:
* fast/block/negative-margin-start-positive-margin-end-expected.html: Added.
* fast/block/negative-margin-start-positive-margin-end.html: Added.
* fast/block/negative-start-margin-align-center-expected.html: Added.
* fast/block/negative-start-margin-align-center.html: Added.
* fast/block/positive-margin-block-child-align-center-expected.html: Added.
* fast/block/positive-margin-block-child-align-center.html: Added.
* fast/block/positive-margin-start-align-center-expected.html: Added.
* fast/block/positive-margin-start-align-center.html: Added.
* fast/block/positive-margin-start-negative-margin-end-align-center-expected.html: Added.
* fast/block/positive-margin-start-negative-margin-end-align-center.html: Added.
Those checks the combination of margin start / end both positive and negative.
* fast/block/positive-margin-block-child-align-center-rtl-expected.html: Added.
* fast/block/positive-margin-block-child-align-center-rtl.html: Added.
One ltr test as I didn't find any.
* fast/table/table-cell-negative-start-margin-align-center-expected.html: Added.
* fast/table/table-cell-negative-start-margin-align-center.html: Added.
This test is very similar to the one above but involves a table.
TBR=jchaffraix@webkit.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=120872
Patch Set 1 #Messages
Total messages: 1 (0 generated)
|