| 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 { | 296 { |
| 297 const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style(); | 297 const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style(); |
| 298 m_marginBox.setStart(styleToUse->direction(), value); | 298 m_marginBox.setStart(styleToUse->direction(), value); |
| 299 } | 299 } |
| 300 void setMarginEnd(LayoutUnit value, const RenderStyle* overrideStyle = 0) | 300 void setMarginEnd(LayoutUnit value, const RenderStyle* overrideStyle = 0) |
| 301 { | 301 { |
| 302 const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style(); | 302 const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style(); |
| 303 m_marginBox.setEnd(styleToUse->direction(), value); | 303 m_marginBox.setEnd(styleToUse->direction(), value); |
| 304 } | 304 } |
| 305 | 305 |
| 306 // The following five functions are used to implement collapsing margins. | |
| 307 // All objects know their maximal positive and negative margins. The | |
| 308 // formula for computing a collapsed margin is |maxPosMargin| - |maxNegmargi
n|. | |
| 309 // For a non-collapsing box, such as a leaf element, this formula will simpl
y return | |
| 310 // the margin of the element. Blocks override the maxMarginBefore and maxMa
rginAfter | |
| 311 // methods. | |
| 312 enum MarginSign { PositiveMargin, NegativeMargin }; | |
| 313 virtual bool isSelfCollapsingBlock() const { return false; } | |
| 314 virtual LayoutUnit collapsedMarginBefore() const { return marginBefore(); } | |
| 315 virtual LayoutUnit collapsedMarginAfter() const { return marginAfter(); } | |
| 316 | |
| 317 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO
ffset) const override; | 306 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO
ffset) const override; |
| 318 virtual void absoluteQuads(Vector<FloatQuad>&) const override; | 307 virtual void absoluteQuads(Vector<FloatQuad>&) const override; |
| 319 | 308 |
| 320 virtual void layout() override; | 309 virtual void layout() override; |
| 321 virtual void paint(PaintInfo&, const LayoutPoint&) override; | 310 virtual void paint(PaintInfo&, const LayoutPoint&) override; |
| 322 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion) override; | 311 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion) override; |
| 323 | 312 |
| 324 virtual LayoutUnit minPreferredLogicalWidth() const override; | 313 virtual LayoutUnit minPreferredLogicalWidth() const override; |
| 325 virtual LayoutUnit maxPreferredLogicalWidth() const override; | 314 virtual LayoutUnit maxPreferredLogicalWidth() const override; |
| 326 | 315 |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 if (UNLIKELY(inlineBoxWrapper() != 0)) | 725 if (UNLIKELY(inlineBoxWrapper() != 0)) |
| 737 deleteLineBoxWrapper(); | 726 deleteLineBoxWrapper(); |
| 738 } | 727 } |
| 739 | 728 |
| 740 ensureRareData().m_inlineBoxWrapper = boxWrapper; | 729 ensureRareData().m_inlineBoxWrapper = boxWrapper; |
| 741 } | 730 } |
| 742 | 731 |
| 743 } // namespace blink | 732 } // namespace blink |
| 744 | 733 |
| 745 #endif // RenderBox_h | 734 #endif // RenderBox_h |
| OLD | NEW |