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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 LayoutRectOutsets marginBoxOutsets() const override { return m_marginBoxOuts
ets; } | 436 LayoutRectOutsets marginBoxOutsets() const override { return m_marginBoxOuts
ets; } |
437 LayoutUnit marginTop() const override { return m_marginBoxOutsets.top(); } | 437 LayoutUnit marginTop() const override { return m_marginBoxOutsets.top(); } |
438 LayoutUnit marginBottom() const override { return m_marginBoxOutsets.bottom(
); } | 438 LayoutUnit marginBottom() const override { return m_marginBoxOutsets.bottom(
); } |
439 LayoutUnit marginLeft() const override { return m_marginBoxOutsets.left(); } | 439 LayoutUnit marginLeft() const override { return m_marginBoxOutsets.left(); } |
440 LayoutUnit marginRight() const override { return m_marginBoxOutsets.right();
} | 440 LayoutUnit marginRight() const override { return m_marginBoxOutsets.right();
} |
441 void setMarginTop(LayoutUnit margin) { m_marginBoxOutsets.setTop(margin); } | 441 void setMarginTop(LayoutUnit margin) { m_marginBoxOutsets.setTop(margin); } |
442 void setMarginBottom(LayoutUnit margin) { m_marginBoxOutsets.setBottom(margi
n); } | 442 void setMarginBottom(LayoutUnit margin) { m_marginBoxOutsets.setBottom(margi
n); } |
443 void setMarginLeft(LayoutUnit margin) { m_marginBoxOutsets.setLeft(margin);
} | 443 void setMarginLeft(LayoutUnit margin) { m_marginBoxOutsets.setLeft(margin);
} |
444 void setMarginRight(LayoutUnit margin) { m_marginBoxOutsets.setRight(margin)
; } | 444 void setMarginRight(LayoutUnit margin) { m_marginBoxOutsets.setRight(margin)
; } |
445 | 445 |
446 LayoutUnit marginLogicalLeft() const { return m_marginBoxOutsets.logicalLeft
(style()->writingMode()); } | 446 LayoutUnit marginLogicalLeft() const { return m_marginBoxOutsets.logicalLeft
(style()->getWritingMode()); } |
447 LayoutUnit marginLogicalRight() const { return m_marginBoxOutsets.logicalRig
ht(style()->writingMode()); } | 447 LayoutUnit marginLogicalRight() const { return m_marginBoxOutsets.logicalRig
ht(style()->getWritingMode()); } |
448 | 448 |
449 LayoutUnit marginBefore(const ComputedStyle* overrideStyle = nullptr) const
final { return m_marginBoxOutsets.before((overrideStyle ? overrideStyle : style(
))->writingMode()); } | 449 LayoutUnit marginBefore(const ComputedStyle* overrideStyle = nullptr) const
final { return m_marginBoxOutsets.before((overrideStyle ? overrideStyle : style(
))->getWritingMode()); } |
450 LayoutUnit marginAfter(const ComputedStyle* overrideStyle = nullptr) const f
inal { return m_marginBoxOutsets.after((overrideStyle ? overrideStyle : style())
->writingMode()); } | 450 LayoutUnit marginAfter(const ComputedStyle* overrideStyle = nullptr) const f
inal { return m_marginBoxOutsets.after((overrideStyle ? overrideStyle : style())
->getWritingMode()); } |
451 LayoutUnit marginStart(const ComputedStyle* overrideStyle = nullptr) const f
inal | 451 LayoutUnit marginStart(const ComputedStyle* overrideStyle = nullptr) const f
inal |
452 { | 452 { |
453 const ComputedStyle* styleToUse = overrideStyle ? overrideStyle : style(
); | 453 const ComputedStyle* styleToUse = overrideStyle ? overrideStyle : style(
); |
454 return m_marginBoxOutsets.start(styleToUse->writingMode(), styleToUse->d
irection()); | 454 return m_marginBoxOutsets.start(styleToUse->getWritingMode(), styleToUse
->direction()); |
455 } | 455 } |
456 LayoutUnit marginEnd(const ComputedStyle* overrideStyle = nullptr) const fin
al | 456 LayoutUnit marginEnd(const ComputedStyle* overrideStyle = nullptr) const fin
al |
457 { | 457 { |
458 const ComputedStyle* styleToUse = overrideStyle ? overrideStyle : style(
); | 458 const ComputedStyle* styleToUse = overrideStyle ? overrideStyle : style(
); |
459 return m_marginBoxOutsets.end(styleToUse->writingMode(), styleToUse->dir
ection()); | 459 return m_marginBoxOutsets.end(styleToUse->getWritingMode(), styleToUse->
direction()); |
460 } | 460 } |
461 LayoutUnit marginOver() const final { return m_marginBoxOutsets.over(style()
->writingMode()); } | 461 LayoutUnit marginOver() const final { return m_marginBoxOutsets.over(style()
->getWritingMode()); } |
462 LayoutUnit marginUnder() const final { return m_marginBoxOutsets.under(style
()->writingMode()); } | 462 LayoutUnit marginUnder() const final { return m_marginBoxOutsets.under(style
()->getWritingMode()); } |
463 void setMarginBefore(LayoutUnit value, const ComputedStyle* overrideStyle =
nullptr) { m_marginBoxOutsets.setBefore((overrideStyle ? overrideStyle : style()
)->writingMode(), value); } | 463 void setMarginBefore(LayoutUnit value, const ComputedStyle* overrideStyle =
nullptr) { m_marginBoxOutsets.setBefore((overrideStyle ? overrideStyle : style()
)->getWritingMode(), value); } |
464 void setMarginAfter(LayoutUnit value, const ComputedStyle* overrideStyle = n
ullptr) { m_marginBoxOutsets.setAfter((overrideStyle ? overrideStyle : style())-
>writingMode(), value); } | 464 void setMarginAfter(LayoutUnit value, const ComputedStyle* overrideStyle = n
ullptr) { m_marginBoxOutsets.setAfter((overrideStyle ? overrideStyle : style())-
>getWritingMode(), value); } |
465 void setMarginStart(LayoutUnit value, const ComputedStyle* overrideStyle = n
ullptr) | 465 void setMarginStart(LayoutUnit value, const ComputedStyle* overrideStyle = n
ullptr) |
466 { | 466 { |
467 const ComputedStyle* styleToUse = overrideStyle ? overrideStyle : style(
); | 467 const ComputedStyle* styleToUse = overrideStyle ? overrideStyle : style(
); |
468 m_marginBoxOutsets.setStart(styleToUse->writingMode(), styleToUse->direc
tion(), value); | 468 m_marginBoxOutsets.setStart(styleToUse->getWritingMode(), styleToUse->di
rection(), value); |
469 } | 469 } |
470 void setMarginEnd(LayoutUnit value, const ComputedStyle* overrideStyle = nul
lptr) | 470 void setMarginEnd(LayoutUnit value, const ComputedStyle* overrideStyle = nul
lptr) |
471 { | 471 { |
472 const ComputedStyle* styleToUse = overrideStyle ? overrideStyle : style(
); | 472 const ComputedStyle* styleToUse = overrideStyle ? overrideStyle : style(
); |
473 m_marginBoxOutsets.setEnd(styleToUse->writingMode(), styleToUse->directi
on(), value); | 473 m_marginBoxOutsets.setEnd(styleToUse->getWritingMode(), styleToUse->dire
ction(), value); |
474 } | 474 } |
475 | 475 |
476 // The following functions are used to implement collapsing margins. | 476 // The following functions are used to implement collapsing margins. |
477 // All objects know their maximal positive and negative margins. The | 477 // All objects know their maximal positive and negative margins. The |
478 // formula for computing a collapsed margin is |maxPosMargin| - |maxNegmargi
n|. | 478 // formula for computing a collapsed margin is |maxPosMargin| - |maxNegmargi
n|. |
479 // For a non-collapsing box, such as a leaf element, this formula will simpl
y return | 479 // For a non-collapsing box, such as a leaf element, this formula will simpl
y return |
480 // the margin of the element. Blocks override the maxMarginBefore and maxMa
rginAfter | 480 // the margin of the element. Blocks override the maxMarginBefore and maxMa
rginAfter |
481 // methods. | 481 // methods. |
482 virtual bool isSelfCollapsingBlock() const { return false; } | 482 virtual bool isSelfCollapsingBlock() const { return false; } |
483 virtual LayoutUnit collapsedMarginBefore() const { return marginBefore(); } | 483 virtual LayoutUnit collapsedMarginBefore() const { return marginBefore(); } |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 PaintLayer* enclosingFloatPaintingLayer() const; | 746 PaintLayer* enclosingFloatPaintingLayer() const; |
747 | 747 |
748 virtual int firstLineBoxBaseline() const { return -1; } | 748 virtual int firstLineBoxBaseline() const { return -1; } |
749 virtual int inlineBlockBaseline(LineDirectionMode) const { return -1; } // R
eturns -1 if we should skip this box when computing the baseline of an inline-bl
ock. | 749 virtual int inlineBlockBaseline(LineDirectionMode) const { return -1; } // R
eturns -1 if we should skip this box when computing the baseline of an inline-bl
ock. |
750 | 750 |
751 bool shrinkToAvoidFloats() const; | 751 bool shrinkToAvoidFloats() const; |
752 virtual bool avoidsFloats() const; | 752 virtual bool avoidsFloats() const; |
753 | 753 |
754 virtual void markForPaginationRelayoutIfNeeded(SubtreeLayoutScope&); | 754 virtual void markForPaginationRelayoutIfNeeded(SubtreeLayoutScope&); |
755 | 755 |
756 bool isWritingModeRoot() const { return !parent() || parent()->style()->writ
ingMode() != style()->writingMode(); } | 756 bool isWritingModeRoot() const { return !parent() || parent()->style()->getW
ritingMode() != style()->getWritingMode(); } |
757 bool isOrthogonalWritingModeRoot() const { return parent() && parent()->isHo
rizontalWritingMode() != isHorizontalWritingMode(); } | 757 bool isOrthogonalWritingModeRoot() const { return parent() && parent()->isHo
rizontalWritingMode() != isHorizontalWritingMode(); } |
758 void markOrthogonalWritingModeRoot(); | 758 void markOrthogonalWritingModeRoot(); |
759 void unmarkOrthogonalWritingModeRoot(); | 759 void unmarkOrthogonalWritingModeRoot(); |
760 | 760 |
761 bool isDeprecatedFlexItem() const { return !isInline() && !isFloatingOrOutOf
FlowPositioned() && parent() && parent()->isDeprecatedFlexibleBox(); } | 761 bool isDeprecatedFlexItem() const { return !isInline() && !isFloatingOrOutOf
FlowPositioned() && parent() && parent()->isDeprecatedFlexibleBox(); } |
762 bool isFlexItemIncludingDeprecated() const { return !isInline() && !isFloati
ngOrOutOfFlowPositioned() && parent() && parent()->isFlexibleBoxIncludingDepreca
ted(); } | 762 bool isFlexItemIncludingDeprecated() const { return !isInline() && !isFloati
ngOrOutOfFlowPositioned() && parent() && parent()->isFlexibleBoxIncludingDepreca
ted(); } |
763 | 763 |
764 bool isGridItem() const { return parent() && parent()->isLayoutGrid(); } | 764 bool isGridItem() const { return parent() && parent()->isLayoutGrid(); } |
765 | 765 |
766 LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositionMode =
PositionOnContainingLine) const override; | 766 LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositionMode =
PositionOnContainingLine) const override; |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 if (UNLIKELY(m_inlineBoxWrapper != nullptr)) | 1131 if (UNLIKELY(m_inlineBoxWrapper != nullptr)) |
1132 deleteLineBoxWrapper(); | 1132 deleteLineBoxWrapper(); |
1133 } | 1133 } |
1134 | 1134 |
1135 m_inlineBoxWrapper = boxWrapper; | 1135 m_inlineBoxWrapper = boxWrapper; |
1136 } | 1136 } |
1137 | 1137 |
1138 } // namespace blink | 1138 } // namespace blink |
1139 | 1139 |
1140 #endif // LayoutBox_h | 1140 #endif // LayoutBox_h |
OLD | NEW |