Source/WebCore/ChangeLog

 12018-06-19 Timothy Hatcher <timothy@apple.com>
 2
 3 Corner of two scroll bars is white with dark mode enabled.
 4
 5 https://bugs.webkit.org/show_bug.cgi?id=186819
 6 rdar://problem/40434350
 7
 8 Reviewed by NOBODY (OOPS!).
 9
 10 Pass useSystemAppearance and defaultAppearance down through Widget drawing
 11 so we can paint the scrollbars with the right appearance.
 12
 13 Start drawing the scrollbar corner with CoreUI, so we can get the right appearance,
 14 even in light mode -- instead of always white.
 15
 16 * Configurations/WebCore.xcconfig: Link against CoreUI.
 17 * inspector/InspectorOverlay.cpp:
 18 (WebCore::InspectorOverlay::paint):
 19 * page/FrameView.cpp:
 20 (WebCore::FrameView::paintScrollCorner):
 21 (WebCore::FrameView::paintScrollbar):
 22 (WebCore::FrameView::paintControlTints):
 23 (WebCore::FrameView::paintContentsForSnapshot):
 24 * page/FrameView.h:
 25 * page/Page.h:
 26 * platform/ScrollView.cpp:
 27 (WebCore::ScrollView::paintScrollCorner):
 28 (WebCore::ScrollView::paintScrollbar):
 29 (WebCore::ScrollView::paintScrollbars):
 30 (WebCore::ScrollView::paint):
 31 * platform/ScrollView.h:
 32 * platform/Scrollbar.cpp:
 33 (WebCore::Scrollbar::paint):
 34 * platform/Scrollbar.h:
 35 * platform/ScrollbarTheme.h:
 36 (WebCore::ScrollbarTheme::paint):
 37 (WebCore::ScrollbarTheme::paintScrollCorner):
 38 * platform/ScrollbarThemeComposite.cpp:
 39 (WebCore::ScrollbarThemeComposite::paint):
 40 (WebCore::ScrollbarThemeComposite::paintScrollCorner): Deleted.
 41 * platform/ScrollbarThemeComposite.h:
 42 * platform/Widget.h:
 43 * platform/gtk/WidgetGtk.cpp:
 44 (WebCore::Widget::paint):
 45 * platform/mac/ScrollbarThemeMac.h:
 46 * platform/mac/ScrollbarThemeMac.mm:
 47 (WebCore::ScrollbarThemeMac::paint):
 48 (WebCore::ScrollbarThemeMac::paintScrollCorner):
 49 * platform/mac/WidgetMac.mm:
 50 (WebCore::Widget::paint):
 51 * platform/win/WidgetWin.cpp:
 52 (WebCore::Widget::paint):
 53 * platform/wpe/WidgetWPE.cpp:
 54 (WebCore::Widget::paint):
 55 * rendering/RenderLayer.cpp:
 56 (WebCore::RenderLayer::paintOverflowControls):
 57 (WebCore::RenderLayer::paintScrollCorner):
 58 * rendering/RenderLayerBacking.cpp:
 59 (WebCore::RenderLayerBacking::paintContents):
 60 * rendering/RenderLayerCompositor.cpp:
 61 (WebCore::paintScrollbar):
 62 (WebCore::RenderLayerCompositor::paintContents):
 63 * rendering/RenderLayerCompositor.h:
 64 * rendering/RenderListBox.cpp:
 65 (WebCore::RenderListBox::paintScrollbar):
 66 * rendering/RenderScrollbar.cpp:
 67 (WebCore::RenderScrollbar::paint):
 68 * rendering/RenderScrollbar.h:
 69 * rendering/RenderScrollbarTheme.cpp:
 70 (WebCore::RenderScrollbarTheme::paintScrollCorner):
 71 * rendering/RenderScrollbarTheme.h:
 72 * rendering/RenderWidget.cpp:
 73 (WebCore::RenderWidget::paintContents):
 74 * svg/graphics/SVGImage.cpp:
 75 (WebCore::SVGImage::draw):
 76
1772018-06-18 Carlos Alberto Lopez Perez <clopez@igalia.com>
278
379 [WTF] Remove workarounds needed to support libstdc++-4

Source/WebCore/PAL/ChangeLog

 12018-06-19 Timothy Hatcher <timothy@apple.com>
 2
 3 Corner of two scroll bars is white with dark mode enabled.
 4
 5 https://bugs.webkit.org/show_bug.cgi?id=186819
 6 rdar://problem/40434350
 7
 8 Reviewed by NOBODY (OOPS!).
 9
 10 Expose some SPI of CoreUI and NSAppearance to draw scrollbar corners.
 11
 12 * PAL.xcodeproj/project.pbxproj:
 13 * pal/spi/mac/CoreUISPI.h: Added.
 14 * pal/spi/mac/NSAppearanceSPI.h: Added.
 15
1162018-06-15 Jonathan Bedard <jbedard@apple.com>
217
318 Complex text handling should opt out of bounded text layout (follow-up fix)

Source/WebKit/ChangeLog

 12018-06-19 Timothy Hatcher <timothy@apple.com>
 2
 3 Corner of two scroll bars is white with dark mode enabled.
 4
 5 https://bugs.webkit.org/show_bug.cgi?id=186819
 6 rdar://problem/40434350
 7
 8 Reviewed by NOBODY (OOPS!).
 9
 10 Pass useSystemAppearance and defaultAppearance down through Widget drawing
 11 so we can paint the scrollbars with the right appearance.
 12
 13 * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
 14 (WebKit::InjectedBundleRangeHandle::renderedImage):
 15 * WebProcess/Plugins/PDF/PDFPlugin.mm:
 16 (WebKit::PDFPlugin::paintControlForLayerInContext):
 17 * WebProcess/Plugins/PluginView.cpp:
 18 (WebKit::PluginView::paint):
 19 * WebProcess/Plugins/PluginView.h:
 20 * WebProcess/WebPage/WebPage.cpp:
 21 (WebKit::WebPage::drawRect):
 22
1232018-06-18 Karl Leplat <karl.leplat_ext@softathome.com>
224
325 [Threaded paintingEngine] Fix rendering glitches

Source/WebKitLegacy/mac/ChangeLog

 12018-06-19 Timothy Hatcher <timothy@apple.com>
 2
 3 Corner of two scroll bars is white with dark mode enabled.
 4
 5 https://bugs.webkit.org/show_bug.cgi?id=186819
 6 rdar://problem/40434350
 7
 8 Reviewed by NOBODY (OOPS!).
 9
 10 Pass useSystemAppearance and defaultAppearance down through Widget drawing
 11 so we can paint the scrollbars with the right appearance.
 12
 13 * WebView/WebFrame.mm:
 14 (-[WebFrame _drawRect:contentsOnly:]):
 15
1162018-06-12 Darin Adler <darin@apple.com>
217
318 [Cocoa] Make some RetainPtr refinements to get more ready for ARC

Source/WebCore/Configurations/WebCore.xcconfig

@@WK_AUDIO_UNIT_LDFLAGS_macosx = -framework AudioUnit;
8080WK_CARBON_LDFLAGS = $(WK_CARBON_LDFLAGS_$(WK_PLATFORM_NAME));
8181WK_CARBON_LDFLAGS_macosx = -framework Carbon;
8282
 83WK_CORE_UI_LDFLAGS = $(WK_CORE_UI_LDFLAGS_$(WK_PLATFORM_NAME));
 84WK_CORE_UI_LDFLAGS_macosx = -framework CoreUI;
 85
