Changeset 202274 in webkit


Ignore:
Timestamp:
Jun 21, 2016 6:15:40 AM (8 years ago)
Author:
mitz@apple.com
Message:

Inlined some picture-in-picture code.
https://bugs.webkit.org/show_bug.cgi?id=158977

Reviewed by Eric Carlsson.

This code was written primarily by Ada Chan, and originally reviewed by Alex Christensen,
Anders Carlsson, Conrad Shultz, Dan Bernstein, Eric Carlson, Jer Noble, Jeremy Jones,
Jon Lee, Remy Demarest, and Zach Li.

Source/WebCore:

  • English.lproj/Localizable.strings: Updated using update-webkit-localizable-strings.
  • Modules/mediacontrols/mediaControlsApple.css:

(video:-webkit-full-screen::-webkit-media-controls-panel .picture-in-picture-button):

  • Modules/mediacontrols/mediaControlsApple.js:

(Controller.prototype.configureFullScreenControls):

  • WebCore.xcodeproj/project.pbxproj: Added PIPSPI.h.
  • html/HTMLMediaElement.cpp: Inlined code from HTMLMediaElementAdditions.cpp.
  • html/HTMLVideoElement.cpp: Inlined code from HTMLVideoElementSupportsFullscreenAdditions.cpp.
  • platform/LocalizedStrings.cpp:

(WebCore::contextMenuItemTagEnterVideoEnhancedFullscreen): Brought in from ContextMenuLocalizedStringsAdditions.cpp.
(WebCore::contextMenuItemTagExitVideoEnhancedFullscreen): Ditto.
(WebCore::AXARIAContentGroupText): Made updates that should have been part of r198543.

  • platform/mac/WebVideoFullscreenInterfaceMac.h: Removed USE(APPLE_INTERNAL_SDK) guards.
  • platform/mac/WebVideoFullscreenInterfaceMac.mm: Inlined WebVideoFullscreenInterfaceMacAdditions.mm.
  • platform/spi/mac/PIPSPI.h: Added.
  • rendering/HitTestResult.cpp: Inlined HitTestResultAdditions.cpp.
  • rendering/RenderThemeMac.mm:

(WebCore::RenderThemeMac::mediaControlsStyleSheet): Removed include of

RenderThemeMacMediaControlsStyleSheetAdditions.mm now that the content is in
mediaControlsApple.css.

(WebCore::RenderThemeMac::mediaControlsScript): Removed include of

RenderThemeMacMediaControlsScriptAdditions.mm now that the content is in mediaControlsApple.js.

Source/WebKit2:

  • Shared/WebPreferencesStoreDefaultsAdditions.cpp: Define and use DEFAULT_ALLOWS_PICTURE_IN_PICTURE_MEDIA_PLAYBACK.
  • Shared/WebPreferencesStore.cpp:

(WebKit::defaults): Removed include of WebPreferencesStoreDefaultsAdditions.cpp now that the

default is defined correctly in WebPreferencesStoreDefaultsAdditions.cpp.

  • UIProcess/API/C/WKPreferences.cpp: Inlined WKPreferencesAdditions.cpp.
  • UIProcess/API/C/WKPreferencesRefPrivate.h: Ditto.
  • WebProcess/cocoa/WebVideoFullscreenManager.mm: Inlined WebVideoFullscreenManagerSupportsVideoFullscreenMac.mm.
Location:
trunk/Source
Files:
1 added
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r202272 r202274  
     12016-06-21  Dan Bernstein  <mitz@apple.com>
     2
     3        Inlined some picture-in-picture code.
     4        https://bugs.webkit.org/show_bug.cgi?id=158977
     5
     6        Reviewed by Eric Carlsson.
     7
     8        This code was written primarily by Ada Chan, and originally reviewed by Alex Christensen,
     9        Anders Carlsson, Conrad Shultz, Dan Bernstein, Eric Carlson, Jer Noble, Jeremy Jones,
     10        Jon Lee, Remy Demarest, and Zach Li.
     11
     12        * English.lproj/Localizable.strings:
     13          Updated using update-webkit-localizable-strings.
     14
     15        * Modules/mediacontrols/mediaControlsApple.css:
     16        (video:-webkit-full-screen::-webkit-media-controls-panel .picture-in-picture-button):
     17
     18        * Modules/mediacontrols/mediaControlsApple.js:
     19        (Controller.prototype.configureFullScreenControls):
     20
     21        * WebCore.xcodeproj/project.pbxproj: Added PIPSPI.h.
     22
     23        * html/HTMLMediaElement.cpp: Inlined code from HTMLMediaElementAdditions.cpp.
     24
     25        * html/HTMLVideoElement.cpp: Inlined code from HTMLVideoElementSupportsFullscreenAdditions.cpp.
     26
     27        * platform/LocalizedStrings.cpp:
     28        (WebCore::contextMenuItemTagEnterVideoEnhancedFullscreen): Brought in from ContextMenuLocalizedStringsAdditions.cpp.
     29        (WebCore::contextMenuItemTagExitVideoEnhancedFullscreen): Ditto.
     30        (WebCore::AXARIAContentGroupText): Made updates that should have been part of r198543.
     31
     32        * platform/mac/WebVideoFullscreenInterfaceMac.h: Removed USE(APPLE_INTERNAL_SDK) guards.
     33        * platform/mac/WebVideoFullscreenInterfaceMac.mm: Inlined WebVideoFullscreenInterfaceMacAdditions.mm.
     34
     35        * platform/spi/mac/PIPSPI.h: Added.
     36
     37        * rendering/HitTestResult.cpp: Inlined HitTestResultAdditions.cpp.
     38
     39        * rendering/RenderThemeMac.mm:
     40        (WebCore::RenderThemeMac::mediaControlsStyleSheet): Removed include of
     41          RenderThemeMacMediaControlsStyleSheetAdditions.mm now that the content is in
     42          mediaControlsApple.css.
     43        (WebCore::RenderThemeMac::mediaControlsScript): Removed include of
     44          RenderThemeMacMediaControlsScriptAdditions.mm now that the content is in mediaControlsApple.js.
     45
    1462016-06-21  Miguel Gomez  <magomez@igalia.com>
    247
  • trunk/Source/WebCore/English.lproj/Localizable.strings

    r199260 r202274  
    239239"Enter Full Screen" = "Enter Full Screen";
    240240
     241/* menu item */
     242"Enter Picture-in-Picture" = "Enter Picture-in-Picture";
     243
    241244/* Video Exit Fullscreen context menu item */
    242245"Exit Full Screen" = "Exit Full Screen";
    243246
     247/* menu item */
     248"Exit Picture-in-Picture" = "Exit Picture-in-Picture";
     249
    244250/* Default application name for Open With context menu */
    245251"Finder" = "Finder";
     
    713719"alert" = "alert";
    714720
     721/* An ARIA accessibility group that acts as a status update. */
     722"application status" = "application status";
     723
     724/* An ARIA accessibility group that acts as an article. */
     725"article" = "article";
     726
     727/* accessibility role description for an attachment element */
     728"attachment" = "attachment";
     729
     730/* accessibility help text for audio element controller */
     731"audio element playback controls and status display" = "audio element playback controls and status display";
     732
     733/* accessibility label for audio element controller */
     734"audio playback" = "audio playback";
     735
     736/* accessibility label for seek back 30 seconds button */
     737"back 30 seconds" = "back 30 seconds";
     738
     739/* HTTP result code string */
     740"bad gateway" = "bad gateway";
     741
     742/* HTTP result code string */
     743"bad request" = "bad request";
     744
     745/* An ARIA accessibility group that acts as a banner. */
     746"banner" = "banner";
     747
     748/* accessibility help text for play button */
     749"begin playback" = "begin playback";
     750
     751/* accessibility description for a search field cancel button */
     752"cancel" = "cancel";
     753
     754/* Verb stating the action that will occur when an unchecked checkbox is clicked, as used by accessibility */
     755"check" = "check";
     756
     757/* HTTP result code string */
     758"client error" = "client error";
     759
     760/* An ARIA accessibility group that acts as a region of complementary information. */
     761"complementary" = "complementary";
     762
     763/* HTTP result code string */
     764"conflict" = "conflict";
     765
     766/* Label for the auto fill contacts button inside a text field. */
     767"contact info auto fill" = "contact info auto fill";
     768
     769/* An ARIA accessibility group that contains content. */
     770"content information" = "content information";
     771
     772/* HTTP result code string */
     773"continue" = "continue";
     774
     775/* HTTP result code string */
     776"created" = "created";
     777
     778/* accessibility help text for movie status display */
     779"current movie status" = "current movie status";
     780
     781/* accessibility help text for elapsed time display */
     782"current movie time in seconds" = "current movie time in seconds";
     783
     784/* role description of ARIA definition role */
     785"definition" = "definition";
     786
     787/* description detail */
     788"description" = "description";
     789
     790/* accessibility role description of a description list */
     791"description list" = "description list";
     792
     793/* An ARIA accessibility group that acts as a document. */
     794"document" = "document";
     795
     796/* accessibility label for elapsed time display */
     797"elapsed time" = "elapsed time";
     798
     799/* accessibility label for enter fullscreen button */
     800"enter fullscreen" = "enter fullscreen";
     801
     802/* accessibility label for exit fullscreen button */
     803"exit fullscreen" = "exit fullscreen";
     804
     805/* HTTP result code string */
     806"expectation failed" = "expectation failed";
     807
     808/* accessibility label for fast forward button */
     809"fast forward" = "fast forward";
     810
     811/* accessibility label for fast reverse button */
     812"fast reverse" = "fast reverse";
     813
     814/* accessibility role description for a file upload button */
     815"file upload button" = "file upload button";
     816
     817/* accessibility role description for a footer */
     818"footer" = "footer";
     819
     820/* HTTP result code string */
     821"forbidden" = "forbidden";
     822
     823/* HTTP result code string */
     824"found" = "found";
     825
     826/* HTTP result code string */
     827"gateway timed out" = "gateway timed out";
     828
     829/* accessibility role description for headings */
     830"heading" = "heading";
     831
     832/* accessibility label for hide closed captions button */
     833"hide closed captions" = "hide closed captions";
     834
     835/* accessibility role description for image map */
     836"image map" = "image map";
     837
     838/* accessibility help text for an indefinite media controller time value */
     839"indefinite time" = "indefinite time";
     840
     841/* HTTP result code string */
     842"informational" = "informational";
     843
     844/* HTTP result code string */
     845"internal server error" = "internal server error";
     846
     847/* Verb stating the action that will occur when a link is clicked, as used by accessibility */
     848"jump" = "jump";
     849
     850/* HTTP result code string */
     851"length required" = "length required";
     852
     853/* accessibility role description for link */
     854"link" = "link";
     855
     856/* accessibility role description for list marker */
     857"list marker" = "list marker";
     858
     859/* An ARIA accessibility group that acts as a console log. */
     860"log" = "log";
     861
     862/* An ARIA accessibility group that is the main portion of the website. */
     863"main" = "main";
     864
     865/* An ARIA accessibility group that acts as a marquee. */
     866"marquee" = "marquee";
     867
     868/* An ARIA accessibility group that contains mathematical symbols. */
     869"math" = "math";
     870
     871/* HTTP result code string */
     872"method not allowed" = "method not allowed";
     873
     874/* HTTP result code string */
     875"moved permanently" = "moved permanently";
     876
     877/* accessibility label for timeline slider */
     878"movie time" = "movie time";
     879
     880/* accessibility help text for timeline slider */
     881"movie time scrubber" = "movie time scrubber";
     882
     883/* accessibility help text for timeline slider thumb */
     884"movie time scrubber thumb" = "movie time scrubber thumb";
     885
     886/* HTTP result code string */
     887"multiple choices" = "multiple choices";
     888
     889/* accessibility label for mute button */
     890"mute" = "mute";
     891
     892/* accessibility help text for mute button */
     893"mute audio tracks" = "mute audio tracks";
     894
     895/* An ARIA accessibility group that contains the main navigation elements of a website. */
     896"navigation" = "navigation";
     897
     898/* HTTP result code string */
     899"needs proxy" = "needs proxy";
     900
     901/* HTTP result code string */
     902"no content" = "no content";
     903
     904/* HTTP result code string */
     905"no error" = "no error";
     906
     907/* text to display in file button used in HTML forms when no file is selected */
     908"no file selected" = "no file selected";
     909
     910/* text to display in file button used in HTML forms when no files are selected and the button allows multiple files to be selected */
     911"no files selected" = "no files selected";
     912
     913/* HTTP result code string */
     914"no longer exists" = "no longer exists";
     915
     916/* Text to display in file button used in HTML forms for media files when no media files are selected and the button allows multiple files to be selected */
     917"no media selected (multiple)" = "no media selected (multiple)";
     918
     919/* Text to display in file button used in HTML forms for media files when no media file is selected */
     920"no media selected (single)" = "no media selected (single)";
     921
     922/* HTTP result code string */
     923"non-authoritative information" = "non-authoritative information";
     924
     925/* HTTP result code string */
     926"not found" = "not found";
     927
     928/* HTTP result code string */
     929"not modified" = "not modified";
     930
     931/* An ARIA accessibility group that acts as a note in a document. */
     932"note" = "note";
     933
     934/* accessibility help text for remaining time display */
     935"number of seconds of movie remaining" = "number of seconds of movie remaining";
     936
     937/* HTTP result code string */
     938"partial content" = "partial content";
     939
     940/* Label for the auto fill credentials button inside a text field. */
     941"password auto fill" = "password auto fill";
     942
     943/* Validation message for input form controls requiring a constrained value according to pattern */
     944"pattern mismatch" = "pattern mismatch";
     945
     946/* accessibility label for pause button */
     947"pause" = "pause";
     948
     949/* accessibility help text for pause button */
     950"pause playback" = "pause playback";
     951
     952/* HTTP result code string */
     953"payment required" = "payment required";
     954
     955/* accessibility label for play button */
     956"play" = "play";
     957
     958/* HTTP result code string */
     959"precondition failed" = "precondition failed";
     960
     961/* Verb stating the action that will occur when a button is pressed, as used by accessibility */
     962"press" = "press";
     963
     964/* HTTP result code string */
     965"proxy authentication required" = "proxy authentication required";
     966
     967/* Validation message for input form controls with value higher than allowed maximum */
     968"range overflow" = "range overflow";
     969
     970/* Validation message for input form controls with value lower than allowed minimum */
     971"range underflow" = "range underflow";
     972
     973/* HTTP result code string */
     974"redirected" = "redirected";
     975
     976/* An ARIA accessibility group that acts as a distinct region in a document. */
     977"region" = "region";
     978
     979/* accessibility label for time remaining display */
     980"remaining time" = "remaining time";
     981
     982/* HTTP result code string */
     983"request timed out" = "request timed out";
     984
     985/* HTTP result code string */
     986"request too large" = "request too large";
     987
     988/* HTTP result code string */
     989"requested URL too long" = "requested URL too long";
     990
     991/* HTTP result code string */
     992"requested range not satisfiable" = "requested range not satisfiable";
     993
     994/* HTTP result code string */
     995"reset content" = "reset content";
     996
     997/* accessibility help text for return streaming movie to real time button */
     998"return streaming movie to real time" = "return streaming movie to real time";
     999
     1000/* accessibility label for return to real time button */
     1001"return to realtime" = "return to realtime";
     1002
     1003/* An ARIA accessibility group that contains a search feature of a website. */
     1004"search" = "search";
     1005
     1006/* HTTP result code string */
     1007"see other" = "see other";
     1008
     1009/* accessibility help text for jump back 30 seconds button */
     1010"seek movie back 30 seconds" = "seek movie back 30 seconds";
     1011
     1012/* accessibility help text for fast rewind button */
     1013"seek quickly back" = "seek quickly back";
     1014
     1015/* accessibility help text for fast forward button */
     1016"seek quickly forward" = "seek quickly forward";
     1017
     1018/* Verb stating the action that will occur when a radio button is clicked, as used by accessibility */
     1019"select" = "select";
     1020
     1021/* accessibility role description for a horizontal rule [<hr>] */
     1022"separator" = "separator";
     1023
     1024/* HTTP result code string */
     1025"server error" = "server error";
     1026
     1027/* HTTP result code string */
     1028"service unavailable" = "service unavailable";
     1029
     1030/* accessibility label for show closed captions button */
     1031"show closed captions" = "show closed captions";
     1032
     1033/* accessibility help text for show closed captions button */
     1034"start displaying closed captions" = "start displaying closed captions";
     1035
     1036/* accessibility label for movie status */
     1037"status" = "status";
     1038
     1039/* Validation message for input form controls with value not respecting the step attribute */
     1040"step mismatch" = "step mismatch";
     1041
     1042/* accessibility help text for hide closed captions button */
     1043"stop displaying closed captions" = "stop displaying closed captions";
     1044
     1045/* HTTP result code string */
     1046"success" = "success";
     1047
     1048/* HTTP result code string */
     1049"switching protocols" = "switching protocols";
     1050
     1051/* An ARIA accessibility group that contains the content of a tab. */
     1052"tab panel" = "tab panel";
     1053
     1054/* HTTP result code string */
     1055"temporarily redirected" = "temporarily redirected";
     1056
     1057/* term word of a description list */
     1058"term" = "term";
     1059
     1060/* accessibility label for timeline thumb */
     1061"timeline slider thumb" = "timeline slider thumb";
     1062
     1063/* An ARIA accessibility group that acts as an updating timer. */
     1064"timer" = "timer";
     1065
     1066/* Validation message for form control elements with a value longer than maximum allowed length */
     1067"too long" = "too long";
     1068
     1069/* An ARIA accessibility group that acts as a tooltip. */
     1070"tooltip" = "tooltip";
     1071
     1072/* Validation message for input form controls with a value not matching type */
     1073"type mismatch" = "type mismatch";
     1074
     1075/* HTTP result code string */
     1076"unacceptable" = "unacceptable";
     1077
     1078/* HTTP result code string */
     1079"unauthorized" = "unauthorized";
     1080
     1081/* Verb stating the action that will occur when a checked checkbox is clicked, as used by accessibility */
     1082"uncheck" = "uncheck";
     1083
     1084/* HTTP result code string */
     1085"unimplemented" = "unimplemented";
     1086
     1087/* Unknown filename */
     1088"unknown" = "unknown";
     1089
     1090/* accessibility label for turn mute off button */
     1091"unmute" = "unmute";
     1092
     1093/* accessibility help text for un mute button */
     1094"unmute audio tracks" = "unmute audio tracks";
     1095
     1096/* HTTP result code string */
     1097"unsupported media type" = "unsupported media type";
     1098
     1099/* HTTP result code string */
     1100"unsupported version" = "unsupported version";
     1101
     1102/* Validation message for required form control elements that have no value */
     1103"value missing" = "value missing";
     1104
     1105/* accessibility help text for video element controller */
     1106"video element playback controls and status display" = "video element playback controls and status display";
     1107
     1108/* accessibility label for video element controller */
     1109"video playback" = "video playback";
     1110
    7151111/* An ARIA accessibility group that acts as an alert dialog. */
    716 "alert dialog" = "web alert dialog";
     1112"web alert dialog" = "web alert dialog";
    7171113
    7181114/* An ARIA accessibility group that acts as an application. */
    7191115"web application" = "web application";
    7201116
    721 /* An ARIA accessibility group that acts as a status update. */
    722 "application status" = "application status";
    723 
    724 /* An ARIA accessibility group that acts as an article. */
    725 "article" = "article";
    726 
    727 /* accessibility role description for an attachment element */
    728 "attachment" = "attachment";
    729 
    730 /* accessibility help text for audio element controller */
    731 "audio element playback controls and status display" = "audio element playback controls and status display";
    732 
    733 /* accessibility label for audio element controller */
    734 "audio playback" = "audio playback";
    735 
    736 /* accessibility label for seek back 30 seconds button */
    737 "back 30 seconds" = "back 30 seconds";
    738 
    739 /* HTTP result code string */
    740 "bad gateway" = "bad gateway";
    741 
    742 /* HTTP result code string */
    743 "bad request" = "bad request";
    744 
    745 /* An ARIA accessibility group that acts as a banner. */
    746 "banner" = "banner";
    747 
    748 /* accessibility help text for play button */
    749 "begin playback" = "begin playback";
    750 
    751 /* accessibility description for a search field cancel button */
    752 "cancel" = "cancel";
    753 
    754 /* Verb stating the action that will occur when an unchecked checkbox is clicked, as used by accessibility */
    755 "check" = "check";
    756 
    757 /* HTTP result code string */
    758 "client error" = "client error";
    759 
    760 /* An ARIA accessibility group that acts as a region of complementary information. */
    761 "complementary" = "complementary";
    762 
    763 /* HTTP result code string */
    764 "conflict" = "conflict";
    765 
    766 /* Label for the auto fill contacts button inside a text field. */
    767 "contact info auto fill" = "contact info auto fill";
    768 
    769 /* An ARIA accessibility group that contains content. */
    770 "content information" = "content information";
    771 
    772 /* HTTP result code string */
    773 "continue" = "continue";
    774 
    775 /* HTTP result code string */
    776 "created" = "created";
    777 
    778 /* accessibility help text for movie status display */
    779 "current movie status" = "current movie status";
    780 
    781 /* accessibility help text for elapsed time display */
    782 "current movie time in seconds" = "current movie time in seconds";
    783 
    784 /* role description of ARIA definition role */
    785 "definition" = "definition";
    786 
    787 /* description detail */
    788 "description" = "description";
    789 
    790 /* accessibility role description of a description list */
    791 "description list" = "description list";
    792 
    7931117/* An ARIA accessibility group that acts as an dialog. */
    794 "dialog" = "web dialog";
    795 
    796 /* An ARIA accessibility group that acts as a document. */
    797 "document" = "document";
    798 
    799 /* accessibility label for elapsed time display */
    800 "elapsed time" = "elapsed time";
    801 
    802 /* accessibility label for enter fullscreen button */
    803 "enter fullscreen" = "enter fullscreen";
    804 
    805 /* accessibility label for exit fullscreen button */
    806 "exit fullscreen" = "exit fullscreen";
    807 
    808 /* HTTP result code string */
    809 "expectation failed" = "expectation failed";
    810 
    811 /* accessibility label for fast forward button */
    812 "fast forward" = "fast forward";
    813 
    814 /* accessibility label for fast reverse button */
    815 "fast reverse" = "fast reverse";
    816 
    817 /* accessibility role description for a file upload button */
    818 "file upload button" = "file upload button";
    819 
    820 /* accessibility role description for a footer */
    821 "footer" = "footer";
    822 
    823 /* HTTP result code string */
    824 "forbidden" = "forbidden";
    825 
    826 /* HTTP result code string */
    827 "found" = "found";
    828 
    829 /* HTTP result code string */
    830 "gateway timed out" = "gateway timed out";
    831 
    832 /* accessibility role description for headings */
    833 "heading" = "heading";
    834 
    835 /* accessibility label for hide closed captions button */
    836 "hide closed captions" = "hide closed captions";
    837 
    838 /* accessibility role description for image map */
    839 "image map" = "image map";
    840 
    841 /* accessibility help text for an indefinite media controller time value */
    842 "indefinite time" = "indefinite time";
    843 
    844 /* HTTP result code string */
    845 "informational" = "informational";
    846 
    847 /* HTTP result code string */
    848 "internal server error" = "internal server error";
    849 
    850 /* Verb stating the action that will occur when a link is clicked, as used by accessibility */
    851 "jump" = "jump";
    852 
    853 /* HTTP result code string */
    854 "length required" = "length required";
    855 
    856 /* accessibility role description for link */
    857 "link" = "link";
    858 
    859 /* accessibility role description for list marker */
    860 "list marker" = "list marker";
    861 
    862 /* An ARIA accessibility group that acts as a console log. */
    863 "log" = "log";
    864 
    865 /* An ARIA accessibility group that is the main portion of the website. */
    866 "main" = "main";
    867 
    868 /* An ARIA accessibility group that acts as a marquee. */
    869 "marquee" = "marquee";
    870 
    871 /* An ARIA accessibility group that contains mathematical symbols. */
    872 "math" = "math";
    873 
    874 /* HTTP result code string */
    875 "method not allowed" = "method not allowed";
    876 
    877 /* HTTP result code string */
    878 "moved permanently" = "moved permanently";
    879 
    880 /* accessibility label for timeline slider */
    881 "movie time" = "movie time";
    882 
    883 /* accessibility help text for timeline slider */
    884 "movie time scrubber" = "movie time scrubber";
    885 
    886 /* accessibility help text for timeline slider thumb */
    887 "movie time scrubber thumb" = "movie time scrubber thumb";
    888 
    889 /* HTTP result code string */
    890 "multiple choices" = "multiple choices";
    891 
    892 /* accessibility label for mute button */
    893 "mute" = "mute";
    894 
    895 /* accessibility help text for mute button */
    896 "mute audio tracks" = "mute audio tracks";
    897 
    898 /* An ARIA accessibility group that contains the main navigation elements of a website. */
    899 "navigation" = "navigation";
    900 
    901 /* HTTP result code string */
    902 "needs proxy" = "needs proxy";
    903 
    904 /* HTTP result code string */
    905 "no content" = "no content";
    906 
    907 /* HTTP result code string */
    908 "no error" = "no error";
    909 
    910 /* text to display in file button used in HTML forms when no file is selected */
    911 "no file selected" = "no file selected";
    912 
    913 /* text to display in file button used in HTML forms when no files are selected and the button allows multiple files to be selected */
    914 "no files selected" = "no files selected";
    915 
    916 /* HTTP result code string */
    917 "no longer exists" = "no longer exists";
    918 
    919 /* Text to display in file button used in HTML forms for media files when no media files are selected and the button allows multiple files to be selected */
    920 "no media selected (multiple)" = "no media selected (multiple)";
    921 
    922 /* Text to display in file button used in HTML forms for media files when no media file is selected */
    923 "no media selected (single)" = "no media selected (single)";
    924 
    925 /* HTTP result code string */
    926 "non-authoritative information" = "non-authoritative information";
    927 
    928 /* HTTP result code string */
    929 "not found" = "not found";
    930 
    931 /* HTTP result code string */
    932 "not modified" = "not modified";
    933 
    934 /* An ARIA accessibility group that acts as a note in a document. */
    935 "note" = "note";
    936 
    937 /* accessibility help text for remaining time display */
    938 "number of seconds of movie remaining" = "number of seconds of movie remaining";
    939 
    940 /* HTTP result code string */
    941 "partial content" = "partial content";
    942 
    943 /* Label for the auto fill credentials button inside a text field. */
    944 "password auto fill" = "password auto fill";
    945 
    946 /* Validation message for input form controls requiring a constrained value according to pattern */
    947 "pattern mismatch" = "pattern mismatch";
    948 
    949 /* accessibility label for pause button */
    950 "pause" = "pause";
    951 
    952 /* accessibility help text for pause button */
    953 "pause playback" = "pause playback";
    954 
    955 /* HTTP result code string */
    956 "payment required" = "payment required";
    957 
    958 /* accessibility label for play button */
    959 "play" = "play";
    960 
    961 /* HTTP result code string */
    962 "precondition failed" = "precondition failed";
    963 
    964 /* Verb stating the action that will occur when a button is pressed, as used by accessibility */
    965 "press" = "press";
    966 
    967 /* HTTP result code string */
    968 "proxy authentication required" = "proxy authentication required";
    969 
    970 /* Validation message for input form controls with value higher than allowed maximum */
    971 "range overflow" = "range overflow";
    972 
    973 /* Validation message for input form controls with value lower than allowed minimum */
    974 "range underflow" = "range underflow";
    975 
    976 /* HTTP result code string */
    977 "redirected" = "redirected";
    978 
    979 /* An ARIA accessibility group that acts as a distinct region in a document. */
    980 "region" = "region";
    981 
    982 /* accessibility label for time remaining display */
    983 "remaining time" = "remaining time";
    984 
    985 /* HTTP result code string */
    986 "request timed out" = "request timed out";
    987 
    988 /* HTTP result code string */
    989 "request too large" = "request too large";
    990 
    991 /* HTTP result code string */
    992 "requested URL too long" = "requested URL too long";
    993 
    994 /* HTTP result code string */
    995 "requested range not satisfiable" = "requested range not satisfiable";
    996 
    997 /* HTTP result code string */
    998 "reset content" = "reset content";
    999 
    1000 /* accessibility help text for return streaming movie to real time button */
    1001 "return streaming movie to real time" = "return streaming movie to real time";
    1002 
    1003 /* accessibility label for return to real time button */
    1004 "return to realtime" = "return to realtime";
    1005 
    1006 /* An ARIA accessibility group that contains a search feature of a website. */
    1007 "search" = "search";
    1008 
    1009 /* HTTP result code string */
    1010 "see other" = "see other";
    1011 
    1012 /* accessibility help text for jump back 30 seconds button */
    1013 "seek movie back 30 seconds" = "seek movie back 30 seconds";
    1014 
    1015 /* accessibility help text for fast rewind button */
    1016 "seek quickly back" = "seek quickly back";
    1017 
    1018 /* accessibility help text for fast forward button */
    1019 "seek quickly forward" = "seek quickly forward";
    1020 
    1021 /* Verb stating the action that will occur when a radio button is clicked, as used by accessibility */
    1022 "select" = "select";
    1023 
    1024 /* accessibility role description for a horizontal rule [<hr>] */
    1025 "separator" = "separator";
    1026 
    1027 /* HTTP result code string */
    1028 "server error" = "server error";
    1029 
    1030 /* HTTP result code string */
    1031 "service unavailable" = "service unavailable";
    1032 
    1033 /* accessibility label for show closed captions button */
    1034 "show closed captions" = "show closed captions";
    1035 
    1036 /* accessibility help text for show closed captions button */
    1037 "start displaying closed captions" = "start displaying closed captions";
    1038 
    1039 /* accessibility label for movie status */
    1040 "status" = "status";
    1041 
    1042 /* Validation message for input form controls with value not respecting the step attribute */
    1043 "step mismatch" = "step mismatch";
    1044 
    1045 /* accessibility help text for hide closed captions button */
    1046 "stop displaying closed captions" = "stop displaying closed captions";
    1047 
    1048 /* HTTP result code string */
    1049 "success" = "success";
    1050 
    1051 /* HTTP result code string */
    1052 "switching protocols" = "switching protocols";
    1053 
    1054 /* An ARIA accessibility group that contains the content of a tab. */
    1055 "tab panel" = "tab panel";
    1056 
    1057 /* HTTP result code string */
    1058 "temporarily redirected" = "temporarily redirected";
    1059 
    1060 /* term word of a description list */
    1061 "term" = "term";
    1062 
    1063 /* accessibility label for timeline thumb */
    1064 "timeline slider thumb" = "timeline slider thumb";
    1065 
    1066 /* An ARIA accessibility group that acts as an updating timer. */
    1067 "timer" = "timer";
    1068 
    1069 /* Validation message for form control elements with a value longer than maximum allowed length */
    1070 "too long" = "too long";
    1071 
    1072 /* An ARIA accessibility group that acts as a tooltip. */
    1073 "tooltip" = "tooltip";
    1074 
    1075 /* Validation message for input form controls with a value not matching type */
    1076 "type mismatch" = "type mismatch";
    1077 
    1078 /* HTTP result code string */
    1079 "unacceptable" = "unacceptable";
    1080 
    1081 /* HTTP result code string */
    1082 "unauthorized" = "unauthorized";
    1083 
    1084 /* Verb stating the action that will occur when a checked checkbox is clicked, as used by accessibility */
    1085 "uncheck" = "uncheck";
    1086 
    1087 /* HTTP result code string */
    1088 "unimplemented" = "unimplemented";
    1089 
    1090 /* Unknown filename */
    1091 "unknown" = "unknown";
    1092 
    1093 /* accessibility label for turn mute off button */
    1094 "unmute" = "unmute";
    1095 
    1096 /* accessibility help text for un mute button */
    1097 "unmute audio tracks" = "unmute audio tracks";
    1098 
    1099 /* HTTP result code string */
    1100 "unsupported media type" = "unsupported media type";
    1101 
    1102 /* HTTP result code string */
    1103 "unsupported version" = "unsupported version";
    1104 
    1105 /* Validation message for required form control elements that have no value */
    1106 "value missing" = "value missing";
    1107 
    1108 /* accessibility help text for video element controller */
    1109 "video element playback controls and status display" = "video element playback controls and status display";
    1110 
    1111 /* accessibility label for video element controller */
    1112 "video playback" = "video playback";
    1113 
     1118"web dialog" = "web dialog";
     1119
  • trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.css

    r202183 r202274  
    11371137    pointer-events: none;
    11381138}
     1139
     1140video:-webkit-full-screen::-webkit-media-controls-panel .picture-in-picture-button {
     1141    margin-top: 7px;
     1142    margin-right: 24px;
     1143    margin-left: 0px;
     1144}
  • trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js

    r202183 r202274  
    625625        this.controls.panel.appendChild(this.controls.wirelessTargetPicker);
    626626        this.controls.panel.appendChild(this.controls.captionButton);
    627         if (!this.isAudio())
     627        if (!this.isAudio()) {
     628            this.updatePictureInPictureButton();
    628629            this.controls.panel.appendChild(this.controls.fullscreenButton);
     630        }
    629631        if (!this.isLive) {
    630632            this.controls.panel.appendChild(this.controls.timelineBox);
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r202183 r202274  
    14531453                379E61CC126CA5C400B63E8D /* BaseCheckableInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = 379E61C8126CA5C300B63E8D /* BaseCheckableInputType.h */; };
    14541454                37ACCF690DA414E70089E602 /* FontDescription.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37ACCE620DA2AA960089E602 /* FontDescription.cpp */; };
     1455                37B327D31D17096A005737FA /* PIPSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 37B327D21D17096A005737FA /* PIPSPI.h */; };
    14551456                37BAAE581980D1DD005DFE71 /* ProtectionSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 37BAAE571980D1DD005DFE71 /* ProtectionSpace.h */; settings = {ATTRIBUTES = (Private, ); }; };
    14561457                37C236101097EE7700EF9F72 /* ComplexTextController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37C2360E1097EE7700EF9F72 /* ComplexTextController.cpp */; };
     
    89758976                379E61C8126CA5C300B63E8D /* BaseCheckableInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseCheckableInputType.h; sourceTree = "<group>"; };
    89768977                37ACCE620DA2AA960089E602 /* FontDescription.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontDescription.cpp; sourceTree = "<group>"; };
     8978                37B327D21D17096A005737FA /* PIPSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PIPSPI.h; sourceTree = "<group>"; };
    89778979                37BAAE571980D1DD005DFE71 /* ProtectionSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProtectionSpace.h; sourceTree = "<group>"; };
    89788980                37C2360E1097EE7700EF9F72 /* ComplexTextController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ComplexTextController.cpp; sourceTree = "<group>"; };
     
    1906719069                                2D77AC2C1BF2B9A00072470A /* NSViewSPI.h */,
    1906819070                                2D0CF8161BCF5DE1007A4937 /* NSWindowSPI.h */,
     19071                                37B327D21D17096A005737FA /* PIPSPI.h */,
    1906919072                                1AA6BC4F1CF4F695003F6396 /* QTKitSPI.h */,
    1907019073                                937F4CCB1A2D48C100BB39F5 /* QuickLookMacSPI.h */,
     
    2552125524                                371F51A10D262FA000ECE0D5 /* CSSSegmentedFontFace.h in Headers */,
    2552225525                                A80E73520A199C77007FB8C5 /* CSSSelector.h in Headers */,
     25526                                37B327D31D17096A005737FA /* PIPSPI.h in Headers */,
    2552325527                                E4C1789B0EE6903800824D69 /* CSSSelectorList.h in Headers */,
    2552425528                                A80E6CE80A1989CA007FB8C5 /* CSSShadowValue.h in Headers */,
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r202238 r202274  
    156156#endif
    157157
    158 #if USE(APPLE_INTERNAL_SDK)
    159 #include <WebKitAdditions/HTMLMediaElementAdditions.cpp>
    160 #endif
    161 
    162158namespace WebCore {
    163159
     
    71027098}
    71037099
    7104 #if !USE(APPLE_INTERNAL_SDK)
    71057100bool HTMLMediaElement::shouldOverrideBackgroundLoadingRestriction() const
    71067101{
     
    71107105#endif
    71117106
    7112     return false;
     7107    return m_videoFullscreenMode == VideoFullscreenModePictureInPicture;
    71137108}
    71147109
    71157110void HTMLMediaElement::fullscreenModeChanged(VideoFullscreenMode mode)
    71167111{
     7112    if (m_videoFullscreenMode == mode)
     7113        return;
     7114
    71177115    m_videoFullscreenMode = mode;
    7118 }
    7119 #endif
    7120 
    7121 }
    7122 
    7123 #endif
     7116    m_mediaSession->scheduleClientDataBufferingCheck();
     7117}
     7118
     7119}
     7120
     7121#endif
  • trunk/Source/WebCore/html/HTMLVideoElement.cpp

    r202105 r202274  
    150150bool HTMLVideoElement::supportsFullscreen(HTMLMediaElementEnums::VideoFullscreenMode videoFullscreenMode) const
    151151{
    152 #if USE(APPLE_INTERNAL_SDK)
    153 #include <WebKitAdditions/HTMLVideoElementSupportsFullscreenAdditions.cpp>
    154 #endif
     152    if (videoFullscreenMode == HTMLMediaElementEnums::VideoFullscreenModePictureInPicture && !mediaSession().allowsPictureInPicture(*this))
     153        return false;
    155154
    156155    Page* page = document().page();
  • trunk/Source/WebCore/platform/LocalizedStrings.cpp

    r200415 r202274  
    510510#if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)
    511511
    512 #if USE(APPLE_INTERNAL_SDK)
    513 #include <WebKitAdditions/ContextMenuLocalizedStringsAdditions.cpp>
    514 #else
    515512String contextMenuItemTagEnterVideoEnhancedFullscreen()
    516513{
    517     return { };
     514    return WEB_UI_STRING("Enter Picture-in-Picture", "menu item");
    518515}
    519516
    520517String contextMenuItemTagExitVideoEnhancedFullscreen()
    521518{
    522     return { };
    523 }
    524 #endif
     519    return WEB_UI_STRING("Exit Picture-in-Picture", "menu item");
     520}
    525521
    526522#endif
     
    694690        return WEB_UI_STRING("alert", "An ARIA accessibility group that acts as an alert.");
    695691    if (ariaType == "ARIAApplicationAlertDialog")
    696         return WEB_UI_STRING("alert dialog", "An ARIA accessibility group that acts as an alert dialog.");
     692        return WEB_UI_STRING("web alert dialog", "An ARIA accessibility group that acts as an alert dialog.");
    697693    if (ariaType == "ARIAApplicationDialog")
    698         return WEB_UI_STRING("dialog", "An ARIA accessibility group that acts as an dialog.");
     694        return WEB_UI_STRING("web dialog", "An ARIA accessibility group that acts as an dialog.");
    699695    if (ariaType == "ARIAApplicationLog")
    700696        return WEB_UI_STRING("log", "An ARIA accessibility group that acts as a console log.");
  • trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h

    r200595 r202274  
    3737
    3838OBJC_CLASS NSWindow;
    39 
    40 #if USE(APPLE_INTERNAL_SDK)
    4139OBJC_CLASS WebVideoFullscreenInterfaceMacObjC;
    42 #endif
    4340
    4441namespace WebCore {
     
    10198    void rateChanged(bool isPlaying, float playbackRate) override;
    10299
    103 #if USE(APPLE_INTERNAL_SDK)
    104100    WEBCORE_EXPORT WebVideoFullscreenInterfaceMacObjC *videoFullscreenInterfaceObjC();
    105 #endif
    106101
    107102private:
     
    111106    WebVideoFullscreenChangeObserver* m_fullscreenChangeObserver { nullptr };
    112107    HTMLMediaElementEnums::VideoFullscreenMode m_mode { HTMLMediaElementEnums::VideoFullscreenModeNone };
    113 
    114 #if USE(APPLE_INTERNAL_SDK)
    115108    RetainPtr<WebVideoFullscreenInterfaceMacObjC> m_webVideoFullscreenInterfaceObjC;
    116 #endif
    117109};
    118110
  • trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm

    r201492 r202274  
    3131#import "AVKitSPI.h"
    3232#import "IntRect.h"
     33#import "Logging.h"
    3334#import "MediaTimeAVFoundation.h"
     35#import "PIPSPI.h"
    3436#import "TimeRanges.h"
    3537#import "WebPlaybackSessionInterfaceMac.h"
     
    4345SOFT_LINK_CLASS_OPTIONAL(AVKit, AVValueTiming)
    4446
    45 #if USE(APPLE_INTERNAL_SDK)
    46 #include <WebKitAdditions/WebVideoFullscreenInterfaceMacAdditions.mm>
    47 #endif
     47SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(PIP)
     48SOFT_LINK_CLASS_OPTIONAL(PIP, PIPViewController)
     49
     50using namespace WebCore;
     51
     52@class WebVideoViewContainer;
     53
     54@protocol WebVideoViewContainerDelegate <NSObject>
     55
     56- (void)boundsDidChangeForVideoViewContainer:(WebVideoViewContainer *)videoViewContainer;
     57- (void)superviewDidChangeForVideoViewContainer:(WebVideoViewContainer *)videoViewContainer;
     58
     59@end
     60
     61@interface WebVideoViewContainer : NSView {
     62    id <WebVideoViewContainerDelegate> _videoViewContainerDelegate;
     63}
     64
     65@property (nonatomic, assign) id <WebVideoViewContainerDelegate> videoViewContainerDelegate;
     66
     67@end
     68
     69@implementation WebVideoViewContainer
     70
     71@synthesize videoViewContainerDelegate=_videoViewContainerDelegate;
     72
     73- (void)resizeWithOldSuperviewSize:(NSSize)oldBoundsSize
     74{
     75    [super resizeWithOldSuperviewSize:oldBoundsSize];
     76
     77    [_videoViewContainerDelegate boundsDidChangeForVideoViewContainer:self];
     78}
     79
     80- (void)viewDidMoveToSuperview
     81{
     82    [super viewDidMoveToSuperview];
     83
     84    [_videoViewContainerDelegate superviewDidChangeForVideoViewContainer:self];
     85}
     86
     87@end
     88
     89enum class PIPState {
     90    NotInPIP,
     91    InPIP,
     92    ExitingPIP
     93};
     94
     95@interface WebVideoFullscreenInterfaceMacObjC : NSObject <PIPViewControllerDelegate, WebVideoViewContainerDelegate> {
     96    WebCore::WebVideoFullscreenInterfaceMac* _webVideoFullscreenInterfaceMac;
     97    NSSize _videoDimensions;
     98    RetainPtr<PIPViewController> _pipViewController;
     99    RetainPtr<NSViewController> _videoViewContainerController;
     100    RetainPtr<WebVideoViewContainer> _videoViewContainer;
     101    PIPState _pipState;
     102    RetainPtr<NSWindow> _returningWindow;
     103    NSRect _returningRect;
     104    BOOL _playing;
     105    BOOL _didRequestExitingPIP;
     106    BOOL _exitingToStandardFullscreen;
     107}
     108
     109- (instancetype)initWithWebVideoFullscreenInterfaceMac:(WebCore::WebVideoFullscreenInterfaceMac*)webVideoFullscreenInterfaceMac;
     110- (void)invalidateFullscreenState;
     111- (void)invalidate;
     112
     113// Tracking video playback state
     114@property (nonatomic) NSSize videoDimensions;
     115@property (nonatomic, getter=isPlaying) BOOL playing;
     116- (void)updateIsPlaying:(BOOL)isPlaying newPlaybackRate:(float)playbackRate;
     117
     118// Handling PIP transitions
     119@property (nonatomic, readonly) BOOL didRequestExitingPIP;
     120@property (nonatomic, getter=isExitingToStandardFullscreen) BOOL exitingToStandardFullscreen;
     121
     122- (void)setUpPIPForVideoView:(NSView *)videoView withFrame:(NSRect)frame inWindow:(NSWindow *)window;
     123- (void)enterPIP;
     124- (void)exitPIP;
     125- (void)exitPIPAnimatingToRect:(NSRect)rect inWindow:(NSWindow *)window;
     126
     127@end
     128
     129@implementation WebVideoFullscreenInterfaceMacObjC
     130
     131@synthesize playing=_playing;
     132@synthesize videoDimensions=_videoDimensions;
     133@synthesize didRequestExitingPIP=_didRequestExitingPIP;
     134@synthesize exitingToStandardFullscreen=_exitingToStandardFullscreen;
     135
     136- (instancetype)initWithWebVideoFullscreenInterfaceMac:(WebCore::WebVideoFullscreenInterfaceMac*)webVideoFullscreenInterfaceMac
     137{
     138    if (!(self = [super init]))
     139        return nil;
     140
     141    _webVideoFullscreenInterfaceMac = webVideoFullscreenInterfaceMac;
     142    _pipState = PIPState::NotInPIP;
     143
     144    return self;
     145}
     146
     147- (void)invalidateFullscreenState
     148{
     149    [_pipViewController setDelegate:nil];
     150    _pipViewController = nil;
     151    [_videoViewContainer removeFromSuperview];
     152    [_videoViewContainer setVideoViewContainerDelegate:nil];
     153    _videoViewContainer = nil;
     154    _videoViewContainerController = nil;
     155    _pipState = PIPState::NotInPIP;
     156    _didRequestExitingPIP = NO;
     157    _exitingToStandardFullscreen = NO;
     158    _returningWindow = nil;
     159    _returningRect = NSZeroRect;
     160}
     161
     162- (void)invalidate
     163{
     164    [self invalidateFullscreenState];
     165    _webVideoFullscreenInterfaceMac = nullptr;
     166    _videoDimensions = NSZeroSize;
     167}
     168
     169- (void)updateIsPlaying:(BOOL)isPlaying newPlaybackRate:(float)playbackRate
     170{
     171    _playing = isPlaying && playbackRate;
     172
     173    if ([_pipViewController respondsToSelector:@selector(setPlaying:)])
     174        [_pipViewController setPlaying:_playing];
     175}
     176
     177- (void)setVideoDimensions:(NSSize)videoDimensions
     178{
     179    _videoDimensions = videoDimensions;
     180
     181    if ([_pipViewController respondsToSelector:@selector(setAspectRatio:)])
     182        [_pipViewController setAspectRatio:_videoDimensions];
     183}
     184
     185- (void)setUpPIPForVideoView:(NSView *)videoView withFrame:(NSRect)frame inWindow:(NSWindow *)window
     186{
     187    ASSERT(!_pipViewController);
     188    ASSERT(!_videoViewContainerController);
     189    ASSERT(!_videoViewContainer);
     190
     191    _pipViewController = adoptNS([[getPIPViewControllerClass() alloc] init]);
     192    [_pipViewController setDelegate:self];
     193    if ([_pipViewController respondsToSelector:@selector(setUserCanResize:)])
     194        [_pipViewController setUserCanResize:YES];
     195    if ([_pipViewController respondsToSelector:@selector(setPlaying:)])
     196        [_pipViewController setPlaying:_playing];
     197    [self setVideoDimensions:NSEqualSizes(_videoDimensions, NSZeroSize) ? frame.size : _videoDimensions];
     198    if (_webVideoFullscreenInterfaceMac && _webVideoFullscreenInterfaceMac->webVideoFullscreenModel())
     199        _webVideoFullscreenInterfaceMac->webVideoFullscreenModel()->setVideoLayerGravity(WebVideoFullscreenModel::VideoGravityResizeAspectFill);
     200
     201    _videoViewContainer = adoptNS([[WebVideoViewContainer alloc] initWithFrame:frame]);
     202    [_videoViewContainer setVideoViewContainerDelegate:self];
     203    [_videoViewContainer addSubview:videoView];
     204    videoView.frame = [_videoViewContainer bounds];
     205    videoView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
     206
     207    _videoViewContainerController = adoptNS([[NSViewController alloc] init]);
     208    [_videoViewContainerController setView:_videoViewContainer.get()];
     209    [window.contentView addSubview:_videoViewContainer.get() positioned:NSWindowAbove relativeTo:nil];
     210}
     211
     212- (void)enterPIP
     213{
     214    if (_pipState == PIPState::InPIP)
     215        return;
     216
     217    [_videoViewContainerController view].layer.backgroundColor = CGColorGetConstantColor(kCGColorBlack);
     218    [_pipViewController presentViewControllerAsPictureInPicture:_videoViewContainerController.get()];
     219    _pipState = PIPState::InPIP;
     220}
     221
     222- (void)exitPIP
     223{
     224    if (_pipState != PIPState::InPIP || !_pipViewController || !_videoViewContainerController)
     225        return;
     226
     227    _didRequestExitingPIP = YES;
     228    [_videoViewContainerController view].layer.backgroundColor = CGColorGetConstantColor(kCGColorClear);
     229    [_pipViewController dismissViewController:_videoViewContainerController.get()];
     230    _pipState = PIPState::ExitingPIP;
     231}
     232
     233- (void)exitPIPAnimatingToRect:(NSRect)rect inWindow:(NSWindow *)window
     234{
     235    _returningWindow = window;
     236    _returningRect = rect;
     237   
     238    [_pipViewController setReplacementRect:rect];
     239    [_pipViewController setReplacementWindow:window];
     240
     241    [self exitPIP];
     242}
     243
     244// WebVideoViewContainerDelegate
     245
     246- (void)boundsDidChangeForVideoViewContainer:(WebVideoViewContainer *)videoViewContainer
     247{
     248    if (!_videoViewContainer || !_pipViewController)
     249        return;
     250
     251    ASSERT_UNUSED(videoViewContainer, videoViewContainer == _videoViewContainer);
     252
     253    if (_webVideoFullscreenInterfaceMac && _webVideoFullscreenInterfaceMac->webVideoFullscreenModel())
     254        _webVideoFullscreenInterfaceMac->webVideoFullscreenModel()->setVideoLayerFrame([_videoViewContainer bounds]);
     255}
     256
     257- (void)superviewDidChangeForVideoViewContainer:(WebVideoViewContainer *)videoViewContainer
     258{
     259    if (!_videoViewContainer || !_pipViewController)
     260        return;
     261
     262    ASSERT(videoViewContainer == _videoViewContainer);
     263
     264    if (![videoViewContainer isDescendantOf:[_pipViewController view]])
     265        return;
     266
     267    // Once the view is moved into the pip view, make sure it resizes with the pip view.
     268    videoViewContainer.frame = [videoViewContainer superview].bounds;
     269    videoViewContainer.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
     270}
     271
     272// PIPViewControllerDelegate
     273
     274- (BOOL)pipShouldClose:(PIPViewController *)pip
     275{
     276    ASSERT_UNUSED(pip, pip == _pipViewController);
     277
     278    if (!_webVideoFullscreenInterfaceMac || !_webVideoFullscreenInterfaceMac->webVideoFullscreenChangeObserver())
     279        return YES;
     280
     281    _didRequestExitingPIP = YES;
     282    _webVideoFullscreenInterfaceMac->webVideoFullscreenChangeObserver()->fullscreenMayReturnToInline();
     283
     284    return NO;
     285}
     286
     287- (void)pipDidClose:(PIPViewController *)pip
     288{
     289    ASSERT_UNUSED(pip, pip == _pipViewController);
     290
     291    if (_webVideoFullscreenInterfaceMac && _webVideoFullscreenInterfaceMac->webVideoFullscreenModel() && _videoViewContainer && _returningWindow && !NSEqualRects(_returningRect, NSZeroRect)) {
     292        [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
     293            context.allowsImplicitAnimation = NO;
     294            [_videoViewContainer setFrame:_returningRect];
     295            _webVideoFullscreenInterfaceMac->webVideoFullscreenModel()->setVideoLayerFrame([_videoViewContainer bounds]);
     296            _webVideoFullscreenInterfaceMac->webVideoFullscreenModel()->setVideoLayerGravity(WebVideoFullscreenModel::VideoGravityResizeAspect);
     297
     298            [[_returningWindow contentView] addSubview:_videoViewContainer.get() positioned:NSWindowAbove relativeTo:nil];
     299        } completionHandler:nil];
     300    }
     301
     302    if (_webVideoFullscreenInterfaceMac) {
     303        if (!self.isExitingToStandardFullscreen) {
     304            if (WebVideoFullscreenModel* videoFullscreenModel = _webVideoFullscreenInterfaceMac->webVideoFullscreenModel()) {
     305                videoFullscreenModel->requestFullscreenMode(HTMLMediaElementEnums::VideoFullscreenModeNone);
     306                videoFullscreenModel->setVideoLayerGravity(WebVideoFullscreenModel::VideoGravityResizeAspect);
     307            }
     308        }
     309
     310        _webVideoFullscreenInterfaceMac->clearMode(HTMLMediaElementEnums::VideoFullscreenModePictureInPicture);
     311
     312        if (WebVideoFullscreenChangeObserver* fullscreenChangeObserver = _webVideoFullscreenInterfaceMac->webVideoFullscreenChangeObserver())
     313            fullscreenChangeObserver->didExitFullscreen();
     314    }
     315}
     316
     317- (void)pipActionPlay:(PIPViewController *)pip
     318{
     319    ASSERT_UNUSED(pip, pip == _pipViewController);
     320
     321    if (_webVideoFullscreenInterfaceMac && _webVideoFullscreenInterfaceMac->webPlaybackSessionModel())
     322        _webVideoFullscreenInterfaceMac->webPlaybackSessionModel()->play();
     323}
     324
     325- (void)pipActionPause:(PIPViewController *)pip
     326{
     327    ASSERT_UNUSED(pip, pip == _pipViewController);
     328
     329    if (_webVideoFullscreenInterfaceMac && _webVideoFullscreenInterfaceMac->webPlaybackSessionModel())
     330        _webVideoFullscreenInterfaceMac->webPlaybackSessionModel()->pause();
     331}
     332
     333- (void)pipActionStop:(PIPViewController *)pip
     334{
     335    ASSERT_UNUSED(pip, pip == _pipViewController);
     336
     337    if (!_webVideoFullscreenInterfaceMac)
     338        return;
     339
     340    if (WebPlaybackSessionModel* playbackSessionModel = _webVideoFullscreenInterfaceMac->webPlaybackSessionModel())
     341        playbackSessionModel->pause();
     342
     343    // FIXME 25096170: Should animate only if the page with the video is unobscured. For now, always close without animation.
     344    [self exitPIP];
     345}
     346
     347@end
    48348
    49349namespace WebCore {
     
    110410void WebVideoFullscreenInterfaceMac::rateChanged(bool isPlaying, float playbackRate)
    111411{
    112 #if USE(APPLE_INTERNAL_SDK)
    113412    [videoFullscreenInterfaceObjC() updateIsPlaying:isPlaying newPlaybackRate:playbackRate];
    114 #else
    115     UNUSED_PARAM(isPlaying);
    116     UNUSED_PARAM(playbackRate);
     413}
     414
     415void WebVideoFullscreenInterfaceMac::setSeekableRanges(const TimeRanges& timeRanges)
     416{
     417    m_playbackSessionInterface->setSeekableRanges(timeRanges);
     418}
     419
     420void WebVideoFullscreenInterfaceMac::setAudioMediaSelectionOptions(const Vector<WTF::String>& options, uint64_t selectedIndex)
     421{
     422    m_playbackSessionInterface->setAudioMediaSelectionOptions(options, selectedIndex);
     423}
     424
     425void WebVideoFullscreenInterfaceMac::setLegibleMediaSelectionOptions(const Vector<WTF::String>& options, uint64_t selectedIndex)
     426{
     427    m_playbackSessionInterface->setLegibleMediaSelectionOptions(options, selectedIndex);
     428}
     429
     430void WebVideoFullscreenInterfaceMac::ensureControlsManager()
     431{
     432    m_playbackSessionInterface->ensureControlsManager();
     433}
     434
     435WebVideoFullscreenInterfaceMacObjC *WebVideoFullscreenInterfaceMac::videoFullscreenInterfaceObjC()
     436{
     437    if (!m_webVideoFullscreenInterfaceObjC)
     438        m_webVideoFullscreenInterfaceObjC = adoptNS([[WebVideoFullscreenInterfaceMacObjC alloc] initWithWebVideoFullscreenInterfaceMac:this]);
     439
     440    return m_webVideoFullscreenInterfaceObjC.get();
     441}
     442
     443void WebVideoFullscreenInterfaceMac::setupFullscreen(NSView& layerHostedView, const IntRect& initialRect, NSWindow *parentWindow, HTMLMediaElementEnums::VideoFullscreenMode mode, bool allowsPictureInPicturePlayback)
     444{
     445    LOG(Fullscreen, "WebVideoFullscreenInterfaceMac::setupFullscreen(%p), initialRect:{%d, %d, %d, %d}, parentWindow:%p, mode:%d", this, initialRect.x(), initialRect.y(), initialRect.width(), initialRect.height(), parentWindow, mode);
     446
     447    UNUSED_PARAM(allowsPictureInPicturePlayback);
     448    ASSERT(mode == HTMLMediaElementEnums::VideoFullscreenModePictureInPicture);
     449
     450    m_mode = mode;
     451
     452    [videoFullscreenInterfaceObjC() setUpPIPForVideoView:&layerHostedView withFrame:(NSRect)initialRect inWindow:parentWindow];
     453
     454    RefPtr<WebVideoFullscreenInterfaceMac> protectedThis(this);
     455    dispatch_async(dispatch_get_main_queue(), [protectedThis, this] {
     456        if (m_fullscreenChangeObserver)
     457            m_fullscreenChangeObserver->didSetupFullscreen();
     458    });
     459}
     460
     461void WebVideoFullscreenInterfaceMac::enterFullscreen()
     462{
     463    LOG(Fullscreen, "WebVideoFullscreenInterfaceMac::enterFullscreen(%p)", this);
     464
     465    if (mode() == HTMLMediaElementEnums::VideoFullscreenModePictureInPicture) {
     466        [m_webVideoFullscreenInterfaceObjC enterPIP];
     467
     468        if (m_fullscreenChangeObserver)
     469            m_fullscreenChangeObserver->didEnterFullscreen();
     470    } else
     471        ASSERT_NOT_REACHED();
     472}
     473
     474void WebVideoFullscreenInterfaceMac::exitFullscreen(const IntRect& finalRect, NSWindow *parentWindow)
     475{
     476    LOG(Fullscreen, "WebVideoFullscreenInterfaceMac::exitFullscreen(%p), finalRect:{%d, %d, %d, %d}, parentWindow:%p", this, finalRect.x(), finalRect.y(), finalRect.width(), finalRect.height(), parentWindow);
     477
     478    if ([m_webVideoFullscreenInterfaceObjC didRequestExitingPIP])
     479        return;
     480
     481    if (finalRect.isEmpty())
     482        [m_webVideoFullscreenInterfaceObjC exitPIP];
     483    else
     484        [m_webVideoFullscreenInterfaceObjC exitPIPAnimatingToRect:finalRect inWindow:parentWindow];
     485}
     486
     487void WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode(HTMLMediaElementEnums::VideoFullscreenMode mode)
     488{
     489    LOG(Fullscreen, "WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode(%p), mode:%d", this, mode);
     490
     491    if ([m_webVideoFullscreenInterfaceObjC didRequestExitingPIP])
     492        return;
     493
     494    [m_webVideoFullscreenInterfaceObjC setExitingToStandardFullscreen:mode == HTMLMediaElementEnums::VideoFullscreenModeStandard];
     495    [m_webVideoFullscreenInterfaceObjC exitPIP];
     496}
     497
     498void WebVideoFullscreenInterfaceMac::cleanupFullscreen()
     499{
     500    LOG(Fullscreen, "WebVideoFullscreenInterfaceMac::cleanupFullscreen(%p)", this);
     501
     502    [m_webVideoFullscreenInterfaceObjC exitPIP];
     503    [m_webVideoFullscreenInterfaceObjC invalidateFullscreenState];
     504
     505    if (m_fullscreenChangeObserver)
     506        m_fullscreenChangeObserver->didCleanupFullscreen();
     507}
     508
     509void WebVideoFullscreenInterfaceMac::invalidate()
     510{
     511    LOG(Fullscreen, "WebVideoFullscreenInterfaceMac::invalidate(%p)", this);
     512
     513    m_videoFullscreenModel = nil;
     514    m_fullscreenChangeObserver = nil;
     515
     516    cleanupFullscreen();
     517
     518    [m_webVideoFullscreenInterfaceObjC invalidate];
     519    m_webVideoFullscreenInterfaceObjC = nil;
     520}
     521
     522#if !LOG_DISABLED
     523static const char* boolString(bool val)
     524{
     525    return val ? "true" : "false";
     526}
    117527#endif
    118 }
    119 
    120 void WebVideoFullscreenInterfaceMac::setSeekableRanges(const TimeRanges& timeRanges)
    121 {
    122     m_playbackSessionInterface->setSeekableRanges(timeRanges);
    123 }
    124 
    125 void WebVideoFullscreenInterfaceMac::setAudioMediaSelectionOptions(const Vector<WTF::String>& options, uint64_t selectedIndex)
    126 {
    127     m_playbackSessionInterface->setAudioMediaSelectionOptions(options, selectedIndex);
    128 }
    129 
    130 void WebVideoFullscreenInterfaceMac::setLegibleMediaSelectionOptions(const Vector<WTF::String>& options, uint64_t selectedIndex)
    131 {
    132     m_playbackSessionInterface->setLegibleMediaSelectionOptions(options, selectedIndex);
    133 }
    134 
    135 void WebVideoFullscreenInterfaceMac::ensureControlsManager()
    136 {
    137     m_playbackSessionInterface->ensureControlsManager();
    138 }
    139 
    140 #if !USE(APPLE_INTERNAL_SDK)
    141 void WebVideoFullscreenInterfaceMac::setupFullscreen(NSView&, const IntRect&, NSWindow *, HTMLMediaElementEnums::VideoFullscreenMode, bool)
    142 {
    143 }
    144 
    145 void WebVideoFullscreenInterfaceMac::enterFullscreen()
    146 {
    147 }
    148 
    149 void WebVideoFullscreenInterfaceMac::exitFullscreen(const IntRect&, NSWindow *)
    150 {
    151 }
    152 
    153 void WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode(HTMLMediaElementEnums::VideoFullscreenMode)
    154 {
    155 }
    156 
    157 void WebVideoFullscreenInterfaceMac::cleanupFullscreen()
    158 {
    159 }
    160 
    161 void WebVideoFullscreenInterfaceMac::invalidate()
    162 {
    163 }
    164 
    165 void WebVideoFullscreenInterfaceMac::preparedToReturnToInline(bool, const IntRect&, NSWindow *)
    166 {
    167 }
    168 
    169 void WebVideoFullscreenInterfaceMac::setVideoDimensions(bool, float, float)
    170 {
     528
     529void WebVideoFullscreenInterfaceMac::preparedToReturnToInline(bool visible, const IntRect& inlineRect, NSWindow *parentWindow)
     530{
     531    LOG(Fullscreen, "WebVideoFullscreenInterfaceMac::preparedToReturnToInline(%p), visible:%s, inlineRect:{%d, %d, %d, %d}, parentWindow:%p", this, boolString(visible), inlineRect.x(), inlineRect.y(), inlineRect.width(), inlineRect.height(), parentWindow);
     532
     533    if (!visible) {
     534        [m_webVideoFullscreenInterfaceObjC exitPIP];
     535        return;
     536    }
     537
     538    ASSERT(parentWindow);
     539    [m_webVideoFullscreenInterfaceObjC exitPIPAnimatingToRect:(NSRect)inlineRect inWindow:parentWindow];
     540}
     541
     542void WebVideoFullscreenInterfaceMac::setExternalPlayback(bool enabled, ExternalPlaybackTargetType, String)
     543{
     544    LOG(Fullscreen, "WebVideoFullscreenInterfaceMac::setExternalPlayback(%p), enabled:%s", this, boolString(enabled));
     545
     546    if (enabled && m_mode == HTMLMediaElementEnums::VideoFullscreenModePictureInPicture)
     547        exitFullscreen(IntRect(), nil);
     548}
     549
     550void WebVideoFullscreenInterfaceMac::setVideoDimensions(bool hasVideo, float width, float height)
     551{
     552    LOG(Fullscreen, "WebVideoFullscreenInterfaceMac::setVideoDimensions(%p), hasVideo:%s, width:%.0f, height:%.0f", this, boolString(hasVideo), width, height);
     553
     554    if (!hasVideo) {
     555        exitFullscreenWithoutAnimationToMode(HTMLMediaElementEnums::VideoFullscreenModeNone);
     556        return;
     557    }
     558
     559    // Width and height can be zero when we are transitioning from one video to another. Ignore zero values.
     560    if (width && height)
     561        [m_webVideoFullscreenInterfaceObjC setVideoDimensions:NSMakeSize(width, height)];
    171562}
    172563
    173564bool WebVideoFullscreenInterfaceMac::isPlayingVideoInEnhancedFullscreen() const
    174565{
    175     return false;
    176 }
    177 
    178 void WebVideoFullscreenInterfaceMac::setExternalPlayback(bool, ExternalPlaybackTargetType, String)
    179 {
     566    return hasMode(WebCore::HTMLMediaElementEnums::VideoFullscreenModePictureInPicture) && [m_webVideoFullscreenInterfaceObjC isPlaying];
    180567}
    181568
    182569bool supportsPictureInPicture()
    183570{
    184     return false;
    185 }
     571    return PIPLibrary() && getPIPViewControllerClass();
     572}
     573
     574}
     575
    186576#endif
    187 
    188 }
    189 
    190 #endif
  • trunk/Source/WebCore/rendering/HitTestResult.cpp

    r201205 r202274  
    787787}
    788788
    789 #if USE(APPLE_INTERNAL_SDK)
    790 #include <WebKitAdditions/HitTestResultAdditions.cpp>
     789bool HitTestResult::mediaSupportsEnhancedFullscreen() const
     790{
     791#if PLATFORM(MAC) && ENABLE(VIDEO) && ENABLE(VIDEO_PRESENTATION_MODE)
     792    HTMLMediaElement* mediaElt(mediaElement());
     793    return is<HTMLVideoElement>(mediaElt) && mediaElt->supportsFullscreen(HTMLMediaElementEnums::VideoFullscreenModePictureInPicture);
    791794#else
    792 bool HitTestResult::mediaSupportsEnhancedFullscreen() const
    793 {
    794     return false;
     795    return false;
     796#endif
    795797}
    796798
    797799bool HitTestResult::mediaIsInEnhancedFullscreen() const
    798800{
    799     return false;
     801#if PLATFORM(MAC) && ENABLE(VIDEO) && ENABLE(VIDEO_PRESENTATION_MODE)
     802    HTMLMediaElement* mediaElt(mediaElement());
     803    return is<HTMLVideoElement>(mediaElt) && mediaElt->fullscreenMode() == HTMLMediaElementEnums::VideoFullscreenModePictureInPicture;
     804#else
     805    return false;
     806#endif
    800807}
    801808
    802809void HitTestResult::toggleEnhancedFullscreenForVideo() const
    803810{
    804 }
    805 #endif
     811#if PLATFORM(MAC) && ENABLE(VIDEO) && ENABLE(VIDEO_PRESENTATION_MODE)
     812    HTMLMediaElement* mediaElement(this->mediaElement());
     813    if (!is<HTMLVideoElement>(mediaElement) || !mediaElement->supportsFullscreen(HTMLMediaElementEnums::VideoFullscreenModePictureInPicture))
     814        return;
     815
     816    HTMLVideoElement& videoElement = downcast<HTMLVideoElement>(*mediaElement);
     817    UserGestureIndicator indicator(DefinitelyProcessingUserGesture, &mediaElement->document());
     818    if (videoElement.fullscreenMode() == HTMLMediaElementEnums::VideoFullscreenModePictureInPicture)
     819        videoElement.exitFullscreen();
     820    else
     821        videoElement.enterFullscreen(HTMLMediaElementEnums::VideoFullscreenModePictureInPicture);
     822#endif
     823}
    806824
    807825} // namespace WebCore
  • trunk/Source/WebCore/rendering/RenderThemeMac.mm

    r202117 r202274  
    237237        StringBuilder styleSheetBuilder;
    238238        styleSheetBuilder.append([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsApple" ofType:@"css"] encoding:NSUTF8StringEncoding error:nil]);
    239 
    240 #if USE(APPLE_INTERNAL_SDK)
    241 #import <WebKitAdditions/RenderThemeMacMediaControlsStyleSheetAdditions.mm>
    242 #endif
    243 
    244239        m_mediaControlsStyleSheet = styleSheetBuilder.toString();
    245240    }
     
    257252        scriptBuilder.append([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsLocalizedStrings" ofType:@"js"] encoding:NSUTF8StringEncoding error:nil]);
    258253        scriptBuilder.append([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsApple" ofType:@"js"] encoding:NSUTF8StringEncoding error:nil]);
    259 
    260 #if USE(APPLE_INTERNAL_SDK)
    261 #import <WebKitAdditions/RenderThemeMacMediaControlsScriptAdditions.mm>
    262 #endif
    263        
    264254        m_mediaControlsScript = scriptBuilder.toString();
    265255    }
  • trunk/Source/WebKit2/ChangeLog

    r202273 r202274  
     12016-06-21  Dan Bernstein  <mitz@apple.com>
     2
     3        Inlined some picture-in-picture code.
     4        https://bugs.webkit.org/show_bug.cgi?id=158977
     5
     6        Reviewed by Eric Carlsson.
     7
     8        This code was written primarily by Ada Chan, and originally reviewed by Alex Christensen,
     9        Anders Carlsson, Conrad Shultz, Dan Bernstein, Eric Carlson, Jer Noble, Jeremy Jones,
     10        Jon Lee, Remy Demarest, and Zach Li.
     11
     12        * Shared/WebPreferencesStoreDefaultsAdditions.cpp:
     13          Define and use DEFAULT_ALLOWS_PICTURE_IN_PICTURE_MEDIA_PLAYBACK.
     14
     15        * Shared/WebPreferencesStore.cpp:
     16        (WebKit::defaults): Removed include of WebPreferencesStoreDefaultsAdditions.cpp now that the
     17          default is defined correctly in WebPreferencesStoreDefaultsAdditions.cpp.
     18
     19        * UIProcess/API/C/WKPreferences.cpp: Inlined WKPreferencesAdditions.cpp.
     20        * UIProcess/API/C/WKPreferencesRefPrivate.h: Ditto.
     21
     22        * WebProcess/cocoa/WebVideoFullscreenManager.mm: Inlined WebVideoFullscreenManagerSupportsVideoFullscreenMac.mm.
     23
    1242016-06-21  Carlos Garcia Campos  <cgarcia@igalia.com>
    225
  • trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h

    r201759 r202274  
    6464
    6565#if PLATFORM(IOS)
     66#define DEFAULT_ALLOWS_PICTURE_IN_PICTURE_MEDIA_PLAYBACK true
    6667#define DEFAULT_BACKSPACE_KEY_NAVIGATION_ENABLED false
    6768#define DEFAULT_FRAME_FLATTENING_ENABLED true
     
    8081#define DEFAULT_REQUIRES_USER_GESTURE_FOR_AUDIO_PLAYBACK true
    8182#else
     83#define DEFAULT_ALLOWS_PICTURE_IN_PICTURE_MEDIA_PLAYBACK false
    8284#define DEFAULT_BACKSPACE_KEY_NAVIGATION_ENABLED true
    8385#define DEFAULT_FRAME_FLATTENING_ENABLED false
     
    162164    macro(InvisibleAutoplayNotPermitted, invisibleAutoplayNotPermitted, Bool, bool, DEFAULT_INVISIBLE_AUTOPLAY_NOT_PERMITTED, "", "") \
    163165    macro(MediaDataLoadsAutomatically, mediaDataLoadsAutomatically, Bool, bool, DEFAULT_MEDIA_DATA_LOADS_AUTOMATICALLY, "", "") \
    164     macro(AllowsPictureInPictureMediaPlayback, allowsPictureInPictureMediaPlayback, Bool, bool, true, "", "") \
     166    macro(AllowsPictureInPictureMediaPlayback, allowsPictureInPictureMediaPlayback, Bool, bool, DEFAULT_ALLOWS_PICTURE_IN_PICTURE_MEDIA_PLAYBACK, "", "") \
    165167    macro(AllowsAirPlayForMediaPlayback, allowsAirPlayForMediaPlayback, Bool, bool, true, "", "") \
    166168    macro(MediaControlsScaleWithPageZoom, mediaControlsScaleWithPageZoom, Bool, bool, DEFAULT_MEDIA_CONTROLS_SCALE_WITH_PAGE_ZOOM, "", "") \
  • trunk/Source/WebKit2/Shared/WebPreferencesStore.cpp

    r199700 r202274  
    166166        FOR_EACH_WEBKIT_EXPERIMENTAL_FEATURE_PREFERENCE(DEFINE_DEFAULTS)
    167167#undef DEFINE_DEFAULTS
    168 #if USE(APPLE_INTERNAL_SDK)
    169 #include <WebKitAdditions/WebPreferencesStoreDefaultsAdditions.cpp>
    170 #endif
    171168    }
    172169
  • trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp

    r202242 r202274  
    3636using namespace WebKit;
    3737
    38 #if USE(APPLE_INTERNAL_SDK)
    39 #include <WebKitAdditions/WKPreferencesAdditions.cpp>
    40 #endif
    41 
    4238WKTypeID WKPreferencesGetTypeID()
    4339{
     
    15261522    return toImpl(preferencesRef)->selectionPaintingWithoutSelectionGapsEnabled();
    15271523}
     1524
     1525void WKPreferencesSetAllowsPictureInPictureMediaPlayback(WKPreferencesRef preferencesRef, bool enabled)
     1526{
     1527    toImpl(preferencesRef)->setAllowsPictureInPictureMediaPlayback(enabled);
     1528}
     1529
     1530bool WKPreferencesGetAllowsPictureInPictureMediaPlayback(WKPreferencesRef preferencesRef)
     1531{
     1532    return toImpl(preferencesRef)->allowsPictureInPictureMediaPlayback();
     1533}
  • trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h

    r201542 r202274  
    422422WK_EXPORT bool WKPreferencesGetSelectionPaintingWithoutSelectionGapsEnabled(WKPreferencesRef);
    423423
     424// Defaults to false.
     425WK_EXPORT void WKPreferencesSetAllowsPictureInPictureMediaPlayback(WKPreferencesRef, bool flag);
     426WK_EXPORT bool WKPreferencesGetAllowsPictureInPictureMediaPlayback(WKPreferencesRef);
     427
    424428#ifdef __cplusplus
    425429}
  • trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm

    r201963 r202274  
    257257    UNUSED_PARAM(mode);
    258258    return Settings::avKitEnabled();
    259 #elif USE(APPLE_INTERNAL_SDK)
    260 #import <WebKitAdditions/WebVideoFullscreenManagerSupportsVideoFullscreenMac.mm>
    261259#else
    262     return false;
     260    return mode == HTMLMediaElementEnums::VideoFullscreenModePictureInPicture && supportsPictureInPicture();
    263261#endif
    264262}
Note: See TracChangeset for help on using the changeset viewer.