Bug 147512

Summary: [iOS] Make the AllowsInlineMediaPlayback preference work in WebKit / WebKit2.
Product: WebKit Reporter: Jer Noble <jer.noble>
Component: New BugsAssignee: Jer Noble <jer.noble>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, buildbot, cdumez, commit-queue, dbates, eric.carlson, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 148579    
Attachments:
Description Flags
WIP
none
WIP
none
Archive of layout-test-results from ews102 for mac-mavericks
none
Archive of layout-test-results from ews104 for mac-mavericks-wk2
none
WIP
none
Archive of layout-test-results from ews100 for mac-mavericks
none
Archive of layout-test-results from ews106 for mac-mavericks-wk2
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description Jer Noble 2015-07-31 15:09:15 PDT
[iOS] Make the AllowsInlineMediaPlayback preference work in WebKit / WebKit2.
Comment 1 Jer Noble 2015-07-31 16:12:32 PDT
Created attachment 257976 [details]
WIP
Comment 2 Jer Noble 2015-07-31 21:47:20 PDT
Created attachment 257993 [details]
WIP
Comment 3 Build Bot 2015-07-31 22:05:00 PDT
Comment on attachment 257993 [details]
WIP

Attachment 257993 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/5000

New failing tests:
media/video-frame-accurate-seek.html
http/tests/css/vertical-align-baseline-after-image-load-2.html
media/video-aspect-ratio.html
compositing/video/video-object-fit.html
media/video-transformed.html
media/video-canvas-alpha.html
media/video-fullscreeen-only-controls.html
media/track/track-cue-rendering-horizontal.html
media/video-controls-visible-audio-only.html
media/video-remove-insert-repaints.html
http/tests/css/vertical-align-baseline-after-image-load-3.html
compositing/overflow/overflow-compositing-descendant.html
media/video-controls-visible-exiting-fullscreen.html
compositing/layers-inside-overflow-scroll.html
media/video-zoom.html
compositing/self-painting-layers.html
compositing/overflow/scroll-ancestor-update.html
compositing/geometry/video-opacity-overlay.html
compositing/geometry/video-fixed-scrolling.html
fast/css/object-fit/object-fit-video-poster.html
media/media-captions-no-controls.html
compositing/video/video-poster.html
http/tests/css/vertical-align-baseline-after-image-load.html
Comment 4 Build Bot 2015-07-31 22:05:02 PDT
Created attachment 257995 [details]
Archive of layout-test-results from ews102 for mac-mavericks

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-mavericks  Platform: Mac OS X 10.9.5
Comment 5 Build Bot 2015-07-31 22:31:12 PDT
Comment on attachment 257993 [details]
WIP

Attachment 257993 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/5038

New failing tests:
media/video-frame-accurate-seek.html
http/tests/css/vertical-align-baseline-after-image-load-2.html
media/video-aspect-ratio.html
compositing/video/video-object-fit.html
media/video-transformed.html
media/video-canvas-alpha.html
media/video-fullscreeen-only-controls.html
media/track/track-cue-rendering-horizontal.html
media/video-controls-visible-audio-only.html
media/video-remove-insert-repaints.html
http/tests/contentextensions/text-track-blocked.html
http/tests/css/vertical-align-baseline-after-image-load-3.html
compositing/overflow/overflow-compositing-descendant.html
media/video-controls-visible-exiting-fullscreen.html
compositing/layers-inside-overflow-scroll.html
media/video-zoom.html
compositing/self-painting-layers.html
compositing/overflow/scroll-ancestor-update.html
compositing/geometry/video-opacity-overlay.html
http/tests/contentextensions/media-filtered.html
compositing/geometry/video-fixed-scrolling.html
fast/css/object-fit/object-fit-video-poster.html
media/media-captions-no-controls.html
compositing/video/video-poster.html
http/tests/css/vertical-align-baseline-after-image-load.html
Comment 6 Build Bot 2015-07-31 22:31:14 PDT
Created attachment 257997 [details]
Archive of layout-test-results from ews104 for mac-mavericks-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-mavericks-wk2  Platform: Mac OS X 10.9.5
Comment 7 Jer Noble 2015-08-03 09:37:34 PDT
Created attachment 258066 [details]
WIP
Comment 8 Build Bot 2015-08-03 14:40:52 PDT
Comment on attachment 258066 [details]
WIP

Attachment 258066 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/12595

