New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 804952 link

Starred by 4 users

Issue metadata

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

Blocked on:
issue 805996

Blocking:
issue 771643



Sign in to add a comment

Table row group and table row with transform should establish containing block for out-of-flow positioned descendants

Project Member Reported by wangxianzhu@chromium.org, Jan 23 2018

Issue description

<table>
  <tr style="transform: rotate(10deg)">
    <td>
      <div style="position: absolute">ABSOLUTE</div>
    </td>
  </tr>
</table>

According to spec:
- https://www.w3.org/TR/css-transforms-1/:
  - an element whose layout is governed by the CSS box model which is either a block-level or atomic inline-level element, or whose display property computes to table-row, table-row-group, table-header-group, table-footer-group, table-cell, or table-caption [CSS2]
  - For elements whose layout is governed by the CSS box model, any value other than none for the transform also causes the element to become a containing block

The tr should establish a containing block for the absolute-position descendant.

Currently we don't treat the tr as the containing block, but we do apply the transform to the absolute-position descendant. The current behavior is inconsistent about how the transform applies to descendants, and it's also hard to implement this behavior in SPv175 (see  bug 804467 ).

Test case: http://jsbin.com/cemigih

Compatibility analysis:

Other browsers:
- Edge: doesn't support transform on tr.
- Firefox: treat transformed tr as the containing block of out-of-flow positioned descendants.

Real-world usage: zero usage[1] in 100k top pages (https://ct.skia.org/results/cluster-telemetry/tasks/benchmark_runs/wangxianzhu-20180122213656/consolidated_outputs/wangxianzhu-20180122213656.output)

[1] Criterion: object.StyleRef().CanContainFixedPositionObjects() && !object.CanContainFixedPositionObjects().
 
Owner: vmp...@chromium.org
Status: Assigned (was: Available)
Cc: vmp...@chromium.org
Owner: wangxianzhu@chromium.org
I have created a prototype CL which seems to work. Will upload it soon.
Two similar ongoing things to keep in mind:
You aware of  bug 795549 , which is about filters becoming containing blocks?
Also, there has been a recent attempt to support position:relative on table components (so that they become containing blocks for absolutely positioned descendant, but not for fixed-positioned ones), but it got reverted here: https://chromium-review.googlesource.com/875015
Cc: -vmp...@chromium.org wangxianzhu@chromium.org
Owner: vmp...@chromium.org
I think vmpstr@ is the better owner of this bug because it's related his recent works.

Comment 6 by vmp...@chromium.org, Jan 25 2018

Blockedon: 805996
Project Member

Comment 7 by bugdroid1@chromium.org, Jan 25 2018

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

commit e5214927c9d079ff414fbe06dab8f98655cf0641
Author: Vladimir Levin <vmpstr@chromium.org>
Date: Thu Jan 25 19:38:36 2018

[PE] Fix DCHECKs that trigger on a transformed tr with abspos div.

The code in place handles cases where the container is a TableSection
with a transform. Extend this to also work when the container is a
TableRow with a transform. In general, this patch changes IsTableSection
to IsTablePart to handle any part of the table that can be a container.

This also changes the EnclosingIntRect to RoundedIntRect in a DCHECK,
since offsets under EnclosingIntRect are susceptible to int differences
when the source has small floating point changes. For example,
-1.0000028610 offset in one rect becomes -2, but
-1.0000000000 stays -1.

R=chrishtr@chromium.org

Bug:  804952 
Change-Id: Ibc1e062953c1c6bc436101705d4842209e6af707
Reviewed-on: https://chromium-review.googlesource.com/884681
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: vmpstr <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531977}
[modify] https://crrev.com/e5214927c9d079ff414fbe06dab8f98655cf0641/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
[modify] https://crrev.com/e5214927c9d079ff414fbe06dab8f98655cf0641/third_party/WebKit/Source/core/layout/LayoutGeometryMap.cpp
[modify] https://crrev.com/e5214927c9d079ff414fbe06dab8f98655cf0641/third_party/WebKit/Source/core/layout/LayoutObject.cpp

Comment 8 by mar...@chromium.org, Jan 26 2018

Blocking: -804667
Issue 804667 is unrelated, removing as blocking.
Blocking: 804467
Sorry, the blocked bug number should be  bug 804467 .
Project Member

Comment 10 by bugdroid1@chromium.org, Jan 29 2018

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

commit 698540a37178642814cb231974bcf8cd95d332f8
Author: Vladimir Levin <vmpstr@chromium.org>
Date: Mon Jan 29 21:00:19 2018

[TransTableContainer] Add WPT tests for trasformed table parts containing fixpos

This patch adds WPT tests for testing whether transformed table parts contain
fixed position elements as specced in:

https://www.w3.org/TR/css-transforms-1/#transformable-element
https://www.w3.org/TR/css-transforms-1/#transform-rendering

R=chrishtr@chromium.org

