| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 { | 53 { |
| 54 } | 54 } |
| 55 | 55 |
| 56 RenderBlockFlow* RenderBlockFlow::createAnonymous(Document* document) | 56 RenderBlockFlow* RenderBlockFlow::createAnonymous(Document* document) |
| 57 { | 57 { |
| 58 RenderBlockFlow* renderer = new RenderBlockFlow(0); | 58 RenderBlockFlow* renderer = new RenderBlockFlow(0); |
| 59 renderer->setDocumentForAnonymous(document); | 59 renderer->setDocumentForAnonymous(document); |
| 60 return renderer; | 60 return renderer; |
| 61 } | 61 } |
| 62 | 62 |
| 63 bool RenderBlockFlow::updateLogicalWidthAndColumnWidth() | |
| 64 { | |
| 65 return RenderBlock::updateLogicalWidthAndColumnWidth(); | |
| 66 } | |
| 67 | |
| 68 void RenderBlockFlow::layout() | 63 void RenderBlockFlow::layout() |
| 69 { | 64 { |
| 70 ASSERT(needsLayout()); | 65 ASSERT(needsLayout()); |
| 71 ASSERT(isInlineBlock() || !isInline()); | 66 ASSERT(isInlineBlock() || !isInline()); |
| 72 | 67 |
| 73 if (simplifiedLayout()) | 68 if (simplifiedLayout()) |
| 74 return; | 69 return; |
| 75 | 70 |
| 76 SubtreeLayoutScope layoutScope(*this); | 71 SubtreeLayoutScope layoutScope(*this); |
| 77 | 72 |
| 78 layoutBlockFlow(layoutScope); | 73 layoutBlockFlow(layoutScope); |
| 79 | 74 |
| 80 updateLayerTransformAfterLayout(); | 75 updateLayerTransformAfterLayout(); |
| 81 | 76 |
| 82 clearNeedsLayout(); | 77 clearNeedsLayout(); |
| 83 } | 78 } |
| 84 | 79 |
| 85 inline void RenderBlockFlow::layoutBlockFlow(SubtreeLayoutScope& layoutScope) | 80 inline void RenderBlockFlow::layoutBlockFlow(SubtreeLayoutScope& layoutScope) |
| 86 { | 81 { |
| 87 LayoutUnit oldLeft = logicalLeft(); | 82 LayoutUnit oldLeft = logicalLeft(); |
| 88 bool logicalWidthChanged = updateLogicalWidthAndColumnWidth(); | 83 bool logicalWidthChanged = updateLogicalWidthAndColumnWidth(); |
| 89 bool relayoutChildren = logicalWidthChanged; | 84 bool relayoutChildren = logicalWidthChanged; |
| 90 | 85 |
| 91 LayoutState state(*this, locationOffset(), logicalWidthChanged); | |
| 92 | |
| 93 LayoutUnit beforeEdge = borderBefore() + paddingBefore(); | 86 LayoutUnit beforeEdge = borderBefore() + paddingBefore(); |
| 94 LayoutUnit afterEdge = borderAfter() + paddingAfter(); | 87 LayoutUnit afterEdge = borderAfter() + paddingAfter(); |
| 95 LayoutUnit previousHeight = logicalHeight(); | 88 LayoutUnit previousHeight = logicalHeight(); |
| 96 setLogicalHeight(beforeEdge); | 89 setLogicalHeight(beforeEdge); |
| 97 | 90 |
| 98 layoutChildren(relayoutChildren, layoutScope, beforeEdge, afterEdge); | 91 layoutChildren(relayoutChildren, layoutScope, beforeEdge, afterEdge); |
| 99 | 92 |
| 100 LayoutUnit oldClientAfterEdge = clientLogicalBottom(); | 93 LayoutUnit oldClientAfterEdge = clientLogicalBottom(); |
| 101 | 94 |
| 102 updateLogicalHeight(); | 95 updateLogicalHeight(); |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 float logicalLeft = logicalLeftOffsetForLine(false).toFloat(); | 348 float logicalLeft = logicalLeftOffsetForLine(false).toFloat(); |
| 356 float availableLogicalWidth = logicalRightOffsetForLine(false) - logicalLeft
; | 349 float availableLogicalWidth = logicalRightOffsetForLine(false) - logicalLeft
; |
| 357 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid
th, availableLogicalWidth, 0); | 350 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid
th, availableLogicalWidth, 0); |
| 358 | 351 |
| 359 if (!style()->isLeftToRightDirection()) | 352 if (!style()->isLeftToRightDirection()) |
| 360 return logicalWidth() - logicalLeft; | 353 return logicalWidth() - logicalLeft; |
| 361 return logicalLeft; | 354 return logicalLeft; |
| 362 } | 355 } |
| 363 | 356 |
| 364 } // namespace blink | 357 } // namespace blink |
| OLD | NEW |