8386WK_DATA_DETECTORS_CORE_LDFLAGS = $(WK_DATA_DETECTORS_CORE_LDFLAGS_$(WK_PLATFORM_NAME));
8487WK_DATA_DETECTORS_CORE_LDFLAGS_macosx = -framework DataDetectorsCore;
8588

@@WK_URL_FORMATTING_LDFLAGS = $(WK_URL_FORMATTING_LDFLAGS_$(WK_HAVE_URL_FORMATTING
126129WK_URL_FORMATTING_LDFLAGS_YES = -framework URLFormatting;
127130
128131// FIXME: Reduce the number of allowable_clients <rdar://problem/31823969>
129 OTHER_LDFLAGS = $(inherited) $(WK_RELOCATABLE_FRAMEWORK_LDFLAGS) $(WK_UNDEFINED_SYMBOLS_LDFLAGS) -lsqlite3 -lobjc -lANGLE -allowable_client WebCoreTestSupport -allowable_client WebKitLegacy -force_load $(BUILT_PRODUCTS_DIR)/libPAL.a -framework CFNetwork -framework CoreAudio -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework Metal $(OTHER_LDFLAGS_PLATFORM_$(WK_COCOA_TOUCH)) $(OTHER_LDFLAGS_PLATFORM_$(WK_PLATFORM_NAME)) $(WK_APPKIT_LDFLAGS) $(WK_APPSUPPORT_LDFLAGS) $(WK_AUDIO_UNIT_LDFLAGS) $(WK_CARBON_LDFLAGS) $(WK_DATA_DETECTORS_CORE_LDFLAGS) $(WK_DEVICE_IDENTITY_LDFLAGS) $(WK_GRAPHICS_SERVICES_LDFLAGS) $(WK_IOSURFACE_LDFLAGS) $(WK_LIBWEBRTC_LDFLAGS) $(WK_MOBILE_CORE_SERVICES_LDFLAGS) $(WK_MOBILE_GESTALT_LDFLAGS) $(WK_OPENGL_LDFLAGS) $(WK_SYSTEM_CONFIGURATION_LDFLAGS) $(WK_SYSTEM_PREVIEW_LDFLAGS) $(WK_URL_FORMATTING_LDFLAGS);
 132OTHER_LDFLAGS = $(inherited) $(WK_RELOCATABLE_FRAMEWORK_LDFLAGS) $(WK_UNDEFINED_SYMBOLS_LDFLAGS) -lsqlite3 -lobjc -lANGLE -allowable_client WebCoreTestSupport -allowable_client WebKitLegacy -force_load $(BUILT_PRODUCTS_DIR)/libPAL.a -framework CFNetwork -framework CoreAudio -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework Metal $(OTHER_LDFLAGS_PLATFORM_$(WK_COCOA_TOUCH)) $(OTHER_LDFLAGS_PLATFORM_$(WK_PLATFORM_NAME)) $(WK_APPKIT_LDFLAGS) $(WK_APPSUPPORT_LDFLAGS) $(WK_AUDIO_UNIT_LDFLAGS) $(WK_CARBON_LDFLAGS) $(WK_CORE_UI_LDFLAGS) $(WK_DATA_DETECTORS_CORE_LDFLAGS) $(WK_DEVICE_IDENTITY_LDFLAGS) $(WK_GRAPHICS_SERVICES_LDFLAGS) $(WK_IOSURFACE_LDFLAGS) $(WK_LIBWEBRTC_LDFLAGS) $(WK_MOBILE_CORE_SERVICES_LDFLAGS) $(WK_MOBILE_GESTALT_LDFLAGS) $(WK_OPENGL_LDFLAGS) $(WK_SYSTEM_CONFIGURATION_LDFLAGS) $(WK_SYSTEM_PREVIEW_LDFLAGS) $(WK_URL_FORMATTING_LDFLAGS);
130133
131134OTHER_LDFLAGS_PLATFORM_cocoatouch = -allowable_client WebKit -allowable_client iTunesU -allowable_client Casablanca -allowable_client Remote -allowable_client TVBooks -allowable_client DumpRenderTree -allowable_client WebKitTestRunner -allowable_client TestWebKitAPI;
132135OTHER_LDFLAGS_PLATFORM_macosx = -sub_library libobjc -umbrella WebKit;

Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj

105105 1C09D0581E31C57E00725F18 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C09D0571E31C57E00725F18 /* config.h */; };
106106 1C4876D81F8D7F4E00CCEEBD /* Logging.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C4876D61F8D7F4E00CCEEBD /* Logging.cpp */; };
107107 1C4876D91F8D7F4E00CCEEBD /* Logging.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C4876D71F8D7F4E00CCEEBD /* Logging.h */; };
 108 1CCEE4F520D871930047B097 /* CoreUISPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CCEE4F420D871930047B097 /* CoreUISPI.h */; };
 109 1CCEE4F720D8743F0047B097 /* NSAppearanceSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CCEE4F620D8743F0047B097 /* NSAppearanceSPI.h */; };
108110 2D02E93C2056FAA700A13797 /* AudioToolboxSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D02E93B2056FAA700A13797 /* AudioToolboxSPI.h */; };
109111 31308B1420A21705003FB929 /* SystemPreviewSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 31308B1320A21705003FB929 /* SystemPreviewSPI.h */; };
110112 570AB8F120AE2E8D00B8BE87 /* SecKeyProxySPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 570AB8F020AE2E8D00B8BE87 /* SecKeyProxySPI.h */; };

252254 1C4876DC1F8D7FC600CCEEBD /* LogMacros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LogMacros.h; sourceTree = "<group>"; };
253255 1C67CEA11E32EDA800F80F2E /* FeatureDefines.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = FeatureDefines.xcconfig; sourceTree = "<group>"; };
254256 1C67CEA21E32EE2600F80F2E /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = "<group>"; };
 257 1CCEE4F420D871930047B097 /* CoreUISPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreUISPI.h; sourceTree = "<group>"; };
 258 1CCEE4F620D8743F0047B097 /* NSAppearanceSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSAppearanceSPI.h; sourceTree = "<group>"; };
255259 2D02E93B2056FAA700A13797 /* AudioToolboxSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioToolboxSPI.h; sourceTree = "<group>"; };
256260 31308B1320A21705003FB929 /* SystemPreviewSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SystemPreviewSPI.h; sourceTree = "<group>"; };
257261 37119A7820CCB5FF002C6DC9 /* WebKitTargetConditionals.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = WebKitTargetConditionals.xcconfig; sourceTree = "<group>"; };

417421 isa = PBXGroup;
418422 children = (
419423 0C7785701F45130F00F4EBB6 /* AVFoundationSPI.h */,
 424 1CCEE4F420D871930047B097 /* CoreUISPI.h */,
420425 0C7785711F45130F00F4EBB6 /* DataDetectorsSPI.h */,
421426 A102658D1F567E9D00B4C844 /* HIServicesSPI.h */,
422427 A10265881F56747A00B4C844 /* HIToolboxSPI.h */,

424429 0C7785731F45130F00F4EBB6 /* MediaRemoteSPI.h */,
425430 A1F55DCE1F5528EC00EDB75F /* MetadataSPI.h */,
426431 0C7785741F45130F00F4EBB6 /* NSAccessibilitySPI.h */,
 432 1CCEE4F620D8743F0047B097 /* NSAppearanceSPI.h */,
