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

Side by Side Diff: Source/core/html/HTMLFormControlElement.cpp

Issue 137833018: Remove form control related virtual methods from Element (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add HTMLFormControlElement.setFocus as suggested Created 6 years, 10 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/HTMLFormControlElement.h ('k') | Source/core/html/HTMLOptGroupElement.h » ('j') | 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 247
248 void HTMLFormControlElement::removedFrom(ContainerNode* insertionPoint) 248 void HTMLFormControlElement::removedFrom(ContainerNode* insertionPoint)
249 { 249 {
250 m_validationMessage = nullptr; 250 m_validationMessage = nullptr;
251 m_ancestorDisabledState = AncestorDisabledStateUnknown; 251 m_ancestorDisabledState = AncestorDisabledStateUnknown;
252 m_dataListAncestorState = Unknown; 252 m_dataListAncestorState = Unknown;
253 HTMLElement::removedFrom(insertionPoint); 253 HTMLElement::removedFrom(insertionPoint);
254 FormAssociatedElement::removedFrom(insertionPoint); 254 FormAssociatedElement::removedFrom(insertionPoint);
255 } 255 }
256 256
257 bool HTMLFormControlElement::wasChangedSinceLastFormControlChangeEvent() const
258 {
259 return m_wasChangedSinceLastFormControlChangeEvent;
260 }
261
262 void HTMLFormControlElement::setChangedSinceLastFormControlChangeEvent(bool chan ged) 257 void HTMLFormControlElement::setChangedSinceLastFormControlChangeEvent(bool chan ged)
263 { 258 {
264 m_wasChangedSinceLastFormControlChangeEvent = changed; 259 m_wasChangedSinceLastFormControlChangeEvent = changed;
265 } 260 }
266 261
267 void HTMLFormControlElement::dispatchChangeEvent() 262 void HTMLFormControlElement::dispatchChangeEvent()
268 { 263 {
269 dispatchScopedEvent(Event::createBubble(EventTypeNames::change)); 264 dispatchScopedEvent(Event::createBubble(EventTypeNames::change));
270 } 265 }
271 266
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 { 495 {
501 String fullName = name(); 496 String fullName = name();
502 String trimmedName = fullName.stripWhiteSpace(); 497 String trimmedName = fullName.stripWhiteSpace();
503 if (!trimmedName.isEmpty()) 498 if (!trimmedName.isEmpty())
504 return trimmedName; 499 return trimmedName;
505 fullName = getIdAttribute(); 500 fullName = getIdAttribute();
506 trimmedName = fullName.stripWhiteSpace(); 501 trimmedName = fullName.stripWhiteSpace();
507 return trimmedName; 502 return trimmedName;
508 } 503 }
509 504
505 void HTMLFormControlElement::setFocus(bool flag)
506 {
507 LabelableElement::setFocus(flag);
508
509 if (!flag && wasChangedSinceLastFormControlChangeEvent())
510 dispatchFormControlChangeEvent();
511 }
512
510 } // namespace Webcore 513 } // namespace Webcore
OLDNEW
« no previous file with comments | « Source/core/html/HTMLFormControlElement.h ('k') | Source/core/html/HTMLOptGroupElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698