Re: trimming whitespace in name and description calculation

Hi Fred,

> Is trimming whitespace described elsewhere?

The accname-aam uses the phrase "flat text string" in many places to
describe both intermediate and final results.  The term itself is
defined in the "Terminology" section [1], repeated here:

"Flat string:  A string of characters where all carriage returns,
newlines, tabs, and form-feeds are replaced with a single space, and
multiple spaces are reduced to a single space. The string contains only
character data; it does not contain any markup."

Section 5 begins, "Each step of the algorithm generates a flat text
string".  Each step itself says (paraphrase) that the result of that
step is appended with a space to the current accumulated text (although
there is one case [step 2F.iii] with an editor's note about sometimes
appending without a space).  "Appending with/without a space" is also
defined in the Terminology section.

The logic is that each step produces a flat string, and that flat string
is appended to the current result, which is also a flat string.  Since a
flat string is defined as containing nothing but single spaces between
text tokens, all intermediate results and the final result are
effectively trimmed.

Hope that helps.

[1] https://w3c.github.io/aria/accname-aam/accname-aam.html#terminology

On 2016-06-10 11:53 AM, Fred Esch wrote:
>
> Hi Joseph,
>
> In January, Joanie noted that trimming whitespace was omitted from the
> name and description calculation. The only place I can find trimming
> white space mentioned is in the second sentence of Accessible Name and
> Description Mapping
> <http://w3c.github.io/aria/accname-aam/accname-aam.html#accessible-name-and-description-mapping>.
>
>
> /An implementation//trims//the text and concatenates it with the text
> alternative computed by previous steps. /
>
> Is trimming whitespace described elsewhere? In SVG, we have at least
> one rule that is dependent on whether a string is empty or not. In SVG
> Views
> <https://rawgit.com/w3c/aria/master/svg-aam/svg-aam.html#mapping_view>
> in the second bullet we have
> /If the result is a//non-empty string//, it //SHOULD//replace the
> corresponding name or description for the //svg//element while the
> view is in effect. /
>
> Even though this is a SHOULD I am wondering whether trimming strings
> is adequately defined.
>
>
> Regards,
>
> Fred Esch
> Watson, IBM, W3C Accessibility
> IBM Watson 	Watson Release Management and Quality
>
>
>

-- 
;;;;joseph.

'Die Wahrheit ist Irgendwo da Draußen. Wieder.'
                 - C. Carter -

Received on Friday, 10 June 2016 20:26:13 UTC