Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-anchor-1] Change anchor-scroll's initial value to default #8844

Closed
xiaochengh opened this issue May 15, 2023 · 0 comments · Fixed by #8846
Closed

[css-anchor-1] Change anchor-scroll's initial value to default #8844

xiaochengh opened this issue May 15, 2023 · 0 comments · Fixed by #8846

Comments

@xiaochengh
Copy link
Contributor

xiaochengh commented May 15, 2023

I think it's better if anchor-scroll's initial value is default, so that as long as we are using anchor-default or implicit anchor, we don't need to explicitly set the value of anchor-scroll.

This would allow the basic usage pattern to be very simple, where anchor-scroll is automatically hooked up:

.anchor { anchor-name: --my-anchor; }
.target {
  position: fixed;
  anchor-default: --my-anchor;
  top: anchor(bottom);
  left: anchor(left);
}

Also:

So it's not a very ergonomic design, and if we can avoid it from a use case, avoid it.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue May 17, 2023
Implements spec change w3c/csswg-drafts#8844

This also means that almost all elements will have
`anchor-scroll: default`. To avoid creating an AnchorScrollData for
all of them, this patch tightens the condition by also checking if
there's an implicit anchor element.

Note: this patch will make LayoutObject::StyleDidChange() check the
existence of an implicit anchor for every OOF. I assume that OOF
elements are rare, so this shouldn't cause a performance regression.
In case it does, we can add anElementFlag to indicate whether there's
an implicit anchor.

Bug: 1309178
Change-Id: I128daa25dd3828586a9e01733166e35c0ad3f363
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue May 17, 2023
Implements spec change w3c/csswg-drafts#8844

This also means that almost all elements will have
`anchor-scroll: default`. To avoid creating an AnchorScrollData for
all of them, this patch tightens the condition by also checking if
there's an implicit anchor element.

Note: this patch will make LayoutObject::StyleDidChange() check the
existence of an implicit anchor for every OOF. I assume that OOF
elements are rare, so this shouldn't cause a performance regression.
In case it does, we can add anElementFlag to indicate whether there's
an implicit anchor.

Bug: 1309178
Change-Id: I128daa25dd3828586a9e01733166e35c0ad3f363
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue May 18, 2023
Implements spec change w3c/csswg-drafts#8844

This also means that almost all elements will have
`anchor-scroll: default`. To avoid creating an AnchorScrollData for
all of them, this patch tightens the condition by also checking if
there's an implicit anchor element.

Note: this patch will make LayoutObject::StyleDidChange() check the
existence of an implicit anchor for every OOF. I assume that OOF
elements are rare, so this shouldn't cause a performance regression.
In case it does, we can add anElementFlag to indicate whether there's
an implicit anchor.

Bug: 1309178
Change-Id: I128daa25dd3828586a9e01733166e35c0ad3f363
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4538691
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1146041}
aarongable pushed a commit to chromium/chromium that referenced this issue May 18, 2023
Implements spec change w3c/csswg-drafts#8844

This also means that almost all elements will have
`anchor-scroll: default`. To avoid creating an AnchorScrollData for
all of them, this patch tightens the condition by also checking if
there's an implicit anchor element.

Note: this patch will make LayoutObject::StyleDidChange() check the
existence of an implicit anchor for every OOF. I assume that OOF
elements are rare, so this shouldn't cause a performance regression.
In case it does, we can add anElementFlag to indicate whether there's
an implicit anchor.

Bug: 1309178
Change-Id: I128daa25dd3828586a9e01733166e35c0ad3f363
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4538691
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1146041}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue May 18, 2023
Implements spec change w3c/csswg-drafts#8844

This also means that almost all elements will have
`anchor-scroll: default`. To avoid creating an AnchorScrollData for
all of them, this patch tightens the condition by also checking if
there's an implicit anchor element.

Note: this patch will make LayoutObject::StyleDidChange() check the
existence of an implicit anchor for every OOF. I assume that OOF
elements are rare, so this shouldn't cause a performance regression.
In case it does, we can add anElementFlag to indicate whether there's
an implicit anchor.

Bug: 1309178
Change-Id: I128daa25dd3828586a9e01733166e35c0ad3f363
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4538691
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1146041}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue May 25, 2023
…f `anchor-scroll` to default, a=testonly

Automatic update from web-platform-tests
[anchor-position] Change initial value of `anchor-scroll` to default

Implements spec change w3c/csswg-drafts#8844

This also means that almost all elements will have
`anchor-scroll: default`. To avoid creating an AnchorScrollData for
all of them, this patch tightens the condition by also checking if
there's an implicit anchor element.

Note: this patch will make LayoutObject::StyleDidChange() check the
existence of an implicit anchor for every OOF. I assume that OOF
elements are rare, so this shouldn't cause a performance regression.
In case it does, we can add anElementFlag to indicate whether there's
an implicit anchor.