New failing tests:
media/video-frame-accurate-seek.html
http/tests/css/vertical-align-baseline-after-image-load-2.html
media/video-aspect-ratio.html
compositing/video/video-object-fit.html
media/video-transformed.html
media/video-canvas-alpha.html
media/video-fullscreeen-only-controls.html
media/track/track-cue-rendering-horizontal.html
media/video-controls-visible-audio-only.html
media/video-remove-insert-repaints.html
http/tests/css/vertical-align-baseline-after-image-load-3.html
compositing/overflow/overflow-compositing-descendant.html
media/video-controls-visible-exiting-fullscreen.html
compositing/layers-inside-overflow-scroll.html
media/video-zoom.html
compositing/self-painting-layers.html
compositing/overflow/scroll-ancestor-update.html
compositing/geometry/video-opacity-overlay.html
compositing/geometry/video-fixed-scrolling.html
fast/css/object-fit/object-fit-video-poster.html
media/media-captions-no-controls.html
compositing/video/video-poster.html
http/tests/css/vertical-align-baseline-after-image-load.html
Comment 9 Build Bot 2015-08-03 14:40:54 PDT
Created attachment 258115 [details]
Archive of layout-test-results from ews100 for mac-mavericks

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-mavericks  Platform: Mac OS X 10.9.5
Comment 10 Build Bot 2015-08-03 14:45:11 PDT
Comment on attachment 258066 [details]
WIP

Attachment 258066 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/12613

New failing tests:
media/video-frame-accurate-seek.html
http/tests/css/vertical-align-baseline-after-image-load-2.html
media/video-aspect-ratio.html
compositing/video/video-object-fit.html
media/video-transformed.html
media/video-canvas-alpha.html
media/video-fullscreeen-only-controls.html
media/track/track-cue-rendering-horizontal.html
media/video-controls-visible-audio-only.html
media/video-remove-insert-repaints.html
http/tests/contentextensions/text-track-blocked.html
http/tests/css/vertical-align-baseline-after-image-load-3.html
compositing/overflow/overflow-compositing-descendant.html
media/video-controls-visible-exiting-fullscreen.html
compositing/layers-inside-overflow-scroll.html
media/video-zoom.html
compositing/self-painting-layers.html
compositing/overflow/scroll-ancestor-update.html
compositing/geometry/video-opacity-overlay.html
http/tests/contentextensions/media-filtered.html
compositing/geometry/video-fixed-scrolling.html
fast/css/object-fit/object-fit-video-poster.html
media/media-captions-no-controls.html
compositing/video/video-poster.html
http/tests/css/vertical-align-baseline-after-image-load.html
Comment 11 Build Bot 2015-08-03 14:45:13 PDT
Created attachment 258118 [details]
Archive of layout-test-results from ews106 for mac-mavericks-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-mavericks-wk2  Platform: Mac OS X 10.9.5
Comment 12 Jer Noble 2015-08-24 12:55:37 PDT
Created attachment 259767 [details]
Patch
Comment 13 Eric Carlson 2015-08-24 13:17:26 PDT
Comment on attachment 259767 [details]
Patch

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

> Source/WebCore/html/MediaElementSession.cpp:369
> +    if (!element.fastHasAttribute(HTMLNames::webkit_playsinlineAttr))
> +        return true;

This isn't right, we don't require the attribute on all devices.
Comment 14 Jer Noble 2015-08-25 09:02:25 PDT
Created attachment 259849 [details]
Patch
Comment 15 Chris Dumez 2015-08-25 09:06:25 PDT
Comment on attachment 259849 [details]
Patch

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

> Source/WebCore/html/MediaElementSession.cpp:367
> +    if (settings->inlineMediaPlaybackRequiresPlaysInlineAttribute() && !element.fastHasAttribute(HTMLNames::webkit_playsinlineAttr))

nit: return settings->inlineMediaPlaybackRequiresPlaysInlineAttribute() && !element.fastHasAttribute(HTMLNames::webkit_playsinlineAttr);

> Source/WebCore/testing/InternalSettings.cpp:531
> +void InternalSettings::setAllowsInlineMediaPlayback(bool allows, ExceptionCode& ec)

ec is unused.

> Source/WebCore/testing/InternalSettings.cpp:537
> +void InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute(bool requires, ExceptionCode& ec)

ec is unused.

> Source/WebCore/testing/InternalSettings.idl:77
> +    [RaisesException] void setAllowsInlineMediaPlayback(boolean allows);

You can drop the [RaisesException]

> Source/WebCore/testing/InternalSettings.idl:78
> +    [RaisesException] void setInlineMediaPlaybackRequiresPlaysInlineAttribute(boolean requires);

ditto.
Comment 16 Eric Carlson 2015-08-25 09:15:00 PDT
Comment on attachment 259849 [details]
Patch

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

Looks OK modulo the nits, but I am not a WK2 reviewer so someone else will have to give the official r+

> Source/WebKit/mac/WebView/WebPreferences.mm:525
> +        [NSNumber numberWithBool:YES], WebKitInlineMediaPlaybackRequiresPlaysInlineAttributeKey,

Nit: doesn't align like the surrounding code.
Comment 17 Jer Noble 2015-08-25 10:09:03 PDT
Created attachment 259854 [details]
Patch

Re-based; should apply now
Comment 18 Jer Noble 2015-08-25 10:20:26 PDT
Created attachment 259855 [details]
Patch

