OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 2413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2424 } | 2424 } |
2425 | 2425 |
2426 static bool columnFlexItemHasStretchAlignment(const RenderObject* flexitem) | 2426 static bool columnFlexItemHasStretchAlignment(const RenderObject* flexitem) |
2427 { | 2427 { |
2428 RenderObject* parent = flexitem->parent(); | 2428 RenderObject* parent = flexitem->parent(); |
2429 // auto margins mean we don't stretch. Note that this function will only be
used for | 2429 // auto margins mean we don't stretch. Note that this function will only be
used for |
2430 // widths, so we don't have to check marginBefore/marginAfter. | 2430 // widths, so we don't have to check marginBefore/marginAfter. |
2431 ASSERT(parent->style()->isColumnFlexDirection()); | 2431 ASSERT(parent->style()->isColumnFlexDirection()); |
2432 if (flexitem->style()->marginStart().isAuto() || flexitem->style()->marginEn
d().isAuto()) | 2432 if (flexitem->style()->marginStart().isAuto() || flexitem->style()->marginEn
d().isAuto()) |
2433 return false; | 2433 return false; |
2434 return flexitem->style()->alignSelf() == AlignStretch || (flexitem->style()-
>alignSelf() == AlignAuto && parent->style()->alignItems() == AlignStretch); | 2434 return flexitem->style()->alignSelf() == ItemPositionStretch || (flexitem->s
tyle()->alignSelf() == ItemPositionAuto && parent->style()->alignItems() == Item
PositionStretch); |
2435 } | 2435 } |
2436 | 2436 |
2437 static bool isStretchingColumnFlexItem(const RenderObject* flexitem) | 2437 static bool isStretchingColumnFlexItem(const RenderObject* flexitem) |
2438 { | 2438 { |
2439 RenderObject* parent = flexitem->parent(); | 2439 RenderObject* parent = flexitem->parent(); |
2440 if (parent->isDeprecatedFlexibleBox() && parent->style()->boxOrient() == VER
TICAL && parent->style()->boxAlign() == BSTRETCH) | 2440 if (parent->isDeprecatedFlexibleBox() && parent->style()->boxOrient() == VER
TICAL && parent->style()->boxAlign() == BSTRETCH) |
2441 return true; | 2441 return true; |
2442 | 2442 |
2443 // We don't stretch multiline flexboxes because they need to apply line spac
ing (align-content) first. | 2443 // We don't stretch multiline flexboxes because they need to apply line spac
ing (align-content) first. |
2444 if (parent->isFlexibleBox() && parent->style()->flexWrap() == FlexNoWrap &&
parent->style()->isColumnFlexDirection() && columnFlexItemHasStretchAlignment(fl
exitem)) | 2444 if (parent->isFlexibleBox() && parent->style()->flexWrap() == FlexNoWrap &&
parent->style()->isColumnFlexDirection() && columnFlexItemHasStretchAlignment(fl
exitem)) |
(...skipping 2466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4911 return 0; | 4911 return 0; |
4912 | 4912 |
4913 if (!layoutState && !flowThreadContainingBlock()) | 4913 if (!layoutState && !flowThreadContainingBlock()) |
4914 return 0; | 4914 return 0; |
4915 | 4915 |
4916 RenderBlock* containerBlock = containingBlock(); | 4916 RenderBlock* containerBlock = containingBlock(); |
4917 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); | 4917 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); |
4918 } | 4918 } |
4919 | 4919 |
4920 } // namespace WebCore | 4920 } // namespace WebCore |
OLD | NEW |