Correct traversal of transform tree ancestors.
This code is only used when the TransformInterop feature is enabled. The added test fails prior to the patch, with the TransformInterop feature enabled, but passes either with the patch or without the TransformInterop feature enabled. Change-Id: I087c478c744531aa6120304e4e7df8ba35e2c0fb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2774638 Commit-Queue: L. David Baron <dbaron@chromium.org> Reviewed-by: Philip Rogers <pdr@chromium.org> Cr-Commit-Position: refs/heads/master@{#864565}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
e37b1ea8a8
commit
cc62deee43
cc/trees
third_party/blink/web_tests/external/wpt/css/css-transforms
@ -412,15 +412,23 @@ bool IsTransformToRootOf3DRenderingContextBackFaceVisible(
|
||||
|
||||
const TransformNode& transform_node =
|
||||
*transform_tree.Node(transform_tree_index);
|
||||
if (transform_node.delegates_to_parent_for_backface)
|
||||
const TransformNode* root_node = &transform_node;
|
||||
if (transform_node.delegates_to_parent_for_backface) {
|
||||
transform_tree_index = transform_node.parent_id;
|
||||
root_node = transform_tree.Node(transform_tree_index);
|
||||
}
|
||||
|
||||
int root_id = transform_tree_index;
|
||||
int sorting_context_id = transform_node.sorting_context_id;
|
||||
|
||||
while (root_id > 0 && transform_tree.Node(root_id - 1)->sorting_context_id ==
|
||||
sorting_context_id)
|
||||
root_id--;
|
||||
while (root_id > TransformTree::kRootNodeId) {
|
||||
int parent_id = root_node->parent_id;
|
||||
const TransformNode* parent_node = transform_tree.Node(parent_id);
|
||||
if (parent_node->sorting_context_id != sorting_context_id)
|
||||
break;
|
||||
root_id = parent_id;
|
||||
root_node = parent_node;
|
||||
}
|
||||
|
||||
// TODO(chrishtr): cache this on the transform trees if needed, similar to
|
||||
// |to_target| and |to_screen|.
|
||||
@ -428,8 +436,7 @@ bool IsTransformToRootOf3DRenderingContextBackFaceVisible(
|
||||
if (transform_tree_index != root_id)
|
||||
property_trees->transform_tree.CombineTransformsBetween(
|
||||
transform_tree_index, root_id, &to_3d_root);
|
||||
to_3d_root.PreconcatTransform(
|
||||
property_trees->transform_tree.Node(root_id)->to_parent);
|
||||
to_3d_root.PreconcatTransform(root_node->to_parent);
|
||||
return to_3d_root.IsBackFaceVisible();
|
||||
}
|
||||
|
||||
|
44
third_party/blink/web_tests/external/wpt/css/css-transforms/backface-visibility-with-sibling-001.html
vendored
Normal file
44
third_party/blink/web_tests/external/wpt/css/css-transforms/backface-visibility-with-sibling-001.html
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>backface-visibility test</title>
|
||||
<link rel="author" title="L. David Baron" href="https://dbaron.org/">
|
||||
<link rel="author" title="Google" href="http://www.google.com/">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-transforms-2/#3d-transform-rendering">
|
||||
<link rel="match" href="/common/blank.html">
|
||||
<meta name="assert" content="The backface-visibility property still works correctly when there is an element outside the 3-D rendering context that is, in tree order, in between the element with backface-visibility and the root of the 3-D Rendering Context">
|
||||
|
||||
<style>
|
||||
|
||||
div {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
#outer {
|
||||
transform-style: preserve-3d;
|
||||
transform: rotateX(120deg);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#outer > div {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
#grandchild {
|
||||
transform: translateZ(1px);
|
||||
}
|
||||
|
||||
#child2 {
|
||||
transform-style: preserve-3d;
|
||||
transform: translateX(0);
|
||||
backface-visibility: hidden;
|
||||
background: red;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="outer">
|
||||
<div id="child1"><div id="grandchild"></div></div>
|
||||
<div id="child2"></div>
|
||||
</div>
|
Reference in New Issue
Block a user