427433 0C7785751F45130F00F4EBB6 /* NSApplicationSPI.h */,
428434 A1175B4A1F6B2D7E00C4B9F0 /* NSCellSPI.h */,
429435 0C7785761F45130F00F4EBB6 /* NSEventSPI.h */,

629635 0CF99CA91F738437007EE793 /* CoreMediaSoftLink.h in Headers */,
630636 0C2DA0721F33CA8400DBC317 /* CoreMediaSPI.h in Headers */,
631637 0C2DA1401F3BEB4900DBC317 /* CoreTextSPI.h in Headers */,
 638 1CCEE4F520D871930047B097 /* CoreUISPI.h in Headers */,
632639 0C5AF9191F43A4C7002EAC02 /* CoreUISPI.h in Headers */,
633640 1C09D0531E31C44100725F18 /* CryptoDigest.h in Headers */,
634641 0C2DA1411F3BEB4900DBC317 /* DataDetectorsCoreSPI.h in Headers */,

660667 0C5AF91E1F43A4C7002EAC02 /* MobileGestaltSPI.h in Headers */,
661668 0C2DA1491F3BEB4900DBC317 /* NEFilterSourceSPI.h in Headers */,
662669 0C77858D1F45130F00F4EBB6 /* NSAccessibilitySPI.h in Headers */,
 670 1CCEE4F720D8743F0047B097 /* NSAppearanceSPI.h in Headers */,
663671 0C77858E1F45130F00F4EBB6 /* NSApplicationSPI.h in Headers */,
664672 0C2DA14A1F3BEB4900DBC317 /* NSAttributedStringSPI.h in Headers */,
665673 0C2DA14B1F3BEB4900DBC317 /* NSButtonCellSPI.h in Headers */,

