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-lists] The cursor property should apply to ::markers #6203

Open
pxeger opened this issue Apr 10, 2021 · 8 comments
Open

[css-lists] The cursor property should apply to ::markers #6203

pxeger opened this issue Apr 10, 2021 · 8 comments
Labels

Comments

@pxeger
Copy link

pxeger commented Apr 10, 2021

The spec for the properties which apply to ::markers does not include the cursor property. I'd like to be able to apply this to the ::marker of a summary element in particular, to give user feedback that clicking on it will do something (that is, open/close the details).

You can add cursor to the whole summary, but that also applies it to the actual content of the summary, and the blank space after the content, with no easy way to remove it there. Demo:

<style>
  summary {
    cursor: pointer;
  }
</style>
<details>
  <summary>Label</summary>
  Content
</details>
@Loirooriol
Copy link
Contributor

I already mentioned cursor in #4568 (comment). The resolution in #4568 (comment) was

If property applies to text and no dependency on box geometry it can be set on ::marker and inherits to text of marker

I guess the cursor property kinda exposes the size of the ::marker, so it depends on box geometry.

However, resetting cursor in UA origin would be bad. So it's possible to set cursor on the list item, let it inherit, and reset it for the contents of the list item. And anyways, getComputedStyle exposes the size without user interaction. So allowing cursor doesn't seem a big deal, and not allowing it is a hassle for authors.

@fantasai
Copy link
Collaborator

I think that even though this expresses the geometry, it doesn't do so in a way that would significantly break if we change how the geometry is calculated, so I think it would be safe to apply this to ::marker.

@Loirooriol
Copy link
Contributor

Thinking about this again:

I still think cursor should apply to the ::marker box itself and not just to the text inside, but I guess that in most cases the difference would be hard to tell. So just following the existing resolutions would already be an improvement.

@yisibl
Copy link
Contributor

yisibl commented Jun 11, 2024

I think the use of ::marker in details>summary is a mistake.

  1. This makes the display have to be a list-item, and by default you can't use a layout like flexbox(This means that marker cannot be placed to the right via the order property).
  2. There are only a limited number of properties that can be set in marker, you can't use transform to animate it
  3. The cursor cannot be set as mentioned in this issue.
  4. Adds additional computational and performance overhead. See Figure out some way to trigger ::marker without being a list item #6781

If we just allow the use of the cursor, we can't solve similar problems completely.

So I think a generic pseudo-element should be added, which faces the same problem as checkmark in selectlist, the current Chrome implementation (by @josepharhar ) uses ::before.

@Loirooriol
Copy link
Contributor

Sure, but allowing cursor on ::marker seems useful on actual list items too. Changing <summary> can be discussed in other issues.

@yisibl
Copy link
Contributor

yisibl commented Jun 12, 2024

Sure, but allowing cursor on ::marker seems useful on actual list items too. Changing <summary> can be discussed in other issues.

I agree.

@yisibl
Copy link
Contributor

yisibl commented Jun 12, 2024

Here is a collection of requests to support more properties in ::marker.

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [css-lists] The `cursor` property should apply to `::marker`s, and agreed to the following:

  • RESOLVED: cursor property applies to ::marker pseudo
The full IRC log of that discussion <flackr> fantasai: proposal is to allow cursor to ::marker. Technically this exposes the geometry of ::marker which we avoided in the past because we haven't defined the layout of it
<flackr> fantasai: changing the cursor a few pixels either way seems unlikley to break anything significant so it seems like it should be same to apply even though we don't know where it is
<TabAtkins> +1
<flackr> astearns: comments or questions?
<kizu> +1
<fantasai> s/same to/safe to/
<TabAtkins> (we should solve this issue more generally, but this is good as a particular change)
<ChrisL> +1 to allowing cursor in ::marker but note the list of other properties to add at the end of that issue
<ChrisL> q+
<florian> +1 to allowing it
<flackr> TabAtkins: we should figure out how to make marker have the same power as before and after in the future
<flackr> TabAtkins: we'd like to make it a real element that's just not in the tree
<astearns> ack ChrisL
<fantasai> an "element-emulating" pseudo-element :p
<flackr> ChrisL: I think it's good to add it, the last comment in the issue has a bunch of other properties which should prob be added so let's not close it off without migrating it
<flackr> astearns: links to other issues though
<flackr> Proposed resolution: cursor property applies to ::marker pseudo
<flackr> RESOLVED: cursor property applies to ::marker pseudo

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Aug 5, 2024
According to this CSSWG resolution:
w3c/csswg-drafts#6203 (comment)

