[Webkit-unassigned] [Bug 79167] Expose a setting to exempt media playback from user gesture requirement after a user gesture is initiated on loading/playing a media

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 21 19:44:43 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=79167


Adam Barth <abarth at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #128092|review?                     |review-
               Flag|                            |




--- Comment #2 from Adam Barth <abarth at webkit.org>  2012-02-21 19:44:43 PST ---
(From update of attachment 128092)
View in context: https://bugs.webkit.org/attachment.cgi?id=128092&action=review

You seem to be missing the changes to Source/WebKit/chromium/public, which is presumably useful to you.

> ChangeLog:1
> +2012-02-21  Min Qin  <qinmin at google.com>

This isn't the right ChangeLog file.  These comments should be in Source/WebCore/ChangeLog.  I wonder how you came to edit this file...  ./Tools/Scripts/prepare-ChangeLog should have edited the right file.

> Source/WebCore/html/HTMLMediaElement.cpp:261
> +    if (document->settings() && document->settings()->exemptUserGestureForPlaybackAfterInitiated())
> +        m_userGestureExemptedForPlaybackAfterInitiated = true;
> +    else
> +        m_userGestureExemptedForPlaybackAfterInitiated = false;
> +        

Why not just:

m_userGestureExemptedForPlaybackAfterInitiated = document->settings() && document->settings()->exemptUserGestureForPlaybackAfterInitiated();

?

> Source/WebCore/html/HTMLMediaElement.cpp:2077
> -    if (userGestureRequiredForRateChange() && !ScriptController::processingUserGesture())
> +    if (userGestureRequiredForRateChange() && !ScriptController::processingUserGesture() && !m_userGestureExempted)

Should userGestureRequiredForRateChange() read m_userGestureExempted rather than use reading it directly?

> Source/WebCore/html/HTMLMediaElement.h:596
> +    bool m_userGestureExemptedForPlaybackAfterInitiated: 1;
> +    bool m_userGestureExempted: 1;

m_userGestureExemptedForPlaybackAfterInitiated doesn't seem to be initialized in the constructor.

I'm not in love with these variable names.  Maybe....

m_userGestureExemptedForPlaybackAfterInitiated -> m_shouldSkipUserGestureChecksAfterFirstUserGesture
m_userGestureExempted -> m_skipUserGestureChecks

?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list