[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-142-g786665c

mitz at apple.com mitz at apple.com
Mon Dec 27 16:28:50 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit e31c88a3335c0ab063276dfde82d7a4de5155800
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 22 02:19:53 2010 +0000

    WebCore: <rdar://problem/8725702> REGRESSION (r68854): Broken image icon seen in the Address Book Dashboard widget
    
    Reviewed by John Sullivan.
    
    Test: platform/mac/fast/dom/HTMLImageElement/dashboard-src-quirk.html
    
    The Address Book widget sets the src attribute of an img element to a string that looks like a CSS
    URL value. This used to work prior to r68854, because some DOM attribute parsing functions were using
    the wrong function to parse URL attributes (last named deprecatedParseURL).
    
    * html/HTMLImageLoader.cpp:
    (WebCore::HTMLImageLoader::sourceURI): In Dashboard, check if the src attribute begins with 'url("'
    and ends with '")', and if so, strip those away.
    
    LayoutTests: <rdar://problem/8725702> REGRESSION(r68854): Broken image icon seen in the Address Book Dashboard widget
    
    Reviewed by John Sullivan.
    
    * platform/mac/fast/dom/HTMLImageElement/dashboard-src-quirk-expected.txt: Added.
    * platform/mac/fast/dom/HTMLImageElement/dashboard-src-quirk.html: Added.
    * platform/mac/fast/dom/HTMLImageElement/resources: Added.
    * platform/mac/fast/dom/HTMLImageElement/resources/blue_rect.jpg: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74447 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 70b9860..904f685 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-12-21  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by John Sullivan.
+
+        <rdar://problem/8725702> REGRESSION(r68854): Broken image icon seen in the Address Book Dashboard widget
+
+        * platform/mac/fast/dom/HTMLImageElement/dashboard-src-quirk-expected.txt: Added.
+        * platform/mac/fast/dom/HTMLImageElement/dashboard-src-quirk.html: Added.
+        * platform/mac/fast/dom/HTMLImageElement/resources: Added.
+        * platform/mac/fast/dom/HTMLImageElement/resources/blue_rect.jpg: Added.
+
 2010-12-21  Zhenyao Mo  <zmo at google.com>
 
         Reviewed by Kenneth Russell.
diff --git a/LayoutTests/platform/mac/fast/dom/HTMLImageElement/dashboard-src-quirk-expected.txt b/LayoutTests/platform/mac/fast/dom/HTMLImageElement/dashboard-src-quirk-expected.txt
new file mode 100644
index 0000000..f6a51c0
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/dom/HTMLImageElement/dashboard-src-quirk-expected.txt
@@ -0,0 +1,3 @@
+Test a Dashboard quirk that allows the src attribute of an HTML img element to be specified using a form of CSS URL value notation.
+
+PASS
diff --git a/LayoutTests/platform/mac/fast/dom/HTMLImageElement/dashboard-src-quirk.html b/LayoutTests/platform/mac/fast/dom/HTMLImageElement/dashboard-src-quirk.html
new file mode 100644
index 0000000..25ad8c8
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/dom/HTMLImageElement/dashboard-src-quirk.html
@@ -0,0 +1,28 @@
+<p>
+    Test a Dashboard quirk that allows the <tt>src</tt> attribute of an HTML <tt>img</tt> element to
+    be specified using a form of CSS URL value notation.
+</p>
+<p id="result">
+    This test can only run in DumpRenderTree.
+</p>
+<script>
+    if (window.layoutTestController) {
+        layoutTestController.dumpAsText();
+        layoutTestController.waitUntilDone();
+        layoutTestController.setUseDashboardCompatibilityMode(true);
+
+        var image = document.createElement("img");
+
+        image.addEventListener("load", function(event) {
+            document.getElementById("result").innerText = "PASS";
+            layoutTestController.notifyDone();
+        }, false);
+
+        image.addEventListener("error", function(event) {
+            document.getElementById("result").innerText = "FAIL";
+            layoutTestController.notifyDone();
+        }, false);
+
+        image.src = 'url("resources/blue_rect.jpg")';
+    }
+</script>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c96eb79..d1e72a0 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-12-21  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by John Sullivan.
+
+        <rdar://problem/8725702> REGRESSION (r68854): Broken image icon seen in the Address Book Dashboard widget
+
+        Test: platform/mac/fast/dom/HTMLImageElement/dashboard-src-quirk.html
+
+        The Address Book widget sets the src attribute of an img element to a string that looks like a CSS
+        URL value. This used to work prior to r68854, because some DOM attribute parsing functions were using
+        the wrong function to parse URL attributes (last named deprecatedParseURL).
+
+        * html/HTMLImageLoader.cpp:
+        (WebCore::HTMLImageLoader::sourceURI): In Dashboard, check if the src attribute begins with 'url("'
+        and ends with '")', and if so, strip those away.
+
 2010-12-21  Ryosuke Niwa  <rniwa at webkit.org>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/html/HTMLImageLoader.cpp b/WebCore/html/HTMLImageLoader.cpp
index a1a3b26..90f3ca4 100644
--- a/WebCore/html/HTMLImageLoader.cpp
+++ b/WebCore/html/HTMLImageLoader.cpp
@@ -29,6 +29,7 @@
 #include "HTMLNames.h"
 #include "HTMLObjectElement.h"
 #include "HTMLParserIdioms.h"
+#include "Settings.h"
 
 #if USE(JSC)
 #include "JSDOMWindowBase.h"
@@ -55,7 +56,11 @@ void HTMLImageLoader::dispatchLoadEvent()
 
 String HTMLImageLoader::sourceURI(const AtomicString& attr) const
 {
-    return stripLeadingAndTrailingHTMLSpaces(attr);
+    Settings* settings = element()->document()->settings();
+    if (!settings || !settings->usesDashboardBackwardCompatibilityMode() || attr.length() < 7 || !attr.startsWith("url(\"") || !attr.endsWith("\")"))
+        return stripLeadingAndTrailingHTMLSpaces(attr);
+
+    return attr.string().substring(5, attr.length() - 7);
 }
 
 void HTMLImageLoader::notifyFinished(CachedResource*)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list