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 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 void styleWillChange(StyleDifference, const ComputedStyle& newStyle) overrid
e; | 856 void styleWillChange(StyleDifference, const ComputedStyle& newStyle) overrid
e; |
857 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override
; | 857 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override
; |
858 void updateFromStyle() override; | 858 void updateFromStyle() override; |
859 | 859 |
860 // Returns false if it could not cheaply compute the extent (e.g. fixed back
ground), in which case the returned rect may be incorrect. | 860 // Returns false if it could not cheaply compute the extent (e.g. fixed back
ground), in which case the returned rect may be incorrect. |
861 // FIXME: make this a const method once the LayoutBox reference in BoxPainte
r is const. | 861 // FIXME: make this a const method once the LayoutBox reference in BoxPainte
r is const. |
862 bool getBackgroundPaintedExtent(LayoutRect&) const; | 862 bool getBackgroundPaintedExtent(LayoutRect&) const; |
863 virtual bool foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect,
unsigned maxDepthToTest) const; | 863 virtual bool foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect,
unsigned maxDepthToTest) const; |
864 bool computeBackgroundIsKnownToBeObscured() const override; | 864 bool computeBackgroundIsKnownToBeObscured() const override; |
865 | 865 |
866 void computePositionedLogicalWidth(LogicalExtentComputedValues&) const; | 866 virtual void computePositionedLogicalWidth(LogicalExtentComputedValues&) con
st; |
867 | 867 |
868 LayoutUnit computeIntrinsicLogicalWidthUsing(const Length& logicalWidthLengt
h, LayoutUnit availableLogicalWidth, LayoutUnit borderAndPadding) const; | 868 LayoutUnit computeIntrinsicLogicalWidthUsing(const Length& logicalWidthLengt
h, LayoutUnit availableLogicalWidth, LayoutUnit borderAndPadding) const; |
869 virtual LayoutUnit computeIntrinsicLogicalContentHeightUsing(const Length& l
ogicalHeightLength, LayoutUnit intrinsicContentHeight, LayoutUnit borderAndPaddi
ng) const; | 869 virtual LayoutUnit computeIntrinsicLogicalContentHeightUsing(const Length& l
ogicalHeightLength, LayoutUnit intrinsicContentHeight, LayoutUnit borderAndPaddi
ng) const; |
870 | 870 |
871 virtual bool shouldComputeSizeAsReplaced() const { return isAtomicInlineLeve
l() && !isInlineBlockOrInlineTable(); } | 871 virtual bool shouldComputeSizeAsReplaced() const { return isAtomicInlineLeve
l() && !isInlineBlockOrInlineTable(); } |
872 | 872 |
873 LayoutObject* splitAnonymousBoxesAroundChild(LayoutObject* beforeChild); | 873 LayoutObject* splitAnonymousBoxesAroundChild(LayoutObject* beforeChild); |
874 | 874 |
875 void addLayerHitTestRects(LayerHitTestRects&, const PaintLayer* currentCompo
sitedLayer, const LayoutPoint& layerOffset, const LayoutRect& containerRect) con
st override; | 875 void addLayerHitTestRects(LayerHitTestRects&, const PaintLayer* currentCompo
sitedLayer, const LayoutPoint& layerOffset, const LayoutRect& containerRect) con
st override; |
876 void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOf
fset) const override; | 876 void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOf
fset) const override; |
877 | 877 |
878 bool hitTestClippedOutByRoundedBorder(const HitTestLocation& locationInConta
iner, const LayoutPoint& borderBoxLocation) const; | 878 bool hitTestClippedOutByRoundedBorder(const HitTestLocation& locationInConta
iner, const LayoutPoint& borderBoxLocation) const; |
879 | 879 |
880 PaintInvalidationReason paintInvalidationReason(const LayoutBoxModelObject&
paintInvalidationContainer, | 880 PaintInvalidationReason paintInvalidationReason(const LayoutBoxModelObject&
paintInvalidationContainer, |
881 const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInva
lidationContainer, | 881 const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInva
lidationContainer, |
882 const LayoutRect& newBounds, const LayoutPoint& newPositionFromPaintInva
lidationContainer) const override; | 882 const LayoutRect& newBounds, const LayoutPoint& newPositionFromPaintInva
lidationContainer) const override; |
883 void incrementallyInvalidatePaint(const LayoutBoxModelObject& paintInvalidat
ionContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds, const La
youtPoint& positionFromPaintInvalidationContainer) override; | 883 void incrementallyInvalidatePaint(const LayoutBoxModelObject& paintInvalidat
ionContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds, const La
youtPoint& positionFromPaintInvalidationContainer) override; |
884 | 884 |
885 PaintInvalidationReason invalidatePaintIfNeeded(PaintInvalidationState&, con
st LayoutBoxModelObject& paintInvalidationContainer) override; | 885 PaintInvalidationReason invalidatePaintIfNeeded(PaintInvalidationState&, con
st LayoutBoxModelObject& paintInvalidationContainer) override; |
886 void invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& childPaintInv
alidationState) override; | 886 void invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& childPaintInv
alidationState) override; |
887 | 887 |
888 bool hasNonCompositedScrollbars() const final; | 888 bool hasNonCompositedScrollbars() const final; |
889 void excludeScrollbars(LayoutRect&, OverlayScrollbarSizeRelevancy = IgnoreOv
erlayScrollbarSize) const; | 889 void excludeScrollbars(LayoutRect&, OverlayScrollbarSizeRelevancy = IgnoreOv
erlayScrollbarSize) const; |
890 | 890 |
| 891 LayoutUnit containingBlockLogicalWidthForPositioned(const LayoutBoxModelObje
ct* containingBlock, bool checkForPerpendicularWritingMode = true) const; |
| 892 LayoutUnit containingBlockLogicalHeightForPositioned(const LayoutBoxModelObj
ect* containingBlock, bool checkForPerpendicularWritingMode = true) const; |
| 893 |
| 894 static void computeBlockStaticDistance(Length& logicalTop, Length& logicalBo
ttom, const LayoutBox* child, const LayoutBoxModelObject* containerBlock); |
| 895 static void computeInlineStaticDistance(Length& logicalLeft, Length& logical
Right, const LayoutBox* child, const LayoutBoxModelObject* containerBlock, Layou
tUnit containerLogicalWidth); |
| 896 static void computeLogicalLeftPositionedOffset(LayoutUnit& logicalLeftPos, c
onst LayoutBox* child, LayoutUnit logicalWidthValue, const LayoutBoxModelObject*
containerBlock, LayoutUnit containerLogicalWidth); |
| 897 static void computeLogicalTopPositionedOffset(LayoutUnit& logicalTopPos, con
st LayoutBox* child, LayoutUnit logicalHeightValue, const LayoutBoxModelObject*
containerBlock, LayoutUnit containerLogicalHeight); |
| 898 |
891 private: | 899 private: |
892 bool mustInvalidateBackgroundOrBorderPaintOnHeightChange() const; | 900 bool mustInvalidateBackgroundOrBorderPaintOnHeightChange() const; |
893 bool mustInvalidateBackgroundOrBorderPaintOnWidthChange() const; | 901 bool mustInvalidateBackgroundOrBorderPaintOnWidthChange() const; |
894 inline bool mustInvalidateFillLayersPaintOnWidthChange(const FillLayer&) con
st; | 902 inline bool mustInvalidateFillLayersPaintOnWidthChange(const FillLayer&) con
st; |
895 | 903 |
896 void invalidatePaintRectClippedByOldAndNewBounds(const LayoutBoxModelObject&
paintInvalidationContainer, const LayoutRect&, const LayoutRect& oldBounds, con
st LayoutRect& newBounds); | 904 void invalidatePaintRectClippedByOldAndNewBounds(const LayoutBoxModelObject&
paintInvalidationContainer, const LayoutRect&, const LayoutRect& oldBounds, con
st LayoutRect& newBounds); |
897 | 905 |
898 void updateShapeOutsideInfoAfterStyleChange(const ComputedStyle&, const Comp
utedStyle* oldStyle); | 906 void updateShapeOutsideInfoAfterStyleChange(const ComputedStyle&, const Comp
utedStyle* oldStyle); |
899 void updateGridPositionAfterStyleChange(const ComputedStyle*); | 907 void updateGridPositionAfterStyleChange(const ComputedStyle*); |
900 | 908 |
901 bool autoWidthShouldFitContent() const; | 909 bool autoWidthShouldFitContent() const; |
902 LayoutUnit shrinkToFitLogicalWidth(LayoutUnit availableLogicalWidth, LayoutU
nit bordersPlusPadding) const; | 910 LayoutUnit shrinkToFitLogicalWidth(LayoutUnit availableLogicalWidth, LayoutU
nit bordersPlusPadding) const; |
903 | 911 |
904 // Returns true if we queued up a paint invalidation. | 912 // Returns true if we queued up a paint invalidation. |
905 bool invalidatePaintOfLayerRectsForImage(WrappedImagePtr, const FillLayer&,
bool drawingBackground); | 913 bool invalidatePaintOfLayerRectsForImage(WrappedImagePtr, const FillLayer&,
bool drawingBackground); |
906 | 914 |
907 bool stretchesToViewportInQuirksMode() const; | 915 bool stretchesToViewportInQuirksMode() const; |
908 bool skipContainingBlockForPercentHeightCalculation(const LayoutBox* contain
ingBlock) const; | 916 bool skipContainingBlockForPercentHeightCalculation(const LayoutBox* contain
ingBlock) const; |
909 | 917 |
910 LayoutUnit containingBlockLogicalWidthForPositioned(const LayoutBoxModelObje
ct* containingBlock, bool checkForPerpendicularWritingMode = true) const; | 918 virtual void computePositionedLogicalHeight(LogicalExtentComputedValues&) co
nst; |
911 LayoutUnit containingBlockLogicalHeightForPositioned(const LayoutBoxModelObj
ect* containingBlock, bool checkForPerpendicularWritingMode = true) const; | |
912 | |
913 void computePositionedLogicalHeight(LogicalExtentComputedValues&) const; | |
914 void computePositionedLogicalWidthUsing(SizeType, Length logicalWidth, const
LayoutBoxModelObject* containerBlock, TextDirection containerDirection, | 919 void computePositionedLogicalWidthUsing(SizeType, Length logicalWidth, const
LayoutBoxModelObject* containerBlock, TextDirection containerDirection, |
915 LayoutUnit containerLogicalWidth, LayoutUnit bordersPlusPadding, | 920 LayoutUnit containerLogicalWidth, LayoutUnit bordersPlusPadding, |
916 const Length& logicalLeft, const Length& logicalRight, const Length& mar
ginLogicalLeft, | 921 const Length& logicalLeft, const Length& logicalRight, const Length& mar
ginLogicalLeft, |
917 const Length& marginLogicalRight, LogicalExtentComputedValues&) const; | 922 const Length& marginLogicalRight, LogicalExtentComputedValues&) const; |
918 void computePositionedLogicalHeightUsing(SizeType, Length logicalHeightLengt
h, const LayoutBoxModelObject* containerBlock, | 923 void computePositionedLogicalHeightUsing(SizeType, Length logicalHeightLengt
h, const LayoutBoxModelObject* containerBlock, |
919 LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding, Layout
Unit logicalHeight, | 924 LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding, Layout
Unit logicalHeight, |
920 const Length& logicalTop, const Length& logicalBottom, const Length& mar
ginLogicalTop, | 925 const Length& logicalTop, const Length& logicalBottom, const Length& mar
ginLogicalTop, |
921 const Length& marginLogicalBottom, LogicalExtentComputedValues&) const; | 926 const Length& marginLogicalBottom, LogicalExtentComputedValues&) const; |
922 | 927 |
923 void computePositionedLogicalHeightReplaced(LogicalExtentComputedValues&) co
nst; | |
924 void computePositionedLogicalWidthReplaced(LogicalExtentComputedValues&) con
st; | |
925 | |
926 LayoutUnit fillAvailableMeasure(LayoutUnit availableLogicalWidth) const; | 928 LayoutUnit fillAvailableMeasure(LayoutUnit availableLogicalWidth) const; |
927 LayoutUnit fillAvailableMeasure(LayoutUnit availableLogicalWidth, LayoutUnit
& marginStart, LayoutUnit& marginEnd) const; | 929 LayoutUnit fillAvailableMeasure(LayoutUnit availableLogicalWidth, LayoutUnit
& marginStart, LayoutUnit& marginEnd) const; |
928 | 930 |
929 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo
utUnit& maxLogicalWidth) const; | 931 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo
utUnit& maxLogicalWidth) const; |
930 | 932 |
931 // This function calculates the preferred widths for an object. | 933 // This function calculates the preferred widths for an object. |
932 // | 934 // |
933 // This function is only expected to be called if | 935 // This function is only expected to be called if |
934 // the boolean preferredLogicalWidthsDirty is true. It also MUST clear the | 936 // the boolean preferredLogicalWidthsDirty is true. It also MUST clear the |
935 // boolean before returning. | 937 // boolean before returning. |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 if (UNLIKELY(m_inlineBoxWrapper != nullptr)) | 1080 if (UNLIKELY(m_inlineBoxWrapper != nullptr)) |
1079 deleteLineBoxWrapper(); | 1081 deleteLineBoxWrapper(); |
1080 } | 1082 } |
1081 | 1083 |
1082 m_inlineBoxWrapper = boxWrapper; | 1084 m_inlineBoxWrapper = boxWrapper; |
1083 } | 1085 } |
1084 | 1086 |
1085 } // namespace blink | 1087 } // namespace blink |
1086 | 1088 |
1087 #endif // LayoutBox_h | 1089 #endif // LayoutBox_h |
OLD | NEW |