Skip to content

Commit 087b6d6

Browse files
committed
[css-ui-4] Change value mapping logic of user-select to used-value time
Closes w3c#3344
1 parent a461de9 commit 087b6d6

File tree

3 files changed

+41
-24
lines changed

3 files changed

+41
-24
lines changed

css-ui-4/Overview.bs

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,15 +1506,15 @@ avoiding accidental selections of neighbouring content.
15061506
Initial: auto
15071507
Inherited: no
15081508
Applies to: all elements, and optionally to the ''::before'' and ''::after'' pseudo elements
1509-
Computed value: See below
1509+
Computed value: specified keyword
15101510
Animation type: not animatable
15111511
</pre>
15121512

15131513
User Agents must not apply the 'user-select' property to
15141514
the ''::first-line'' and ''::first-letter'' pseudo elements.
15151515

15161516
Note: The UA may apply this property to the ''::before'' and ''::after'' pseudo elements.
1517-
If it does, ''user-select/auto'' value computes to ''user-select/none'' on these pseudos,
1517+
If it does, ''user-select/auto'' value maps to a [=used value=] of ''user-select/none'' on these pseudos,
15181518
but other values can be specified.
15191519
This preserves the legacy behavior of generated content not being selectable or copyable,
15201520
which is appropriate when these pseudos are used for decorative purposes.
@@ -1535,21 +1535,21 @@ through this mechanism,
15351535
UAs should also make this content findable through their search function.
15361536

15371537
Issue: Should it also apply to ''::marker''? To <a>page-margin boxes</a>?
1538-
Should the computed value of '''user-select/auto'' also be ''user-select/none'',
1538+
Should the [=used value=] of '''user-select/auto'' also be ''user-select/none'',
15391539
or would ''user-select/text'' be more appropriate?
15401540

1541-
The computed value is the specified value,
1541+
The [=used value=] is the same as the [=computed value=],
15421542
except:
15431543

15441544
<ol>
15451545
<li>
15461546
on <a>editable element</a>s
1547-
where the computed value is always ''user-select/contain''
1548-
regardless of the specified value
1547+
where the [=used value=] is always ''user-select/contain''
1548+
regardless of the [=computed value=]
15491549

15501550
<li>
1551-
when the specified value is ''user-select/auto'',
1552-
which computes one of the other values as defined below
1551+
when the [=computed value=] is ''user-select/auto'',
1552+
in which case the [=used value=] one of the other values as defined below
15531553
</ol>
15541554

15551555
For the purpose of this specification,
@@ -1559,41 +1559,41 @@ or a <a spec=html>mutable</a> form control with textual content,
15591559
such as <{textarea}>.
15601560

15611561
Issue: Should there be constraints
1562-
on what happens to the computed value
1562+
on what happens to the used value
15631563
on elements that are editable descendants of editing hosts?
15641564
The semantics are not obvious.
1565-
Maybe ''user-select/none'' should compute to ''user-select/text'',
1566-
or maybe all values should compute to ''user-select/text''.
1565+
Maybe ''user-select/none'' should map to ''user-select/text'',
1566+
or maybe all values should map to ''user-select/text''.
15671567

15681568
<dl dfn-type=value dfn-for=user-select>
15691569
<dt><dfn>auto</dfn>
15701570
<dd>
1571-
The computed value of ''user-select/auto'' is determined as follows:
1571+
The [=used value=] of ''user-select/auto'' is determined as follows:
15721572

15731573
<ul>
15741574
<li>
15751575
On the ''::before'' and ''::after'' pseudo elements,
1576-
the computed value is ''user-select/none''
1576+
the used value is ''user-select/none''
15771577

15781578
<li>
15791579
If the element is an <a>editable element</a>,
1580-
the computed value is ''user-select/contain''
1580+
the [=used value=] is ''user-select/contain''
15811581

15821582
<li>
15831583
Otherwise,
1584-
if the computed value of 'user-select' on the parent of this element is ''all'',
1585-
the computed value is ''all''
1584+
if the [=used value=] of 'user-select' on the parent of this element is ''all'',
1585+
the [=used value=] is ''all''
15861586

15871587
<li>
15881588
Otherwise,
1589-
if the computed value of 'user-select' on the parent of this element is ''user-select/none'',
1590-
the computed value is ''user-select/none''
1589+
if the [=used value=] of 'user-select' on the parent of this element is ''user-select/none'',
1590+
the [=used value=] is ''user-select/none''
15911591
<li>
1592-
Otherwise, the computed value is ''user-select/text''
1592+
Otherwise, the [=used value=] is ''user-select/text''
15931593
</ul>
15941594

