WebKit Bugzilla
Attachment 342675 Details for
Bug 186597
: CSS "background-color" style no longer affects natively rendered text fields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186597-20180613105048.patch (text/plain), 4.68 KB, created by
Wenson Hsieh
on 2018-06-13 10:50:48 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2018-06-13 10:50:48 PDT
Size:
4.68 KB
patch
obsolete
>Subversion Revision: 232794 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 50328f184a6300ca0952105387d7cbae15dcafd5..d9edd0cac05ec58b79502fea35fd1a87890f2102 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,31 @@ >+2018-06-13 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ CSS "background-color" style no longer affects natively rendered text fields >+ https://bugs.webkit.org/show_bug.cgi?id=186597 >+ <rdar://problem/41050528> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ AppKit currently does not support rendering background color to the edges of a text field cell. This means that >+ in WebCore, when natively rendering text inputs with background color, we need to only draw the bezels of a text >+ field, such that the background color we paint behind the text field will be shown. Currently, the way we >+ accomplish this is by intercepting an internal NSTextField method that computes drawing options for CoreUI, and >+ inserting a `"borders only" => true` entry. >+ >+ However, in a recent build of macOS Mojave, AppKit tweaked -_coreUIDrawOptionsWithFrame:inView:includeFocus: to >+ add an extra argument (such that it's now -_coreUIDrawOptionsWithFrame:inView:includeFocus:maskOnly:), which >+ negates the above workaround. To fix this in the short term, augment the workaround to apply to the latest macOS >+ Mojave as well. A longer-term fix is already tracked in <rdar://problem/11385461>, which would allow WebKit to >+ simply specify a background color on the text field cell, and have AppKit render it properly to the edges of the >+ bezels. >+ >+ Covered by a test that is currently failing on Mojave: fast/forms/hidpi-textfield-background-bleeding.html >+ >+ * rendering/RenderThemeMac.mm: >+ (-[WebCoreTextFieldCell _adjustedCoreUIDrawOptionsForDrawingBordersOnly:]): >+ (-[WebCoreTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:]): >+ (-[WebCoreTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:maskOnly:]): >+ > 2018-06-13 Philippe Normand <pnormand@igalia.com> > > Unreviewed GTK build fix for --cmakeargs=-DUSE_GSTREAMER_GL=OFF >diff --git a/Source/WebCore/rendering/RenderThemeMac.mm b/Source/WebCore/rendering/RenderThemeMac.mm >index 34fa174140134ed6feedc21facc991677165c566..a2e3ce79343fbfe25dd4d00bfd37dadc59b507a5 100644 >--- a/Source/WebCore/rendering/RenderThemeMac.mm >+++ b/Source/WebCore/rendering/RenderThemeMac.mm >@@ -115,6 +115,7 @@ > // FIXME: This should go into an SPI.h file in the spi directory. > @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 > > // FIXME: This should go into an SPI.h file in the spi directory. >@@ -153,15 +154,26 @@ static const double progressAnimationNumFrames = 256; > > @implementation WebCoreTextFieldCell > >-- (CFDictionaryRef)_coreUIDrawOptionsWithFrame:(NSRect)cellFrame inView:(NSView *)controlView includeFocus:(BOOL)includeFocus >+- (CFDictionaryRef)_adjustedCoreUIDrawOptionsForDrawingBordersOnly:(CFDictionaryRef)defaultOptions > { >- // FIXME: This is a workaround for <rdar://problem/11385461>. When that bug is resolved, we should remove this code. >- CFMutableDictionaryRef coreUIDrawOptions = CFDictionaryCreateMutableCopy(NULL, 0, [super _coreUIDrawOptionsWithFrame:cellFrame inView:controlView includeFocus:includeFocus]); >+ // FIXME: This is a workaround for <rdar://problem/11385461>. When that bug is resolved, we should remove this code, >+ // as well as the internal method overrides below. >+ CFMutableDictionaryRef coreUIDrawOptions = CFDictionaryCreateMutableCopy(NULL, 0, defaultOptions); > CFDictionarySetValue(coreUIDrawOptions, CFSTR("borders only"), kCFBooleanTrue); > CFAutorelease(coreUIDrawOptions); > return coreUIDrawOptions; > } > >+- (CFDictionaryRef)_coreUIDrawOptionsWithFrame:(NSRect)cellFrame inView:(NSView *)controlView includeFocus:(BOOL)includeFocus >+{ >+ return [self _adjustedCoreUIDrawOptionsForDrawingBordersOnly:[super _coreUIDrawOptionsWithFrame:cellFrame inView:controlView includeFocus:includeFocus]]; >+} >+ >+- (CFDictionaryRef)_coreUIDrawOptionsWithFrame:(NSRect)cellFrame inView:(NSView *)controlView includeFocus:(BOOL)includeFocus maskOnly:(BOOL)maskOnly >+{ >+ return [self _adjustedCoreUIDrawOptionsForDrawingBordersOnly:[super _coreUIDrawOptionsWithFrame:cellFrame inView:controlView includeFocus:includeFocus maskOnly:maskOnly]]; >+} >+ > @end > > @interface WebCoreRenderThemeBundle : NSObject
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 186597
: 342675