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

Side by Side Diff: Source/core/html/HTMLOptGroupElement.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
« no previous file with comments | « Source/core/html/HTMLInputElement.cpp ('k') | Source/core/html/HTMLOptionElement.cpp » ('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, 2008, 2010 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv ed.
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 { 62 {
63 recalcSelectOptions(); 63 recalcSelectOptions();
64 HTMLElement::childrenChanged(change); 64 HTMLElement::childrenChanged(change);
65 } 65 }
66 66
67 void HTMLOptGroupElement::parseAttribute(const QualifiedName& name, const Atomic String& value) 67 void HTMLOptGroupElement::parseAttribute(const QualifiedName& name, const Atomic String& value)
68 { 68 {
69 HTMLElement::parseAttribute(name, value); 69 HTMLElement::parseAttribute(name, value);
70 recalcSelectOptions(); 70 recalcSelectOptions();
71 71
72 if (name == disabledAttr) 72 if (name == disabledAttr) {
73 didAffectSelector(AffectedSelectorDisabled | AffectedSelectorEnabled); 73 pseudoStateChanged(CSSSelector::PseudoDisabled);
74 else if (name == labelAttr) 74 pseudoStateChanged(CSSSelector::PseudoEnabled);
75 } else if (name == labelAttr) {
75 updateGroupLabel(); 76 updateGroupLabel();
77 }
76 } 78 }
77 79
78 void HTMLOptGroupElement::recalcSelectOptions() 80 void HTMLOptGroupElement::recalcSelectOptions()
79 { 81 {
80 if (HTMLSelectElement* select = Traversal<HTMLSelectElement>::firstAncestor( *this)) 82 if (HTMLSelectElement* select = Traversal<HTMLSelectElement>::firstAncestor( *this))
81 select->setRecalcListItems(); 83 select->setRecalcListItems();
82 } 84 }
83 85
84 void HTMLOptGroupElement::attach(const AttachContext& context) 86 void HTMLOptGroupElement::attach(const AttachContext& context)
85 { 87 {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 label.setTextContent(labelText); 167 label.setTextContent(labelText);
166 label.setAttribute(aria_labelAttr, AtomicString(labelText)); 168 label.setAttribute(aria_labelAttr, AtomicString(labelText));
167 } 169 }
168 170
169 HTMLDivElement& HTMLOptGroupElement::optGroupLabelElement() const 171 HTMLDivElement& HTMLOptGroupElement::optGroupLabelElement() const
170 { 172 {
171 return *toHTMLDivElement(userAgentShadowRoot()->getElementById(ShadowElement Names::optGroupLabel())); 173 return *toHTMLDivElement(userAgentShadowRoot()->getElementById(ShadowElement Names::optGroupLabel()));
172 } 174 }
173 175
174 } // namespace 176 } // namespace
OLDNEW
« no previous file with comments | « Source/core/html/HTMLInputElement.cpp ('k') | Source/core/html/HTMLOptionElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698