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

darin at apple.com darin at apple.com
Wed Dec 22 11:28:46 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 948ec43d5fa6a4413d382d429d75893fef6032a0
Author: darin at apple.com <darin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jul 26 22:58:33 2010 +0000

    2010-07-26  Darin Adler  <darin at apple.com>
    
            Reviewed by Eric Carlson.
    
            Don't handle empty URL attributes specially in reflection, even in cases such as <img src="">
            https://bugs.webkit.org/show_bug.cgi?id=42087
    
            * html/HTMLMediaElement.cpp:
            (WebCore::HTMLMediaElement::insertedIntoDocument): Check if the src attribute is empty
            by calling getAttribute instead of calling the src function. This keeps the behavior
            correct with the reflection change, and has a side benefit of being more efficient as
            well since there is no reason to resolve the URL.
            (WebCore::HTMLMediaElement::loadResource): Call getNonEmptyURLAttribute directly here
            instead of using the poster function.
            (WebCore::HTMLMediaElement::getPluginProxyParams): Ditto.
    
            * html/HTMLMediaElement.h: Removed the poster virtual function. The code that gets the
            poster attribute is already video-specific and uses generic attribute fetching code, so
            we no longer need a virtual function. Removed the src function. Since this would give
            a different result from the JavaScript reflected src attribute, it's safer not to have
            it, and it was easy to convert all the callers.
    
            * html/HTMLMediaElement.idl: Removed the NonEmpty extended attribute from the src
            attribute.
    
            * html/HTMLSourceElement.cpp: Removed the src function for the same reason as above.
            * html/HTMLSourceElement.h: Ditto.
    
            * html/HTMLSourceElement.idl: Removed the NonEmpty extended attribute from the src
            attribute.
    
            * html/HTMLVideoElement.cpp:
            (WebCore::HTMLVideoElement::parseMappedAttribute): Removed code to update m_posterURL,
            which is no longer needed. Changed call site that used the poster() function to instead
            use getNonEmptyURLAttribute.
            (WebCore::HTMLVideoElement::updatePosterImage): Check if the poster attribute is empty
            by calling getAttribute instead of calling the poster function. This keeps the behavior
            correct with the reflection change, and has a side benefit of being more efficient as
            well since there is no reason to resolve the URL.
    
            * html/HTMLVideoElement.h: Removed the poster function for the same reason we removed
            the src function above. Also removed now-unneeded m_posterURL data member.
    
            * html/HTMLVideoElement.idl: Removed the NonEmpty extended attribute from the poster
            attribute.
    2010-07-26  Darin Adler  <darin at apple.com>
    
            Reviewed by Eric Carlson.
    
            Don’t handle empty URL attributes specially in reflection, even in cases such as <img src="">
            https://bugs.webkit.org/show_bug.cgi?id=42087
    
            * fast/dom/URL-attribute-reflection-expected.txt: Updated.
            * fast/dom/script-tests/URL-attribute-reflection.js: Updated test expectations so that even
            for URLs where "" is invalid, we reflect the empty string resolved to the base URL.
    
            * media/video-poster-expected.txt: Updated.
            * media/video-poster.html: Updated to expect poster="" to reflect as the base URL.
            * media/video-source-error-no-candidate-expected.txt: Updated.
            * media/video-src-none-expected.txt: Updated.
            * media/video-src-none.html: Updated to expect src="" to reflect as the base URL.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64085 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 450d467..de47738 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,20 @@
+2010-07-26  Darin Adler  <darin at apple.com>
+
+        Reviewed by Eric Carlson.
+
+        Don’t handle empty URL attributes specially in reflection, even in cases such as <img src="">
+        https://bugs.webkit.org/show_bug.cgi?id=42087
+
+        * fast/dom/URL-attribute-reflection-expected.txt: Updated.
+        * fast/dom/script-tests/URL-attribute-reflection.js: Updated test expectations so that even
+        for URLs where "" is invalid, we reflect the empty string resolved to the base URL.
+
+        * media/video-poster-expected.txt: Updated.
+        * media/video-poster.html: Updated to expect poster="" to reflect as the base URL.
+        * media/video-source-error-no-candidate-expected.txt: Updated.
+        * media/video-src-none-expected.txt: Updated.
+        * media/video-src-none.html: Updated to expect src="" to reflect as the base URL.
+
 2010-07-26  Ryosuke Niwa  <rniwa at webkit.org>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/fast/dom/URL-attribute-reflection-expected.txt b/LayoutTests/fast/dom/URL-attribute-reflection-expected.txt
index 3bcff50..c7f8f81 100644
--- a/LayoutTests/fast/dom/URL-attribute-reflection-expected.txt
+++ b/LayoutTests/fast/dom/URL-attribute-reflection-expected.txt
@@ -10,26 +10,26 @@ FAIL testURLReflection('cite', 'blockquote') should be URL. Was non-URL.
 FAIL testURLReflection('cite', 'del') should be URL. Was non-URL.
 FAIL testURLReflection('cite', 'ins') should be URL. Was non-URL.
 FAIL testURLReflection('cite', 'q') should be URL. Was non-URL.
-FAIL testURLReflection('data', 'object') should be non-empty URL. Was URL.
+PASS testURLReflection('data', 'object') is 'URL'
 FAIL testURLReflection('formaction', 'button') should be URL. Was none.
 FAIL testURLReflection('formaction', 'input') should be URL. Was none.
 PASS testURLReflection('href', 'a') is 'URL'
 PASS testURLReflection('href', 'area') is 'URL'
-FAIL testURLReflection('href', 'link') should be non-empty URL. Was URL.
+PASS testURLReflection('href', 'link') is 'URL'
 FAIL testURLReflection('href', 'base') should be URL. Was non-URL.
-FAIL testURLReflection('icon', 'command') should be non-empty URL. Was none.
-FAIL testURLReflection('manifest', 'html') should be non-empty URL. Was none.
-PASS testURLReflection('poster', 'video') is 'non-empty URL'
-PASS testURLReflection('src', 'audio') is 'non-empty URL'
-FAIL testURLReflection('src', 'embed') should be non-empty URL. Was non-URL.
-FAIL testURLReflection('src', 'iframe') should be non-empty URL. Was non-URL.
-FAIL testURLReflection('src', 'img') should be non-empty URL. Was URL.
-FAIL testURLReflection('src', 'input') should be non-empty URL. Was URL.
-FAIL testURLReflection('src', 'script') should be non-empty URL. Was URL.
-PASS testURLReflection('src', 'source') is 'non-empty URL'
-PASS testURLReflection('src', 'video') is 'non-empty URL'
-FAIL testURLReflection('longDesc', 'img') should be non-empty URL. Was URL.
-FAIL testURLReflection('lowsrc', 'img') should be non-empty URL. Was URL.
+FAIL testURLReflection('icon', 'command') should be URL. Was none.
+FAIL testURLReflection('manifest', 'html') should be URL. Was none.
+PASS testURLReflection('poster', 'video') is 'URL'
+PASS testURLReflection('src', 'audio') is 'URL'
+FAIL testURLReflection('src', 'embed') should be URL. Was non-URL.
+FAIL testURLReflection('src', 'iframe') should be URL. Was non-URL.
+PASS testURLReflection('src', 'img') is 'URL'
+PASS testURLReflection('src', 'input') is 'URL'
+PASS testURLReflection('src', 'script') is 'URL'
+PASS testURLReflection('src', 'source') is 'URL'
+PASS testURLReflection('src', 'video') is 'URL'
+PASS testURLReflection('longDesc', 'img') is 'URL'
+PASS testURLReflection('lowsrc', 'img') is 'URL'
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/LayoutTests/fast/dom/script-tests/URL-attribute-reflection.js b/LayoutTests/fast/dom/script-tests/URL-attribute-reflection.js
index 82f36b3..d9aa497 100644
--- a/LayoutTests/fast/dom/script-tests/URL-attribute-reflection.js
+++ b/LayoutTests/fast/dom/script-tests/URL-attribute-reflection.js
@@ -36,35 +36,35 @@ shouldBe("testURLReflection('attribute', 'element')", "'none'");
 shouldBe("testURLReflection('id', 'element')", "'non-URL'");
 
 // The following list comes from the HTML5 document’s attributes index.
-// The expected results are based on what the table there says.
+// These are the URL attributes from that list.
 
 shouldBe("testURLReflection('action', 'form')", "'URL'");
 shouldBe("testURLReflection('cite', 'blockquote')", "'URL'");
 shouldBe("testURLReflection('cite', 'del')", "'URL'");
 shouldBe("testURLReflection('cite', 'ins')", "'URL'");
 shouldBe("testURLReflection('cite', 'q')", "'URL'");
-shouldBe("testURLReflection('data', 'object')", "'non-empty URL'");
+shouldBe("testURLReflection('data', 'object')", "'URL'");
 shouldBe("testURLReflection('formaction', 'button')", "'URL'");
 shouldBe("testURLReflection('formaction', 'input')", "'URL'");
 shouldBe("testURLReflection('href', 'a')", "'URL'");
 shouldBe("testURLReflection('href', 'area')", "'URL'");
-shouldBe("testURLReflection('href', 'link')", "'non-empty URL'");
+shouldBe("testURLReflection('href', 'link')", "'URL'");
 shouldBe("testURLReflection('href', 'base')", "'URL'");
-shouldBe("testURLReflection('icon', 'command')", "'non-empty URL'");
-shouldBe("testURLReflection('manifest', 'html')", "'non-empty URL'");
-shouldBe("testURLReflection('poster', 'video')", "'non-empty URL'");
-shouldBe("testURLReflection('src', 'audio')", "'non-empty URL'");
-shouldBe("testURLReflection('src', 'embed')", "'non-empty URL'");
-shouldBe("testURLReflection('src', 'iframe')", "'non-empty URL'");
-shouldBe("testURLReflection('src', 'img')", "'non-empty URL'");
-shouldBe("testURLReflection('src', 'input')", "'non-empty URL'");
-shouldBe("testURLReflection('src', 'script')", "'non-empty URL'");
-shouldBe("testURLReflection('src', 'source')", "'non-empty URL'");
-shouldBe("testURLReflection('src', 'video')", "'non-empty URL'");
+shouldBe("testURLReflection('icon', 'command')", "'URL'");
+shouldBe("testURLReflection('manifest', 'html')", "'URL'");
+shouldBe("testURLReflection('poster', 'video')", "'URL'");
+shouldBe("testURLReflection('src', 'audio')", "'URL'");
+shouldBe("testURLReflection('src', 'embed')", "'URL'");
+shouldBe("testURLReflection('src', 'iframe')", "'URL'");
+shouldBe("testURLReflection('src', 'img')", "'URL'");
+shouldBe("testURLReflection('src', 'input')", "'URL'");
+shouldBe("testURLReflection('src', 'script')", "'URL'");
+shouldBe("testURLReflection('src', 'source')", "'URL'");
+shouldBe("testURLReflection('src', 'video')", "'URL'");
 
 // Other reflected URL attributes.
 
-shouldBe("testURLReflection('longDesc', 'img')", "'non-empty URL'");
-shouldBe("testURLReflection('lowsrc', 'img')", "'non-empty URL'");
+shouldBe("testURLReflection('longDesc', 'img')", "'URL'");
+shouldBe("testURLReflection('lowsrc', 'img')", "'URL'");
 
 var successfullyParsed = true;
diff --git a/LayoutTests/media/video-poster-expected.txt b/LayoutTests/media/video-poster-expected.txt
index 61c105e..2602ff9 100644
--- a/LayoutTests/media/video-poster-expected.txt
+++ b/LayoutTests/media/video-poster-expected.txt
@@ -5,7 +5,7 @@ EXPECTED (relativeURL(video.poster) == 'content/greenbox.png') OK
 
 Set 'poster' to ''.
 EXPECTED (video.getAttribute('poster') == '') OK
-EXPECTED (relativeURL(video.poster) == '') OK
+EXPECTED (relativeURL(video.poster) == 'video-poster.html') OK
 
 Set 'poster' to 'content/abe.png'.
 EXPECTED (video.getAttribute('poster') == 'content/abe.png') OK
diff --git a/LayoutTests/media/video-poster.html b/LayoutTests/media/video-poster.html
index e62c27e..b57456e 100644
--- a/LayoutTests/media/video-poster.html
+++ b/LayoutTests/media/video-poster.html
@@ -18,7 +18,8 @@
 
                 consoleWrite("<br><i>Set 'poster' to ''.<" + "/i>");
                 video.setAttribute('poster', '');
-                testPoster('');
+                testExpected("video.getAttribute('poster')", '');
+                testExpected("relativeURL(video.poster)", 'video-poster.html');
 
                 consoleWrite("<br><i>Set 'poster' to 'content/abe.png'.<" + "/i>");
                 video.setAttribute('poster', 'content/abe.png');
diff --git a/LayoutTests/media/video-source-error-no-candidate-expected.txt b/LayoutTests/media/video-source-error-no-candidate-expected.txt
index 538d2f8..73706f0 100644
--- a/LayoutTests/media/video-source-error-no-candidate-expected.txt
+++ b/LayoutTests/media/video-source-error-no-candidate-expected.txt
@@ -10,7 +10,7 @@ EXPECTED (video.error == 'null') OK
 EVENT(error) from <source id='unsupported-media-query' src='content/test.mp4'> OK
 EXPECTED (video.error == 'null') OK
 
-EVENT(error) from <source id='empty-src' src=''> OK
+EVENT(error) from <source id='empty-src' src='video-source-error-no-candidate.html'> OK
 EXPECTED (video.error == 'null') OK
 
 END OF TEST
diff --git a/LayoutTests/media/video-src-none-expected.txt b/LayoutTests/media/video-src-none-expected.txt
index 082244e..e6046e8 100644
--- a/LayoutTests/media/video-src-none-expected.txt
+++ b/LayoutTests/media/video-src-none-expected.txt
@@ -8,7 +8,7 @@ EXPECTED (videos[0].src == '') OK
 ** <video> with empty src attribute **
 EXPECTED (videos[1].error == 'null') OK
 EXPECTED (videos[1].networkState == '0') OK
-EXPECTED (videos[1].src == '') OK
+EXPECTED (relativeURL(videos[1].src) == 'video-src-none.html') OK
 
 Calling load() with empty 'src' should fire 'error' event, set network state to NETWORK_NO_SOURCE, and set error to MEDIA_ERR_SRC_NOT_SUPPORTED.
 'error' event:
diff --git a/LayoutTests/media/video-src-none.html b/LayoutTests/media/video-src-none.html
index 2d1f91e..2cc0ee9 100644
--- a/LayoutTests/media/video-src-none.html
+++ b/LayoutTests/media/video-src-none.html
@@ -42,7 +42,7 @@
                 consoleWrite("** &lt;video&gt; with empty src attribute **");
                 testExpected("videos[1].error", null);
                 testExpected("videos[1].networkState", HTMLMediaElement.NETWORK_EMPTY);
-                testExpected("videos[1].src", "");
+                testExpected("relativeURL(videos[1].src)", "video-src-none.html");
 
                 consoleWrite("<br><" + "i>Calling load() with empty 'src' should fire 'error' event, set network state to NETWORK_NO_SOURCE, and set error to MEDIA_ERR_SRC_NOT_SUPPORTED.<" + "/i>");
                 state = "load() with empty 'src'";
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a070726..bf05a0d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,49 @@
+2010-07-26  Darin Adler  <darin at apple.com>
+
+        Reviewed by Eric Carlson.
+
+        Don't handle empty URL attributes specially in reflection, even in cases such as <img src="">
+        https://bugs.webkit.org/show_bug.cgi?id=42087
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::insertedIntoDocument): Check if the src attribute is empty
+        by calling getAttribute instead of calling the src function. This keeps the behavior
+        correct with the reflection change, and has a side benefit of being more efficient as
+        well since there is no reason to resolve the URL.
+        (WebCore::HTMLMediaElement::loadResource): Call getNonEmptyURLAttribute directly here
+        instead of using the poster function.
+        (WebCore::HTMLMediaElement::getPluginProxyParams): Ditto.
+
+        * html/HTMLMediaElement.h: Removed the poster virtual function. The code that gets the
+        poster attribute is already video-specific and uses generic attribute fetching code, so
+        we no longer need a virtual function. Removed the src function. Since this would give
+        a different result from the JavaScript reflected src attribute, it's safer not to have
+        it, and it was easy to convert all the callers.
+
+        * html/HTMLMediaElement.idl: Removed the NonEmpty extended attribute from the src
+        attribute.
+
+        * html/HTMLSourceElement.cpp: Removed the src function for the same reason as above.
+        * html/HTMLSourceElement.h: Ditto.
+
+        * html/HTMLSourceElement.idl: Removed the NonEmpty extended attribute from the src
+        attribute.
+
+        * html/HTMLVideoElement.cpp:
+        (WebCore::HTMLVideoElement::parseMappedAttribute): Removed code to update m_posterURL,
+        which is no longer needed. Changed call site that used the poster() function to instead
+        use getNonEmptyURLAttribute.
+        (WebCore::HTMLVideoElement::updatePosterImage): Check if the poster attribute is empty
+        by calling getAttribute instead of calling the poster function. This keeps the behavior
+        correct with the reflection change, and has a side benefit of being more efficient as
+        well since there is no reason to resolve the URL.
+
+        * html/HTMLVideoElement.h: Removed the poster function for the same reason we removed
+        the src function above. Also removed now-unneeded m_posterURL data member.
+
+        * html/HTMLVideoElement.idl: Removed the NonEmpty extended attribute from the poster
+        attribute.
+
 2010-07-26  Chris Fleizach  <cfleizach at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index 22f6277..34f54aa 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -304,7 +304,7 @@ RenderObject* HTMLMediaElement::createRenderer(RenderArena* arena, RenderStyle*)
 void HTMLMediaElement::insertedIntoDocument()
 {
     HTMLElement::insertedIntoDocument();
-    if (!src().isEmpty() && m_networkState == NETWORK_EMPTY)
+    if (!getAttribute(srcAttr).isEmpty() && m_networkState == NETWORK_EMPTY)
         scheduleLoad();
 }
 
@@ -438,11 +438,6 @@ PassRefPtr<MediaError> HTMLMediaElement::error() const
     return m_error;
 }
 
-KURL HTMLMediaElement::src() const
-{
-    return getNonEmptyURLAttribute(srcAttr);
-}
-
 void HTMLMediaElement::setSrc(const String& url)
 {
     setAttribute(srcAttr, url);
@@ -671,9 +666,9 @@ void HTMLMediaElement::loadResource(const KURL& initialURL, ContentType& content
     m_player->load(m_currentSrc, contentType);
 
     if (isVideo() && m_player->canLoadPoster()) {
-        KURL posterUrl = poster();
-        if (!posterUrl.isEmpty())
-            m_player->setPoster(posterUrl);
+        KURL posterURL = getNonEmptyURLAttribute(posterAttr);
+        if (!posterURL.isEmpty())
+            m_player->setPoster(posterURL);
     }
 
     if (renderer())
@@ -1962,13 +1957,10 @@ void HTMLMediaElement::getPluginProxyParams(KURL& url, Vector<String>& names, Ve
     FrameLoader* loader = frame ? frame->loader() : 0;
 
     if (isVideo()) {
-        String poster = poster();
-        if (!poster.isEmpty() && loader) {
-            KURL posterURL = loader->completeURL(poster);
-            if (posterURL.isValid() && loader->willLoadMediaElementURL(posterURL)) {
-                names.append("_media_element_poster_");
-                values.append(posterURL.string());
-            }
+        KURL posterURL = getNonEmptyURLAttribute(posterAttr);
+        if (!posterURL.isEmpty() && loader && loader->willLoadMediaElementURL(posterURL)) {
+            names.append("_media_element_poster_");
+            values.append(posterURL.string());
         }
     }
 
diff --git a/WebCore/html/HTMLMediaElement.h b/WebCore/html/HTMLMediaElement.h
index 051629e..eede363 100644
--- a/WebCore/html/HTMLMediaElement.h
+++ b/WebCore/html/HTMLMediaElement.h
@@ -64,7 +64,6 @@ public:
 
     // Eventually overloaded in HTMLVideoElement
     virtual bool supportsFullscreen() const { return false; };
-    virtual const KURL poster() const { return KURL(); }
 
     virtual bool supportsSave() const;
     
@@ -84,7 +83,6 @@ public:
     PassRefPtr<MediaError> error() const;
 
 // network state
-    KURL src() const;
     void setSrc(const String&);
     String currentSrc() const;
 
diff --git a/WebCore/html/HTMLMediaElement.idl b/WebCore/html/HTMLMediaElement.idl
index 28a0fbe..12a1464 100644
--- a/WebCore/html/HTMLMediaElement.idl
+++ b/WebCore/html/HTMLMediaElement.idl
@@ -30,7 +30,7 @@ interface [Conditional=VIDEO] HTMLMediaElement : HTMLElement {
     readonly attribute MediaError error;
 
     // network state
-    attribute [Reflect,NonEmpty,URL] DOMString src;
+    attribute [Reflect,URL] DOMString src;
     readonly attribute DOMString currentSrc;
     
     const unsigned short NETWORK_EMPTY = 0;
diff --git a/WebCore/html/HTMLSourceElement.cpp b/WebCore/html/HTMLSourceElement.cpp
index 2c83fed..6c26610 100644
--- a/WebCore/html/HTMLSourceElement.cpp
+++ b/WebCore/html/HTMLSourceElement.cpp
@@ -62,11 +62,6 @@ void HTMLSourceElement::insertedIntoDocument()
     }
 }
 
-KURL HTMLSourceElement::src() const
-{
-    return getNonEmptyURLAttribute(srcAttr);
-}
-
 void HTMLSourceElement::setSrc(const String& url)
 {
     setAttribute(srcAttr, url);
diff --git a/WebCore/html/HTMLSourceElement.h b/WebCore/html/HTMLSourceElement.h
index 6cca64e..20049cc 100644
--- a/WebCore/html/HTMLSourceElement.h
+++ b/WebCore/html/HTMLSourceElement.h
@@ -37,7 +37,6 @@ class HTMLSourceElement : public HTMLElement {
 public:
     static PassRefPtr<HTMLSourceElement> create(const QualifiedName&, Document*);
 
-    KURL src() const;
     String media() const;
     String type() const;
     void setSrc(const String&);    
diff --git a/WebCore/html/HTMLSourceElement.idl b/WebCore/html/HTMLSourceElement.idl
index f7229f1..61dc4d0 100644
--- a/WebCore/html/HTMLSourceElement.idl
+++ b/WebCore/html/HTMLSourceElement.idl
@@ -25,7 +25,7 @@
 
 module html {
 interface [Conditional=VIDEO] HTMLSourceElement : HTMLElement {
-    attribute [Reflect,NonEmpty,URL] DOMString src;
+    attribute [Reflect,URL] DOMString src;
     attribute DOMString type;
     attribute DOMString media;
 };
diff --git a/WebCore/html/HTMLVideoElement.cpp b/WebCore/html/HTMLVideoElement.cpp
index a6fdb5f..bfdf241 100644
--- a/WebCore/html/HTMLVideoElement.cpp
+++ b/WebCore/html/HTMLVideoElement.cpp
@@ -101,7 +101,6 @@ void HTMLVideoElement::parseMappedAttribute(Attribute* attr)
     const QualifiedName& attrName = attr->name();
 
     if (attrName == posterAttr) {
-        m_posterURL = getNonEmptyURLAttribute(posterAttr);
         updatePosterImage();
         if (m_shouldDisplayPosterImage) {
 #if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
@@ -110,7 +109,7 @@ void HTMLVideoElement::parseMappedAttribute(Attribute* attr)
             m_imageLoader->updateFromElementIgnoringPreviousError();
 #else
             if (player())
-                player()->setPoster(poster());
+                player()->setPoster(getNonEmptyURLAttribute(posterAttr));
 #endif
         }
     } else if (attrName == widthAttr)
@@ -179,7 +178,7 @@ void HTMLVideoElement::updatePosterImage()
     bool oldShouldShowPosterImage = m_shouldDisplayPosterImage;
 #endif
 
-    m_shouldDisplayPosterImage = !poster().isEmpty() && !hasAvailableVideoFrame();
+    m_shouldDisplayPosterImage = !getAttribute(posterAttr).isEmpty() && !hasAvailableVideoFrame();
 
 #if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     if (renderer() && oldShouldShowPosterImage != m_shouldDisplayPosterImage)
diff --git a/WebCore/html/HTMLVideoElement.h b/WebCore/html/HTMLVideoElement.h
index c27962f..e7c3f34 100644
--- a/WebCore/html/HTMLVideoElement.h
+++ b/WebCore/html/HTMLVideoElement.h
@@ -44,8 +44,6 @@ public:
     unsigned videoWidth() const;
     unsigned videoHeight() const;
     
-    virtual const KURL poster() const { return m_posterURL; }
-
     // Fullscreen
     void webkitEnterFullscreen(bool isUserGesture, ExceptionCode&);
     void webkitExitFullscreen();
@@ -84,7 +82,6 @@ private:
     virtual void willMoveToNewOwnerDocument();
 
     OwnPtr<HTMLImageLoader> m_imageLoader;
-    KURL m_posterURL;
     bool m_shouldDisplayPosterImage;
 };
 
diff --git a/WebCore/html/HTMLVideoElement.idl b/WebCore/html/HTMLVideoElement.idl
index 248d0f4..ca5db5e 100644
--- a/WebCore/html/HTMLVideoElement.idl
+++ b/WebCore/html/HTMLVideoElement.idl
@@ -32,7 +32,7 @@ module html {
         attribute [Reflect] unsigned long height;
         readonly attribute unsigned long videoWidth;
         readonly attribute unsigned long videoHeight;
-        attribute [Reflect,NonEmpty,URL] DOMString poster;
+        attribute [Reflect,URL] DOMString poster;
 
         readonly attribute boolean webkitSupportsFullscreen;
         readonly attribute boolean webkitDisplayingFullscreen;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list