Address (pre-)review feedback.
Comment 19 Jer Noble 2015-08-25 10:37:50 PDT
Created attachment 259858 [details]
Patch

Once more with the rebasing.
Comment 20 Jer Noble 2015-08-25 11:33:23 PDT
Created attachment 259863 [details]
Patch

Once more with the rebasing.
Comment 21 Jer Noble 2015-08-25 11:41:23 PDT
Created attachment 259864 [details]
Patch

Once more (3x) with the rebasing.
Comment 22 Jer Noble 2015-08-25 14:31:39 PDT
(In reply to comment #15)
> Comment on attachment 259849 [details]
> > Source/WebCore/testing/InternalSettings.cpp:531
> > +void InternalSettings::setAllowsInlineMediaPlayback(bool allows, ExceptionCode& ec)
> 
> ec is unused.
> 
> > Source/WebCore/testing/InternalSettings.cpp:537
> > +void InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute(bool requires, ExceptionCode& ec)
> 
> ec is unused.
> 
> > Source/WebCore/testing/InternalSettings.idl:77
> > +    [RaisesException] void setAllowsInlineMediaPlayback(boolean allows);
> 
> You can drop the [RaisesException]
> 
> > Source/WebCore/testing/InternalSettings.idl:78
> > +    [RaisesException] void setInlineMediaPlaybackRequiresPlaysInlineAttribute(boolean requires);
> 
> ditto.

Turns out, ec is very much used. `InternalSettingsGuardForSettings()` is a macro which sets `ec` if settings() is NULL. I'll upload a new patch which puts these back.
Comment 23 Chris Dumez 2015-08-25 14:32:52 PDT
(In reply to comment #22)
> (In reply to comment #15)
> > Comment on attachment 259849 [details]
> > > Source/WebCore/testing/InternalSettings.cpp:531
> > > +void InternalSettings::setAllowsInlineMediaPlayback(bool allows, ExceptionCode& ec)
> > 
> > ec is unused.
> > 
> > > Source/WebCore/testing/InternalSettings.cpp:537
> > > +void InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute(bool requires, ExceptionCode& ec)
> > 
> > ec is unused.
> > 
> > > Source/WebCore/testing/InternalSettings.idl:77
> > > +    [RaisesException] void setAllowsInlineMediaPlayback(boolean allows);
> > 
> > You can drop the [RaisesException]
> > 
> > > Source/WebCore/testing/InternalSettings.idl:78
> > > +    [RaisesException] void setInlineMediaPlaybackRequiresPlaysInlineAttribute(boolean requires);
> > 
> > ditto.
> 
> Turns out, ec is very much used. `InternalSettingsGuardForSettings()` is a
> macro which sets `ec` if settings() is NULL. I'll upload a new patch which
> puts these back.

Ahhh, sorry about that :( I failed to notice this.
Comment 24 Jer Noble 2015-08-27 12:38:19 PDT
Created attachment 260081 [details]
Patch
Comment 25 WebKit Commit Bot 2015-08-28 11:52:01 PDT
Comment on attachment 260081 [details]
Patch

Clearing flags on attachment: 260081

Committed r189112: <http://trac.webkit.org/changeset/189112>
Comment 26 WebKit Commit Bot 2015-08-28 11:52:09 PDT
All reviewed patches have been landed.  Closing bug.
Comment 27 Andy Estes 2015-08-28 12:55:09 PDT
This caused media/video-fullscreeen-only-playback.html to start failing. See <https://build.webkit.org/results/Apple%20Mavericks%20Release%20WK2%20(Tests)/r189112%20(16761)/results.html>.

It looks like you removed the RUN() around internals.settings.setAllowsInlineMediaPlayback(false) in the expected result, but the actual result still includes that text.
Comment 28 Jer Noble 2015-08-28 12:59:30 PDT
(In reply to comment #27)
> This caused media/video-fullscreeen-only-playback.html to start failing. See
> <https://build.webkit.org/results/
> Apple%20Mavericks%20Release%20WK2%20(Tests)/r189112%20(16761)/results.html>.
> 
> It looks like you removed the RUN() around
> internals.settings.setAllowsInlineMediaPlayback(false) in the expected
> result, but the actual result still includes that text.

Weird; since I generated those new results with run-webkit-tests --reset-results.  Will fix.
Comment 29 Jer Noble 2015-08-28 13:07:09 PDT
(In reply to comment #28)
> (In reply to comment #27)
> > This caused media/video-fullscreeen-only-playback.html to start failing. See
> > <https://build.webkit.org/results/
> > Apple%20Mavericks%20Release%20WK2%20(Tests)/r189112%20(16761)/results.html>.
> > 
> > It looks like you removed the RUN() around
> > internals.settings.setAllowsInlineMediaPlayback(false) in the expected
> > result, but the actual result still includes that text.
> 
> Weird; since I generated those new results with run-webkit-tests
> --reset-results.  Will fix.

Landed follow up test expectations fix in <http://trac.webkit.org/r189121>.