| 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 14 matching lines...) Expand all Loading... |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "core/rendering/RenderFlexibleBox.h" | 32 #include "core/rendering/RenderFlexibleBox.h" |
| 33 | 33 |
| 34 #include "core/frame/UseCounter.h" | 34 #include "core/frame/UseCounter.h" |
| 35 #include "core/paint/BlockPainter.h" |
| 35 #include "core/rendering/RenderLayer.h" | 36 #include "core/rendering/RenderLayer.h" |
| 36 #include "core/rendering/RenderView.h" | 37 #include "core/rendering/RenderView.h" |
| 37 #include "core/rendering/TextAutosizer.h" | 38 #include "core/rendering/TextAutosizer.h" |
| 38 #include "platform/LengthFunctions.h" | 39 #include "platform/LengthFunctions.h" |
| 39 #include "wtf/MathExtras.h" | 40 #include "wtf/MathExtras.h" |
| 40 #include <limits> | 41 #include <limits> |
| 41 | 42 |
| 42 namespace blink { | 43 namespace blink { |
| 43 | 44 |
| 44 struct RenderFlexibleBox::LineContext { | 45 struct RenderFlexibleBox::LineContext { |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 { | 276 { |
| 276 for (RenderBox* child = m_orderIterator.first(); child; child = m_orderItera
tor.next()) { | 277 for (RenderBox* child = m_orderIterator.first(); child; child = m_orderItera
tor.next()) { |
| 277 if (!child->isOutOfFlowPositioned()) | 278 if (!child->isOutOfFlowPositioned()) |
| 278 childFrameRects.append(child->frameRect()); | 279 childFrameRects.append(child->frameRect()); |
| 279 } | 280 } |
| 280 } | 281 } |
| 281 | 282 |
| 282 void RenderFlexibleBox::paintChildren(PaintInfo& paintInfo, const LayoutPoint& p
aintOffset) | 283 void RenderFlexibleBox::paintChildren(PaintInfo& paintInfo, const LayoutPoint& p
aintOffset) |
| 283 { | 284 { |
| 284 for (RenderBox* child = m_orderIterator.first(); child; child = m_orderItera
tor.next()) | 285 for (RenderBox* child = m_orderIterator.first(); child; child = m_orderItera
tor.next()) |
| 285 paintChildAsInlineBlock(child, paintInfo, paintOffset); | 286 BlockPainter(*this).paintChildAsInlineBlock(child, paintInfo, paintOffse
t); |
| 286 } | 287 } |
| 287 | 288 |
| 288 void RenderFlexibleBox::repositionLogicalHeightDependentFlexItems(Vector<LineCon
text>& lineContexts) | 289 void RenderFlexibleBox::repositionLogicalHeightDependentFlexItems(Vector<LineCon
text>& lineContexts) |
| 289 { | 290 { |
| 290 LayoutUnit crossAxisStartEdge = lineContexts.isEmpty() ? LayoutUnit() : line
Contexts[0].crossAxisOffset; | 291 LayoutUnit crossAxisStartEdge = lineContexts.isEmpty() ? LayoutUnit() : line
Contexts[0].crossAxisOffset; |
| 291 alignFlexLines(lineContexts); | 292 alignFlexLines(lineContexts); |
| 292 | 293 |
| 293 alignChildren(lineContexts); | 294 alignChildren(lineContexts); |
| 294 | 295 |
| 295 if (style()->flexWrap() == FlexWrapReverse) | 296 if (style()->flexWrap() == FlexWrapReverse) |
| (...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1401 ASSERT(child); | 1402 ASSERT(child); |
| 1402 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; | 1403 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE
xtent; |
| 1403 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; | 1404 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset
- crossAxisStartEdge; |
| 1404 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; | 1405 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi
sExtent; |
| 1405 adjustAlignmentForChild(*child, newOffset - originalOffset); | 1406 adjustAlignmentForChild(*child, newOffset - originalOffset); |
| 1406 } | 1407 } |
| 1407 } | 1408 } |
| 1408 } | 1409 } |
| 1409 | 1410 |
| 1410 } | 1411 } |
| OLD | NEW |