Bug: 352335092
Change-Id: I5d1c2f89cabf10e397de70bd70bfbe03910a0676
aarongable pushed a commit to chromium/chromium that referenced this issue Aug 6, 2024
According to this CSSWG resolution:
w3c/csswg-drafts#6203 (comment)

Bug: 352335092
Change-Id: I5d1c2f89cabf10e397de70bd70bfbe03910a0676
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5756462
Reviewed-by: Steinar H Gunderson <sesse@chromium.org>
Commit-Queue: Oriol Brufau <obrufau@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1337776}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Aug 6, 2024
According to this CSSWG resolution:
w3c/csswg-drafts#6203 (comment)

Bug: 352335092
Change-Id: I5d1c2f89cabf10e397de70bd70bfbe03910a0676
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5756462
Reviewed-by: Steinar H Gunderson <sesse@chromium.org>
Commit-Queue: Oriol Brufau <obrufau@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1337776}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Aug 6, 2024
According to this CSSWG resolution:
w3c/csswg-drafts#6203 (comment)

Bug: 352335092
Change-Id: I5d1c2f89cabf10e397de70bd70bfbe03910a0676
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5756462
Reviewed-by: Steinar H Gunderson <sesse@chromium.org>
Commit-Queue: Oriol Brufau <obrufau@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1337776}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Aug 8, 2024
…nts, a=testonly

Automatic update from web-platform-tests
Accept 'cursor' on ::marker pseudo-elements

According to this CSSWG resolution:
w3c/csswg-drafts#6203 (comment)

Bug: 352335092
Change-Id: I5d1c2f89cabf10e397de70bd70bfbe03910a0676
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5756462
Reviewed-by: Steinar H Gunderson <sesse@chromium.org>
Commit-Queue: Oriol Brufau <obrufau@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1337776}

--

wpt-commits: 165162b51fc2d3d0cc39d930c6aed809adef58cb
wpt-pr: 47454
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this issue Aug 12, 2024
…nts, a=testonly

Automatic update from web-platform-tests
Accept 'cursor' on ::marker pseudo-elements

According to this CSSWG resolution:
w3c/csswg-drafts#6203 (comment)

Bug: 352335092
Change-Id: I5d1c2f89cabf10e397de70bd70bfbe03910a0676
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5756462
Reviewed-by: Steinar H Gunderson <sesse@chromium.org>
Commit-Queue: Oriol Brufau <obrufau@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1337776}

--

wpt-commits: 165162b51fc2d3d0cc39d930c6aed809adef58cb
wpt-pr: 47454
ErichDonGubler pushed a commit to erichdongubler-mozilla/firefox that referenced this issue Aug 19, 2024
…nts, a=testonly

Automatic update from web-platform-tests
Accept 'cursor' on ::marker pseudo-elements

According to this CSSWG resolution:
w3c/csswg-drafts#6203 (comment)

Bug: 352335092
Change-Id: I5d1c2f89cabf10e397de70bd70bfbe03910a0676
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5756462
Reviewed-by: Steinar H Gunderson <sesse@chromium.org>
Commit-Queue: Oriol Brufau <obrufau@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1337776}

--

wpt-commits: 165162b51fc2d3d0cc39d930c6aed809adef58cb
wpt-pr: 47454
Andrew-Fryer added a commit to Andrew-Fryer/WebKit that referenced this issue Aug 22, 2024
https://bugs.webkit.org/show_bug.cgi?id=277662
rdar://problem/133256523

Reviewed by NOBODY (OOPS!).

Add CSSPropertyCursor to the list of ValidMarkerStyleProperties because the CSS Working Group agreed that "cursor property applies to ::marker pseudo"
w3c/csswg-drafts#6203 (comment)

* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/marker-hit-testing-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:
* Source/WebCore/style/PropertyAllowlist.cpp:
(WebCore::Style::isValidMarkerStyleProperty):
webkit-commit-queue pushed a commit to Andrew-Fryer/WebKit that referenced this issue Aug 23, 2024
https://bugs.webkit.org/show_bug.cgi?id=277662
rdar://problem/133256523

Reviewed by Tim Nguyen.

Add CSSPropertyCursor to the list of ValidMarkerStyleProperties because the CSS Working Group agreed that "cursor property applies to ::marker pseudo"
w3c/csswg-drafts#6203 (comment)

* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/marker-hit-testing-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo/parsing/marker-supported-properties-in-animation-expected.txt:
* Source/WebCore/style/PropertyAllowlist.cpp:
(WebCore::Style::isValidMarkerStyleProperty):

Canonical link: https://commits.webkit.org/282642@main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Wednesday afternoon
Development

No branches or pull requests

6 participants