| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 RenderDeprecatedFlexibleBox* m_box; | 112 RenderDeprecatedFlexibleBox* m_box; |
| 113 RenderBox* m_currentChild; | 113 RenderBox* m_currentChild; |
| 114 bool m_forward; | 114 bool m_forward; |
| 115 unsigned int m_currentOrdinal; | 115 unsigned int m_currentOrdinal; |
| 116 unsigned int m_largestOrdinal; | 116 unsigned int m_largestOrdinal; |
| 117 HashSet<unsigned int> m_ordinalValues; | 117 HashSet<unsigned int> m_ordinalValues; |
| 118 Vector<unsigned int> m_sortedOrdinalValues; | 118 Vector<unsigned int> m_sortedOrdinalValues; |
| 119 int m_ordinalIteration; | 119 int m_ordinalIteration; |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 RenderDeprecatedFlexibleBox::RenderDeprecatedFlexibleBox(Element* element) | 122 RenderDeprecatedFlexibleBox::RenderDeprecatedFlexibleBox(Element& element) |
| 123 : RenderBlock(element) | 123 : RenderBlock(&element) |
| 124 { | 124 { |
| 125 ASSERT(!childrenInline()); | 125 ASSERT(!childrenInline()); |
| 126 m_stretchingChildren = false; | 126 m_stretchingChildren = false; |
| 127 if (!isAnonymous()) { | 127 if (!isAnonymous()) { |
| 128 const KURL& url = document().url(); | 128 const KURL& url = document().url(); |
| 129 if (url.protocolIs("chrome")) | 129 if (url.protocolIs("chrome")) |
| 130 UseCounter::count(document(), UseCounter::DeprecatedFlexboxChrome); | 130 UseCounter::count(document(), UseCounter::DeprecatedFlexboxChrome); |
| 131 else if (url.protocolIs("chrome-extension")) | 131 else if (url.protocolIs("chrome-extension")) |
| 132 UseCounter::count(document(), UseCounter::DeprecatedFlexboxChromeExt
ension); | 132 UseCounter::count(document(), UseCounter::DeprecatedFlexboxChromeExt
ension); |
| 133 else | 133 else |
| 134 UseCounter::count(document(), UseCounter::DeprecatedFlexboxWebConten
t); | 134 UseCounter::count(document(), UseCounter::DeprecatedFlexboxWebConten
t); |
| 135 } | 135 } |
| 136 } | 136 } |
| 137 | 137 |
| 138 RenderDeprecatedFlexibleBox::~RenderDeprecatedFlexibleBox() | 138 RenderDeprecatedFlexibleBox::~RenderDeprecatedFlexibleBox() |
| 139 { | 139 { |
| 140 } | 140 } |
| 141 | 141 |
| 142 RenderDeprecatedFlexibleBox* RenderDeprecatedFlexibleBox::createAnonymous(Docume
nt* document) | |
| 143 { | |
| 144 RenderDeprecatedFlexibleBox* renderer = new RenderDeprecatedFlexibleBox(0); | |
| 145 renderer->setDocumentForAnonymous(document); | |
| 146 return renderer; | |
| 147 } | |
| 148 | |
| 149 static LayoutUnit marginWidthForChild(RenderBox* child) | 142 static LayoutUnit marginWidthForChild(RenderBox* child) |
| 150 { | 143 { |
| 151 // A margin basically has three types: fixed, percentage, and auto (variable
). | 144 // A margin basically has three types: fixed, percentage, and auto (variable
). |
| 152 // Auto and percentage margins simply become 0 when computing min/max width. | 145 // Auto and percentage margins simply become 0 when computing min/max width. |
| 153 // Fixed margins can be added in as is. | 146 // Fixed margins can be added in as is. |
| 154 Length marginLeft = child->style()->marginLeft(); | 147 Length marginLeft = child->style()->marginLeft(); |
| 155 Length marginRight = child->style()->marginRight(); | 148 Length marginRight = child->style()->marginRight(); |
| 156 LayoutUnit margin = 0; | 149 LayoutUnit margin = 0; |
| 157 if (marginLeft.isFixed()) | 150 if (marginLeft.isFixed()) |
| 158 margin += marginLeft.value(); | 151 margin += marginLeft.value(); |
| (...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1069 if (isPseudoElement()) | 1062 if (isPseudoElement()) |
| 1070 return "RenderDeprecatedFlexibleBox (generated)"; | 1063 return "RenderDeprecatedFlexibleBox (generated)"; |
| 1071 if (isAnonymous()) | 1064 if (isAnonymous()) |
| 1072 return "RenderDeprecatedFlexibleBox (generated)"; | 1065 return "RenderDeprecatedFlexibleBox (generated)"; |
| 1073 if (isRelPositioned()) | 1066 if (isRelPositioned()) |
| 1074 return "RenderDeprecatedFlexibleBox (relative positioned)"; | 1067 return "RenderDeprecatedFlexibleBox (relative positioned)"; |
| 1075 return "RenderDeprecatedFlexibleBox"; | 1068 return "RenderDeprecatedFlexibleBox"; |
| 1076 } | 1069 } |
| 1077 | 1070 |
| 1078 } // namespace blink | 1071 } // namespace blink |
| OLD | NEW |