Source/WebCore/PAL/pal/spi/mac/CoreUISPI.h

 1/*
 2 * Copyright (C) 2018 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#pragma once
 27
 28#if USE(APPLE_INTERNAL_SDK)
 29
 30#include <CoreUI/CoreUI.h>
 31
 32#else
 33
 34extern const CFStringRef kCUIWidgetKey;
 35extern const CFStringRef kCUIIsFlippedKey;
 36
 37extern const CFStringRef kCUIWidgetScrollBarTrackCorner;
 38
 39#endif

Source/WebCore/PAL/pal/spi/mac/NSAppearanceSPI.h

 1/*
 2 * Copyright (C) 2015 Apple Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#if USE(APPKIT)
 27
 28@interface NSAppearance ()
 29
 30- (void)_drawInRect:(NSRect)rect context:(CGContextRef)context options:(NSDictionary *)options;
 31
 32@end
 33
 34#endif // USE(APPKIT)

Source/WebCore/inspector/InspectorOverlay.cpp

@@void InspectorOverlay::paint(GraphicsContext& context)
180180 GraphicsContextStateSaver stateSaver(context);
181181 FrameView* view = overlayPage()->mainFrame().view();
182182 view->updateLayoutAndStyleIfNeededRecursive();
183  view->paint(context, IntRect(0, 0, view->width(), view->height()));
 183 view->paint(context, IntRect(0, 0, view->width(), view->height()), m_page.useSystemAppearance(), m_page.defaultAppearance());
184184}
185185
186186void InspectorOverlay::getHighlight(Highlight& highlight, InspectorOverlay::CoordinateSystem coordinateSystem) const

Source/WebCore/page/FrameView.cpp

@@void FrameView::updateScrollCorner()
38663866 }
38673867}
38683868
3869 void FrameView::paintScrollCorner(GraphicsContext& context, const IntRect& cornerRect)
 3869void FrameView::paintScrollCorner(GraphicsContext& context, const IntRect& cornerRect, bool useSystemAppearance, bool useDefaultAppearance)
38703870{
38713871 if (context.updatingControlTints()) {
38723872 updateScrollCorner();

@@void FrameView::paintScrollCorner(GraphicsContext& context, const IntRect& corne
38803880 return;
38813881 }
38823882
3883  ScrollView::paintScrollCorner(context, cornerRect);
 3883 ScrollView::paintScrollCorner(context, cornerRect, useSystemAppearance, useDefaultAppearance);
38843884}
38853885
3886 void FrameView::paintScrollbar(GraphicsContext& context, Scrollbar& bar, const IntRect& rect)
 3886void FrameView::paintScrollbar(GraphicsContext& context, Scrollbar& bar, const IntRect& rect, bool useSystemAppearance, bool useDefaultAppearance)
38873887{
38883888 if (bar.isCustomScrollbar() && frame().isMainFrame()) {
38893889 IntRect toFill = bar.frameRect();

@@void FrameView::paintScrollbar(GraphicsContext& context, Scrollbar& bar, const I
38913891 context.fillRect(toFill, baseBackgroundColor());
38923892 }
38933893
3894  ScrollView::paintScrollbar(context, bar, rect);
 3894 ScrollView::paintScrollbar(context, bar, rect, useSystemAppearance, useDefaultAppearance);
38953895}
38963896
38973897Color FrameView::documentBackgroundColor() const

@@void FrameView::paintControlTints()
40204020 if (platformWidget()) {
40214021 // FIXME: consult paintsEntireContents().
40224022 paintContents(context, visibleContentRect(LegacyIOSDocumentVisibleRect));
4023  } else
4024  paint(context, frameRect());
 4023 } else {
 4024 auto* page = frame().page();
 4025 paint(context, frameRect(), page->useSystemAppearance(), page->defaultAppearance());
 4026 }
40254027}
40264028
40274029bool FrameView::wasScrolledByUser() const

@@void FrameView::paintContentsForSnapshot(GraphicsContext& context, const IntRect
42094211 else {
42104212 // A snapshot in ViewCoordinates will include a scrollbar, and the snapshot will contain
42114213 // whatever content the document is currently scrolled to.
4212  paint(context, imageRect);
 4214 auto* page = frame().page();
 4215 paint(context, imageRect, page->useSystemAppearance(), page->defaultAppearance());
42134216 }
42144217
42154218 // Restore selection.

Source/WebCore/page/FrameView.h

@@public:
375375 WEBCORE_EXPORT void paintContentsForSnapshot(GraphicsContext&, const IntRect& imageRect, SelectionInSnapshot shouldPaintSelection, CoordinateSpaceForSnapshot);
376376
377377 void paintOverhangAreas(GraphicsContext&, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect) final;
378  void paintScrollCorner(GraphicsContext&, const IntRect& cornerRect) final;
379  void paintScrollbar(GraphicsContext&, Scrollbar&, const IntRect&) final;
 378 void paintScrollCorner(GraphicsContext&, const IntRect& cornerRect, bool useSystemAppearance, bool useDefaultAppearance) final;
 379 void paintScrollbar(GraphicsContext&, Scrollbar&, const IntRect&, bool useSystemAppearance, bool useDefaultAppearance) final;
380380
381381 WEBCORE_EXPORT Color documentBackgroundColor() const;
382382

Source/WebCore/page/Page.h

@@public:
342342 bool useSystemAppearance() const { return m_useSystemAppearance; }
343343 void setUseSystemAppearance(bool a) { m_useSystemAppearance = a; }
344344
345  bool defaultAppearance() const;
 345 WEBCORE_EXPORT bool defaultAppearance() const;
346346 void setDefaultAppearance(bool a) { m_defaultAppearance = a; }
347347
348348#if ENABLE(TEXT_AUTOSIZING)

Source/WebCore/platform/ScrollView.cpp

@@void ScrollView::scrollbarStyleChanged(ScrollbarStyle newStyle, bool forceUpdate
11201120 positionScrollbarLayers();
11211121}
11221122
1123 void ScrollView::paintScrollCorner(GraphicsContext& context, const IntRect& cornerRect)
 1123void ScrollView::paintScrollCorner(GraphicsContext& context, const IntRect& cornerRect, bool useSystemAppearance, bool useDefaultAppearance)
11241124{
1125  ScrollbarTheme::theme().paintScrollCorner(this, context, cornerRect);
 1125 ScrollbarTheme::theme().paintScrollCorner(context, cornerRect, useSystemAppearance, useDefaultAppearance);
11261126}
11271127
1128 void ScrollView::paintScrollbar(GraphicsContext& context, Scrollbar& bar, const IntRect& rect)
 1128void ScrollView::paintScrollbar(GraphicsContext& context, Scrollbar& bar, const IntRect& rect, bool useSystemAppearance, bool useDefaultAppearance)
11291129{
1130  bar.paint(context, rect);
 1130 bar.paint(context, rect, useSystemAppearance, useDefaultAppearance);
11311131}
11321132
11331133void ScrollView::invalidateScrollCornerRect(const IntRect& rect)

@@void ScrollView::invalidateScrollCornerRect(const IntRect& rect)
11351135 invalidateRect(rect);
11361136}
11371137
1138 void ScrollView::paintScrollbars(GraphicsContext& context, const IntRect& rect)
 1138void ScrollView::paintScrollbars(GraphicsContext& context, const IntRect& rect, bool useSystemAppearance, bool useDefaultAppearance)
11391139{
11401140 if (m_horizontalScrollbar && !layerForHorizontalScrollbar())
1141  paintScrollbar(context, *m_horizontalScrollbar.get(), rect);
 1141 paintScrollbar(context, *m_horizontalScrollbar.get(), rect, useSystemAppearance, useDefaultAppearance);
11421142 if (m_verticalScrollbar && !layerForVerticalScrollbar())
1143  paintScrollbar(context, *m_verticalScrollbar.get(), rect);
 1143 paintScrollbar(context, *m_verticalScrollbar.get(), rect, useSystemAppearance, useDefaultAppearance);
11441144
11451145 if (layerForScrollCorner())
11461146 return;
11471147
1148  paintScrollCorner(context, scrollCornerRect());
 1148 paintScrollCorner(context, scrollCornerRect(), useSystemAppearance, useDefaultAppearance);
11491149}
11501150
11511151void ScrollView::paintPanScrollIcon(GraphicsContext& context)

@@void ScrollView::paintPanScrollIcon(GraphicsContext& context)
11571157 context.drawImage(panScrollIcon, iconGCPoint);
11581158}
11591159
1160 void ScrollView::paint(GraphicsContext& context, const IntRect& rect, SecurityOriginPaintPolicy securityOriginPaintPolicy)
 1160void ScrollView::paint(GraphicsContext& context, const IntRect& rect, bool useSystemAppearance, bool useDefaultAppearance, SecurityOriginPaintPolicy securityOriginPaintPolicy)
11611161{
11621162 if (platformWidget()) {
1163  Widget::paint(context, rect);
 1163 Widget::paint(context, rect, useSystemAppearance, useDefaultAppearance);
11641164 return;
11651165 }
11661166

@@void ScrollView::paint(GraphicsContext& context, const IntRect& rect, SecurityOr
12091209 scrollViewDirtyRect.moveBy(-location());
12101210 context.clip(IntRect(IntPoint(), visibleAreaWithScrollbars.size()));
12111211
1212  paintScrollbars(context, scrollViewDirtyRect);
 1212 paintScrollbars(context, scrollViewDirtyRect, useSystemAppearance, useDefaultAppearance);
12131213 }
12141214
12151215 // Paint the panScroll Icon

Source/WebCore/platform/ScrollView.h

@@public:
342342 }
343343
344344 // Widget override. Handles painting of the contents of the view as well as the scrollbars.
345  WEBCORE_EXPORT void paint(GraphicsContext&, const IntRect&, Widget::SecurityOriginPaintPolicy = SecurityOriginPaintPolicy::AnyOrigin) final;
346  void paintScrollbars(GraphicsContext&, const IntRect&);
 345 WEBCORE_EXPORT void paint(GraphicsContext&, const IntRect&, bool useSystemAppearance, bool useDefaultAppearance, Widget::SecurityOriginPaintPolicy = SecurityOriginPaintPolicy::AnyOrigin) final;
 346 void paintScrollbars(GraphicsContext&, const IntRect&, bool useSystemAppearance, bool useDefaultAppearance);
347347
348348 // Widget overrides to ensure that our children's visibility status is kept up to date when we get shown and hidden.
349349 WEBCORE_EXPORT void show() override;

@@public:
359359 bool isPointInScrollbarCorner(const IntPoint&);
360360 bool scrollbarCornerPresent() const;
361361 IntRect scrollCornerRect() const final;
362  virtual void paintScrollCorner(GraphicsContext&, const IntRect& cornerRect);
363  virtual void paintScrollbar(GraphicsContext&, Scrollbar&, const IntRect&);
 362 virtual void paintScrollCorner(GraphicsContext&, const IntRect& cornerRect, bool useSystemAppearance, bool useDefaultAppearance);
 363 virtual void paintScrollbar(GraphicsContext&, Scrollbar&, const IntRect&, bool useSystemAppearance, bool useDefaultAppearance);
364364
365365 IntRect convertFromScrollbarToContainingView(const Scrollbar&, const IntRect&) const final;
366366 IntRect convertFromContainingViewToScrollbar(const Scrollbar&, const IntRect&) const final;

Source/WebCore/platform/Scrollbar.cpp

@@void Scrollbar::updateThumbProportion()
156156 updateThumb();
157157}
158158
159 void Scrollbar::paint(GraphicsContext& context, const IntRect& damageRect, Widget::SecurityOriginPaintPolicy)
 159void Scrollbar::paint(GraphicsContext& context, const IntRect& damageRect, bool useSystemAppearance, bool useDefaultAppearance, Widget::SecurityOriginPaintPolicy)
160160{
161161 if (context.updatingControlTints() && theme().supportsControlTints()) {
162162 invalidate();

@@void Scrollbar::paint(GraphicsContext& context, const IntRect& damageRect, Widge
166166 if (context.paintingDisabled() || !frameRect().intersects(damageRect))
167167 return;
168168
169  if (!theme().paint(*this, context, damageRect))
170  Widget::paint(context, damageRect);
 169 if (!theme().paint(*this, context, damageRect, useSystemAppearance, useDefaultAppearance))
 170 Widget::paint(context, damageRect, useSystemAppearance, useDefaultAppearance);
171171}
172172
173173void Scrollbar::autoscrollTimerFired()

Source/WebCore/platform/Scrollbar.h

@@public:
8383 WEBCORE_EXPORT void setProportion(int visibleSize, int totalSize);
8484 void setPressedPos(int p) { m_pressedPos = p; }
8585
86  void paint(GraphicsContext&, const IntRect& damageRect, Widget::SecurityOriginPaintPolicy = SecurityOriginPaintPolicy::AnyOrigin) override;
 86 void paint(GraphicsContext&, const IntRect& damageRect, bool useSystemAppearance, bool useDefaultAppearance, Widget::SecurityOriginPaintPolicy = SecurityOriginPaintPolicy::AnyOrigin) override;
8787
8888 bool enabled() const { return m_enabled; }
8989 virtual void setEnabled(bool);

Source/WebCore/platform/ScrollbarTheme.h

@@public:
4848
4949 virtual void updateEnabledState(Scrollbar&) { }
5050
51  virtual bool paint(Scrollbar&, GraphicsContext&, const IntRect& /*damageRect*/) { return false; }
 51 virtual bool paint(Scrollbar&, GraphicsContext&, const IntRect& /*damageRect*/, bool /*useSystemAppearance*/, bool /*useDefaultAppearance*/) { return false; }
