Confirmed users
1,396
edits
(→Text) |
|||
| Line 937: | Line 937: | ||
p.textAttributes.get("font-weight") == 700; // true | p.textAttributes.get("font-weight") == 700; // true | ||
</pre> | </pre> | ||
==Caret and selection== | ==Caret and selection== | ||
Document accessible provides bunch of methods to | Document accessible provides bunch of methods to operate on text selection and caret. | ||
<pre> | <pre> | ||
partial interface AccessibleDocument { | partial interface AccessibleDocument { | ||
attribute AccessiblePos caret; | attribute AccessiblePos caret; | ||
attribute AccessiblePos? selectionStart; | |||
attribute AccessiblePos? selectionEnd; | |||
}; | }; | ||
</pre> | </pre> | ||
| Line 962: | Line 955: | ||
::Returns accessible position for the caret. | ::Returns accessible position for the caret. | ||
</code> | </code> | ||
<code> | <code> | ||
AccessibleDocument .'' | AccessibleDocument .''selectionStart'' | ||
:: | ::Get/set selection start. | ||
AccessibleDocument .''selectionEnd'' | |||
::Get/set selection end. | |||
</code> | </code> | ||
< | <b>Example</b> | ||
</ | |||
< | <pre> | ||
var pos = new A11ePos(new DOMPoint(event.x, event.y)); | |||
document.a11ement.selectionStart = pos; | |||
</ | var pos2 = new A11ePos(pos.anchor.nextSibling); | ||
document.a11ement.selectionEnd = pos; | |||
</pre> | |||
==Geometry== | ==Geometry== | ||