-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Missing layout invalidation for position-fallback changes
When the position-fallback property changes, the layout may change. Add the property to computed_style_diff_functions.json5. Bug: 1381609 Change-Id: I3d3d88ef7cbb512ca4e6ca3ad0213d8b872bd9a9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4020512 Commit-Queue: Rune Lillesveen <futhark@chromium.org> Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/main@{#1070568}
- Loading branch information
Rune Lillesveen
authored and
Chromium LUCI CQ
committed
Nov 11, 2022
1 parent
5effd94
commit dcc4b23
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...party/blink/web_tests/external/wpt/css/css-anchor-position/position-fallback-dynamic.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!DOCTYPE html> | ||
<title>CSS Anchor Positioning Test: Dynamically change position via position-fallback property</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-anchor-1/#fallback"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<style> | ||
body { margin: 0; } | ||
|
||
@position-fallback --fallback1 { | ||
@try { | ||
left: anchor(--a1 right); | ||
} | ||
} | ||
#anchor { | ||
anchor-name: --a1; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
#anchored { | ||
position: absolute; | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
<div id="anchor"></div> | ||
<div id="anchored"></div> | ||
<script> | ||
test(() => { | ||
assert_equals(anchored.offsetLeft, 0); | ||
}, "Initial static left position is 0"); | ||
|
||
test(() => { | ||
anchored.style.positionFallback = "--fallback1"; | ||
assert_equals(anchored.offsetLeft, 100); | ||
}, "Left position set to right edge of anchor with @position-fallback"); | ||
</script> |