FFFF [css-pseudo] Add text-emphasis-color and text-shadow to ::selection p… · w3c/csswg-drafts@9bfe4d3 · GitHub
Skip to content

Commit 9bfe4d3

Browse files
committed
[css-pseudo] Add text-emphasis-color and text-shadow to ::selection properties. Remove issue about wash requirement, since nobody objected. Clarify that text decoration should be repainted with selection color (current behavior is so weird); this probably needs an example. Wordsmithing.
1 parent 6ebbf1c commit 9bfe4d3

2 files changed

Lines changed: 34 additions & 19 deletions

File tree

css-pseudo/Overview.bs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -480,22 +480,30 @@ Styling Highlighted Ranges</h3>
480480
<li>'cursor' (optional)
481481
<li>'outline' and its longhands (optional)
482482
<li>'text-decoration' and its associated properties (optional)
483+
<li>'text-emphasis-color' (optional)
484+
<li>'text-shadow' (optional)
483485
</ul>
484486

485-
Issue: What properties should be included here?
486-
Only color and bgcolor seem supported; but text-decoration is needed for spellcheck.
487+
Issue: Are there any other properties that should be included here?
488+
[Caret-color should be added once we have it.]
487489

488-
If 'color' is not specified, the text's actual color must be used for the highlight.
490+
Issue: Only 'color' and 'background-color' are cross-browser.
491+
Should any others be required?
492+
493+
If 'color' is not specified, the text (and text decoration)'s
494+
unselected color must be used for the highlight.
489495
(As usual, the initial 'background-color' is ''transparent''.)
490496

491497
Issue: Can we reuse ''currentColor'' for this, now that it computes to itself?
492498

493499
The UA should use the OS-default selection color
494500
when neither 'color' nor 'background-color' has been specified by the author.
495501

496-
Note: This behavior does not let allow <a href="http://lists.w3.org/Archives/Public/www-style/2008Oct/0268.html">using the normal cascade</a>
502+
Note: This paired-cascading behavior
503+
does not allow <a href="http://lists.w3.org/Archives/Public/www-style/2008Oct/0268.html">using the normal cascade</a>
497504
to represent the OS default selection colors.
498-
However it has been interoperably implemented in browsers and is thus probably a Web-compatibility requirement.
505+
However it has been interoperably implemented in browsers
506+
and is thus probably a Web-compatibility requirement.
499507

500508
The ''::selection'' pseudo element draws its background
501509
over the selected portion of the element,
@@ -504,7 +512,8 @@ Styling Highlighted Ranges</h3>
504512
It also suppresses the drawing of any selected text
505513
and instead redraws that text
506514
(and any text decorations)
507-
over that background.
515+
over that background
516+
using the specified 'color'.
508517

509518
Issue: Implementations seem to redraw text decorations and text shadows over the selection background.
510519
This seems particularly weird if the text decoration color doesn't match the text.
@@ -521,8 +530,6 @@ Styling Highlighted Ranges</h3>
521530
else the specified 'color';
522531
however the UA may adjust the alpha channel if it is opaque.
523532

524-
Issue: The wash requirement is a minor update on WebKit's behavior. Gecko & Opera just use the default selection color for the wash.
525-
526533
Issue: This whole section needs vocabulary cleanup.
527534

528535
<h2 id="generated-content">

css-pseudo/Overview.html

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line nu 8BEF mberDiff line change
@@ -587,22 +587,30 @@ <h3 class="heading settled" data-level=3.1 id=highlight-styling><span class=secn
587587
<li><a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-ui-3/#cursor0 title=cursor>cursor</a> (optional)
588588
<li><a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-ui-3/#outline0 title=outline>outline</a> and its longhands (optional)
589589
<li><a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-text-decor-3/#propdef-text-decoration title=text-decoration>text-decoration</a> and its associated properties (optional)
590+
<li><a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-text-decor-3/#propdef-text-emphasis-color title=text-emphasis-color>text-emphasis-color</a> (optional)
591+
<li><a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-text-decor-3/#propdef-text-shadow title=text-shadow>text-shadow</a> (optional)
590592
</ul>
591593

592-
<p class=issue id=issue-c0c29618><a class=self-link href=#issue-c0c29618></a>What properties should be included here?
593-
Only color and bgcolor seem supported; but text-decoration is needed for spellcheck.</p>
594+
<p class=issue id=issue-7be57116><a class=self-link href=#issue-7be57116></a>Are there any other properties that should be included here?
595+
[Caret-color should be added once we have it.]</p>
594596

