-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[anchor-position] Make 'anchor-scroll' internal
See w3c/csswg-drafts#8675 for context. This patch: 1. Changes the implementation to longer expose `anchor-scroll` as a CSS property, but use the target of `anchor-default` for scrolling purposes 2. Coverts tests and UA style to stop using `anchor-scroll`. The usage is either simply removed if there's already a default anchor, or changed to use `anchor-default` otherwise. The cases that assume different `anchor-scroll` and `anchor-default` targets are removed since they will no longer be a possible. To minimize diff, this patch focuses on the implementation change. A follow up patch will convert all in-code documentations and rename existing classes/functions to stop referring to the functionality as "anchor-scroll", and hence, stop the naming confusion. Bug: 1463085 Change-Id: I3cb2000de67b2b81b4edf8b9a1303de682946232
- Loading branch information
1 parent
86b4ccd
commit 47268e7
Showing
47 changed files
with
81 additions
and
139 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
width: 100px; | ||
height: 100px; | ||
background: lime; | ||
anchor-scroll: --a; | ||
anchor-default: --a; | ||
} | ||
|
||
body { | ||
|
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 |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
width: 100px; | ||
height: 100px; | ||
background: lime; | ||
anchor-scroll: --a; | ||
anchor-default: --a; | ||
} | ||
|
||
body { | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<!DOCTYPE html> | ||
<title>Basic of anchor-scroll: anchored elements should be "pinned" to the anchor when anchor is scrolled</title> | ||
<title>Basic of anchor positioned scrolling: anchored elements should be "pinned" to the anchor when anchor is scrolled</title> | ||
<link rel="author" href="mailto:[email protected]"> | ||
<link rel="help" href="https://drafts.csswg.org/css-anchor-1/"> | ||
<link rel="match" href="reference/anchor-scroll-ref.html"> | ||
|
@@ -40,15 +40,15 @@ | |
position: absolute; | ||
left: anchor(--anchor left); | ||
bottom: anchor(--anchor top); | ||
anchor-scroll: --anchor; | ||
anchor-default: --anchor; | ||
} | ||
|
||
#outer-anchored { | ||
color: yellow; | ||
position: absolute; | ||
left: anchor(--anchor left); | ||
top: anchor(--anchor bottom); | ||
anchor-scroll: --anchor; | ||
anchor-default: --anchor; | ||
} | ||
</style> | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<!DOCTYPE html> | ||
<title>Tests anchor-scroll resolving name conflicts</title> | ||
<title>Tests anchor positioned scrolling resolving name conflicts</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-anchor-position-1/#scroll"> | ||
<link rel="author" href="mailto:[email protected]"> | ||
<script src="/resources/testharness.js"></script> | ||
|
@@ -45,7 +45,7 @@ | |
height: 50px; | ||
top: anchor(--a1 top); | ||
left: anchor(--a1 right); | ||
anchor-scroll: --a1; | ||
anchor-default: --a1; | ||
} | ||
</style> | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<!DOCTYPE html> | ||
<title>Tests anchor-scroll with fragmented containing block</title> | ||
<title>Tests anchor positioned scrolling with fragmented containing block</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-anchor-position-1/#scroll"> | ||
<link rel="author" href="mailto:[email protected]"> | ||
<script src="/resources/testharness.js"></script> | ||
|
@@ -47,7 +47,7 @@ | |
position: absolute; | ||
left: anchor(--a left); | ||
bottom: anchor(--a top); | ||
anchor-scroll: --a; | ||
anchor-default: --a; | ||
width: 50px; | ||
height: 50px; | ||
background: lime; | ||
|
@@ -72,5 +72,5 @@ | |
|
||
let targetRect = target.getBoundingClientRect(); | ||
assert_equals(targetRect.top, 30); | ||
}, 'anchor-scroll should work in fragmented containing block'); | ||
}, 'Scrolling should work in fragmented containing block'); | ||
</script> |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>Tests anchor-scroll with relatively positioned inline containers</title> | ||
<title>Tests anchor positioned scrolling with relatively positioned inline containers</title> | ||
<link rel="help" href="https://drafts4.csswg.org/css-anchor-position-1/#scroll"> | ||
<link rel="author" href="mailto:[email protected]"> | ||
<link rel="stylesheet" href="/fonts/ahem.css"> | ||
|
@@ -32,7 +32,7 @@ | |
|
||
.target { | ||
position: absolute; | ||
anchor-scroll: --a; | ||
anchor-default: --a; | ||
top: anchor(--a bottom); | ||
left: anchor(--a left); | ||
color: lime; | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<!DOCTYPE html> | ||
<title>Tests 'anchor-scroll' with anchor in fixed-positioned scroller</title> | ||
<title>Tests scrolling with anchor in fixed-positioned scroller</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-anchor-position-1/#scroll"> | ||
<link rel="author" href="mailto:[email protected]"> | ||
<script src="/resources/testharness.js"></script> | ||
|
@@ -33,7 +33,7 @@ | |
width: 100px; | ||
height: 100px; | ||
bottom: anchor(--a top); | ||
anchor-scroll: --a; | ||
anchor-default: --a; | ||
background: lime; | ||
} | ||
</style> | ||
|
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<!DOCTYPE html> | ||
<title>Tests that anchor-scroll doesn't crash renderer when anchor is in a scroller whose content doesn't overflow</title> | ||
<title>Tests that scrolling doesn't crash renderer when anchor is in a scroller whose content doesn't overflow</title> | ||
<link rel="author" href="mailto:[email protected]"> | ||
<link rel="help" href="https://drafts.csswg.org/css-anchor-1/"> | ||
<style> | ||
|
@@ -23,7 +23,7 @@ | |
|
||
#anchored { | ||
position: absolute; | ||
anchor-scroll: --a; | ||
anchor-default: --a; | ||
left: anchor(--a left); | ||
bottom: anchor(--a top); | ||
width: 100px; | ||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<!DOCTYPE html> | ||
<html class="test-wait"> | ||
<title>Tests that anchor-scroll doesn't crash renderer when scroller's content no longer overflows</title> | ||
<title>Tests that scrolling doesn't crash renderer when scroller's content no longer overflows</title> | ||
<link rel="author" href="mailto:[email protected]"> | ||
<link rel="help" href="https://drafts.csswg.org/css-anchor-1/"> | ||
|
||
|
@@ -23,7 +23,7 @@ | |
position: fixed; | ||
top: anchor(--a bottom); | ||
left: anchor(--a left); | ||
anchor-scroll: --a; | ||
anchor-default: --a; | ||
} | ||
</style> | ||
|
||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<!DOCTYPE html> | ||
<html class="test-wait"> | ||
<title>Tests that anchor-scroll doesn't crash renderer when scroller becomes non-scroller</title> | ||
<title>Tests that scrolling doesn't crash renderer when scroller becomes non-scroller</title> | ||
<link rel="author" href="mailto:[email protected]"> | ||
<link rel="help" href="https://drafts.csswg.org/css-anchor-1/"> | ||
|
||
|
@@ -23,7 +23,7 @@ | |
position: fixed; | ||
top: anchor(--a bottom); | ||
left: anchor(--a left); | ||
anchor-scroll: --a; | ||
anchor-default: --a; | ||
} | ||
</style> | ||
|
||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<!DOCTYPE html> | ||
<html class="test-wait"> | ||
<title>Tests that anchor-scroll doesn't crash renderer when scroller's content no longer overflows, and target precedes scroller in DOM</title> | ||
<title>Tests that scrolling doesn't crash renderer when scroller's content no longer overflows, and target precedes scroller in DOM</title> | ||
<link rel="author" href="mailto:[email protected]"> | ||
<link rel="help" href="https://drafts.csswg.org/css-anchor-1/"> | ||
|
||
|
@@ -23,7 +23,7 @@ | |
position: fixed; | ||
top: anchor(--a bottom); | ||
left: anchor(--a left); | ||
anchor-scroll: --a; | ||
anchor-default: --a; | ||
} | ||
</style> | ||
|
||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<!DOCTYPE html> | ||
<html class="test-wait"> | ||
<title>Tests that anchor-scroll doesn't crash renderer with `overflow: hidden` scroller</title> | ||
<title>Tests that scrolling doesn't crash renderer with `overflow: hidden` scroller</title> | ||
<link rel="author" href="mailto:[email protected]"> | ||
<link rel="help" href="https://drafts.csswg.org/css-anchor-1/"> | ||
|
||
|
@@ -23,7 +23,7 @@ | |
position: fixed; | ||
top: anchor(--a bottom); | ||
left: anchor(--a left); | ||
anchor-scroll: --a; | ||
anchor-default: --a; | ||
} | ||
</style> | ||
|
||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<!DOCTYPE html> | ||
<html class="reftest-wait"> | ||
<title>Tests anchor-scroll element paint order in composited scrolling</title> | ||
<title>Tests anchor-positioned element paint order in composited scrolling</title> | ||
<link rel="help" href="https://drafts4.csswg.org/css-anchor-position-1/#scroll"> | ||
<link rel="author" href="mailto:[email protected]"> | ||
<link rel="match" href="reference/anchor-scroll-composited-scrolling-006-ref.html"> | ||
|
@@ -29,7 +29,7 @@ | |
background: red; | ||
left: 0; | ||
bottom: anchor(--a top); | ||
anchor-scroll: --a; | ||
anchor-default: --a; | ||
} | ||
#overlap { | ||
position: absolute; | ||
|
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
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
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
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
Oops, something went wrong.