Changeset 269775 in webkit


Ignore:
Timestamp:
Nov 13, 2020 7:30:59 AM (3 years ago)
Author:
Aditya Keerthi
Message:

[iOS][FCR] Add an internal feature flag to enable the new appearance
https://bugs.webkit.org/show_bug.cgi?id=218873
<rdar://problem/71345270>

Reviewed by Tim Horton.

Source/WebCore:

Add a feature flag for the iOS form control refresh, so that the
feature can be tested.

A new user-agent stylesheet is introduced for the refresh so that
the new styles can be opted in to at runtime. Only styles which
differ from the existing stylesheet will be added to the new one.

  • DerivedSources-input.xcfilelist:
  • DerivedSources.make:
  • WebCore.xcodeproj/project.pbxproj:
  • css/iOSFormControlRefresh.css: Added.
  • style/InspectorCSSOMWrappers.cpp:

(WebCore::Style::InspectorCSSOMWrappers::collectDocumentWrappers):

  • style/UserAgentStyle.cpp:

(WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement):

  • style/UserAgentStyle.h:

Source/WTF:

Enable the feature at build time on PLATFORM(IOS_FAMILY) and disable
the feature at runtime.

  • Scripts/Preferences/WebPreferencesInternal.yaml:
  • wtf/PlatformEnable.h:
  • wtf/PlatformEnableCocoa.h:
Location:
trunk/Source
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r269764 r269775  
     12020-11-13  Aditya Keerthi  <akeerthi@apple.com>
     2
     3        [iOS][FCR] Add an internal feature flag to enable the new appearance
     4        https://bugs.webkit.org/show_bug.cgi?id=218873
     5        <rdar://problem/71345270>
     6
     7        Reviewed by Tim Horton.
     8
     9        Enable the feature at build time on PLATFORM(IOS_FAMILY) and disable
     10        the feature at runtime.
     11
     12        * Scripts/Preferences/WebPreferencesInternal.yaml:
     13        * wtf/PlatformEnable.h:
     14        * wtf/PlatformEnableCocoa.h:
     15
    1162020-11-12  Youenn Fablet  <youenn@apple.com>
    217
  • trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml

    r269416 r269775  
    307307      default: true
    308308
     309IOSFormControlRefreshEnabled:
     310  type: bool
     311  humanReadableName: "iOS Form Control Refresh"
     312  humanReadableDescription: "Enable the new appearance for form controls on iOS"
     313  condition: ENABLE(IOS_FORM_CONTROL_REFRESH)
     314  defaultValue:
     315    WebKitLegacy:
     316      default: false
     317    WebKit:
     318      default: false
     319    WebCore:
     320      default: false
     321
    309322IPCTestingAPIEnabled:
    310323  type: bool
  • trunk/Source/WTF/wtf/PlatformEnable.h

    r269574 r269775  
    312312#endif
    313313
     314#if !defined(ENABLE_IOS_FORM_CONTROL_REFRESH)
     315#define ENABLE_IOS_FORM_CONTROL_REFRESH 0
     316#endif
     317
    314318#if !defined(ENABLE_IPC_TESTING_API)
    315319/* Enable IPC testing on all ASAN builds and debug builds. */
  • trunk/Source/WTF/wtf/PlatformEnableCocoa.h

    r269584 r269775  
    285285#endif
    286286
     287#if !defined(ENABLE_IOS_FORM_CONTROL_REFRESH) && PLATFORM(IOS_FAMILY)
     288#define ENABLE_IOS_FORM_CONTROL_REFRESH 1
     289#endif
     290
    287291#if !defined(ENABLE_IOS_GESTURE_EVENTS) && PLATFORM(IOS_FAMILY) && USE(APPLE_INTERNAL_SDK)
    288292#define ENABLE_IOS_GESTURE_EVENTS 1
  • trunk/Source/WebCore/ChangeLog

    r269774 r269775  
     12020-11-13  Aditya Keerthi  <akeerthi@apple.com>
     2
     3        [iOS][FCR] Add an internal feature flag to enable the new appearance
     4        https://bugs.webkit.org/show_bug.cgi?id=218873
     5        <rdar://problem/71345270>
     6
     7        Reviewed by Tim Horton.
     8
     9        Add a feature flag for the iOS form control refresh, so that the
     10        feature can be tested.
     11
     12        A new user-agent stylesheet is introduced for the refresh so that
     13        the new styles can be opted in to at runtime. Only styles which
     14        differ from the existing stylesheet will be added to the new one.
     15
     16        * DerivedSources-input.xcfilelist:
     17        * DerivedSources.make:
     18        * WebCore.xcodeproj/project.pbxproj:
     19        * css/iOSFormControlRefresh.css: Added.
     20        * style/InspectorCSSOMWrappers.cpp:
     21        (WebCore::Style::InspectorCSSOMWrappers::collectDocumentWrappers):
     22        * style/UserAgentStyle.cpp:
     23        (WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement):
     24        * style/UserAgentStyle.h:
     25
    1262020-11-13  Antoine Quint  <graouts@webkit.org>
    227
  • trunk/Source/WebCore/DerivedSources-input.xcfilelist

    r269764 r269775  
    676676$(PROJECT_DIR)/css/fullscreen.css
    677677$(PROJECT_DIR)/css/html.css
     678$(PROJECT_DIR)/css/iOSFormControlRefresh.css
    678679$(PROJECT_DIR)/css/make-css-file-arrays.pl
    679680$(PROJECT_DIR)/css/makeSelectorPseudoClassAndCompatibilityElementMap.py
  • trunk/Source/WebCore/DerivedSources.make

    r269764 r269775  
    14991499    $(WebCore)/css/fullscreen.css \
    15001500    $(WebCore)/css/html.css \
     1501    $(WebCore)/css/iOSFormControlRefresh.css \
    15011502    $(WebCore)/css/mathml.css \
    15021503    $(WebCore)/css/mediaControls.css \
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r269764 r269775  
    1627716277                E52EFDF22112875A00AD282A /* InputMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InputMode.h; sourceTree = "<group>"; };
    1627816278                E52EFDF32112875A00AD282A /* InputMode.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InputMode.cpp; sourceTree = "<group>"; };
     16279                E54CA6DD255DE2D500F901A3 /* iOSFormControlRefresh.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = iOSFormControlRefresh.css; sourceTree = "<group>"; };
    1627916280                E55F4979151B888000BB67DB /* LengthFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LengthFunctions.cpp; sourceTree = "<group>"; };
    1628016281                E58B45B820AD07DD00991025 /* DataListButtonElement.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DataListButtonElement.h; sourceTree = "<group>"; };
     
    2922129222                                CD4E0AFA11F7BC27009D3811 /* fullscreen.css */,
    2922229223                                93CA4C9909DF93FA00DF8677 /* html.css */,
     29224                                E54CA6DD255DE2D500F901A3 /* iOSFormControlRefresh.css */,
    2922329225                                E55F4979151B888000BB67DB /* LengthFunctions.cpp */,
    2922429226                                E5BA7D62151437CA00FE1E3F /* LengthFunctions.h */,
  • trunk/Source/WebCore/style/InspectorCSSOMWrappers.cpp

    r254186 r269775  
    119119        collectFromStyleSheetContents(UserAgentStyle::colorInputStyleSheet);
    120120#endif
     121#if ENABLE(IOS_FORM_CONTROL_REFRESH)
     122        collectFromStyleSheetContents(UserAgentStyle::iOSFormControlRefreshStyleSheet);
     123#endif
    121124        collectFromStyleSheetContents(UserAgentStyle::plugInsStyleSheet);
    122125        collectFromStyleSheetContents(UserAgentStyle::mediaQueryStyleSheet);
  • trunk/Source/WebCore/style/UserAgentStyle.cpp

    r267773 r269775  
    8585StyleSheetContents* UserAgentStyle::colorInputStyleSheet;
    8686#endif
     87#if ENABLE(IOS_FORM_CONTROL_REFRESH)
     88StyleSheetContents* UserAgentStyle::iOSFormControlRefreshStyleSheet;
     89#endif
    8790
    8891#if PLATFORM(IOS_FAMILY)
     
    297300#endif // ENABLE(FULLSCREEN_API)
    298301
     302#if ENABLE(IOS_FORM_CONTROL_REFRESH)
     303    if (!iOSFormControlRefreshStyleSheet && element.document().settings().iOSFormControlRefreshEnabled()) {
     304        iOSFormControlRefreshStyleSheet = parseUASheet(iOSFormControlRefreshUserAgentStyleSheet, sizeof(iOSFormControlRefreshUserAgentStyleSheet));
     305        addToDefaultStyle(*iOSFormControlRefreshStyleSheet);
     306    }
     307#endif
     308
    299309    ASSERT(defaultStyle->features().idsInRules.isEmpty());
    300310    ASSERT(mathMLStyleSheet || defaultStyle->features().siblingRules.isEmpty());
  • trunk/Source/WebCore/style/UserAgentStyle.h

    r267701 r269775  
    5555    static StyleSheetContents* colorInputStyleSheet;
    5656#endif
     57#if ENABLE(IOS_FORM_CONTROL_REFRESH)
     58    static StyleSheetContents* iOSFormControlRefreshStyleSheet;
     59#endif
    5760
    5861    static StyleSheetContents* mediaQueryStyleSheet;
Note: See TracChangeset for help on using the changeset viewer.