summaryrefslogtreecommitdiffstats
path: root/layout/generic/nsLineBox.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /layout/generic/nsLineBox.h
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/generic/nsLineBox.h')
-rw-r--r--layout/generic/nsLineBox.h48
1 files changed, 24 insertions, 24 deletions
diff --git a/layout/generic/nsLineBox.h b/layout/generic/nsLineBox.h
index d46cf9604a..e35f36a481 100644
--- a/layout/generic/nsLineBox.h
+++ b/layout/generic/nsLineBox.h
@@ -238,42 +238,40 @@ class nsLineBox final : public nsLineLink {
}
}
- // mHasForcedLineBreak bit & mFloatClearType value
- // Break information is applied *before* the line if the line is a block,
- // or *after* the line if the line is an inline.
- bool HasForcedLineBreak() const { return mFlags.mHasForcedLineBreak; }
+ // mHasForcedLineBreakAfter bit & mFloatClearType value
void ClearForcedLineBreak() {
- mFlags.mHasForcedLineBreak = false;
+ mFlags.mHasForcedLineBreakAfter = false;
mFlags.mFloatClearType = mozilla::StyleClear::None;
}
- bool HasForcedLineBreakBefore() const {
- return IsBlock() && HasForcedLineBreak();
+ bool HasFloatClearTypeBefore() const {
+ return FloatClearTypeBefore() != mozilla::StyleClear::None;
}
- void SetForcedLineBreakBefore(mozilla::StyleClear aClearType) {
- MOZ_ASSERT(IsBlock(), "Only blocks have break-before");
+ void SetFloatClearTypeBefore(mozilla::StyleClear aClearType) {
+ MOZ_ASSERT(IsBlock(), "Only block lines have break-before status!");
MOZ_ASSERT(aClearType != mozilla::StyleClear::None,
"Only StyleClear:Left/Right/Both are allowed before a line");
- mFlags.mHasForcedLineBreak = true;
mFlags.mFloatClearType = aClearType;
}
mozilla::StyleClear FloatClearTypeBefore() const {
- return IsBlock() ? FloatClearType() : mozilla::StyleClear::None;
+ return IsBlock() ? mFlags.mFloatClearType : mozilla::StyleClear::None;
}
bool HasForcedLineBreakAfter() const {
- return IsInline() && HasForcedLineBreak();
+ MOZ_ASSERT(IsInline() || !mFlags.mHasForcedLineBreakAfter,
+ "A block line shouldn't set mHasForcedLineBreakAfter bit!");
+ return IsInline() && mFlags.mHasForcedLineBreakAfter;
}
void SetForcedLineBreakAfter(mozilla::StyleClear aClearType) {
- MOZ_ASSERT(IsInline(), "Only inlines have break-after");
- mFlags.mHasForcedLineBreak = true;
+ MOZ_ASSERT(IsInline(), "Only inline lines have break-after status!");
+ mFlags.mHasForcedLineBreakAfter = true;
mFlags.mFloatClearType = aClearType;
}
bool HasFloatClearTypeAfter() const {
- return IsInline() && FloatClearType() != mozilla::StyleClear::None;
+ return FloatClearTypeAfter() != mozilla::StyleClear::None;
}
mozilla::StyleClear FloatClearTypeAfter() const {
- return IsInline() ? FloatClearType() : mozilla::StyleClear::None;
+ return IsInline() ? mFlags.mFloatClearType : mozilla::StyleClear::None;
}
// mCarriedOutBEndMargin value
@@ -316,7 +314,7 @@ class nsLineBox final : public nsLineLink {
nsRect InkOverflowRect() const {
return GetOverflowArea(mozilla::OverflowType::Ink);
}
- nsRect ScrollableOverflowRect() {
+ nsRect ScrollableOverflowRect() const {
return GetOverflowArea(mozilla::OverflowType::Scrollable);
}
@@ -520,11 +518,15 @@ class nsLineBox final : public nsLineLink {
// Has this line moved to a different fragment of the block since
// the last time it was reflowed?
bool mMovedFragments : 1;
- // mHasForcedLineBreak indicates that this line has either a break-before or
- // a break-after.
- bool mHasForcedLineBreak : 1;
- // mFloatClearType indicates that there's a float clearance before or after
- // this line.
+ // mHasForcedLineBreakAfter indicates that this *inline* line has a
+ // break-after status due to a float clearance or ending with <br>. A block
+ // line shouldn't set this bit.
+ //
+ // Note: This bit is unrelated to CSS break-after property because it is all
+ // about line break-after for inline-level boxes.
+ bool mHasForcedLineBreakAfter : 1;
+ // mFloatClearType indicates that there's a float clearance before a block
+ // line, or after an inline line.
mozilla::StyleClear mFloatClearType;
};
@@ -570,8 +572,6 @@ class nsLineBox final : public nsLineLink {
FlagBits mFlags;
};
- mozilla::StyleClear FloatClearType() const { return mFlags.mFloatClearType; };
-
union {
ExtraData* mData;
ExtraBlockData* mBlockData;