Bug 1545328 Part 6 - Mark some nsColumnSetFrame methods "const". r=mats

Also, move GetAvailableContentBSize() to non-public section because it's
only used by nsColumnSetFrame.

Differential Revision: https://phabricator.services.mozilla.com/D28014

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ting-Yu Lin 2019-04-19 05:43:14 +00:00
Родитель de008d4346
Коммит 4319b2077b
2 изменённых файлов: 16 добавлений и 15 удалений

Просмотреть файл

@ -117,7 +117,7 @@ nsColumnSetFrame::nsColumnSetFrame(ComputedStyle* aStyle,
void nsColumnSetFrame::ForEachColumnRule(
const std::function<void(const nsRect& lineRect)>& aSetLineRect,
const nsPoint& aPt) {
const nsPoint& aPt) const {
nsIFrame* child = mFrames.FirstChild();
if (!child) return; // no columns
@ -167,7 +167,8 @@ void nsColumnSetFrame::ForEachColumnRule(
}
}
nsRect nsColumnSetFrame::CalculateColumnRuleBounds(const nsPoint& aOffset) {
nsRect nsColumnSetFrame::CalculateColumnRuleBounds(
const nsPoint& aOffset) const {
nsRect combined;
ForEachColumnRule(
[&combined](const nsRect& aLineRect) {
@ -262,7 +263,7 @@ static nscoord GetAvailableContentISize(const ReflowInput& aReflowInput) {
}
nscoord nsColumnSetFrame::GetAvailableContentBSize(
const ReflowInput& aReflowInput) {
const ReflowInput& aReflowInput) const {
if (aReflowInput.AvailableBSize() == NS_INTRINSICSIZE) {
return NS_INTRINSICSIZE;
}
@ -274,7 +275,7 @@ nscoord nsColumnSetFrame::GetAvailableContentBSize(
return std::max(0, aReflowInput.AvailableBSize() - bp.BStartEnd(wm));
}
static nscoord GetColumnGap(nsColumnSetFrame* aFrame,
static nscoord GetColumnGap(const nsColumnSetFrame* aFrame,
nscoord aPercentageBasis) {
const auto& columnGap = aFrame->StylePosition()->mColumnGap;
if (columnGap.IsNormal()) {
@ -289,7 +290,7 @@ static nscoord ClampUsedColumnWidth(const Length& aColumnWidth) {
}
nsColumnSetFrame::ReflowConfig nsColumnSetFrame::ChooseColumnStrategy(
const ReflowInput& aReflowInput, bool aForceAuto = false) {
const ReflowInput& aReflowInput, bool aForceAuto = false) const {
WritingMode wm = aReflowInput.GetWritingMode();
const nsStyleColumn* colStyle = StyleColumn();

Просмотреть файл

@ -40,13 +40,6 @@ class nsColumnSetFrame final : public nsContainerFrame {
nscoord GetMinISize(gfxContext* aRenderingContext) override;
nscoord GetPrefISize(gfxContext* aRenderingContext) override;
/**
* Retrieve the available block-size for content of this frame. The available
* content block-size is the available block-size for the frame, minus borders
* and padding.
*/
nscoord GetAvailableContentBSize(const ReflowInput& aReflowInput);
nsContainerFrame* GetContentInsertionFrame() override {
nsIFrame* frame = PrincipalChildList().FirstChild();
@ -80,7 +73,7 @@ class nsColumnSetFrame final : public nsContainerFrame {
}
#endif
nsRect CalculateColumnRuleBounds(const nsPoint& aOffset);
nsRect CalculateColumnRuleBounds(const nsPoint& aOffset) const;
void CreateBorderRenderers(nsTArray<nsCSSBorderRenderer>& aBorderRenderers,
gfxContext* aCtx, const nsRect& aDirtyRect,
const nsPoint& aPt);
@ -180,7 +173,7 @@ class nsColumnSetFrame final : public nsContainerFrame {
* the state machine that controls column balancing.
*/
ReflowConfig ChooseColumnStrategy(const ReflowInput& aReflowInput,
bool aForceAuto);
bool aForceAuto) const;
/**
* Perform the binary search for the best balance block-size for this column
@ -208,9 +201,16 @@ class nsColumnSetFrame final : public nsContainerFrame {
ReflowOutput& aDesiredSize,
bool aUnboundedLastColumn, nsReflowStatus& aStatus);
/**
* Retrieve the available block-size for content of this frame. The available
* content block-size is the available block-size for the frame, minus borders
* and padding.
*/
nscoord GetAvailableContentBSize(const ReflowInput& aReflowInput) const;
void ForEachColumnRule(
const std::function<void(const nsRect& lineRect)>& aSetLineRect,
const nsPoint& aPt);
const nsPoint& aPt) const;
};
#endif // nsColumnSetFrame_h___