hidden屿§ãã¹ãŠã®HTMLèŠçŽ ã¯hiddenã³ã³ãã³ã屿§èšå®ãæã£ãŠããããhidden屿§ã¯çåœå±æ§ã§ãããèŠçŽ ã§æå®ãããå Žåãããã¯ãèŠçŽ ããŸã ãªãããšããŸãã¯ãã¯ãããŒãžã®çŸåšã®ç¶æ
ã«ã¯çŽæ¥é¢ä¿ããªãããŸãã¯ããŠãŒã¶ãŒãçŽæ¥ã¢ã¯ã»ã¹ããã®ãšã¯å¯Ÿç
§çã«ãããŒãžã®ä»ã®éšåã§åå©çšããã³ã³ãã³ãã宣èšããããã«äœ¿çšãããŠããããšã瀺ããUser agents should not render elements that have the hidden attribute specified. This requirement may be implemented indirectly through the style layer. For example, an HTML+CSS user agent could implement these requirements using the rules suggested in the Rendering section.
ãã®å±æ§ã¯éåžžCSSã䜿çšããŠå®è£
ãããŠãããããCSSã䜿çšããŠäžæžãããããšãã§ãããããšãã°ã'display: block'ããã¹ãŠã®èŠçŽ ã«é©çšããèŠåã¯ãhidden屿§ã®åœ±é¿ãçžæ®ºããã ããããããã£ãŠèè
ã¯ãæåŸ
éãã«å±æ§ãã¹ã¿ã€ã«ä»ããããŠããããšã確èªãããã®ã¹ã¿ã€ã«ã·ãŒããæžãéã«æ³šæããå¿
èŠãããã
以äžã®éªšæ Œã®äŸã«ãããŠã屿§ã¯ããŠãŒã¶ãŒããã°ã€ã³ãããŸã§ãŠã§ãã²ãŒã ã®ã¡ã€ã³ç»é¢ãé衚瀺ã«ããããã«äœ¿çšãããïŒ
<h1>The Example Game</h1>
<section id="login">
<h2>Login</h2>
<form>
...
<!-- calls login() once the user's credentials have been checked -->
</form>
<script>
function login() {
// switch screens
document.getElementById('login').hidden = true;
document.getElementById('game').hidden = false;
}
</script>
</section>
<section id="game" hidden>
...
</section>
hidden屿§ã¯ãå¥ã®ãã¬ãŒã³ããŒã·ã§ã³ã«åæ³çã«ç€ºãããšãã§ããã³ã³ãã³ããé ãããã«äœ¿çšãããŠã¯ãªããªããããšãã°ãã¿ãä»ãã€ã³ã¿ãŒãã§ãŒã¹ã¯åã«ãªãŒããŒãããŒãã¬ãŒã³ããŒã·ã§ã³ã®äžçš®ã§ãããããã¿ãä»ããã€ã¢ãã°ã§ããã«ãé ãããã«hiddenã䜿çšããããšã¯èª€ãã§ãããâããã¯ã¹ã¯ããŒã«ããŒããã€1ã€ã®å€§ããªããŒãžå
ã®ãã¹ãŠã®ãã©ãŒã ã³ã³ãããŒã«ã瀺ãã®ãšåæ§ã§ãããã¡ããã©1ã€ã®ãã¬ãŒã³ããŒã·ã§ã³ããã³ã³ãã³ããé衚瀺ã«ããããã«ãã®å±æ§ã䜿çšããããšãåæ§ã«èª€ãã§ãããâäœããhiddenãšããŒã¯ãããå Žåãããã¯ãããšãã°ããªã³ã¿ãªã©ãå«ãããã¹ãŠã®ãã¬ãŒã³ããŒã·ã§ã³ããé ãããŠããã
èªèº«ãhiddenã§ãªãèŠçŽ ã¯ãhiddenã§ããèŠçŽ ãžãã€ããŒãªã³ã¯ãããŠã¯ãªããªããèªèº«ãhiddenã§ãªãlabelããã³outputèŠçŽ ã®for屿§ãåæ§ã«ãhiddenã§ããèŠçŽ ãåç
§ããŠã¯ãªããªããã©ã¡ãã®å Žåãããã®ãããªåç
§ã¯ãŠãŒã¶ãŒã®æ··ä¹±ãåŒãèµ·ããã ããã
ããããèŠçŽ ããã³ã¹ã¯ãªããã¯ãä»ã®ã³ã³ããã¹ãã§hiddenã§ããèŠçŽ ãåç
§ããŠãããã
ããšãã°ãhidden屿§ã§ããŒã¯ãããã»ã¯ã·ã§ã³ã«ãªã³ã¯ããhref屿§ã䜿çšããã®ã¯èª€ãã ãããã³ã³ãã³ããé©åãŸãã¯é¢é£ããªãå Žåãããã«ãªã³ã¯ããçç±ã¯ãªãã
ããããèªèº«ãhiddenã§ãã説æãåç
§ããããã«ãARIA aria-describedby屿§ã䜿çšããããšã¯æ§ããªãã ããã説æãé衚瀺ã«ããããšã¯ããããåç¬ã§æçšã§ãªãããšãæå³ããäžæ¹ã§ããããã¯ããããã説æããç»åããåç
§ãããç¹å®ã®ã³ã³ããã¹ãã«ãããŠæçšã§ããæ¹æ³ã§èšè¿°ããããšãã§ããã
åæ§ã«ãhidden屿§ãæã€canvasèŠçŽ ã¯ããªãã¹ã¯ãªãŒã³ãããã¡ãšããŠã¹ã¯ãªããåãããã°ã©ãã£ãã¯ã¹ãšã³ãžã³ã«ãã£ãŠäœ¿çšããããããããããã©ãŒã ã³ã³ãããŒã«ã¯ãform屿§ã䜿çšããé ãformèŠçŽ ãåç
§ãããããããªãã
ã¢ã¯ã»ã·ããªãã£ãŒAPIã¯ãããã©ã«ãã®ãã¥ãŒã§é衚瀺ãšããŠããŒã¯ããéæ§é åãããã³ã³ãã³ããå ¬éããæ¹æ³ãæäŸããããšãæšå¥šããããã®ãããªã³ã³ãã³ãã¯ãæ¯æŽæè¡ïŒATïŒãŸãã¯ã¡ã€ã³ã¹ããªãŒã ã®ãŠãŒã¶ãŒãšãŒãžã§ã³ãã䜿çšããŠãããã©ãããä»»æã®æ§åŒã§ãéåžžã®ææžãããŒã§ãŠãŒã¶ãŒã«ç¥èŠã§ããããã«ãã¹ãã§ãªãã
ãã®ãããªæ©èœãå©çšå¯èœãªéããã®ãããªã³ã³ãã³ããIDåç
§ãŸãã¯åŠ¥åœãªããã·ã¥ååç
§ã«ãã£ãŠéæ¥çã«åç
§ããããªãã°ãé©åãªå Žåã«ããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãATã«hiddenèŠçŽ ã®å®å
šãªã»ãã³ãã£ãã¯ãå
¬éããããã«ãããã䜿çšããŠããããããã¯ãéåžžã®ããã¥ã¡ã³ããããŒã«å±ãããã¹ãŠã®ãã¬ãŒã³ããŒã·ã§ã³ã§é ãããã³ã³ãã³ããç¶æããªãããATãããŠãŒã¶ãŒã®èŠæ±ã«å¿ããŠããããã®hiddenèŠçŽ ã®æ§é ã«ã¢ã¯ã»ã¹ã§ãããhiddenèŠçŽ ã®ãŠãŒã¶ãŒèµ·åã®è¡šç€ºãé²ãããèè
ã¯ããã®ãããªæ©æ§ãæã€èŠçŽ ãåç
§ãã¹ãã§ãªãã
ATãžãã®ãããªã³ã³ãã³ããå
¬éããéã«äžéšã®ãŠãŒã¶ãŒãšãŒãžã§ã³ãã¯é衚瀺ã³ã³ãã³ããå¹³åŠåããŠããã®ã§ãèè
ã¯ãå¹³åŠåããéã«äžå¯æ¬ ãªæå³ã倱ãhiddenå
容ãåç
§ãã¹ãã§ãªãã
ããšãã°ãhidden屿§ã§ããŒã¯ãããã»ã¯ã·ã§ã³ã«ãªã³ã¯ããhref屿§ã䜿çšããã®ã¯èª€ãã ãããã³ã³ãã³ããé©åãŸãã¯é¢é£ããªãå Žåãããã«ãªã³ã¯ããçç±ã¯ãªãã
ããããèªèº«ãhiddenã§ãã説æãåç
§ããããã«ãARIA aria-describedby屿§ã䜿çšããããšã¯æ§ããªãã ããã説æãé衚瀺ã«ããããšã¯ããããåç¬ã§æçšã§ãªãããšãæå³ããäžæ¹ã§ããããã¯ããããã説æããç»åããåç
§ãããç¹å®ã®ã³ã³ããã¹ãã«ãããŠæçšã§ããæ¹æ³ã§èšè¿°ããããšãã§ããã
åæ§ã«ãhidden屿§ãæã€canvasèŠçŽ ã¯ããªãã¹ã¯ãªãŒã³ãããã¡ãšããŠã¹ã¯ãªããåãããã°ã©ãã£ãã¯ã¹ãšã³ãžã³ã«ãã£ãŠäœ¿çšããããããããããã©ãŒã ã³ã³ãããŒã«ã¯ãform屿§ã䜿çšããé ãformèŠçŽ ãåç
§ãããããããªãã
hidden屿§ã«ãã£ãŠé衚瀺ã«ãããã»ã¯ã·ã§ã³å
ã®èŠçŽ ã¯äŸç¶ãšããŠã¢ã¯ãã£ãã§ãããããšãã°ããã®ãããªã»ã¯ã·ã§ã³ã§ã®ã¹ã¯ãªããããã©ãŒã ã³ã³ãããŒã«ã¯ãäŸç¶ãšããŠå®è¡ããã³éä¿¡ããããããã®ãã¬ãŒã³ããŒã·ã§ã³ã®ã¿ããŠãŒã¶ãŒã«å€æŽãããã
The hidden IDL attribute must reflect
the content attribute of the same name.
ïŒç¹ã«èŠçŽ ãããã¹ãããŒãïŒããããŒãã¯äžæŽ»æ§ãšããŠããŒã¯ã§ãããããŒããäžæŽ»æ§ã§ãããšããããããããŒãããŠãŒã¶ãŒã€ã³ã¿ã©ã¯ã·ã§ã³ã€ãã³ãã察象ããç®çã®ããã«äžåšã§ãããã®ããã«ããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯åäœããªããã°ãªãããããã¹ãæ€çŽ¢ãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ãŒã¹ïŒäžè¬ã«"ããŒãžå æ€çŽ¢"ãšããŠç¥ãããïŒã®ç®çã«å¯ŸããŠããŒããç¡èŠããŠãããããã®ããŒãå ã®ããã¹ãã®éžæãããŠãŒã¶ãŒãé²ãã§ãããããããããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ããŠãŒã¶ãŒãæ€çŽ¢ãšããã¹ãéžæã«å¶éãäžæžãã§ããããã«ãã¹ãã§ããã
ããšãã°ãbodyã®äžå€®ã«äœçœ®ããåäžã®äžæŽ»æ§æ®µèœãããªãããŒãžãèããŠã¿ãããŠãŒã¶ãŒãbodyäžããäžæŽ»æ§æ®µèœãžãã€ã³ãã£ã³ã°ããã€ã¹ãç§»åãããæ®µèœäžãã¯ãªãã¯ããå Žåãmouseoverã€ãã³ãã¯çºç«ãããmousemoveããã³clickã€ãã³ãã¯æ®µèœãããããbodyèŠçŽ ã§çºç«ããã ããã
ããŒããäžæŽ»æ§ã§ããå ŽåãããŒãã¯ãŸããã©ãŒã«ã¹å¯èœã§ã¯ãªãã
Documentå
šäœã¯ãã¢ãŒãã«ãã€ã¢ãã°ãã€ã¢ãã°ã«ãã£ãŠãããã¯ãããsubjectãšããŠããŒã¯ã§ãããDocumentããã®ããã«ããŒã¯ãããŠããäžæ¹ã§ãsubjectèŠçŽ ããã³ãã®åå«ãé€ããŠãDocumentå
ã®ãã¹ãŠã®ããŒãã¯ãäžæŽ»æ§ãšããŒã¯ãããªããã°ãªããªããïŒãã®æ®µèœã§é€å€ãããèŠçŽ ã¯ãããã«ä»ã®ææ®µãä»ããŠäžæŽ»æ§ã«ããŒã¯ããããšãã§ãããã¢ãŒãã«ãã€ã¢ãã°ã®äžéšã§ããããšã¯äžæŽ»æ§ãšããŒã¯ãããããšããããŒãã"å®ã"ããšã¯ãªããïŒ
äžåºŠã«1ã€ã®ã¿èŠçŽ ãã¢ãŒãã«ãã€ã¢ãã°ã«ãã£ãŠãããã¯ãããŠãããšããŠDocumentãããŒã¯ããããšãã§ããã
click()ããããèŠçŽ ãã¯ãªãã¯ããããã®ããã«åäœããã
The click() method must run synthetic click
activation steps on the element.
When an element is focused, key events received by the document must be targeted at that
element. There may be no element focused; when no element is focused, key events received by the
document must be targeted at the body element, if there is one, or else at the
Document's root element, if there is one. If there is no root element, key events
must not be fired.
User agents may track focus for each browsing context or Document
individually, or may support only one focused element per top-level browsing context
â user agents should follow platform conventions in this regard.
Which elements within a top-level browsing context currently have focus must be independent of whether or not the top-level browsing context itself has the system focus.
When a child browsing context is focused, its browsing context container must also have focus.
When an element is focused, the element matches the CSS :focus
pseudo-class.
tabindex屿§tabindexã³ã³ãã³ã屿§ã¯ãèè
ããèŠçŽ ããã©ãŒã«ã¹ã§ããããšãä»®å®ãããã©ããããããé æ¬¡ãã©ãŒã«ã¹ããã²ãŒã·ã§ã³ã䜿çšããŠå°éããããšãä»®å®ãããã©ãããäœãã·ãŒã±ã³ã·ã£ã«ãã©ãŒã«ã¹ããã²ãŒã·ã§ã³ã®ããã®èŠçŽ ã®çžå¯Ÿçãªé åºã«ãªãããå¶åŸ¡ã§ãããåå"tab index"ã¯ããã©ãŒã«ã¹å¯èœãªèŠçŽ ãéããŠããã²ãŒããã"tab"ããŒã®äžè¬çãªäœ¿ç𿹿³ããæ¥ãŠãããçšèª"tabbing"ã¯ãé æ¬¡ãã©ãŒã«ã¹ããã²ãŒã·ã§ã³ã䜿çšããŠå°éããããšãã§ãããã©ãŒã«ã¹å¯èœãªèŠçŽ ãåæ¹ã«ç§»åããããšãæãã
tabindex屿§ãæå®ãããå Žåã劥åœãªæŽæ°ã§ããå€ãæããªããã°ãªããªãã
Each element can have a tabindex focus flag set, as defined below. This flag is a factor that contributes towards determining whether an element is focusable, as described in the next section.
If the attribute is specified, it must be parsed using the rules for parsing integers. The attribute's values have the following meanings:
The user agent should follow platform conventions to determine if the element's tabindex focus flag is set and, if so, whether the element can be reached using sequential focus navigation, and if so, what its relative order should be.
Modulo platform conventions, it is suggested that for the following elements, the tabindex focus flag be set:
a elements that have an href
attributelink elements that have an href attributebutton elementsinput elements whose type attribute are
not in the Hidden stateselectèŠçŽ textareaèŠçŽ One valid reason to ignore the platform conventions and always allow an element to be focused (by setting its tabindex focus flag) would be if the user's only mechanism for activating an element is through a keyboard action that triggers the focused element.
The user agent must set the element's tabindex focus flag, but should not allow the element to be reached using sequential focus navigation.
One valid reason to ignore the requirement that sequential focus navigation not
allow the author to lead to the element would be if the user's only mechanism for moving the
focus is sequential focus navigation. For instance, a keyboard-only user would be unable to
click on a text field with a negative tabindex, so that
user's user agent would be well justified in allowing the user to tab to the control
regardless.
The user agent must set the element's tabindex focus flag, should allow the element to be reached using sequential focus navigation, and should follow platform conventions to determine the element's relative order.
The user agent must set the element's tabindex focus flag, should allow the element to be reached using sequential focus navigation, and should place the element in the sequential focus navigation order so that it is:
tabindex
attribute has been omitted or whose value, when parsed, returns an error,tabindex
attribute has a value equal to or less than zero,tabindex attribute has a value
greater than zero but less than the value of the tabindex
attribute on the element,tabindex attribute has a value
equal to the value of the tabindex attribute on the element
but that is earlier in the document in tree order than the element,tabindex attribute has a value
equal to the value of the tabindex attribute on the element
but that is later in the document in tree order than the element, andtabindex attribute has a value
greater than the value of the tabindex attribute on the
element.An element that has its tabindex focus flag set but does not otherwise have an activation behavior defined has an activation behavior that does nothing.
This means that an element that is only focusable because of its tabindex attribute will fire a click
event in response to a non-mouse activation (e.g. hitting the "enter" key while the element is
focused).
The tabIndex IDL attribute must
reflect the value of the tabindex content
attribute. Its default value is 0 for elements that are focusable and â1 for elements that
are not focusable.
An element is focusable if all of the following conditions are met:
canvas element that represents embedded
content.In addition, each shape that is generated for an area element, any
user-agent-provided interface components of media elements
(e.g. a play button), and distinct user interface components of form controls (e.g. "up" and
"down" buttons on an <input type=number> spin
control), should be focusable, unless platform conventions dictate otherwise or
unless their corresponding element is disabled. (A
single area element can correspond to multiple shapes, since image maps can be reused
with multiple images on a page.)
Notwithstanding the above, user agents may make any element or part of an element focusable, especially to aid with accessibility or to better match platform conventions.
The focusing steps for an element are as follows:
If the element is not in a Document, or if
the element's Document has no browsing context, or if the element's
Document's browsing context has no top-level browsing
context, or if the element is not focusable, or if the element is already
focused, then abort these steps.
If focusing the element will remove the focus from another element, then run the unfocusing steps for that element.
Make the element the currently focused element in its top-level browsing context.
Some elements, most notably area, can correspond to more than one distinct
focusable area. If a particular area was indicated when the element was focused, then that is
the area that must get focus; otherwise, e.g. when using the focus() method, the first such region in tree order is the one that
must be focused.
The user agent may apply relevant platform-specific conventions for focusing widgets.
For example, some platforms select the contents of a text field when that field is focused.
Fire a simple event named focus at the element.
User agents must synchronously run the focusing steps for an element whenever the user moves the focus to a focusable element.
The unfocusing steps for an element are as follows:
If the element is an input element, and the change event applies to the element, and the element does not
have a defined activation behavior, and the user has changed the element's value or its list of selected files while the control was focused
without committing that change, then fire a simple event that bubbles named change at the element.
Unfocus the element.
Fire a simple event named blur at the element.
When an element that is focused stops being a focusable element, or stops being focused without another element being explicitly focused in its stead, the user agent should synchronously run the unfocusing steps for the affected element only.
For example, this might happen because the element is removed from its
Document, or has a hidden attribute added. It would
also happen to an input element when the element gets disabled.
activeElementçŸåšãã©ãŒã«ã¹ã®ããèŠçŽ ãè¿ãã
hasFocus()ææžããã©ãŒã«ã¹ãæã€å Žåã¯trueãè¿ããããã§ãªããã°falseãè¿ãã
focus()ãŠã£ã³ããŠããã©ãŒã«ã¹ããããã®ã¡ãœããã®äœ¿çšã¯æšå¥šãããªãã代ããã«ããŠãŒã¶ãŒããŠã£ã³ããŠã®ãã©ãŒã«ã¹ãå¶åŸ¡ã§ããã
blur()ãŠã£ã³ããŠãã¢ã³ãã©ãŒã«ã¹ããããã®ã¡ãœããã®äœ¿çšã¯æšå¥šãããªãã代ããã«ããŠãŒã¶ãŒããŠã£ã³ããŠã®ãã©ãŒã«ã¹ãå¶åŸ¡ã§ããã
The activeElement attribute on
Document objects must return the element in the document that is focused. If no
element in the Document is focused, this must return the body
element.
When a child browsing context is focused, its browsing context
container is also focused, by definition. For
example, if the user moves the focus to a text field in an iframe, the
iframe is the element with focus in the parent browsing context.
The hasFocus() method on
Document objects must return true if the Document's browsing
context is focused, and all its ancestor browsing
contexts are also focused, and the top-level browsing context has the
system focus. If the Document has no browsing context or if its
browsing context has no top-level browsing context, then the method will
always return false.
The focus() method on the Window
object, when invoked, provides a hint to the user agent that the script believes the user might be
interested in the contents of the browsing context of the Window object
on which the method was invoked.
User agents are encouraged to have this focus() method
trigger some kind of notification.
The blur() method on the Window
object, when invoked, provides a hint to the user agent that the script believes the user probably
is not currently interested in the contents of the browsing context of the
Window object on which the method was invoked, but that the contents might become
interesting again in the future.
User agents are encouraged to ignore calls to this blur()
method entirely.
Historically the focus() and blur() methods actually affected the system focus, but hostile
sites widely abuse this behavior to the user's detriment.
focus()èŠçŽ ããã©ãŒã«ã¹ããã
blur()èŠçŽ ãã¢ã³ãã©ãŒã«ã¹ããããã®ã¡ãœããã®äœ¿çšã¯æšå¥šãããªãã代ããã«å¥ã®èŠçŽ ããã©ãŒã«ã¹ããã
ãã©ãŒã«ã¹ãªã³ã°ãé衚瀺ã«ããããã«ãã®æ¹æ³ã䜿çšããŠã¯ãªããªããããŒããŒããŠãŒã¶ãŒãããã©ãŒã«ã¹ãªã³ã°ãé ããŠä»ã®æ¹æ³ã䜿çšããŠã¯ãªããªããç¹ã«ã'outline'ããããã£ãŒãäžæžãããããã«CSSèŠåã䜿çšããŠã¯ãªããªãããã©ãŒã«ã¹ãªã³ã°ã®é€å»ã¯ãããã²ãŒãããããã³ããŒããŒãã䜿çšããŠã€ã³ã¿ã©ã¯ãã£ããªã³ã³ãã³ããæäœãããŠãŒã¶ãŒã«å¯ŸããŠé倧ãªã¢ã¯ã»ã·ããªãã£ãŒã®åé¡ãããããã
The focus() method, when invoked, must run the
following algorithm:
If the element is marked as locked for focus, then abort these steps.
Mark the element as locked for focus.
Run the focusing steps for the element.
Unmark the element as locked for focus.
The blur() method, when invoked, should run the
unfocusing steps for the element on which the method was called instead. User agents
may selectively or uniformly ignore calls to this method for usability reasons.
For example, if the blur() method is unwisely
being used to remove the focus ring for aesthetics reasons, the page would become unusable by
keyboard users. Ignoring calls to this method would thus allow keyboard users to interact with the
page.
ãã®ç¯ã¯éèŠç¯çã§ããã
ã¢ã¯ãã£ããŸãã¯ãã©ãŒã«ã¹ãããããšãã§ããåèŠçŽ ã¯accesskey屿§ã䜿çšããŠããããã¢ã¯ãã£ãã«ããããã®åäžã®ããŒã®çµã¿åãããå²ãåœãŠãããšãã§ããã
æ£ç¢ºãªã·ã§ãŒãã«ããã¯ããŠãŒã¶ãŒãšãŒãžã§ã³ãã«ãã£ãŠæ±ºå®ããããŠãŒã¶ãŒã®ããŒããŒãã«é¢ããæ
å ±ã«åºã¥ããã©ã®ããŒããŒãã·ã§ãŒãã«ãããæ¢ã«ãã©ãããã©ãŒã äžã«ååšããä»ã«ã©ã®ãããªã·ã§ãŒãã«ãããããŒãžäžã§æå®ãããã¬ã€ããšããŠaccesskey屿§ã«æäŸãããæ
å ±ã䜿çšããã
é¢é£ããããŒããŒãã·ã§ãŒãã«ãããå€çš®å€æ§ãªå
¥åããã€ã¹ã§å©çšå¯èœã§ããããšã確å®ã«ããããã«ãèè
ã¯accesskey屿§ã§å€æ°ã®éžæè¢ãæäŸã§ããã
åéžæè¢ã¯ãæåãŸãã¯æ°åã®ãããªãåäžã®æåã§æ§æãããã
ãŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãããŒããŒãã·ã§ãŒãã«ããã®äžèЧããŠãŒã¶ãŒã«æäŸã§ããããèè
ã¯è¡ãããšãæšå¥šããããaccessKeyLabel IDL屿§ã¯ããŠãŒã¶ãŒãšãŒãžã§ã³ãã«ãã£ãŠå²ãåœãŠãããå®éã®ããŒã®çµã¿åããã衚ãæååãè¿ãã
ãã®äŸã«ãããŠãèè ã¯ã·ã§ãŒãã«ããããŒã䜿çšããŠåŒã³åºãããšãã§ãããã¿ã³ãæäŸããŠããããã«ããŒããŒãããµããŒãããããã«ãèè ã¯å¯èœãªããŒãšããŠ"C"ãæäŸããŠããããã³ããŒã®ã¿ãæèŒããããã€ã¹ããµããŒãããããã«ãèè ã¯å¥ã®å¯èœãªããŒãšããŠ"1"ãæäŸããŠããã
<input type=button value=Collect onclick="collect()"
accesskey="C 1" id=c>
ã·ã§ãŒãã«ããããŒãäœã§ãããããŠãŒã¶ãŒã«äŒããããã«ãèè ã¯æç€ºçã«ãã¿ã³ã®ã©ãã«ã«ããŒã®çµã¿åããã远å ããããã«éžæããŠããããã§ã®ãã®ã¹ã¯ãªãããæã€ã
function addShortcutKeyLabel(button) {
if (button.accessKeyLabel != '')
button.value += ' (' + button.accessKeyLabel + ')';
}
addShortcutKeyLabel(document.getElementById('c'));
ç°ãªããã©ãããã©ãŒã äžã®ãã©ãŠã¶ã¯ãããšãåãããŒã®çµã¿åããã§ãã£ãŠãããã®ãã©ãããã©ãŒã äžã§æ®åããŠããèŠåã«åºã¥ããŠç°ãªãã©ãã«ã衚瀺ãããããšãã°ãããŒã®çµã¿åããããControlããŒãShiftããŒãããã³æåCã§ããå ŽåãMacã®ãã©ãŠã¶ã"^â§C"ã衚瀺ãããããããªãäžæ¹ã§ãWindowsã®ãã©ãŠã¶ã¯"Ctrl+Shift+C"ã衚瀺ãããããããªããäžæ¹ã§Emacsã®ãã©ãŠã¶ã¯åã«"C-C"ã衚瀺ãããããããªããåæ§ã«ãããŒã®çµã¿åãããAltããŒãšEscããŒã§ããå ŽåãWindowsã¯"Alt+Esc"ã䜿çšããããããããMacã¯"â¥â"ã䜿çšããããããããEmacsã®ãã©ãŠã¶ã¯ã"M-ESC"ãŸãã¯"ESC ESC"ã䜿çšãããããããªãã
ãããã£ãŠãäžè¬ã«ãaccessKeyLabelIDL屿§ããè¿ãããå€ãè§£æããããšããã®ã¯è³¢æã§ã¯ãªãã
accesskey屿§ãã¹ãŠã®HTMLèŠçŽ ã¯ãaccesskeyã³ã³ãã³ã屿§ã®èšå®ãæã£ãŠããããaccesskey屿§å€ã¯ãèŠçŽ ãã¢ã¯ãã£ããŸãã¯ãã©ãŒã«ã¹ããããŒããŒãã·ã§ãŒãã«ãããäœæããããã®ã¬ã€ããšããŠããŠãŒã¶ãŒãšãŒãžã§ã³ãã«ãã£ãŠäœ¿çšãããã
æå®ãããå Žåãå€ã¯å€§æåã»å°æååºå¥ã§ããäžæãªã¹ããŒã¹åºåãããŒã¯ã³ã®é åºä»ãéåã§ãªããã°ãªããããã®åã ãæ£ç¢ºã«1ã€ã®Unicodeã³ãŒããã€ã³ãã®é·ãã§ãªããã°ãªããªãã
次ã®äŸã«ãããŠããµã€ããçç¥ããããŒããŒããŠãŒã¶ãŒãããè¿ éã«é¢é£ããããŒãžã«ç§»åã§ãããããããŸããŸãªãªã³ã¯ãã¢ã¯ã»ã¹ããŒãšãšãã«äžããããïŒ
<nav> <p> <a title="Consortium Activities" accesskey="A" href="/Consortium/activities">Activities</a> | <a title="Technical Reports and Recommendations" accesskey="T" href="/TR/">Technical Reports</a> | <a title="Alphabetical Site Index" accesskey="S" href="/Consortium/siteindex">Site Index</a> | <a title="About This Site" accesskey="B" href="/Consortium/">About Consortium</a> | <a title="Contact Consortium" accesskey="C" href="/Consortium/contact">Contact</a> </p> </nav>
次ã®äŸã«ãããŠãæ€çŽ¢ãã£ãŒã«ãã¯2ã€ã®å¯èœãªã¢ã¯ã»ã¹ããŒã"s"ãš"0"ïŒãã®é çªã§ïŒãäžããããããã³ããŒä»ãã®å°ããªããã€ã¹äžã®ãŠãŒã¶ãŒãšãŒãžã§ã³ãã¯åãªãç°¡çŽ ãªããŒ0ãéžã¶ãããããªããããã«ããŒããŒããæèŒããããã€ã¹ã§ã®ãŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãã·ã§ãŒãã«ããããŒãšããŠCtrl+Alt+Sãéžã¶ãããããªãïŒ
<form action="/search"> <label>Search: <input type="search" name="q" accesskey="s 0"></label> <input type="submit"> </form>
次ã®äŸã«ãããŠããã¿ã³ã¯èª¬æå¯èœãªã¢ã¯ã»ã¹ããŒãæã€ããã®ã¹ã¯ãªããã¯æ¬¡ã«ããŠãŒã¶ãŒãšãŒãžã§ã³ããéžæããããŒã®çµã¿åãããéç¥ããããã«ãã¿ã³ã®ã©ãã«ã®æŽæ°ã詊ã¿ãã
<input type=submit accesskey="N @ 1" value="Compose">
...
<script>
function labelButton(button) {
if (button.accessKeyLabel)
button.value += ' (' + button.accessKeyLabel + ')';
}
var inputs = document.getElementsByTagName('input');
for (var i = 0; i < inputs.length; i += 1) {
if (inputs[i].type == "submit")
labelButton(inputs[i]);
}
</script>
ãããŠãŒã¶ãŒãšãŒãžã§ã³ãã«ãããŠããã¿ã³ã®ã©ãã«ã¯"ComposeïŒâNïŒ"ã«ãªããããããªããå¥ã®ãã®ã«ãããŠãããã¯"ComposeïŒAlt+â§+1ïŒ"ã«ãªããããããªãããŠãŒã¶ãŒãšãŒãžã§ã³ããããŒãå²ãåœãŠãªãå Žåãåã«"Compose"ã«ãªããæ£ç¢ºãªæååã¯å²ãåœãŠãããã¢ã¯ã»ã¹ããŒãäœã§ããããããã³ã©ã®ããã«ãŠãŒã¶ãŒãšãŒãžã§ã³ãããã®ããŒã®çµã¿åããã衚ããã«äŸåããã
An element's assigned access key is a key combination derived from the element's
accesskey content attribute. Initially, an element must not
have an assigned access key.
Whenever an element's accesskey attribute is set, changed,
or removed, the user agent must update the element's assigned access key by running
the following steps:
If the element has no accesskey attribute, then skip
to the fallback step below.
Otherwise, split the attribute's value on spaces, and let keys be the resulting tokens.
For each value in keys in turn, in the order the tokens appeared in the attribute's value, run the following substeps:
If the value is not a string exactly one Unicode code point in length, then skip the remainder of these steps for this value.
If the value does not correspond to a key on the system's keyboard, then skip the remainder of these steps for this value.
If the user agent can find a mix of zero or more modifier keys that, combined with the key that corresponds to the value given in the attribute, can be used as the access key, then the user agent may assign that combination of keys as the element's assigned access key and abort these steps.
Fallback: Optionally, the user agent may assign a key combination of its choosing as the element's assigned access key and then abort these steps.
If this step is reached, the element has no assigned access key.
Once a user agent has selected and assigned an access key for an element, the user agent should
not change the element's assigned access key unless the accesskey content attribute is changed or the element is moved to
another Document.
User agents might expose elements that have
an accesskey attribute in other ways as well, e.g. in a menu
displayed in response to a specific key combination.
The accessKey IDL attribute must
reflect the accesskey content attribute.
The accessKeyLabel IDL attribute must return
a string that represents the element's assigned access key, if any. If the element
does not have one, then the IDL attribute must return the empty string.
contenteditableã³ã³ãã³ã屿§contenteditable屿§ã¯ãããŒã¯ãŒãã空æååãtrueãããšã³falseãšãªãåæå±æ§ã§ãããç©ºã®æååããã³trueããŒã¯ãŒãã¯ãtrueç¶æ
ã«å¯Ÿå¿ãããfalseããŒã¯ãŒãã¯ãfalseç¶æ
ã«å¯Ÿå¿ãããããã«ãinheritç¶æ
ãšãã第3ã®ç¶æ
ãååšãããããã¯æ¬ èœããå€ã®ããã©ã«ãïŒããã³åŠ¥åœã§ãªãå€ã®ããã©ã«ãïŒã§ããã
trueç¶æ ã¯ãèŠçŽ ãç·šéå¯èœã§ããããšã瀺ããinheritç¶æ ã¯ããã®èŠªãååšããå ŽåãèŠçŽ ãç·šéå¯èœã§ããããšã瀺ããfalseç¶æ ã¯ãèŠçŽ ãç·šéå¯èœã§ãªãããšã瀺ãã
contentEditable [ = value ]contenteditable屿§ã®ç¶æ
ã«åºã¥ããŠã"true"ã"false"ããŸãã¯"inherit"ãè¿ãã
ãã®ç¶æ ã倿Žããèšå®ãå¯èœã§ããã
æ°ããå€ããããã®æååã®ããããã§ãªãå ŽåãSyntaxErroräŸå€ãæããã
isContentEditableèŠçŽ ãç·šéå¯èœãªå Žåã«trueãè¿ããããã§ãªããã°falseãè¿ãã
The contentEditable IDL attribute, on
getting, must return the string "true" if the content attribute is set to
the true state, "false" if the content attribute is set to the false state,
and "inherit" otherwise. On setting, if the new value is an ASCII
case-insensitive match for the string "inherit" then the content
attribute must be removed, if the new value is an ASCII case-insensitive match for
the string "true" then the content attribute must be set to the string
"true", if the new value is an ASCII case-insensitive match for
the string "false" then the content attribute must be set to the string
"false", and otherwise the attribute setter must throw a
SyntaxError exception.
The isContentEditable IDL attribute, on
getting, must return true if the element is either an editing host or
editable, and false otherwise.
designModeIDL屿§Documents have a designMode, which can be either enabled or
disabled.
designMode [ = value ]ææžãç·šéå¯èœã§ããå Žåã«"on"ãè¿ãããªãå Žåã«"off"ãè¿ãã
ææžã®çŸåšã®ç¶æ ã倿Žããèšå®ãå¯èœã§ãããããã¯ãææžããã©ãŒã«ã¹ãããã®ææžã§ææžã®éžæããªã»ããããã
The designMode IDL attribute on the
Document object takes two values, "on" and "off". On setting, the new value must be compared in an ASCII
case-insensitive manner to these two values; if it matches the "on"
value, then designMode must be enabled, and if it
matches the "off" value, then designMode must be disabled. Other values must be
ignored.
On getting, if designMode is enabled, the IDL
attribute must return the value "on"; otherwise it is disabled, and the
attribute must return the value "off".
The last state set must persist until the document is destroyed or the state is changed.
Initially, documents must have their designMode
disabled.
When the designMode changes from being disabled to
being enabled, the user agent must synchronously reset the document's active range's
start and end boundary points to be at the start of the Document and then run the
focusing steps for the root element of the Document, if any.
èè ã¯ãããšããšå€'pre-wrap'ãžãããç·šéã®ã¡ã«ããºã ãä»ããŠäœæããããã¹ããç·šéããã³ããŒã¯ã¢ããäžã®'white-space'ããããã£ãŒãèšå®ããããæšå¥šãããããã©ã«ãã®HTML空çœåŠçã¯ãããŸãWYSIWYGç·šéã«åããããããŠ'white-space'ãããã©ã«ãå€ã®ãŸãŸã§ããå Žåãããã€ãã®ã³ãŒããŒã®å Žåã«ãããŠãè¡ã®æãè¿ãã¯æ£ããåäœããªãã
ããã©ã«ã'normal'å€ã代ããã«äœ¿çšãããå Žåã«çºçããåé¡ã®äŸãšããŠãåèªã®éã«2ã€ã®ã¹ããŒã¹ïŒããã§ã¯"â£"ã«ãã£ãŠè¡šãããïŒãšãšãã«ã"yellowâ£â£ball"ãšå ¥åãããŠãŒã¶ãŒã®å Žåãèããã'white-space'ã®ããã©ã«ãå€ïŒ'normal'ïŒã®ããã®å Žæã§ã®ç·šéèŠåãšãã«ãçµæã®ããŒã¯ã¢ããã¯ã"yellow ball"ãŸãã¯"yellow ball"ã®ããããã§æ§æããããããªãã¡ã2ã€ã®åèªéã®éé祚ã¹ããŒã¹ã«å ããŠãéåžžã¹ããŒã¹ãååšããã ããã'white-space'ã«å¯Ÿãã'normal'å€ã¯å ±ã«çžæ®ºããããã«é£æ¥ããéåžžã¹ããŒã¹ãå¿ èŠãšãããããããã¯å¿ èŠã§ããã
åè ã®å Žåã«ãããŠãããšãè¡ã®æ«å°Ÿã§"yellow"åç¬ã§äžèŽãããšããŠãã"yellowâœ"ã¯æ¬¡ã®è¡ïŒ"âœ"ã¯éæ¹è¡ã¹ããŒã¹ã衚ãããã«ããã§äœ¿çšãããŠããïŒã«æãè¿ããåŸè ã®å Žåã«ãããŠãè¡ã®å é ã«å ãŸããå Žåã"âœball"ã¯éæ¹è¡ã¹ããŒã¹ç±æ¥ã®å¯èŠã€ã³ãã³ããæã€ã ããã
ãããã'white-space'ã'pre-wrap'ã«èšå®ãããå Žåãç·šéèŠåã¯ã代ããã«åã«åèªéã«2ã€ã®éåžžã®ã¹ããŒã¹ã眮ãã2ã€ã®åèªãè¡æ«ã§åå²ãããã¹ãã§ãããã¹ããŒã¹ã¯ã¬ã³ããªã³ã°ããåé€ãããŠãããã«ãªãã
çšèªã¢ã¯ãã£ãç¯å²ãç·šéãã¹ããããã³ç·šéå¯èœã®å®çŸ©ãç·šéãã¹ããŸãã¯ç·šéå¯èœã§ããèŠçŽ ã®ãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ãŒã¹èŠä»¶ãexecCommand()ãqueryCommandEnabled()ãqueryCommandIndeterm()ãqueryCommandState()ãqueryCommandSupported()ãããã³queryCommandValue()ã¡ãœãããããã¹ãéžæãããã³éžæåé€ã¢ã«ãŽãªãºã ã¯ãHTML Editing API仿§ã§å®çŸ©ããããç·šéã®ã€ã³ã¿ã©ã¯ã·ã§ã³ããã³ãŠãŒã¶ãŒãšãŒãžã§ã³ãã§ã®ã¢ã³ãã¥/ãªãã¥æ©èœã¯ãUndoManagerããã³DOM Transaction仿§ã«ãã£ãŠå®çŸ©ãããã[EDITING] [UNDO]
User agents can support the checking of spelling and grammar of editable text, either in form
controls (such as the value of textarea elements), or in elements in an editing
host (e.g. using contenteditable).
For each element, user agents must establish a default behavior, either through defaults or through preferences expressed by the user. There are three possible default behaviors for each element:
spellcheck屿§ã¯ãããŒã¯ãŒãã空æååãtrueããã³falseãšãªãåæå±æ§ã§ãããç©ºã®æååããã³trueããŒã¯ãŒãã¯ãtrueç¶æ
ã«å¯Ÿå¿ãããfalseããŒã¯ãŒãã¯ãfalseç¶æ
ã«å¯Ÿå¿ãããããã«ãdefaultç¶æ
ãšãã第3ã®ç¶æ
ãååšãããããã¯æ¬ èœããå€ã®ããã©ã«ãïŒããã³åŠ¥åœã§ãªãå€ã®ããã©ã«ãïŒã§ããã
trueç¶æ
ã¯ãèŠçŽ ããã®ã¹ãã«ããã³ææ³ãã§ãã¯ãæã€ããšã瀺ããdefaultç¶æ
ã¯ã以äžã§å®çŸ©ãããããã«ã芪èŠçŽ ã®ç¬èªã®spellcheckç¶æ
ã«ããããåºã¥ããŠãããã©ã«ãã®åäœã«å¿ããŠåäœããèŠçŽ ã§ããããšã瀺ããfalseç¶æ
ã¯ãèŠçŽ ããã§ãã¯ãããªãããšã瀺ãã
spellcheck [ = value ]èŠçŽ ãã¹ãã«ãææ³ãã§ãã¯ãæã€å Žåã¯trueãè¿ããããã§ãªããã°falseãè¿ãã
ããã©ã«ããäžæžãããŠspellcheckã³ã³ãã³ã屿§ãèšå®ããããã®ãèšå®ãå¯èœã§ããã
The spellcheck IDL attribute, on getting, must
return true if the element's spellcheck content attribute is
in the true state, or if the element's spellcheck
content attribute is in the default state and the element's default behavior is true-by-default, or if the element's spellcheck content attribute is in the default state and the
element's default behavior is inherit-by-default and the element's parent
element's spellcheck IDL attribute would return true;
otherwise, if none of those conditions applies, then the attribute must instead return false.
The spellcheck IDL attribute is not affected
by user preferences that override the spellcheck content
attribute, and therefore might not reflect the actual spellchecking state.
On setting, if the new value is true, then the element's spellcheck content attribute must be set to the literal string
"true", otherwise it must be set to the literal string "false".
User agents must only consider the following pieces of text as checkable for the purposes of this feature:
input elements whose type attributes are in the Text, Search,
URL, or E-mail states and that are mutable (i.e. that do not have the readonly attribute specified and that are not disabled).textarea elements that do not
have a readonly attribute and that are not disabled.Text nodes that are children of editing
hosts or editable elements.For text that is part of a Text node, the element with which the text is
associated is the element that is the immediate parent of the first character of the word,
sentence, or other piece of text. For text in attributes, it is the attribute's element. For the
values of input and textarea elements, it is the element itself.
To determine if a word, sentence, or other piece of text in an applicable element (as defined above) is to have spelling- and grammar-checking enabled, the UA must use the following algorithm:
spellcheck content attribute, then: if that attribute is in the
true state, then checking is enabled; otherwise, if that attribute is in the false
state, then checking is disabled.spellcheck content attribute that is not in the default
state, then: if the nearest such ancestor's spellcheck
content attribute is in the true state, then checking is enabled; otherwise, checking is
disabled.If the checking is enabled for a word/sentence/text, the user agent should indicate spelling
and grammar errors in that text. User agents should take into account the other semantics given in
the document when suggesting spelling and grammar corrections. User agents may use the language of
the element to determine what spelling and grammar rules to use, or may use the user's preferred
language settings. UAs should use input element attributes such as pattern to ensure that the resulting value is valid, where
possible.
If checking is disabled, the user agent should not indicate spelling or grammar errors for that text.
Even when checking is enabled, user agents may opt to not report spelling or grammar errors in text that the user agent deems the user has no interest in having checked (e.g. text that was already present when the page was loaded, or that the user did not type, or text in controls that the user has not focused, or in parts of e-mail addresses that the user agent is not confident were misspelt).
The element with ID "a" in the following example would be the one used to determine if the word "Hello" is checked for spelling errors. In this example, it would not be.
<div contenteditable="true"> <span spellcheck="false" id="a">Hell</span><em>o!</em> </div>
The element with ID "b" in the following example would have checking enabled (the leading
space character in the attribute's value on the input element causes the attribute
to be ignored, so the ancestor's value is used instead, regardless of the default).
<p spellcheck="true"> <label>Name: <input spellcheck=" false" id="b"></label> </p>
ãã®ä»æ§ã¯ãã¹ãã«ãææ³ãã§ãã«ãŒã«å¯ŸãããŠãŒã¶ãŒã€ã³ã¿ãŒãã§ãŒã¹ãå®çŸ©ããªãããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãªã³ããã³ããã§ãã¯ãæäŸãããããããããã§ãã¯ãæå¹ã§ããéã«é£ç¶çãªãã§ãã¯ãå®è¡ãããããããããŸãã¯ä»ã®ã€ã³ã¿ãŒãã§ãŒã¹ã䜿çšãããããããªãã