Bug:  804952 ,  805996 
Change-Id: I2701e7abffddc67ad4ee206948361acfb28cecd1
Reviewed-on: https://chromium-review.googlesource.com/887364
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: vmpstr <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532584}
[modify] https://crrev.com/698540a37178642814cb231974bcf8cd95d332f8/third_party/WebKit/LayoutTests/TestExpectations
[add] https://crrev.com/698540a37178642814cb231974bcf8cd95d332f8/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/transform-transformed-caption-contains-fixed-position-ref.html
[add] https://crrev.com/698540a37178642814cb231974bcf8cd95d332f8/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/transform-transformed-caption-contains-fixed-position.html
[add] https://crrev.com/698540a37178642814cb231974bcf8cd95d332f8/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/transform-transformed-tbody-contains-fixed-position-ref.html
[add] https://crrev.com/698540a37178642814cb231974bcf8cd95d332f8/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/transform-transformed-tbody-contains-fixed-position.html
[add] https://crrev.com/698540a37178642814cb231974bcf8cd95d332f8/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/transform-transformed-td-contains-fixed-position-ref.html
[add] https://crrev.com/698540a37178642814cb231974bcf8cd95d332f8/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/transform-transformed-td-contains-fixed-position.html
[add] https://crrev.com/698540a37178642814cb231974bcf8cd95d332f8/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/transform-transformed-tfoot-contains-fixed-position-ref.html
[add] https://crrev.com/698540a37178642814cb231974bcf8cd95d332f8/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/transform-transformed-tfoot-contains-fixed-position.html
[add] https://crrev.com/698540a37178642814cb231974bcf8cd95d332f8/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/transform-transformed-th-contains-fixed-position-ref.html
[add] https://crrev.com/698540a37178642814cb231974bcf8cd95d332f8/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/transform-transformed-th-contains-fixed-position.html
[add] https://crrev.com/698540a37178642814cb231974bcf8cd95d332f8/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/transform-transformed-thead-contains-fixed-position-ref.html
[add] https://crrev.com/698540a37178642814cb231974bcf8cd95d332f8/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/transform-transformed-thead-contains-fixed-position.html
[add] https://crrev.com/698540a37178642814cb231974bcf8cd95d332f8/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/transform-transformed-tr-contains-fixed-position-ref.html
[add] https://crrev.com/698540a37178642814cb231974bcf8cd95d332f8/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/transform-transformed-tr-contains-fixed-position.html

Project Member

Comment 11 by bugdroid1@chromium.org, Jan 31 2018

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

commit 1b860735f6a25bcf074228e51e749c1e4b38551c
Author: Vladimir Levin <vmpstr@chromium.org>
Date: Wed Jan 31 20:16:25 2018

[TransTableContainer] Make table parts with transforms be containers.

This patch makes table parts that have transforms be containing blocks
for fixed position elements.

Intent to implement and ship:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/dnvWXuX70YE

This also updates LayoutTests to enable the previously failing WPT. As well,
it rebaselines the transformed table with abspos child since it was being
generated by the previous code and wasn't quite correct (the rotation is
slightly off).

R=chrishtr@chromium.org, mstensho@chromium.org

Bug:  804952 
Change-Id: I21e70f1146edb4cc508e0cc796f58e0c1295960b
Reviewed-on: https://chromium-review.googlesource.com/892018
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Commit-Queue: vmpstr <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533377}
[modify] https://crrev.com/1b860735f6a25bcf074228e51e749c1e4b38551c/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/1b860735f6a25bcf074228e51e749c1e4b38551c/third_party/WebKit/LayoutTests/tables/table-transform-absolute-position-child-expected.png
[modify] https://crrev.com/1b860735f6a25bcf074228e51e749c1e4b38551c/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
[modify] https://crrev.com/1b860735f6a25bcf074228e51e749c1e4b38551c/third_party/WebKit/Source/core/layout/LayoutObject.cpp
[modify] https://crrev.com/1b860735f6a25bcf074228e51e749c1e4b38551c/third_party/WebKit/Source/core/layout/LayoutTableBoxComponent.cpp
[modify] https://crrev.com/1b860735f6a25bcf074228e51e749c1e4b38551c/third_party/WebKit/Source/core/layout/LayoutTableBoxComponent.h

Blocking: -804467 771643
Still investigating the sizing issue. It seems that although the table part like a row is a container for the purposes of location and transform, it isn't using the row dimensions to determine percent-dimensions of the out of flow pos children. It uses the table dimensions instead. This is true even if the table is located within a "real" containing block like a transformed div. Ie, the sizing information is not grabbed from the next containing block, but from what looks like the table itself.
Project Member

Comment 14 by bugdroid1@chromium.org, Feb 2 2018

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

commit 420ffd70631b3694288f1d9999e1b01a8fabbfca
Author: Vladimir Levin <vmpstr@chromium.org>
Date: Fri Feb 02 01:07:43 2018

[TransTableContainer] Ensure that percent height children use right value.

This patch ensures that the transformed table parts that act as
containing blocks also do so for percent width/height children.

R=wangxianzhu@chromium.org, chrishtr@chromium.org

Bug:  804952 
Change-Id: Idf01cd98094e59639f2833f42909eac2dccaac3b
Reviewed-on: https://chromium-review.googlesource.com/896822
Commit-Queue: vmpstr <vmpstr@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533883}
[add] https://crrev.com/420ffd70631b3694288f1d9999e1b01a8fabbfca/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/transform-transformed-tr-percent-height-child-ref.html
[add] https://crrev.com/420ffd70631b3694288f1d9999e1b01a8fabbfca/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/transform-transformed-tr-percent-height-child.html
[modify] https://crrev.com/420ffd70631b3694288f1d9999e1b01a8fabbfca/third_party/WebKit/Source/core/layout/LayoutBox.cpp

Status: Fixed (was: Assigned)
Cc: trchen@chromium.org
 Issue 804467  has been merged into this issue.

Sign in to add a comment