Bug 29621 - Add port-specific control over rendering of media control elements
Summary: Add port-specific control over rendering of media control elements
Status: RESOLVED DUPLICATE of bug 28689
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-21 16:08 PDT by Andrew Scherkus
Modified: 2009-09-22 08:42 PDT (History)
1 user (show)

See Also:


Attachments
Draft (5.53 KB, patch)
2009-09-21 16:13 PDT, Andrew Scherkus
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Scherkus 2009-09-21 16:08:42 PDT
Ports should be able to control whether a media control element is rendered or not.
Comment 1 Andrew Scherkus 2009-09-21 16:13:07 PDT
Created attachment 39891 [details]
Draft

This is a draft of deferring the decision on rendering a media control element to the RenderTheme.

This is my first real dive into Element/RenderObject/Style/Theme interaction, so feel free to point out my mistakes :)
Comment 2 Andrew Scherkus 2009-09-21 16:15:03 PDT
The overall change is:
 1) Media control elements will always create a renderer
 2) RenderTheme decides whether those renderers will be visible based on inspecting the HTMLMediaElement
Comment 3 Andrew Scherkus 2009-09-21 18:38:56 PDT
Forgot I had left my previous bug open.  Closing.

*** This bug has been marked as a duplicate of bug 28689 ***
Comment 4 Eric Carlson 2009-09-22 08:39:37 PDT
> +
> +    // Alternatively we could pass in the theme for fine-tuned adjustment.  If
> +    // we keep it as simply setting display to NONE then I might rename this method
> +    // shouldDisplayMediaControlPart instead.
> +    if (!renderer->theme()->shouldRenderMediaControlPart(renderer))
> +        style->setDisplay(NONE);

This shouldn't be necessary. I think if have both MediaControlElement:: rendererIsNeeded and MediaControlInputElement:: rendererIsNeeded call the theme method it should just work.

>  bool MediaControlMuteButtonElement::rendererIsNeeded(RenderStyle* style)
>  {
> -    return MediaControlInputElement::rendererIsNeeded(style) && !disabled();
> +    // All subclasses will probably end up NOT implementing this method anymore.
> +    return MediaControlInputElement::rendererIsNeeded(style);

We do want to call the the base class method, an element could not need a renderer for other reasons (eg. CSS).
Comment 5 Eric Carlson 2009-09-22 08:42:38 PDT
oops, wrong bug.