OLD | NEW |
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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // This only supports clearing out the files, but that's OK because for | 71 // This only supports clearing out the files, but that's OK because for |
72 // security reasons that's the only change the DOM is allowed to make. | 72 // security reasons that's the only change the DOM is allowed to make. |
73 FileList* files = input->files(); | 73 FileList* files = input->files(); |
74 ASSERT(files); | 74 ASSERT(files); |
75 if (files && files->isEmpty()) | 75 if (files && files->isEmpty()) |
76 setShouldDoFullPaintInvalidation(); | 76 setShouldDoFullPaintInvalidation(); |
77 } | 77 } |
78 | 78 |
79 int RenderFileUploadControl::maxFilenameWidth() const | 79 int RenderFileUploadControl::maxFilenameWidth() const |
80 { | 80 { |
81 int uploadButtonWidth = (uploadButton() && uploadButton()->renderBox()) ? up
loadButton()->renderBox()->pixelSnappedWidth() : 0; | 81 int uploadButtonWidth = (uploadButton() && uploadButton()->layoutBox()) ? up
loadButton()->layoutBox()->pixelSnappedWidth() : 0; |
82 return std::max(0, contentBoxRect().pixelSnappedWidth() - uploadButtonWidth
- afterButtonSpacing); | 82 return std::max(0, contentBoxRect().pixelSnappedWidth() - uploadButtonWidth
- afterButtonSpacing); |
83 } | 83 } |
84 | 84 |
85 void RenderFileUploadControl::paintObject(const PaintInfo& paintInfo, const Layo
utPoint& paintOffset) | 85 void RenderFileUploadControl::paintObject(const PaintInfo& paintInfo, const Layo
utPoint& paintOffset) |
86 { | 86 { |
87 FileUploadControlPainter(*this).paintObject(paintInfo, paintOffset); | 87 FileUploadControlPainter(*this).paintObject(paintInfo, paintOffset); |
88 } | 88 } |
89 | 89 |
90 void RenderFileUploadControl::computeIntrinsicLogicalWidths(LayoutUnit& minLogic
alWidth, LayoutUnit& maxLogicalWidth) const | 90 void RenderFileUploadControl::computeIntrinsicLogicalWidths(LayoutUnit& minLogic
alWidth, LayoutUnit& maxLogicalWidth) const |
91 { | 91 { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |