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

Side by Side Diff: Source/core/html/shadow/TextControlInnerElements.cpp

Issue 471803003: Adjust autofilled property for <search> input and <select> elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase and add NeedsRebaseLine for window test. Created 6 years, 4 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 | « Source/core/html/HTMLSelectElement.cpp ('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) 2006, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 RefPtrWillBeRawPtr<HTMLInputElement> input(toHTMLInputElement(shadowHost())) ; 224 RefPtrWillBeRawPtr<HTMLInputElement> input(toHTMLInputElement(shadowHost())) ;
225 if (!input || input->isDisabledOrReadOnly()) { 225 if (!input || input->isDisabledOrReadOnly()) {
226 if (!event->defaultHandled()) 226 if (!event->defaultHandled())
227 HTMLDivElement::defaultEventHandler(event); 227 HTMLDivElement::defaultEventHandler(event);
228 return; 228 return;
229 } 229 }
230 230
231 231
232 if (event->type() == EventTypeNames::click && event->isMouseEvent() && toMou seEvent(event)->button() == LeftButton) { 232 if (event->type() == EventTypeNames::click && event->isMouseEvent() && toMou seEvent(event)->button() == LeftButton) {
233 input->setValueForUser(""); 233 input->setValueForUser("");
234 input->setAutofilled(false);
234 input->onSearch(); 235 input->onSearch();
235 event->setDefaultHandled(); 236 event->setDefaultHandled();
236 } 237 }
237 238
238 if (!event->defaultHandled()) 239 if (!event->defaultHandled())
239 HTMLDivElement::defaultEventHandler(event); 240 HTMLDivElement::defaultEventHandler(event);
240 } 241 }
241 242
242 bool SearchFieldCancelButtonElement::willRespondToMouseClickEvents() 243 bool SearchFieldCancelButtonElement::willRespondToMouseClickEvents()
243 { 244 {
244 const HTMLInputElement* input = toHTMLInputElement(shadowHost()); 245 const HTMLInputElement* input = toHTMLInputElement(shadowHost());
245 if (input && !input->isDisabledOrReadOnly()) 246 if (input && !input->isDisabledOrReadOnly())
246 return true; 247 return true;
247 248
248 return HTMLDivElement::willRespondToMouseClickEvents(); 249 return HTMLDivElement::willRespondToMouseClickEvents();
249 } 250 }
250 251
251 } 252 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLSelectElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698