[Webkit-unassigned] [Bug 36128] [Gtk] nameFromChildren is obsolete

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 11 05:00:47 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=36128


Mario Sanchez Prada <msanchez at igalia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msanchez at igalia.com




--- Comment #8 from Mario Sanchez Prada <msanchez at igalia.com>  2010-05-11 05:00:47 PST ---
After some investigation I found that this patch would solve the issue, although I'm not sure that's the right way to go:

diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp
index 071bf5d..15e52ee 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -1007,7 +1007,16 @@ String AccessibilityRenderObject::textUnderElement() const
             // catch stale WebCoreAXObject (see <rdar://problem/3960196>)
             if (frame->document() != node->document())
                 return String();
-            return plainText(rangeOfContents(node).get());
+            String ret = plainText(rangeOfContents(node).get());
+
+            // try the first (text) descendant as a last resort
+            if (!ret.length()) {
+                Node *descendant = node->firstDescendant();
+                if (descendant->isTextNode())
+                    ret = descendant->textContent(false);
+            }
+
+            return ret;
         }
     }

The rationale behind this is that I've observed that, when running the test through the DRT, the return value of plainText() is always an empty String, while directly accessing to the text content of its first descendant (in case it's a text node) returns the right value.

I know this is unlikely to be the right solution, but sharing it anyway just in case someone else, which more knowledge than me at this moment, could comment something about it... or even in case it rang any bell that could lead to the right solution (in case it's not this one).

Btw, Accerciser keeps working fine with this bug applied, and I wasn't able to find any test failing because of this change.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list