[orca] Don't bother checking input and textarea elements as complex contenteditable
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Don't bother checking input and textarea elements as complex contenteditable
- Date: Wed, 29 Apr 2020 17:12:13 +0000 (UTC)
commit dfddcff15faf85cfc741ebc0866fb4e069522502
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Wed Apr 29 12:56:33 2020 -0400
Don't bother checking input and textarea elements as complex contenteditable
We want to check editable elements for descendants so we handle rich-text
editors correctly. There's no point in doing this for native input and
textarea elements. Granted, checking for descendants in childless elements
should be super quick. But we're seeing some weird performance problems
when doing this check for giant textareas in Chromium.
src/orca/scripts/web/script_utilities.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 5a90d9a95..c63ad83a7 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -4260,7 +4260,9 @@ class Utilities(script_utilities.Utilities):
hasTextBlockRole = lambda x: x and x.getRole() in self._textBlockElementRoles() \
and not self.isFakePlaceholderForEntry(x)
- if role == pyatspi.ROLE_ENTRY and state.contains(pyatspi.STATE_MULTI_LINE):
+ if self._getTag(obj) in ["input", "textarea"]:
+ rv = False
+ elif role == pyatspi.ROLE_ENTRY and state.contains(pyatspi.STATE_MULTI_LINE):
rv = pyatspi.findDescendant(obj, hasTextBlockRole)
elif state.contains(pyatspi.STATE_EDITABLE):
rv = hasTextBlockRole(obj) or self.isLink(obj)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]