A partial archive of discourse.wicg.io as of Saturday February 24, 2024.

Standardizing selection content

stuartpb
2015-07-24

Continuing the discussion from Standardizing innerText:

Just to start the ball rolling, I’m thinking the sanest way to handle some of the most significant disagreements on selection behavior (how should whitespace be translated, should text transformations be applied) would be to add CSS rules controlling it (and then specify what the default values for those rules should be).

Such a rule would be akin to (and maybe extended from) the non-standard user-select rule. (I was originally thinking of properties on document in the DOM that could be set by script, but a CSS rule like this makes more sense, especially as it allows this behavior to be declarative and element-oriented.)

stuartpb
2015-07-24

If user-select is to be standardized (which, of course, it was on track to be at one point), one of the first key points to establish (as noted by MDN) would be its inheritance behavior. It seems most sensible to me to have it inherited down the tree, so selection behavior for the whole document can be established by setting a rule on html or body.

RickByers
2015-07-24

Note that the CSS WG has recently re-started serious efforts to standardize user-select, and blink is motivated to change our behavior to match the standard.

stuartpb
2015-07-24

Okay, looks like user-select is back on track, that’s great to see. That controls the ability to select - should there be another rule for the content of the selection? Should it span multiple rules? Should there be a shorthand for setting all of them? (if there are multiple rules the answer here is obviously yes) Should the shorthand include setting user-select? (I think they’re actually usually separate concerns, so no)

stuartpb
2015-07-27

I’ve renamed the thread to “Standardizing selection content” to differentiate it from stuff like user-select, which should be discussed in its own thread or mailing lists or something.