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

Side by Side Diff: Source/core/rendering/RenderFileUploadControl.cpp

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Blind fix for Mac. Created 5 years, 10 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) 2006, 2007, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 if (!style()->width().isPercent()) 108 if (!style()->width().isPercent())
109 minLogicalWidth = maxLogicalWidth; 109 minLogicalWidth = maxLogicalWidth;
110 } 110 }
111 111
112 void RenderFileUploadControl::computePreferredLogicalWidths() 112 void RenderFileUploadControl::computePreferredLogicalWidths()
113 { 113 {
114 ASSERT(preferredLogicalWidthsDirty()); 114 ASSERT(preferredLogicalWidthsDirty());
115 115
116 m_minPreferredLogicalWidth = 0; 116 m_minPreferredLogicalWidth = 0;
117 m_maxPreferredLogicalWidth = 0; 117 m_maxPreferredLogicalWidth = 0;
118 RenderStyle* styleToUse = style(); 118 const RenderStyle* styleToUse = style();
119 119
120 if (styleToUse->width().isFixed() && styleToUse->width().value() > 0) 120 if (styleToUse->width().isFixed() && styleToUse->width().value() > 0)
121 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentB oxLogicalWidthForBoxSizing(styleToUse->width().value()); 121 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentB oxLogicalWidthForBoxSizing(styleToUse->width().value());
122 else 122 else
123 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferred LogicalWidth); 123 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferred LogicalWidth);
124 124
125 if (styleToUse->minWidth().isFixed() && styleToUse->minWidth().value() > 0) { 125 if (styleToUse->minWidth().isFixed() && styleToUse->minWidth().value() > 0) {
126 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(styleToUse->minWidth().value())); 126 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(styleToUse->minWidth().value()));
127 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(styleToUse->minWidth().value())); 127 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(styleToUse->minWidth().value()));
128 } 128 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 } 161 }
162 162
163 String RenderFileUploadControl::fileTextValue() const 163 String RenderFileUploadControl::fileTextValue() const
164 { 164 {
165 HTMLInputElement* input = toHTMLInputElement(node()); 165 HTMLInputElement* input = toHTMLInputElement(node());
166 ASSERT(input->files()); 166 ASSERT(input->files());
167 return LayoutTheme::theme().fileListNameForWidth(input->locale(), input->fil es(), style()->font(), maxFilenameWidth()); 167 return LayoutTheme::theme().fileListNameForWidth(input->locale(), input->fil es(), style()->font(), maxFilenameWidth());
168 } 168 }
169 169
170 } // namespace blink 170 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698