Changeset 233771 in webkit


Ignore:
Timestamp:
Jul 12, 2018 10:03:41 AM (6 years ago)
Author:
jer.noble@apple.com
Message:

REGRESSION (r230163): Videos cannot be seen full screen in Complete Anatomy app
https://bugs.webkit.org/show_bug.cgi?id=187527
<rdar://problem/40511527>

Reviewed by Ryosuke Niwa.

Do not enable element fullscreen mode unless apps specifically opt-in. The Fullscreen API is
an experimental feature on iOS, but not on Mac, but we can't simply not return the ExperimentalFeature
object from the list of experimental features, as this keeps Safari from being able to apply a
NSUserDefault value for that feature. Instead, add a property to API::ExperimentalFeature and
_WKExperimentalFeature called "hidden", which signals to clients whether to display the feature
in their UI.

  • Scripts/GeneratePreferences.rb:
  • Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
  • Shared/WebPreferences.yaml:
  • Shared/WebPreferencesDefaultValues.h:
  • UIProcess/API/APIExperimentalFeature.cpp:

(API::ExperimentalFeature::create):
(API::ExperimentalFeature::ExperimentalFeature):

  • UIProcess/API/APIExperimentalFeature.h:
  • UIProcess/API/Cocoa/_WKExperimentalFeature.h:
  • UIProcess/API/Cocoa/_WKExperimentalFeature.mm:

(-[_WKExperimentalFeature isHidden]):

Location:
trunk/Source/WebKit
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r233770 r233771  
     12018-07-12  Jer Noble  <jer.noble@apple.com>
     2
     3        REGRESSION (r230163): Videos cannot be seen full screen in Complete Anatomy app
     4        https://bugs.webkit.org/show_bug.cgi?id=187527
     5        <rdar://problem/40511527>
     6
     7        Reviewed by Ryosuke Niwa.
     8
     9        Do not enable element fullscreen mode unless apps specifically opt-in. The Fullscreen API is
     10        an experimental feature on iOS, but not on Mac, but we can't simply not return the ExperimentalFeature
     11        object from the list of experimental features, as this keeps Safari from being able to apply a
     12        NSUserDefault value for that feature. Instead, add a property to API::ExperimentalFeature and
     13        _WKExperimentalFeature called "hidden", which signals to clients whether to display the feature
     14        in their UI.
     15
     16        * Scripts/GeneratePreferences.rb:
     17        * Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
     18        * Shared/WebPreferences.yaml:
     19        * Shared/WebPreferencesDefaultValues.h:
     20        * UIProcess/API/APIExperimentalFeature.cpp:
     21        (API::ExperimentalFeature::create):
     22        (API::ExperimentalFeature::ExperimentalFeature):
     23        * UIProcess/API/APIExperimentalFeature.h:
     24        * UIProcess/API/Cocoa/_WKExperimentalFeature.h:
     25        * UIProcess/API/Cocoa/_WKExperimentalFeature.mm:
     26        (-[_WKExperimentalFeature isHidden]):
     27
    1282018-07-12  Alexey Proskuryakov  <ap@apple.com>
    229
  • trunk/Source/WebKit/Scripts/GeneratePreferences.rb

    r229680 r233771  
    7171  attr_accessor :webcoreBinding
    7272  attr_accessor :condition
    73   attr_accessor :visibleCondition
     73  attr_accessor :hidden
    7474
    7575  def initialize(name, opts)
     
    8484    @webcoreName = opts["webcoreName"]
    8585    @condition = opts["condition"]
    86     @visibleCondition = opts["visibleCondition"]
     86    @hidden = opts["hidden"] || false
    8787  end
    8888
  • trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb

    r229680 r233771  
    5454#if <%= @pref.condition %>
    5555<%- end -%>
    56 <%- if @pref.visibleCondition -%>
    57 #if <%= @pref.visibleCondition %>
    58 <%- end -%>
    59         API::ExperimentalFeature::create(<%= @pref.humanReadableName %>, "<%= @pref.name %>", <%= @pref.humanReadableDescription %>, <%= @pref.defaultValue %>),
    60 <%- if @pref.visibleCondition -%>
    61 #endif
    62 <%- end -%>
     56        API::ExperimentalFeature::create(<%= @pref.humanReadableName %>, "<%= @pref.name %>", <%= @pref.humanReadableDescription %>, <%= @pref.defaultValue %>, <%= @pref.hidden %>),
    6357<%- if @pref.condition -%>
    6458#endif
  • trunk/Source/WebKit/Shared/WebPreferences.yaml

    r233746 r233771  
    12691269FullScreenEnabled:
    12701270  type: bool
    1271   defaultValue: DEFAULT_ENABLE_FULLSCREEN_API
     1271  defaultValue: false
    12721272  condition: ENABLE(FULLSCREEN_API)
    1273   visibleCondition: PLATFORM(IOS)
     1273  hidden: EXPERIMENTAL_FULLSCREEN_API_HIDDEN
    12741274  humanReadableName: "Fullscreen API"
    12751275  humanReadableDescription: "Fullscreen API"
  • trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h

    r233203 r233771  
    7676#define DEFAULT_REQUIRES_USER_GESTURE_FOR_AUDIO_PLAYBACK true
    7777#define DEFAULT_INTERACTIVE_MEDIA_CAPTURE_STREAM_REPROMPT_INTERVAL_IN_MINUTES 1
    78 #define DEFAULT_ENABLE_FULLSCREEN_API false
     78#define EXPERIMENTAL_FULLSCREEN_API_HIDDEN false
    7979#else
    8080#define DEFAULT_ALLOWS_PICTURE_IN_PICTURE_MEDIA_PLAYBACK false
     
    9595#define DEFAULT_REQUIRES_USER_GESTURE_FOR_AUDIO_PLAYBACK false
    9696#define DEFAULT_INTERACTIVE_MEDIA_CAPTURE_STREAM_REPROMPT_INTERVAL_IN_MINUTES 10
    97 #define DEFAULT_ENABLE_FULLSCREEN_API true
     97#define EXPERIMENTAL_FULLSCREEN_API_HIDDEN true
    9898#endif
    9999
  • trunk/Source/WebKit/UIProcess/API/APIExperimentalFeature.cpp

    r209443 r233771  
    2929namespace API {
    3030
    31 Ref<ExperimentalFeature> ExperimentalFeature::create(const WTF::String& name, const WTF::String& key, const WTF::String& details, bool defaultValue)
     31Ref<ExperimentalFeature> ExperimentalFeature::create(const WTF::String& name, const WTF::String& key, const WTF::String& details, bool defaultValue, bool hidden)
    3232{
    33     return adoptRef(*new ExperimentalFeature(name, key, details, defaultValue));
     33    return adoptRef(*new ExperimentalFeature(name, key, details, defaultValue, hidden));
    3434}
    3535
    36 ExperimentalFeature::ExperimentalFeature(const WTF::String& name, const WTF::String& key, const WTF::String& details, bool defaultValue)
     36ExperimentalFeature::ExperimentalFeature(const WTF::String& name, const WTF::String& key, const WTF::String& details, bool defaultValue, bool hidden)
    3737    : m_name(name)
    3838    , m_key(key)
    3939    , m_details(details)
    4040    , m_defaultValue(defaultValue)
     41    , m_hidden(hidden)
    4142{
    4243}
  • trunk/Source/WebKit/UIProcess/API/APIExperimentalFeature.h

    r209443 r233771  
    3434class ExperimentalFeature final : public ObjectImpl<Object::Type::ExperimentalFeature> {
    3535public:
    36     static Ref<ExperimentalFeature> create(const WTF::String& name, const WTF::String& key, const WTF::String& details, bool defaultValue);
     36    static Ref<ExperimentalFeature> create(const WTF::String& name, const WTF::String& key, const WTF::String& details, bool defaultValue, bool hidden);
    3737    virtual ~ExperimentalFeature();
    3838
     
    4141    WTF::String details() const { return m_details; }
    4242    bool defaultValue() const { return m_defaultValue; }
     43    bool isHidden() const { return m_hidden; }
    4344
    4445private:
    45     explicit ExperimentalFeature(const WTF::String& name, const WTF::String& key, const WTF::String& details, bool defaultValue);
     46    explicit ExperimentalFeature(const WTF::String& name, const WTF::String& key, const WTF::String& details, bool defaultValue, bool hidden);
    4647
    4748    WTF::String m_name;
     
    4950    WTF::String m_details;
    5051    bool m_defaultValue;
     52    bool m_hidden;
    5153};
    5254
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKExperimentalFeature.h

    r209443 r233771  
    3737@property (nonatomic, readonly, copy) NSString *details;
    3838@property (nonatomic, readonly) BOOL defaultValue;
     39@property (nonatomic, readonly, getter=isHidden) BOOL hidden;
    3940
    4041@end
  • trunk/Source/WebKit/UIProcess/API/Cocoa/_WKExperimentalFeature.mm

    r209443 r233771  
    6363}
    6464
     65- (BOOL)isHidden
     66{
     67    return _experimentalFeature->isHidden();
     68}
     69
    6570#pragma mark WKObject protocol implementation
    6671
Note: See TracChangeset for help on using the changeset viewer.