Skip to content

Commit

Permalink
Fix 3-D Rendering Context tests to test what was intended.
Browse files Browse the repository at this point in the history
Three of the tests in this file have styles that don't match their
names, and thus duplicate other tests also in the file.  This makes the
styles match the names of the tests as I believe was intended, and thus
avoids duplicate tests that are testing the same set of conditions.

This also fixes an incorrect pass condition for one set of tests, those
testing that an intermediate DOM node causes a 3-D Rendering Context to
end.  These tests use a pair of 45deg rotations into 3-D space, and an
intermediate element that should cause these rotations to be in
different 3-D Rendering Contexts and thus be flattened separately.  When
flattened such rotations should reduce the width by sqrt(2), so two of
them, flattened separately, should reduce the width by half.  This
matches the result for the (not previously tested) case of an element in
the normal flow, but produces two new failures for the absolute and
fixed position cases.

Since one of the tests now has a part that fails, this splits that test
into three so the parts can independently report pass or fail.

The bug on the two parts that fail is https://crbug.com/1189985.

Change-Id: I4bec597318a7054f5a1d8a01b9b2d663fa53658a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2774435
Reviewed-by: Chris Harrelson <[email protected]>
Commit-Queue: L. David Baron <[email protected]>
Cr-Commit-Position: refs/heads/master@{#864750}
  • Loading branch information
dbaron authored and chromium-wpt-export-bot committed Mar 19, 2021
1 parent 3afc7b5 commit a8cbe9c
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions css/css-transforms/3d-rendering-context-behavior.tentative.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
</div>

<div class="parent rotateNeg45">
<div id=fixedChildOfPreserve3D class="child rotate45" style="position: absolute"></div>
<div id=fixedChildOfPreserve3D class="child rotate45" style="position: fixed"></div>
</div>

<div class="parent rotateNeg45">
<div>
<div id=childWithIntermediate class="child rotate45" style="position: absolute"></div>
<div id=childWithIntermediate class="child rotate45"></div>
</div>
</div>

Expand All @@ -57,7 +57,7 @@
</div>

<div class="perspective">
<div id=childWithPerspectiveParent class="child rotate45" style="position: absolute"></div>
<div id=childWithPerspectiveParent class="child rotate45"></div>
<div id=absWithPerspectiveParent class="child rotate45" style="position: absolute"></div>
<div id=fixedWithPerspectiveParent class="child rotate45" style="position: fixed"></div>
</div>
Expand All @@ -78,10 +78,14 @@
}, "Direct DOM parent is root of rendering context");

test(function() {
assert_equals(childWithIntermediate.getBoundingClientRect().width, 200);
assert_equals(absWithIntermediate.getBoundingClientRect().width, 200);
assert_equals(fixedWithIntermediate.getBoundingClientRect().width, 200);
}, "Intermediate DOM nodes cause rendering context to end");
assert_equals(childWithIntermediate.getBoundingClientRect().width, 100);
}, "Intermediate DOM nodes cause rendering context to end (normal flow)");
test(function() {
assert_equals(absWithIntermediate.getBoundingClientRect().width, 100);
}, "Intermediate DOM nodes cause rendering context to end (absolute)");
test(function() {
assert_equals(fixedWithIntermediate.getBoundingClientRect().width, 100);
}, "Intermediate DOM nodes cause rendering context to end (fixed)");

test(function() {
assert_approx_equals(
Expand Down

0 comments on commit a8cbe9c

Please sign in to comment.