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

Side by Side Diff: Source/core/html/HTMLOptionElement.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 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 5 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
6 * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. All rights reserved.
8 * Copyright (C) 2011 Motorola Mobility, Inc. All rights reserved. 8 * Copyright (C) 2011 Motorola Mobility, Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 if (!value.isNull()) 80 if (!value.isNull())
81 element->setValue(value); 81 element->setValue(value);
82 if (defaultSelected) 82 if (defaultSelected)
83 element->setAttribute(selectedAttr, emptyAtom); 83 element->setAttribute(selectedAttr, emptyAtom);
84 element->setSelected(selected); 84 element->setSelected(selected);
85 85
86 return element.release(); 86 return element.release();
87 } 87 }
88 88
89 void HTMLOptionElement::attach(const AttachContext& context) 89 void HTMLOptionElement::createRenderTree(const AttachContext& context)
90 { 90 {
91 HTMLElement::attach(context); 91 HTMLElement::createRenderTree(context);
92 // If after attaching nothing called styleForRenderer() on this node we 92 // If after attaching nothing called styleForRenderer() on this node we
93 // manually cache the value. This happens if our parent doesn't have a 93 // manually cache the value. This happens if our parent doesn't have a
94 // renderer like <optgroup> or if it doesn't allow children like <select>. 94 // renderer like <optgroup> or if it doesn't allow children like <select>.
95 if (!m_style && parentNode()->renderStyle()) 95 if (!m_style && parentNode()->renderStyle())
96 updateNonRenderStyle(); 96 updateNonRenderStyle();
97 } 97 }
98 98
99 void HTMLOptionElement::detach(const AttachContext& context) 99 void HTMLOptionElement::destroyRenderTree(const AttachContext& context)
100 { 100 {
101 m_style.clear(); 101 m_style.clear();
102 HTMLElement::detach(context); 102 HTMLElement::destroyRenderTree(context);
103 } 103 }
104 104
105 bool HTMLOptionElement::rendererIsFocusable() const 105 bool HTMLOptionElement::rendererIsFocusable() const
106 { 106 {
107 // Option elements do not have a renderer so we check the renderStyle instea d. 107 // Option elements do not have a renderer so we check the renderStyle instea d.
108 return renderStyle() && renderStyle()->display() != NONE; 108 return renderStyle() && renderStyle()->display() != NONE;
109 } 109 }
110 110
111 String HTMLOptionElement::text() const 111 String HTMLOptionElement::text() const
112 { 112 {
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 // Text nodes inside script elements are not part of the option text. 368 // Text nodes inside script elements are not part of the option text.
369 if (node->isElementNode() && toScriptLoaderIfPossible(toElement(node))) 369 if (node->isElementNode() && toScriptLoaderIfPossible(toElement(node)))
370 node = NodeTraversal::nextSkippingChildren(node, this); 370 node = NodeTraversal::nextSkippingChildren(node, this);
371 else 371 else
372 node = NodeTraversal::next(node, this); 372 node = NodeTraversal::next(node, this);
373 } 373 }
374 return text.toString(); 374 return text.toString();
375 } 375 }
376 376
377 } // namespace WebCore 377 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698