[orca] Don't treat display:block lists as on the same line as other objects



commit e42b76ef8b7a01c0bd77c975c6d975fe6ebe6f99
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Feb 12 19:21:46 2020 +0100

    Don't treat display:block lists as on the same line as other objects
    
    Lists with display:block are functionally not on the same line as
    surrounding objects such as (but not limited to) headings. Treating
    them as such leads to verbose, and at times confusing, context
    presentation.

 src/orca/scripts/web/script_utilities.py | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 768004ec3..a19758503 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -1522,6 +1522,9 @@ class Utilities(script_utilities.Utilities):
             if self.isLandmark(obj) and self.isLandmark(xObj) and obj != xObj:
                 return False
 
+            if self.isBlockListDescendant(obj) != self.isBlockListDescendant(xObj):
+                return False
+
             xExtents = self.getExtents(xObj, xStart, xStart + 1)
             if self.isMathTopLevel(xObj) or self.isMath(obj):
                 onSameLine = self.extentsAreOnSameLine(extents, xExtents, extents[3])
@@ -3289,6 +3292,12 @@ class Utilities(script_utilities.Utilities):
         self._isInlineListItem[hash(obj)] = rv
         return rv
 
+    def isBlockListDescendant(self, obj):
+        if not self.isListDescendant(obj):
+            return False
+
+        return not self.isInlineListDescendant(obj)
+
     def isListDescendant(self, obj):
         if not (obj and self.inDocumentContent(obj)):
             return False


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]