Accessibility/TextAttributes: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
 
(64 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<small>[[Accessibility |<< Back to Accessibility Home Page]]</small>
<small>[[Accessibility |<< Back to Accessibility Home Page]]</small>


= Attribute list =
Text attributes are now implemented in Firefox 3.1


== Gecko specific ==
This document has been superseded by the official [https://developer.mozilla.org/en/Accessibility/AT-APIs/Gecko/TextAttrs/ text attribute developer docs].


{| summary="Gecko Specific Text Attributes" width="90%" border="1" cellspacing="1" cellpadding="1"
The original text attribute proposal is available in the [https://wiki.mozilla.org/index.php?title=Accessibility/TextAttributes&action=history history for this page].
! Attribute name
! Attribute description
! Text attribute
! Default text attribute
|-
| direction
| rtl or ltr for bidi text
| Yes
| Yes
|-
| border
| not sure how best to expose these properties, or whether to (same with outline CSS property)
| Yes
|
|-
| language
| What language is this text in, e.g. en-US
| Yes
| Yes
|-
| misspelled
| "true" if it is marked by the inline spell checker for being incorrectly spelled (Note: in most cases a special underlining style will accompany this mark, and the underlining+style should also be exposed as a decoration attribute)
| Yes
|
|-
| static
| "true" for list bullet/numbering text or layout-inserted text (such as via CSS pseudo styles :before or :after)
| Yes
|
|-
| z-index
| a number which indicates how low/high an element is
| Yes
|
|}
 
== IA2 proposed ==
 
{| summary="IA2 Proposed Text Attributes" width="90%" border="1" cellspacing="1" cellpadding="1"
! Attribute name
! Attribute description
! Text attribute
! Default text attribute
|-
| background-color
| Background color as u, u, u
| Yes
| Yes
|-
| color
| Foreground color as u, u, u
| Yes
| Yes
|-
| font-family
| The computed font name
| Yes
| Yes
|-
| font-size
| Font size in pixels
| Yes
| Yes
|-
| font-style
| normal/italic/oblique
| Yes
| Yes
|-
| font-weight
| The computed font weight, as a number
| Yes
| Yes
|-
| text-line-through-mode
| continuous
| Yes
| Yes (empty implies none)
|-
| text-line-through-style
| none/solid
| Yes
| Yes (empty implies none)
|-
| text-line-through-type
| none/single
| Yes
| Yes (empty implies none)
|-
| text-underline-mode
| none/continuous
| Yes
| Yes (empty implies none)
|-
| text-underline-style
| none/solid
| Yes
| Yes (empty implies none)
|-
| text-underline-type
| none/single
| Yes
| Yes (empty implies none)
|-
| text-underline-width
| none/normal
| Yes
| Yes (empty implies none)
|-
| line-height
| [http://www.w3.org/TR/REC-CSS2/visudet.html#propdef-line-height CSS2]
| Yes
| Yes (empty implies none)
|-
| margin-bottom
| [http://www.w3.org/TR/REC-CSS2/box.html#propdef-margin-bottom CSS2]
| Yes
| Yes (empty implies none)
|-
| margin-left
| [http://www.w3.org/TR/REC-CSS2/box.html#propdef-margin-left CSS2]
| Yes
| Yes (empty implies none)
|-
| margin-right
| [http://www.w3.org/TR/REC-CSS2/box.html#propdef-margin-right CSS2]
| Yes
| Yes (empty implies none)
|-
| text-align
| left/center/right/justify
| Yes
| Yes
|-
| text-indent
| [http://www.w3.org/TR/REC-CSS2/text.html#propdef-text-indent CSS2]
| Yes
| Yes (empty implies none)
|}
 
= Proposed API =
 
== Summary ==
 
Returns a collection of text attributes at the given offset. 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 ==
 
* What is the range hierarchy: are range nested or consecutive? Let we have a text 'abc<b>def</b>ghi'. 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?
 
= Events =
 
= References =
 
* [http://www.linux-foundation.org/en/Accessibility/IAccessible2/TextAttributes IA2 Text Attributes] - IAccessible2 Text Attributes Documentation

Latest revision as of 19:25, 8 March 2012

<< Back to Accessibility Home Page

Text attributes are now implemented in Firefox 3.1

This document has been superseded by the official text attribute developer docs.

The original text attribute proposal is available in the history for this page.