Changeset 72673 in webkit


Ignore:
Timestamp:
Nov 24, 2010 7:56:49 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2010-11-24 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r72499.
http://trac.webkit.org/changeset/72499
https://bugs.webkit.org/show_bug.cgi?id=50022

This change is causing crashes on the bots. (Requested by
mrobinson on #webkit).

  • accessibility/AccessibilityMenuListOption.cpp: (WebCore::AccessibilityMenuListOption::nameForMSAA):
  • accessibility/AccessibilityMenuListOption.h:
  • accessibility/gtk/AXObjectCacheAtk.cpp: (WebCore::AXObjectCache::postPlatformNotification):
  • accessibility/gtk/AccessibilityObjectWrapperAtk.cpp: (setAtkStateSetFromCoreObject): (optionFromList): (optionFromSelection): (webkit_accessible_selection_add_selection): (webkit_accessible_selection_clear_selection): (webkit_accessible_selection_get_selection_count): (webkit_accessible_selection_is_child_selected): (webkit_accessible_selection_remove_selection): (webkit_accessible_text_get_text): (getInterfaceMaskFromObject):
  • platform/gtk/PopupMenuGtk.cpp: (WebCore::PopupMenuGtk::show):

2010-11-24 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r72499.
http://trac.webkit.org/changeset/72499
https://bugs.webkit.org/show_bug.cgi?id=50022

This change is causing crashes on the bots. (Requested by
mrobinson on #webkit).

  • tests/testatk.c: (main):
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r72672 r72673  
     12010-11-24  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r72499.
     4        http://trac.webkit.org/changeset/72499
     5        https://bugs.webkit.org/show_bug.cgi?id=50022
     6
     7        This change is causing crashes on the bots. (Requested by
     8        mrobinson on #webkit).
     9
     10        * accessibility/AccessibilityMenuListOption.cpp:
     11        (WebCore::AccessibilityMenuListOption::nameForMSAA):
     12        * accessibility/AccessibilityMenuListOption.h:
     13        * accessibility/gtk/AXObjectCacheAtk.cpp:
     14        (WebCore::AXObjectCache::postPlatformNotification):
     15        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
     16        (setAtkStateSetFromCoreObject):
     17        (optionFromList):
     18        (optionFromSelection):
     19        (webkit_accessible_selection_add_selection):
     20        (webkit_accessible_selection_clear_selection):
     21        (webkit_accessible_selection_get_selection_count):
     22        (webkit_accessible_selection_is_child_selected):
     23        (webkit_accessible_selection_remove_selection):
     24        (webkit_accessible_text_get_text):
     25        (getInterfaceMaskFromObject):
     26        * platform/gtk/PopupMenuGtk.cpp:
     27        (WebCore::PopupMenuGtk::show):
     28
    1292010-11-24  Patrick Gansterer  <paroga@webkit.org>
    230
  • trunk/WebCore/accessibility/AccessibilityMenuListOption.cpp

    r72499 r72673  
    9292String AccessibilityMenuListOption::nameForMSAA() const
    9393{
    94     return stringValue();
     94    return static_cast<HTMLOptionElement*>(m_element.get())->text();
    9595}
    9696
     
    111111}
    112112
    113 String AccessibilityMenuListOption::stringValue() const
    114 {
    115     return static_cast<HTMLOptionElement*>(m_element.get())->text();
    116 }
    117 
    118113} // namespace WebCore
  • trunk/WebCore/accessibility/AccessibilityMenuListOption.h

    r72499 r72673  
    6060    virtual bool canSetSelectedAttribute() const;
    6161    virtual IntRect elementRect() const;
    62     virtual String stringValue() const;
    6362
    6463    RefPtr<HTMLElement> m_element;
  • trunk/WebCore/accessibility/gtk/AXObjectCacheAtk.cpp

    r72499 r72673  
    9696void AXObjectCache::postPlatformNotification(AccessibilityObject* coreObject, AXNotification notification)
    9797{
    98     AtkObject* axObject = coreObject->wrapper();
    99     if (!axObject)
    100         return;
    101 
    10298    if (notification == AXCheckedStateChanged) {
    10399        if (!coreObject->isCheckboxOrRadio())
    104100            return;
    105         g_signal_emit_by_name(axObject, "state-change", "checked", coreObject->isChecked());
    106     } else if (notification == AXMenuListValueChanged) {
    107         if (!coreObject->isMenuList())
    108             return;
    109         g_signal_emit_by_name(axObject, "focus-event", true);
    110         g_signal_emit_by_name(axObject, "state-change", "focused", true);
     101        g_signal_emit_by_name(coreObject->wrapper(), "state-change", "checked", coreObject->isChecked());
    111102    } else if (notification == AXSelectedChildrenChanged)
    112103        notifyChildrenSelectionChange(coreObject);
  • trunk/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp

    r72499 r72673  
    5959#include "RenderListMarker.h"
    6060#include "RenderText.h"
    61 #include "SelectElement.h"
    6261#include "TextEncoding.h"
    6362#include "TextIterator.h"
     
    502501    }
    503502
    504     if (coreObject->canSetExpandedAttribute())
    505         atk_state_set_add_state(stateSet, ATK_STATE_EXPANDABLE);
    506 
    507     if (coreObject->isExpanded())
    508         atk_state_set_add_state(stateSet, ATK_STATE_EXPANDED);
    509 
    510503    if (coreObject->canSetFocusAttribute())
    511504        atk_state_set_add_state(stateSet, ATK_STATE_FOCUSABLE);
     
    702695// Selection (for controls)
    703696
    704 static AccessibilityObject* listObjectForSelection(AtkSelection* selection)
    705 {
    706     AccessibilityObject* coreSelection = core(selection);
    707 
    708     // Only list boxes and menu lists supported so far.
    709     if (!coreSelection->isListBox() && !coreSelection->isMenuList())
    710         return 0;
    711 
    712     // For list boxes the list object is just itself.
    713     if (coreSelection->isListBox())
    714         return coreSelection;
    715 
    716     // For menu lists we need to return the first accessible child,
    717     // with role MenuListPopupRole, since that's the one holding the list
    718     // of items with role MenuListOptionRole.
    719     AccessibilityObject::AccessibilityChildrenVector children = coreSelection->children();
    720     if (!children.size())
    721         return 0;
    722 
    723     AccessibilityObject* listObject = children.at(0).get();
    724     if (!listObject->isMenuListPopup())
    725         return 0;
    726 
    727     return listObject;
    728 }
    729 
    730697static AccessibilityObject* optionFromList(AtkSelection* selection, gint i)
    731698{
     
    734701        return 0;
    735702
    736     // Need to select the proper list object depending on the type.
    737     AccessibilityObject* listObject = listObjectForSelection(selection);
    738     if (!listObject)
    739         return 0;
    740 
    741     AccessibilityRenderObject::AccessibilityChildrenVector options = listObject->children();
     703    AccessibilityRenderObject::AccessibilityChildrenVector options = core(selection)->children();
    742704    if (i < static_cast<gint>(options.size()))
    743705        return options.at(i).get();
     
    751713
    752714    AccessibilityObject* coreSelection = core(selection);
    753     if (!coreSelection || !coreSelection->isAccessibilityRenderObject() || i < 0)
     715    if (!coreSelection || i < 0)
    754716        return 0;
    755717
    756718    AccessibilityRenderObject::AccessibilityChildrenVector selectedItems;
    757719    if (coreSelection->isListBox())
    758         coreSelection->selectedChildren(selectedItems);
    759     else if (coreSelection->isMenuList()) {
    760         RenderObject* renderer = toAccessibilityRenderObject(coreSelection)->renderer();
    761         if (!renderer)
    762             return 0;
    763 
    764         SelectElement* selectNode = toSelectElement(static_cast<Element*>(renderer->node()));
    765         int selectedIndex = selectNode->selectedIndex();
    766         const Vector<Element*> listItems = selectNode->listItems();
    767 
    768         if (selectedIndex < 0 || selectedIndex >= static_cast<int>(listItems.size()))
    769             return 0;
    770 
    771         return optionFromList(selection, selectedIndex);
    772     }
     720        static_cast<AccessibilityListBox*>(coreSelection)->selectedChildren(selectedItems);
     721
     722    // TODO: Combo boxes
    773723
    774724    if (i < static_cast<gint>(selectedItems.size()))
     
    779729
    780730static gboolean webkit_accessible_selection_add_selection(AtkSelection* selection, gint i)
     731{
     732    AccessibilityObject* option = optionFromList(selection, i);
     733    if (option && core(selection)->isListBox()) {
     734        AccessibilityListBoxOption* listBoxOption = static_cast<AccessibilityListBoxOption*>(option);
     735        listBoxOption->setSelected(true);
     736        return listBoxOption->isSelected();
     737    }
     738
     739    return false;
     740}
     741
     742static gboolean webkit_accessible_selection_clear_selection(AtkSelection* selection)
    781743{
    782744    AccessibilityObject* coreSelection = core(selection);
     
    784746        return false;
    785747
    786     AccessibilityObject* option = optionFromList(selection, i);
    787     if (option && (coreSelection->isListBox() || coreSelection->isMenuList())) {
    788         option->setSelected(true);
    789         return option->isSelected();
    790     }
    791 
    792     return false;
    793 }
    794 
    795 static gboolean webkit_accessible_selection_clear_selection(AtkSelection* selection)
    796 {
    797     AccessibilityObject* coreSelection = core(selection);
    798     if (!coreSelection)
    799         return false;
    800 
    801748    AccessibilityRenderObject::AccessibilityChildrenVector selectedItems;
    802     if (coreSelection->isListBox() || coreSelection->isMenuList()) {
     749    if (coreSelection->isListBox()) {
    803750        // Set the list of selected items to an empty list; then verify that it worked.
    804751        AccessibilityListBox* listBox = static_cast<AccessibilityListBox*>(coreSelection);
     
    825772{
    826773    AccessibilityObject* coreSelection = core(selection);
    827     if (!coreSelection || !coreSelection->isAccessibilityRenderObject())
    828         return 0;
    829 
    830     if (coreSelection->isListBox()) {
     774    if (coreSelection && coreSelection->isListBox()) {
    831775        AccessibilityRenderObject::AccessibilityChildrenVector selectedItems;
    832         coreSelection->selectedChildren(selectedItems);
     776        static_cast<AccessibilityListBox*>(coreSelection)->selectedChildren(selectedItems);
    833777        return static_cast<gint>(selectedItems.size());
    834778    }
    835779
    836     if (coreSelection->isMenuList()) {
    837         RenderObject* renderer = toAccessibilityRenderObject(coreSelection)->renderer();
    838         if (!renderer)
    839             return 0;
    840 
    841         SelectElement* selectNode = toSelectElement(static_cast<Element*>(renderer->node()));
    842         int selectedIndex = selectNode->selectedIndex();
    843         const Vector<Element*> listItems = selectNode->listItems();
    844 
    845         return selectedIndex >= 0 && selectedIndex < static_cast<int>(listItems.size());
    846     }
    847 
    848780    return 0;
    849781}
     
    851783static gboolean webkit_accessible_selection_is_child_selected(AtkSelection* selection, gint i)
    852784{
    853     AccessibilityObject* coreSelection = core(selection);
    854     if (!coreSelection)
    855         return 0;
    856 
    857785    AccessibilityObject* option = optionFromList(selection, i);
    858     if (option && (coreSelection->isListBox() || coreSelection->isMenuList()))
    859         return option->isSelected();
     786    if (option && core(selection)->isListBox())
     787        return static_cast<AccessibilityListBoxOption*>(option)->isSelected();
    860788
    861789    return false;
     
    864792static gboolean webkit_accessible_selection_remove_selection(AtkSelection* selection, gint i)
    865793{
    866     AccessibilityObject* coreSelection = core(selection);
    867     if (!coreSelection)
    868         return 0;
    869 
    870794    // TODO: This is only getting called if i == 0. What is preventing the rest?
    871795    AccessibilityObject* option = optionFromSelection(selection, i);
    872     if (option && (coreSelection->isListBox() || coreSelection->isMenuList())) {
    873         option->setSelected(false);
    874         return !option->isSelected();
     796    if (option && core(selection)->isListBox()) {
     797        AccessibilityListBoxOption* listBoxOption = static_cast<AccessibilityListBoxOption*>(option);
     798        listBoxOption->setSelected(false);
     799        return !listBoxOption->isSelected();
    875800    }
    876801
     
    1045970    if (coreObject->isTextControl())
    1046971        ret = coreObject->doAXStringForRange(PlainTextRange(start, length));
    1047     else {
    1048         ret = coreObject->stringValue().substring(start, length);
    1049         if (!ret)
    1050             ret = coreObject->textUnderElement().substring(start, length);
    1051     }
     972    else
     973        ret = coreObject->textUnderElement().substring(start, length);
    1052974
    1053975    if (!ret.length()) {
     
    22562178
    22572179    // Action
    2258     // As the implementation of the AtkAction interface is a very
    2259     // basic one (just relays in executing the default action for each
    2260     // object, and only supports having one action per object), it is
    2261     // better just to implement this interface for every instance of
    2262     // the WebKitAccessible class and let WebCore decide what to do.
    2263     interfaceMask |= 1 << WAI_ACTION;
    2264 
    2265     // Hyperlink
    2266     if (coreObject->isLink())
    2267         interfaceMask |= 1 << WAI_HYPERLINK;
     2180    if (!coreObject->actionVerb().isEmpty()) {
     2181        interfaceMask |= 1 << WAI_ACTION;
     2182
     2183        if (!coreObject->accessibilityIsIgnored() && coreObject->isLink())
     2184            interfaceMask |= 1 << WAI_HYPERLINK;
     2185    }
    22682186
    22692187    // Selection
    2270     if (coreObject->isListBox() || coreObject->isMenuList())
     2188    if (coreObject->isListBox())
    22712189        interfaceMask |= 1 << WAI_SELECTION;
    22722190
    22732191    // Text & Editable Text
    2274     if (role == StaticTextRole || coreObject->isMenuListOption())
     2192    if (role == StaticTextRole)
    22752193        interfaceMask |= 1 << WAI_TEXT;
    22762194    else if (coreObject->isAccessibilityRenderObject()) {
  • trunk/WebCore/platform/gtk/PopupMenuGtk.cpp

    r72499 r72673  
    5959        gtk_container_foreach(GTK_CONTAINER(m_popup.get()), reinterpret_cast<GtkCallback>(menuRemoveItem), this);
    6060
    61     int x = 0;
    62     int y = 0;
    63     GdkWindow* window = gtk_widget_get_window(GTK_WIDGET(view->hostWindow()->platformPageClient()));
    64     if (window)
    65         gdk_window_get_origin(window, &x, &y);
     61    int x, y;
     62    gdk_window_get_origin(gtk_widget_get_window(GTK_WIDGET(view->hostWindow()->platformPageClient())), &x, &y);
    6663    m_menuPosition = view->contentsToWindow(rect.location());
    6764    m_menuPosition = IntPoint(m_menuPosition.x() + x, m_menuPosition.y() + y + rect.height());
  • trunk/WebKit/gtk/ChangeLog

    r72634 r72673  
     12010-11-24  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r72499.
     4        http://trac.webkit.org/changeset/72499
     5        https://bugs.webkit.org/show_bug.cgi?id=50022
     6
     7        This change is causing crashes on the bots. (Requested by
     8        mrobinson on #webkit).
     9
     10        * tests/testatk.c:
     11        (main):
     12
    1132010-11-23  Xan Lopez  <xlopez@igalia.com>
    214
  • trunk/WebKit/gtk/tests/testatk.c

    r72499 r72673  
    4545static const char* contentsInTableWithHeaders = "<html><body><table><tr><th>foo</th><th>bar</th><th colspan='2'>baz</th></tr><tr><th>qux</th><td>1</td><td>2</td><td>3</td></tr><tr><th rowspan='2'>quux</th><td>4</td><td>5</td><td>6</td></tr><tr><td>6</td><td>7</td><td>8</td></tr><tr><th>corge</th><td>9</td><td>10</td><td>11</td></tr></table><table><tr><td>1</td><td>2</td></tr><tr><td>3</td><td>4</td></tr></table></body></html>";
    4646
    47 static const char* comboBoxSelector = "<html><body><select><option selected value='foo'>foo</option><option value='bar'>bar</option></select></body></html>";
    48 
    4947static const char* formWithTextInputs = "<html><body><form><input type='text' name='entry' /></form></body></html>";
    5048
     
    222220    testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_END,
    223221                        0, "This is a test. This is the second sentence. And this the third.", 0, 64);
    224 }
    225 
    226 static void testWebkitAtkComboBox()
    227 {
    228     WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
    229     g_object_ref_sink(webView);
    230     GtkAllocation allocation = { 0, 0, 800, 600 };
    231     gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation);
    232     webkit_web_view_load_string(webView, comboBoxSelector, 0, 0, 0);
    233 
    234     /* Wait for the accessible objects to be created. */
    235     waitForAccessibleObjects();
    236 
    237     AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView));
    238     g_assert(object);
    239 
    240     AtkObject* formObject = atk_object_ref_accessible_child(object, 0);
    241     g_assert(formObject);
    242 
    243     AtkObject* comboBox = atk_object_ref_accessible_child(formObject, 0);
    244     g_assert(ATK_IS_OBJECT(comboBox));
    245 
    246     AtkObject* menuPopup = atk_object_ref_accessible_child(comboBox, 0);
    247     g_assert(ATK_IS_OBJECT(menuPopup));
    248 
    249     AtkObject* item1 = atk_object_ref_accessible_child(menuPopup, 0);
    250     g_assert(ATK_IS_OBJECT(item1));
    251 
    252     AtkObject* item2 = atk_object_ref_accessible_child(menuPopup, 1);
    253     g_assert(ATK_IS_OBJECT(item2));
    254 
    255     /* Check roles. */
    256     g_assert(atk_object_get_role(comboBox) == ATK_ROLE_COMBO_BOX);
    257     g_assert(atk_object_get_role(menuPopup) == ATK_ROLE_MENU);
    258     g_assert(atk_object_get_role(item1) == ATK_ROLE_MENU_ITEM);
    259     g_assert(atk_object_get_role(item2) == ATK_ROLE_MENU_ITEM);
    260 
    261     /* Check the implementation of the AtkSelection interface. */
    262     g_assert(ATK_IS_SELECTION(comboBox));
    263     AtkSelection* atkSelection = ATK_SELECTION(comboBox);
    264     g_assert_cmpint(atk_selection_get_selection_count(atkSelection), ==, 1);
    265     g_assert(atk_selection_is_child_selected(atkSelection, 0));
    266     g_assert(!atk_selection_is_child_selected(atkSelection, 1));
    267     AtkObject* selectedItem = atk_selection_ref_selection(atkSelection, 0);
    268     g_assert(selectedItem == item1);
    269     g_object_unref(selectedItem);
    270 
    271     /* Check the implementations of the AtkAction interface. */
    272     g_assert(ATK_IS_ACTION(comboBox));
    273     AtkAction* atkAction = ATK_ACTION(comboBox);
    274     g_assert_cmpint(atk_action_get_n_actions(atkAction), ==, 1);
    275     g_assert(atk_action_do_action(atkAction, 0));
    276 
    277     g_assert(ATK_IS_ACTION(menuPopup));
    278     atkAction = ATK_ACTION(menuPopup);
    279     g_assert_cmpint(atk_action_get_n_actions(atkAction), ==, 1);
    280     g_assert(atk_action_do_action(atkAction, 0));
    281 
    282     g_assert(ATK_IS_ACTION(item1));
    283     atkAction = ATK_ACTION(item1);
    284     g_assert_cmpint(atk_action_get_n_actions(atkAction), ==, 1);
    285     g_assert(atk_action_do_action(atkAction, 0));
    286 
    287     g_assert(ATK_IS_ACTION(item2));
    288     atkAction = ATK_ACTION(item2);
    289     g_assert_cmpint(atk_action_get_n_actions(atkAction), ==, 1);
    290     g_assert(atk_action_do_action(atkAction, 0));
    291 
    292     /* After selecting the second item, selection should have changed. */
    293     g_assert_cmpint(atk_selection_get_selection_count(atkSelection), ==, 1);
    294     g_assert(!atk_selection_is_child_selected(atkSelection, 0));
    295     g_assert(atk_selection_is_child_selected(atkSelection, 1));
    296     selectedItem = atk_selection_ref_selection(atkSelection, 0);
    297     g_assert(selectedItem == item2);
    298     g_object_unref(selectedItem);
    299 
    300     /* Check the implementation of the AtkText interface. */
    301     g_assert(ATK_IS_TEXT(item1));
    302     AtkText* atkText = ATK_TEXT(item1);
    303     char *text = atk_text_get_text(atkText, 0, -1);
    304     g_assert_cmpstr(text, ==, "foo");
    305     g_free(text);
    306     text = atk_text_get_text(atkText, 0, 2);
    307     g_assert_cmpstr(text, ==, "fo");
    308     g_free(text);
    309 
    310     g_assert(ATK_IS_TEXT(item2));
    311     atkText = ATK_TEXT(item2);
    312     text = atk_text_get_text(atkText, 0, -1);
    313     g_assert_cmpstr(text, ==, "bar");
    314     g_free(text);
    315     text = atk_text_get_text(atkText, 1, 3);
    316     g_assert_cmpstr(text, ==, "ar");
    317     g_free(text);
    318 
    319     g_object_unref(formObject);
    320     g_object_unref(comboBox);
    321     g_object_unref(menuPopup);
    322     g_object_unref(item1);
    323     g_object_unref(item2);
    324     g_object_unref(webView);
    325222}
    326223
     
    13151212
    13161213    g_test_bug_base("https://bugs.webkit.org/");
    1317     g_test_add_func("/webkit/atk/comboBox", testWebkitAtkComboBox);
    13181214    g_test_add_func("/webkit/atk/getTextAtOffset", testWebkitAtkGetTextAtOffset);
    13191215    g_test_add_func("/webkit/atk/getTextAtOffsetForms", testWebkitAtkGetTextAtOffsetForms);
Note: See TracChangeset for help on using the changeset viewer.