Changeset 234289 in webkit


Ignore:
Timestamp:
Jul 26, 2018 6:37:54 PM (6 years ago)
Author:
Ryan Haddad
Message:

Unreviewed, rolling out r234281.

Broke internal builds.

Reverted changeset:

"[Datalist] Add button to TextFieldInputs with a datalist"
https://bugs.webkit.org/show_bug.cgi?id=187741
https://trac.webkit.org/changeset/234281

Location:
trunk
Files:
7 deleted
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r234281 r234289  
     12018-07-26  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r234281.
     4
     5        Broke internal builds.
     6
     7        Reverted changeset:
     8
     9        "[Datalist] Add button to TextFieldInputs with a datalist"
     10        https://bugs.webkit.org/show_bug.cgi?id=187741
     11        https://trac.webkit.org/changeset/234281
     12
    1132018-07-26  Aditya Keerthi  <akeerthi@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r234281 r234289  
     12018-07-26  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r234281.
     4
     5        Broke internal builds.
     6
     7        Reverted changeset:
     8
     9        "[Datalist] Add button to TextFieldInputs with a datalist"
     10        https://bugs.webkit.org/show_bug.cgi?id=187741
     11        https://trac.webkit.org/changeset/234281
     12
    1132018-07-26  Aditya Keerthi  <akeerthi@apple.com>
    214
  • trunk/Source/WebCore/PAL/ChangeLog

    r234281 r234289  
     12018-07-26  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r234281.
     4
     5        Broke internal builds.
     6
     7        Reverted changeset:
     8
     9        "[Datalist] Add button to TextFieldInputs with a datalist"
     10        https://bugs.webkit.org/show_bug.cgi?id=187741
     11        https://trac.webkit.org/changeset/234281
     12
    1132018-07-26  Aditya Keerthi  <akeerthi@apple.com>
    214
  • trunk/Source/WebCore/PAL/pal/spi/cocoa/NSColorSPI.h

    r234281 r234289  
    2929
    3030#import <AppKit/NSColor_Private.h>
    31 #import <AppKit/NSColor_UserAccent.h>
    3231
    3332#else
     
    4847@end
    4948
    50 typedef NS_ENUM(NSInteger, NSUserAccentColor) {
    51     NSUserAccentColorRed = 0,
    52     NSUserAccentColorOrange,
    53     NSUserAccentColorYellow,
    54     NSUserAccentColorGreen,
    55     NSUserAccentColorBlue,
    56     NSUserAccentColorPurple,
    57     NSUserAccentColorPink,
    58 
    59     NSUserAccentColorNoColor = -1,
    60 };
    61 
    62 extern "C" NSUserAccentColor NSColorGetUserAccentColor(void);
    63 
    6449#endif
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r234281 r234289  
    47824782                E4E9B11D1814569C003ACCDF /* SimpleLineLayoutFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = E4E9B11C1814569C003ACCDF /* SimpleLineLayoutFunctions.h */; };
    47834783                E4F9EEF3156DA00700D23E7E /* StyleSheetContents.h in Headers */ = {isa = PBXBuildFile; fileRef = E4F9EEF1156D84C400D23E7E /* StyleSheetContents.h */; settings = {ATTRIBUTES = (Private, ); }; };
    4784                 E59DD4B821098287003C8B47 /* ListButtonArrow.png in Resources */ = {isa = PBXBuildFile; fileRef = E59DD4B721098285003C8B47 /* ListButtonArrow.png */; };
    4785                 E516699120FF9918009D2C27 /* ListButtonArrow@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E516698F20FF9916009D2C27 /* ListButtonArrow@2x.png */; };
    47864784                E517670320B88C1400D41167 /* DataListSuggestionInformation.h in Headers */ = {isa = PBXBuildFile; fileRef = E517670220B88C1400D41167 /* DataListSuggestionInformation.h */; settings = {ATTRIBUTES = (Private, ); }; };
    47874785                E52CF54D20A268AC00DADA27 /* DataListSuggestionsClient.h in Headers */ = {isa = PBXBuildFile; fileRef = E52CF54C20A268AC00DADA27 /* DataListSuggestionsClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
    47884786                E52CF54F20A35A2800DADA27 /* DataListSuggestionPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = E52CF54E20A35A2800DADA27 /* DataListSuggestionPicker.h */; settings = {ATTRIBUTES = (Private, ); }; };
    4789                 E58B45BA20AD07DD00991025 /* DataListButtonElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E58B45B820AD07DD00991025 /* DataListButtonElement.h */; };
    4790                 E58B45BB20AD07DD00991025 /* DataListButtonElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E58B45B920AD07DD00991025 /* DataListButtonElement.cpp */; };
    47914787                E5BA7D63151437CA00FE1E3F /* LengthFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = E5BA7D62151437CA00FE1E3F /* LengthFunctions.h */; settings = {ATTRIBUTES = (Private, ); }; };
    47924788                EBF5121C1696496C0056BD25 /* JSTypeConversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EBF5121A1696496C0056BD25 /* JSTypeConversions.cpp */; };
     
    1449414490                E4F9EEF0156D84C400D23E7E /* StyleSheetContents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleSheetContents.cpp; sourceTree = "<group>"; };
    1449514491                E4F9EEF1156D84C400D23E7E /* StyleSheetContents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleSheetContents.h; sourceTree = "<group>"; };
    14496                 E59DD4B721098285003C8B47 /* ListButtonArrow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ListButtonArrow.png; sourceTree = "<group>"; };
    14497                 E516698F20FF9916009D2C27 /* ListButtonArrow@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "ListButtonArrow@2x.png"; sourceTree = "<group>"; };
    1449814492                E517670220B88C1400D41167 /* DataListSuggestionInformation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DataListSuggestionInformation.h; sourceTree = "<group>"; };
    1449914493                E51A81DE17298D7700BFCA61 /* JSPerformance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPerformance.cpp; sourceTree = "<group>"; };
     
    1450214496                E52CF54E20A35A2800DADA27 /* DataListSuggestionPicker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DataListSuggestionPicker.h; sourceTree = "<group>"; };
    1450314497                E55F4979151B888000BB67DB /* LengthFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LengthFunctions.cpp; sourceTree = "<group>"; };
    14504                 E58B45B820AD07DD00991025 /* DataListButtonElement.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DataListButtonElement.h; sourceTree = "<group>"; };
    14505                 E58B45B920AD07DD00991025 /* DataListButtonElement.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DataListButtonElement.cpp; sourceTree = "<group>"; };
    1450614498                E5BA7D62151437CA00FE1E3F /* LengthFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LengthFunctions.h; sourceTree = "<group>"; };
    1450714499                EB081CD81696084400553730 /* TypeConversions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TypeConversions.h; sourceTree = "<group>"; };
     
    1685116843                                7C1E97251A9F9834007BF0FB /* AutoFillButtonElement.cpp */,
    1685216844                                7C1E97261A9F9834007BF0FB /* AutoFillButtonElement.h */,
    16853                                 E58B45B920AD07DD00991025 /* DataListButtonElement.cpp */,
    16854                                 E58B45B820AD07DD00991025 /* DataListButtonElement.h */,
    1685516845                                A7C9ABF61357A3BF00F5503F /* DetailsMarkerControl.cpp */,
    1685616846                                A7C9ABF71357A3BF00F5503F /* DetailsMarkerControl.h */,
     
    1923219222                                D02B64B014089E56006EFA21 /* DictationPhraseWithAlternativesDot.png */,
    1923319223                                D02B64B114089E56006EFA21 /* DictationPhraseWithAlternativesDot@2x.png */,
    19234                                 E59DD4B721098285003C8B47 /* ListButtonArrow.png */,
    19235                                 E516698F20FF9916009D2C27 /* ListButtonArrow@2x.png */,
    1923619224                                BE8C753010681324001E93F5 /* SpellingDot.png */,
    1923719225                                01E6C2E31194B2820050821C /* SpellingDot@2x.png */,
     
    2768027668                                C5227DF11C3C6DF100F5ED54 /* DataDetection.h in Headers */,
    2768127669                                7C7941E51C56C29300A4C58E /* DataDetectorsCoreSoftLink.h in Headers */,
    27682                                 E58B45BA20AD07DD00991025 /* DataListButtonElement.h in Headers */,
    2768327670                                E517670320B88C1400D41167 /* DataListSuggestionInformation.h in Headers */,
    2768427671                                E52CF54F20A35A2800DADA27 /* DataListSuggestionPicker.h in Headers */,
     
    3124431231                                7CC7E3D717208C0F003C5277 /* IDNScriptWhiteList.txt in Resources */,
    3124531232                                2D9F0E1314FF1CBF00BA0FF7 /* linearSRGB.icc in Resources */,
    31246                                 E59DD4B821098287003C8B47 /* ListButtonArrow.png in Resources */,
    31247                                 E516699120FF9918009D2C27 /* ListButtonArrow@2x.png in Resources */,
    3124831233                                BCAD180A131C7A0D00990406 /* Localizable.strings in Resources */,
    3124931234                                837A80131E1E127300026B9F /* Localizable.stringsdict in Resources */,
     
    3148831473                                1ABA76CA11D20E50004C201C /* CSSPropertyNames.cpp in Sources */,
    3148931474                                BE23480C18A9870B00E4B6E8 /* DataCue.cpp in Sources */,
    31490                                 E58B45BB20AD07DD00991025 /* DataListButtonElement.cpp in Sources */,
    3149131475                                515BE18F1D54F5FB00DD7C68 /* EmptyGamepadProvider.cpp in Sources */,
    3149231476                                724ED32C1A3A7E5400F5F13C /* EXTBlendMinMax.cpp in Sources */,
  • trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h

    r234281 r234289  
    620620    case ApplePayButtonPart:
    621621        m_value.valueID = CSSValueApplePayButton;
    622         break;
    623 #endif
    624 #if ENABLE(DATALIST_ELEMENT)
    625     case ListButtonPart:
    626         m_value.valueID = CSSValueListButton;
    627622        break;
    628623#endif
  • trunk/Source/WebCore/css/CSSProperties.json

    r234281 r234289  
    37943794                "attachment",
    37953795                "caps-lock-indicator",
    3796                 "list-button",
    37973796                "none"
    37983797            ],
  • trunk/Source/WebCore/css/CSSValueKeywords.in

    r234281 r234289  
    837837-apple-pay-button
    838838#endif
    839 #if defined(ENABLE_DATALIST_ELEMENT) && ENABLE_DATALIST_ELEMENT
    840 list-button
    841 #endif
    842839textarea
    843840#if defined(ENABLE_ATTACHMENT_ELEMENT) && ENABLE_ATTACHMENT_ELEMENT
  • trunk/Source/WebCore/css/html.css

    r234281 r234289  
    617617}
    618618
    619 #if defined(ENABLE_DATALIST_ELEMENT) && ENABLE_DATALIST_ELEMENT
    620 input::-webkit-list-button {
    621     -webkit-appearance: list-button;
    622     display: block;
    623     position: relative;
    624     cursor: default;
    625     align-self: stretch;
    626     flex: none;
    627     -webkit-user-select: none;
    628     width: 16px;
    629     height: 100%;
    630 }
    631 #endif
    632 
    633619keygen, select {
    634620    border-radius: 5px;
  • trunk/Source/WebCore/html/HTMLInputElement.cpp

    r234281 r234289  
    242242}
    243243
    244 #if ENABLE(DATALIST_ELEMENT)
    245 HTMLElement* HTMLInputElement::dataListButtonElement() const
    246 {
    247     return m_inputType->dataListButtonElement();
    248 }
    249 #endif
    250 
    251244bool HTMLInputElement::shouldAutocomplete() const
    252245{
     
    16361629}
    16371630
    1638 bool HTMLInputElement::isShowingList() const
    1639 {
    1640     return m_inputType->isShowingList();
    1641 }
    1642 
    16431631#endif // ENABLE(DATALIST_ELEMENT)
    16441632
  • trunk/Source/WebCore/html/HTMLInputElement.h

    r234281 r234289  
    149149    HTMLElement* placeholderElement() const final;
    150150    WEBCORE_EXPORT HTMLElement* autoFillButtonElement() const;
    151 #if ENABLE(DATALIST_ELEMENT)
    152     HTMLElement* dataListButtonElement() const;
    153 #endif
    154151
    155152    bool checked() const { return m_isChecked; }
     
    276273    RefPtr<HTMLDataListElement> dataList() const;
    277274    void listAttributeTargetChanged();
    278     bool isShowingList() const;
    279275#endif
    280276
  • trunk/Source/WebCore/html/InputType.h

    r234281 r234289  
    227227    virtual HTMLElement* sliderTrackElement() const { return nullptr; }
    228228    virtual HTMLElement* placeholderElement() const;
    229 #if ENABLE(DATALIST_ELEMENT)
    230     virtual HTMLElement* dataListButtonElement() const { return nullptr; }
    231 #endif
    232229
    233230    // Miscellaneous functions.
     
    294291
    295292#if ENABLE(DATALIST_ELEMENT)
    296     virtual bool isShowingList() const { return false; };
    297293    virtual void listAttributeTargetChanged();
    298294    virtual std::optional<Decimal> findClosestTickMarkValue(const Decimal&);
  • trunk/Source/WebCore/html/TextFieldInputType.cpp

    r234281 r234289  
    286286bool TextFieldInputType::needsContainer() const
    287287{
    288 #if ENABLE(DATALIST_ELEMENT)
    289     return element()->hasAttributeWithoutSynchronization(listAttr);
    290 #endif
    291288    return false;
    292289}
     
    347344
    348345    updateAutoFillButton();
    349 
    350 #if ENABLE(DATALIST_ELEMENT)
    351     m_dataListDropdownIndicator = DataListButtonElement::create(element()->document(), *this);
    352     m_dataListDropdownIndicator->setInlineStyleProperty(CSSPropertyDisplay, CSSValueNone, true);
    353     m_container->appendChild(*m_dataListDropdownIndicator);
    354 #endif
    355346}
    356347
     
    402393    m_capsLockIndicator = nullptr;
    403394    m_autoFillButton = nullptr;
    404 #if ENABLE(DATALIST)
    405     m_dataListDropdownIndicator = nullptr;
    406 #endif
    407395    m_container = nullptr;
    408396}
     
    798786#if ENABLE(DATALIST_ELEMENT)
    799787
    800 void TextFieldInputType::listAttributeTargetChanged()
    801 {
    802     if (!m_dataListDropdownIndicator)
    803         return;
    804 
    805     m_dataListDropdownIndicator->setInlineStyleProperty(CSSPropertyDisplay, element()->list() ? CSSValueBlock : CSSValueNone, true);
    806 }
    807 
    808 HTMLElement* TextFieldInputType::dataListButtonElement() const
    809 {
    810     return m_dataListDropdownIndicator.get();
    811 }
    812 
    813 void TextFieldInputType::dataListButtonElementWasClicked()
    814 {
    815     if (element()->list())
    816         displaySuggestions(DataListSuggestionActivationType::IndicatorClicked);
    817 }
    818 
    819788IntRect TextFieldInputType::elementRectInRootViewCoordinates() const
    820789{
     
    851820{
    852821    m_suggestionPicker = nullptr;
    853     element()->renderer()->repaint();
    854822}
    855823
     
    877845}
    878846
    879 bool TextFieldInputType::isShowingList() const
    880 {
    881     return !!m_suggestionPicker;
    882 }
    883 
    884847#endif
    885848
  • trunk/Source/WebCore/html/TextFieldInputType.h

    r234281 r234289  
    3333
    3434#include "AutoFillButtonElement.h"
    35 #include "DataListButtonElement.h"
    3635#include "DataListSuggestionPicker.h"
    3736#include "DataListSuggestionsClient.h"
     
    4847class TextFieldInputType : public InputType, protected SpinButtonElement::SpinButtonOwner, protected AutoFillButtonElement::AutoFillButtonOwner
    4948#if ENABLE(DATALIST_ELEMENT)
    50     , private DataListSuggestionsClient, protected DataListButtonElement::DataListButtonOwner
     49    , private DataListSuggestionsClient
    5150#endif
    5251{
     
    6665    HTMLElement* capsLockIndicatorElement() const final;
    6766    HTMLElement* autoFillButtonElement() const final;
    68 #if ENABLE(DATALIST_ELEMENT)
    69     HTMLElement* dataListButtonElement() const final;
    70 #endif
    7167
    7268    virtual bool needsContainer() const;
     
    125121
    126122#if ENABLE(DATALIST_ELEMENT)
    127     bool isShowingList() const override;
    128     void listAttributeTargetChanged() final;
    129123    void displaySuggestions(DataListSuggestionActivationType);
    130124    void closeSuggestions();
     
    135129    void didSelectDataListOption(const String&) final;
    136130    void didCloseSuggestions() final;
    137 
    138     void dataListButtonElementWasClicked() final;
    139     RefPtr<DataListButtonElement> m_dataListDropdownIndicator;
    140131
    141132    std::unique_ptr<DataListSuggestionPicker> m_suggestionPicker;
  • trunk/Source/WebCore/platform/ThemeTypes.h

    r234281 r234289  
    5252    ApplePayButtonPart,
    5353#endif
    54 #if ENABLE(DATALIST_ELEMENT)
    55     ListButtonPart,
    56 #endif
    5754    TextAreaPart,
    5855#if ENABLE(ATTACHMENT_ELEMENT)
  • trunk/Source/WebCore/rendering/RenderTheme.cpp

    r234281 r234289  
    266266    case BorderlessAttachmentPart:
    267267        return adjustAttachmentStyle(styleResolver, style, element);
    268 #endif
    269 #if ENABLE(DATALIST_ELEMENT)
    270     case ListButtonPart:
    271         return adjustListButtonStyle(styleResolver, style, element);
    272268#endif
    273269    default:
     
    1003999#if ENABLE(DATALIST_ELEMENT)
    10041000
    1005 void RenderTheme::adjustListButtonStyle(StyleResolver&, RenderStyle&, const Element*) const
    1006 {
    1007 }
    1008 
    10091001LayoutUnit RenderTheme::sliderTickSnappingThreshold() const
    10101002{
  • trunk/Source/WebCore/rendering/RenderTheme.h

    r234281 r234289  
    337337    virtual void adjustAttachmentStyle(StyleResolver&, RenderStyle&, const Element*) const;
    338338    virtual bool paintAttachment(const RenderObject&, const PaintInfo&, const IntRect&);
    339 #endif
    340 
    341 #if ENABLE(DATALIST_ELEMENT)
    342     virtual void adjustListButtonStyle(StyleResolver&, RenderStyle&, const Element*) const;
    343339#endif
    344340
  • trunk/Source/WebCore/rendering/RenderThemeMac.h

    r234281 r234289  
    155155    bool paintSearchFieldResultsButton(const RenderBox&, const PaintInfo&, const IntRect&) final;
    156156
    157 #if ENABLE(DATALIST_ELEMENT)
    158     void paintListButtonForInput(const RenderObject&, GraphicsContext&, const FloatRect&);
    159     void adjustListButtonStyle(StyleResolver&, RenderStyle&, const Element*) const;
    160 #endif
    161 
    162157#if ENABLE(VIDEO)
    163158    bool supportsClosedCaptioning() const final { return true; }
     
    224219    NSSliderCell *sliderThumbVertical() const;
    225220    NSTextFieldCell *textField() const;
    226 #if ENABLE(DATALIST_ELEMENT)
    227     NSCell *listButton() const;
    228 #endif
    229221
    230222#if ENABLE(METER_ELEMENT)
     
    255247    mutable RetainPtr<NSServicesRolloverButtonCell> m_servicesRolloverButton;
    256248#endif
    257 #if ENABLE(DATALIST_ELEMENT)
    258     mutable RetainPtr<NSCell> m_listButton;
    259 #endif
    260249
    261250    bool m_isSliderThumbHorizontalPressed { false };
  • trunk/Source/WebCore/rendering/RenderThemeMac.mm

    r234281 r234289  
    197197@implementation WebCoreRenderThemeBundle
    198198@end
    199 
    200 #if ENABLE(DATALIST_ELEMENT)
    201 
    202 static const CGFloat listButtonWidth = 16.0f;
    203 static const CGFloat listButtonCornerRadius = 5.0f;
    204 
    205 @interface WebListButtonCell : NSCell
    206 @end
    207 
    208 @implementation WebListButtonCell
    209 - (void)drawWithFrame:(NSRect)cellFrame inView:(__unused NSView *)controlView
    210 {
    211     CGFloat listButtonCornerRadius = 5.0f;
    212     NSPoint topLeft = NSMakePoint(NSMinX(cellFrame), NSMinY(cellFrame));
    213     NSPoint topRight = NSMakePoint(NSMaxX(cellFrame), NSMinY(cellFrame));
    214     NSPoint bottomRight = NSMakePoint(NSMaxX(cellFrame), NSMaxY(cellFrame));
    215     NSPoint bottomLeft = NSMakePoint(NSMinX(cellFrame), NSMaxY(cellFrame));
    216 
    217     NSBezierPath *path = [NSBezierPath bezierPath];
    218     [path moveToPoint:topLeft];
    219 
    220     [path lineToPoint:NSMakePoint(topRight.x - listButtonCornerRadius, topRight.y)];
    221     [path curveToPoint:NSMakePoint(topRight.x, topRight.y + listButtonCornerRadius) controlPoint1:topRight controlPoint2:topRight];
    222 
    223     [path lineToPoint:NSMakePoint(bottomRight.x, bottomRight.y - listButtonCornerRadius)];
    224     [path curveToPoint:NSMakePoint(bottomRight.x - listButtonCornerRadius, bottomRight.y) controlPoint1:bottomRight controlPoint2:bottomRight];
    225 
    226     [path lineToPoint:bottomLeft];
    227     [path lineToPoint:topLeft];
    228 
    229     if ([self userInterfaceLayoutDirection] == NSUserInterfaceLayoutDirectionRightToLeft) {
    230         NSAffineTransform *transform = [NSAffineTransform transform];
    231         [transform translateXBy:NSMidX(cellFrame) yBy:NSMidY(cellFrame)];
    232         [transform rotateByDegrees:180];
    233         [transform translateXBy:-1 * NSMidX(cellFrame) yBy:-1 * NSMidY(cellFrame)];
    234         [path transformUsingAffineTransform:transform];
    235     }
    236 
    237     // FIXME: Obtain the gradient colors from CoreUI or AppKit
    238     RetainPtr<NSGradient> gradient;
    239     NSUserAccentColor accentColor = NSColorGetUserAccentColor();
    240     if (accentColor == NSUserAccentColorRed)
    241         gradient = adoptNS([[NSGradient alloc] initWithStartingColor:[NSColor colorWithRed:(212.0 / 255) green:(122.0 / 255) blue:(117.0 / 255) alpha:1.0] endingColor:[NSColor colorWithRed:(189.0 / 255) green:(34.0 / 255) blue:(23.0 / 255) alpha:1.0]]);
    242     else if (accentColor == NSUserAccentColorOrange)
    243         gradient = adoptNS([[NSGradient alloc] initWithStartingColor:[NSColor colorWithRed:(242.0 / 255) green:(185.0 / 255) blue:(113.0 / 255) alpha:1.0] endingColor:[NSColor colorWithRed:(242.0 / 255) green:(145.0 / 255) blue:(17.0 / 255) alpha:1.0]]);
    244     else if (accentColor == NSUserAccentColorYellow)
    245         gradient = adoptNS([[NSGradient alloc] initWithStartingColor:[NSColor colorWithRed:(241.0 / 255) green:(212.0 / 255) blue:(119.0 / 255) alpha:1.0] endingColor:[NSColor colorWithRed:(239.0 / 255) green:(193.0 / 255) blue:(27.0 / 255) alpha:1.0]]);
    246     else if (accentColor == NSUserAccentColorGreen)
    247         gradient = adoptNS([[NSGradient alloc] initWithStartingColor:[NSColor colorWithRed:(132.0 / 255) green:(186.0 / 255) blue:(120.0 / 255) alpha:1.0] endingColor:[NSColor colorWithRed:(46.0 / 255) green:(145.0 / 255) blue:(30.0 / 255) alpha:1.0]]);
    248     else if (accentColor == NSUserAccentColorPurple)
    249         gradient = adoptNS([[NSGradient alloc] initWithStartingColor:[NSColor colorWithRed:(178.0 / 255) green:(128.0 / 255) blue:(175.0 / 255) alpha:1.0] endingColor:[NSColor colorWithRed:(130.0 / 255) green:(43.0 / 255) blue:(123.0 / 255) alpha:1.0]]);
    250     else if (accentColor == NSUserAccentColorPink)
    251         gradient = adoptNS([[NSGradient alloc] initWithStartingColor:[NSColor colorWithRed:(225.0 / 255) green:(126.0 / 255) blue:(165.0 / 255) alpha:1.0] endingColor:[NSColor colorWithRed:(211.0 / 255) green:(42.0 / 255) blue:(105.0 / 255) alpha:1.0]]);
    252     else if (accentColor == NSUserAccentColorNoColor)
    253         gradient = adoptNS([[NSGradient alloc] initWithStartingColor:[NSColor colorWithRed:(177.0 / 255) green:(177.0 / 255) blue:(182.0 / 255) alpha:1.0] endingColor:[NSColor colorWithRed:(145.0 / 255) green:(145.0 / 255) blue:(150.0 / 255) alpha:1.0]]);
    254     else
    255         gradient = adoptNS([[NSGradient alloc] initWithStartingColor:[NSColor colorWithRed:(114.0 / 255) green:(164.0 / 255) blue:(243.0 / 255) alpha:1.0] endingColor:[NSColor colorWithRed:(45.0 / 255) green:(117.0 / 255) blue:(246.0 / 255) alpha:1.0]]);
    256 
    257     [gradient drawInBezierPath:path angle:90];
    258     if ([self isHighlighted]) {
    259         NSColor *overlay = [NSColor colorWithWhite:0 alpha:0.1];
    260         [overlay setFill];
    261         [path fill];
    262     }
    263 }
    264 @end
    265 
    266 #endif // ENABLE(DATALIST_ELEMENT)
    267199
    268200namespace WebCore {
     
    10741006}
    10751007
    1076 #if ENABLE(DATALIST_ELEMENT)
    1077 
    1078 void RenderThemeMac::paintListButtonForInput(const RenderObject& o, GraphicsContext& context, const FloatRect& r)
    1079 {
    1080     // We can't paint an NSComboBoxCell since they are not height-resizable.
    1081     const auto& input = downcast<HTMLInputElement>(*(o.generatingNode()));
    1082     NSCell *listButton = this->listButton();
    1083 
    1084     NSRect listButtonFrame = NSMakeRect(r.maxX() - listButtonWidth, r.y(), listButtonWidth, r.height());
    1085     if (!o.style().isLeftToRightDirection()) {
    1086         listButtonFrame.origin.x = r.x();
    1087         [listButton setUserInterfaceLayoutDirection:NSUserInterfaceLayoutDirectionRightToLeft];
    1088     } else
    1089         [listButton setUserInterfaceLayoutDirection:NSUserInterfaceLayoutDirectionLeftToRight];
    1090 
    1091     [listButton setHighlighted:input.isShowingList()];
    1092     if (!input.isShowingList())
    1093         updatePressedState(listButton, *(input.dataListButtonElement()->renderer()));
    1094 
    1095     [listButton drawWithFrame:listButtonFrame inView:documentViewFor(o)];
    1096     [listButton setControlView:nil];
    1097 
    1098     RefPtr<Image> image;
    1099     float imageScale = 1;
    1100     if (o.document().deviceScaleFactor() >= 2) {
    1101         image = Image::loadPlatformResource("ListButtonArrow@2x");
    1102         imageScale = 2;
    1103     } else
    1104         image = Image::loadPlatformResource("ListButtonArrow");
    1105 
    1106     FloatRect imageRect(0, 0, image->width() / imageScale, image->height() / imageScale);
    1107     imageRect.setX(NSMidX(listButtonFrame) - imageRect.width() / 2);
    1108     imageRect.setY(NSMidY(listButtonFrame) - imageRect.height() / 2);
    1109 
    1110     context.drawImage(*image, imageRect);
    1111 }
    1112 
    1113 void RenderThemeMac::adjustListButtonStyle(StyleResolver&, RenderStyle& style, const Element*) const
    1114 {
    1115     // Add a margin to place the button at end of the input field.
    1116     if (style.isLeftToRightDirection())
    1117         style.setMarginRight(Length(-4, Fixed));
    1118     else
    1119         style.setMarginLeft(Length(-4, Fixed));
    1120 }
    1121 
    1122 #endif
    1123 
    11241008bool RenderThemeMac::paintTextField(const RenderObject& o, const PaintInfo& paintInfo, const FloatRect& r)
    11251009{
     
    11471031
    11481032    [textField setControlView:nil];
    1149 
    1150 #if ENABLE(DATALIST_ELEMENT)
    1151     if (!is<HTMLInputElement>(o.generatingNode()))
    1152         return false;
    1153 
    1154     const auto& input = downcast<HTMLInputElement>(*(o.generatingNode()));
    1155     if (input.list())
    1156         paintListButtonForInput(o, paintInfo.context(), adjustedPaintRect);
    1157 #endif
    11581033
    11591034    return false;
     
    19141789    [search resetSearchButtonCell];
    19151790
    1916 #if ENABLE(DATALIST_ELEMENT)
    1917     if (!is<HTMLInputElement>(o.generatingNode()))
    1918         return false;
    1919 
    1920     const auto& input = downcast<HTMLInputElement>(*(o.generatingNode()));
    1921     if (input.list())
    1922         paintListButtonForInput(o, paintInfo.context(), FloatRect(unzoomedRect.x(), unzoomedRect.y() + 1, unzoomedRect.width(), unzoomedRect.height() - 2));
    1923 #endif
    1924 
    19251791    return false;
    19261792}
     
    20251891
    20261892    FloatRect localBounds = adjustedCancelButtonRect([search cancelButtonRectForBounds:NSRect(snappedIntRect(inputBox.contentBoxRect()))]);
    2027 
    20281893    // Adjust position based on the content direction.
    20291894    float adjustedXPosition;
    2030 
    2031     if (is<HTMLInputElement>(*input)) {
    2032         RenderBox* cancelButtonBox = downcast<RenderBox>(downcast<HTMLInputElement>(*input).cancelButtonElement()->renderer());
    2033         // The cancel button won't always be the rightmost element
    2034         adjustedXPosition = inputBox.contentBoxRect().x() + (cancelButtonBox->absoluteContentBox().x() - inputBox.absoluteContentBox().x());
    2035     } else {
    2036         if (box.style().direction() == RTL)
    2037             adjustedXPosition = inputBox.contentBoxRect().x();
    2038         else
    2039             adjustedXPosition = inputBox.contentBoxRect().maxX() - localBounds.size().width();
    2040     }
    2041 
     1895    if (box.style().direction() == RTL)
     1896        adjustedXPosition = inputBox.contentBoxRect().x();
     1897    else
     1898        adjustedXPosition = inputBox.contentBoxRect().maxX() - localBounds.size().width();
     1899   
    20421900    localBounds.setX(adjustedXPosition);
    20431901    FloatPoint paintingPos = convertToPaintingPosition(inputBox, box, localBounds.location(), r.location());
     
    23702228}
    23712229
    2372 #if ENABLE(DATALIST_ELEMENT)
    2373 NSCell *RenderThemeMac::listButton() const
    2374 {
    2375     if (!m_listButton)
    2376         m_listButton = adoptNS([[WebListButtonCell alloc] init]);
    2377 
    2378     return m_listButton.get();
    2379 }
    2380 #endif
    2381 
    23822230String RenderThemeMac::fileListNameForWidth(const FileList* fileList, const FontCascade& font, int width, bool multipleFilesAllowed) const
    23832231{
  • trunk/Source/WebInspectorUI/ChangeLog

    r234281 r234289  
     12018-07-26  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r234281.
     4
     5        Broke internal builds.
     6
     7        Reverted changeset:
     8
     9        "[Datalist] Add button to TextFieldInputs with a datalist"
     10        https://bugs.webkit.org/show_bug.cgi?id=187741
     11        https://trac.webkit.org/changeset/234281
     12
    1132018-07-26  Aditya Keerthi  <akeerthi@apple.com>
    214
  • trunk/Source/WebInspectorUI/UserInterface/External/CodeMirror/css.js

    r234281 r234289  
    627627    "korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal",
    628628    "landscape", "lao", "large", "larger", "left", "level", "lighter", "lighten",
    629     "line-through", "linear", "linear-gradient", "lines", "list-item", "listbox", "list-button", "listitem",
     629    "line-through", "linear", "linear-gradient", "lines", "list-item", "listbox", "listitem",
    630630    "local", "logical", "loud", "lower", "lower-alpha", "lower-armenian",
    631631    "lower-greek", "lower-hexadecimal", "lower-latin", "lower-norwegian",
  • trunk/Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js

    r234281 r234289  
    10411041    /*
    10421042    "-webkit-appearance": [
    1043         "none", "checkbox", "radio", "push-button", "square-button", "button", "button-bevel", "default-button", "inner-spin-button", "listbox", "listitem", "media-enter-fullscreen-button", "media-exit-fullscreen-button", "media-fullscreen-volume-slider", "media-fullscreen-volume-slider-thumb", "media-mute-button", "media-play-button", "media-overlay-play-button", "media-seek-back-button", "media-seek-forward-button", "media-rewind-button", "media-return-to-realtime-button", "media-toggle-closed-captions-button", "media-slider", "media-sliderthumb", "media-volume-slider-container", "media-volume-slider", "media-volume-sliderthumb", "media-volume-slider-mute-button", "media-controls-background", "media-controls-fullscreen-background", "media-current-time-display", "media-time-remaining-display", "menulist", "menulist-button", "menulist-text", "menulist-textfield", "meter", "progress-bar", "progress-bar-value", "slider-horizontal", "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "caret", "searchfield", "searchfield-decoration", "searchfield-results-decoration", "searchfield-results-button", "searchfield-cancel-button", "snapshotted-plugin-overlay", "textfield", "relevancy-level-indicator", "continuous-capacity-level-indicator", "discrete-capacity-level-indicator", "rating-level-indicator", "textarea", "attachment", "caps-lock-indicator", "list-button"
     1043        "none", "checkbox", "radio", "push-button", "square-button", "button", "button-bevel", "default-button", "inner-spin-button", "listbox", "listitem", "media-enter-fullscreen-button", "media-exit-fullscreen-button", "media-fullscreen-volume-slider", "media-fullscreen-volume-slider-thumb", "media-mute-button", "media-play-button", "media-overlay-play-button", "media-seek-back-button", "media-seek-forward-button", "media-rewind-button", "media-return-to-realtime-button", "media-toggle-closed-captions-button", "media-slider", "media-sliderthumb", "media-volume-slider-container", "media-volume-slider", "media-volume-sliderthumb", "media-volume-slider-mute-button", "media-controls-background", "media-controls-fullscreen-background", "media-current-time-display", "media-time-remaining-display", "menulist", "menulist-button", "menulist-text", "menulist-textfield", "meter", "progress-bar", "progress-bar-value", "slider-horizontal", "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "caret", "searchfield", "searchfield-decoration", "searchfield-results-decoration", "searchfield-results-button", "searchfield-cancel-button", "snapshotted-plugin-overlay", "textfield", "relevancy-level-indicator", "continuous-capacity-level-indicator", "discrete-capacity-level-indicator", "rating-level-indicator", "textarea", "attachment", "caps-lock-indicator"
    10441044    ],
    10451045    */
Note: See TracChangeset for help on using the changeset viewer.