Bug: 1309178
Change-Id: I128daa25dd3828586a9e01733166e35c0ad3f363
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4538691
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1146041}

--

wpt-commits: 1cf9ec81e77991d6f30f951653d3ef62af561fa6
wpt-pr: 40045
ErichDonGubler pushed a commit to erichdongubler-mozilla/firefox that referenced this issue May 27, 2023
…f `anchor-scroll` to default, a=testonly

Automatic update from web-platform-tests
[anchor-position] Change initial value of `anchor-scroll` to default

Implements spec change w3c/csswg-drafts#8844

This also means that almost all elements will have
`anchor-scroll: default`. To avoid creating an AnchorScrollData for
all of them, this patch tightens the condition by also checking if
there's an implicit anchor element.

Note: this patch will make LayoutObject::StyleDidChange() check the
existence of an implicit anchor for every OOF. I assume that OOF
elements are rare, so this shouldn't cause a performance regression.
In case it does, we can add anElementFlag to indicate whether there's
an implicit anchor.

Bug: 1309178
Change-Id: I128daa25dd3828586a9e01733166e35c0ad3f363
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4538691
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1146041}

--

wpt-commits: 1cf9ec81e77991d6f30f951653d3ef62af561fa6
wpt-pr: 40045
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue May 31, 2023
…f `anchor-scroll` to default, a=testonly

Automatic update from web-platform-tests
[anchor-position] Change initial value of `anchor-scroll` to default

Implements spec change w3c/csswg-drafts#8844

This also means that almost all elements will have
`anchor-scroll: default`. To avoid creating an AnchorScrollData for
all of them, this patch tightens the condition by also checking if
there's an implicit anchor element.

Note: this patch will make LayoutObject::StyleDidChange() check the
existence of an implicit anchor for every OOF. I assume that OOF
elements are rare, so this shouldn't cause a performance regression.
In case it does, we can add anElementFlag to indicate whether there's
an implicit anchor.

Bug: 1309178
Change-Id: I128daa25dd3828586a9e01733166e35c0ad3f363
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4538691
Commit-Queue: Xiaocheng Hu <xiaochenghchromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrickchromium.org>
Cr-Commit-Position: refs/heads/main{#1146041}

--

wpt-commits: 1cf9ec81e77991d6f30f951653d3ef62af561fa6
wpt-pr: 40045

UltraBlame original commit: 613d21f00edda9d93608d0de4cb8614df3f4f2c2
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue May 31, 2023
…f `anchor-scroll` to default, a=testonly

Automatic update from web-platform-tests
[anchor-position] Change initial value of `anchor-scroll` to default

Implements spec change w3c/csswg-drafts#8844

This also means that almost all elements will have
`anchor-scroll: default`. To avoid creating an AnchorScrollData for
all of them, this patch tightens the condition by also checking if
there's an implicit anchor element.

Note: this patch will make LayoutObject::StyleDidChange() check the
existence of an implicit anchor for every OOF. I assume that OOF
elements are rare, so this shouldn't cause a performance regression.
In case it does, we can add anElementFlag to indicate whether there's
an implicit anchor.

Bug: 1309178
Change-Id: I128daa25dd3828586a9e01733166e35c0ad3f363
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4538691
Commit-Queue: Xiaocheng Hu <xiaochenghchromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrickchromium.org>
Cr-Commit-Position: refs/heads/main{#1146041}

--

wpt-commits: 1cf9ec81e77991d6f30f951653d3ef62af561fa6
wpt-pr: 40045

UltraBlame original commit: 613d21f00edda9d93608d0de4cb8614df3f4f2c2
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue May 31, 2023
…f `anchor-scroll` to default, a=testonly

Automatic update from web-platform-tests
[anchor-position] Change initial value of `anchor-scroll` to default

Implements spec change w3c/csswg-drafts#8844

This also means that almost all elements will have
`anchor-scroll: default`. To avoid creating an AnchorScrollData for
all of them, this patch tightens the condition by also checking if
there's an implicit anchor element.

Note: this patch will make LayoutObject::StyleDidChange() check the
existence of an implicit anchor for every OOF. I assume that OOF
elements are rare, so this shouldn't cause a performance regression.
In case it does, we can add anElementFlag to indicate whether there's
an implicit anchor.

Bug: 1309178
Change-Id: I128daa25dd3828586a9e01733166e35c0ad3f363
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4538691
Commit-Queue: Xiaocheng Hu <xiaochenghchromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrickchromium.org>
Cr-Commit-Position: refs/heads/main{#1146041}

--

wpt-commits: 1cf9ec81e77991d6f30f951653d3ef62af561fa6
wpt-pr: 40045

UltraBlame original commit: 613d21f00edda9d93608d0de4cb8614df3f4f2c2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant