[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

darin at apple.com darin at apple.com
Thu Apr 8 02:14:36 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 5694af4b6fa767caf43afc1528f973d7c1e2e206
Author: darin at apple.com <darin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Mar 8 22:16:00 2010 +0000

    2010-03-08  Darin Adler  <darin at apple.com>
    
            Reviewed by Jon Honeycutt.
    
            https://bugs.webkit.org/show_bug.cgi?id=35876
    
            Fix minor style issues in HTMLMediaElement and classes derived from it.
            Made many public members private and protected.
    
            * html/HTMLMediaElement.cpp:
            (WebCore::HTMLMediaElement::screenRect): Got rid of a stray "const" and
            retstructured the function to use early return and get rid of a local.
    
            * html/HTMLMediaElement.h: Made lots of members private and some
            protected. Also use private inheritance instead of public. Removed
            some unneeded includes.
    
            * html/HTMLVideoElement.cpp:
            (WebCore::HTMLVideoElement::parseMappedAttribute): Use player() instead
            of m_player; HTMLMediaElement data members are now private, not protected.
            (WebCore::HTMLVideoElement::supportsFullscreen): Ditto.
            (WebCore::HTMLVideoElement::videoWidth): Ditto.
            (WebCore::HTMLVideoElement::videoHeight): Ditto.
            (WebCore::HTMLVideoElement::hasAvailableVideoFrame): Ditto.
            (WebCore::HTMLVideoElement::webkitEnterFullScreen): Use isFullscreen()
            instead of m_isFullscreen; same reason.
            (WebCore::HTMLVideoElement::webkitExitFullScreen): Ditto.
            (WebCore::HTMLVideoElement::webkitDisplayingFullscreen): Ditto.
    
            * html/HTMLVideoElement.h: Removed an unneeded include. Made many
            public functions private. Got rid of unused paint function, which was
            replaced with paintCurrentFrameInContext a while back.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55682 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c8e5004..7456b20 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,36 @@
+2010-03-08  Darin Adler  <darin at apple.com>
+
+        Reviewed by Jon Honeycutt.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35876
+
+        Fix minor style issues in HTMLMediaElement and classes derived from it.
+        Made many public members private and protected.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::screenRect): Got rid of a stray "const" and
+        retstructured the function to use early return and get rid of a local.
+
+        * html/HTMLMediaElement.h: Made lots of members private and some
+        protected. Also use private inheritance instead of public. Removed
+        some unneeded includes.
+
+        * html/HTMLVideoElement.cpp:
+        (WebCore::HTMLVideoElement::parseMappedAttribute): Use player() instead
+        of m_player; HTMLMediaElement data members are now private, not protected.
+        (WebCore::HTMLVideoElement::supportsFullscreen): Ditto.
+        (WebCore::HTMLVideoElement::videoWidth): Ditto.
+        (WebCore::HTMLVideoElement::videoHeight): Ditto.
+        (WebCore::HTMLVideoElement::hasAvailableVideoFrame): Ditto.
+        (WebCore::HTMLVideoElement::webkitEnterFullScreen): Use isFullscreen()
+        instead of m_isFullscreen; same reason.
+        (WebCore::HTMLVideoElement::webkitExitFullScreen): Ditto.
+        (WebCore::HTMLVideoElement::webkitDisplayingFullscreen): Ditto.
+
+        * html/HTMLVideoElement.h: Removed an unneeded include. Made many
+        public functions private. Got rid of unused paint function, which was
+        replaced with paintCurrentFrameInContext a while back.
+
 2010-03-08  Joanmarie Diggs  <joanmarie.diggs at gmail.com>
 
         Reviewed by Xan Lopez.
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index 48af1ae..d1ec43c 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -1812,12 +1812,11 @@ void HTMLMediaElement::mediaVolumeDidChange()
     updateVolume();
 }
 
-const IntRect HTMLMediaElement::screenRect()
+IntRect HTMLMediaElement::screenRect()
 {
-    IntRect elementRect;
-    if (renderer())
-        elementRect = renderer()->view()->frameView()->contentsToScreen(renderer()->absoluteBoundingBoxRect());
-    return elementRect;
+    if (!renderer())
+        return IntRect();
+    return renderer()->view()->frameView()->contentsToScreen(renderer()->absoluteBoundingBoxRect());
 }
     
 void HTMLMediaElement::defaultEventHandler(Event* event)
diff --git a/WebCore/html/HTMLMediaElement.h b/WebCore/html/HTMLMediaElement.h
index a2eb67a..15928e6 100644
--- a/WebCore/html/HTMLMediaElement.h
+++ b/WebCore/html/HTMLMediaElement.h
@@ -30,11 +30,6 @@
 
 #include "HTMLElement.h"
 #include "MediaPlayer.h"
-#include "Timer.h"
-
-#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
-#include "MediaPlayerProxy.h"
-#endif
 
 namespace WebCore {
 
@@ -44,22 +39,12 @@ class MediaError;
 class KURL;
 class TimeRanges;
 
+// FIXME: The inheritance from MediaPlayerClient here should be private inheritance.
+// But it can't be until the Chromium WebMediaPlayerClientImpl class is fixed so it
+// no longer depends on typecasting a MediaPlayerClient to an HTMLMediaElement.
+
 class HTMLMediaElement : public HTMLElement, public MediaPlayerClient {
 public:
-    virtual ~HTMLMediaElement();
-
-    bool checkDTD(const Node* newChild);
-    
-    void attributeChanged(Attribute*, bool preserveDecls);
-    void parseMappedAttribute(MappedAttribute *);
-
-    virtual bool rendererIsNeeded(RenderStyle*);
-    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
-    virtual void insertedIntoDocument();
-    virtual void removedFromDocument();
-    virtual void attach();
-    virtual void recalcStyle(StyleChange);
-    
     MediaPlayer* player() const { return m_player.get(); }
     
     virtual bool isVideo() const = 0;
@@ -80,11 +65,6 @@ public:
 
     void scheduleLoad();
     
-    virtual void defaultEventHandler(Event*);
-    
-    // Pauses playback without changing any states or generating events
-    void setPausedInternal(bool);
-    
     MediaPlayer::MovieLoadType movieLoadType() const;
     
     bool inActiveDocument() const { return m_inActiveDocument; }
@@ -151,7 +131,7 @@ public:
     void beginScrubbing();
     void endScrubbing();
 
-    const IntRect screenRect();
+    IntRect screenRect();
 
     bool canPlay() const;
 
@@ -159,14 +139,15 @@ public:
 
 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     void setNeedWidgetUpdate(bool needWidgetUpdate) { m_needWidgetUpdate = needWidgetUpdate; }
-    void deliverNotification(MediaPlayerProxyNotificationType notification);
-    void setMediaPlayerProxy(WebMediaPlayerProxy* proxy);
+    void deliverNotification(MediaPlayerProxyNotificationType);
+    void setMediaPlayerProxy(WebMediaPlayerProxy*);
     String initialURL();
     virtual void finishParsingChildren();
 #endif
 
     bool hasSingleSecurityOrigin() const { return !m_player || m_player->hasSingleSecurityOrigin(); }
     
+    bool isFullscreen() const { return m_isFullscreen; }
     void enterFullscreen();
     void exitFullscreen();
 
@@ -178,7 +159,22 @@ public:
 
 protected:
     HTMLMediaElement(const QualifiedName&, Document*);
+    virtual ~HTMLMediaElement();
 
+    virtual void parseMappedAttribute(MappedAttribute *);
+    virtual void attach();
+
+private:
+    virtual bool checkDTD(const Node* newChild);    
+    virtual void attributeChanged(Attribute*, bool preserveDecls);
+    virtual bool rendererIsNeeded(RenderStyle*);
+    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
+    virtual void insertedIntoDocument();
+    virtual void removedFromDocument();
+    virtual void recalcStyle(StyleChange);
+    
+    virtual void defaultEventHandler(Event*);
+    
     float getTimeOffsetAttribute(const QualifiedName&, float valueOnError) const;
     void setTimeOffsetAttribute(const QualifiedName&, float value);
     
@@ -193,7 +189,6 @@ protected:
     virtual void willMoveToNewOwnerDocument();
     virtual void didMoveToNewOwnerDocument();
 
-private: // MediaPlayerClient
     virtual Document* mediaPlayerOwningDocument();
     virtual void mediaPlayerNetworkStateChanged(MediaPlayer*);
     virtual void mediaPlayerReadyStateChanged(MediaPlayer*);
@@ -210,7 +205,6 @@ private: // MediaPlayerClient
     virtual void mediaPlayerRenderingModeChanged(MediaPlayer*);
 #endif
 
-private:
     void loadTimerFired(Timer<HTMLMediaElement>*);
     void asyncEventTimerFired(Timer<HTMLMediaElement>*);
     void progressEventTimerFired(Timer<HTMLMediaElement>*);
@@ -265,15 +259,17 @@ private:
     float minTimeSeekable() const;
     float maxTimeSeekable() const;
 
-    // Restrictions to change default behaviors. This is a effectively a compile time choice at the moment
-    //  because there are no accessor methods.
+    // Pauses playback without changing any states or generating events
+    void setPausedInternal(bool);
+
+    // Restrictions to change default behaviors. This is effectively a compile time choice at the moment
+    // because there are no accessor functions.
     enum BehaviorRestrictions {
         NoRestrictions = 0,
         RequireUserGestureForLoadRestriction = 1 << 0,
         RequireUserGestureForRateChangeRestriction = 1 << 1,
     };
 
-protected:
     Timer<HTMLMediaElement> m_loadTimer;
     Timer<HTMLMediaElement> m_asyncEventTimer;
     Timer<HTMLMediaElement> m_progressEventTimer;
@@ -305,7 +301,7 @@ protected:
     // loading state
     enum LoadState { WaitingForSource, LoadingFromSrcAttr, LoadingFromSourceElement };
     LoadState m_loadState;
-    HTMLSourceElement *m_currentSourceNode;
+    HTMLSourceElement* m_currentSourceNode;
     
     OwnPtr<MediaPlayer> m_player;
 
diff --git a/WebCore/html/HTMLVideoElement.cpp b/WebCore/html/HTMLVideoElement.cpp
index be8f884..34ad2c9 100644
--- a/WebCore/html/HTMLVideoElement.cpp
+++ b/WebCore/html/HTMLVideoElement.cpp
@@ -104,8 +104,8 @@ void HTMLVideoElement::parseMappedAttribute(MappedAttribute* attr)
                 m_imageLoader.set(new HTMLImageLoader(this));
             m_imageLoader->updateFromElementIgnoringPreviousError();
 #else
-            if (m_player)
-                m_player->setPoster(poster());
+            if (player())
+                player()->setPoster(poster());
 #endif
         }
     } else if (attrName == widthAttr)
