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

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

Issue 24430002: Rename attach and detach to createRenderTree/destroyRenderTree (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 void HTMLOptGroupElement::recalcSelectOptions() 83 void HTMLOptGroupElement::recalcSelectOptions()
84 { 84 {
85 ContainerNode* select = parentNode(); 85 ContainerNode* select = parentNode();
86 while (select && !select->hasTagName(selectTag)) 86 while (select && !select->hasTagName(selectTag))
87 select = select->parentNode(); 87 select = select->parentNode();
88 if (select) 88 if (select)
89 toHTMLSelectElement(select)->setRecalcListItems(); 89 toHTMLSelectElement(select)->setRecalcListItems();
90 } 90 }
91 91
92 void HTMLOptGroupElement::attach(const AttachContext& context) 92 void HTMLOptGroupElement::createRenderTree(const AttachContext& context)
93 { 93 {
94 HTMLElement::attach(context); 94 HTMLElement::createRenderTree(context);
95 // If after attaching nothing called styleForRenderer() on this node we 95 // If after attaching nothing called styleForRenderer() on this node we
96 // manually cache the value. This happens if our parent doesn't have a 96 // manually cache the value. This happens if our parent doesn't have a
97 // renderer like <optgroup> or if it doesn't allow children like <select>. 97 // renderer like <optgroup> or if it doesn't allow children like <select>.
98 if (!m_style && parentNode()->renderStyle()) 98 if (!m_style && parentNode()->renderStyle())
99 updateNonRenderStyle(); 99 updateNonRenderStyle();
100 } 100 }
101 101
102 void HTMLOptGroupElement::detach(const AttachContext& context) 102 void HTMLOptGroupElement::destroyRenderTree(const AttachContext& context)
103 { 103 {
104 m_style.clear(); 104 m_style.clear();
105 HTMLElement::detach(context); 105 HTMLElement::destroyRenderTree(context);
106 } 106 }
107 107
108 void HTMLOptGroupElement::updateNonRenderStyle() 108 void HTMLOptGroupElement::updateNonRenderStyle()
109 { 109 {
110 m_style = originalStyleForRenderer(); 110 m_style = originalStyleForRenderer();
111 } 111 }
112 112
113 RenderStyle* HTMLOptGroupElement::nonRendererStyle() const 113 RenderStyle* HTMLOptGroupElement::nonRendererStyle() const
114 { 114 {
115 return m_style.get(); 115 return m_style.get();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 149
150 void HTMLOptGroupElement::accessKeyAction(bool) 150 void HTMLOptGroupElement::accessKeyAction(bool)
151 { 151 {
152 HTMLSelectElement* select = ownerSelectElement(); 152 HTMLSelectElement* select = ownerSelectElement();
153 // send to the parent to bring focus to the list box 153 // send to the parent to bring focus to the list box
154 if (select && !select->focused()) 154 if (select && !select->focused())
155 select->accessKeyAction(false); 155 select->accessKeyAction(false);
156 } 156 }
157 157
158 } // namespace 158 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698