Bug 26661

Summary: Fullscreen button should be hidden when the backend doesn't support it.
Product: WebKit Reporter: Pierre d'Herbemont <pdherbemont>
Component: New BugsAssignee: Pierre d'Herbemont <pdherbemont>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Bug Depends on: 26659    
Bug Blocks: 26742    
Attachments:
Description Flags
patch 1/2 - v1.
none
patch 2/2 - v1.
none
patch 1/2 - v2.
eric: review+
patch 2/2 - v2.
eric: review+
patch 1/2 - v3.
simon.fraser: review+
patch 1/2 - v4. simon.fraser: review+

Description Pierre d'Herbemont 2009-06-23 14:16:58 PDT
Blocked by: https://bugs.webkit.org/show_bug.cgi?id=26659
Comment 1 Pierre d'Herbemont 2009-06-23 14:33:34 PDT
Created attachment 31739 [details]
patch 1/2 - v1.
Comment 2 Pierre d'Herbemont 2009-06-23 14:34:25 PDT
Created attachment 31740 [details]
patch 2/2 - v1.
Comment 3 Pierre d'Herbemont 2009-06-23 15:54:30 PDT
Created attachment 31750 [details]
patch 1/2 - v2.

With ChangeLog.
Comment 4 Pierre d'Herbemont 2009-06-23 15:55:16 PDT
Created attachment 31751 [details]
patch 2/2 - v2.

With ChangeLog.
Comment 5 Eric Seidel (no email) 2009-06-23 17:34:24 PDT
Comment on attachment 31750 [details]
patch 1/2 - v2.

I bet there are still ways to test this... but ok.
Comment 6 Eric Seidel (no email) 2009-06-23 17:35:28 PDT
Comment on attachment 31751 [details]
patch 2/2 - v2.

Looks OK.
Comment 7 Eric Seidel (no email) 2009-06-24 18:50:50 PDT
Pierre will you commit these yourself, or does someone need to commit them for you?
Comment 8 Pierre d'Herbemont 2009-06-24 19:20:07 PDT
(In reply to comment #7)
> Pierre will you commit these yourself, or does someone need to commit them for
> you?

I don't have commit access... So I still need someone to commit them.
Comment 9 Pierre d'Herbemont 2009-06-25 10:25:29 PDT
Created attachment 31863 [details]
patch 1/2 - v3.

supportsFullscreen() shouldn't be pure virtual. Return false by default.
Comment 10 Pierre d'Herbemont 2009-06-25 10:26:33 PDT
Comment on attachment 31863 [details]
patch 1/2 - v3.

I think it's still r+ by Eric Seidel, even after this change. Yet. Marquing as r?
Comment 11 Simon Fraser (smfr) 2009-06-25 11:36:50 PDT
Comment on attachment 31863 [details]
patch 1/2 - v3.


> diff --git a/WebCore/html/HTMLMediaElement.h b/WebCore/html/HTMLMediaElement.h
> index 2a08e3c..18b263a 100644
> --- a/WebCore/html/HTMLMediaElement.h
> +++ b/WebCore/html/HTMLMediaElement.h
> @@ -65,7 +65,9 @@ public:
>      
>      virtual bool isVideo() const { return false; }
>      virtual bool hasVideo() const { return false; }
> -    
> +
> +    virtual bool supportsFullscreen() const { return false; }

Try to avoid changing whitespace.

> +void MediaControlFullscreenButtonElement::update()
> +{
> +    setHidden(!m_mediaElement->supportsFullscreen());
> +    MediaControlInputElement::update();

Will need to change when setHidden goes away.

> diff --git a/WebCore/rendering/MediaControlElements.h b/WebCore/rendering/MediaControlElements.h
> index 0c95976..4d8647e 100644
> --- a/WebCore/rendering/MediaControlElements.h
> +++ b/WebCore/rendering/MediaControlElements.h
> @@ -154,6 +154,7 @@ class MediaControlFullscreenButtonElement : public MediaControlInputElement {
>  public:
>      MediaControlFullscreenButtonElement(Document*, HTMLMediaElement*);
>      virtual void defaultEventHandler(Event*);
> +    void update();

You'll need to make update() virtual on MediaControlInputElement, then declare if virtual here.

OK with these changes.
Comment 12 Pierre d'Herbemont 2009-06-25 16:40:02 PDT
Created attachment 31886 [details]
patch 1/2 - v4.

With Simon's comment.
Comment 13 Eric Seidel (no email) 2009-06-25 17:07:19 PDT
Comment on attachment 31886 [details]
patch 1/2 - v4.

No argument name needed:
virtual bool rendererIsNeeded(RenderStyle* style);
according to WK style.

I think simon should review this.
Comment 14 Simon Fraser (smfr) 2009-06-26 11:14:50 PDT
Comment on attachment 31886 [details]
patch 1/2 - v4.

> +bool MediaControlFullscreenButtonElement::rendererIsNeeded(RenderStyle* style)
> +{
> +    return m_mediaElement->supportsFullscreen() && HTMLInputElement::rendererIsNeeded(style);

Should just call up to the superclass here, not skip a generation.
Comment 15 Simon Fraser (smfr) 2009-06-26 11:28:55 PDT
http://trac.webkit.org/changeset/45273