forked from mirrors/gecko-dev
Bug 1887539 - Fix nsRangeFrame::UpdateForValueChange after bug 1740580. r=dholbert
In bug 1740580 I updated these functions to take the content size, but forgot to update two existing callers. Differential Revision: https://phabricator.services.mozilla.com/D205549
This commit is contained in:
parent
3ad4e2a42e
commit
ff6647e085
4 changed files with 71 additions and 3 deletions
|
|
@ -330,7 +330,7 @@ Decimal nsRangeFrame::GetValueAtEventPoint(WidgetGUIEvent* aEvent) {
|
||||||
->GetValueAsDecimal();
|
->GetValueAsDecimal();
|
||||||
}
|
}
|
||||||
|
|
||||||
nsRect rangeContentRect = GetContentRectRelativeToSelf();
|
const nsRect rangeContentRect = GetContentRectRelativeToSelf();
|
||||||
nsSize thumbSize;
|
nsSize thumbSize;
|
||||||
|
|
||||||
if (IsThemed()) {
|
if (IsThemed()) {
|
||||||
|
|
@ -397,11 +397,12 @@ void nsRangeFrame::UpdateForValueChange() {
|
||||||
if (!rangeProgressFrame && !thumbFrame) {
|
if (!rangeProgressFrame && !thumbFrame) {
|
||||||
return; // diplay:none?
|
return; // diplay:none?
|
||||||
}
|
}
|
||||||
|
const nsSize contentBoxSize = GetContentRect().Size();
|
||||||
if (rangeProgressFrame) {
|
if (rangeProgressFrame) {
|
||||||
DoUpdateRangeProgressFrame(rangeProgressFrame, GetSize());
|
DoUpdateRangeProgressFrame(rangeProgressFrame, contentBoxSize);
|
||||||
}
|
}
|
||||||
if (thumbFrame) {
|
if (thumbFrame) {
|
||||||
DoUpdateThumbPosition(thumbFrame, GetSize());
|
DoUpdateThumbPosition(thumbFrame, contentBoxSize);
|
||||||
}
|
}
|
||||||
if (IsThemed()) {
|
if (IsThemed()) {
|
||||||
// We don't know the exact dimensions or location of the thumb when native
|
// We don't know the exact dimensions or location of the thumb when native
|
||||||
|
|
|
||||||
30
layout/reftests/forms/input/range/1887539-ref.html
Normal file
30
layout/reftests/forms/input/range/1887539-ref.html
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
<!doctype html>
|
||||||
|
<style>
|
||||||
|
#scrubber {
|
||||||
|
height: 100px;
|
||||||
|
width: 100%;
|
||||||
|
appearance: none;
|
||||||
|
background-color: black;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 6px 2px;
|
||||||
|
margin: 0;
|
||||||
|
|
||||||
|
&::-moz-range-thumb {
|
||||||
|
border-radius: 14px;
|
||||||
|
background-color: #BFBFC9;
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
border: 3px solid white;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::-moz-range-track {
|
||||||
|
background-color: #969696;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::-moz-range-progress {
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<input type="range" id="scrubber" value="0.5" min="0" max="1" step=".001">
|
||||||
35
layout/reftests/forms/input/range/1887539.html
Normal file
35
layout/reftests/forms/input/range/1887539.html
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
<!doctype html>
|
||||||
|
<style>
|
||||||
|
#scrubber {
|
||||||
|
height: 100px;
|
||||||
|
width: 100%;
|
||||||
|
appearance: none;
|
||||||
|
background-color: black;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 6px 2px;
|
||||||
|
margin: 0;
|
||||||
|
|
||||||
|
&::-moz-range-thumb {
|
||||||
|
border-radius: 14px;
|
||||||
|
background-color: #BFBFC9;
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
border: 3px solid white;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::-moz-range-track {
|
||||||
|
background-color: #969696;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::-moz-range-progress {
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<input type="range" id="scrubber" value="0" min="0" max="1" step=".001">
|
||||||
|
<script>
|
||||||
|
let scrubber = document.getElementById('scrubber');
|
||||||
|
scrubber.getBoundingClientRect();
|
||||||
|
scrubber.value = 0.5;
|
||||||
|
</script>
|
||||||
|
|
@ -59,3 +59,5 @@ skip-if(Android) == range-border-background.html range-border-background-ref.htm
|
||||||
fails-if(Android) fuzzy(0-2,0-80) == auto-size.html auto-size-ref.html # Snapping, bug 1621141
|
fails-if(Android) fuzzy(0-2,0-80) == auto-size.html auto-size-ref.html # Snapping, bug 1621141
|
||||||
== range-track-bg.html range-track-bg-ref.html
|
== range-track-bg.html range-track-bg-ref.html
|
||||||
!= track-default-rendering.html track-default-rendering-ref.html
|
!= track-default-rendering.html track-default-rendering-ref.html
|
||||||
|
|
||||||
|
== 1887539.html 1887539-ref.html
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue