|
Lines 297-303
RenderThemeMac::RenderThemeMac()
a/Source/WebCore/rendering/RenderThemeMac.mm_sec1
|
| 297 |
|
297 |
|
| 298 |
NSView *RenderThemeMac::documentViewFor(const RenderObject& o) const |
298 |
NSView *RenderThemeMac::documentViewFor(const RenderObject& o) const |
| 299 |
{ |
299 |
{ |
| 300 |
LocalDefaultSystemAppearance localAppearance(o.page().useSystemAppearance(), o.page().useDarkAppearance()); |
300 |
LocalDefaultSystemAppearance localAppearance(usingDarkAppearance(o)); |
| 301 |
ControlStates states(extractControlStatesForRenderer(o)); |
301 |
ControlStates states(extractControlStatesForRenderer(o)); |
| 302 |
return ThemeMac::ensuredView(&o.view().frameView(), states); |
302 |
return ThemeMac::ensuredView(&o.view().frameView(), states); |
| 303 |
} |
303 |
} |
|
Lines 392-405
String RenderThemeMac::imageControlsStyleSheet() const
a/Source/WebCore/rendering/RenderThemeMac.mm_sec2
|
| 392 |
|
392 |
|
| 393 |
Color RenderThemeMac::platformActiveSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const |
393 |
Color RenderThemeMac::platformActiveSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const |
| 394 |
{ |
394 |
{ |
| 395 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseSystemAppearance), options.contains(StyleColor::Options::UseDarkAppearance)); |
395 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseDarkAppearance)); |
| 396 |
return colorFromNSColor([NSColor selectedTextBackgroundColor]); |
396 |
return colorFromNSColor([NSColor selectedTextBackgroundColor]); |
| 397 |
} |
397 |
} |
| 398 |
|
398 |
|
| 399 |
Color RenderThemeMac::platformInactiveSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const |
399 |
Color RenderThemeMac::platformInactiveSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const |
| 400 |
{ |
400 |
{ |
| 401 |
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 |
401 |
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 |
| 402 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseSystemAppearance), options.contains(StyleColor::Options::UseDarkAppearance)); |
402 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseDarkAppearance)); |
| 403 |
return colorFromNSColor([NSColor unemphasizedSelectedTextBackgroundColor]); |
403 |
return colorFromNSColor([NSColor unemphasizedSelectedTextBackgroundColor]); |
| 404 |
#else |
404 |
#else |
| 405 |
UNUSED_PARAM(options); |
405 |
UNUSED_PARAM(options); |
|
Lines 409-415
Color RenderThemeMac::platformInactiveSelectionBackgroundColor(OptionSet<StyleCo
a/Source/WebCore/rendering/RenderThemeMac.mm_sec3
|
| 409 |
|
409 |
|
| 410 |
Color RenderThemeMac::transformSelectionBackgroundColor(const Color& color, OptionSet<StyleColor::Options> options) const |
410 |
Color RenderThemeMac::transformSelectionBackgroundColor(const Color& color, OptionSet<StyleColor::Options> options) const |
| 411 |
{ |
411 |
{ |
| 412 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseSystemAppearance), options.contains(StyleColor::Options::UseDarkAppearance)); |
412 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseDarkAppearance)); |
| 413 |
if (localAppearance.usingDarkAppearance()) { |
413 |
if (localAppearance.usingDarkAppearance()) { |
| 414 |
// Use an alpha value that is similar to results from blendWithWhite() on light colors. |
414 |
// Use an alpha value that is similar to results from blendWithWhite() on light colors. |
| 415 |
static const float darkAppearanceAlpha = 0.8; |
415 |
static const float darkAppearanceAlpha = 0.8; |
|
Lines 421-433
Color RenderThemeMac::transformSelectionBackgroundColor(const Color& color, Opti
a/Source/WebCore/rendering/RenderThemeMac.mm_sec4
|
| 421 |
|
421 |
|
| 422 |
bool RenderThemeMac::supportsSelectionForegroundColors(OptionSet<StyleColor::Options> options) const |
422 |
bool RenderThemeMac::supportsSelectionForegroundColors(OptionSet<StyleColor::Options> options) const |
| 423 |
{ |
423 |
{ |
| 424 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseSystemAppearance), options.contains(StyleColor::Options::UseDarkAppearance)); |
424 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseDarkAppearance)); |
| 425 |
return localAppearance.usingDarkAppearance(); |
425 |
return localAppearance.usingDarkAppearance(); |
| 426 |
} |
426 |
} |
| 427 |
|
427 |
|
| 428 |
Color RenderThemeMac::platformActiveSelectionForegroundColor(OptionSet<StyleColor::Options> options) const |
428 |
Color RenderThemeMac::platformActiveSelectionForegroundColor(OptionSet<StyleColor::Options> options) const |
| 429 |
{ |
429 |
{ |
| 430 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseSystemAppearance), options.contains(StyleColor::Options::UseDarkAppearance)); |
430 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseDarkAppearance)); |
| 431 |
if (localAppearance.usingDarkAppearance()) |
431 |
if (localAppearance.usingDarkAppearance()) |
| 432 |
return colorFromNSColor([NSColor selectedTextColor]); |
432 |
return colorFromNSColor([NSColor selectedTextColor]); |
| 433 |
return { }; |
433 |
return { }; |
|
Lines 436-442
Color RenderThemeMac::platformActiveSelectionForegroundColor(OptionSet<StyleColo
a/Source/WebCore/rendering/RenderThemeMac.mm_sec5
|
| 436 |
Color RenderThemeMac::platformInactiveSelectionForegroundColor(OptionSet<StyleColor::Options> options) const |
436 |
Color RenderThemeMac::platformInactiveSelectionForegroundColor(OptionSet<StyleColor::Options> options) const |
| 437 |
{ |
437 |
{ |
| 438 |
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 |
438 |
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 |
| 439 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseSystemAppearance), options.contains(StyleColor::Options::UseDarkAppearance)); |
439 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseDarkAppearance)); |
| 440 |
if (localAppearance.usingDarkAppearance()) |
440 |
if (localAppearance.usingDarkAppearance()) |
| 441 |
return colorFromNSColor([NSColor unemphasizedSelectedTextColor]); |
441 |
return colorFromNSColor([NSColor unemphasizedSelectedTextColor]); |
| 442 |
return { }; |
442 |
return { }; |
|
Lines 449-455
Color RenderThemeMac::platformInactiveSelectionForegroundColor(OptionSet<StyleCo
a/Source/WebCore/rendering/RenderThemeMac.mm_sec6
|
| 449 |
Color RenderThemeMac::platformActiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const |
449 |
Color RenderThemeMac::platformActiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const |
| 450 |
{ |
450 |
{ |
| 451 |
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 |
451 |
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 |
| 452 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseSystemAppearance), options.contains(StyleColor::Options::UseDarkAppearance)); |
452 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseDarkAppearance)); |
| 453 |
return colorFromNSColor([NSColor selectedContentBackgroundColor]); |
453 |
return colorFromNSColor([NSColor selectedContentBackgroundColor]); |
| 454 |
#else |
454 |
#else |
| 455 |
UNUSED_PARAM(options); |
455 |
UNUSED_PARAM(options); |
|
Lines 460-466
Color RenderThemeMac::platformActiveListBoxSelectionBackgroundColor(OptionSet<St
a/Source/WebCore/rendering/RenderThemeMac.mm_sec7
|
| 460 |
Color RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const |
460 |
Color RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor(OptionSet<StyleColor::Options> options) const |
| 461 |
{ |
461 |
{ |
| 462 |
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 |
462 |
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 |
| 463 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseSystemAppearance), options.contains(StyleColor::Options::UseDarkAppearance)); |
463 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseDarkAppearance)); |
| 464 |
return colorFromNSColor([NSColor unemphasizedSelectedContentBackgroundColor]); |
464 |
return colorFromNSColor([NSColor unemphasizedSelectedContentBackgroundColor]); |
| 465 |
#else |
465 |
#else |
| 466 |
UNUSED_PARAM(options); |
466 |
UNUSED_PARAM(options); |
|
Lines 470-483
Color RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor(OptionSet<
a/Source/WebCore/rendering/RenderThemeMac.mm_sec8
|
| 470 |
|
470 |
|
| 471 |
Color RenderThemeMac::platformActiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options> options) const |
471 |
Color RenderThemeMac::platformActiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options> options) const |
| 472 |
{ |
472 |
{ |
| 473 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseSystemAppearance), options.contains(StyleColor::Options::UseDarkAppearance)); |
473 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseDarkAppearance)); |
| 474 |
return colorFromNSColor([NSColor alternateSelectedControlTextColor]); |
474 |
return colorFromNSColor([NSColor alternateSelectedControlTextColor]); |
| 475 |
} |
475 |
} |
| 476 |
|
476 |
|
| 477 |
Color RenderThemeMac::platformInactiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options> options) const |
477 |
Color RenderThemeMac::platformInactiveListBoxSelectionForegroundColor(OptionSet<StyleColor::Options> options) const |
| 478 |
{ |
478 |
{ |
| 479 |
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 |
479 |
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 |
| 480 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseSystemAppearance), options.contains(StyleColor::Options::UseDarkAppearance)); |
480 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseDarkAppearance)); |
| 481 |
return colorFromNSColor([NSColor unemphasizedSelectedTextColor]); |
481 |
return colorFromNSColor([NSColor unemphasizedSelectedTextColor]); |
| 482 |
#else |
482 |
#else |
| 483 |
UNUSED_PARAM(options); |
483 |
UNUSED_PARAM(options); |
|
Lines 495-501
Color RenderThemeMac::platformFocusRingColor(OptionSet<StyleColor::Options> opti
a/Source/WebCore/rendering/RenderThemeMac.mm_sec9
|
| 495 |
Color RenderThemeMac::platformActiveTextSearchHighlightColor(OptionSet<StyleColor::Options> options) const |
495 |
Color RenderThemeMac::platformActiveTextSearchHighlightColor(OptionSet<StyleColor::Options> options) const |
| 496 |
{ |
496 |
{ |
| 497 |
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300 |
497 |
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300 |
| 498 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseSystemAppearance), options.contains(StyleColor::Options::UseDarkAppearance)); |
498 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseDarkAppearance)); |
| 499 |
return colorFromNSColor([NSColor findHighlightColor]); |
499 |
return colorFromNSColor([NSColor findHighlightColor]); |
| 500 |
#else |
500 |
#else |
| 501 |
UNUSED_PARAM(options); |
501 |
UNUSED_PARAM(options); |
|
Lines 612-620
void RenderThemeMac::platformColorsDidChange()
a/Source/WebCore/rendering/RenderThemeMac.mm_sec10
|
| 612 |
|
612 |
|
| 613 |
auto RenderThemeMac::colorCache(OptionSet<StyleColor::Options> options) const -> ColorCache& |
613 |
auto RenderThemeMac::colorCache(OptionSet<StyleColor::Options> options) const -> ColorCache& |
| 614 |
{ |
614 |
{ |
| 615 |
const bool useSystemAppearance = options.contains(StyleColor::Options::UseSystemAppearance); |
615 |
LocalDefaultSystemAppearance localAppearance(options.contains(StyleColor::Options::UseDarkAppearance)); |
| 616 |
const bool useDarkAppearance = options.contains(StyleColor::Options::UseDarkAppearance); |
|
|
| 617 |
LocalDefaultSystemAppearance localAppearance(useSystemAppearance, useDarkAppearance); |
| 618 |
if (localAppearance.usingDarkAppearance()) |
616 |
if (localAppearance.usingDarkAppearance()) |
| 619 |
return m_darkColorCache; |
617 |
return m_darkColorCache; |
| 620 |
return RenderTheme::colorCache(options); |
618 |
return RenderTheme::colorCache(options); |
|
Lines 626-632
Color RenderThemeMac::systemColor(CSSValueID cssValueID, OptionSet<StyleColor::O
a/Source/WebCore/rendering/RenderThemeMac.mm_sec11
|
| 626 |
const bool useDarkAppearance = options.contains(StyleColor::Options::UseDarkAppearance); |
624 |
const bool useDarkAppearance = options.contains(StyleColor::Options::UseDarkAppearance); |
| 627 |
const bool forVisitedLink = options.contains(StyleColor::Options::ForVisitedLink); |
625 |
const bool forVisitedLink = options.contains(StyleColor::Options::ForVisitedLink); |
| 628 |
|
626 |
|
| 629 |
LocalDefaultSystemAppearance localAppearance(useSystemAppearance, useDarkAppearance); |
627 |
LocalDefaultSystemAppearance localAppearance(useDarkAppearance); |
| 630 |
|
628 |
|
| 631 |
auto& cache = colorCache(options); |
629 |
auto& cache = colorCache(options); |
| 632 |
|
630 |
|
|
Lines 1802-1808
void RenderThemeMac::setPopupButtonCellState(const RenderObject& o, const IntSiz
a/Source/WebCore/rendering/RenderThemeMac.mm_sec12
|
| 1802 |
|
1800 |
|
| 1803 |
void RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary(NSCell* cell, const RenderObject& renderer, const PaintInfo& paintInfo, const FloatRect& rect) |
1801 |
void RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary(NSCell* cell, const RenderObject& renderer, const PaintInfo& paintInfo, const FloatRect& rect) |
| 1804 |
{ |
1802 |
{ |
| 1805 |
LocalDefaultSystemAppearance localAppearance(renderer.page().useSystemAppearance(), renderer.page().useDarkAppearance()); |
1803 |
LocalDefaultSystemAppearance localAppearance(usingDarkAppearance(renderer)); |
| 1806 |
bool shouldDrawFocusRing = isFocused(renderer) && renderer.style().outlineStyleIsAuto() == OutlineIsAuto::On; |
1804 |
bool shouldDrawFocusRing = isFocused(renderer) && renderer.style().outlineStyleIsAuto() == OutlineIsAuto::On; |
| 1807 |
bool shouldUseImageBuffer = renderer.style().effectiveZoom() != 1 || renderer.page().pageScaleFactor() != 1; |
1805 |
bool shouldUseImageBuffer = renderer.style().effectiveZoom() != 1 || renderer.page().pageScaleFactor() != 1; |
| 1808 |
bool shouldDrawCell = true; |
1806 |
bool shouldDrawCell = true; |
|
Lines 1884-1890
bool RenderThemeMac::paintSliderThumb(const RenderObject& o, const PaintInfo& pa
a/Source/WebCore/rendering/RenderThemeMac.mm_sec13
|
| 1884 |
? sliderThumbVertical() |
1882 |
? sliderThumbVertical() |
| 1885 |
: sliderThumbHorizontal(); |
1883 |
: sliderThumbHorizontal(); |
| 1886 |
|
1884 |
|
| 1887 |
LocalDefaultSystemAppearance localAppearance(o.page().useSystemAppearance(), o.page().useDarkAppearance()); |
1885 |
LocalDefaultSystemAppearance localAppearance(usingDarkAppearance(o)); |
| 1888 |
|
1886 |
|
| 1889 |
LocalCurrentGraphicsContext localContext(paintInfo.context()); |
1887 |
LocalCurrentGraphicsContext localContext(paintInfo.context()); |
| 1890 |
|
1888 |
|
|
Lines 2997-3008
bool RenderThemeMac::paintAttachment(const RenderObject& renderer, const PaintIn
a/Source/WebCore/rendering/RenderThemeMac.mm_sec14
|
| 2997 |
|
2995 |
|
| 2998 |
bool RenderThemeMac::usingDarkAppearance(const RenderObject& o) const |
2996 |
bool RenderThemeMac::usingDarkAppearance(const RenderObject& o) const |
| 2999 |
{ |
2997 |
{ |
| 3000 |
#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 |
2998 |
return o.document().useDarkAppearance(); |
| 3001 |
return o.page().useSystemAppearance() && o.page().useDarkAppearance(); |
|
|
| 3002 |
#else |
| 3003 |
UNUSED_PARAM(o); |
| 3004 |
return false; |
| 3005 |
#endif |
| 3006 |
} |
2999 |
} |
| 3007 |
|
3000 |
|
| 3008 |
CGColorRef RenderThemeMac::colorForMarkerLineStyle(DocumentMarkerLineStyle style, bool useDarkMode) |
3001 |
CGColorRef RenderThemeMac::colorForMarkerLineStyle(DocumentMarkerLineStyle style, bool useDarkMode) |