[webkit-reviews] review denied: [Bug 30628] [Qt] It is impossible to list the attributes of QWebElement : [Attachment 42588] Proposal for a patch to allow getting the list of all attributes for a qweblement

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 9 06:19:08 PST 2009


Kenneth Rohde Christiansen <kenneth at webkit.org> has denied Antonio Gomes
(tonikitoo) <tonikitoo at webkit.org>'s request for review:
Bug 30628: [Qt] It is impossible to list the attributes of QWebElement
https://bugs.webkit.org/show_bug.cgi?id=30628

Attachment 42588: Proposal for a patch to allow getting the list of all
attributes for a qweblement
https://bugs.webkit.org/attachment.cgi?id=42588&action=review

------- Additional Comments from Kenneth Rohde Christiansen
<kenneth at webkit.org>
First of all, I would like to postpone API additions to 4.7, unless you have a
good argument for why this is required in 4.6. We have already branched off, so
the patch can get committed, but it would be nice to know if we need to
cherry-pick this change or not.

> +QMap<QPair<QString,QString>,QString> QWebElement::attributes() const

Yes, maybe a typedef would be nice.

> +{
> +    QMap<QPair<QString,QString>,QString> attributes;
> +    if (m_element) {
> +	   NamedNodeMap* attrs = m_element->attributes(true);
> +	   if (attrs) {
> +	       unsigned numAttrs = attrs->length();
> +	       for (unsigned i = 0; i < numAttrs; i++) {
> +		   Attribute *attribute = attrs->attributeItem(i);

coding style violation. * should be to the left.

> +		  
attributes[QPair<QString,QString>(attribute->namespaceURI(),attribute->localNam
e())] = 

coding style: missing space after ,. Please run the check-webkit-style script

> +		       attribute->value();
> +	       }
> +	   }
> +	       
> +    }
> +    return attributes;
> +}
> +
> +
> +/*!
>      Returns true if the element has keyboard input focus; otherwise, returns
false
>  
>      \sa setFocus()
> diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h
b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h
> index 351ccb4..6495cc7 100644
> --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h
> +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.h
> @@ -71,6 +71,7 @@ public:
>      void removeAttribute(const QString& name);
>      void removeAttributeNS(const QString& namespaceUri, const QString&
name);
>      bool hasAttributes() const;
> +    QMap<QPair<QString,QString>,QString> attributes() const;
>  
>      QStringList classes() const;
>      bool hasClass(const QString& name) const;


More information about the webkit-reviews mailing list