diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2009-09-18 13:22:27 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-09-18 13:22:27 (GMT) |
commit | b68c5cd72b4fc58a1422a801e1c52c72be32f3d4 (patch) | |
tree | 0de572352715008a541f52d8d17d377195469604 /src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp | |
parent | 9f80bac10f1ab5155999cb554559cd3dacab2bb9 (diff) | |
parent | b9b8a1cb6bc5a1b93373a7a634a23dcd785b3c31 (diff) | |
download | Qt-b68c5cd72b4fc58a1422a801e1c52c72be32f3d4.zip Qt-b68c5cd72b4fc58a1422a801e1c52c72be32f3d4.tar.gz Qt-b68c5cd72b4fc58a1422a801e1c52c72be32f3d4.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt
Conflicts:
src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
src/gui/kernel/qwidget_x11.cpp
Diffstat (limited to 'src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp')
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp index 57c8b0d..ff086f6 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp @@ -23,8 +23,8 @@ #include "CSSComputedStyleDeclaration.h" #include "CSSMutableStyleDeclaration.h" #include "CSSParser.h" -#include "CSSRuleList.h" #include "CSSRule.h" +#include "CSSRuleList.h" #include "CSSStyleRule.h" #include "CString.h" #include "Document.h" @@ -42,6 +42,7 @@ #include "qwebframe.h" #include "qwebframe_p.h" #include "runtime_root.h" +#include <parser/SourceCode.h> #include <wtf/Vector.h> using namespace WebCore; @@ -218,7 +219,7 @@ QList<QWebElement> QWebElement::findAll(const QString &selectorQuery) const if (!nodes) return elements; - for (int i = 0; i < nodes->length(); ++i) { + for (unsigned i = 0; i < nodes->length(); ++i) { WebCore::Node* n = nodes->item(i); elements.append(QWebElement(static_cast<Element*>(n))); } @@ -697,7 +698,7 @@ static bool setupScriptObject(WebCore::Element* element, ScriptObject& object, S if (!thisObject) return false; - object = ScriptObject(thisObject); + object = ScriptObject(state, thisObject); return true; } @@ -1661,6 +1662,23 @@ void QWebElement::replace(const QString &markup) } /*! + \internal + Walk \a node's parents until a valid QWebElement is found. + For example, a WebCore::Text node is not a valid Html QWebElement, but its + enclosing p tag is. +*/ +QWebElement QWebElement::enclosingElement(WebCore::Node* node) +{ + QWebElement element(node); + + while (element.isNull() && node) { + node = node->parentNode(); + element = QWebElement(node); + } + return element; +} + +/*! \fn inline bool QWebElement::operator==(const QWebElement& o) const; Returns true if this element points to the same underlying DOM object as |