Bug 1663819 - Loosen the styling restrictions on meter and input[type=range] pseudo-elements. r=jwatt

These were there to prevent crashes because when the type of the frame
changes dynamically we would mess up and fail to find the right
insertion point.

We deal with this correctly nowadays:

  https://searchfox.org/mozilla-central/rev/b2716c233e9b4398fc5923cbe150e7f83c7c6c5b/layout/base/nsCSSFrameConstructor.cpp#8521-8536

And the list was never exhaustive in the first place (e.g., writing-mode
can also cause us to reframe, and so do a bunch of other properties). So
there's no real reason to be so strict anymore.

Also change ::-moz-complex-control-wrapper while at it too, because it's
not web exposed so there's no need for those declarations in the first
place.

Differential Revision: https://phabricator.services.mozilla.com/D89586
This commit is contained in:
Emilio Cobos Álvarez 2020-09-09 14:24:17 +00:00
parent dc1acec1a6
commit e146795f9e

View File

@ -767,11 +767,8 @@ progress {
}
::-moz-progress-bar {
/* Prevent styling that would change the type of frame we construct. */
display: inline-block !important;
float: none !important;
position: static !important;
overflow: visible !important;
display: inline-block;
box-sizing: border-box !important;
appearance: auto;
@ -793,11 +790,7 @@ meter {
}
::-moz-meter-bar {
/* Block styles that would change the type of frame we construct. */
display: inline-block !important;
float: none !important;
position: static !important;
overflow: visible !important;
display: inline-block;
appearance: auto;
-moz-default-appearance: meterchunk;
@ -840,12 +833,7 @@ input[type=range] {
* set the width/height of this pseudo-element.
*/
input[type=range]::-moz-range-track {
/* Prevent styling that would change the type of frame we construct. */
display: block !important;
float: none !important;
position: static !important;
writing-mode: unset !important;
direction: unset !important;
display: block;
block-size: 0.2em; /* same as inline-size below */
/* Prevent nsIFrame::HandlePress setting mouse capture to this element. */
user-select: none !important;
@ -865,12 +853,7 @@ input[type=range][orient=vertical]::-moz-range-track {
* is ignored.
*/
input[type=range]::-moz-range-progress {
/* Prevent styling that would change the type of frame we construct. */
display: block !important;
float: none !important;
position: static !important;
writing-mode: unset !important;
direction: unset !important;
display: block;
/* Since one of width/height will be ignored, this just sets the "other"
dimension.
*/
@ -892,12 +875,7 @@ input[type=range]::-moz-range-thumb {
*/
appearance: auto !important;
-moz-default-appearance: range-thumb !important;
/* Prevent styling that would change the type of frame we construct. */
display: block !important;
float: none !important;
position: static !important;
writing-mode: unset !important;
direction: unset !important;
display: block;
width: 1em;
height: 1em;
@ -914,10 +892,7 @@ input[type="number"] {
}
input:is([type=number], [type=search])::-moz-complex-control-wrapper {
/* Prevent styling that would change the type of frame we construct. */
display: flex;
float: none !important;
position: static !important;
block-size: 100%;
/* The align-self: center bit below allows the editor to be potentially
* bigger than us. Clip it to match other text fields. */