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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
111 RenderDeprecatedFlexibleBox* m_box; | 111 RenderDeprecatedFlexibleBox* m_box; |
112 RenderBox* m_currentChild; | 112 RenderBox* m_currentChild; |
113 bool m_forward; | 113 bool m_forward; |
114 unsigned int m_currentOrdinal; | 114 unsigned int m_currentOrdinal; |
115 unsigned int m_largestOrdinal; | 115 unsigned int m_largestOrdinal; |
116 HashSet<unsigned int> m_ordinalValues; | 116 HashSet<unsigned int> m_ordinalValues; |
117 Vector<unsigned int> m_sortedOrdinalValues; | 117 Vector<unsigned int> m_sortedOrdinalValues; |
118 int m_ordinalIteration; | 118 int m_ordinalIteration; |
119 }; | 119 }; |
120 | 120 |
121 RenderDeprecatedFlexibleBox::RenderDeprecatedFlexibleBox(Element* element) | 121 RenderDeprecatedFlexibleBox::RenderDeprecatedFlexibleBox(Element& element) |
122 : RenderBlock(element) | 122 : RenderBlock(&element) |
123 { | 123 { |
124 setChildrenInline(false); // All of our children must be block-level | 124 setChildrenInline(false); // All of our children must be block-level |
125 m_stretchingChildren = false; | 125 m_stretchingChildren = false; |
126 if (!isAnonymous()) { | 126 |
cbiesinger
2014/08/06 03:00:30
This entire if block needs to stay. The webkit pat
harpreet.sk
2014/08/06 13:22:14
Done.
| |
127 const KURL& url = document().url(); | 127 UseCounter::count(document(), UseCounter::DeprecatedFlexboxWebContent); |
128 if (url.protocolIs("chrome")) | |
129 UseCounter::count(document(), UseCounter::DeprecatedFlexboxChrome); | |
130 else if (url.protocolIs("chrome-extension")) | |
131 UseCounter::count(document(), UseCounter::DeprecatedFlexboxChromeExt ension); | |
132 else | |
133 UseCounter::count(document(), UseCounter::DeprecatedFlexboxWebConten t); | |
134 } | |
135 } | 128 } |
136 | 129 |
137 RenderDeprecatedFlexibleBox::~RenderDeprecatedFlexibleBox() | 130 RenderDeprecatedFlexibleBox::~RenderDeprecatedFlexibleBox() |
138 { | 131 { |
139 } | 132 } |
140 | 133 |
141 RenderDeprecatedFlexibleBox* RenderDeprecatedFlexibleBox::createAnonymous(Docume nt* document) | |
142 { | |
143 RenderDeprecatedFlexibleBox* renderer = new RenderDeprecatedFlexibleBox(0); | |
144 renderer->setDocumentForAnonymous(document); | |
145 return renderer; | |
146 } | |
147 | |
148 static LayoutUnit marginWidthForChild(RenderBox* child) | 134 static LayoutUnit marginWidthForChild(RenderBox* child) |
149 { | 135 { |
150 // A margin basically has three types: fixed, percentage, and auto (variable ). | 136 // A margin basically has three types: fixed, percentage, and auto (variable ). |
151 // Auto and percentage margins simply become 0 when computing min/max width. | 137 // Auto and percentage margins simply become 0 when computing min/max width. |
152 // Fixed margins can be added in as is. | 138 // Fixed margins can be added in as is. |
153 Length marginLeft = child->style()->marginLeft(); | 139 Length marginLeft = child->style()->marginLeft(); |
154 Length marginRight = child->style()->marginRight(); | 140 Length marginRight = child->style()->marginRight(); |
155 LayoutUnit margin = 0; | 141 LayoutUnit margin = 0; |
156 if (marginLeft.isFixed()) | 142 if (marginLeft.isFixed()) |
157 margin += marginLeft.value(); | 143 margin += marginLeft.value(); |
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1068 if (isPseudoElement()) | 1054 if (isPseudoElement()) |
1069 return "RenderDeprecatedFlexibleBox (generated)"; | 1055 return "RenderDeprecatedFlexibleBox (generated)"; |
1070 if (isAnonymous()) | 1056 if (isAnonymous()) |
1071 return "RenderDeprecatedFlexibleBox (generated)"; | 1057 return "RenderDeprecatedFlexibleBox (generated)"; |
1072 if (isRelPositioned()) | 1058 if (isRelPositioned()) |
1073 return "RenderDeprecatedFlexibleBox (relative positioned)"; | 1059 return "RenderDeprecatedFlexibleBox (relative positioned)"; |
1074 return "RenderDeprecatedFlexibleBox"; | 1060 return "RenderDeprecatedFlexibleBox"; |
1075 } | 1061 } |
1076 | 1062 |
1077 } // namespace WebCore | 1063 } // namespace WebCore |
OLD | NEW |