* [CODE(DOMi)@en[Selection]] インターフェイス

@@

* [CODE[::selection]] 疑似要素

@@

* アクセス可能性

[61] 
[CODE[::selection]] の[[背景色]]を[[背景色]]と区別がつきにくいページがよくあって困ります。
[[Webブラウザー]]でなんとかしてもらえないもんですかねえ。
[TIME[2022-08-27T02:55:55.300Z]]

* 歴史

** 選択子3

[REFS[
- [3] [CITE[User Interface Enhancements]] ([TIME[1999-09-16 05:07:02 +09:00]] 版) <http://www.w3.org/TR/1999/WD-css3-userint-19990916#pseudo-selection>
- [2] [CITE@en[User Interface for CSS3]] ([TIME[2000-06-23 03:09:21 +09:00]] 版) <http://www.w3.org/TR/2000/WD-css3-userint-20000216#pseudo-selection>
- [6] [CITE@en[CSS3 module: W3C Selectors]] ([TIME[2000-04-11 01:57:05 +09:00]] 版) <http://www.w3.org/TR/2000/WD-css3-selectors-20000410#selection>
- [7] [CITE@en[CSS3 module: W3C Selectors]] ([TIME[2000-10-06 02:05:50 +09:00]] 版) <http://www.w3.org/TR/2000/WD-css3-selectors-20001005/#selection>
- [8] [CITE@en[CSS3 module: W3C Selectors]] ([TIME[2001-01-29 23:57:00 +09:00]] 版) <http://www.w3.org/TR/2001/WD-css3-selectors-20010126/#selection>
- [9] [CITE@en[Selectors]] ([TIME[2001-11-15 23:36:43 +09:00]] 版) <http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#selection>
- [12] [CITE@en[Selectors]] ([TIME[2005-12-15 00:49:29 +09:00]] 版) <http://www.w3.org/TR/2005/WD-css3-selectors-20051215/#selection>
]REFS]

[4] はじめ [CODE(CSS)@en[[[:selection]]]] [[擬似要素]]は [[css-userint]] [[WD]] で定義されており、
途中で[[選択子3]]に移動しました。[[擬似要素]]の構文の変更で、途中から [CODE(CSS)@en[[[::selection]]]]
に変わっています。

** [CODE(CSS)@en[::-moz-selection]]

@@ 

** 選択子3からの削除

[REFS[
- [13] [CITE@en[Selectors Level 3]] ([TIME[2009-03-10 22:17:53 +09:00]] 版) <http://www.w3.org/TR/2009/WD-css3-selectors-20090310/#selection>
- [15] [CITE@en[Selectors Level 3]] ([TIME[2009-12-15 08:41:18 +09:00]] 版) <http://www.w3.org/TR/2009/PR-css3-selectors-20091215/#selection>
- [16] [CITE@en[Selectors Level 3]] ([TIME[2011-09-29 22:16:17 +09:00]] 版) <http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#selection>
- [1] [CITE@en[Selectors Level 3]] ([TIME[2011-09-29 22:16:17 +09:00]] 版) <http://www.w3.org/TR/selectors/#selection>
]REFS]

[14] >>12 の次の [[WD]] である >>13 で、実装経験の不足から削除されています。

[17] [CITE@en[CSS Basic User Interface Module Level 3 (CSS3 UI)]]
( ([[Tantek Çelik]] 著, [TIME[2012-01-13 20:03:30 +09:00]] 版))
<http://www.w3.org/TR/2012/WD-css3-ui-20120117/#changes-list>

[18] [CITE@en[selection object (Internet Explorer)]]
( ([TIME[2014-01-16 03:18:53 +09:00]] 版))
<http://msdn.microsoft.com/en-us/library/ie/ms535869(v=vs.85).aspx>

[19] [CITE@en[''''''[''''''css3-selectors'''''']'''''''''['''css3-ui''']''' Status of the ::selection pseudo-element]]
( ([[Daniel Tan]] 著, [TIME[2012-01-12 05:41:01 +09:00]] 版))
<http://lists.w3.org/Archives/Public/www-style/2012Jan/0514.html>

[20] [CITE@en[How ::selection works on nested elements]]
( ([[L. David Baron]] 著, [TIME[2008-10-27 07:10:02 +09:00]] 版))
<http://lists.w3.org/Archives/Public/www-style/2008Oct/0268.html>

[21] [CITE@en[Re: ''''''[''''''css4-selectors'''''']'''''' ::selection pseudo-element should be put back  in  the spec]]
( ([[fantasai]] 著, [TIME[2011-08-27 02:47:15 +09:00]] 版))
<http://lists.w3.org/Archives/Public/www-style/2011Aug/0631.html>