595-
<p>If <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-color-3/#color0 title=color>color</a> is not specified, the text’s actual color must be used for the highlight.
597+
<p class=issue id=issue-b0e74d3c><a class=self-link href=#issue-b0e74d3c></a>Only <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-color-3/#color0 title=color>color</a> and <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-backgrounds-3/#background-color title=background-color>background-color</a> are cross-browser.
598+
Should any others be required?</p>
599+
600+
<p>If <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-color-3/#color0 title=color>color</a> is not specified, the text (and text decoration)'s
601+
unselected color must be used for the highlight.
596602
(As usual, the initial <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-backgrounds-3/#background-color title=background-color>background-color</a> is <span class=css>transparent</span>.)</p>
597603

598604
<p class=issue id=issue-73cb06fc><a class=self-link href=#issue-73cb06fc></a>Can we reuse <span class=css>currentColor</span> for this, now that it computes to itself?</p>
599605

600606
<p>The UA should use the OS-default selection color
601607
when neither <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-color-3/#color0 title=color>color</a> nor <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-backgrounds-3/#background-color title=background-color>background-color</a> has been specified by the author.</p>
602608

603-
<p class=note>Note: This behavior does not let allow <a href=http://lists.w3.org/Archives/Public/www-style/2008Oct/0268.html>using the normal cascade</a>
609+
<p class=note>Note: This paired-cascading behavior
610+
does not allow <a href=http://lists.w3.org/Archives/Public/www-style/2008Oct/0268.html>using the normal cascade</a>
604611
to represent the OS default selection colors.
605-
However it has been interoperably implemented in browsers and is thus probably a Web-compatibility requirement.</p>
612+
However it has been interoperably implemented in browsers
613+
and is thus probably a Web-compatibility requirement.</p>
606614

607615
<p>The <a class=css data-link-type=maybe href=#selectordef-selection title=::selection>::selection</a> pseudo element draws its background
608616
over the selected portion of the element,
@@ -611,7 +619,8 @@ <h3 class="heading settled" data-level=3.1 id=highlight-styling><span class=secn
611619
It also suppresses the drawing of any selected text
612620
and instead redraws that text
613621
(and any text decorations)
614-
over that background.</p>
622+
over that background
623+
using the specified <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-color-3/#color0 title=color>color</a>.</p>
615624

616625
<p class=issue id=issue-8f96bd90><a class=self-link href=#issue-8f96bd90></a>Implementations seem to redraw text decorations and text shadows over the selection background.
617626
This seems particularly weird if the text decoration color doesn’t match the text.
@@ -628,8 +637,6 @@ <h3 class="heading settled" data-level=3.1 id=highlight-styling><span class=secn
628637
else the specified <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-color-3/#color0 title=color>color</a>;
629638
however the UA may adjust the alpha channel if it is opaque.</p>
630639

631-
<p class=issue id=issue-81c4e72d><a class=self-link href=#issue-81c4e72d></a>The wash requirement is a minor update on WebKit’s behavior. Gecko &amp; Opera just use the default selection color for the wash.</p>
632-
633640
<p class=issue id=issue-a5c22c51><a class=self-link href=#issue-a5c22c51></a>This whole section needs vocabulary cleanup.</p>
634641

635642
<h2 class="heading settled" data-level=4 id=generated-content><span class=secno>4. </span><span class=content>
@@ -1051,13 +1058,14 @@ <h2 class="no-num heading settled" id=references><span class=content>References<
10511058
So, how do we want <span class=css>inherit</span> to behave here?
10521059
Should it inherit from the parent <a class=css data-link-type=maybe href=#selectordef-selection title=::selection>::selection</a>
10531060
or the <a data-link-type=dfn href=http://dev.w3.org/csswg/selectors-4/#originating-element title="originating element">originating element</a>?
1054-
Opera does the former, Gecko/Blink the latter.<a href=#issue-64a36ad9></a></div><div class=issue>What properties should be included here?
1055-
Only color and bgcolor seem supported; but text-decoration is needed for spellcheck.<a href=#issue-c0c29618></a></div><div class=issue>Can we reuse <span class=css>currentColor</span> for this, now that it computes to itself?<a href=#issue-73cb06fc></a></div><div class=issue>Implementations seem to redraw text decorations and text shadows over the selection background.
1061+
Opera does the former, Gecko/Blink the latter.<a href=#issue-64a36ad9></a></div><div class=issue>Are there any other properties that should be included here?
1062+
[Caret-color should be added once we have it.]<a href=#issue-7be57116></a></div><div class=issue>Only <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-color-3/#color0 title=color>color</a> and <a class=property data-link-type=propdesc href=http://dev.w3.org/csswg/css-backgrounds-3/#background-color title=background-color>background-color</a> are cross-browser.
1063+
Should any others be required?<a href=#issue-b0e74d3c></a></div><div class=issue>Can we reuse <span class=css>currentColor</span> for this, now that it computes to itself?<a href=#issue-73cb06fc></a></div><div class=issue>Implementations seem to redraw text decorations and text shadows over the selection background.
10561064
This seems particularly weird if the text decoration color doesn’t match the text.
10571065
Perhaps the only thing visible should be the text itself (unless the background is transparent)
10581066
and any text decorations specified for the selection itself.
10591067
(Alternately the decorations should get the color of the selected text,
1060-
not the unselected text.)<a href=#issue-8f96bd90></a></div><div class=issue>The wash requirement is a minor update on WebKit’s behavior. Gecko &amp; Opera just use the default selection color for the wash.<a href=#issue-81c4e72d></a></div><div class=issue>This whole section needs vocabulary cleanup.<a href=#issue-a5c22c51></a></div><div class=issue>
1068+
not the unselected text.)<a href=#issue-8f96bd90></a></div><div class=issue>This whole section needs vocabulary cleanup.<a href=#issue-a5c22c51></a></div><div class=issue>
10611069
The approach in this draft
10621070
is to start with a bare minimum
10631071
for the CSSPseudoElement interface

0 commit comments

Comments
 (0)