5252 virtual ScrollbarPart hitTest(Scrollbar&, const IntPoint&) { return NoPart; }
5353
5454 virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar, ScrollbarExpansionState = ScrollbarExpansionState::Expanded) { return 0; }

@@public:
8484
8585 virtual void invalidatePart(Scrollbar&, ScrollbarPart) { }
8686
87  virtual void paintScrollCorner(ScrollView*, GraphicsContext& context, const IntRect& cornerRect) { defaultPaintScrollCorner(context, cornerRect); }
 87 virtual void paintScrollCorner(GraphicsContext& context, const IntRect& cornerRect, bool /*useSystemAppearance*/, bool /*useDefaultAppearance*/) { defaultPaintScrollCorner(context, cornerRect); }
8888 static void defaultPaintScrollCorner(GraphicsContext& context, const IntRect& cornerRect) { context.fillRect(cornerRect, Color::white); }
8989
9090 virtual void paintTickmarks(GraphicsContext&, Scrollbar&, const IntRect&) { }

Source/WebCore/platform/ScrollbarThemeComposite.cpp

3131
3232namespace WebCore {
3333
34 bool ScrollbarThemeComposite::paint(Scrollbar& scrollbar, GraphicsContext& graphicsContext, const IntRect& damageRect)
 34bool ScrollbarThemeComposite::paint(Scrollbar& scrollbar, GraphicsContext& graphicsContext, const IntRect& damageRect, bool, bool)
3535{
3636 // Create the ScrollbarControlPartMask based on the damageRect
3737 ScrollbarControlPartMask scrollMask = NoPart;

@@int ScrollbarThemeComposite::trackLength(Scrollbar& scrollbar)
260260 return (scrollbar.orientation() == HorizontalScrollbar) ? constrainedTrackRect.width() : constrainedTrackRect.height();
261261}
262262
263 void ScrollbarThemeComposite::paintScrollCorner(ScrollView*, GraphicsContext& context, const IntRect& cornerRect)
264 {
265  context.fillRect(cornerRect, Color::white);
266 }
267 
268263IntRect ScrollbarThemeComposite::thumbRect(Scrollbar& scrollbar)
269264{
270265 if (!hasThumb(scrollbar))

Source/WebCore/platform/ScrollbarThemeComposite.h

@@namespace WebCore {
3737class ScrollbarThemeComposite : public ScrollbarTheme {
3838public:
3939 // Implement ScrollbarTheme interface
40  bool paint(Scrollbar&, GraphicsContext&, const IntRect& damageRect) override;
 40 bool paint(Scrollbar&, GraphicsContext&, const IntRect& damageRect, bool useSystemAppearance, bool useDefaultAppearance) override;
4141 ScrollbarPart hitTest(Scrollbar&, const IntPoint&) override;
4242 void invalidatePart(Scrollbar&, ScrollbarPart) override;
4343 int thumbPosition(Scrollbar&) override;
4444 int thumbLength(Scrollbar&) override;
4545 int trackPosition(Scrollbar&) override;
4646 int trackLength(Scrollbar&) override;
47  void paintScrollCorner(ScrollView*, GraphicsContext&, const IntRect& cornerRect) override;
4847 void paintOverhangAreas(ScrollView&, GraphicsContext&, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect) override;
4948
5049 virtual bool hasButtons(Scrollbar&) = 0;

Source/WebCore/platform/Widget.h

@@public:
113113
114114 enum class SecurityOriginPaintPolicy { AnyOrigin, AccessibleOriginOnly };
115115
116  WEBCORE_EXPORT virtual void paint(GraphicsContext&, const IntRect&, SecurityOriginPaintPolicy = SecurityOriginPaintPolicy::AnyOrigin);
 116 WEBCORE_EXPORT virtual void paint(GraphicsContext&, const IntRect&, bool useSystemAppearance, bool useDefaultAppearance, SecurityOriginPaintPolicy = SecurityOriginPaintPolicy::AnyOrigin);
117117 void invalidate() { invalidateRect(boundsRect()); }
118118 virtual void invalidateRect(const IntRect&) = 0;
119119

Source/WebCore/platform/gtk/ScrollbarThemeGtk.cpp

@@IntRect ScrollbarThemeGtk::forwardButtonRect(Scrollbar& scrollbar, ScrollbarPart
447447#endif // GTK_CHECK_VERSION(3, 20, 0)
448448
449449#if GTK_CHECK_VERSION(3, 20, 0)
450 bool ScrollbarThemeGtk::paint(Scrollbar& scrollbar, GraphicsContext& graphicsContext, const IntRect& damageRect)
 450bool ScrollbarThemeGtk::paint(Scrollbar& scrollbar, GraphicsContext& graphicsContext, const IntRect& damageRect, bool, bool)
451451{
452452 if (graphicsContext.paintingDisabled())
453453 return false;

Source/WebCore/platform/gtk/ScrollbarThemeGtk.h

@@public:
4545#ifndef GTK_API_VERSION_2
4646 ScrollbarThemeGtk();
4747
48  bool paint(Scrollbar&, GraphicsContext&, const IntRect& damageRect) override;
 48 bool paint(Scrollbar&, GraphicsContext&, const IntRect& damageRect, bool useSystemAppearance, bool useDefaultAppearance) override;
4949 ScrollbarButtonPressAction handleMousePressEvent(Scrollbar&, const PlatformMouseEvent&, ScrollbarPart) override;
5050 int scrollbarThickness(ScrollbarControlSize, ScrollbarExpansionState = ScrollbarExpansionState::Expanded) override;
5151 int minimumThumbLength(Scrollbar&) override;

Source/WebCore/platform/gtk/WidgetGtk.cpp

@@void Widget::hide()
8080 gtk_widget_hide(platformWidget());
8181}
8282
83 void Widget::paint(GraphicsContext&, const IntRect&, SecurityOriginPaintPolicy)
 83void Widget::paint(GraphicsContext&, const IntRect&, bool, bool, SecurityOriginPaintPolicy)
8484{
8585}
8686

Source/WebCore/platform/ios/ScrollbarThemeIOS.h

@@public:
3636 ScrollbarThemeIOS();
3737 virtual ~ScrollbarThemeIOS();
3838
39  bool paint(Scrollbar&, GraphicsContext&, const IntRect& damageRect) override;
 39 bool paint(Scrollbar&, GraphicsContext&, const IntRect& damageRect, bool useSystemAppearance, bool useDefaultAppearance) override;
4040
4141 int scrollbarThickness(ScrollbarControlSize = RegularScrollbar, ScrollbarExpansionState = ScrollbarExpansionState::Expanded) override;
4242

Source/WebCore/platform/ios/ScrollbarThemeIOS.mm

@@int ScrollbarThemeIOS::minimumThumbLength(Scrollbar&)
113113 return 0;
114114}
115115
116 bool ScrollbarThemeIOS::paint(Scrollbar&, GraphicsContext&, const IntRect& /*damageRect*/)
 116bool ScrollbarThemeIOS::paint(Scrollbar&, GraphicsContext&, const IntRect& /*damageRect*/, bool /*useSystemAppearance*/, bool /*useDefaultAppearance*/)
117117{
118118 return true;
119119}

Source/WebCore/platform/ios/WidgetIOS.mm

@@NSView* Widget::getOuterView() const
141141 return view;
142142}
143143
144 void Widget::paint(GraphicsContext& p, const IntRect& r, SecurityOriginPaintPolicy)
 144void Widget::paint(GraphicsContext& p, const IntRect& r, bool, bool, SecurityOriginPaintPolicy)
145145{
146146 if (p.paintingDisabled())
147147 return;

Source/WebCore/platform/mac/ScrollbarThemeMac.h

@@public:
4040
4141 void updateEnabledState(Scrollbar&) override;
4242
43  bool paint(Scrollbar&, GraphicsContext&, const IntRect& damageRect) override;
 43 bool paint(Scrollbar&, GraphicsContext&, const IntRect& damageRect, bool useSystemAppearance, bool useDefaultAppearance) override;
 44 void paintScrollCorner(GraphicsContext&, const IntRect&, bool useSystemAppearance, bool useDefaultAppearance) override;
4445
4546 int scrollbarThickness(ScrollbarControlSize = RegularScrollbar, ScrollbarExpansionState = ScrollbarExpansionState::Expanded) override;
4647

Source/WebCore/platform/mac/ScrollbarThemeMac.mm

3232#import "GraphicsLayer.h"
3333#import "ImageBuffer.h"
3434#import "LocalCurrentGraphicsContext.h"
 35#import "LocalDefaultSystemAppearance.h"
3536#import "NSScrollerImpDetails.h"
3637#import "PlatformMouseEvent.h"
3738#import "ScrollAnimatorMac.h"
3839#import "ScrollView.h"
3940#import <Carbon/Carbon.h>
4041#import <pal/spi/cg/CoreGraphicsSPI.h>
 42#import <pal/spi/mac/CoreUISPI.h>
 43#import <pal/spi/mac/NSAppearanceSPI.h>
4144#import <pal/spi/mac/NSScrollerImpSPI.h>
4245#import <wtf/BlockObjCExceptions.h>
4346#import <wtf/HashMap.h>

@@static void scrollerImpPaint(NSScrollerImp *scrollerImp, bool enabled)
546549 END_BLOCK_OBJC_EXCEPTIONS;
547550}
548551
549 bool ScrollbarThemeMac::paint(Scrollbar& scrollbar, GraphicsContext& context, const IntRect& damageRect)
 552bool ScrollbarThemeMac::paint(Scrollbar& scrollbar, GraphicsContext& context, const IntRect& damageRect, bool useSystemAppearance, bool useDefaultAppearance)
550553{
 554 LocalDefaultSystemAppearance localAppearance(useSystemAppearance, useDefaultAppearance);
 555
551556 setPaintCharacteristicsForScrollbar(scrollbar);
552557
553558 if (scrollbar.supportsUpdateOnSecondaryThread())
554559 return true;
555560
556561 SetForScope<bool> isCurrentlyDrawingIntoLayer(g_isCurrentlyDrawingIntoLayer, context.isCALayerContext());
557 
 562
558563 GraphicsContextStateSaver stateSaver(context);
559564 context.clip(damageRect);
560565 context.translate(scrollbar.frameRect().location());

@@bool ScrollbarThemeMac::paint(Scrollbar& scrollbar, GraphicsContext& context, co
564569 return true;
565570}
566571
 572void ScrollbarThemeMac::paintScrollCorner(GraphicsContext& context, const IntRect& cornerRect, bool useSystemAppearance, bool useDefaultAppearance)
 573{
 574 auto cornerDrawingOptions = adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
 575
 576 CFDictionarySetValue(cornerDrawingOptions.get(), kCUIWidgetKey, kCUIWidgetScrollBarTrackCorner);
 577 CFDictionarySetValue(cornerDrawingOptions.get(), kCUIIsFlippedKey, kCFBooleanTrue);
 578
 579 LocalDefaultSystemAppearance localAppearance(useSystemAppearance, useDefaultAppearance);
 580 LocalCurrentGraphicsContext localContext(context);
 581
 582 [[NSAppearance currentAppearance] _drawInRect:cornerRect context:localContext.cgContext() options:(__bridge NSDictionary *)cornerDrawingOptions.get()];
 583}
 584
567585#if ENABLE(RUBBER_BANDING)
568586static RetainPtr<CGColorRef> linenBackgroundColor()
569587{

Source/WebCore/platform/mac/WidgetMac.mm

@@NSView *Widget::getOuterView() const
186186 return view;
187187}
188188
189 void Widget::paint(GraphicsContext& p, const IntRect& r, SecurityOriginPaintPolicy)
 189void Widget::paint(GraphicsContext& p, const IntRect& r, bool, bool, SecurityOriginPaintPolicy)
190190{
191191 if (p.paintingDisabled())
192192 return;

Source/WebCore/platform/win/PopupMenuWin.cpp

@@void PopupMenuWin::paint(const IntRect& damageRect, HDC hdc)
673673 }
674674
675675 if (m_scrollbar)
676  m_scrollbar->paint(context, damageRect);
 676 m_scrollbar->paint(context, damageRect, true, true);
677677
678678 HWndDC hWndDC;
679679 HDC localDC = hdc ? hdc : hWndDC.setHWnd(m_popup);

Source/WebCore/platform/win/WidgetWin.cpp

@@void Widget::setCursor(const Cursor& cursor)
7575 view->hostWindow()->setCursor(cursor);
7676}
7777
78 void Widget::paint(GraphicsContext&, const IntRect&, SecurityOriginPaintPolicy)
 78void Widget::paint(GraphicsContext&, const IntRect&, bool, bool, SecurityOriginPaintPolicy)
7979{
8080}
8181

Source/WebCore/platform/wpe/WidgetWPE.cpp

@@IntRect Widget::frameRect() const
5252 return m_frame;
5353}
5454
55 void Widget::paint(GraphicsContext&, const IntRect&, SecurityOriginPaintPolicy)
 55void Widget::paint(GraphicsContext&, const IntRect&, bool, bool, SecurityOriginPaintPolicy)
5656{
5757 notImplemented();
5858}

Source/WebCore/rendering/RenderLayer.cpp

@@void RenderLayer::paintOverflowControls(GraphicsContext& context, const IntPoint
36783678
36793679 // Now that we're sure the scrollbars are in the right place, paint them.
36803680 if (m_hBar && !layerForHorizontalScrollbar())
3681  m_hBar->paint(context, damageRect);
 3681 m_hBar->paint(context, damageRect, page().useSystemAppearance(), page().defaultAppearance());
36823682 if (m_vBar && !layerForVerticalScrollbar())
3683  m_vBar->paint(context, damageRect);
 3683 m_vBar->paint(context, damageRect, page().useSystemAppearance(), page().defaultAppearance());
36843684
36853685 if (layerForScrollCorner())
36863686 return;

@@void RenderLayer::paintScrollCorner(GraphicsContext& context, const IntPoint& pa
37103710 return;
37113711 }
37123712
3713  // We don't want to paint white if we have overlay scrollbars, since we need
 3713 // We don't want to paint a corner if we have overlay scrollbars, since we need
37143714 // to see what is behind it.
37153715 if (!hasOverlayScrollbars())
3716  context.fillRect(absRect, Color::white);
 3716 ScrollbarTheme::theme().paintScrollCorner(context, absRect, page().useSystemAppearance(), page().defaultAppearance());
37173717}
37183718
37193719void RenderLayer::drawPlatformResizerImage(GraphicsContext& context, const LayoutRect& resizerCornerRect)

Source/WebCore/rendering/RenderLayerBacking.cpp

@@void RenderLayerBacking::paintContents(const GraphicsLayer* graphicsLayer, Graph
26112611
26122612 InspectorInstrumentation::didPaint(renderer(), dirtyRect);
26132613 } else if (graphicsLayer == layerForHorizontalScrollbar()) {
2614  paintScrollbar(m_owningLayer.horizontalScrollbar(), context, dirtyRect);
 2614 paintScrollbar(m_owningLayer.horizontalScrollbar(), context, dirtyRect, renderer().page().useSystemAppearance(), renderer().page().defaultAppearance());
26152615 } else if (graphicsLayer == layerForVerticalScrollbar()) {
2616  paintScrollbar(m_owningLayer.verticalScrollbar(), context, dirtyRect);
 2616 paintScrollbar(m_owningLayer.verticalScrollbar(), context, dirtyRect, renderer().page().useSystemAppearance(), renderer().page().defaultAppearance());
26172617 } else if (graphicsLayer == layerForScrollCorner()) {
26182618 const LayoutRect& scrollCornerAndResizer = m_owningLayer.scrollCornerAndResizerRect();
26192619 context.save();

Source/WebCore/rendering/RenderLayerCompositor.cpp

@@bool RenderLayerCompositor::requiresScrollLayer(RootLayerAttachment attachment)
27502750 || attachment == RootLayerAttachedViaEnclosingFrame; // a composited frame on Mac
27512751}
27522752
2753 void paintScrollbar(Scrollbar* scrollbar, GraphicsContext& context, const IntRect& clip)
 2753void paintScrollbar(Scrollbar* scrollbar, GraphicsContext& context, const IntRect& clip, bool useSystemAppearance, bool useDefaultAppearance)
27542754{
27552755 if (!scrollbar)
27562756 return;

@@void paintScrollbar(Scrollbar* scrollbar, GraphicsContext& context, const IntRec
27602760 context.translate(-scrollbarRect.location());
27612761 IntRect transformedClip = clip;
27622762 transformedClip.moveBy(scrollbarRect.location());
2763  scrollbar->paint(context, transformedClip);
 2763 scrollbar->paint(context, transformedClip, useSystemAppearance, useDefaultAppearance);
27642764 context.restore();
27652765}
27662766

@@void RenderLayerCompositor::paintContents(const GraphicsLayer* graphicsLayer, Gr
27682768{
27692769 IntRect pixelSnappedRectForIntegralPositionedItems = snappedIntRect(LayoutRect(clip));
27702770 if (graphicsLayer == layerForHorizontalScrollbar())
2771  paintScrollbar(m_renderView.frameView().horizontalScrollbar(), context, pixelSnappedRectForIntegralPositionedItems);
 2771 paintScrollbar(m_renderView.frameView().horizontalScrollbar(), context, pixelSnappedRectForIntegralPositionedItems, page().useSystemAppearance(), page().defaultAppearance());
27722772 else if (graphicsLayer == layerForVerticalScrollbar())
2773  paintScrollbar(m_renderView.frameView().verticalScrollbar(), context, pixelSnappedRectForIntegralPositionedItems);
 2773 paintScrollbar(m_renderView.frameView().verticalScrollbar(), context, pixelSnappedRectForIntegralPositionedItems, page().useSystemAppearance(), page().defaultAppearance());
27742774 else if (graphicsLayer == layerForScrollCorner()) {
27752775 const IntRect& scrollCorner = m_renderView.frameView().scrollCornerRect();
27762776 context.save();
27772777 context.translate(-scrollCorner.location());
27782778 IntRect transformedClip = pixelSnappedRectForIntegralPositionedItems;
27792779 transformedClip.moveBy(scrollCorner.location());
2780  m_renderView.frameView().paintScrollCorner(context, transformedClip);
 2780 m_renderView.frameView().paintScrollCorner(context, transformedClip, page().useSystemAppearance(), page().defaultAppearance());
27812781 context.restore();
27822782 }
27832783}

Source/WebCore/rendering/RenderLayerCompositor.h

@@private:
566566 HashMap<ScrollingNodeID, RenderLayer*> m_scrollingNodeToLayerMap;
567567};
568568
569 void paintScrollbar(Scrollbar*, GraphicsContext&, const IntRect& clip);
 569void paintScrollbar(Scrollbar*, GraphicsContext&, const IntRect& clip, bool useSystemAppearance, bool useDefaultAppearance);
570570
571571WTF::TextStream& operator<<(WTF::TextStream&, CompositingUpdateType);
572572

Source/WebCore/rendering/RenderListBox.cpp

@@void RenderListBox::paintScrollbar(PaintInfo& paintInfo, const LayoutPoint& pain
381381 LayoutUnit height = this->height() - (borderTop() + borderBottom());
382382 IntRect scrollRect = snappedIntRect(left, top, width, height);
383383 m_vBar->setFrameRect(scrollRect);
384  m_vBar->paint(paintInfo.context(), snappedIntRect(paintInfo.rect));
 384 m_vBar->paint(paintInfo.context(), snappedIntRect(paintInfo.rect), page().useSystemAppearance(), page().defaultAppearance());
385385}
386386
387387static LayoutSize itemOffsetForAlignment(TextRun textRun, const RenderStyle* itemStyle, FontCascade itemFont, LayoutRect itemBoudingBox)

Source/WebCore/rendering/RenderScrollbar.cpp

@@void RenderScrollbar::styleChanged()
100100 updateScrollbarParts();
101101}
102102
103 void RenderScrollbar::paint(GraphicsContext& context, const IntRect& damageRect, Widget::SecurityOriginPaintPolicy)
 103void RenderScrollbar::paint(GraphicsContext& context, const IntRect& damageRect, bool useSystemAppearance, bool useDefaultAppearance, Widget::SecurityOriginPaintPolicy)
104104{
105105 if (context.updatingControlTints()) {
106106 updateScrollbarParts();
107107 return;
108108 }
109  Scrollbar::paint(context, damageRect);
 109 Scrollbar::paint(context, damageRect, useSystemAppearance, useDefaultAppearance);
110110}
111111
112112void RenderScrollbar::setHoveredPart(ScrollbarPart part)

Source/WebCore/rendering/RenderScrollbar.h

@@private:
6666 void setParent(ScrollView*) override;
6767 void setEnabled(bool) override;
6868
69  void paint(GraphicsContext&, const IntRect& damageRect, Widget::SecurityOriginPaintPolicy) override;
 69 void paint(GraphicsContext&, const IntRect& damageRect, bool useSystemAppearance, bool useDefaultAppearance, Widget::SecurityOriginPaintPolicy) override;
7070
7171 void setHoveredPart(ScrollbarPart) override;
7272 void setPressedPart(ScrollbarPart) override;

Source/WebCore/rendering/RenderScrollbarTheme.cpp

@@void RenderScrollbarTheme::didPaintScrollbar(GraphicsContext& context, Scrollbar
126126 }
127127}
128128
129 void RenderScrollbarTheme::paintScrollCorner(ScrollView*, GraphicsContext& context, const IntRect& cornerRect)
 129void RenderScrollbarTheme::paintScrollCorner(GraphicsContext& context, const IntRect& cornerRect, bool useSystemAppearanc, bool defaultAppearance)
130130{
131  // FIXME: Implement.
132  context.fillRect(cornerRect, Color::white);
 131 ScrollbarTheme::theme().paintScrollCorner(context, cornerRect, useSystemAppearanc, defaultAppearance);
133132}
134133
135134void RenderScrollbarTheme::paintScrollbarBackground(GraphicsContext& context, Scrollbar& scrollbar)

Source/WebCore/rendering/RenderScrollbarTheme.h

@@public:
4343
4444 bool supportsControlTints() const override { return true; }
4545
46  void paintScrollCorner(ScrollView*, GraphicsContext&, const IntRect& cornerRect) override;
 46 void paintScrollCorner(GraphicsContext&, const IntRect& cornerRect, bool useSystemAppearance, bool useDefaultAppearance) override;
4747
4848 ScrollbarButtonPressAction handleMousePressEvent(Scrollbar& scrollbar, const PlatformMouseEvent& event, ScrollbarPart pressedPart) override { return ScrollbarTheme::theme().handleMousePressEvent(scrollbar, event, pressedPart); }
4949

Source/WebCore/rendering/RenderWidget.cpp

@@void RenderWidget::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintO
247247 paintRect.move(-widgetPaintOffset);
248248 }
249249 // FIXME: Remove repaintrect enclosing/integral snapping when RenderWidget becomes device pixel snapped.
250  m_widget->paint(paintInfo.context(), snappedIntRect(paintRect), paintInfo.requireSecurityOriginAccessForWidgets ? Widget::SecurityOriginPaintPolicy::AccessibleOriginOnly : Widget::SecurityOriginPaintPolicy::AnyOrigin);
 250 m_widget->paint(paintInfo.context(), snappedIntRect(paintRect), page().useSystemAppearance(), page().defaultAppearance(), paintInfo.requireSecurityOriginAccessForWidgets ? Widget::SecurityOriginPaintPolicy::AccessibleOriginOnly : Widget::SecurityOriginPaintPolicy::AnyOrigin);
