[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

jocelyn.turcotte at nokia.com jocelyn.turcotte at nokia.com
Wed Dec 22 15:09:00 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 16be951f63fc307145a42916529af8f094ebba36
Author: jocelyn.turcotte at nokia.com <jocelyn.turcotte at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 28 16:05:51 2010 +0000

    [Qt] QWebElement: Don't retrieve CSS rules through DOMWindow.
    https://bugs.webkit.org/show_bug.cgi?id=48519
    
    Reviewed by Andreas Kling.
    
    JavaScript is prevented from retrieving cross-domain CSS rules since r70335.
    This patch allow QWebElement to retrive style without this limitation
    by asking the Document directly instead of going through DOMWindow.
    
    Fixes:
    - tst_QWebFrame::setHtmlWithResource()
    - tst_QWebElement::style()
    
    * Api/qwebelement.cpp:
    (QWebElement::styleProperty):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70778 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/qt/Api/qwebelement.cpp b/WebKit/qt/Api/qwebelement.cpp
index 261631c..68fa17a 100644
--- a/WebKit/qt/Api/qwebelement.cpp
+++ b/WebKit/qt/Api/qwebelement.cpp
@@ -26,6 +26,7 @@
 #include "CSSRule.h"
 #include "CSSRuleList.h"
 #include "CSSStyleRule.h"
+#include "CSSStyleSelector.h"
 #include "Document.h"
 #include "DocumentFragment.h"
 #include "FrameView.h"
@@ -852,8 +853,8 @@ QString QWebElement::styleProperty(const QString &name, StyleResolveStrategy str
         // by importance and inheritance order. This include external CSS
         // declarations, as well as embedded and inline style declarations.
 
-        DOMWindow* domWindow = m_element->document()->frame()->domWindow();
-        if (RefPtr<CSSRuleList> rules = domWindow->getMatchedCSSRules(m_element, "")) {
+        Document* doc = m_element->document();
+        if (RefPtr<CSSRuleList> rules = doc->styleSelector()->styleRulesForElement(m_element, /*authorOnly*/ true)) {
             for (int i = rules->length(); i > 0; --i) {
                 CSSStyleRule* rule = static_cast<CSSStyleRule*>(rules->item(i - 1));
 
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 657d99c..71d0da9 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,21 @@
+2010-10-28  Jocelyn Turcotte  <jocelyn.turcotte at nokia.com>
+
+        Reviewed by Andreas Kling.
+
+        [Qt] QWebElement: Don't retrieve CSS rules through DOMWindow.
+        https://bugs.webkit.org/show_bug.cgi?id=48519
+
+        JavaScript is prevented from retrieving cross-domain CSS rules since r70335.
+        This patch allow QWebElement to retrive style without this limitation
+        by asking the Document directly instead of going through DOMWindow.
+
+        Fixes:
+        - tst_QWebFrame::setHtmlWithResource()
+        - tst_QWebElement::style()
+
+        * Api/qwebelement.cpp:
+        (QWebElement::styleProperty):
+
 2010-10-28  Kenneth Rohde Christiansen  <kenneth at webkit.org>
 
         Reviewed by Andreas Kling.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list