[22] [CITE[IRC logs: freenode / #whatwg / 20140325]]
( ([TIME[2014-03-26 19:34:05 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20140325#l-636>

[23] [CITE@en-US[Internationalization Tag Set (ITS) Version 2.0]]
( ([TIME[2013-10-27 19:39:43 +09:00]] 版))
<http://www.w3.org/TR/its20/#termdef-selection>

[24] [CITE@en[css3-ui ''''''[''''''CSS Working Group Wiki'''''']'''''']]
( ([TIME[2014-09-18 04:38:14 +09:00]] 版))
<http://wiki.csswg.org/spec/css3-ui#issue-30>

[25] [CITE[IRC logs: freenode / #whatwg / 20140917]]
( ([TIME[2014-09-18 04:38:24 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20140917#l-801>

** 

[26] [CITE@ja[Cross Browser selectionStart/selectionEnd]] ([TIME[2005-11-27 10:46:32 +09:00]] 版) <http://www.teria.com/~koseki/memo/xbselection/>

[27] [CITE[IRC logs: freenode / #whatwg / 20140325]]
( ([TIME[2014-03-26 19:34:05 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20140325#l-636>

** Selection API

[28] [CITE@en[Re: ''''''[''''''Editing'''''']'''''' Splitting Selection API Into a Separate Specification]]
( ([[Ryosuke Niwa]] 著, [TIME[2014-04-11 15:41:27 +09:00]] 版))
<http://lists.w3.org/Archives/Public/public-webapps/2014AprJun/0122.html>

[29] [CITE[rniwa/selection-api]]
( ([TIME[2014-04-18 09:15:41 +09:00]] 版))
<https://github.com/rniwa/selection-api>

[5] [CITE@en[Selection API Specification]]
( ([TIME[2014-04-18 09:16:14 +09:00]] 版))
<https://rawgit.com/rniwa/selection-api/master/selection-api.html>

[31] [CITE@en[Selection API Specification]]
( ([TIME[2014-04-11 16:11:38 +09:00]] 版))
<http://rniwa.github.io/selection-api.html>

[7] [CITE@en[Bug 10583 – ''''''[''''''Selection'''''']'''''' toString should return only the text within the selection that is visible to the user]]
( ([TIME[2014-09-18 09:46:28 +09:00]] 版))
<https://www.w3.org/Bugs/Public/show_bug.cgi?id=10583>

[32] [CITE@en[Selection API]]
( ([TIME[2014-10-07 04:34:01 +09:00]] 版))
<http://www.w3.org/TR/2014/WD-selection-api-20141007/>

[33] [CITE@en[717339 – Selection's Ranges should be removed on document.open()]]
([TIME[2015-05-05 19:42:37 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=717339>

[10] [CITE@en[Selection API]]
( ([TIME[2015-09-29 20:39:47 +09:00]] 版))
<http://www.w3.org/TR/2015/WD-selection-api-20151008/>

[11] [CITE[seamonkey mozilla/content/base/public/nsISelection.idl]]
([TIME[2006-03-30 06:57:22 +09:00]] 版)
<http://lxr.mozilla.org/seamonkey/source/content/base/public/nsISelection.idl>

[34] [CITE@en[Selection API]]
( ([TIME[2015-11-19 19:21:21 +09:00]] 版))
<http://www.w3.org/TR/2015/WD-selection-api-20151124/>

[35] [CITE@en[Selection API]]
([TIME[2015-12-05 07:30:19 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-selection-api-20151204/>

[36] [CITE@en[Selection API]]
([TIME[2015-12-07 23:06:09 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-selection-api-20151207/>

[37] [CITE@en[Selection API]]
([TIME[2015-12-15 17:06:28 +09:00]] 版)
<http://www.w3.org/TR/2015/WD-selection-api-20151215/>

[38] [CITE@en[Add Selection API as the ref for the Selection interface · whatwg/html@9e1be16]]
([TIME[2016-01-29 17:12:40 +09:00]] 版)
<https://github.com/whatwg/html/commit/9e1be16025075ad5877ffa43984cc0f40afe8b6b>

[39] [CITE@en[Selection API]]
([TIME[2016-03-11 06:40:15 +09:00]] 版)
<https://www.w3.org/TR/2016/WD-selection-api-20160310/>

[40] [CITE@en[Selection API]]
([TIME[2016-04-21 13:24:40 +09:00]] 版)
<https://www.w3.org/TR/2016/WD-selection-api-20160421/>

[41] [CITE@en[Selection API]]
([TIME[2016-09-21 22:21:46 +09:00]])
<https://www.w3.org/TR/2016/WD-selection-api-20160921/>


[30] [CITE@en[Selection API]]
([TIME[2016-12-07 08:44:45 +09:00]])
<https://www.w3.org/TR/2016/WD-selection-api-20161206/>

[42] [CITE@en[Editorial: deduplicate selection-setting algorithm]]
([[domenic]]著, [TIME[2017-02-11 07:12:45 +09:00]])
<https://github.com/whatwg/html/commit/3a5d50d9d5b1f899bc28b7f7060c60875837a3b0>

[43] [CITE@en[Selection API]]
([TIME[2017-02-27 14:06:14 +09:00]])
<https://www.w3.org/TR/2017/WD-selection-api-20170227/>

[44] [CITE@en[Clean up selection direction handling]]
([[domenic]]著, [TIME[2017-03-16 07:51:53 +09:00]])
<https://github.com/whatwg/html/commit/af9fa0ff11d07a341f6404d4578017d68fafc8c7>

[45] [CITE@en[Selection API]]
([TIME[2017-03-30 17:04:42 +09:00]])
<https://www.w3.org/TR/2017/WD-selection-api-20170330/>

[46] [CITE@en[Do not change input/textarea text selection for the same value]]
([[domenic]]著, [TIME[2017-03-15 06:34:23 +09:00]])
<https://github.com/whatwg/html/commit/8cbd60575061e2ef25394804be1f7d86b6d61857>

[47] [CITE@en[Clarify the value comparison in input.value's setter]]
([[domenic]]著, [TIME[2017-04-20 06:15:14 +09:00]])
<https://github.com/whatwg/html/commit/8ee1ea4a5ea241a0c3b1803fe4364d68cc686865>

[48] [CITE@en[Selection API]]
([TIME[2017-05-01 01:22:45 +09:00]])
<https://www.w3.org/TR/2017/WD-selection-api-20170430/>

[49] [CITE@en[Selection API]]
([TIME[2017-05-10 06:37:16 +09:00]])
<https://www.w3.org/TR/2017/WD-selection-api-20170509/>

[50] [CITE@en[Require text entry cursor at the beginning of controls initially]]
([[domenic]]著, [TIME[2017-06-24 01:34:33 +09:00]])
<https://github.com/whatwg/html/commit/dd0fb780a96e603f32ff8537d2b465d49ec06e27>

[51] [CITE@en[Require text entry cursor at the beginning of controls initially by domenic · Pull Request #2770 · whatwg/html]]
([TIME[2017-06-24 11:38:58 +09:00]])
<https://github.com/whatwg/html/pull/2770>

[52] [CITE@en[1337392 - in a pre filled textbox, cursor is behind all text, previously it was on the first position]]
([TIME[2017-06-24 11:46:20 +09:00]])
<https://bugzilla.mozilla.org/show_bug.cgi?id=1337392>

[53] [CITE@en[Selection API]]
([TIME[2017-06-29 06:53:47 +09:00]])
<https://www.w3.org/TR/2017/WD-selection-api-20170628/>

[54] [CITE@en[Text selection after updating textContent of TEXTAREA · Issue #2411 · whatwg/html]]
([TIME[2018-03-17 17:53:56 +09:00]])
<https://github.com/whatwg/html/issues/2411>

[55] [CITE@en[Fix selection/text entry cursor position processing for input/textarea by domenic · Pull Request #3472 · whatwg/html]]
([TIME[2018-03-17 17:55:03 +09:00]])
<https://github.com/whatwg/html/pull/3472>

[56] [CITE@en[Do not change input/textarea text selection for the same value by domenic · Pull Request #2437 · whatwg/html]]
([TIME[2018-03-17 17:57:42 +09:00]])
<https://github.com/whatwg/html/pull/2437>

[57] [CITE@en[Editorial: clarify some text selection/cursor concepts]]
([[domenic]]著, [TIME[2018-02-17 08:55:18 +09:00]])
<https://github.com/whatwg/html/commit/2e8be71869f7c1e67f2aecd31c7ea3eaeff22b54>

[58] [CITE@en[State an initial selection direction]]
([[domenic]]著, [TIME[2019-04-27 05:15:33 +09:00]])
<https://github.com/whatwg/html/commit/eec509550616464b82c8968e93c01583c2a772fc>

[59] [CITE@en[State an initial selection direction by domenic · Pull Request #4572 · whatwg/html]]
([TIME[2020-01-12 13:55:49 +09:00]])
<https://github.com/whatwg/html/pull/4572>

[60] [CITE@en[Initial value of selectionDirection · Issue #4541 · whatwg/html]]
([TIME[2020-01-12 13:56:00 +09:00]])
<https://github.com/whatwg/html/issues/4541>