Bug 138215 - The Page's muted setting should not affect the HTMLMediaElement's 'muted' IDL attribute
Summary: The Page's muted setting should not affect the HTMLMediaElement's 'muted' IDL...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ada Chan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-30 10:46 PDT by Ada Chan
Modified: 2014-10-30 16:42 PDT (History)
13 users (show)

See Also:


Attachments
Patch (15.03 KB, patch)
2014-10-30 14:22 PDT, Ada Chan
eric.carlson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ada Chan 2014-10-30 10:46:28 PDT
For example, if the HTMLMediaElement's muted attribute has not been set, but the Page's muted setting is set to true, querying the element's muted property in script should still return false.  The Page's muted setting is more of an override, similar to how the Page's media volume works.
Comment 1 Ada Chan 2014-10-30 14:22:49 PDT
Created attachment 240697 [details]
Patch
Comment 2 Eric Carlson 2014-10-30 14:35:28 PDT
Comment on attachment 240697 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=240697&action=review

> Source/WebCore/html/HTMLMediaElement.cpp:6042
> +    return (document().page() && document().page()->isMuted()) || muted();

Minor nit: "muted()" is cheaper than "document().page() && document().page()->isMuted()" so it should be first.

> Source/WebCore/testing/Internals.h:349
>      void installMockPageOverlay(const String& overlayType, ExceptionCode&);
>      String pageOverlayLayerTreeAsText(ExceptionCode&) const;
>  
> +    void setMuted(bool);

Nit: I think "page" should be in the method name. "setPageMuted" maybe?
Comment 3 Ada Chan 2014-10-30 15:07:46 PDT
(In reply to comment #2)
> Comment on attachment 240697 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=240697&action=review
> 
> > Source/WebCore/html/HTMLMediaElement.cpp:6042
> > +    return (document().page() && document().page()->isMuted()) || muted();
> 
> Minor nit: "muted()" is cheaper than "document().page() &&
> document().page()->isMuted()" so it should be first.

Fixed.

> 
> > Source/WebCore/testing/Internals.h:349
> >      void installMockPageOverlay(const String& overlayType, ExceptionCode&);
> >      String pageOverlayLayerTreeAsText(ExceptionCode&) const;
> >  
> > +    void setMuted(bool);
> 
> Nit: I think "page" should be in the method name. "setPageMuted" maybe?

Renamed as you suggested.

Thanks Eric!
Comment 4 Joseph Pecoraro 2014-10-30 15:38:49 PDT
Looks like this may have broken the windows build. Probably just a symbol export issue:
<https://build.webkit.org/builders/Apple%20Win%20Debug%20%28Build%29/builds/83112/steps/compile-webkit/logs/stdio>

>      1>WebCoreTestSupport.lib(Internals.obj) : error LNK2019: unresolved external symbol "public: void __thiscall WebCore::Page::setMuted(bool)" (?setMuted@Page@WebCore@@QAEX_N@Z) referenced in function "public: void __thiscall WebCore::Internals::setPageMuted(bool)" (?setPageMuted@Internals@WebCore@@QAEX_N@Z)
>      1>C:\cygwin\home\buildbot\slave\win-debug\build\WebKitBuild\Debug\bin32\DumpRenderTree.dll : fatal error LNK1120: 1 unresolved externals
>      1>Done Building Project "C:\cygwin\home\buildbot\slave\win-debug\build\Tools\DumpRenderTree\DumpRenderTree.vcxproj\DumpRenderTree\DumpRenderTree.vcxproj" (Build target(s)) -- FAILED.
Comment 5 Ada Chan 2014-10-30 16:20:37 PDT
Committed:
http://trac.webkit.org/changeset/175384

And as Joe noted, that broke Windows.  First attempt to fix it is:
http://trac.webkit.org/changeset/175393
Comment 6 Ada Chan 2014-10-30 16:42:00 PDT
The Windows 32-bit build error should be fixed with http://trac.webkit.org/changeset/175393.  Roger is going to help me figure out the symbol to export for 64-bit.