Commit 557e476e authored by xan@webkit.org's avatar xan@webkit.org

2009-07-30 Xan Lopez <xlopez@igalia.com>

        Reviewed by Maciej Stachowiak.

        https://bugs.webkit.org/show_bug.cgi?id=25535
        [GTK] object:state-changed:checked events missing for radio buttons and checkboxes

        Implement state-changed:checked for radio buttons and checkboxes.

        * accessibility/gtk/AXObjectCacheAtk.cpp:
        (WebCore::AXObjectCache::postPlatformNotification):
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::setChecked):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@46574 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c5c00fa1
2009-07-30 Xan Lopez <xlopez@igalia.com>
Reviewed by Maciej Stachowiak.
https://bugs.webkit.org/show_bug.cgi?id=25535
[GTK] object:state-changed:checked events missing for radio buttons and checkboxes
Implement state-changed:checked for radio buttons and checkboxes.
* accessibility/gtk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::postPlatformNotification):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setChecked):
2009-07-30 Xan Lopez <xlopez@igalia.com>
Forgot the 'break'.
......
......@@ -37,8 +37,13 @@ void AXObjectCache::attachWrapper(AccessibilityObject* obj)
g_object_unref(atkObj);
}
void AXObjectCache::postPlatformNotification(AccessibilityObject*, const String&)
void AXObjectCache::postPlatformNotification(AccessibilityObject* coreObject, const String& message)
{
if (message == "AXCheckedStateChanged") {
if (!coreObject->isCheckboxOrRadio())
return;
g_signal_emit_by_name(coreObject->wrapper(), "state-change", "checked", coreObject->isChecked());
}
}
void AXObjectCache::handleFocusedUIElementChanged()
......
......@@ -26,6 +26,7 @@
#include "config.h"
#include "HTMLInputElement.h"
#include "AXObjectCache.h"
#include "CSSPropertyNames.h"
#include "ChromeClient.h"
#include "Document.h"
......@@ -972,6 +973,12 @@ void HTMLInputElement::setChecked(bool nowChecked, bool sendChangeEvent)
if (renderer() && renderer()->style()->hasAppearance())
renderer()->theme()->stateChanged(renderer(), CheckedState);
// Ideally we'd do this from the render tree (matching
// RenderTextView), but it's not possible to do it at the moment
// because of the way the code is structured.
if (renderer() && AXObjectCache::accessibilityEnabled())
renderer()->document()->axObjectCache()->postNotification(renderer(), "AXCheckedStateChanged", true);
// Only send a change event for items in the document (avoid firing during
// parsing) and don't send a change event for a radio button that's getting
// unchecked to match other browsers. DOM is not a useful standard for this
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment