-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[anchor-position] Support inline fragmentation
This patch adds inline fragmentation support to the anchor positioning. The anchor rectangle will be the union of the bounding rectangles of all fragments. This is considered the most sensible option, though we may revisit in the future. This patch adds two tests, and adjust one existing test: * Ensure it works on the 2nd line of the 2nd block of the container. * One new test is about a span wrapping to two lines. In this case, one fragment for each line. * Another test is about bidi reordering creating two fragments of a span. In this case, two fragments in a line. Bug: 1309178 Change-Id: Ia0ce0a1b46d58a450548cab6dd780dfbae5d9a1a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3787752 Auto-Submit: Koji Ishii <kojii@chromium.org> Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org> Commit-Queue: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/main@{#1028600}
- Loading branch information
Showing
5 changed files
with
99 additions
and
9 deletions.
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
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
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
...arty/blink/web_tests/wpt_internal/css/css-anchor-position/anchor-position-inline-002.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> | ||
<link rel="help" href="https://tabatkins.github.io/specs/css-anchor-position/#propdef-anchor-name"> | ||
<link rel="author" href="mailto:kojii@chromium.org"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/resources/check-layout-th.js"></script> | ||
<style> | ||
#container { | ||
position: relative; | ||
font-family: Ahem; | ||
font-size: 10px; | ||
line-height: 1; | ||
width: 10em; | ||
} | ||
#anchor1 { | ||
anchor-name: --a1; | ||
} | ||
.target { | ||
position: absolute; | ||
} | ||
</style> | ||
<body onload="checkLayout('.target')"> | ||
<div id="container"> | ||
<div>spacer</div> | ||
<div> | ||
<br> | ||
<!-- The following line wraps between "5" and "7". --> | ||
0123<span id="anchor1">45 789</span>000 | ||
</div> | ||
|
||
<div class="target" style="left: anchor(--a1 left)" data-offset-x=0></div> | ||
<div class="target" style="right: anchor(--a1 right)" data-offset-x=60></div> | ||
<div class="target" style="top: anchor(--a1 top)" data-offset-y=20></div> | ||
<div class="target" style="bottom: anchor(--a1 bottom)" data-offset-y=40></div> | ||
</div> | ||
</body> |
36 changes: 36 additions & 0 deletions
36
...arty/blink/web_tests/wpt_internal/css/css-anchor-position/anchor-position-inline-003.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> | ||
<link rel="help" href="https://tabatkins.github.io/specs/css-anchor-position/#propdef-anchor-name"> | ||
<link rel="author" href="mailto:kojii@chromium.org"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/resources/check-layout-th.js"></script> | ||
<style> | ||
#container { | ||
position: relative; | ||
font-family: Ahem; | ||
font-size: 10px; | ||
line-height: 1; | ||
width: 10em; | ||
} | ||
#anchor1 { | ||
anchor-name: --a1; | ||
} | ||
.target { | ||
position: absolute; | ||
} | ||
</style> | ||
<body onload="checkLayout('.target')"> | ||
<div id="container"> | ||
<div>spacer</div> | ||
<div> | ||
<br> | ||
<!-- The bidi reordering creates two fragments of the `span` in a line. --> | ||
a<span id="anchor1">1‮2‭</span>z | ||
</div> | ||
|
||
<div class="target" style="left: anchor(--a1 left)" data-offset-x=10></div> | ||
<div class="target" style="right: anchor(--a1 right)" data-offset-x=40></div> | ||
<div class="target" style="top: anchor(--a1 top)" data-offset-y=20></div> | ||
<div class="target" style="bottom: anchor(--a1 bottom)" data-offset-y=30></div> | ||
</div> | ||
</body> |