WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
188477
[macOS] Color wells should appear pressed when presenting a color picker
https://bugs.webkit.org/show_bug.cgi?id=188477
Summary
[macOS] Color wells should appear pressed when presenting a color picker
Aditya Keerthi
Reported
2018-08-10 13:29:54 PDT
Color wells should appear pressed when presenting a color picker.
Attachments
Patch
(119.24 KB, patch)
2018-08-10 13:55 PDT
,
Aditya Keerthi
no flags
Details
Formatted Diff
Diff
Patch
(119.68 KB, patch)
2018-08-10 14:39 PDT
,
Aditya Keerthi
thorton
: review+
Details
Formatted Diff
Diff
Patch for landing
(119.70 KB, patch)
2018-08-12 11:38 PDT
,
Aditya Keerthi
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Aditya Keerthi
Comment 1
2018-08-10 13:55:21 PDT
Created
attachment 346921
[details]
Patch
Tim Horton
Comment 2
2018-08-10 14:02:20 PDT
Comment on
attachment 346921
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=346921&action=review
> Source/WebCore/platform/mac/ThemeMac.mm:714 > + NSButtonCell *buttonCell = button(ColorWellPart, controlStates, IntSize(zoomedRect.size()), zoomFactor);
This button is kept statically, right? Who unsets highlighted?
> Source/WebKit/UIProcess/WebColorPicker.cpp:48 > + m_client = 0;
nullptr?
> Source/WebKit/UIProcess/mac/WebColorPickerMac.mm:98 > + if (m_colorPickerUI) {
Why doesn't this just call endPicker?
Aditya Keerthi
Comment 3
2018-08-10 14:24:04 PDT
(In reply to Tim Horton from
comment #2
)
> Comment on
attachment 346921
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=346921&action=review
> > > Source/WebCore/platform/mac/ThemeMac.mm:714 > > + NSButtonCell *buttonCell = button(ColorWellPart, controlStates, IntSize(zoomedRect.size()), zoomFactor); > > This button is kept statically, right? Who unsets highlighted?
Each time a button cell is created, setUpButtonCell is called. This in turn calls updateStates, which sets the correct highlighted value given the state. Both of those methods are in ThemeMac. Now that I think about it, it might make sense to move the statement that sets the highlight from paintColorWell, to updateStates.
> > > Source/WebKit/UIProcess/mac/WebColorPickerMac.mm:98 > > + if (m_colorPickerUI) { > > Why doesn't this just call endPicker?
There are two ways this destructor can be called. One is by calling endPicker() which eventually sets m_colorPicker to nullptr in WebPageProxy. If we had endPicker() in the destructor we would be calling endPicker() in an infinite loop. The other way for the destructor to be called is for a new color picker to be created while the previous one is still active. For example, when clicking on another color input while one is already active. In this case, endPicker() may not be called before the new color picker is created - which is why we invalidate m_colorPickerUI.
Tim Horton
Comment 4
2018-08-10 14:29:16 PDT
(In reply to Aditya Keerthi from
comment #3
)
> (In reply to Tim Horton from
comment #2
) > > Comment on
attachment 346921
[details]
> > Patch > > > > View in context: > >
https://bugs.webkit.org/attachment.cgi?id=346921&action=review
> > > > > Source/WebCore/platform/mac/ThemeMac.mm:714 > > > + NSButtonCell *buttonCell = button(ColorWellPart, controlStates, IntSize(zoomedRect.size()), zoomFactor); > > > > This button is kept statically, right? Who unsets highlighted? > > Each time a button cell is created, setUpButtonCell is called. This in turn > calls updateStates, which sets the correct highlighted value given the > state. Both of those methods are in ThemeMac. Now that I think about it, it > might make sense to move the statement that sets the highlight from > paintColorWell, to updateStates.
Yes please. Also fix the build.
Aditya Keerthi
Comment 5
2018-08-10 14:39:06 PDT
Created
attachment 346926
[details]
Patch
Tim Horton
Comment 6
2018-08-11 12:41:00 PDT
Comment on
attachment 346926
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=346926&action=review
> Source/WebKit/UIProcess/mac/WebColorPickerMac.mm:55 > +@protocol WKPopoverColorWellDelegate<NSObject>
You should check, but I think we usually put a space before brackets for protocol conformance
> Source/WebKit/UIProcess/mac/WebColorPickerMac.mm:277 > + [[NSColorPanel sharedColorPanel] setDelegate:nil];
Why do you use dot notation for delegate on one line and bracket notation on the next? DOTS!
Aditya Keerthi
Comment 7
2018-08-12 11:38:06 PDT
Created
attachment 346987
[details]
Patch for landing
WebKit Commit Bot
Comment 8
2018-08-12 13:19:32 PDT
Comment on
attachment 346987
[details]
Patch for landing Clearing flags on attachment: 346987 Committed
r234788
: <
https://trac.webkit.org/changeset/234788
>
Radar WebKit Bug Importer
Comment 9
2018-08-16 11:57:21 PDT
<
rdar://problem/43391628
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug