[macOS] Color wells should appear pressed when presenting a color picker
[WebKit-https.git] / Source / WebKit / UIProcess / WebPageProxy.cpp
index 7a6f275..ac17b42 100644 (file)
@@ -4800,7 +4800,8 @@ void WebPageProxy::setColorPickerColor(const WebCore::Color& color)
 
 void WebPageProxy::endColorPicker()
 {
-    ASSERT(m_colorPicker);
+    if (!m_colorPicker)
+        return;
 
     m_colorPicker->endPicker();
 }
@@ -4818,13 +4819,7 @@ void WebPageProxy::didEndColorPicker()
     if (!isValid())
         return;
 
-#if ENABLE(INPUT_TYPE_COLOR)
-    if (m_colorPicker) {
-        m_colorPicker->invalidate();
-        m_colorPicker = nullptr;
-    }
-#endif
-
+    m_colorPicker = nullptr;
     m_process->send(Messages::WebPage::DidEndColorPicker(), m_pageID);
 }
 #endif
@@ -6113,13 +6108,6 @@ void WebPageProxy::resetState(ResetStateReason resetStateReason)
     m_touchEventTracking.reset();
 #endif
 
-#if ENABLE(INPUT_TYPE_COLOR)
-    if (m_colorPicker) {
-        m_colorPicker->invalidate();
-        m_colorPicker = nullptr;
-    }
-#endif
-
 #if ENABLE(GEOLOCATION)
     m_geolocationPermissionRequestManager.invalidateRequests();
 #endif
@@ -7657,8 +7645,7 @@ void WebPageProxy::closeOverlayedViews()
 #endif
 
 #if ENABLE(INPUT_TYPE_COLOR_POPOVER) && ENABLE(INPUT_TYPE_COLOR)
-    if (m_colorPicker)
-        endColorPicker();
+    endColorPicker();
 #endif
 }