Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: third_party/WebKit/Source/core/html/forms/ColorInputType.cpp

Issue 2110783002: Open a color input with display:none via a label (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated test case as per review comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/forms/color/display-none-input-color-chooser-shown.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 if (!valueChanged) 160 if (!valueChanged)
161 return; 161 return;
162 162
163 element().updateView(); 163 element().updateView();
164 if (m_chooser) 164 if (m_chooser)
165 m_chooser->setSelectedColor(valueAsColor()); 165 m_chooser->setSelectedColor(valueAsColor());
166 } 166 }
167 167
168 void ColorInputType::handleDOMActivateEvent(Event* event) 168 void ColorInputType::handleDOMActivateEvent(Event* event)
169 { 169 {
170 if (element().isDisabledFormControl() || !element().layoutObject()) 170 if (element().isDisabledFormControl())
171 return; 171 return;
172 172
173 if (!UserGestureIndicator::utilizeUserGesture()) 173 if (!UserGestureIndicator::utilizeUserGesture())
174 return; 174 return;
175 175
176 ChromeClient* chromeClient = this->chromeClient(); 176 ChromeClient* chromeClient = this->chromeClient();
177 if (chromeClient && !m_chooser) 177 if (chromeClient && !m_chooser)
178 m_chooser = chromeClient->openColorChooser(element().document().frame(), this, valueAsColor()); 178 m_chooser = chromeClient->openColorChooser(element().document().frame(), this, valueAsColor());
179 179
180 event->setDefaultHandled(); 180 event->setDefaultHandled();
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 { 292 {
293 return m_chooser ? m_chooser->rootAXObject() : nullptr; 293 return m_chooser ? m_chooser->rootAXObject() : nullptr;
294 } 294 }
295 295
296 ColorChooserClient* ColorInputType::colorChooserClient() 296 ColorChooserClient* ColorInputType::colorChooserClient()
297 { 297 {
298 return this; 298 return this;
299 } 299 }
300 300
301 } // namespace blink 301 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/forms/color/display-none-input-color-chooser-shown.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698