15951595
Note: This unusual combination of a non inherited property with an initial value of ''user-select/auto''
1596-
whose computed value depends on the parent element
1596+
whose used value depends on the parent element
15971597
makes it possible to create what is effectively selective inheritance.
15981598
This was initially proposed by Microsoft in IE to introduce a behavior similar to inheritance
15991599
except that the ''user-select/contain'' value does not inherit.
@@ -1627,14 +1627,14 @@ or maybe all values should compute to ''user-select/text''.
16271627
Firefox and Internet explorer behave as prescribed in this specification
16281628
and do not create a selection at all.
16291629

1630-
However, if this element has descendants on which the computed value of 'user-select' is not ''user-select/none'',
1630+
However, if this element has descendants on which the [=used value=] of 'user-select' is not ''user-select/none'',
16311631
selections that start and end within these descendants are allowed.
16321632

16331633
The UA must allow selections to extend across this element,
16341634
and must exclude this element from such a selection.
16351635
An exception is made for UAs which do not support multiple ranges per selection,
16361636
and they may include this element.
1637-
If the element has descendants on which 'user-select' does not compute to ''user-select/none'',
1637+
If the element has descendants on which the [=used value=] of 'user-select' is not ''user-select/none'',
16381638
these descendants must be included in a selection extending across the element.
16391639
<span class=note>This specification makes no normative requirement
16401640
about the behavior of the clipboard.
@@ -1714,10 +1714,10 @@ or maybe all values should compute to ''user-select/text''.
17141714
If a selection would contain part of the element,
17151715
then the selection must contain the entire element including all its descendants.
17161716
If the element is selected
1717-
and the computed value of 'user-select' on its parent is ''all'',
1717+
and the [=used value=] of 'user-select' on its parent is ''all'',
17181718
then the parent must be included in the selection, recursively.
17191719

1720-
If this element has descendants on which the computed value of 'user-select' is not ''all''
1720+
If this element has descendants on which the [=used value=] of 'user-select' is not ''all''
17211721
and if a selection is entirely contained in these descendants,
17221722
then the selection is not extended to include this whole element.
17231723
</dl>
@@ -2146,6 +2146,7 @@ the following normative changes have been made:
21462146
<li>Moved the 'box-sizing' and 'text-overflow' properties to [[CSS-SIZING-3]] and [[CSS-OVERFLOW-4]] respectively.
21472147
<li>Changed the requirement that the ''cursor/text'' cursor matches the writing mode from MAY to MUST
21482148
<li>The definition of the appearance property has been significantly reworked to make the design compatible with existing web content
2149+
<li>The logic that mapped ''user-select: auto'' to various values at computed value time has been changed to used value time
21492150
</ul>
21502151

21512152
<h3 id=changes-22-09-2015 class=no-num>Changes from the

css-ui-4/issues-fpwd-2015.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,14 @@ <h1>CSS Basic User Interface Module Level 4 Disposition of Comments for 2015-09-
162162
Response: <a href='https://github.com/w3c/csswg-drafts/issues/3196#issuecomment-427736600'>https://github.com/w3c/csswg-drafts/issues/3196#issuecomment-427736600</a>
163163
Closed: Accepted
164164
Resolved: Editorial</pre>
165+
<pre class='a' id='issue-17'>
166+
Issue 17. <a href='#issue-17'>#</a>
167+
Summary: The computed value rules of user-select is problematic
168+
From: Emilio Cobos Álvarez
169+
Comment: <a href='https://github.com/w3c/csswg-drafts/issues/3344'>https://github.com/w3c/csswg-drafts/issues/3344</a>
170+
Response: <a href='https://github.com/w3c/csswg-drafts/issues/3344#issuecomment-466839533'>https://github.com/w3c/csswg-drafts/issues/3344#issuecomment-466839533</a>
171+
Closed: Accepted
172+
Resolved: <a href='https://github.com/w3c/csswg-drafts/issues/3344#issuecomment-467637093'>https://github.com/w3c/csswg-drafts/issues/3344#issuecomment-467637093</a></pre>
165173
<script>
166174
(function () {
167175
var sheet = document.styleSheets[0];

css-ui-4/issues-fpwd-2015.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,11 @@ Comment: https://github.com/w3c/csswg-drafts/issues/3219
138138
Response: https://github.com/w3c/csswg-drafts/issues/3196#issuecomment-427736600
139139
Closed: Accepted
140140
Resolved: Editorial
141+
----
142+
Issue 17.
143+
Summary: The computed value rules of user-select is problematic
144+
From: Emilio Cobos Álvarez
145+
Comment: https://github.com/w3c/csswg-drafts/issues/3344
146+
Response: https://github.com/w3c/csswg-drafts/issues/3344#issuecomment-466839533
147+
Closed: Accepted
148+
Resolved: https://github.com/w3c/csswg-drafts/issues/3344#issuecomment-467637093

0 commit comments

Comments
 (0)