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

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

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master 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
« no previous file with comments | « Source/core/html/HTMLObjectElement.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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 PassRefPtr<RenderStyle> HTMLOptGroupElement::customStyleForRenderer() 118 PassRefPtr<RenderStyle> HTMLOptGroupElement::customStyleForRenderer()
119 { 119 {
120 // styleForRenderer is called whenever a new style should be associated 120 // styleForRenderer is called whenever a new style should be associated
121 // with an Element so now is a good time to update our cached style. 121 // with an Element so now is a good time to update our cached style.
122 updateNonRenderStyle(); 122 updateNonRenderStyle();
123 return m_style; 123 return m_style;
124 } 124 }
125 125
126 String HTMLOptGroupElement::groupLabelText() const 126 String HTMLOptGroupElement::groupLabelText() const
127 { 127 {
128 String itemText = document()->displayStringModifiedByEncoding(getAttribute(l abelAttr)); 128 String itemText = document().displayStringModifiedByEncoding(getAttribute(la belAttr));
129 129
130 // In WinIE, leading and trailing whitespace is ignored in options and optgr oups. We match this behavior. 130 // In WinIE, leading and trailing whitespace is ignored in options and optgr oups. We match this behavior.
131 itemText = itemText.stripWhiteSpace(); 131 itemText = itemText.stripWhiteSpace();
132 // We want to collapse our whitespace too. This will match other browsers. 132 // We want to collapse our whitespace too. This will match other browsers.
133 itemText = itemText.simplifyWhiteSpace(); 133 itemText = itemText.simplifyWhiteSpace();
134 134
135 return itemText; 135 return itemText;
136 } 136 }
137 137
138 HTMLSelectElement* HTMLOptGroupElement::ownerSelectElement() const 138 HTMLSelectElement* HTMLOptGroupElement::ownerSelectElement() const
(...skipping 10 matching lines...) Expand all
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
« no previous file with comments | « Source/core/html/HTMLObjectElement.cpp ('k') | Source/core/html/HTMLOptionElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698