Chromium-based Windows applications under Wine (Electron, CEF) exposed only what the legacy MSAA path could announce, one event at a time. The helper now starts a publisher for each Chromium window: a PE worker reads the page through MSAA and IAccessible2 inside the prefix, and a native ATK publisher presents it on the accessibility bus as toolkit Chromium, matching native Linux Chromium, so the reader's own browser support handles browse mode, structural navigation, forms, tables and live regions. Once a window is published, legacy announcements for it stop, so nothing is spoken twice; if the publisher fails, the window returns to the legacy path and the helper retries with backoff. Publishers follow the helper's lifetime. The publisher marks itself with WINE_ACCESS_BROWSER_PUBLISHER=1 and gives each frame a wine-access-x11-window attribute so readers can verify window ownership. Password text, values and boundaries never leave the worker. Design, mapping rules and verification are in docs/browser.md; the IAccessible2 IDL is vendored in third_party/ia2. Checked: xvfb-run ctest (all 10, including the new browser-publisher-snapshot comparison with native Chromium 158 and Electron 42), menu_integration.py with the menu and edit fixtures, the Orca extension unit tests, and tests/browser/live_checks.sh against Electron 45: worker protocol, helper lifecycle (publish, no legacy announcements while typing, restart, no orphans), and live tree, text boundaries and AT-SPI event sequence matching native Chromium. A live test with Cthulhu on Electron 45 read the fixture page correctly. Remaining live checks: Orca with the extension, Firefox, WebView2, 32-bit browsers, iframes, and window switching under other window managers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
59 lines
2.1 KiB
Python
Executable File
59 lines
2.1 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
"""Compare a native Chromium event log with a Wine Access publisher event log.
|
|
|
|
Usage: compare_events.py NATIVE.events.txt PUBLISHER.events.txt
|
|
Exits 0 when the logs match after the documented normalizations, 1 otherwise.
|
|
"""
|
|
|
|
import difflib
|
|
import re
|
|
import sys
|
|
|
|
# Each rule: (reason, predicate or rewrite) applied to both logs.
|
|
DROPPED = [
|
|
("atk-bridge reports objects defunct when it drops its temporary references; native Chromium shows "
|
|
"the same on objects that stay in place, so these say nothing about presentation",
|
|
re.compile(r"^object:state-changed:defunct ")),
|
|
("native Chromium has browser UI (address bar, navigation buttons) that an Electron window does not",
|
|
re.compile(r" src=(entry:Address and search bar|button:(Back|Forward|Reload|Home))\b")),
|
|
]
|
|
REWRITES = [
|
|
("the removed child is described after removal, so its role depends on timing; the event itself matters",
|
|
re.compile(r"^(object:children-changed:remove .*) data=.*$"), r"\1 data=<removed>"),
|
|
]
|
|
|
|
|
|
def normalize(path):
|
|
lines = []
|
|
with open(path, encoding="utf-8") as logFile:
|
|
for line in logFile.read().splitlines():
|
|
if any(pattern.search(line) for _reason, pattern in DROPPED):
|
|
continue
|
|
for _reason, pattern, replacement in REWRITES:
|
|
line = pattern.sub(replacement, line)
|
|
lines.append(line)
|
|
return lines
|
|
|
|
|
|
def main():
|
|
if len(sys.argv) != 3:
|
|
print(__doc__)
|
|
return 2
|
|
nativeLines = normalize(sys.argv[1])
|
|
publisherLines = normalize(sys.argv[2])
|
|
if sum(1 for line in nativeLines if line.startswith("STEP")) == 0:
|
|
print("The native log has no steps")
|
|
return 1
|
|
difference = list(difflib.unified_diff(nativeLines, publisherLines, "native", "publisher", lineterm=""))
|
|
if difference:
|
|
print("\n".join(difference))
|
|
print("MISMATCH")
|
|
return 1
|
|
events = sum(1 for line in nativeLines if not line.startswith("STEP"))
|
|
print(f"MATCH ({events} events after allowed differences)")
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|