Changeset 81587 in webkit
- Timestamp:
- Mar 21, 2011 9:32:27 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r81584 r81587 1 2011-03-21 Mario Sanchez Prada <msanchez@igalia.com> 2 3 Reviewed by Martin Robinson. 4 5 [GTK] [Stable] AtkHypertext exposes wrong offsets for links placed inside <span> nodes 6 https://bugs.webkit.org/show_bug.cgi?id=56737 7 8 Only consider parent objects not ignoring accessibility. 9 10 * accessibility/gtk/WebKitAccessibleHyperlink.cpp: 11 (webkitAccessibleHyperlinkGetStartIndex): Look for the parent 12 object not ignoring accessibility for the current hyperlink. 13 (webkitAccessibleHyperlinkGetEndIndex): Ditto. 14 1 15 2011-03-21 Andreas Kling <kling@webkit.org> 2 16 -
trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleHyperlink.cpp
r71026 r81587 33 33 #include "RenderObject.h" 34 34 #include "TextIterator.h" 35 #include "htmlediting.h" 35 36 36 37 #include <atk/atk.h> … … 231 232 return 0; 232 233 234 AccessibilityObject* parentUnignored = coreObject->parentObjectUnignored(); 235 if (!parentUnignored) 236 return 0; 237 233 238 Node* node = coreObject->node(); 234 239 if (!node) 235 240 return 0; 236 241 237 RefPtr<Range> range = Range::create(node->document(), firstPositionInNode(node->parentNode()), firstPositionInNode(node)); 242 Node* parentNode = parentUnignored->node(); 243 if (!parentNode) 244 return 0; 245 246 RefPtr<Range> range = Range::create(node->document(), firstPositionInOrBeforeNode(parentNode), firstPositionInOrBeforeNode(node)); 238 247 return getRangeLengthForObject(coreObject, range.get()); 239 248 } … … 247 256 return 0; 248 257 258 AccessibilityObject* parentUnignored = coreObject->parentObjectUnignored(); 259 if (!parentUnignored) 260 return 0; 261 249 262 Node* node = coreObject->node(); 250 263 if (!node) 251 264 return 0; 252 265 253 RefPtr<Range> range = Range::create(node->document(), firstPositionInNode(node->parentNode()), lastPositionInNode(node)); 266 Node* parentNode = parentUnignored->node(); 267 if (!parentNode) 268 return 0; 269 270 RefPtr<Range> range = Range::create(node->document(), firstPositionInOrBeforeNode(parentNode), lastPositionInOrAfterNode(node)); 254 271 return getRangeLengthForObject(coreObject, range.get()); 255 272 } -
trunk/Source/WebKit/gtk/ChangeLog
r81486 r81587 1 2011-03-21 Mario Sanchez Prada <msanchez@igalia.com> 2 3 Reviewed by Martin Robinson. 4 5 [GTK] [Stable] AtkHypertext exposes wrong offsets for links placed inside <span> nodes 6 https://bugs.webkit.org/show_bug.cgi?id=56737 7 8 * tests/testatk.c: 9 (testWebkitAtkHypertextAndHyperlinks): Updated unit test to also 10 check offsets for hyperlinks inside <span> nodes. 11 1 12 2011-03-18 David Keijser <keijser@gmail.com> and Xan Lopez <xlopez@igalia.com> 2 13 -
trunk/Source/WebKit/gtk/tests/testatk.c
r78978 r81587 53 53 static const char* formWithTextInputs = "<html><body><form><input type='text' name='entry' /></form></body></html>"; 54 54 55 static const char* hypertextAndHyperlinks = "<html><body><p>A paragraph with no links at all</p><p><a href='http://foo.bar.baz/'>A line</a> with <a href='http://bar.baz.foo/'>a link in the middle</a> as well as at the beginning and <a href='http://baz.foo.bar/'>at the end</a></p>< /body></html>";55 static const char* hypertextAndHyperlinks = "<html><body><p>A paragraph with no links at all</p><p><a href='http://foo.bar.baz/'>A line</a> with <a href='http://bar.baz.foo/'>a link in the middle</a> as well as at the beginning and <a href='http://baz.foo.bar/'>at the end</a></p><ol><li>List item with a <span><a href='http://foo.bar.baz/'>link inside a span node</a></span></li></ol></body></html>"; 56 56 57 57 static const char* layoutAndDataTables = "<html><body><table><tr><th>Odd</th><th>Even</th></tr><tr><td>1</td><td>2</td></tr></table><table><tr><td>foo</td><td>bar</td></tr></table></body></html>"; … … 1406 1406 g_assert_cmpstr(atk_hyperlink_get_uri(hLink3, 0), ==, "http://baz.foo.bar/"); 1407 1407 1408 AtkObject* list = atk_object_ref_accessible_child(object, 2); 1409 g_assert(ATK_OBJECT(list)); 1410 g_assert(atk_object_get_role(list) == ATK_ROLE_LIST); 1411 g_assert_cmpint(atk_object_get_n_accessible_children(list), ==, 1); 1412 1413 AtkObject* listItem = atk_object_ref_accessible_child(list, 0); 1414 g_assert(ATK_IS_TEXT(listItem)); 1415 g_assert(ATK_IS_HYPERTEXT(listItem)); 1416 1417 AtkHyperlink* hLinkInListItem = atk_hypertext_get_link(ATK_HYPERTEXT(listItem), 0); 1418 g_assert(ATK_HYPERLINK(hLinkInListItem)); 1419 AtkObject* hLinkObject = atk_hyperlink_get_object(hLinkInListItem, 0); 1420 g_assert(ATK_OBJECT(hLinkObject)); 1421 g_assert(atk_object_get_role(hLinkObject) == ATK_ROLE_LINK); 1422 g_assert_cmpint(atk_hyperlink_get_start_index(hLinkInListItem), ==, 20); 1423 g_assert_cmpint(atk_hyperlink_get_end_index(hLinkInListItem), ==, 43); 1424 g_assert_cmpint(atk_hyperlink_get_n_anchors(hLinkInListItem), ==, 1); 1425 g_assert_cmpstr(atk_hyperlink_get_uri(hLinkInListItem, 0), ==, "http://foo.bar.baz/"); 1426 1408 1427 /* Finally check the AtkAction interface for a given AtkHyperlink. */ 1409 1428 g_assert(ATK_IS_ACTION(hLink1)); … … 1415 1434 g_object_unref(paragraph1); 1416 1435 g_object_unref(paragraph2); 1436 g_object_unref(list); 1437 g_object_unref(listItem); 1417 1438 g_object_unref(webView); 1418 1439 }
Note: See TracChangeset
for help on using the changeset viewer.