| 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 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 { | 314 { |
| 315 const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style(); | 315 const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style(); |
| 316 m_marginBox.setStart(styleToUse->writingMode(), styleToUse->direction(),
value); | 316 m_marginBox.setStart(styleToUse->writingMode(), styleToUse->direction(),
value); |
| 317 } | 317 } |
| 318 void setMarginEnd(LayoutUnit value, const RenderStyle* overrideStyle = 0) | 318 void setMarginEnd(LayoutUnit value, const RenderStyle* overrideStyle = 0) |
| 319 { | 319 { |
| 320 const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style(); | 320 const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style(); |
| 321 m_marginBox.setEnd(styleToUse->writingMode(), styleToUse->direction(), v
alue); | 321 m_marginBox.setEnd(styleToUse->writingMode(), styleToUse->direction(), v
alue); |
| 322 } | 322 } |
| 323 | 323 |
| 324 // The following five functions are used to implement collapsing margins. | 324 // The following functions are used to implement collapsing margins. |
| 325 // All objects know their maximal positive and negative margins. The | 325 // All objects know their maximal positive and negative margins. The |
| 326 // formula for computing a collapsed margin is |maxPosMargin| - |maxNegmargi
n|. | 326 // formula for computing a collapsed margin is |maxPosMargin| - |maxNegmargi
n|. |
| 327 // For a non-collapsing box, such as a leaf element, this formula will simpl
y return | 327 // For a non-collapsing box, such as a leaf element, this formula will simpl
y return |
| 328 // the margin of the element. Blocks override the maxMarginBefore and maxMa
rginAfter | 328 // the margin of the element. Blocks override the maxMarginBefore and maxMa
rginAfter |
| 329 // methods. | 329 // methods. |
| 330 enum MarginSign { PositiveMargin, NegativeMargin }; | |
| 331 virtual bool isSelfCollapsingBlock() const { return false; } | 330 virtual bool isSelfCollapsingBlock() const { return false; } |
| 332 virtual LayoutUnit collapsedMarginBefore() const { return marginBefore(); } | 331 virtual LayoutUnit collapsedMarginBefore() const { return marginBefore(); } |
| 333 virtual LayoutUnit collapsedMarginAfter() const { return marginAfter(); } | 332 virtual LayoutUnit collapsedMarginAfter() const { return marginAfter(); } |
| 334 | 333 |
| 335 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO
ffset) const OVERRIDE; | 334 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO
ffset) const OVERRIDE; |
| 336 virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const OVERRID
E; | 335 virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const OVERRID
E; |
| 337 | 336 |
| 338 int reflectionOffset() const; | 337 int reflectionOffset() const; |
| 339 // Given a rect in the object's coordinate space, returns the corresponding
rect in the reflection. | 338 // Given a rect in the object's coordinate space, returns the corresponding
rect in the reflection. |
| 340 LayoutRect reflectedRect(const LayoutRect&) const; | 339 LayoutRect reflectedRect(const LayoutRect&) const; |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 if (UNLIKELY(inlineBoxWrapper() != 0)) | 803 if (UNLIKELY(inlineBoxWrapper() != 0)) |
| 805 deleteLineBoxWrapper(); | 804 deleteLineBoxWrapper(); |
| 806 } | 805 } |
| 807 | 806 |
| 808 ensureRareData().m_inlineBoxWrapper = boxWrapper; | 807 ensureRareData().m_inlineBoxWrapper = boxWrapper; |
| 809 } | 808 } |
| 810 | 809 |
| 811 } // namespace blink | 810 } // namespace blink |
| 812 | 811 |
| 813 #endif // RenderBox_h | 812 #endif // RenderBox_h |
| OLD | NEW |