OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the render object implementation for KHTML. | 2 * This file is part of the render object implementation for KHTML. |
3 * | 3 * |
4 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 4 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
5 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 5 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
6 * Copyright (C) 2003 Apple Computer, Inc. | 6 * Copyright (C) 2003 Apple Computer, Inc. |
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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 } | 208 } |
209 } | 209 } |
210 | 210 |
211 maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth); | 211 maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth); |
212 | 212 |
213 LayoutUnit scrollbarWidth = instrinsicScrollbarLogicalWidth(); | 213 LayoutUnit scrollbarWidth = instrinsicScrollbarLogicalWidth(); |
214 maxLogicalWidth += scrollbarWidth; | 214 maxLogicalWidth += scrollbarWidth; |
215 minLogicalWidth += scrollbarWidth; | 215 minLogicalWidth += scrollbarWidth; |
216 } | 216 } |
217 | 217 |
218 void RenderDeprecatedFlexibleBox::computePreferredLogicalWidths() | |
219 { | |
220 ASSERT(preferredLogicalWidthsDirty()); | |
221 | |
222 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = 0; | |
223 RenderStyle* styleToUse = style(); | |
224 | |
225 if (styleToUse->width().isFixed() && styleToUse->width().value() > 0) | |
226 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = adjustContentB
oxLogicalWidthForBoxSizing(styleToUse->width().value()); | |
227 else | |
228 computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferred
LogicalWidth); | |
229 | |
230 if (styleToUse->minWidth().isFixed() && styleToUse->minWidth().value() > 0)
{ | |
231 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjust
ContentBoxLogicalWidthForBoxSizing(styleToUse->minWidth().value())); | |
232 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjust
ContentBoxLogicalWidthForBoxSizing(styleToUse->minWidth().value())); | |
233 } | |
234 | |
235 if (styleToUse->maxWidth().isFixed()) { | |
236 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjust
ContentBoxLogicalWidthForBoxSizing(styleToUse->maxWidth().value())); | |
237 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, adjust
ContentBoxLogicalWidthForBoxSizing(styleToUse->maxWidth().value())); | |
238 } | |
239 | |
240 LayoutUnit borderAndPadding = borderAndPaddingLogicalWidth(); | |
241 m_minPreferredLogicalWidth += borderAndPadding; | |
242 m_maxPreferredLogicalWidth += borderAndPadding; | |
243 | |
244 clearPreferredLogicalWidthsDirty(); | |
245 } | |
246 | |
247 void RenderDeprecatedFlexibleBox::layoutBlock(bool relayoutChildren) | 218 void RenderDeprecatedFlexibleBox::layoutBlock(bool relayoutChildren) |
248 { | 219 { |
249 ASSERT(needsLayout()); | 220 ASSERT(needsLayout()); |
250 | 221 |
251 if (!relayoutChildren && simplifiedLayout()) | 222 if (!relayoutChildren && simplifiedLayout()) |
252 return; | 223 return; |
253 | 224 |
254 { | 225 { |
255 // LayoutState needs this deliberate scope to pop before paint invalidat
ion. | 226 // LayoutState needs this deliberate scope to pop before paint invalidat
ion. |
256 LayoutState state(*this, locationOffset()); | 227 LayoutState state(*this, locationOffset()); |
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 ASSERT_NOT_REACHED(); | 1041 ASSERT_NOT_REACHED(); |
1071 } | 1042 } |
1072 if (isAnonymous()) | 1043 if (isAnonymous()) |
1073 return "RenderDeprecatedFlexibleBox (generated)"; | 1044 return "RenderDeprecatedFlexibleBox (generated)"; |
1074 if (isRelPositioned()) | 1045 if (isRelPositioned()) |
1075 return "RenderDeprecatedFlexibleBox (relative positioned)"; | 1046 return "RenderDeprecatedFlexibleBox (relative positioned)"; |
1076 return "RenderDeprecatedFlexibleBox"; | 1047 return "RenderDeprecatedFlexibleBox"; |
1077 } | 1048 } |
1078 | 1049 |
1079 } // namespace blink | 1050 } // namespace blink |
OLD | NEW |