Bug 1723709 - Ignore line-height in the inside of the datetimebox when there's a fixed height specified. r=layout-reviewers,jfkthame

But use it when we're intrinsically sized. This matches other browsers.

Differential Revision: https://phabricator.services.mozilla.com/D121616
This commit is contained in:
Emilio Cobos Álvarez 2021-08-03 13:57:13 +00:00
parent fd0013fc0c
commit 77c4eb5db9
7 changed files with 42 additions and 2 deletions

View File

@ -155,8 +155,9 @@ void nsDateTimeControlFrame::Reflow(nsPresContext* aPresContext,
if (contentBoxBSize == NS_UNCONSTRAINEDSIZE) {
// We are intrinsically sized -- we should shrinkwrap the input area's
// block-size:
contentBoxBSize = childMarginBoxBSize;
// block-size, or our line-height:
contentBoxBSize =
std::max(aReflowInput.GetLineHeight(), childMarginBoxBSize);
// Make sure we obey min/max-bsize in the case when we're doing intrinsic
// sizing (we get it for free when we have a non-intrinsic

View File

@ -0,0 +1,9 @@
<!doctype html>
<style>
input {
box-sizing: border-box;
height: 34px;
}
</style>
<input type=date>
<input type=time>

View File

@ -0,0 +1,10 @@
<!doctype html>
<style>
input {
box-sizing: border-box;
height: 34px;
line-height: 80px;
}
</style>
<input type=date>
<input type=time>

View File

@ -0,0 +1,8 @@
<!doctype html>
<style>
input {
height: 80px;
}
</style>
<input type=date>
<input type=time>

View File

@ -0,0 +1,8 @@
<!doctype html>
<style>
input {
line-height: 80px;
}
</style>
<input type=date>
<input type=time>

View File

@ -20,3 +20,6 @@ skip-if(Android) fuzzy-if(!nativeThemePref,0-24,0-4) == time-reset-button-right-
== reset-button-visibility-hidden.html reset-button-visibility-hidden-ref.html
!= text-align.html text-align-notref.html
== line-height-01.html line-height-01-ref.html
== line-height-02.html line-height-02-ref.html

View File

@ -4,6 +4,7 @@
.datetimebox {
display: flex;
line-height: normal;
/* TODO: Enable selection once bug 1455893 is fixed */
user-select: none;
}