@@ -122,7 +122,7 @@ bool HTMLVideoElement::supportsFullscreen() const
     if (!page) 
         return false;
 
-    if (!m_player || !m_player->supportsFullscreen() || !m_player->hasVideo())
+    if (!player() || !player()->supportsFullscreen() || !player()->hasVideo())
         return false;
 
     // Check with the platform client.
@@ -131,16 +131,16 @@ bool HTMLVideoElement::supportsFullscreen() const
 
 unsigned HTMLVideoElement::videoWidth() const
 {
-    if (!m_player)
+    if (!player())
         return 0;
-    return m_player->naturalSize().width();
+    return player()->naturalSize().width();
 }
 
 unsigned HTMLVideoElement::videoHeight() const
 {
-    if (!m_player)
+    if (!player())
         return 0;
-    return m_player->naturalSize().height();
+    return player()->naturalSize().height();
 }
 
 unsigned HTMLVideoElement::width() const
@@ -196,16 +196,6 @@ void HTMLVideoElement::updatePosterImage()
 #endif
 }
 
-void HTMLVideoElement::paint(GraphicsContext* context, const IntRect& destRect)
-{
-    MediaPlayer* player = HTMLMediaElement::player();
-    if (!player)
-        return;
-
-    player->setVisible(true); // Make player visible or it won't draw.
-    player->paint(context, destRect);
-}
-
 void HTMLVideoElement::paintCurrentFrameInContext(GraphicsContext* context, const IntRect& destRect)
 {
     MediaPlayer* player = HTMLMediaElement::player();
@@ -218,15 +208,15 @@ void HTMLVideoElement::paintCurrentFrameInContext(GraphicsContext* context, cons
 
 bool HTMLVideoElement::hasAvailableVideoFrame() const
 {
-    if (!m_player)
+    if (!player())
         return false;
     
-    return m_player->hasAvailableVideoFrame();
+    return player()->hasAvailableVideoFrame();
 }
 
 void HTMLVideoElement::webkitEnterFullScreen(bool isUserGesture, ExceptionCode& ec)
 {
-    if (m_isFullscreen)
+    if (isFullscreen())
         return;
 
     // Generate an exception if this isn't called in response to a user gesture, or if the 
@@ -241,7 +231,7 @@ void HTMLVideoElement::webkitEnterFullScreen(bool isUserGesture, ExceptionCode&
 
 void HTMLVideoElement::webkitExitFullScreen()
 {
-    if (m_isFullscreen)
+    if (isFullscreen())
         exitFullscreen();
 }
 
@@ -252,7 +242,7 @@ bool HTMLVideoElement::webkitSupportsFullscreen()
 
 bool HTMLVideoElement::webkitDisplayingFullscreen()
 {
-    return m_isFullscreen;
+    return isFullscreen();
 }
 
 
diff --git a/WebCore/html/HTMLVideoElement.h b/WebCore/html/HTMLVideoElement.h
index d12667e..67c68e7 100644
--- a/WebCore/html/HTMLVideoElement.h
+++ b/WebCore/html/HTMLVideoElement.h
@@ -29,7 +29,6 @@
 #if ENABLE(VIDEO)
 
 #include "HTMLMediaElement.h"
-#include <wtf/OwnPtr.h>
 
 namespace WebCore {
 
@@ -39,20 +38,6 @@ class HTMLVideoElement : public HTMLMediaElement {
 public:
     HTMLVideoElement(const QualifiedName&, Document*);
 
-    virtual int tagPriority() const { return 5; }
-    virtual bool rendererIsNeeded(RenderStyle*);
-#if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
-    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
-#endif
-    virtual void attach();
-    virtual void detach();
-    virtual void parseMappedAttribute(MappedAttribute* attr);
-    virtual bool isVideo() const { return true; }
-    virtual bool hasVideo() const { return player() && player()->hasVideo(); }
-    virtual bool supportsFullscreen() const;
-    virtual bool isURLAttribute(Attribute*) const;
-    virtual const QualifiedName& imageSourceAttributeName() const;
-
     unsigned width() const;
     void setWidth(unsigned);
     unsigned height() const;
@@ -72,11 +57,24 @@ public:
 
     bool shouldDisplayPosterImage() const { return m_shouldDisplayPosterImage; }
 
-    void paint(GraphicsContext*, const IntRect&);
     // Used by canvas to gain raw pixel access
     void paintCurrentFrameInContext(GraphicsContext*, const IntRect&);
 
 private:
+    virtual int tagPriority() const { return 5; }
+    virtual bool rendererIsNeeded(RenderStyle*);
+#if !ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
+#endif
+    virtual void attach();
+    virtual void detach();
+    virtual void parseMappedAttribute(MappedAttribute*);
+    virtual bool isVideo() const { return true; }
+    virtual bool hasVideo() const { return player() && player()->hasVideo(); }
+    virtual bool supportsFullscreen() const;
+    virtual bool isURLAttribute(Attribute*) const;
+    virtual const QualifiedName& imageSourceAttributeName() const;
+
     virtual bool hasAvailableVideoFrame() const;
     virtual void updatePosterImage();
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list