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

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

Issue 2001453002: Set ComputedStyle on Node and use that in buildOwnLayout() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@storage
Patch Set: 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
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 formAttributeChanged(); 150 formAttributeChanged();
151 UseCounter::count(document(), UseCounter::FormAttribute); 151 UseCounter::count(document(), UseCounter::FormAttribute);
152 } else if (name == disabledAttr) { 152 } else if (name == disabledAttr) {
153 if (oldValue.isNull() != value.isNull()) 153 if (oldValue.isNull() != value.isNull())
154 disabledAttributeChanged(); 154 disabledAttributeChanged();
155 } else if (name == readonlyAttr) { 155 } else if (name == readonlyAttr) {
156 if (oldValue.isNull() != value.isNull()) { 156 if (oldValue.isNull() != value.isNull()) {
157 setNeedsWillValidateCheck(); 157 setNeedsWillValidateCheck();
158 pseudoStateChanged(CSSSelector::PseudoReadOnly); 158 pseudoStateChanged(CSSSelector::PseudoReadOnly);
159 pseudoStateChanged(CSSSelector::PseudoReadWrite); 159 pseudoStateChanged(CSSSelector::PseudoReadWrite);
160 if (layoutObject()) 160 if (hasLayoutObject())
161 LayoutTheme::theme().controlStateChanged(*layoutObject(), ReadOn lyControlState); 161 LayoutTheme::theme().controlStateChanged(*layoutObject(), ReadOn lyControlState);
162 } 162 }
163 } else if (name == requiredAttr) { 163 } else if (name == requiredAttr) {
164 if (oldValue.isNull() != value.isNull()) 164 if (oldValue.isNull() != value.isNull())
165 requiredAttributeChanged(); 165 requiredAttributeChanged();
166 UseCounter::count(document(), UseCounter::RequiredAttribute); 166 UseCounter::count(document(), UseCounter::RequiredAttribute);
167 } else if (name == autofocusAttr) { 167 } else if (name == autofocusAttr) {
168 HTMLElement::parseAttribute(name, oldValue, value); 168 HTMLElement::parseAttribute(name, oldValue, value);
169 UseCounter::count(document(), UseCounter::AutoFocusAttribute); 169 UseCounter::count(document(), UseCounter::AutoFocusAttribute);
170 } else { 170 } else {
171 HTMLElement::parseAttribute(name, oldValue, value); 171 HTMLElement::parseAttribute(name, oldValue, value);
172 } 172 }
173 } 173 }
174 174
175 void HTMLFormControlElement::disabledAttributeChanged() 175 void HTMLFormControlElement::disabledAttributeChanged()
176 { 176 {
177 setNeedsWillValidateCheck(); 177 setNeedsWillValidateCheck();
178 pseudoStateChanged(CSSSelector::PseudoDisabled); 178 pseudoStateChanged(CSSSelector::PseudoDisabled);
179 pseudoStateChanged(CSSSelector::PseudoEnabled); 179 pseudoStateChanged(CSSSelector::PseudoEnabled);
180 if (layoutObject()) 180 if (hasLayoutObject())
181 LayoutTheme::theme().controlStateChanged(*layoutObject(), EnabledControl State); 181 LayoutTheme::theme().controlStateChanged(*layoutObject(), EnabledControl State);
182 if (isDisabledFormControl() && adjustedFocusedElementInTreeScope() == this) { 182 if (isDisabledFormControl() && adjustedFocusedElementInTreeScope() == this) {
183 // We might want to call blur(), but it's dangerous to dispatch events 183 // We might want to call blur(), but it's dangerous to dispatch events
184 // here. 184 // here.
185 document().setNeedsFocusedElementCheck(); 185 document().setNeedsFocusedElementCheck();
186 } 186 }
187 } 187 }
188 188
189 void HTMLFormControlElement::requiredAttributeChanged() 189 void HTMLFormControlElement::requiredAttributeChanged()
190 { 190 {
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 dispatchFormControlChangeEvent(); 654 dispatchFormControlChangeEvent();
655 } 655 }
656 656
657 void HTMLFormControlElement::copyNonAttributePropertiesFromElement(const Element & source) 657 void HTMLFormControlElement::copyNonAttributePropertiesFromElement(const Element & source)
658 { 658 {
659 HTMLElement::copyNonAttributePropertiesFromElement(source); 659 HTMLElement::copyNonAttributePropertiesFromElement(source);
660 setNeedsValidityCheck(); 660 setNeedsValidityCheck();
661 } 661 }
662 662
663 } // namespace blink 663 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698