Skip to content

Commit bc169c7

Browse files
committed
Bug 1978487 - Make all ButtonControlFrames non-fragmentable, not just nsComboboxControlFrame. r=layout-reviewers,dshin
This matches the pre-regression behavior. I matched select's break-inside behavior, but we might want to make that !important, since the old code always used unconstrained bsize for the button contents? Differential Revision: https://phabricator.services.mozilla.com/D258190
1 parent 58f63ef commit bc169c7

File tree

5 files changed

+25
-4
lines changed

5 files changed

+25
-4
lines changed

layout/forms/ButtonControlFrame.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,13 @@ nsresult ButtonControlFrame::HandleEvent(nsPresContext* aPresContext,
4343
return NS_OK;
4444
}
4545

46+
void ButtonControlFrame::Reflow(nsPresContext* aPc, ReflowOutput& aDesiredSize,
47+
const ReflowInput& aReflowInput,
48+
nsReflowStatus& aStatus) {
49+
nsBlockFrame::Reflow(aPc, aDesiredSize, aReflowInput, aStatus);
50+
// We're always complete and we don't support overflow containers
51+
// so we shouldn't have a next-in-flow ever.
52+
aStatus.Reset();
53+
}
54+
4655
} // namespace mozilla

layout/forms/ButtonControlFrame.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ class ButtonControlFrame : public nsBlockFrame,
3939
mozilla::WidgetGUIEvent* aEvent,
4040
nsEventStatus* aEventStatus) override;
4141

42+
void Reflow(nsPresContext*, ReflowOutput&, const ReflowInput&,
43+
nsReflowStatus&) override;
44+
4245
// Given a string of text (for the button label), ensure it's not empty so
4346
// that line height computations work (inserting a zero-width character if
4447
// necessary).

layout/forms/nsComboboxControlFrame.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,6 @@ void nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
238238
}
239239

240240
ButtonControlFrame::Reflow(aPresContext, aDesiredSize, aReflowInput, aStatus);
241-
// We're always complete and we don't support overflow containers
242-
// so we shouldn't have a next-in-flow ever.
243-
aStatus.Reset();
244241
}
245242

246243
void nsComboboxControlFrame::Init(nsIContent* aContent,

layout/style/res/forms.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ select {
228228
overflow: clip;
229229
/* No text-decoration reaching inside, by default */
230230
display: inline-block;
231-
page-break-inside: avoid;
231+
break-inside: avoid;
232232
overflow-clip-box: padding-box !important; /* bug 992447 */
233233
padding-block: 1px;
234234

@@ -501,6 +501,7 @@ input:is([type="color"], [type="reset"], [type="button"], [type="submit"]) {
501501
box-sizing: border-box;
502502
user-select: none;
503503
overflow-clip-box: padding-box;
504+
break-inside: avoid;
504505
}
505506

506507
/* Text-related properties for buttons: these ones are not shared with
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<style>
2+
.parent {
3+
columns: 2;
4+
}
5+
input {
6+
float: inline-start;
7+
}
8+
</style>
9+
<div class="parent">
10+
<input style="display: block" type="color">
11+
</div>

0 commit comments

Comments
 (0)