Accessibility/TextAttributes: Difference between revisions
| Line 96: | Line 96: | ||
| background-color | | background-color | ||
| Background color as u, u, u | | Background color as u, u, u | ||
| ? | | no default, always specified? | ||
|- | |- | ||
| color | | color | ||
| Foreground color as u, u, u | | Foreground color as u, u, u | ||
| ? | | no default, always specified? | ||
|- | |- | ||
| font-family | | font-family | ||
| The computed font name | | The computed font name | ||
| ? | | no default, always specified? | ||
|- | |- | ||
| font-size | | font-size | ||
| Font size in pixels | | Font size in pixels | ||
| ? | | no default, always specified? | ||
|- | |- | ||
| font-style | | font-style | ||
| Line 117: | Line 117: | ||
| The computed font weight (100, 200, 300, 400, 500, 600, 700, 800, 900; normal = 400, bold = 700) | | The computed font weight (100, 200, 300, 400, 500, 600, 700, 800, 900; normal = 400, bold = 700) | ||
| 400 | | 400 | ||
|- | |- | ||
| text-line-through-style | | text-line-through-style | ||
| | | solid (only exposed if if there is a line through) | ||
| no line through | | no line through | ||
|- | |- | ||
| text-underline-style | | text-underline-style | ||
| | | solid (only exposed if if there is an underline) | ||
| no underline | | no underline | ||
|- | |- | ||
| line-height | | line-height | ||
| [http://www.w3.org/TR/REC-CSS2/visudet.html#propdef-line-height CSS2] | | [http://www.w3.org/TR/REC-CSS2/visudet.html#propdef-line-height CSS2] | ||
| | | no default, always specified? | ||
|- | |- | ||
| margin-bottom | | margin-bottom | ||
| [http://www.w3.org/TR/REC-CSS2/box.html#propdef-margin-bottom CSS2] | | [http://www.w3.org/TR/REC-CSS2/box.html#propdef-margin-bottom CSS2] | ||
| | | no default, always specified? | ||
|- | |- | ||
| margin-left | | margin-left | ||
| [http://www.w3.org/TR/REC-CSS2/box.html#propdef-margin-left CSS2] | | [http://www.w3.org/TR/REC-CSS2/box.html#propdef-margin-left CSS2] | ||
| | | no default, always specified? | ||
|- | |- | ||
| margin-right | | margin-right | ||
| [http://www.w3.org/TR/REC-CSS2/box.html#propdef-margin-right CSS2] | | [http://www.w3.org/TR/REC-CSS2/box.html#propdef-margin-right CSS2] | ||
| | | no default, always specified? | ||
|- | |- | ||
| text-align | | text-align | ||
| Line 170: | Line 150: | ||
| no indent | | no indent | ||
|} | |} | ||
The following text attributes, which are in the [http://www.linux-foundation.org/en/Accessibility/IAccessible2/TextAttributes IAccessible2 text attribute specification], are not currently supported due to today's limitations of text formatting on the web: | |||
* text-line-through-mode | |||
* text-line-through-type | |||
* text-underline-type | |||
* text-underline-width | |||
* text-underline-mode | |||
= References = | = References = | ||
* [http://www.linux-foundation.org/en/Accessibility/IAccessible2/TextAttributes IA2 Text Attributes] - IAccessible2 Text Attributes Documentation | * [http://www.linux-foundation.org/en/Accessibility/IAccessible2/TextAttributes IA2 Text Attributes] - IAccessible2 Text Attributes Documentation | ||
Revision as of 17:30, 19 November 2007
<< Back to Accessibility Home Page
Introduction
This article is targeted to reflect a support of text attributes by Gecko accessibility API. There is no implementation in Gecko yet. This is a draft of specification how we will do it.
Proposed API
Summary
This is the internal nsIAccessibleText method (not the ATK or IA2 method -- the implementation for those will consume this method).
The following method returns a collection of text attributes at the given offset, and calculates the range where returned attributes are stretched.
nsIPersistentProperties getTextAttributes(in long offset,
out long rangeStartOffset,
out long rangeEndOffset);
Parameters
- offset
- [in] the given offset
- rangeStartOffset
- [out] the start offset of the result range
- rangeEndOffset
- [out] the end offset of the result range
Return Value
A collection of text attributes (the list of pairs consisted from name and value).
Questions
- Range questions
- What is the range hierarchy: are range nested or consecutive? Let we have a text 'abcdefghi'. If ranges are nested then we have two ranges: (0,9) and (3,6). If ranges are consecutive then we have three ranges (0, 3), (3, 6) and (6, 9).
- Should text attributes in a range be either relative to a parent (in the case of nested ranges) or previous (in the case of consecutive ranges) range or cumulative?
- Default attributes
- Should we support default attributes? IA2 hasn't their support.
Events
Summary
When a certain text attribute is changed then 'EVENT_TEXT_ATTRIBUTE_CHANGED' event should be fired.
Questions
- How will AT know what attribute has been changed? Should the getTextAttributes() method return only last changed attribute?
- It's not clear how to track CSS style changes mapped to text attributes. Possibly some of those changes will lead accessible is recreated.
- Are more events other than changes to whether an item is misspelled even useful?
List of supported attributes
Gecko specific
| Attribute name | Attribute description | Default value if attribute not exposed |
|---|---|---|
| direction | rtl or ltr for bidi text | ltr |
| border | not sure how best to expose these properties, or whether to (same with outline CSS property) | no border |
| language | What language is this text in, e.g. en-US (do we want this or do we use IA2::locale and make sure each locale change gets separate accessible object?) | same as doc itself? |
| misspelled | "true" if it is marked by the inline spell checker for being incorrectly spelled. Attribute not present in all other cases. | Not misspelled |
| static | "true" for list bullet/numbering text or layout-inserted text (such as via CSS pseudo styles :before or :after) | false |
| z-index | a number which indicates how low/high an element is | 0 (normal height) |
IA2 proposed
| Attribute name | Attribute description | Default value if attribute not exposed |
|---|---|---|
| background-color | Background color as u, u, u | no default, always specified? |
| color | Foreground color as u, u, u | no default, always specified? |
| font-family | The computed font name | no default, always specified? |
| font-size | Font size in pixels | no default, always specified? |
| font-style | normal/italic/oblique | normal |
| font-weight | The computed font weight (100, 200, 300, 400, 500, 600, 700, 800, 900; normal = 400, bold = 700) | 400 |
| text-line-through-style | solid (only exposed if if there is a line through) | no line through |
| text-underline-style | solid (only exposed if if there is an underline) | no underline |
| line-height | CSS2 | no default, always specified? |
| margin-bottom | CSS2 | no default, always specified? |
| margin-left | CSS2 | no default, always specified? |
| margin-right | CSS2 | no default, always specified? |
| text-align | left/center/right/justify | left |
| text-indent | CSS2 | no indent |
The following text attributes, which are in the IAccessible2 text attribute specification, are not currently supported due to today's limitations of text formatting on the web:
- text-line-through-mode
- text-line-through-type
- text-underline-type
- text-underline-width
- text-underline-mode
References
- IA2 Text Attributes - IAccessible2 Text Attributes Documentation