Closed Bug 1550644 Opened 5 years ago Closed 2 years ago

Name from subtree calculation splits text for all text nodes which are direct children of a block element

Categories

(Core :: Disability Access APIs, defect, P3)

defect

Tracking

()

RESOLVED FIXED
100 Branch
Tracking Status
firefox100 --- fixed

People

(Reporter: Jamie, Assigned: Jamie)

References

Details

(Keywords: parity-chrome)

Attachments

(1 file)

(Spun off bug 1524539 comment 11.)

  1. A11y splits the string for text nodes which are direct children of a block element:
    data:text/html,<div role="option"><strong>a</strong>b</div>
  2. It doesn't do this if both the text nodes are not direct children of the block element:
    data:text/html,<div role="option"><strong>a</strong><span>b</span></div>

Point 2) would suggest that 1) is a bug. I think (but haven't debugged this) that this is caused by the block stuff here:
https://searchfox.org/mozilla-central/source/accessible/base/nsTextEquivUtils.cpp#118
It does that for all text node children. It really shouldn't split the string when there's an inline element in the middle.

I'm not quite sure how to fix this yet. It's going to require some careful thought.

Note that it doesn't do this if the container is an inline element:
data:text/html,<span role="option"><strong>a</strong>b</span>

See Also: → 1758616
Blocks: 1758616
See Also: 1758616
Assignee: nobody → jteh
Keywords: parity-chrome

Previously, when we were about to add text from a text node, we looked at the parent to determine if it was a block element and added space based on that.
This caused problems if there were multiple text nodes inside a block because we ended up adding space between those text nodes, even if there was no intervening block.
Instead, since we're walking the tree, we now add space whenever we encounter a block, both before and after its descendants.
If there are multiple adjacent blocks, this does mean we append multiple spaces, but we compress space befor returning to the caller anyway.
This fixes highlights in address bar suggestions being separated from the rest of the suggestion.

Pushed by jteh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/60cf5a19aa68
nsTextEquivUtils: Add space for block elements when we encounter them. r=eeejay

Backed out changeset 60cf5a19aa68 (Bug 1550644) for causing bc failures on browser_autocomplete_a11y_label.js.
Backout link
Push with failures - bc5
Failure Log

Flags: needinfo?(jteh)

Hi James.
I think this change may fix the failure.
The above patch is that I posted while trying to fix bug 1758616.

Thanks.

Flags: needinfo?(jteh)
Pushed by jteh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1d46ebfbf801
nsTextEquivUtils: Add space for block elements when we encounter them. r=eeejay,adw
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: