Skip to content

Commit

Permalink
[GPU Process] [FormControls] Add a ControlPart for TextField
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=249573
rdar://103508637

Reviewed by Simon Fraser and Aditya Keerthi.

NSTextFieldCell is used draw a border around the text field. CoreUI is used to
draw a list button if the text field has a data list.

* Source/WebCore/Headers.cmake:
* Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj:
* Source/WebCore/PAL/pal/spi/mac/NSTextFieldCellSPI.h: Added.
* Source/WebCore/SourcesCocoa.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/graphics/controls/ControlFactory.h:
* Source/WebCore/platform/graphics/controls/ControlPart.h:
* Source/WebCore/platform/graphics/controls/ControlStyle.cpp:
(WebCore::operator<<):
* Source/WebCore/platform/graphics/controls/ControlStyle.h:
* Source/WebCore/platform/graphics/controls/TextFieldPart.h: Copied from Source/WebCore/platform/graphics/controls/ControlFactory.h.
(WebCore::TextFieldPart::create):
(WebCore::TextFieldPart::TextFieldPart):
* Source/WebCore/platform/graphics/mac/controls/ControlFactoryMac.h:
* Source/WebCore/platform/graphics/mac/controls/ControlFactoryMac.mm:
(WebCore::ControlFactoryMac::levelIndicatorCell const):
(WebCore::ControlFactoryMac::textFieldCell const):
(WebCore::ControlFactoryMac::createPlatformTextField):
* Source/WebCore/platform/graphics/mac/controls/ControlMac.h:
* Source/WebCore/platform/graphics/mac/controls/ControlMac.mm:
(WebCore::ControlMac::userPrefersContrast):
(WebCore::drawCellOrFocusRing):
(WebCore::ControlMac::drawCell):
(WebCore::ControlMac::drawListButton):
(WebCore::ControlMac::draw): Deleted.
* Source/WebCore/platform/graphics/mac/controls/MeterMac.mm:
(WebCore::MeterMac::draw):
* Source/WebCore/platform/graphics/mac/controls/TextFieldMac.h: Copied from Source/WebCore/platform/graphics/controls/ControlFactory.h.
* Source/WebCore/platform/graphics/mac/controls/TextFieldMac.mm: Added.
(WebCore::TextFieldMac::TextFieldMac):
(WebCore::TextFieldMac::shouldPaintCustomTextField):
(WebCore::TextFieldMac::draw):
* Source/WebCore/platform/graphics/mac/controls/WebControlView.h:
* Source/WebCore/platform/graphics/mac/controls/WebControlView.mm:
(-[WebControlTextFieldCell _adjustedCoreUIDrawOptionsForDrawingBordersOnly:]):
(-[WebControlTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:]):
(-[WebControlTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:maskOnly:]):
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::ensureControlPartForRenderer):
(WebCore::RenderBox::ensureControlPartForBorderOnly):
(WebCore::RenderBox::paintBoxDecorations):
(WebCore::RenderBox::ensureControlPart): Deleted.
* Source/WebCore/rendering/RenderBox.h:
* Source/WebCore/rendering/RenderTheme.cpp:
(WebCore::RenderTheme::createControlPart const):
(WebCore::RenderTheme::extractControlStyleStatesForRenderer const):
(WebCore::RenderTheme::hasListButton const):
(WebCore::RenderTheme::hasListButtonPressed const):
(WebCore::RenderTheme::createControlPartForRenderer const): Deleted.
* Source/WebCore/rendering/RenderTheme.h:
(WebCore::RenderTheme::canCreateControlPartForBorderOnly const):
* Source/WebCore/rendering/RenderThemeMac.h:
* Source/WebCore/rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::canPaint const):
(WebCore::RenderThemeMac::canCreateControlPartForBorderOnly const):
(WebCore::RenderThemeMac::meterSizeForBounds const):
(WebCore::RenderThemeMac::shouldPaintCustomTextField const): Deleted.
(WebCore::RenderThemeMac::paintTextField): Deleted.
(WebCore::RenderThemeMac::textField const): Deleted.
* Source/WebKit/Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ControlPart>::decode):
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:

Canonical link: https://commits.webkit.org/258125@main
  • Loading branch information
shallawa authored and Said Abou-Hallawa committed Dec 20, 2022
1 parent f68cfcc commit 8209e22
Show file tree
Hide file tree
Showing 27 changed files with 499 additions and 102 deletions.
1 change: 1 addition & 0 deletions Source/WebCore/Headers.cmake
Expand Up @@ -1740,6 +1740,7 @@ set(WebCore_PRIVATE_FRAMEWORK_HEADERS
platform/graphics/controls/ControlStyle.h
platform/graphics/controls/MeterPart.h
platform/graphics/controls/PlatformControl.h
platform/graphics/controls/TextFieldPart.h

platform/graphics/displaylists/DisplayList.h
platform/graphics/displaylists/DisplayListDrawingContext.h
Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj
Expand Up @@ -935,6 +935,7 @@
5CB898B1286274FA00CA3485 /* QuarantineSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuarantineSPI.h; sourceTree = "<group>"; };
63E369F921AFA83F001C14BC /* NSProgressSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSProgressSPI.h; sourceTree = "<group>"; };
71B1141F26823ACD004D6701 /* SystemPreviewSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SystemPreviewSPI.h; sourceTree = "<group>"; };
72BA2A872951462500678507 /* NSTextFieldCellSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSTextFieldCellSPI.h; sourceTree = "<group>"; };
7A36D0F8223AD9AB00B0522E /* CommonCryptoSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonCryptoSPI.h; sourceTree = "<group>"; };
7A3A6A7F20CADB4600317AAE /* NSImageSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSImageSPI.h; sourceTree = "<group>"; };
7B47F2A128587B9700E793C8 /* CoreGraphicsSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreGraphicsSoftLink.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1210,6 +1211,7 @@
0C77857F1F45130F00F4EBB6 /* NSSharingServicePickerSPI.h */,
0C7785801F45130F00F4EBB6 /* NSSharingServiceSPI.h */,
0C7785811F45130F00F4EBB6 /* NSSpellCheckerSPI.h */,
72BA2A872951462500678507 /* NSTextFieldCellSPI.h */,
0C7785821F45130F00F4EBB6 /* NSTextFinderSPI.h */,
93DB7D3624626BCC004BD8A3 /* NSTextInputContextSPI.h */,
93DB7D3924626F86004BD8A3 /* NSUndoManagerSPI.h */,
Expand Down
33 changes: 33 additions & 0 deletions Source/WebCore/PAL/pal/spi/mac/NSTextFieldCellSPI.h
@@ -0,0 +1,33 @@
/*
* Copyright (C) 2022 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/

#pragma once

#import <AppKit/NSTextFieldCell.h>

@interface NSTextFieldCell ()
- (CFDictionaryRef)_coreUIDrawOptionsWithFrame:(NSRect)cellFrame inView:(NSView *)controlView includeFocus:(BOOL)includeFocus;
- (CFDictionaryRef)_coreUIDrawOptionsWithFrame:(NSRect)cellFrame inView:(NSView *)controlView includeFocus:(BOOL)includeFocus maskOnly:(BOOL)maskOnly;
@end
1 change: 1 addition & 0 deletions Source/WebCore/SourcesCocoa.txt
Expand Up @@ -465,6 +465,7 @@ platform/graphics/mac/WebLayer.mm
platform/graphics/mac/controls/ControlFactoryMac.mm
platform/graphics/mac/controls/ControlMac.mm
platform/graphics/mac/controls/MeterMac.mm
platform/graphics/mac/controls/TextFieldMac.mm
platform/graphics/mac/controls/WebControlView.mm
platform/graphics/opentype/OpenTypeCG.cpp
platform/image-decoders/avif/AVIFImageDecoder.cpp
Expand Down
8 changes: 8 additions & 0 deletions Source/WebCore/WebCore.xcodeproj/project.pbxproj
Expand Up @@ -2482,6 +2482,7 @@
72A645262949158000C14BA3 /* ControlFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 722623C029486B28006DCCF1 /* ControlFactory.h */; settings = {ATTRIBUTES = (Private, ); }; };
72A73BEF245A3F90001C9D03 /* AnimationFrameRate.h in Headers */ = {isa = PBXBuildFile; fileRef = 722A815C238FD50500C00583 /* AnimationFrameRate.h */; settings = {ATTRIBUTES = (Private, ); }; };
72ACC9C627629A7700D523F7 /* SVGPreserveAspectRatioValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C8F22461DD3D1C500E92DA3 /* SVGPreserveAspectRatioValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
72B2213129502059002B5609 /* TextFieldPart.h in Headers */ = {isa = PBXBuildFile; fileRef = 72B2212E295015BB002B5609 /* TextFieldPart.h */; settings = {ATTRIBUTES = (Private, ); }; };
72B8B0352753438600F752AA /* FilterFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 7262D756272A174100C56A09 /* FilterFunction.h */; settings = {ATTRIBUTES = (Private, ); }; };
72B8B0362753441400F752AA /* FilterImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 72435EF4273D07670005E7EE /* FilterImage.h */; settings = {ATTRIBUTES = (Private, ); }; };
72BAC3AE23E1F0B0008D741C /* ImageBufferBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = 72BAC3A523E17328008D741C /* ImageBufferBackend.h */; settings = {ATTRIBUTES = (Private, ); }; };
Expand Down Expand Up @@ -11912,6 +11913,9 @@
72A13AD7274DE57800E2A88E /* SourceGraphicSoftwareApplier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SourceGraphicSoftwareApplier.h; sourceTree = "<group>"; };
72A6451F2948F25900C14BA3 /* WebControlView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebControlView.h; sourceTree = "<group>"; };
72A645A4294FCDC600C14BA3 /* ControlStyle.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ControlStyle.cpp; sourceTree = "<group>"; };
72B2212E295015BB002B5609 /* TextFieldPart.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TextFieldPart.h; sourceTree = "<group>"; };
72B2212F295015D5002B5609 /* TextFieldMac.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = TextFieldMac.mm; sourceTree = "<group>"; };
72B22130295015D5002B5609 /* TextFieldMac.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TextFieldMac.h; sourceTree = "<group>"; };
72B4EF74274E233300293C2F /* FEBlendSoftwareApplier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FEBlendSoftwareApplier.h; sourceTree = "<group>"; };
72B4EF75274E233400293C2F /* FEBlendSoftwareApplier.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FEBlendSoftwareApplier.cpp; sourceTree = "<group>"; };
72B4EF7C274EE37F00293C2F /* FilterImageVector.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FilterImageVector.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -25871,6 +25875,8 @@
722623C629486C32006DCCF1 /* ControlMac.mm */,
722623CB29486C8F006DCCF1 /* MeterMac.h */,
722623CA29486C8F006DCCF1 /* MeterMac.mm */,
72B22130295015D5002B5609 /* TextFieldMac.h */,
72B2212F295015D5002B5609 /* TextFieldMac.mm */,
72A6451F2948F25900C14BA3 /* WebControlView.h */,
722623D02948EEF4006DCCF1 /* WebControlView.mm */,
);
Expand All @@ -25891,6 +25897,7 @@
722623C329486B6A006DCCF1 /* MeterPart.cpp */,
722623C429486B6A006DCCF1 /* MeterPart.h */,
722623CC29486CC8006DCCF1 /* PlatformControl.h */,
72B2212E295015BB002B5609 /* TextFieldPart.h */,
);
path = controls;
sourceTree = "<group>";
Expand Down Expand Up @@ -39247,6 +39254,7 @@
933A14300B7D188600A53FFD /* TextEvent.h in Headers */,
A77B41A012E675A90054343D /* TextEventInputType.h in Headers */,
F55B3DD81251F12D003EF269 /* TextFieldInputType.h in Headers */,
72B2213129502059002B5609 /* TextFieldPart.h in Headers */,
B2C3DA450D006C1D00EF6F26 /* TextFlags.h in Headers */,
93309E18099E64920056E581 /* TextGranularity.h in Headers */,
2D4F96F61A1ECC240098BF88 /* TextIndicator.h in Headers */,
Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/platform/graphics/controls/ControlFactory.h
Expand Up @@ -29,6 +29,7 @@ namespace WebCore {

class MeterPart;
class PlatformControl;
class TextFieldPart;

class ControlFactory {
WTF_MAKE_FAST_ALLOCATED;
Expand All @@ -40,6 +41,7 @@ class ControlFactory {
static ControlFactory& sharedControlFactory();

virtual std::unique_ptr<PlatformControl> createPlatformMeter(MeterPart&) = 0;
virtual std::unique_ptr<PlatformControl> createPlatformTextField(TextFieldPart&) = 0;
};

} // namespace WebCore
4 changes: 2 additions & 2 deletions Source/WebCore/platform/graphics/controls/ControlPart.h
Expand Up @@ -42,14 +42,14 @@ class ControlPart : public RefCounted<ControlPart> {

ControlPartType type() const { return m_type; }

ControlFactory& controlFactory() const;
WEBCORE_EXPORT ControlFactory& controlFactory() const;
void setControlFactory(ControlFactory* controlFactory) { m_controlFactory = controlFactory; }

FloatSize sizeForBounds(const FloatRect& bounds, const ControlStyle&);
void draw(GraphicsContext&, const FloatRect&, float deviceScaleFactor, const ControlStyle&) const;

protected:
ControlPart(ControlPartType);
WEBCORE_EXPORT ControlPart(ControlPartType);

PlatformControl* platformControl() const;
virtual std::unique_ptr<PlatformControl> createPlatformControl() = 0;
Expand Down
9 changes: 9 additions & 0 deletions Source/WebCore/platform/graphics/controls/ControlStyle.cpp
Expand Up @@ -75,6 +75,15 @@ TextStream& operator<<(TextStream& ts, ControlStyle::State state)
case ControlStyle::State::LargeControls:
ts << "large-controls";
break;
case ControlStyle::State::ReadOnly:
ts << "read-only";
break;
case ControlStyle::State::ListButton:
ts << "list-button";
break;
case ControlStyle::State::ListButtonPressed:
ts << "list-button-pressed";
break;
}
return ts;
}
Expand Down
5 changes: 4 additions & 1 deletion Source/WebCore/platform/graphics/controls/ControlStyle.h
Expand Up @@ -34,7 +34,7 @@ class TextStream;
namespace WebCore {

struct ControlStyle {
enum class State : uint16_t {
enum class State {
Hovered = 1 << 0,
Pressed = 1 << 1,
Focused = 1 << 2,
Expand All @@ -49,6 +49,9 @@ struct ControlStyle {
DarkAppearance = 1 << 11,
RightToLeft = 1 << 12,
LargeControls = 1 << 13,
ReadOnly = 1 << 14,
ListButton = 1 << 15,
ListButtonPressed = 1 << 16,
};
OptionSet<State> states;
unsigned fontSize { 12 };
Expand Down
52 changes: 52 additions & 0 deletions Source/WebCore/platform/graphics/controls/TextFieldPart.h
@@ -0,0 +1,52 @@
/*
* Copyright (C) 2022 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#pragma once

#include "ControlFactory.h"
#include "ControlPart.h"

namespace WebCore {

class TextFieldPart : public ControlPart {
public:
static Ref<TextFieldPart> create()
{
return adoptRef(*new TextFieldPart());
}

private:
TextFieldPart()
: ControlPart(ControlPartType::TextField)
{
}

std::unique_ptr<PlatformControl> createPlatformControl() override
{
return controlFactory().createPlatformTextField(*this);
}
};

} // namespace WebCore
Expand Up @@ -39,12 +39,16 @@ class ControlFactoryMac : public ControlFactory {
NSView *drawingView(const FloatRect&, const ControlStyle&) const;

std::unique_ptr<PlatformControl> createPlatformMeter(MeterPart&) override;
std::unique_ptr<PlatformControl> createPlatformTextField(TextFieldPart&) override;

private:
NSLevelIndicatorCell* levelIndicatorCell() const;
NSTextFieldCell* textFieldCell() const;

mutable RetainPtr<WebControlView> m_drawingView;

mutable RetainPtr<NSLevelIndicatorCell> m_levelIndicatorCell;
mutable RetainPtr<NSTextFieldCell> m_textFieldCell;
};

} // namespace WebCore
Expand Down
26 changes: 26 additions & 0 deletions Source/WebCore/platform/graphics/mac/controls/ControlFactoryMac.mm
Expand Up @@ -29,7 +29,9 @@
#if PLATFORM(MAC)

#import "MeterMac.h"
#import "TextFieldMac.h"
#import <pal/spi/mac/NSViewSPI.h>
#import <wtf/BlockObjCExceptions.h>

namespace WebCore {

Expand Down Expand Up @@ -60,17 +62,41 @@
NSLevelIndicatorCell* ControlFactoryMac::levelIndicatorCell() const
{
if (!m_levelIndicatorCell) {
BEGIN_BLOCK_OBJC_EXCEPTIONS
m_levelIndicatorCell = adoptNS([[NSLevelIndicatorCell alloc] initWithLevelIndicatorStyle:NSLevelIndicatorStyleContinuousCapacity]);
[m_levelIndicatorCell setLevelIndicatorStyle:NSLevelIndicatorStyleContinuousCapacity];
END_BLOCK_OBJC_EXCEPTIONS
}
return m_levelIndicatorCell.get();
}

NSTextFieldCell* ControlFactoryMac::textFieldCell() const
{
if (!m_textFieldCell) {
BEGIN_BLOCK_OBJC_EXCEPTIONS
m_textFieldCell = adoptNS([[WebControlTextFieldCell alloc] initTextCell:@""]);
[m_textFieldCell setBezeled:YES];
[m_textFieldCell setEditable:YES];
[m_textFieldCell setFocusRingType:NSFocusRingTypeExterior];
// Post-Lion, WebCore can be in charge of paintinng the background thanks to
// the workaround in place for <rdar://problem/11385461>, which is implemented
// above as _coreUIDrawOptionsWithFrame.
[m_textFieldCell setDrawsBackground:NO];
END_BLOCK_OBJC_EXCEPTIONS
}
return m_textFieldCell.get();
}

std::unique_ptr<PlatformControl> ControlFactoryMac::createPlatformMeter(MeterPart& part)
{
return makeUnique<MeterMac>(part, *this, levelIndicatorCell());
}

std::unique_ptr<PlatformControl> ControlFactoryMac::createPlatformTextField(TextFieldPart& part)
{
return makeUnique<TextFieldMac>(part, *this, textFieldCell());
}

} // namespace WebCore

#endif // PLATFORM(MAC)
8 changes: 6 additions & 2 deletions Source/WebCore/platform/graphics/mac/controls/ControlMac.h
Expand Up @@ -42,13 +42,17 @@ class ControlMac : public PlatformControl {
ControlMac(ControlPart&, ControlFactoryMac&);

protected:
using PlatformControl::draw;
static bool userPrefersContrast();

void setFocusRingClipRect(const FloatRect& clipBounds) override;

void updateCellStates(const FloatRect&, const ControlStyle&) override;

void draw(GraphicsContext&, const FloatRect&, float deviceScaleFactor, const ControlStyle&, NSCell *, NSView *, bool drawCell = true);
void drawCell(GraphicsContext&, const FloatRect&, float deviceScaleFactor, const ControlStyle&, NSCell *, NSView *, bool drawCell = true);

#if ENABLE(DATALIST_ELEMENT)
void drawListButton(GraphicsContext&, const FloatRect&, float deviceScaleFactor, const ControlStyle&);
#endif

ControlFactoryMac& m_controlFactory;
};
Expand Down

0 comments on commit 8209e22

Please sign in to comment.