WebKit Bugzilla
Attachment 342382 Details for
Bug 186472
: Link drag image is inconsistently unreadable in dark mode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186472-20180610023538.patch (text/plain), 6.67 KB, created by
Tim Horton
on 2018-06-10 02:35:39 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Tim Horton
Created:
2018-06-10 02:35:39 PDT
Size:
6.67 KB
patch
obsolete
>Subversion Revision: 232650 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 23b06e5d5d708fe6d96fc2e8dd8d5e8af660377b..d6eaa847355ae811abe48f2a0ae71ac1bdb9fd56 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,20 @@ >+2018-06-10 Tim Horton <timothy_horton@apple.com> >+ >+ Link drag image is inconsistently unreadable in dark mode >+ https://bugs.webkit.org/show_bug.cgi?id=186472 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * platform/mac/DragImageMac.mm: >+ (WebCore::createDragImageForLink): >+ Use LocalDefaultSystemAppearance so that NSColors used inside >+ createDragImageForLink are interpreted correctly. This function >+ always follows the system appearance regardless of what the preference >+ is set to, because it's generating UI that isn't part of the page. >+ >+ Use controlBackgroundColor to get a consistently contrasting background >+ for the link drag image. >+ > 2018-06-07 Jer Noble <jer.noble@apple.com> > > REGRESSION: Cannot listen to audio on Google Translate with side switch set to "vibrate" >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 4563ec81fa891fe19293783a6fac247476f632bd..39cce4864ca1cae4ab069783949fe323937105ef 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,17 @@ >+2018-06-10 Tim Horton <timothy_horton@apple.com> >+ >+ Link drag image is inconsistently unreadable in dark mode >+ https://bugs.webkit.org/show_bug.cgi?id=186472 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UIProcess/Cocoa/WebViewImpl.mm: >+ (WebKit::WebViewImpl::useDefaultAppearance): >+ Make defaultAppearance accurate even if useSystemAppearance is false. >+ Some parts of WebKit (like the link drag image, but also context menus) >+ want to be able to follow the system appearance regardless of whether >+ the view or content has opted in. >+ > 2018-06-08 Aditya Keerthi <akeerthi@apple.com> > > [Datalist] Allow TextFieldInputType to show and hide suggestions >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index 2b3ae50da359b18c5ceb7f0a463aed98c47a0330..136298f2d782d9e944b4dc89d41906584b5e6104 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,17 @@ >+2018-06-10 Tim Horton <timothy_horton@apple.com> >+ >+ Link drag image is inconsistently unreadable in dark mode >+ https://bugs.webkit.org/show_bug.cgi?id=186472 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebView/WebView.mm: >+ (-[WebView _defaultAppearance]): >+ Make defaultAppearance accurate even if useSystemAppearance is false. >+ Some parts of WebKit (like the link drag image, but also context menus) >+ want to be able to follow the system appearance regardless of whether >+ the view or content has opted in. >+ > 2018-06-08 Aditya Keerthi <akeerthi@apple.com> > > [Datalist] Allow TextFieldInputType to show and hide suggestions >diff --git a/Source/WebCore/platform/mac/DragImageMac.mm b/Source/WebCore/platform/mac/DragImageMac.mm >index 386ed615684d96dbedb952c49c0e045c9d78a851..d31604abb62c49332bfb479043f5f228f465530c 100644 >--- a/Source/WebCore/platform/mac/DragImageMac.mm >+++ b/Source/WebCore/platform/mac/DragImageMac.mm >@@ -29,6 +29,7 @@ > #if ENABLE(DRAG_SUPPORT) && PLATFORM(MAC) > > #import "BitmapImage.h" >+#import "ColorMac.h" > #import "Element.h" > #import "FloatRoundedRect.h" > #import "FontCascade.h" >@@ -36,6 +37,8 @@ > #import "FontSelector.h" > #import "GraphicsContext.h" > #import "Image.h" >+#import "LocalDefaultSystemAppearance.h" >+#import "Page.h" > #import "StringTruncator.h" > #import "TextIndicator.h" > #import "URL.h" >@@ -294,10 +297,14 @@ LinkImageLayout::LinkImageLayout(URL& url, const String& titleString) > boundingRect.setHeight((static_cast<int>(boundingRect.height() / 2) * 2)); > } > >-DragImageRef createDragImageForLink(Element&, URL& url, const String& title, TextIndicatorData&, FontRenderingMode, float deviceScaleFactor) >+DragImageRef createDragImageForLink(Element& element, URL& url, const String& title, TextIndicatorData&, FontRenderingMode, float deviceScaleFactor) > { > LinkImageLayout layout(url, title); > >+ Page* page = element.document().page(); >+ >+ LocalDefaultSystemAppearance localAppearance(true, page ? page->defaultAppearance() : true); >+ > auto imageSize = layout.boundingRect.size(); > #if __MAC_OS_X_VERSION_MIN_REQUIRED < 101300 > imageSize.expand(2 * linkImageShadowRadius, 2 * linkImageShadowRadius - linkImageShadowOffsetY); >@@ -314,7 +321,7 @@ DragImageRef createDragImageForLink(Element&, URL& url, const String& title, Tex > context.translate(linkImageShadowRadius, linkImageShadowRadius - linkImageShadowOffsetY); > context.setShadow({ 0, linkImageShadowOffsetY }, linkImageShadowRadius, { 0.f, 0.f, 0.f, .25 }); > #endif >- context.fillRoundedRect(FloatRoundedRect(layout.boundingRect, FloatRoundedRect::Radii(linkImageCornerRadius)), Color::white); >+ context.fillRoundedRect(FloatRoundedRect(layout.boundingRect, FloatRoundedRect::Radii(linkImageCornerRadius)), colorFromNSColor([NSColor controlBackgroundColor])); > #if __MAC_OS_X_VERSION_MIN_REQUIRED < 101300 > context.clearShadow(); > #endif >diff --git a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >index b3fbba45d81823138fd70cf42201e65c40c3d48c..939c050eb6cd1cc8ac28614d79b100a7a0c48116 100644 >--- a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >+++ b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >@@ -5016,9 +5016,6 @@ bool WebViewImpl::useSystemAppearance() > bool WebViewImpl::useDefaultAppearance() > { > #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 >- if (!useSystemAppearance()) >- return true; >- > NSAppearanceName appearance = [[m_view effectiveAppearance] bestMatchFromAppearancesWithNames:@[ NSAppearanceNameAqua, NSAppearanceNameDarkAqua ]]; > return [appearance isEqualToString:NSAppearanceNameAqua]; > #else >diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/mac/WebView/WebView.mm >index 0e2f7c27c118b1f3248ea6f001734c9dcb8e612f..b1f161e3b6bd2372f027ec6d5edcf93a50cb6620 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebView.mm >@@ -5278,9 +5278,6 @@ - (WebEdgeInsets)_unobscuredSafeAreaInsets > - (bool)_defaultAppearance > { > #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 >- if (![self _useSystemAppearance]) >- return true; >- > NSAppearanceName appearance = [[self effectiveAppearance] bestMatchFromAppearancesWithNames:@[ NSAppearanceNameAqua, NSAppearanceNameDarkAqua ]]; > return [appearance isEqualToString:NSAppearanceNameAqua]; > #else
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186472
: 342382 |
342383