4 files changed +64
-0
lines changed Original file line number Diff line number Diff line change @@ -674,6 +674,26 @@ double nsRangeFrame::GetValue() const {
674
674
.toDouble ();
675
675
}
676
676
677
+ Maybe<nscoord> nsRangeFrame::GetNaturalBaselineBOffset (
678
+ WritingMode aWM, BaselineSharingGroup aBaselineGroup,
679
+ BaselineExportContext) const {
680
+ NS_ASSERTION (!IsSubtreeDirty(), "frame must not be dirty");
681
+
682
+ if (aBaselineGroup == BaselineSharingGroup::Last) {
683
+ return Nothing{};
684
+ }
685
+
686
+ if (StyleDisplay ()->IsBlockOutsideStyle ()) {
687
+ return Nothing{};
688
+ }
689
+
690
+ if (aWM.IsCentralBaseline ()) {
691
+ return Some (BSize (aWM) / 2 );
692
+ }
693
+
694
+ return Some (GetLogicalSize (aWM).BSize (aWM));
695
+ }
696
+
677
697
bool nsRangeFrame::ShouldUseNativeStyle () const {
678
698
nsIFrame* trackFrame = mTrackDiv ->GetPrimaryFrame ();
679
699
nsIFrame* progressFrame = mProgressDiv ->GetPrimaryFrame ();
Original file line number Diff line number Diff line change @@ -54,6 +54,10 @@ class nsRangeFrame final : public nsContainerFrame,
54
54
const ReflowInput& aReflowInput,
55
55
nsReflowStatus& aStatus) override ;
56
56
57
+ Maybe<nscoord> GetNaturalBaselineBOffset (
58
+ mozilla::WritingMode aWM, BaselineSharingGroup aBaselineGroup,
59
+ BaselineExportContext) const override ;
60
+
57
61
#ifdef DEBUG_FRAME_DUMP
58
62
nsresult GetFrameName (nsAString& aResult) const override {
59
63
return MakeFrameName (u" Range" _ns, aResult);
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < meta charset ="utf-8 ">
3
+ < title > Reference for Input type=range baseline alignment</ title >
4
+ < style >
5
+ .range-placeholder {
6
+ display : inline-block;
7
+ margin : 20px 20px 0 20px ;
8
+ padding : 10px ;
9
+ border : 20px solid transparent;
10
+ box-sizing : border-box;
11
+ width : 180px ;
12
+ height : 60px ;
13
+ }
14
+ </ style >
15
+ < div >
16
+ Baseline text
17
+ < span class ="range-placeholder "> </ span >
18
+ More baseline text
19
+ </ div >
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < meta charset ="utf-8 ">
3
+ < title > Input type=range baseline alignment</ title >
4
+ < link rel ="match " href ="range-baseline-ref.html ">
5
+ < link rel ="help " href ="https://html.spec.whatwg.org/multipage/input.html#range-state-(type=range) ">
6
+ < style >
7
+ .range-input {
8
+ box-sizing : border-box;
9
+ width : 180px ;
10
+ height : 60px ;
11
+ margin : 20px ;
12
+ padding : 10px ;
13
+ border : 20px solid transparent;
14
+ visibility : hidden;
15
+ }
16
+ </ style >
17
+ < div class ="text-wrapper ">
18
+ Baseline text
19
+ < input type ="range " class ="range-input ">
20
+ More baseline text
21
+ </ div >
0 commit comments