Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) | 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 220 } | 220 } |
| 221 | 221 |
| 222 bool RenderStyle::inheritedDataShared(const RenderStyle* other) const | 222 bool RenderStyle::inheritedDataShared(const RenderStyle* other) const |
| 223 { | 223 { |
| 224 // This is a fast check that only looks if the data structures are shared. | 224 // This is a fast check that only looks if the data structures are shared. |
| 225 return inherited_flags == other->inherited_flags | 225 return inherited_flags == other->inherited_flags |
| 226 && inherited.get() == other->inherited.get() | 226 && inherited.get() == other->inherited.get() |
| 227 && rareInheritedData.get() == other->rareInheritedData.get(); | 227 && rareInheritedData.get() == other->rareInheritedData.get(); |
| 228 } | 228 } |
| 229 | 229 |
| 230 bool RenderStyle::requiresOnlyBlockChildren(RenderStyle* style) | |
|
esprehn
2015/01/09 00:56:57
This should just be a method, no reason for it to
| |
| 231 { | |
| 232 switch (style->display()) { | |
| 233 case PARAGRAPH: | |
| 234 case INLINE: | |
| 235 return false; | |
| 236 | |
| 237 case BLOCK: | |
| 238 case FLEX: | |
| 239 case INLINE_FLEX: | |
| 240 case INLINE_BLOCK: | |
| 241 return true; | |
| 242 | |
| 243 case NONE: | |
| 244 ASSERT_NOT_REACHED(); | |
| 245 return false; | |
| 246 } | |
| 247 | |
| 248 ASSERT_NOT_REACHED(); | |
| 249 return false; | |
| 250 } | |
| 251 | |
| 230 static bool positionedObjectMovedOnly(const LengthBox& a, const LengthBox& b, co nst Length& width) | 252 static bool positionedObjectMovedOnly(const LengthBox& a, const LengthBox& b, co nst Length& width) |
| 231 { | 253 { |
| 232 // If any unit types are different, then we can't guarantee | 254 // If any unit types are different, then we can't guarantee |
| 233 // that this was just a movement. | 255 // that this was just a movement. |
| 234 if (a.left().type() != b.left().type() | 256 if (a.left().type() != b.left().type() |
| 235 || a.right().type() != b.right().type() | 257 || a.right().type() != b.right().type() |
| 236 || a.top().type() != b.top().type() | 258 || a.top().type() != b.top().type() |
| 237 || a.bottom().type() != b.bottom().type()) | 259 || a.bottom().type() != b.bottom().type()) |
| 238 return false; | 260 return false; |
| 239 | 261 |
| (...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1259 // right | 1281 // right |
| 1260 radiiSum = radii.topRight().height() + radii.bottomRight().height(); | 1282 radiiSum = radii.topRight().height() + radii.bottomRight().height(); |
| 1261 if (radiiSum > rect.height()) | 1283 if (radiiSum > rect.height()) |
| 1262 factor = std::min(rect.height() / radiiSum, factor); | 1284 factor = std::min(rect.height() / radiiSum, factor); |
| 1263 | 1285 |
| 1264 ASSERT(factor <= 1); | 1286 ASSERT(factor <= 1); |
| 1265 return factor; | 1287 return factor; |
| 1266 } | 1288 } |
| 1267 | 1289 |
| 1268 } // namespace blink | 1290 } // namespace blink |
| OLD | NEW |