New issue
Advanced search Search tips

Issue 837146 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

[css-writing-modes] Percentage size on orthogonal replaced children is wrongly computed

Project Member Reported by r...@igalia.com, Apr 26 2018

Issue description


Check the attached example, you should see not red if it's working fine.

There's a block with a fixed size of 200x100, which has inside an image with 100% width and height.

If the writing-mode is the same for both element, the image is sized as 200x100 which is right (first case).

But if there's an orthogonal flow (the image is vertical while the container is horizontal or viceversa) the size of the image is wrong.

It seems to be working fine in Firefox and Edge and wrong in Chromium and WebKit.
 
percent-orthogonal-replaced.html
393 bytes View Download

Comment 1 by r...@igalia.com, Apr 26 2018

This seems to be a very old bug: https://bugs.webkit.org/show_bug.cgi?id=46496

There's a FIXME in LayoutBox::ComputeReplacedLogicalHeightUsing() about that:
      // FIXME: availableLogicalHeight() is wrong if the replaced element's
      // writing-mode is perpendicular to the containing block's writing-mode.
      // https://bugs.webkit.org/show_bug.cgi?id=46496

Comment 2 by r...@igalia.com, Apr 26 2018

Owner: r...@igalia.com
Status: Started (was: Available)
Project Member

Comment 3 by bugdroid1@chromium.org, Apr 30 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0dba09954ece0dd1d37224e76f3cd62ad99185fe

commit 0dba09954ece0dd1d37224e76f3cd62ad99185fe
Author: Manuel Rego Casasnovas <rego@igalia.com>
Date: Mon Apr 30 13:17:59 2018

[css-writing-modes] Fix percentages on orthogonal replaced children

This patch modifies LayoutBox::ComputeReplacedLogicalWidth|HeightUsing()
so it's aware of the orthogonal flow cases.

For example to compute the relative widths of replaced elements,
if the element direction is perpendicular to its containing block
it should use the containing block height instead of the width.

BUG= 837146 
TEST=external/wpt/css/css-writing-modes/sizing-percentages-replaced-orthogonal-001.html

Change-Id: I655c984703e2073be9a3a649ac79a63f8c136cc0
Reviewed-on: https://chromium-review.googlesource.com/1029852
Reviewed-by: Javier Fernandez <jfernandez@igalia.com>
Commit-Queue: Manuel Rego Casasnovas <rego@igalia.com>
Cr-Commit-Position: refs/heads/master@{#554731}
[add] https://crrev.com/0dba09954ece0dd1d37224e76f3cd62ad99185fe/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/sizing-percentages-replaced-orthogonal-001-ref.html
[add] https://crrev.com/0dba09954ece0dd1d37224e76f3cd62ad99185fe/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/sizing-percentages-replaced-orthogonal-001.html
[modify] https://crrev.com/0dba09954ece0dd1d37224e76f3cd62ad99185fe/third_party/blink/renderer/core/layout/layout_box.cc

Comment 4 by r...@igalia.com, Apr 30 2018

Status: Fixed (was: Started)

Sign in to add a comment