[Webkit-unassigned] [Bug 30628] [Qt] It is impossible to list the attributes of QWebElement

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


https://bugs.webkit.org/show_bug.cgi?id=30628


Kenneth Rohde Christiansen <kenneth at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #42588|review?                     |review-
               Flag|                            |




--- Comment #7 from Kenneth Rohde Christiansen <kenneth at webkit.org>  2009-11-09 06:19:09 PDT ---
(From update of attachment 42588)
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->localName())] = 

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;

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