Changeset 73302 in webkit


Ignore:
Timestamp:
Dec 3, 2010 2:27:53 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2010-12-03 Chris Guillory <chris.guillory@google.com>

Reviewed by Chris Fleizach.

Include the FrameView widget of a RenderWidget in the accessibility tree.
https://bugs.webkit.org/show_bug.cgi?id=49106

  • platform/win/Skipped:

2010-12-03 Chris Guillory <chris.guillory@google.com>

Reviewed by Chris Fleizach.

Include the FrameView widget of a RenderWidget in the accessibility tree.
https://bugs.webkit.org/show_bug.cgi?id=49106

Include render widget children in the accessibility tree for not mac webkit ports.

  • accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::renderParentObject): (WebCore::AccessibilityRenderObject::addChildren): (WebCore::AccessibilityRenderObject::addRenderWidgetChildren):
  • accessibility/AccessibilityRenderObject.h:
  • accessibility/chromium/AccessibilityObjectChromium.cpp: (WebCore::AccessibilityObject::accessibilityIgnoreAttachment):

2010-12-03 Chris Guillory <chris.guillory@google.com>

Reviewed by Chris Fleizach.

Include the FrameView widget of a RenderWidget in the accessibility tree.
https://bugs.webkit.org/show_bug.cgi?id=49106

  • public/WebAccessibilityObject.h:
  • src/WebAccessibilityObject.cpp: (WebKit::WebAccessibilityObject::equals): (WebKit::WebAccessibilityObject::parentObject):

2010-12-03 Chris Guillory <chris.guillory@google.com>

Reviewed by Chris Fleizach.

