Changeset 72628 in webkit


Ignore:
Timestamp:
Nov 23, 2010 2:33:49 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2010-11-23 Chris Guillory <chris.guillory@google.com>

Reviewed by Dimitri Glazkov.

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

  • accessibility/iframe-has-document-expected.txt: Added.
  • accessibility/iframe-has-document.html: Added.
  • platform/win/Skipped:

2010-11-23 Chris Guillory <chris.guillory@google.com>

Reviewed by Dimitri Glazkov.

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.

Test: accessibility/iframe-has-document.html

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

2010-11-23 Chris Guillory <chris.guillory@google.com>

Reviewed by Dimitri Glazkov.

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-11-23 Chris Guillory <chris.guillory@google.com>

Reviewed by Dimitri Glazkov.

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:
2 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r72627 r72628  
     12010-11-23  Chris Guillory  <chris.guillory@google.com>
     2
     3        Reviewed by Dimitri Glazkov.
     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        * accessibility/iframe-has-document-expected.txt: Added.
     9        * accessibility/iframe-has-document.html: Added.
     10        * platform/win/Skipped:
     11
    1122010-11-23  Tony Chang  <tony@chromium.org>
    213
  • trunk/LayoutTests/platform/win/Skipped

    r72553 r72628  
    380380# Sometimes fails http://webkit.org/b/49182
    381381animations/stop-animation-on-suspend.html
    382 
    383 # Crashing in AccessibilityUIElement::parentElement http://webkit.org/b/49379
    384 accessibility/iframe-bastardization.html
    385382
    386383################################################################################
  • trunk/WebCore/ChangeLog

    r72626 r72628  
     12010-11-23  Chris Guillory  <chris.guillory@google.com>
     2
     3        Reviewed by Dimitri Glazkov.
     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        Test: accessibility/iframe-has-document.html
     11
     12        * accessibility/AccessibilityRenderObject.cpp:
     13        (WebCore::AccessibilityRenderObject::renderParentObject):
     14        (WebCore::AccessibilityRenderObject::addChildren):
     15        (WebCore::AccessibilityRenderObject::addRenderWidgetChildren):
     16        * accessibility/AccessibilityRenderObject.h:
     17        * accessibility/chromium/AccessibilityObjectChromium.cpp:
     18        (WebCore::AccessibilityObject::accessibilityIgnoreAttachment):
     19
    1202010-11-23  Chris Rogers  <crogers@google.com>
    221
  • trunk/WebCore/accessibility/AccessibilityRenderObject.cpp

    r72259 r72628  
    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;
     
    33593366        }
    33603367    }
     3368
     3369    addRenderWidgetChildren();
     3370}
     3371
     3372void AccessibilityRenderObject::addRenderWidgetChildren()
     3373{
     3374#if !PLATFORM(MAC)
     3375    // For RenderWidget, add frame's content renderer if the widget is a FrameView.
     3376    // On the mac port this children logic is in AccessibilityObjectWrapper.mm.
     3377    Widget* widget = widgetForAttachmentView();
     3378    if (!widget || !widget->isFrameView())
     3379        return;
     3380    Frame* frame = static_cast<FrameView*>(widget)->frame();
     3381    if (!frame)
     3382        return;
     3383    RenderView* renderView = frame->contentRenderer();
     3384    if (!renderView)
     3385        return;
     3386    ASSERT(!m_children.size());
     3387    m_children.append(axObjectCache()->getOrCreate(renderView));
     3388#endif
    33613389}
    33623390       
  • trunk/WebCore/accessibility/AccessibilityRenderObject.h

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

    r55855 r72628  
    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

    r72624 r72628  
     12010-11-23  Chris Guillory  <chris.guillory@google.com>
     2
     3        Reviewed by Dimitri Glazkov.
     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-23  John Knottenbelt  <jknotten@chromium.org>
    214
  • trunk/WebKit/chromium/public/WebAccessibilityObject.h

    r67418 r72628  
    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

    r71198 r72628  
    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

    r72617 r72628  
     12010-11-23  Chris Guillory  <chris.guillory@google.com>
     2
     3        Reviewed by Dimitri Glazkov.
     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-11-23  Alex Grilo  <abgrilo@profusion.mobi>
    218
  • trunk/WebKitTools/DumpRenderTree/chromium/AccessibilityUIElement.cpp

    r70064 r72628  
    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

    r70064 r72628  
    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

    r70064 r72628  
    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

    r55563 r72628  
    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.