251251
252252 if (!widgetPaintOffset.isZero())
253253 paintInfo.context().translate(-widgetPaintOffset);

Source/WebCore/svg/graphics/SVGImage.cpp

@@ImageDrawResult SVGImage::draw(GraphicsContext& context, const FloatRect& dstRec
319319 view->layoutContext().layout();
320320 }
321321
322  view->paint(context, intersection(context.clipBounds(), enclosingIntRect(srcRect)));
 322 view->paint(context, intersection(context.clipBounds(), enclosingIntRect(srcRect)), m_page->useSystemAppearance(), m_page->defaultAppearance());
323323
324324 if (compositingRequiresTransparencyLayer)
325325 context.endTransparencyLayer();

Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp

@@RefPtr<WebImage> InjectedBundleRangeHandle::renderedImage(SnapshotOptions option
152152 frameView->setPaintBehavior(paintBehavior);
153153 ownerDocument.updateLayout();
154154
155  frameView->paint(*graphicsContext, paintRect);
 155 frameView->paint(*graphicsContext, paintRect, frame->page()->useSystemAppearance(), frame->page()->defaultAppearance());
156156 frameView->setPaintBehavior(oldPaintBehavior);
157157
158158 frame->selection().setSelection(oldSelection);

Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm

@@void PDFPlugin::paintControlForLayerInContext(CALayer *layer, CGContextRef conte
12111211{
12121212 GraphicsContext graphicsContext(context);
12131213 GraphicsContextStateSaver stateSaver(graphicsContext);
1214 
 1214
12151215 graphicsContext.setIsCALayerContext(true);
1216 
 1216
 1217 auto* page = webFrame()->coreFrame()->page();
 1218
12171219 if (layer == m_scrollCornerLayer) {
12181220 IntRect scrollCornerRect = this->scrollCornerRect();
12191221 graphicsContext.translate(-scrollCornerRect.x(), -scrollCornerRect.y());
1220  ScrollbarTheme::theme().paintScrollCorner(nullptr, graphicsContext, scrollCornerRect);
 1222 ScrollbarTheme::theme().paintScrollCorner(graphicsContext, scrollCornerRect, page->useSystemAppearance(), page->defaultAppearance());
12211223 return;
12221224 }
1223 
 1225
12241226 Scrollbar* scrollbar = nullptr;
1225 
 1227
12261228 if (layer == m_verticalScrollbarLayer)
12271229 scrollbar = verticalScrollbar();
12281230 else if (layer == m_horizontalScrollbarLayer)

@@void PDFPlugin::paintControlForLayerInContext(CALayer *layer, CGContextRef conte
12301232
12311233 if (!scrollbar)
12321234 return;
1233 
 1235
12341236 graphicsContext.translate(-scrollbar->x(), -scrollbar->y());
1235  scrollbar->paint(graphicsContext, scrollbar->frameRect());
 1237 scrollbar->paint(graphicsContext, scrollbar->frameRect(), page->useSystemAppearance(), page->defaultAppearance());
12361238}
12371239
12381240RefPtr<ShareableBitmap> PDFPlugin::snapshot()

Source/WebKit/WebProcess/Plugins/PluginView.cpp

@@void PluginView::setFrameRect(const WebCore::IntRect& rect)
782782 viewGeometryDidChange();
783783}
784784
785 void PluginView::paint(GraphicsContext& context, const IntRect& /*dirtyRect*/, Widget::SecurityOriginPaintPolicy)
 785void PluginView::paint(GraphicsContext& context, const IntRect& /*dirtyRect*/, bool, bool, Widget::SecurityOriginPaintPolicy)
786786{
787787 if (!m_plugin || !m_isInitialized || m_pluginElement->displayState() < HTMLPlugInElement::Restarting)
788788 return;

Source/WebKit/WebProcess/Plugins/PluginView.h

@@private:
173173
174174 // WebCore::Widget
175175 void setFrameRect(const WebCore::IntRect&) override;
176  void paint(WebCore::GraphicsContext&, const WebCore::IntRect&, WebCore::Widget::SecurityOriginPaintPolicy) override;
 176 void paint(WebCore::GraphicsContext&, const WebCore::IntRect&, bool useSystemAppearance, bool useDefaultAppearance, WebCore::Widget::SecurityOriginPaintPolicy) override;
177177 void invalidateRect(const WebCore::IntRect&) override;
178178 void setFocus(bool) override;
179179 void frameRectsChanged() override;

Source/WebKit/WebProcess/WebPage/WebPage.cpp

@@void WebPage::drawRect(GraphicsContext& graphicsContext, const IntRect& rect)
15201520 GraphicsContextStateSaver stateSaver(graphicsContext);
15211521 graphicsContext.clip(rect);
15221522
1523  m_mainFrame->coreFrame()->view()->paint(graphicsContext, rect);
 1523 auto* page = m_mainFrame->coreFrame()->page();
 1524 m_mainFrame->coreFrame()->view()->paint(graphicsContext, rect, page->useSystemAppearance(), page->defaultAppearance());
15241525}
15251526
15261527double WebPage::textZoomFactor() const

Source/WebKitLegacy/mac/WebView/WebFrame.mm

@@- (void)_drawRect:(NSRect)rect contentsOnly:(BOOL)contentsOnly
664664
665665 if (contentsOnly)
666666 view->paintContents(context, enclosingIntRect(rect));
667  else
668  view->paint(context, enclosingIntRect(rect));
 667 else {
 668 auto* page = core(self)->page();
 669 view->paint(context, enclosingIntRect(rect), page->useSystemAppearance(), page->defaultAppearance());
 670 }
669671
670672 view->setPaintBehavior(oldBehavior);
671673}