Include the FrameView widget of a RenderWidget in the accessibility tree.
https://bugs.webkit.org/show_bug.cgi?id=49106

  • DumpRenderTree/chromium/AccessibilityUIElement.cpp: (AccessibilityUIElement::AccessibilityUIElement): (AccessibilityUIElement::parentElementCallback): (AccessibilityUIElement::isEqualCallback):
  • DumpRenderTree/chromium/AccessibilityUIElement.h:
  • DumpRenderTree/chromium/CppBoundClass.cpp: (CppBoundClass::getFromCppVariant):
  • DumpRenderTree/chromium/CppBoundClass.h:
Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r73300 r73302  
     12010-12-03  Chris Guillory  <chris.guillory@google.com>
     2
     3        Reviewed by Chris Fleizach.
     4
     5        Include the FrameView widget of a RenderWidget in the accessibility tree.
     6        https://bugs.webkit.org/show_bug.cgi?id=49106
     7
     8        * platform/win/Skipped:
     9
    1102010-12-03  Victor Wang  <victorw@chromium.org>
    211
  • trunk/LayoutTests/platform/win/Skipped

    r73265 r73302  
    381381# Sometimes fails http://webkit.org/b/49182
    382382animations/stop-animation-on-suspend.html
    383 
    384 # Crashing in AccessibilityUIElement::parentElement http://webkit.org/b/49379
    385 accessibility/iframe-bastardization.html
    386383
    387384################################################################################
  • trunk/WebCore/ChangeLog

    r73296 r73302  
     12010-12-03  Chris Guillory  <chris.guillory@google.com>
     2
     3        Reviewed by Chris Fleizach.
     4
     5        Include the FrameView widget of a RenderWidget in the accessibility tree.
     6        https://bugs.webkit.org/show_bug.cgi?id=49106
     7
     8        Include render widget children in the accessibility tree for not mac webkit ports.
     9
     10        * accessibility/AccessibilityRenderObject.cpp:
     11        (WebCore::AccessibilityRenderObject::renderParentObject):
     12        (WebCore::AccessibilityRenderObject::addChildren):
     13        (WebCore::AccessibilityRenderObject::addRenderWidgetChildren):
     14        * accessibility/AccessibilityRenderObject.h:
     15        * accessibility/chromium/AccessibilityObjectChromium.cpp:
     16        (WebCore::AccessibilityObject::accessibilityIgnoreAttachment):
     17
    1182010-11-30  Abhishek Arya  <inferno@chromium.org>
    219
  • trunk/WebCore/accessibility/AccessibilityRenderObject.cpp

    r73000 r73302  
    391391    RenderObject* firstChild = 0;
    392392    if (m_renderer->isRenderBlock() && (startOfConts = startOfContinuations(m_renderer)))
    393         parent = startOfConts;
     393        return startOfConts;
    394394
    395395    // Case 2: node's parent is an inline which is some node's continuation; parent is
    396396    // the earliest node in the continuation chain.
    397     else if (parent && parent->isRenderInline() && (startOfConts = startOfContinuations(parent)))
    398         parent = startOfConts;
     397    if (parent && parent->isRenderInline() && (startOfConts = startOfContinuations(parent)))
     398        return startOfConts;
    399399   
    400400    // Case 3: The first sibling is the beginning of a continuation chain. Find the origin of that continuation.
    401     else if (parent && (firstChild = parent->firstChild()) && firstChild->node()) {
     401    if (parent && (firstChild = parent->firstChild()) && firstChild->node()) {
    402402        // Get the node's renderer and follow that continuation chain until the first child is found
    403403        RenderObject* nodeRenderFirstChild = firstChild->node()->renderer();
    404404        if (nodeRenderFirstChild != firstChild) {
    405405            for (RenderObject* contsTest = nodeRenderFirstChild; contsTest; contsTest = nextContinuation(contsTest)) {
    406                 if (contsTest == firstChild) {
    407                     parent = nodeRenderFirstChild->parent();
    408                     break;
    409                 }
     406                if (contsTest == firstChild)
     407                    return nodeRenderFirstChild->parent();
    410408            }
    411409        }
    412410    }
     411
     412#if !PLATFORM(MAC)
     413    // Case 4: The node is a RenderView whose FrameView has an associated RenderWidget.
     414    // The parent is the associated RenderWidget.
     415    // On the mac port this parent logic is in AccessibilityObjectWrapper.mm.
     416    RenderWidget* renderWidget = 0;
     417    if (!parent && (renderWidget = RenderWidget::find(frameViewIfRenderView())))
     418        return renderWidget;
     419#endif
    413420       
    414421    return parent;
     
    33723379        }
    33733380    }
     3381
     3382    addRenderWidgetChildren();
     3383}
     3384
     3385void AccessibilityRenderObject::addRenderWidgetChildren()
     3386{
     3387#if !PLATFORM(MAC)
     3388    // For RenderWidget, add frame's content renderer if the widget is a FrameView.
     3389    // On the mac port this children logic is in AccessibilityObjectWrapper.mm.
     3390    Widget* widget = widgetForAttachmentView();
     3391    if (!widget || !widget->isFrameView())
     3392        return;
     3393    Frame* frame = static_cast<FrameView*>(widget)->frame();
     3394    if (!frame)
     3395        return;
     3396    RenderView* renderView = frame->contentRenderer();
     3397    if (!renderView)
     3398        return;
     3399    ASSERT(!m_children.size());
     3400    m_children.append(axObjectCache()->getOrCreate(renderView));
     3401#endif
    33743402}
    33753403       
  • trunk/WebCore/accessibility/AccessibilityRenderObject.h

    r73000 r73302  
    270270
    271271private:
     272    void addRenderWidgetChildren();
    272273    void ariaListboxSelectedChildren(AccessibilityChildrenVector&);
    273274    void ariaListboxVisibleChildren(AccessibilityChildrenVector&);
  • trunk/WebCore/accessibility/chromium/AccessibilityObjectChromium.cpp

    r72635 r73302  
    2727#include "config.h"
    2828#include "AccessibilityObject.h"
     29#include "Frame.h"
     30#include "FrameView.h"
     31#include "Widget.h"
    2932
    3033namespace WebCore {
     
    3235bool AccessibilityObject::accessibilityIgnoreAttachment() const
    3336{
     37    // Ignore render widgets with an attached RenderView because they have
     38    // no role and are not useful in the accessibility tree.
     39    // On the mac port, these render widgets are ignored by forwarding
     40    // calls the to the attached widget.
     41    Widget* widget = widgetForAttachmentView();
     42    if (widget && widget->isFrameView()) {
     43        Frame* frame = static_cast<FrameView*>(widget)->frame();
     44        if (frame && frame->contentRenderer())
     45            return true;
     46    }
     47
    3448    return false;
    3549}
  • trunk/WebKit/chromium/ChangeLog

    r73264 r73302  
     12010-12-03  Chris Guillory  <chris.guillory@google.com>
     2
     3        Reviewed by Chris Fleizach.
     4
     5        Include the FrameView widget of a RenderWidget in the accessibility tree.
     6        https://bugs.webkit.org/show_bug.cgi?id=49106
     7
     8        * public/WebAccessibilityObject.h:
     9        * src/WebAccessibilityObject.cpp:
     10        (WebKit::WebAccessibilityObject::equals):
     11        (WebKit::WebAccessibilityObject::parentObject):
     12
    1132010-11-29  Jeremy Orlow  <jorlow@chromium.org>
    214
  • trunk/WebKit/chromium/public/WebAccessibilityObject.h

    r72635 r73302  
    6464    WEBKIT_API void reset();
    6565    WEBKIT_API void assign(const WebAccessibilityObject&);
     66    WEBKIT_API bool equals(const WebAccessibilityObject&) const;
    6667
    6768    bool isNull() const { return !m_private; }
  • trunk/WebKit/chromium/src/WebAccessibilityObject.cpp

    r72635 r73302  
    6666}
    6767
     68bool WebAccessibilityObject::equals(const WebKit::WebAccessibilityObject& other) const
     69{
     70    return (m_private == other.m_private);
     71}
     72
    6873WebString WebAccessibilityObject::accessibilityDescription() const
    6974{
     
    179184
    180185    m_private->updateBackingStore();
    181     return WebAccessibilityObject(m_private->parentObject());
     186    return WebAccessibilityObject(m_private->parentObjectUnignored());
    182187}
    183188
  • trunk/WebKitTools/ChangeLog

    r73298 r73302  
     12010-12-03  Chris Guillory  <chris.guillory@google.com>
     2
     3        Reviewed by Chris Fleizach.
     4
     5        Include the FrameView widget of a RenderWidget in the accessibility tree.
     6        https://bugs.webkit.org/show_bug.cgi?id=49106
     7
     8        * DumpRenderTree/chromium/AccessibilityUIElement.cpp:
     9        (AccessibilityUIElement::AccessibilityUIElement):
     10        (AccessibilityUIElement::parentElementCallback):
     11        (AccessibilityUIElement::isEqualCallback):
     12        * DumpRenderTree/chromium/AccessibilityUIElement.h:
     13        * DumpRenderTree/chromium/CppBoundClass.cpp:
     14        (CppBoundClass::getFromCppVariant):
     15        * DumpRenderTree/chromium/CppBoundClass.h:
     16
    1172010-12-03  Mihai Parparita  <mihaip@chromium.org>
    218
  • trunk/WebKitTools/DumpRenderTree/chromium/AccessibilityUIElement.cpp

    r72635 r73302  
    305305    bindMethod("increment", &AccessibilityUIElement::incrementCallback);
    306306    bindMethod("decrement", &AccessibilityUIElement::decrementCallback);
     307    bindMethod("isEqual", &AccessibilityUIElement::isEqualCallback);
    307308
    308309    bindProperty("role", &AccessibilityUIElement::roleGetterCallback);
     
    491492void AccessibilityUIElement::parentElementCallback(const CppArgumentList&, CppVariant* result)
    492493{
    493     result->setNull();
     494    AccessibilityUIElement* parent = m_factory->create(accessibilityObject().parentObject());
     495    if (parent)
     496        result->set(*(parent->getAsCppVariant()));
     497    else
     498        result->setNull();       
    494499}
    495500
     
    502507{
    503508    result->setNull();
     509}
     510
     511void AccessibilityUIElement::isEqualCallback(const CppArgumentList& arguments, CppVariant* result)
     512{
     513    bool equal = false;
     514    AccessibilityUIElement* element = static_cast<AccessibilityUIElement*>(CppBoundClass::getFromCppVariant(arguments[0]));
     515    if (element)
     516        equal = accessibilityObject().equals(element->accessibilityObject());
     517    result->set(equal);
    504518}
    505519
  • trunk/WebKitTools/DumpRenderTree/chromium/AccessibilityUIElement.h

    r72635 r73302  
    8383    void incrementCallback(const CppArgumentList&, CppVariant*);
    8484    void decrementCallback(const CppArgumentList&, CppVariant*);
     85    void isEqualCallback(const CppArgumentList&, CppVariant*);
    8586    void fallbackCallback(const CppArgumentList&, CppVariant*);
    8687
  • trunk/WebKitTools/DumpRenderTree/chromium/CppBoundClass.cpp

    r72635 r73302  
    325325}
    326326
     327// static
     328CppBoundClass* CppBoundClass::getFromCppVariant(const CppVariant& value)
     329{
     330    if (!value.isObject())
     331        return 0;
     332    NPObject* npObj = NPVARIANT_TO_OBJECT(value);
     333    if (!npObj || npObj->_class != &CppNPObject::npClass)
     334        return 0;
     335    CppNPObject* obj = reinterpret_cast<CppNPObject*>(npObj);
     336    return obj->boundClass;
     337}
     338
    327339CppVariant* CppBoundClass::getAsCppVariant()
    328340{
  • trunk/WebKitTools/DumpRenderTree/chromium/CppBoundClass.h

    r72635 r73302  
    8686    virtual ~CppBoundClass();
    8787
     88    // Return the CppBoundClass bound to a CppVariant if it exists. Returns null
     89    // otherwise.
     90    static CppBoundClass* getFromCppVariant(const CppVariant&);
     91
    8892    // Return a CppVariant representing this class, for use with BindProperty().
    8993    // The variant type is guaranteed to be NPVariantType_Object.
Note: See TracChangeset for help on using the changeset viewer.