Commit 4b52bee5 authored by hausmann@webkit.org's avatar hausmann@webkit.org

2009-07-26 Kavindra Palaraja <kavindra.palaraja@nokia.com>

        Reviewed by Simon Hausmann.

        Clean up documentation of QWebElement's findFirst and findAll functions,
        as well as their QWebFrame counterparts.

        * Api/qwebelement.cpp:
        * Api/qwebframe.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@46405 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1c244c8c
......@@ -68,6 +68,9 @@ public:
only the span elements that are children of the paragraph that is classified
as "intro" paragraph.
Using findFirst() is more efficient than calling findAll() and extracting the first element
only in the returned list.
Alternatively you can manually traverse the document using firstChild() and nextSibling():
\snippet webkitsnippets/webelement/main.cpp Traversing with QWebElement
......@@ -176,10 +179,13 @@ bool QWebElement::isNull() const
}
/*!
Returns a new collection of elements that are children of this element
and that match the given CSS selector \a selectorQuery.
Returns a new list of child elements matching the given CSS selector \a selectorQuery.
If there are no matching elements, an empty list is returned.
\l{http://www.w3.org/TR/REC-CSS2/selector.html#q1}{Standard CSS2 selector} syntax is
used for the query.
The query is specified using \l{http://www.w3.org/TR/REC-CSS2/selector.html#q1}{standard CSS2 selectors}.
\note This search is performed recursively.
*/
QList<QWebElement> QWebElement::findAll(const QString &selectorQuery) const
{
......@@ -203,9 +209,10 @@ QList<QWebElement> QWebElement::findAll(const QString &selectorQuery) const
/*!
Returns the first child element that matches the given CSS selector \a selectorQuery.
This function is equivalent to calling findAll() and taking only the
first element in the returned collection of elements. However calling
this function is more efficient.
\l{http://www.w3.org/TR/REC-CSS2/selector.html#q1}{Standard CSS2 selector} syntax is
used for the query.
\note This search is performed recursively.
*/
QWebElement QWebElement::findFirst(const QString &selectorQuery) const
{
......
......@@ -1086,8 +1086,11 @@ QWebElement QWebFrame::documentElement() const
/*!
\since 4.6
Returns a new collection of elements that are children of the frame's
document element and that match the given CSS selector \a selectorQuery.
Returns a new list of elements matching the given CSS selector \a selectorQuery.
If there are no matching elements, an empty list is returned.
\l{http://www.w3.org/TR/REC-CSS2/selector.html#q1}{Standard CSS2 selector} syntax is
used for the query.
\sa QWebElement::findAll()
*/
......@@ -1099,8 +1102,11 @@ QList<QWebElement> QWebFrame::findAllElements(const QString &selectorQuery) cons
/*!
\since 4.6
Returns the first element in the frame's document that matches the
given CSS selector \a selectorQuery. Returns a null element if there is no
match.
given CSS selector \a selectorQuery. If there is no matching element, a
null element is returned.
\l{http://www.w3.org/TR/REC-CSS2/selector.html#q1}{Standard CSS2 selector} syntax is
used for the query.
\sa QWebElement::findFirst()
*/
......
2009-07-26 Kavindra Palaraja <kavindra.palaraja@nokia.com>
Reviewed by Simon Hausmann.
Clean up documentation of QWebElement's findFirst and findAll functions,
as well as their QWebFrame counterparts.
* Api/qwebelement.cpp:
* Api/qwebframe.cpp:
2009-07-26 Kavindra Palaraja <kavindra.palaraja@nokia.com>
Reviewed by Simon Hausmann.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment