| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 { | 77 { |
| 78 ASSERT(!childrenInline()); | 78 ASSERT(!childrenInline()); |
| 79 } | 79 } |
| 80 | 80 |
| 81 LayoutFlexibleBox::~LayoutFlexibleBox() | 81 LayoutFlexibleBox::~LayoutFlexibleBox() |
| 82 { | 82 { |
| 83 } | 83 } |
| 84 | 84 |
| 85 LayoutFlexibleBox* LayoutFlexibleBox::createAnonymous(Document* document) | 85 LayoutFlexibleBox* LayoutFlexibleBox::createAnonymous(Document* document) |
| 86 { | 86 { |
| 87 LayoutFlexibleBox* layoutObject = new LayoutFlexibleBox(0); | 87 LayoutFlexibleBox* layoutObject = new LayoutFlexibleBox(nullptr); |
| 88 layoutObject->setDocumentForAnonymous(document); | 88 layoutObject->setDocumentForAnonymous(document); |
| 89 return layoutObject; | 89 return layoutObject; |
| 90 } | 90 } |
| 91 | 91 |
| 92 void LayoutFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidt
h, LayoutUnit& maxLogicalWidth) const | 92 void LayoutFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidt
h, LayoutUnit& maxLogicalWidth) const |
| 93 { | 93 { |
| 94 // FIXME: We're ignoring flex-basis here and we shouldn't. We can't start ho
noring it though until | 94 // FIXME: We're ignoring flex-basis here and we shouldn't. We can't start ho
noring it though until |
| 95 // the flex shorthand stops setting it to 0. | 95 // the flex shorthand stops setting it to 0. |
| 96 // See https://bugs.webkit.org/show_bug.cgi?id=116117 and http://crbug.com/2
40765. | 96 // See https://bugs.webkit.org/show_bug.cgi?id=116117 and http://crbug.com/2
40765. |
| 97 for (LayoutBox* child = firstChildBox(); child; child = child->nextSiblingBo
x()) { | 97 for (LayoutBox* child = firstChildBox(); child; child = child->nextSiblingBo
x()) { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 if (baseline == -1) | 149 if (baseline == -1) |
| 150 baseline = synthesizedBaselineFromContentBox(*this, direction); | 150 baseline = synthesizedBaselineFromContentBox(*this, direction); |
| 151 | 151 |
| 152 return beforeMarginInLineDirection(direction) + baseline; | 152 return beforeMarginInLineDirection(direction) + baseline; |
| 153 } | 153 } |
| 154 | 154 |
| 155 int LayoutFlexibleBox::firstLineBoxBaseline() const | 155 int LayoutFlexibleBox::firstLineBoxBaseline() const |
| 156 { | 156 { |
| 157 if (isWritingModeRoot() || m_numberOfInFlowChildrenOnFirstLine <= 0) | 157 if (isWritingModeRoot() || m_numberOfInFlowChildrenOnFirstLine <= 0) |
| 158 return -1; | 158 return -1; |
| 159 LayoutBox* baselineChild = 0; | 159 LayoutBox* baselineChild = nullptr; |
| 160 int childNumber = 0; | 160 int childNumber = 0; |
| 161 for (LayoutBox* child = m_orderIterator.first(); child; child = m_orderItera
tor.next()) { | 161 for (LayoutBox* child = m_orderIterator.first(); child; child = m_orderItera
tor.next()) { |
| 162 if (child->isOutOfFlowPositioned()) | 162 if (child->isOutOfFlowPositioned()) |
| 163 continue; | 163 continue; |
| 164 if (alignmentForChild(*child) == ItemPositionBaseline && !hasAutoMargins
InCrossAxis(*child)) { | 164 if (alignmentForChild(*child) == ItemPositionBaseline && !hasAutoMargins
InCrossAxis(*child)) { |
| 165 baselineChild = child; | 165 baselineChild = child; |
| 166 break; | 166 break; |
| 167 } | 167 } |
| 168 if (!baselineChild) | 168 if (!baselineChild) |
| 169 baselineChild = child; | 169 baselineChild = child; |
| (...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1452 ASSERT(child); | 1452 ASSERT(child); |
| 1453 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; | 1453 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; |
| 1454 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; | 1454 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; |
| 1455 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; | 1455 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; |
| 1456 adjustAlignmentForChild(*child, newOffset - originalOffset); | 1456 adjustAlignmentForChild(*child, newOffset - originalOffset); |
| 1457 } | 1457 } |
| 1458 } | 1458 } |
| 1459 } | 1459 } |
| 1460 | 1460 |
| 1461 } | 1461 } |
| OLD | NEW |