[Webkit-unassigned] [Bug 41569] [Chromium] Expose basic DOM information in WebAccessibilityObject

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jul 7 12:03:42 PDT 2010


--- Comment #6 from Dominic Mazzoni <dmazzoni at google.com>  2010-07-07 12:03:41 PST ---
Thanks. I'm working on these changes now.

The only thing I'm not clear on is how to do the attributes getter on WebElement.  WebKit::Element::attributes returns a NamedNodeMap, which can't be wrapped by a WebNodeList.

Would it be better to create a new wrapper WebNamedNodeMap, or construct some subclass of NodeList with the attributes that can be wrapped by WebNodeList?

- Dominic

(In reply to comment #5)
> (From update of attachment 60454 [details])
> WebKit/chromium/public/WebAccessibilityObject.h:108
>  +      WEBKIT_API void attributeAt(unsigned index, WebString* name, WebString* value) const;
> nit: webkit style is to use reference types for out params:  WebString& name, WebString& value
> WebKit/chromium/public/WebAccessibilityObject.h:111
>  +      WEBKIT_API WebString documentUrl() const;
> nit: documentUrl -> documentURL
> but, why do you need to expose these document properties?  Why not just
> expose WebDocument (and add properties to it as needed)?
> WebKit/chromium/src/WebAccessibilityObject.cpp:420
>  +      Node* node = renderObject->node();
> instead of exposing a tagName property, how about just exposing
> a WebNode getter?  then, the consumer can call WebNode::nodeName.
> WebKit/chromium/src/WebAccessibilityObject.cpp:440
>  +      if (!node || !node->hasAttributes())
> this also feels like something that should be provided by exposing
> an attributes getter on WebElement.  Use the WebNodeList type.
> WebKit/chromium/src/WebAccessibilityObject.cpp:507
>  +  WebString WebAccessibilityObject::documentUrl() const
> this method should definitely be eliminated in favor of accessing
> the related WebNode, and then query its document.  from the
> WebDocument you can get the WebFrame, and that has a "url" property.
> WebKit/chromium/src/WebAccessibilityObject.cpp:532
>  +      return document->title();
> eliminate this method in favor of querying WebDocument::title.
> WebKit/chromium/src/WebAccessibilityObject.cpp:543
>  +      if (document && document->isXHTMLDocument())
> WebDocument already has an isXHTMLDocument accessor
> WebKit/chromium/src/WebAccessibilityObject.cpp:560
>  +      DocumentType* doctype = document->doctype();
> please expose a "WebDocumentType WebDocument::docType()" accessor.
> that means creating the WebDocumentType class and adding the methods
> to it that you need (just name for now).  it is fairly easy to 
> create a new subclass of WebNode.  just look at WebDocument and
> WebElement to see good examples of it.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list