Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Issue 2793273002: Use internal hooks for notifying fullscreen changes to media controls (Closed)

Created:
3 years, 8 months ago by foolip
Modified:
3 years, 5 months ago
CC:
blink-reviews, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink, eric.carlson_apple.com, feature-media-reviews_chromium.org, fs, gasubic, mlamouri+watch-blink_chromium.org, nessy, Srirama
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Use internal hooks for notifying fullscreen changes to media controls The timing of the fullscreenchange and webkitfullscreenchange events changed in issue 402376, which caused a regression in issue 679281. In order to reland without this regression, use an internal hook that will not change its timing. When the all the fullscreen changes are done, a new mechanism that depends only web-exposed events may be possible, although likely that would require spec changes to either the Fullscreen API or the Screen Orientation API. Note that MediaCustomControlsFullscreenDetectorTest.* would continue to pass without any changes to the test. This is because MediaCustomControlsFullscreenDetector also adds event listeners in the same way. Nevertheless, the test is updated. BUG=402376, 679281

Patch Set 1 #

Patch Set 2 : update test #

Patch Set 3 : update more tests #

Messages

Total messages: 17 (9 generated)
foolip
PTAL. I threw this together today thinking it might conflict with https://codereview.chromium.org/2795783004/ and/or https://codereview.chromium.org/2780403004/ which ...
3 years, 8 months ago (2017-04-04 09:05:29 UTC) #7
mlamouri (slow - plz ping)
I'm concerned by this change in general as we actually moved away from this internals ...
3 years, 8 months ago (2017-04-04 09:23:16 UTC) #8
foolip
On 2017/04/04 09:23:16, mlamouri wrote: > I'm concerned by this change in general as we ...
3 years, 8 months ago (2017-04-04 09:40:13 UTC) #9
mlamouri (slow - plz ping)
On 2017/04/04 at 09:40:13, foolip wrote: > On 2017/04/04 09:23:16, mlamouri wrote: > > I'm ...
3 years, 8 months ago (2017-04-04 13:00:47 UTC) #12
foolip
On 2017/04/04 13:00:47, mlamouri wrote: > On 2017/04/04 at 09:40:13, foolip wrote: > > On ...
3 years, 8 months ago (2017-04-05 10:15:58 UTC) #13
mlamouri (slow - plz ping)
On 2017/04/05 at 10:15:58, foolip wrote: > On 2017/04/04 13:00:47, mlamouri wrote: > > On ...
3 years, 8 months ago (2017-04-05 16:15:51 UTC) #14
foolip
On 2017/04/05 16:15:51, mlamouri wrote: > On 2017/04/05 at 10:15:58, foolip wrote: > > In ...
3 years, 8 months ago (2017-04-07 14:52:36 UTC) #15
mlamouri (slow - plz ping)
3 years, 8 months ago (2017-04-10 12:59:31 UTC) #16
On 2017/04/07 at 14:52:36, foolip wrote:
> On 2017/04/05 16:15:51, mlamouri wrote:
> > On 2017/04/05 at 10:15:58, foolip wrote:
> > > In the meantime, what behavior do you think would be ideal? I assume that
a
> > site would call screen.lock() in the fullscreenchange event when entering
> > fullscreen, and screen.unlock() in the fullscreenchange event when exiting
> > fullscreen. Unless we block paint somehow, will be at least one bad frame in
> > both transitions, but what should the stable layout after that be? If the
answer
> > is that after screen.unlock() the layout is the same as before entering
> > fullscreen, then we will need to teach the screen orientation code about
> > restoring scale+offset saved when entering fullscreen. But, what should
happen
> > if orientation is unlocked long after exiting fullscreen? Maybe the answer
is to
> > privilege only screen.unlock() calls from within a fullscreenchange event
with
> > the scale+offset-restoring behavior?
> > 
> > Maybe we should a VC to discuss this because I might be missing a ton of
> > information. The behaviour that we should have is the one that we have today
> > which, it seems, wouldn't require any special code, right? If I understand,
you
> > expect to break the ability to unlock during a when exiting fullscreen.
Wouldn't
> > this break websites? We can change our own code but if a website is
implementing
> > exactly what you describe above, it would be broken, right?
> 
> The history of this problem is fortunately not very long, so here goes. Issue
402376 changed the timing of the webkitfullscreenchange event to always be at
animation frame timing after the actual change, which is already the timing of
the resize events. This caused the regression in issue 679281, and since there
had already been several other regressions I decided to revert, speculating on
the cause in https://bugs.chromium.org/p/chromium/issues/detail?id=679281#c8
> 
> What I did not spell out there explicitly is what logic I think is going wrong
here:
>
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/web/Fullscreen...
> 
> In FullscreenController::didUpdateLayout() there is code that should run on
the first layout after exiting fullscreen, to restore the scale and offset of
the viewport from before entering fullscreen. That is needed because when in
fullscreen, we force the scale to 1. No spec actually covers this behavior
though.
> 
> So, the trouble is with when we restore initial scale and offset. There must
be some screen orientation code that also affects the scale, because when
rotating it could happen that a scale change is needed so that the page fills
the viewport. I don't know where this code is though.

Could the logic related to orientation be:
https://cs.chromium.org/webrtc/src/third_party/WebKit/Source/web/WebViewImpl....
(or maybe
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/frame/Fra...)

Powered by Google App Engine
This is Rietveld 408576698