Changeset 207426 in webkit


Ignore:
Timestamp:
Oct 17, 2016 1:38:46 PM (7 years ago)
Author:
Chris Dumez
Message:

Move form.reportValidity() behind InteractiveFormValidation setting
https://bugs.webkit.org/show_bug.cgi?id=163550

Reviewed by Darin Adler.

Source/WebCore:

Move form.reportValidity() behind InteractiveFormValidation setting for consistency
given that the two features are strongly related.

Also enable the setting by default so we can get feedback on the implementation.

Demos:

  • bindings/generic/RuntimeEnabledFeatures.h:

(WebCore::RuntimeEnabledFeatures::setInteractiveFormValidationEnabled):
(WebCore::RuntimeEnabledFeatures::interactiveFormValidationEnabled):

  • html/HTMLButtonElement.idl:
  • html/HTMLFieldSetElement.idl:
  • html/HTMLFormElement.idl:
  • html/HTMLInputElement.idl:
  • html/HTMLKeygenElement.idl:
  • html/HTMLObjectElement.idl:
  • html/HTMLOutputElement.idl:
  • html/HTMLSelectElement.idl:
  • html/HTMLTextAreaElement.idl:

Source/WebKit/mac:

Enable InteractiveFormValidation setting by default and link it to
RuntimeEnabledFeatures so we can use it in the IDL.

  • WebView/WebView.mm:

(-[WebView _preferencesChanged:]):

  • WebView/WebViewData.mm:

(-[WebViewPrivate init]):

Source/WebKit2:

Enable InteractiveFormValidation setting by default and link it to
RuntimeEnabledFeatures so we can use it in the IDL.

  • UIProcess/API/C/WKPreferencesRefPrivate.h:
  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::updatePreferences):

Location:
trunk/Source
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r207423 r207426  
     12016-10-17  Chris Dumez  <cdumez@apple.com>
     2
     3        Move form.reportValidity() behind InteractiveFormValidation setting
     4        https://bugs.webkit.org/show_bug.cgi?id=163550
     5
     6        Reviewed by Darin Adler.
     7
     8        Move form.reportValidity() behind InteractiveFormValidation setting for consistency
     9        given that the two features are strongly related.
     10
     11        Also enable the setting by default so we can get feedback on the implementation.
     12
     13        Demos:
     14        - Interactive form validation: http://jsfiddle.net/tj_vantoll/HdSqt/
     15        - Report validity: https://googlechrome.github.io/samples/report-validity/
     16
     17        * bindings/generic/RuntimeEnabledFeatures.h:
     18        (WebCore::RuntimeEnabledFeatures::setInteractiveFormValidationEnabled):
     19        (WebCore::RuntimeEnabledFeatures::interactiveFormValidationEnabled):
     20        * html/HTMLButtonElement.idl:
     21        * html/HTMLFieldSetElement.idl:
     22        * html/HTMLFormElement.idl:
     23        * html/HTMLInputElement.idl:
     24        * html/HTMLKeygenElement.idl:
     25        * html/HTMLObjectElement.idl:
     26        * html/HTMLOutputElement.idl:
     27        * html/HTMLSelectElement.idl:
     28        * html/HTMLTextAreaElement.idl:
     29
    1302016-10-17  Antoine Quint  <graouts@apple.com>
    231
  • trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h

    r206296 r207426  
    199199    bool shadowDOMEnabled() const { return m_isShadowDOMEnabled; }
    200200
     201    void setInteractiveFormValidationEnabled(bool isEnabled) { m_isInteractiveFormValidationEnabled = isEnabled; }
     202    bool interactiveFormValidationEnabled() const { return m_isInteractiveFormValidationEnabled; }
     203
    201204#if ENABLE(CUSTOM_ELEMENTS)
    202205    void setCustomElementsEnabled(bool areEnabled) { m_areCustomElementsEnabled = areEnabled; }
     
    319322    bool m_isShadowDOMEnabled;
    320323
     324    bool m_isInteractiveFormValidationEnabled { false };
     325
    321326#if ENABLE(CUSTOM_ELEMENTS)
    322327    bool m_areCustomElementsEnabled;
  • trunk/Source/WebCore/html/HTMLButtonElement.idl

    r207380 r207426  
    3838    readonly attribute DOMString validationMessage;
    3939    boolean checkValidity();
    40     boolean reportValidity();
     40    [EnabledAtRuntime=InteractiveFormValidation] boolean reportValidity();
    4141    void setCustomValidity(DOMString? error);
    4242
  • trunk/Source/WebCore/html/HTMLFieldSetElement.idl

    r207380 r207426  
    3131    readonly attribute DOMString       validationMessage;
    3232    boolean  checkValidity();
    33     boolean reportValidity();
     33    [EnabledAtRuntime=InteractiveFormValidation] boolean reportValidity();
    3434    void     setCustomValidity(DOMString? error);
    3535};
  • trunk/Source/WebCore/html/HTMLFormElement.idl

    r207380 r207426  
    4848    void reset();
    4949    boolean checkValidity();
    50     boolean reportValidity();
     50    [EnabledAtRuntime=InteractiveFormValidation] boolean reportValidity();
    5151
    5252    [Conditional=REQUEST_AUTOCOMPLETE] void requestAutocomplete();
  • trunk/Source/WebCore/html/HTMLInputElement.idl

    r207380 r207426  
    7272    readonly attribute DOMString validationMessage;
    7373    boolean checkValidity();
    74     boolean reportValidity();
     74    [EnabledAtRuntime=InteractiveFormValidation] boolean reportValidity();
    7575    void setCustomValidity(DOMString? error);
    7676
  • trunk/Source/WebCore/html/HTMLKeygenElement.idl

    r207380 r207426  
    4343    readonly attribute DOMString validationMessage;
    4444    boolean checkValidity();
    45     boolean reportValidity();
     45    [EnabledAtRuntime=InteractiveFormValidation] boolean reportValidity();
    4646    void setCustomValidity(DOMString? error);
    4747
  • trunk/Source/WebCore/html/HTMLObjectElement.idl

    r207380 r207426  
    4545    readonly attribute DOMString validationMessage;
    4646    boolean checkValidity();
    47     boolean reportValidity();
     47    [EnabledAtRuntime=InteractiveFormValidation] boolean reportValidity();
    4848    void setCustomValidity(DOMString? error);
    4949
  • trunk/Source/WebCore/html/HTMLOutputElement.idl

    r207380 r207426  
    3737    readonly attribute DOMString validationMessage;
    3838    boolean checkValidity();
    39     boolean reportValidity();
     39    [EnabledAtRuntime=InteractiveFormValidation] boolean reportValidity();
    4040    void setCustomValidity(DOMString? error);
    4141
  • trunk/Source/WebCore/html/HTMLSelectElement.idl

    r207380 r207426  
    6060    readonly attribute DOMString validationMessage;
    6161    boolean checkValidity();
    62     boolean reportValidity();
     62    [EnabledAtRuntime=InteractiveFormValidation] boolean reportValidity();
    6363    void setCustomValidity(DOMString? error); // FIXME: Argument should not be nullable.
    6464
  • trunk/Source/WebCore/html/HTMLTextAreaElement.idl

    r207380 r207426  
    4444    readonly attribute DOMString validationMessage;
    4545    boolean checkValidity();
    46     boolean reportValidity();
     46    [EnabledAtRuntime=InteractiveFormValidation] boolean reportValidity();
    4747    void setCustomValidity(DOMString? error);
    4848
  • trunk/Source/WebKit/mac/ChangeLog

    r207422 r207426  
     12016-10-17  Chris Dumez  <cdumez@apple.com>
     2
     3        Move form.reportValidity() behind InteractiveFormValidation setting
     4        https://bugs.webkit.org/show_bug.cgi?id=163550
     5
     6        Reviewed by Darin Adler.
     7
     8        Enable InteractiveFormValidation setting by default and link it to
     9        RuntimeEnabledFeatures so we can use it in the IDL.
     10
     11        * WebView/WebView.mm:
     12        (-[WebView _preferencesChanged:]):
     13        * WebView/WebViewData.mm:
     14        (-[WebViewPrivate init]):
     15
    1162016-10-17  Anders Carlsson  <andersca@apple.com>
    217
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r207352 r207426  
    25382538    RuntimeEnabledFeatures::sharedFeatures().setShadowDOMEnabled([preferences shadowDOMEnabled]);
    25392539
     2540    RuntimeEnabledFeatures::sharedFeatures().setInteractiveFormValidationEnabled([self interactiveFormValidationEnabled]);
     2541
    25402542    RuntimeEnabledFeatures::sharedFeatures().setDOMIteratorEnabled([preferences DOMIteratorEnabled]);
    25412543
  • trunk/Source/WebKit/mac/WebView/WebViewData.mm

    r199846 r207426  
    144144    zoomsTextOnly = NO;
    145145
    146     interactiveFormValidationEnabled = NO;
     146    interactiveFormValidationEnabled = YES;
    147147    // The default value should be synchronized with WebCore/page/Settings.cpp.
    148148    validationMessageTimerMagnification = 50;
  • trunk/Source/WebKit2/ChangeLog

    r207424 r207426  
     12016-10-17  Chris Dumez  <cdumez@apple.com>
     2
     3        Move form.reportValidity() behind InteractiveFormValidation setting
     4        https://bugs.webkit.org/show_bug.cgi?id=163550
     5
     6        Reviewed by Darin Adler.
     7
     8        Enable InteractiveFormValidation setting by default and link it to
     9        RuntimeEnabledFeatures so we can use it in the IDL.
     10
     11        * UIProcess/API/C/WKPreferencesRefPrivate.h:
     12        * WebProcess/WebPage/WebPage.cpp:
     13        (WebKit::WebPage::updatePreferences):
     14
    1152016-10-17  Gavin Barraclough  <barraclough@apple.com>
    216
  • trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h

    r207402 r207426  
    180180    macro(ArtificialPluginInitializationDelayEnabled, artificialPluginInitializationDelayEnabled, Bool, bool, false, "", "") \
    181181    macro(TabToLinksEnabled, tabToLinksEnabled, Bool, bool, false, "", "") \
    182     macro(InteractiveFormValidationEnabled, interactiveFormValidationEnabled, Bool, bool, false, "", "") \
     182    macro(InteractiveFormValidationEnabled, interactiveFormValidationEnabled, Bool, bool, true, "", "") \
    183183    macro(ScrollingPerformanceLoggingEnabled, scrollingPerformanceLoggingEnabled, Bool, bool, false, "", "") \
    184184    macro(ScrollAnimatorEnabled, scrollAnimatorEnabled, Bool, bool, DEFAULT_WEBKIT_SCROLL_ANIMATOR_ENABLED, "", "") \
  • trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h

    r204852 r207426  
    244244WK_EXPORT bool WKPreferencesGetTabToLinksEnabled(WKPreferencesRef preferencesRef);
    245245
    246 // Defaults to false
     246// Defaults to true
    247247WK_EXPORT void WKPreferencesSetInteractiveFormValidationEnabled(WKPreferencesRef preferencesRef, bool enabled);
    248248WK_EXPORT bool WKPreferencesGetInteractiveFormValidationEnabled(WKPreferencesRef preferencesRef);
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r207424 r207426  
    31983198    RuntimeEnabledFeatures::sharedFeatures().setShadowDOMEnabled(store.getBoolValueForKey(WebPreferencesKey::shadowDOMEnabledKey()));
    31993199
     3200    RuntimeEnabledFeatures::sharedFeatures().setInteractiveFormValidationEnabled(store.getBoolValueForKey(WebPreferencesKey::interactiveFormValidationEnabledKey()));
     3201
    32003202    RuntimeEnabledFeatures::sharedFeatures().setDOMIteratorEnabled(store.getBoolValueForKey(WebPreferencesKey::domIteratorEnabledKey()));
    32013203
Note: See TracChangeset for help on using the changeset viewer.