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

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

Issue 1523633002: Fix a crash when 'input' event handler for input[type=color] change the input type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 void ColorInputType::valueAttributeChanged() 199 void ColorInputType::valueAttributeChanged()
200 { 200 {
201 if (!element().hasDirtyValue()) 201 if (!element().hasDirtyValue())
202 element().updateView(); 202 element().updateView();
203 } 203 }
204 204
205 void ColorInputType::didChooseColor(const Color& color) 205 void ColorInputType::didChooseColor(const Color& color)
206 { 206 {
207 if (element().isDisabledFormControl() || color == valueAsColor()) 207 if (element().isDisabledFormControl() || color == valueAsColor())
208 return; 208 return;
209 EventQueueScope scope;
209 element().setValueFromRenderer(color.serialized()); 210 element().setValueFromRenderer(color.serialized());
210 element().updateView(); 211 element().updateView();
211 if (!LayoutTheme::theme().isModalColorChooser()) 212 if (!LayoutTheme::theme().isModalColorChooser())
212 element().dispatchFormControlChangeEvent(); 213 element().dispatchFormControlChangeEvent();
213 } 214 }
214 215
215 void ColorInputType::didEndChooser() 216 void ColorInputType::didEndChooser()
216 { 217 {
217 EventQueueScope scope; 218 EventQueueScope scope;
218 if (LayoutTheme::theme().isModalColorChooser()) 219 if (LayoutTheme::theme().isModalColorChooser())
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 { 287 {
287 return m_chooser ? m_chooser->rootAXObject() : nullptr; 288 return m_chooser ? m_chooser->rootAXObject() : nullptr;
288 } 289 }
289 290
290 ColorChooserClient* ColorInputType::colorChooserClient() 291 ColorChooserClient* ColorInputType::colorChooserClient()
291 { 292 {
292 return this; 293 return this;
293 } 294 }
294 295
295 } // namespace blink 296 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698