| 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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 if (child.avoidsFloats() && containsFloats()) { | 666 if (child.avoidsFloats() && containsFloats()) { |
| 667 LayoutUnit positionToAvoidFloats = | 667 LayoutUnit positionToAvoidFloats = |
| 668 startOffsetForLine(logicalTopForChild(child), DoNotIndentText, | 668 startOffsetForLine(logicalTopForChild(child), DoNotIndentText, |
| 669 logicalHeightForChild(child)); | 669 logicalHeightForChild(child)); |
| 670 | 670 |
| 671 // If the child has an offset from the content edge to avoid floats then use | 671 // If the child has an offset from the content edge to avoid floats then use |
| 672 // that, otherwise let any negative margin pull it back over the content | 672 // that, otherwise let any negative margin pull it back over the content |
| 673 // edge or any positive margin push it out. | 673 // edge or any positive margin push it out. |
| 674 // If the child is being centred then the margin calculated to do that has | 674 // If the child is being centred then the margin calculated to do that has |
| 675 // factored in any offset required to avoid floats, so use it if necessary. | 675 // factored in any offset required to avoid floats, so use it if necessary. |
| 676 if (style()->textAlign() == WEBKIT_CENTER || | 676 if (style()->textAlign() == ETextAlign::WebkitCenter || |
| 677 child.style()->marginStartUsing(style()).isAuto()) | 677 child.style()->marginStartUsing(style()).isAuto()) |
| 678 newPosition = | 678 newPosition = |
| 679 std::max(newPosition, positionToAvoidFloats + childMarginStart); | 679 std::max(newPosition, positionToAvoidFloats + childMarginStart); |
| 680 else if (positionToAvoidFloats > initialStartPosition) | 680 else if (positionToAvoidFloats > initialStartPosition) |
| 681 newPosition = std::max(newPosition, positionToAvoidFloats); | 681 newPosition = std::max(newPosition, positionToAvoidFloats); |
| 682 } | 682 } |
| 683 | 683 |
| 684 setLogicalLeftForChild(child, style()->isLeftToRightDirection() | 684 setLogicalLeftForChild(child, style()->isLeftToRightDirection() |
| 685 ? newPosition | 685 ? newPosition |
| 686 : totalAvailableLogicalWidth - newPosition - | 686 : totalAvailableLogicalWidth - newPosition - |
| (...skipping 3883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4570 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); | 4570 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); |
| 4571 } | 4571 } |
| 4572 | 4572 |
| 4573 void LayoutBlockFlow::invalidateDisplayItemClients( | 4573 void LayoutBlockFlow::invalidateDisplayItemClients( |
| 4574 PaintInvalidationReason invalidationReason) const { | 4574 PaintInvalidationReason invalidationReason) const { |
| 4575 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( | 4575 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( |
| 4576 invalidationReason); | 4576 invalidationReason); |
| 4577 } | 4577 } |
| 4578 | 4578 |
| 4579 } // namespace blink | 4579 } // namespace blink |
| OLD | NEW |