Changeset 200462 in webkit


Ignore:
Timestamp:
May 5, 2016 11:14:48 AM (8 years ago)
Author:
adachan@apple.com
Message:

When exiting fullscreen, call a JS method immediately to implement the style changes for the presentation mode change right away
https://bugs.webkit.org/show_bug.cgi?id=157359

Reviewed by Eric Carlson.

No new tests as this is done to just mitigate a visual glitch.

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::exitFullscreen):
(WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):

  • html/HTMLMediaElement.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r200461 r200462  
     12016-05-04  Ada Chan  <adachan@apple.com>
     2
     3        When exiting fullscreen, call a JS method immediately to implement the style changes for the presentation mode change right away
     4        https://bugs.webkit.org/show_bug.cgi?id=157359
     5
     6        Reviewed by Eric Carlson.
     7
     8        No new tests as this is done to just mitigate a visual glitch.
     9
     10        * html/HTMLMediaElement.cpp:
     11        (WebCore::HTMLMediaElement::exitFullscreen):
     12        (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
     13        * html/HTMLMediaElement.h:
     14
    1152016-05-04  Alex Christensen  <achristensen@webkit.org>
    216
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r200431 r200462  
    53965396    VideoFullscreenMode oldVideoFullscreenMode = m_videoFullscreenMode;
    53975397    fullscreenModeChanged(VideoFullscreenModeNone);
     5398#if ENABLE(MEDIA_CONTROLS_SCRIPT)
     5399    updateMediaControlsAfterPresentationModeChange();
     5400#endif
    53985401    if (hasMediaControls())
    53995402        mediaControls()->exitedFullscreen();
     
    65396542    else
    65406543        document().unregisterForPageScaleFactorChangedCallbacks(this);
     6544}
     6545
     6546void HTMLMediaElement::updateMediaControlsAfterPresentationModeChange()
     6547{
     6548    DOMWrapperWorld& world = ensureIsolatedWorld();
     6549    ScriptController& scriptController = document().frame()->script();
     6550    JSDOMGlobalObject* globalObject = JSC::jsCast<JSDOMGlobalObject*>(scriptController.globalObject(world));
     6551    JSC::ExecState* exec = globalObject->globalExec();
     6552    JSC::JSLockHolder lock(exec);
     6553
     6554    JSC::JSValue controllerValue = controllerJSValue(*exec, *globalObject, *this);
     6555    JSC::JSObject* controllerObject = controllerValue.toObject(exec);
     6556
     6557    if (exec->hadException())
     6558        return;
     6559
     6560    JSC::JSValue functionValue = controllerObject->get(exec, JSC::Identifier::fromString(exec, "handlePresentationModeChange"));
     6561    if (exec->hadException() || functionValue.isUndefinedOrNull())
     6562        return;
     6563
     6564    JSC::JSObject* function = functionValue.toObject(exec);
     6565    ASSERT(!exec->hadException());
     6566    JSC::CallData callData;
     6567    JSC::CallType callType = function->methodTable()->getCallData(function, callData);
     6568    if (callType == JSC::CallType::None)
     6569        return;
     6570
     6571    JSC::MarkedArgumentBuffer argList;
     6572    JSC::call(exec, function, callType, callData, controllerObject, argList);
    65416573}
    65426574
  • trunk/Source/WebCore/html/HTMLMediaElement.h

    r200431 r200462  
    484484    bool mediaControlsDependOnPageScaleFactor() const { return m_mediaControlsDependOnPageScaleFactor; }
    485485    void setMediaControlsDependOnPageScaleFactor(bool);
     486    void updateMediaControlsAfterPresentationModeChange();
    486487#endif
    487488
Note: See TracChangeset for help on using the changeset viewer.