diff --git a/components/layout/stylesheets/servo.css b/components/layout/stylesheets/servo.css index 239de221d26..ec368cd773b 100644 --- a/components/layout/stylesheets/servo.css +++ b/components/layout/stylesheets/servo.css @@ -297,15 +297,54 @@ progress #-servo-progress-bar { background-color: #7a3; } +/* Mostly matches https://searchfox.org/mozilla-central/rev/a1f4cb9fc03d81be41ca2ba81294592df784364d/layout/style/res/forms.css#217-243 */ select { background-color: lightgrey; border-radius: 5px; border: 1px solid gray; padding: 0 0.25em; - /* Don't show a text cursor when hovering selected option */ - cursor: default; + cursor: default; /* Don't change cursor when hovering */ + margin: 0; + white-space: nowrap !important; + word-wrap: normal !important; + box-sizing: border-box; + user-select: none; + overflow: clip; + /* No text-decoration reaching inside, by default */ + display: inline-block; + page-break-inside: avoid; + overflow-clip-box: padding-box !important; + padding-block: 1px; + font-family: sans-serif; + + /* These styles are specific to single-select elements */ + padding-inline: 4px; + color: black; + vertical-align: baseline; + appearance: auto; +} + +/* Matches https://searchfox.org/mozilla-central/rev/a1f4cb9fc03d81be41ca2ba81294592df784364d/layout/style/res/forms.css#120-132 */ +input, +textarea, +select, +button { + text-align: initial; + text-indent: initial; + text-shadow: initial; + text-transform: initial; + word-spacing: initial; + letter-spacing: initial; + /* Note that line-height is also reset for all these, via the font shorthand */ +} + +input[type="reset" i], +input[type="button" i], +input[type="submit" i], +button { + text-align: center; } slot { display: contents; -} \ No newline at end of file +} diff --git a/tests/wpt/meta/MANIFEST.json b/tests/wpt/meta/MANIFEST.json index d9ea56030df..2f86d7918dc 100644 --- a/tests/wpt/meta/MANIFEST.json +++ b/tests/wpt/meta/MANIFEST.json @@ -357174,6 +357174,19 @@ ], {} ] + ], + "select-text-decoration.html": [ + "a697e0f7b0c3d3455b6595ee3064dbbe7baff22c", + [ + null, + [ + [ + "/html/rendering/replaced-elements/the-select-element/select-text-decoration-ref.html", + "==" + ] + ], + {} + ] ] }, "the-textarea-element": { @@ -486570,6 +486583,10 @@ "select-multiple-re-add-option-via-document-fragment-ref.html": [ "cb66ddaaaf369479e59f6092d04633a2dc2baf6c", [] + ], + "select-text-decoration-ref.html": [ + "41a039e988f17a0e8af5ad474f82828c4b8534ea", + [] ] }, "the-textarea-element": { diff --git a/tests/wpt/tests/html/rendering/replaced-elements/the-select-element/select-text-decoration-ref.html b/tests/wpt/tests/html/rendering/replaced-elements/the-select-element/select-text-decoration-ref.html new file mode 100644 index 00000000000..41a039e988f --- /dev/null +++ b/tests/wpt/tests/html/rendering/replaced-elements/the-select-element/select-text-decoration-ref.html @@ -0,0 +1,11 @@ + + +
+ + + + + + diff --git a/tests/wpt/tests/html/rendering/replaced-elements/the-select-element/select-text-decoration.html b/tests/wpt/tests/html/rendering/replaced-elements/the-select-element/select-text-decoration.html new file mode 100644 index 00000000000..a697e0f7b0c --- /dev/null +++ b/tests/wpt/tests/html/rendering/replaced-elements/the-select-element/select-text-decoration.html @@ -0,0 +1,22 @@ + + + + +