Open Bug 1995242 Opened 11 months ago Updated 7 months ago

Surface parent value of user-select when computed value of user-select is auto

Categories

(DevTools :: Inspector, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: nchevobbe, Unassigned)

References

Details

If you navigate to data:text/html,<meta charset=utf8><style>body { user-select: none; }</style><h1>Hello you won't be able to select the h1 text
Opening the inspector, if you inspect the <h1> element and look for the user-select value in the computed panel (after clicking "Browser Styles"),
you will only see user-select: auto.
There's no further section that would explain where the value comes from.
The rules view is empty, as user-select is not an inherited property (so we don't show the declaration on the body rule)

According to https://developer.mozilla.org/en-US/docs/Web/CSS/user-select:

Note: user-select is not an inherited property, though the initial auto value makes it behave like it is inherited most of the time.

(see https://developer.mozilla.org/en-US/docs/Web/CSS/user-select#auto)

Since the value is ultimately derived from the parent element value, it would be nice to surface this somewhere in the UI

Chrome does show the user-select none as inherited from the body, which might be technically incorrect, but is useful for end users. Could do the same here.

Priority: -- → P3

(In reply to Julian Descottes [:jdescottes] from comment #1)

Chrome does show the user-select none as inherited from the body, which might be technically incorrect, but is useful for end users. Could do the same here.

That's because they literally implement user-select this way (as an inherited property), which is incorrect. That's tracked in https://issues.chromium.org/issues/40499963 which probably needs a bump.

You need to log in before you can comment on or make changes to this bug.