Bugzilla – Attachment 187746 Details for
Bug 155705
A11Y crash fetching attribute run in second half of a paragraph split over two pages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Python script to trigger the crash
tdf155705.py (text/x-python), 1.77 KB, created by
cwendling
on 2023-06-06 10:34:44 UTC
(
hide
)
Description:
Python script to trigger the crash
Filename:
MIME Type:
Creator:
cwendling
Created:
2023-06-06 10:34:44 UTC
Size:
1.77 KB
patch
obsolete
>#!/usr/bin/env python3 > >import pyatspi > > >def getApp(name): > for desktop in range(0, pyatspi.Registry.getDesktopCount()): > for app in pyatspi.Registry.getDesktop(desktop): > if app.name == name: > return app > return None > > >def getDescendent(node, pred): > if pred(node): > return node > for child in node: > match = getDescendent(child, pred) > if match: > return match > return None > > >def enumerateAllChildren(node): > """ yields all children of a node, including the ones not directly in the > tree but having flows-to/from relationships because Writer optimizes > out offscreen ones this way. > If everything is on-screen, it should be equivalent to iter(node) """ > > def getFirstRelationTargetOfType(child, rt): > for r in child.getRelationSet(): > if r.getRelationType() == rt: > return r.getTarget(0) > return None > > nChildren = node.getChildCount() > if not nChildren: > return > child = node.getChildAtIndex(0) > # find the actual first child, even if off-screen > while True: > prev = getFirstRelationTargetOfType(child, pyatspi.RELATION_FLOWS_FROM) > if not prev: > break > child = prev > # now yield each child in their flowing order > while child: > yield child > child = getFirstRelationTargetOfType(child, pyatspi.RELATION_FLOWS_TO) > > >def main(): > app = getApp('soffice') > assert app > doc = getDescendent(app, lambda n: n.getRole() == pyatspi.ROLE_DOCUMENT_TEXT) > assert doc > > for child in enumerateAllChildren(doc): > txt = child.queryText() > print("child contents is: %s" % txt.getText(0, -1)) > print(txt.getAttributeRun(0, False)) > > >if __name__ == '__main__': > main()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 155705
:
187745
| 187746 |
187747
|
187751
|
187752