Last Comment Bug 413394 - ARIA role="presentation" adds whitespace to AT-SPI IText output
: ARIA role="presentation" adds whitespace to AT-SPI IText output
Product: Core
Classification: Components
Component: Disability Access APIs (show other bugs)
: unspecified
: x86 Linux
-- enhancement (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: alexander :surkov
: 415070 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2008-01-21 13:53 PST by Scott Haeger
Modified: 2011-11-01 08:16 PDT (History)
6 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image Scott Haeger 2008-01-21 13:53:41 PST
What I am seeing is that elements with role="presentation" contribute a space to the text string available via the Text interface.  The behavior is similar to an element that does not have role="presentation" where this element contributes an embed character in it's parent text string.  

To test this I looked at the Mozilla ARIA checkbox and manipulated (added additional <img>, removed/added role="presentation" etc.) the image element. You will see embed characters being added when role="presentation" is not present (and the object itself) and whitespace added when role="presentation" is present.

This mainly affects Orca's Braille output where this added space is mixed within the output string.  I often see 4-5 extra characters before labels as a result.  This is not a blocker but is far from trivial as well.
Comment 1 User image Aaron Leventhal 2008-01-31 06:22:28 PST
Probably related or the same: bug 414976.
Comment 2 User image Aaron Leventhal 2008-01-31 06:23:49 PST
Sorry, that was wrong, I meant bug 415070.
Comment 3 User image Aaron Leventhal 2008-02-01 19:46:22 PST
Here's what's happening. The rendering engine is actually rendering a space between the checkbox image and the text, because of the newline. In HTML a newline will cause whitespace to happen between things. This helps to make sure that there is a space rendered between crazy and friend here:
My <i>crazy</i>

So in this test case, if the newline is removed so is the space and you can see the difference in the rendering. The label becomes jammed up against the checkbox:
   <img src="checked.gif" role="presentation" alt="" />Jammed together

as opposed to your example which is like:

    <img src="checked.gif" role="presentation" alt="" />
    Space between image and this label

So, I'm not sure what to do. We're faithfully representing what the rendering engine says is there, although perhaps for widgets you want us to trim whitespace off of the beginning and end. Ideas appreciated.
Comment 4 User image Aaron Leventhal 2008-02-01 20:16:57 PST
*** Bug 415070 has been marked as a duplicate of this bug. ***
Comment 5 User image alexander :surkov 2008-02-02 02:09:45 PST
Sorry if text is rendered then why shoudn't we expose it?
Comment 6 User image Aaron Leventhal 2008-02-02 06:41:42 PST
Right, I think we actually have to expose it because the caret could land there, and we need to be able to expose a caret position for that.

Scott, what do you think?
Comment 7 User image Scott Haeger 2008-02-03 10:07:00 PST
Admittedly, I am a little weak at knowing the details of how Firefox handles text.  I apologize if we are chasing a red herring.  With that said, I understand the problem with the checkbox example and yes, I do believe it should be exposed.  However, I do not understand the buttons on the first toolbar in this example .  I see two spaces (ascii 32) tacked on to the text interface.

I will also ping Joanie on this one.
Comment 8 User image Joanmarie Diggs 2008-02-04 07:37:44 PST
And admittedly I am a little weak at knowing how ARIA works. :-)  That said, I see the two spaces as well. One seems to be associated with a div; the other with a span.  It would be nice to just have one space. :-)
Comment 9 User image David Bolter [:davidb] 2009-06-16 11:56:33 PDT
Mass un-assigning bugs assigned to Aaron.
Comment 10 User image alexander :surkov 2011-03-10 02:27:22 PST
I'm not sure what whitespaces you talk about, could you please look at the testcase again and point where are they?
Comment 11 User image Marco Zehe (:MarcoZ) 2011-03-10 03:10:55 PST
Alex, look at the " Include decorative fruit basket" (yes, I put that intentionally there). The img that represents the checked checkbox symbol is of role "presentation", but the string includes a whitespace there. I see this in NVDA's virtual buffer, where the checkbox label starts with a whitespace.
Comment 12 User image alexander :surkov 2011-03-10 03:41:26 PST
ok, thank you, it's rendered whitespace (I can navigate it by keyboard), but can we do anything with that?
Comment 13 User image Marco Zehe (:MarcoZ) 2011-03-10 09:33:35 PST
No, it's superflous whitespace that cannot be acted on.
Comment 14 User image David Bolter [:davidb] 2011-03-10 10:09:44 PST
We generally strip out a node with role="presentation" but leave any child text nodes. I'm not sure if that's correct.
Comment 15 User image alexander :surkov 2011-03-10 21:02:23 PST
I tend to wontfix it. This issue should be addressed by widget author I think. Are you fine with that?
Comment 16 User image Eitan Isaacson [:eeejay] 2011-11-01 08:16:46 PDT
I will be more aggressive than Alex, and kill this bug :)

Note You need to log in before you can comment on or make changes to this bug.