Closed Bug 1982324 Opened 7 months ago Closed 6 months ago

Perma /webdriver/tests/bidi/browsing_context/locate_nodes/start_nodes.py | test_locate_with_svg_context_node[accessibility-value3-expected3] - AssertionError

Categories

(Remote Protocol :: WebDriver BiDi, defect, P5)

defect
Points:
1

Tracking

(firefox143 disabled, firefox144 fixed)

RESOLVED FIXED
144 Branch
Tracking Status
firefox143 --- disabled
firefox144 --- fixed

People

(Reporter: whimboo, Assigned: whimboo)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [webdriver:m17], [wptsync upstream])

Attachments

(1 file)

The related test landed in bug 1980195 and was marked as expected perma fail. We should check why it's failing to return the expected node:

https://treeherder.mozilla.org/logviewer?job_id=520310469&repo=try&lineNumber=23165-23181

[task 2025-07-31T09:58:54.339+00:00] 09:58:54     INFO -     def recursive_compare(expected: Any, actual: Any) -> None:
[task 2025-07-31T09:58:54.339+00:00] 09:58:54     INFO -         if callable(expected):
[task 2025-07-31T09:58:54.339+00:00] 09:58:54     INFO -             expected(actual)
[task 2025-07-31T09:58:54.339+00:00] 09:58:54     INFO -             return
[task 2025-07-31T09:58:54.339+00:00] 09:58:54     INFO -     
[task 2025-07-31T09:58:54.339+00:00] 09:58:54     INFO -         if isinstance(actual, List) and isinstance(expected, List):
[task 2025-07-31T09:58:54.339+00:00] 09:58:54     INFO - >           assert len(expected) == len(actual)
[task 2025-07-31T09:58:54.339+00:00] 09:58:54     INFO - E           AssertionError
[task 2025-07-31T09:58:54.339+00:00] 09:58:54     INFO - 
[task 2025-07-31T09:58:54.339+00:00] 09:58:54     INFO - actual     = []
[task 2025-07-31T09:58:54.339+00:00] 09:58:54     INFO - expected   = [{'sharedId': <function any_string at 0x0000021EB10EC680>,
[task 2025-07-31T09:58:54.339+00:00] 09:58:54     INFO -   'type': 'node',
[task 2025-07-31T09:58:54.340+00:00] 09:58:54     INFO -   'value': {'childNodeCount': 1,
[task 2025-07-31T09:58:54.340+00:00] 09:58:54     INFO -             'localName': 'p',
[task 2025-07-31T09:58:54.340+00:00] 09:58:54     INFO -             'namespaceURI': 'http://www.w3.org/1999/xhtml',
[task 2025-07-31T09:58:54.340+00:00] 09:58:54     INFO -             'nodeType': 1}}]
Severity: -- → S3
Priority: -- → P3
Whiteboard: [webdriver:backlog]
Severity: S3 → S4
Keywords: test-disabled
Priority: P3 → P5
Summary: "browsingContext.locateNodes" fails with an SVG element as start node → Perma /webdriver/tests/bidi/browsing_context/locate_nodes/start_nodes.py | test_locate_with_svg_context_node[accessibility-value3-expected3] - AssertionError

The test as written is wrong. Have a look at the following page content:

      <svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg">
        <circle aria-label="circle" cx="5" cy="5" r="5" />
        <p role="banner" aria-label="bar">foo</p>
      </svg>

Here we are putting a p element inside a svg which is not possible because it's not part of the SVG namespace. All browsers render the p element outside of the svg. As such no result should be returned when querying for accessibility role banner and name bar.

Note that all the browsers are failing this test including Chrome:

https://wpt.fyi/results/webdriver/tests/bidi/browsing_context/locate_nodes/start_nodes.py?label=master&label=experimental&product=firefox&product=firefox_android&product=chrome&product=chrome_android&product=safari&view=subtest

Alex, you wrote this test and I assume this slipped through. Maybe you wanted to use g instead? Changing this small thing makes the test work. I'll put up a patch to fix it.

Flags: needinfo?(alexrudenko)
Assignee: nobody → hskupin
Status: NEW → ASSIGNED

Interesting is that the innerText locator tests are passing with Chrome and the unmodified test, which treats me to believe that there is a bug in Chrome. Such a call shouldn't return an element. Alex, maybe you can check?

Points: --- → 1
Whiteboard: [webdriver:backlog] → [webdriver:m17]
Pushed by hskupin@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/44ed63029ba0 https://hg.mozilla.org/integration/autoland/rev/a8010aeef9b0 [wdspec] Fix test "locate_nodes/start_nodes.py | test_locate_with_svg_context_node" for accessibility locator. r=webdriver-reviewers,jdescottes
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 144 Branch
Blocks: 1743116
Keywords: test-disabled
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/54742 for changes under testing/web-platform/tests
Whiteboard: [webdriver:m17] → [webdriver:m17], [wptsync upstream]
Upstream PR merged by moz-wptsync-bot

IIRC it passed when I tested. At least I could see a11y nodes in DevTools's a11y tree. In any case, the important part is that SVG node is accepted as the context node so please make any changes you found necessary!

Flags: needinfo?(alexrudenko)

I see it has landed! Thanks!

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

Attachment

General

Created:
Updated:
Size: