Changeset 49743 in webkit


Ignore:
Timestamp:
Oct 17, 2009 1:00:33 PM (15 years ago)
Author:
eric@webkit.org
Message:

2009-10-17 Joanmarie Diggs <joanmarie.diggs@gmail.com>

Reviewed by Xan Lopez.

https://bugs.webkit.org/show_bug.cgi?id=25413
[GTK] Please expose the level of headings

Exposes the heading level as an attribute of the AtkObject.

  • accessibility/gtk/AccessibilityObjectWrapperAtk.cpp: (addAttributeToSet): (webkit_accessible_get_attributes): (webkit_accessible_class_init):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r49742 r49743  
     12009-10-17  Joanmarie Diggs  <joanmarie.diggs@gmail.com>
     2
     3        Reviewed by Xan Lopez.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=25413
     6        [GTK] Please expose the level of headings
     7
     8        Exposes the heading level as an attribute of the AtkObject.
     9
     10        * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
     11        (addAttributeToSet):
     12        (webkit_accessible_get_attributes):
     13        (webkit_accessible_class_init):
     14
    1152009-10-17  Kwang Yul Seo  <skyul@company100.net>
    216
  • trunk/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp

    r48511 r49743  
    173173    notImplemented();
    174174    return 0;
     175}
     176
     177static AtkAttributeSet* addAttributeToSet(AtkAttributeSet* attributeSet, const char* name, const char* value)
     178{
     179    AtkAttribute* attribute = static_cast<AtkAttribute*>(g_malloc(sizeof(AtkAttribute)));
     180    attribute->name = g_strdup(name);
     181    attribute->value = g_strdup(value);
     182    attributeSet = g_slist_prepend(attributeSet, attribute);
     183
     184    return attributeSet;
     185}
     186
     187static AtkAttributeSet* webkit_accessible_get_attributes(AtkObject* object)
     188{
     189    AtkAttributeSet* attributeSet = NULL;
     190
     191    int headingLevel = core(object)->headingLevel();
     192    if (headingLevel) {
     193        String value = String::number(headingLevel);
     194        attributeSet = addAttributeToSet(attributeSet, "level", value.utf8().data());
     195    }
     196    return attributeSet;
    175197}
    176198
     
    409431    klass->ref_state_set = webkit_accessible_ref_state_set;
    410432    klass->get_index_in_parent = webkit_accessible_get_index_in_parent;
     433    klass->get_attributes = webkit_accessible_get_attributes;
    411434}
    412435
Note: See TracChangeset for help on using the changeset viewer.