Commit a8172de1 authored by Oriol Brufau's avatar Oriol Brufau Committed by Commit Bot

Use the padding area to resolve percentages in fixed positioning

Currently only 'position: absolute' uses the padding area of the
containing block in 'top' and 'bottom' properties, 'position: fixed'
uses the content area instead.

The change only affects the value returned by getComputedStyle, the used
value was already correct.

BUG=883585

TEST=external/wpt/css/cssom/getComputedStyle-insets-fixed.html

The test still has some failures due to http://crbug.com/883582,
http://crbug.com/883574 and http://crbug.com/888532.

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: I91a07472026f50cb60e0225a4e8edd515c04ec6a
Reviewed-on: https://chromium-review.googlesource.com/1240124
Commit-Queue: Oriol Brufau <obrufau@igalia.com>
Reviewed-by: default avatarMorten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594137}
parent e1cf45a6
...@@ -2113,7 +2113,7 @@ LayoutUnit LayoutBox::ContainingBlockLogicalHeightForGetComputedStyle() const { ...@@ -2113,7 +2113,7 @@ LayoutUnit LayoutBox::ContainingBlockLogicalHeightForGetComputedStyle() const {
LayoutBoxModelObject* cb = ToLayoutBoxModelObject(Container()); LayoutBoxModelObject* cb = ToLayoutBoxModelObject(Container());
LayoutUnit height = ContainingBlockLogicalHeightForPositioned(cb); LayoutUnit height = ContainingBlockLogicalHeightForPositioned(cb);
if (StyleRef().GetPosition() != EPosition::kAbsolute) if (IsInFlowPositioned())
height -= cb->PaddingLogicalHeight(); height -= cb->PaddingLogicalHeight();
return height; return height;
} }
......
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