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

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

Issue 2623513005: Introduce Element::AttributeModificationParams (Closed)
Patch Set: Created 3 years, 11 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, 2008, 2010 Apple Inc. All rights 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights
6 * reserved. 6 * reserved.
7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 HTMLOptGroupElement* HTMLOptGroupElement::create(Document& document) { 56 HTMLOptGroupElement* HTMLOptGroupElement::create(Document& document) {
57 HTMLOptGroupElement* optGroupElement = new HTMLOptGroupElement(document); 57 HTMLOptGroupElement* optGroupElement = new HTMLOptGroupElement(document);
58 optGroupElement->ensureUserAgentShadowRoot(); 58 optGroupElement->ensureUserAgentShadowRoot();
59 return optGroupElement; 59 return optGroupElement;
60 } 60 }
61 61
62 bool HTMLOptGroupElement::isDisabledFormControl() const { 62 bool HTMLOptGroupElement::isDisabledFormControl() const {
63 return fastHasAttribute(disabledAttr); 63 return fastHasAttribute(disabledAttr);
64 } 64 }
65 65
66 void HTMLOptGroupElement::parseAttribute(const QualifiedName& name, 66 void HTMLOptGroupElement::parseAttribute(
67 const AtomicString& oldValue, 67 const AttributeModificationParams& params) {
68 const AtomicString& value) { 68 HTMLElement::parseAttribute(params);
69 HTMLElement::parseAttribute(name, oldValue, value);
70 69
71 if (name == disabledAttr) { 70 if (params.name == disabledAttr) {
72 pseudoStateChanged(CSSSelector::PseudoDisabled); 71 pseudoStateChanged(CSSSelector::PseudoDisabled);
73 pseudoStateChanged(CSSSelector::PseudoEnabled); 72 pseudoStateChanged(CSSSelector::PseudoEnabled);
74 } else if (name == labelAttr) { 73 } else if (params.name == labelAttr) {
75 updateGroupLabel(); 74 updateGroupLabel();
76 } 75 }
77 } 76 }
78 77
79 void HTMLOptGroupElement::attachLayoutTree(const AttachContext& context) { 78 void HTMLOptGroupElement::attachLayoutTree(const AttachContext& context) {
80 if (context.resolvedStyle) { 79 if (context.resolvedStyle) {
81 DCHECK(!m_style || m_style == context.resolvedStyle); 80 DCHECK(!m_style || m_style == context.resolvedStyle);
82 m_style = context.resolvedStyle; 81 m_style = context.resolvedStyle;
83 } 82 }
84 HTMLElement::attachLayoutTree(context); 83 HTMLElement::attachLayoutTree(context);
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 label.setTextContent(labelText); 186 label.setTextContent(labelText);
188 label.setAttribute(aria_labelAttr, AtomicString(labelText)); 187 label.setAttribute(aria_labelAttr, AtomicString(labelText));
189 } 188 }
190 189
191 HTMLDivElement& HTMLOptGroupElement::optGroupLabelElement() const { 190 HTMLDivElement& HTMLOptGroupElement::optGroupLabelElement() const {
192 return *toHTMLDivElementOrDie(userAgentShadowRoot()->getElementById( 191 return *toHTMLDivElementOrDie(userAgentShadowRoot()->getElementById(
193 ShadowElementNames::optGroupLabel())); 192 ShadowElementNames::optGroupLabel()));
194 } 193 }
195 194
196 } // namespace blink 195 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLOptGroupElement.h ('k') | third_party/WebKit/Source/core/html/HTMLOptionElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698