Skip to content

Commit

Permalink
Missing layout invalidation for position-fallback changes
Browse files Browse the repository at this point in the history
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
lilles authored and chromium-wpt-export-bot committed Nov 12, 2022
1 parent f4245eb commit a6e9e43
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions css/css-anchor-position/position-fallback-dynamic.html
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>

4 comments on commit a6e9e43

@community-tc-integration
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh oh! Looks like an error! Details

HttpError: You have exceeded a secondary rate limit. Please wait a few minutes before you try again.

@community-tc-integration
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh oh! Looks like an error! Details

HttpError: You have exceeded a secondary rate limit. Please wait a few minutes before you try again.

@community-tc-integration
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh oh! Looks like an error! Details

HttpError: You have exceeded a secondary rate limit. Please wait a few minutes before you try again.

@community-tc-integration
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh oh! Looks like an error! Details

HttpError: You have exceeded a secondary rate limit. Please wait a few minutes before you try again.

Please sign in to comment.