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

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

Issue 540533004: Use style invalidation for more pseudo classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 3 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
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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 } else if (name == autofocusAttr) { 165 } else if (name == autofocusAttr) {
166 HTMLElement::parseAttribute(name, value); 166 HTMLElement::parseAttribute(name, value);
167 UseCounter::count(document(), UseCounter::AutoFocusAttribute); 167 UseCounter::count(document(), UseCounter::AutoFocusAttribute);
168 } else 168 } else
169 HTMLElement::parseAttribute(name, value); 169 HTMLElement::parseAttribute(name, value);
170 } 170 }
171 171
172 void HTMLFormControlElement::disabledAttributeChanged() 172 void HTMLFormControlElement::disabledAttributeChanged()
173 { 173 {
174 setNeedsWillValidateCheck(); 174 setNeedsWillValidateCheck();
175 didAffectSelector(AffectedSelectorDisabled | AffectedSelectorEnabled); 175 pseudoStateChanged(CSSSelector::PseudoDisabled);
176 pseudoStateChanged(CSSSelector::PseudoEnabled);
176 if (renderer() && renderer()->style()->hasAppearance()) 177 if (renderer() && renderer()->style()->hasAppearance())
177 RenderTheme::theme().stateChanged(renderer(), EnabledControlState); 178 RenderTheme::theme().stateChanged(renderer(), EnabledControlState);
178 if (isDisabledFormControl() && treeScope().adjustedFocusedElement() == this) { 179 if (isDisabledFormControl() && treeScope().adjustedFocusedElement() == this) {
179 // We might want to call blur(), but it's dangerous to dispatch events 180 // We might want to call blur(), but it's dangerous to dispatch events
180 // here. 181 // here.
181 document().setNeedsFocusedElementCheck(); 182 document().setNeedsFocusedElementCheck();
182 } 183 }
183 } 184 }
184 185
185 void HTMLFormControlElement::requiredAttributeChanged() 186 void HTMLFormControlElement::requiredAttributeChanged()
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 544
544 void HTMLFormControlElement::setFocus(bool flag) 545 void HTMLFormControlElement::setFocus(bool flag)
545 { 546 {
546 LabelableElement::setFocus(flag); 547 LabelableElement::setFocus(flag);
547 548
548 if (!flag && wasChangedSinceLastFormControlChangeEvent()) 549 if (!flag && wasChangedSinceLastFormControlChangeEvent())
549 dispatchFormControlChangeEvent(); 550 dispatchFormControlChangeEvent();
550 } 551 }
551 552
552 } // namespace Webcore 553 } // namespace Webcore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698