layout/style/forms.css

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 /**
michael@0 6 Styles for old GFX form widgets
michael@0 7 **/
michael@0 8
michael@0 9
michael@0 10 @namespace url(http://www.w3.org/1999/xhtml); /* set default namespace to HTML */
michael@0 11 @namespace xul url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
michael@0 12
michael@0 13 *|*::-moz-fieldset-content {
michael@0 14 display: block;
michael@0 15 unicode-bidi: inherit;
michael@0 16 text-overflow: inherit;
michael@0 17 overflow: inherit;
michael@0 18 padding: inherit;
michael@0 19 height: 100%; /* Need this so percentage heights of kids work right */
michael@0 20 }
michael@0 21
michael@0 22 /* miscellaneous form elements */
michael@0 23
michael@0 24 fieldset > legend {
michael@0 25 padding-left: 2px;
michael@0 26 padding-right: 2px;
michael@0 27 width: -moz-fit-content;
michael@0 28 }
michael@0 29
michael@0 30 legend {
michael@0 31 display: block;
michael@0 32 }
michael@0 33
michael@0 34 fieldset {
michael@0 35 display: block;
michael@0 36 margin-left: 2px;
michael@0 37 margin-right: 2px;
michael@0 38 padding: 0.35em 0.625em 0.75em;
michael@0 39 border: 2px groove ThreeDFace;
michael@0 40 }
michael@0 41
michael@0 42 label {
michael@0 43 cursor: default;
michael@0 44 }
michael@0 45
michael@0 46 /* default inputs, text inputs, and selects */
michael@0 47
michael@0 48 /* Note: Values in nsNativeTheme IsWidgetStyled function
michael@0 49 need to match textfield background/border values here */
michael@0 50
michael@0 51 input {
michael@0 52 -moz-appearance: textfield;
michael@0 53 /* The sum of border-top, border-bottom, padding-top, padding-bottom
michael@0 54 must be the same here, for buttons, and for <select> (including its
michael@0 55 internal padding magic) */
michael@0 56 padding: 1px;
michael@0 57 border: 2px inset ThreeDFace;
michael@0 58 background-color: -moz-Field;
michael@0 59 color: -moz-FieldText;
michael@0 60 font: -moz-field;
michael@0 61 text-rendering: optimizeLegibility;
michael@0 62 line-height: normal;
michael@0 63 text-align: start;
michael@0 64 text-transform: none;
michael@0 65 word-spacing: normal;
michael@0 66 letter-spacing: normal;
michael@0 67 cursor: text;
michael@0 68 -moz-binding: url("chrome://global/content/platformHTMLBindings.xml#inputFields");
michael@0 69 text-indent: 0;
michael@0 70 -moz-user-select: text;
michael@0 71 text-shadow: none;
michael@0 72 overflow-clip-box: content-box;
michael@0 73 }
michael@0 74
michael@0 75 input > .anonymous-div,
michael@0 76 input::-moz-placeholder {
michael@0 77 word-wrap: normal !important;
michael@0 78 /* Make the line-height equal to the available height */
michael@0 79 line-height: -moz-block-height;
michael@0 80 }
michael@0 81
michael@0 82 @-moz-document url-prefix(chrome://) {
michael@0 83 input.uri-element-right-align:-moz-locale-dir(rtl) {
michael@0 84 direction: ltr !important;
michael@0 85 text-align: right !important;
michael@0 86 }
michael@0 87
michael@0 88 /* Make sure that the location bar's alignment in RTL mode changes according
michael@0 89 to the input box direction if the user switches the text direction using
michael@0 90 cmd_switchTextDirection (which applies a dir attribute to the <input>). */
michael@0 91 input.uri-element-right-align[dir=ltr]:-moz-locale-dir(rtl) {
michael@0 92 text-align: left !important;
michael@0 93 }
michael@0 94 }
michael@0 95
michael@0 96 textarea {
michael@0 97 margin: 1px 0 1px 0;
michael@0 98 border: 2px inset ThreeDFace;
michael@0 99 /* The 1px horizontal padding is for parity with Win/IE */
michael@0 100 padding: 0px 1px;
michael@0 101 background-color: -moz-Field;
michael@0 102 color: -moz-FieldText;
michael@0 103 font: medium -moz-fixed;
michael@0 104 text-rendering: optimizeLegibility;
michael@0 105 text-align: start;
michael@0 106 text-transform: none;
michael@0 107 word-spacing: normal;
michael@0 108 letter-spacing: normal;
michael@0 109 vertical-align: text-bottom;
michael@0 110 cursor: text;
michael@0 111 resize: both;
michael@0 112 -moz-binding: url("chrome://global/content/platformHTMLBindings.xml#textAreas");
michael@0 113 -moz-appearance: textfield-multiline;
michael@0 114 text-indent: 0;
michael@0 115 -moz-user-select: text;
michael@0 116 text-shadow: none;
michael@0 117 word-wrap: break-word;
michael@0 118 overflow-clip-box: content-box;
michael@0 119 }
michael@0 120
michael@0 121 textarea > scrollbar {
michael@0 122 cursor: default;
michael@0 123 }
michael@0 124
michael@0 125 textarea > .anonymous-div,
michael@0 126 input > .anonymous-div,
michael@0 127 input::-moz-placeholder,
michael@0 128 textarea::-moz-placeholder {
michael@0 129 white-space: pre;
michael@0 130 overflow: auto;
michael@0 131 border: 0px !important;
michael@0 132 padding: inherit !important;
michael@0 133 margin: 0px;
michael@0 134 text-decoration: inherit;
michael@0 135 -moz-text-decoration-color: inherit;
michael@0 136 -moz-text-decoration-style: inherit;
michael@0 137 display: inline-block;
michael@0 138 ime-mode: inherit;
michael@0 139 resize: inherit;
michael@0 140 -moz-control-character-visibility: visible;
michael@0 141 overflow-clip-box: inherit;
michael@0 142 }
michael@0 143
michael@0 144 textarea > .anonymous-div.wrap,
michael@0 145 input > .anonymous-div.wrap {
michael@0 146 white-space: pre-wrap;
michael@0 147 }
michael@0 148 textarea > .anonymous-div.inherit-overflow,
michael@0 149 input > .anonymous-div.inherit-overflow {
michael@0 150 overflow: inherit;
michael@0 151 }
michael@0 152
michael@0 153 input::-moz-placeholder,
michael@0 154 textarea::-moz-placeholder {
michael@0 155 /*
michael@0 156 * Changing display to inline can leads to broken behaviour and will assert.
michael@0 157 */
michael@0 158 display: inline-block !important;
michael@0 159
michael@0 160 /*
michael@0 161 * Changing resize would display a broken behaviour and will assert.
michael@0 162 */
michael@0 163 resize: none !important;
michael@0 164
michael@0 165 overflow: hidden !important;
michael@0 166
michael@0 167 /*
michael@0 168 * The placeholder should be ignored by pointer otherwise, we might have some
michael@0 169 * unexpected behavior like the resize handle not being selectable.
michael@0 170 */
michael@0 171 pointer-events: none !important;
michael@0 172
michael@0 173 opacity: 0.54;
michael@0 174 }
michael@0 175
michael@0 176 textarea::-moz-placeholder {
michael@0 177 white-space: pre-wrap !important;
michael@0 178 }
michael@0 179
michael@0 180 input:-moz-read-write,
michael@0 181 textarea:-moz-read-write {
michael@0 182 -moz-user-modify: read-write !important;
michael@0 183 }
michael@0 184
michael@0 185 select {
michael@0 186 margin: 0;
michael@0 187 border-color: ThreeDFace;
michael@0 188 background-color: -moz-Combobox;
michael@0 189 color: -moz-ComboboxText;
michael@0 190 font: -moz-list;
michael@0 191 /*
michael@0 192 * Note that the "UA !important" tests in
michael@0 193 * layout/style/test/test_animations.html depend on this rule, because
michael@0 194 * they need some UA !important rule to test. If this changes, use a
michael@0 195 * different one there.
michael@0 196 */
michael@0 197 line-height: normal !important;
michael@0 198 white-space: nowrap !important;
michael@0 199 word-wrap: normal !important;
michael@0 200 text-align: start;
michael@0 201 cursor: default;
michael@0 202 box-sizing: border-box;
michael@0 203 -moz-user-select: none;
michael@0 204 -moz-appearance: menulist;
michael@0 205 border-width: 2px;
michael@0 206 border-style: inset;
michael@0 207 text-indent: 0;
michael@0 208 overflow: -moz-hidden-unscrollable;
michael@0 209 text-shadow: none;
michael@0 210 /* No text-decoration reaching inside, by default */
michael@0 211 display: inline-block;
michael@0 212 page-break-inside: avoid;
michael@0 213 overflow-clip-box: padding-box !important; /* bug 992447 */
michael@0 214 }
michael@0 215
michael@0 216 /* Need the "select[size][multiple]" selector to override the settings on
michael@0 217 'select[size="1"]', eg if one has <select size="1" multiple> */
michael@0 218
michael@0 219 select[size],
michael@0 220 select[multiple],
michael@0 221 select[size][multiple] {
michael@0 222 /* Different alignment and padding for listbox vs combobox */
michael@0 223 background-color: -moz-Field;
michael@0 224 color: -moz-FieldText;
michael@0 225 vertical-align: text-bottom;
michael@0 226 padding: 1px 0 1px 0;
michael@0 227 -moz-appearance: listbox;
michael@0 228 }
michael@0 229
michael@0 230 select[size="0"],
michael@0 231 select[size="1"] {
michael@0 232 /* Except this is not a listbox */
michael@0 233 background-color: -moz-Combobox;
michael@0 234 color: -moz-ComboboxText;
michael@0 235 vertical-align: baseline;
michael@0 236 padding: 0;
michael@0 237 -moz-appearance: menulist;
michael@0 238 }
michael@0 239
michael@0 240 select > button {
michael@0 241 width: 12px;
michael@0 242 height: 12px;
michael@0 243 white-space: nowrap;
michael@0 244 position: static !important;
michael@0 245 background-image: url("arrow.gif") !important;
michael@0 246 background-repeat: no-repeat !important;
michael@0 247 background-position: center !important;
michael@0 248 -moz-appearance: menulist-button;
michael@0 249
michael@0 250 /* Make sure to size correctly if the combobox has a non-auto height. */
michael@0 251 height: 100% ! important;
michael@0 252 box-sizing: border-box ! important;
michael@0 253
michael@0 254 /*
michael@0 255 Make sure to align properly with the display frame. Note that we
michael@0 256 want the baseline of the combobox to match the baseline of the
michael@0 257 display frame, so the dropmarker is what gets the vertical-align.
michael@0 258 */
michael@0 259 vertical-align: top !important;
michael@0 260 }
michael@0 261
michael@0 262 select > button:active {
michael@0 263 background-image: url("arrowd.gif") !important;
michael@0 264 }
michael@0 265
michael@0 266 select:empty {
michael@0 267 width: 2.5em;
michael@0 268 }
michael@0 269
michael@0 270 *|*::-moz-display-comboboxcontrol-frame {
michael@0 271 overflow: -moz-hidden-unscrollable;
michael@0 272 /* This top/bottom padding plus the combobox top/bottom border need to
michael@0 273 add up to the top/bottom borderpadding of text inputs and buttons */
michael@0 274 padding-top: 1px;
michael@0 275 padding-bottom: 1px;
michael@0 276 -moz-padding-start: 4px;
michael@0 277 -moz-padding-end: 0;
michael@0 278 color: inherit;
michael@0 279 white-space: nowrap;
michael@0 280 text-align: inherit;
michael@0 281 -moz-user-select: none;
michael@0 282 /* Make sure to size correctly if the combobox has a non-auto height. */
michael@0 283 height: 100% ! important;
michael@0 284 box-sizing: border-box ! important;
michael@0 285 line-height: -moz-block-height;
michael@0 286 }
michael@0 287
michael@0 288 option {
michael@0 289 display: block;
michael@0 290 float: none !important;
michael@0 291 position: static !important;
michael@0 292 min-height: 1em;
michael@0 293 line-height: normal !important;
michael@0 294 -moz-user-select: none;
michael@0 295 text-indent: 0;
michael@0 296 white-space: nowrap !important;
michael@0 297 word-wrap: normal !important;
michael@0 298 }
michael@0 299
michael@0 300 select > option {
michael@0 301 padding-top : 0;
michael@0 302 padding-bottom: 0;
michael@0 303 -moz-padding-start: 3px;
michael@0 304 -moz-padding-end: 5px;
michael@0 305 }
michael@0 306
michael@0 307 option:checked {
michael@0 308 background-color: -moz-html-cellhighlight !important;
michael@0 309 color: -moz-html-cellhighlighttext !important;
michael@0 310 }
michael@0 311
michael@0 312 select:focus > option:checked,
michael@0 313 select:focus > optgroup > option:checked {
michael@0 314 background-color: Highlight ! important;
michael@0 315 color: HighlightText ! important;
michael@0 316 }
michael@0 317
michael@0 318 optgroup {
michael@0 319 display: block;
michael@0 320 float: none !important;
michael@0 321 position: static !important;
michael@0 322 font: -moz-list;
michael@0 323 line-height: normal !important;
michael@0 324 font-style: italic;
michael@0 325 font-weight: bold;
michael@0 326 font-size: inherit;
michael@0 327 -moz-user-select: none;
michael@0 328 text-indent: 0;
michael@0 329 white-space: nowrap !important;
michael@0 330 word-wrap: normal !important;
michael@0 331 }
michael@0 332
michael@0 333 optgroup > option {
michael@0 334 -moz-padding-start: 20px;
michael@0 335 font-style: normal;
michael@0 336 font-weight: normal;
michael@0 337 }
michael@0 338
michael@0 339 optgroup:before {
michael@0 340 display: block;
michael@0 341 content: attr(label);
michael@0 342 }
michael@0 343
michael@0 344 *|*::-moz-dropdown-list {
michael@0 345 z-index: 2147483647;
michael@0 346 background-color: inherit;
michael@0 347 -moz-user-select: none;
michael@0 348 position: static !important;
michael@0 349 float: none !important;
michael@0 350
michael@0 351 /*
michael@0 352 * We can't change the padding here, because that would affect our
michael@0 353 * intrinsic width, since we scroll. But at the same time, we want
michael@0 354 * to make sure that our left border+padding matches the left
michael@0 355 * border+padding of a combobox so that our scrollbar will line up
michael@0 356 * with the dropmarker. So set our left border to 2px.
michael@0 357 */
michael@0 358 border: 1px outset black !important;
michael@0 359 border-left-width: 2px ! important;
michael@0 360 }
michael@0 361
michael@0 362 input:disabled,
michael@0 363 textarea:disabled,
michael@0 364 option:disabled,
michael@0 365 optgroup:disabled,
michael@0 366 select:disabled:disabled /* Need the pseudo-class twice to have the specificity
michael@0 367 be at least the same as select[size][multiple] above */
michael@0 368 {
michael@0 369 -moz-user-input: disabled;
michael@0 370 color: GrayText;
michael@0 371 background-color: ThreeDFace;
michael@0 372 cursor: inherit;
michael@0 373 }
michael@0 374
michael@0 375 input:disabled,
michael@0 376 textarea:disabled {
michael@0 377 cursor: default;
michael@0 378 }
michael@0 379
michael@0 380 option:disabled,
michael@0 381 optgroup:disabled {
michael@0 382 background-color: transparent;
michael@0 383 }
michael@0 384
michael@0 385 /* hidden inputs */
michael@0 386 input[type="hidden"] {
michael@0 387 -moz-appearance: none;
michael@0 388 display: none !important;
michael@0 389 padding: 0;
michael@0 390 border: 0;
michael@0 391 cursor: auto;
michael@0 392 -moz-user-focus: ignore;
michael@0 393 -moz-binding: none;
michael@0 394 }
michael@0 395
michael@0 396 /* image buttons */
michael@0 397 input[type="image"] {
michael@0 398 -moz-appearance: none;
michael@0 399 padding: 0;
michael@0 400 border: none;
michael@0 401 background-color: transparent;
michael@0 402 font-family: sans-serif;
michael@0 403 font-size: small;
michael@0 404 cursor: pointer;
michael@0 405 -moz-binding: none;
michael@0 406 }
michael@0 407
michael@0 408 input[type="image"]:disabled {
michael@0 409 cursor: inherit;
michael@0 410 }
michael@0 411
michael@0 412 input[type="image"]:-moz-focusring {
michael@0 413 /* Don't specify the outline-color, we should always use initial value. */
michael@0 414 outline: 1px dotted;
michael@0 415 }
michael@0 416
michael@0 417 /* file selector */
michael@0 418 input[type="file"] {
michael@0 419 display: inline-block;
michael@0 420 white-space: nowrap;
michael@0 421 overflow: hidden;
michael@0 422 overflow-clip-box: padding-box;
michael@0 423 color: inherit;
michael@0 424
michael@0 425 /* Revert rules which apply on all inputs. */
michael@0 426 -moz-appearance: none;
michael@0 427 -moz-binding: none;
michael@0 428 cursor: default;
michael@0 429
michael@0 430 border: none;
michael@0 431 background-color: transparent;
michael@0 432 padding: 0;
michael@0 433 }
michael@0 434
michael@0 435 input[type="file"] > xul|label {
michael@0 436 min-width: 12em;
michael@0 437 -moz-padding-start: 5px;
michael@0 438
michael@0 439 color: inherit;
michael@0 440 font-size: inherit;
michael@0 441 letter-spacing: inherit;
michael@0 442
michael@0 443 /*
michael@0 444 * Force the text to have LTR directionality. Otherwise filenames containing
michael@0 445 * RTL characters will be reordered with chaotic results.
michael@0 446 */
michael@0 447 direction: ltr !important;
michael@0 448 }
michael@0 449
michael@0 450 /* button part of file selector */
michael@0 451 input[type="file"] > button[type="button"] {
michael@0 452 height: inherit;
michael@0 453 font-size: inherit;
michael@0 454 letter-spacing: inherit;
michael@0 455 cursor: inherit;
michael@0 456 }
michael@0 457
michael@0 458 /* colored part of the color selector button */
michael@0 459 input[type="color"]:-moz-system-metric(color-picker-available)::-moz-color-swatch {
michael@0 460 width: 100%;
michael@0 461 height: 100%;
michael@0 462 min-width: 3px;
michael@0 463 min-height: 3px;
michael@0 464 margin-left: auto;
michael@0 465 margin-right: auto;
michael@0 466 box-sizing: border-box;
michael@0 467 border: 1px solid grey;
michael@0 468 display: block;
michael@0 469 }
michael@0 470
michael@0 471 /* Try to make RTL <input type='file'> look nicer. */
michael@0 472 /* TODO: use text-align: match-parent when bug 645642 is fixed. */
michael@0 473 input[type="file"]:-moz-dir(rtl) > xul|label {
michael@0 474 -moz-padding-start: 0px;
michael@0 475 padding-right: 5px;
michael@0 476 text-align: right;
michael@0 477 }
michael@0 478
michael@0 479 /* radio buttons */
michael@0 480 input[type="radio"] {
michael@0 481 -moz-appearance: radio;
michael@0 482 margin: 3px 3px 0px 5px;
michael@0 483 border-radius: 100% !important;
michael@0 484 }
michael@0 485
michael@0 486 /* check boxes */
michael@0 487 input[type="checkbox"] {
michael@0 488 -moz-appearance: checkbox;
michael@0 489 margin: 3px 3px 3px 4px;
michael@0 490 border-radius: 0 !important;
michael@0 491 }
michael@0 492
michael@0 493 /* common features of radio buttons and check boxes */
michael@0 494
michael@0 495 /* NOTE: The width, height, border-width, and padding here must all
michael@0 496 add up the way nsFormControlFrame::GetIntrinsic(Width|Height)
michael@0 497 expects them to, or they will not come out with total width equal
michael@0 498 to total height on sites that set their 'width' or 'height' to 'auto'.
michael@0 499 (Should we maybe set !important on width and height, then?) */
michael@0 500 input[type="radio"],
michael@0 501 input[type="checkbox"] {
michael@0 502 box-sizing: border-box;
michael@0 503 width: 13px;
michael@0 504 height: 13px;
michael@0 505 cursor: default;
michael@0 506 padding: 0 !important;
michael@0 507 -moz-binding: none;
michael@0 508 /* same colors as |input| rule, but |!important| this time. */
michael@0 509 background-color: -moz-Field ! important;
michael@0 510 color: -moz-FieldText ! important;
michael@0 511 border: 2px inset ThreeDFace ! important;
michael@0 512 }
michael@0 513
michael@0 514 input[type="radio"]:disabled,
michael@0 515 input[type="radio"]:disabled:active,
michael@0 516 input[type="radio"]:disabled:hover,
michael@0 517 input[type="radio"]:disabled:hover:active,
michael@0 518 input[type="checkbox"]:disabled,
michael@0 519 input[type="checkbox"]:disabled:active,
michael@0 520 input[type="checkbox"]:disabled:hover,
michael@0 521 input[type="checkbox"]:disabled:hover:active {
michael@0 522 padding: 1px;
michael@0 523 border: 1px inset ThreeDShadow ! important;
michael@0 524 /* same as above, but !important */
michael@0 525 color: GrayText ! important;
michael@0 526 background-color: ThreeDFace ! important;
michael@0 527 cursor: inherit;
michael@0 528 }
michael@0 529
michael@0 530 input[type="checkbox"]:-moz-focusring,
michael@0 531 input[type="radio"]:-moz-focusring {
michael@0 532 border-style: groove !important;
michael@0 533 }
michael@0 534
michael@0 535 input[type="checkbox"]:hover:active,
michael@0 536 input[type="radio"]:hover:active {
michael@0 537 background-color: ThreeDFace ! important;
michael@0 538 border-style: inset !important;
michael@0 539 }
michael@0 540
michael@0 541 /* buttons */
michael@0 542
michael@0 543 /* Note: Values in nsNativeTheme IsWidgetStyled function
michael@0 544 need to match button background/border values here */
michael@0 545
michael@0 546 /* Non text-related properties for buttons: these ones are shared with
michael@0 547 input[type="color"] */
michael@0 548 button,
michael@0 549 input[type="color"]:-moz-system-metric(color-picker-available),
michael@0 550 input[type="reset"],
michael@0 551 input[type="button"],
michael@0 552 input[type="submit"] {
michael@0 553 -moz-appearance: button;
michael@0 554 /* The sum of border-top, border-bottom, padding-top, padding-bottom
michael@0 555 must be the same here, for text inputs, and for <select>. For
michael@0 556 buttons, make sure to include the -moz-focus-inner border/padding. */
michael@0 557 padding: 0px 6px 0px 6px;
michael@0 558 border: 2px outset ButtonFace;
michael@0 559 background-color: ButtonFace;
michael@0 560 cursor: default;
michael@0 561 box-sizing: border-box;
michael@0 562 -moz-user-select: none;
michael@0 563 -moz-binding: none;
michael@0 564 }
michael@0 565
michael@0 566 /* Text-related properties for buttons: these ones are not shared with
michael@0 567 input[type="color"] */
michael@0 568 button,
michael@0 569 input[type="reset"],
michael@0 570 input[type="button"],
michael@0 571 input[type="submit"] {
michael@0 572 color: ButtonText;
michael@0 573 font: -moz-button;
michael@0 574 line-height: normal;
michael@0 575 white-space: pre;
michael@0 576 text-align: center;
michael@0 577 text-shadow: none;
michael@0 578 overflow-clip-box: padding-box;
michael@0 579 }
michael@0 580
michael@0 581 input[type="color"]:-moz-system-metric(color-picker-available) {
michael@0 582 width: 64px;
michael@0 583 height: 23px;
michael@0 584 }
michael@0 585
michael@0 586 button {
michael@0 587 /* Buttons should lay out like "normal" html, mostly */
michael@0 588 white-space: inherit;
michael@0 589 text-indent: 0;
michael@0 590 /* But no text-decoration reaching inside, by default */
michael@0 591 display: inline-block;
michael@0 592 }
michael@0 593
michael@0 594 *|*::-moz-button-content {
michael@0 595 display: block;
michael@0 596 }
michael@0 597
michael@0 598 button:hover,
michael@0 599 input[type="color"]:-moz-system-metric(color-picker-available):hover,
michael@0 600 input[type="reset"]:hover,
michael@0 601 input[type="button"]:hover,
michael@0 602 input[type="submit"]:hover {
michael@0 603 background-color: -moz-buttonhoverface;
michael@0 604 }
michael@0 605
michael@0 606 button:hover,
michael@0 607 input[type="reset"]:hover,
michael@0 608 input[type="button"]:hover,
michael@0 609 input[type="submit"]:hover {
michael@0 610 color: -moz-buttonhovertext;
michael@0 611 }
michael@0 612
michael@0 613 button:active:hover,
michael@0 614 input[type="color"]:-moz-system-metric(color-picker-available):active:hover,
michael@0 615 input[type="reset"]:active:hover,
michael@0 616 input[type="button"]:active:hover,
michael@0 617 input[type="submit"]:active:hover {
michael@0 618 padding: 0px 5px 0px 7px;
michael@0 619 border-style: inset;
michael@0 620 background-color: ButtonFace;
michael@0 621 }
michael@0 622
michael@0 623 button:active:hover,
michael@0 624 input[type="reset"]:active:hover,
michael@0 625 input[type="button"]:active:hover,
michael@0 626 input[type="submit"]:active:hover {
michael@0 627 color: ButtonText;
michael@0 628 }
michael@0 629
michael@0 630 button::-moz-focus-inner,
michael@0 631 input[type="color"]:-moz-system-metric(color-picker-available)::-moz-focus-inner,
michael@0 632 input[type="reset"]::-moz-focus-inner,
michael@0 633 input[type="button"]::-moz-focus-inner,
michael@0 634 input[type="submit"]::-moz-focus-inner,
michael@0 635 input[type="file"] > button[type="button"]::-moz-focus-inner {
michael@0 636 padding: 0px 2px 0px 2px;
michael@0 637 border: 1px dotted transparent;
michael@0 638 }
michael@0 639
michael@0 640 button:-moz-focusring::-moz-focus-inner,
michael@0 641 input[type="color"]:-moz-system-metric(color-picker-available):-moz-focusring::-moz-focus-inner,
michael@0 642 input[type="reset"]:-moz-focusring::-moz-focus-inner,
michael@0 643 input[type="button"]:-moz-focusring::-moz-focus-inner,
michael@0 644 input[type="submit"]:-moz-focusring::-moz-focus-inner,
michael@0 645 input[type="file"] > button[type="button"]:-moz-focusring::-moz-focus-inner {
michael@0 646 border-color: ButtonText;
michael@0 647 }
michael@0 648
michael@0 649 button:disabled:active, button:disabled,
michael@0 650 input[type="color"]:-moz-system-metric(color-picker-available):disabled:active,
michael@0 651 input[type="color"]:-moz-system-metric(color-picker-available):disabled,
michael@0 652 input[type="reset"]:disabled:active,
michael@0 653 input[type="reset"]:disabled,
michael@0 654 input[type="button"]:disabled:active,
michael@0 655 input[type="button"]:disabled,
michael@0 656 select:disabled > button,
michael@0 657 select:disabled > button,
michael@0 658 input[type="submit"]:disabled:active,
michael@0 659 input[type="submit"]:disabled {
michael@0 660 /* The sum of border-top, border-bottom, padding-top, padding-bottom
michael@0 661 must be the same here and for text inputs */
michael@0 662 padding: 0px 6px 0px 6px;
michael@0 663 border: 2px outset ButtonFace;
michael@0 664 cursor: inherit;
michael@0 665 }
michael@0 666
michael@0 667 button:disabled:active, button:disabled,
michael@0 668 input[type="reset"]:disabled:active,
michael@0 669 input[type="reset"]:disabled,
michael@0 670 input[type="button"]:disabled:active,
michael@0 671 input[type="button"]:disabled,
michael@0 672 select:disabled > button,
michael@0 673 select:disabled > button,
michael@0 674 input[type="submit"]:disabled:active,
michael@0 675 input[type="submit"]:disabled {
michael@0 676 color: GrayText;
michael@0 677 }
michael@0 678
michael@0 679 /*
michael@0 680 * Make form controls inherit 'unicode-bidi' transparently as required by
michael@0 681 * their various anonymous descendants and pseudo-elements:
michael@0 682 *
michael@0 683 * <textarea> and <input type="text">:
michael@0 684 * inherit into the XULScroll frame with class 'anonymous-div' which is a
michael@0 685 * child of the text control.
michael@0 686 *
michael@0 687 * Buttons (either <button>, <input type="submit">, <input type="button">
michael@0 688 * or <input type="reset">)
michael@0 689 * inherit into the ':-moz-button-content' pseudo-element.
michael@0 690 *
michael@0 691 * <select>:
michael@0 692 * inherit into the ':-moz-display-comboboxcontrol-frame' pseudo-element and
michael@0 693 * the <optgroup>'s ':before' pseudo-element, which is where the label of
michael@0 694 * the <optgroup> gets displayed. The <option>s don't use anonymous boxes,
michael@0 695 * so they need no special rules.
michael@0 696 */
michael@0 697 textarea > .anonymous-div,
michael@0 698 input > .anonymous-div,
michael@0 699 input::-moz-placeholder,
michael@0 700 textarea::-moz-placeholder,
michael@0 701 *|*::-moz-button-content,
michael@0 702 *|*::-moz-display-comboboxcontrol-frame,
michael@0 703 optgroup:before {
michael@0 704 unicode-bidi: inherit;
michael@0 705 text-overflow: inherit;
michael@0 706 }
michael@0 707
michael@0 708 /**
michael@0 709 * Set default style for invalid elements.
michael@0 710 */
michael@0 711 :not(output):-moz-ui-invalid {
michael@0 712 box-shadow: 0 0 1.5px 1px red;
michael@0 713 }
michael@0 714
michael@0 715 :not(output):-moz-ui-invalid:-moz-focusring {
michael@0 716 box-shadow: 0 0 2px 2px rgba(255,0,0,0.4);
michael@0 717 }
michael@0 718
michael@0 719 output:-moz-ui-invalid {
michael@0 720 color: red;
michael@0 721 }
michael@0 722
michael@0 723 @media print {
michael@0 724 input, textarea, select, button {
michael@0 725 -moz-user-input: none !important;
michael@0 726 }
michael@0 727
michael@0 728 input[type="file"] { height: 2em; }
michael@0 729 }
michael@0 730
michael@0 731 progress {
michael@0 732 -moz-appearance: progressbar;
michael@0 733 display: inline-block;
michael@0 734 vertical-align: -0.2em;
michael@0 735
michael@0 736 /* Default style in case of there is -moz-appearance: none; */
michael@0 737 border: 2px solid;
michael@0 738 /* #e6e6e6 is a light gray. */
michael@0 739 -moz-border-top-colors: ThreeDShadow #e6e6e6;
michael@0 740 -moz-border-right-colors: ThreeDHighlight #e6e6e6;
michael@0 741 -moz-border-bottom-colors: ThreeDHighlight #e6e6e6;
michael@0 742 -moz-border-left-colors: ThreeDShadow #e6e6e6;
michael@0 743 background-color: #e6e6e6;
michael@0 744 }
michael@0 745
michael@0 746 ::-moz-progress-bar {
michael@0 747 /* Prevent styling that would change the type of frame we construct. */
michael@0 748 display: inline-block ! important;
michael@0 749 float: none ! important;
michael@0 750 position: static ! important;
michael@0 751 overflow: visible ! important;
michael@0 752 box-sizing: border-box ! important;
michael@0 753
michael@0 754 -moz-appearance: progresschunk;
michael@0 755 height: 100%;
michael@0 756 width: 100%;
michael@0 757
michael@0 758 /* Default style in case of there is -moz-appearance: none; */
michael@0 759 background-color: #0064b4; /* blue */
michael@0 760 }
michael@0 761
michael@0 762 meter {
michael@0 763 -moz-appearance: meterbar;
michael@0 764 display: inline-block;
michael@0 765 vertical-align: -0.2em;
michael@0 766
michael@0 767 background: linear-gradient(#e6e6e6, #e6e6e6, #eeeeee 20%, #cccccc 45%, #cccccc 55%);
michael@0 768 }
michael@0 769
michael@0 770 ::-moz-meter-bar {
michael@0 771 /* Block styles that would change the type of frame we construct. */
michael@0 772 display: inline-block ! important;
michael@0 773 float: none ! important;
michael@0 774 position: static ! important;
michael@0 775 overflow: visible ! important;
michael@0 776
michael@0 777 -moz-appearance: meterchunk;
michael@0 778 height: 100%;
michael@0 779 width: 100%;
michael@0 780 }
michael@0 781
michael@0 782 :-moz-meter-optimum::-moz-meter-bar {
michael@0 783 /* green. */
michael@0 784 background: linear-gradient(#ad7, #ad7, #cea 20%, #7a3 45%, #7a3 55%);
michael@0 785 }
michael@0 786 :-moz-meter-sub-optimum::-moz-meter-bar {
michael@0 787 /* orange. */
michael@0 788 background: linear-gradient(#fe7, #fe7, #ffc 20%, #db3 45%, #db3 55%);
michael@0 789 }
michael@0 790 :-moz-meter-sub-sub-optimum::-moz-meter-bar {
michael@0 791 /* red. */
michael@0 792 background: linear-gradient(#f77, #f77, #fcc 20%, #d44 45%, #d44 55%);
michael@0 793 }
michael@0 794
michael@0 795 input[type=range] {
michael@0 796 -moz-appearance: range;
michael@0 797 display: inline-block;
michael@0 798 width: 12em;
michael@0 799 height: 1.3em;
michael@0 800 margin: 0 0.7em;
michael@0 801 /* Override some rules that apply on all input types: */
michael@0 802 cursor: default;
michael@0 803 background: none;
michael@0 804 border: none;
michael@0 805 -moz-binding: none; /* we don't want any of platformHTMLBindings.xml#inputFields */
michael@0 806 /* Prevent nsFrame::HandlePress setting mouse capture to this element. */
michael@0 807 -moz-user-select: none ! important;
michael@0 808 }
michael@0 809
michael@0 810 input[type=range][orient=vertical] {
michael@0 811 width: 1.3em;
michael@0 812 height: 12em;
michael@0 813 }
michael@0 814
michael@0 815 /**
michael@0 816 * Ideally we'd also require :-moz-focusring here, but that doesn't currently
michael@0 817 * work. Instead we only use the -moz-focus-outer border style if
michael@0 818 * NS_EVENT_STATE_FOCUSRING is set (the check is in
michael@0 819 * nsRangeFrame::BuildDisplayList).
michael@0 820 */
michael@0 821 input[type=range]::-moz-focus-outer {
michael@0 822 border: 1px dotted black;
michael@0 823 }
michael@0 824
michael@0 825 /**
michael@0 826 * Layout handles positioning of this pseudo-element specially (so that content
michael@0 827 * authors can concentrate on styling the thumb without worrying about the
michael@0 828 * logic to position it). Specifically the 'margin', 'top' and 'left'
michael@0 829 * properties are ignored.
michael@0 830 *
michael@0 831 * If content authors want to have a vertical range, they will also need to
michael@0 832 * set the width/height of this pseudo-element.
michael@0 833 */
michael@0 834 input[type=range]::-moz-range-track {
michael@0 835 /* Prevent styling that would change the type of frame we construct. */
michael@0 836 display: inline-block !important;
michael@0 837 float: none !important;
michael@0 838 position: static !important;
michael@0 839 border: none;
michael@0 840 border-top: solid 0.1em lightgrey;
michael@0 841 border-bottom: solid 0.1em lightgrey;
michael@0 842 background-color: grey;
michael@0 843 width: 100%;
michael@0 844 height: 0.2em;
michael@0 845 /* Prevent nsFrame::HandlePress setting mouse capture to this element. */
michael@0 846 -moz-user-select: none ! important;
michael@0 847 }
michael@0 848
michael@0 849 input[type=range][orient=vertical]::-moz-range-track {
michael@0 850 border-top: none;
michael@0 851 border-bottom: none;
michael@0 852 border-left: solid 0.1em lightgrey;
michael@0 853 border-right: solid 0.1em lightgrey;
michael@0 854 width: 0.2em;
michael@0 855 height: 100%;
michael@0 856 }
michael@0 857
michael@0 858 /**
michael@0 859 * Layout handles positioning of this pseudo-element specially (so that content
michael@0 860 * authors can concentrate on styling this pseudo-element without worrying
michael@0 861 * about the logic to position it). Specifically the 'margin', 'top' and 'left'
michael@0 862 * properties are ignored. Additionally, if the range is horizontal, the width
michael@0 863 * property is ignored, and if the range range is vertical, the height property
michael@0 864 * is ignored.
michael@0 865 */
michael@0 866 input[type=range]::-moz-range-progress {
michael@0 867 /* Prevent styling that would change the type of frame we construct. */
michael@0 868 display: inline-block !important;
michael@0 869 float: none !important;
michael@0 870 position: static !important;
michael@0 871 /* Since one of width/height will be ignored, this just sets the "other"
michael@0 872 dimension.
michael@0 873 */
michael@0 874 width: 0.2em;
michael@0 875 height: 0.2em;
michael@0 876 /* Prevent nsFrame::HandlePress setting mouse capture to this element. */
michael@0 877 -moz-user-select: none ! important;
michael@0 878 }
michael@0 879
michael@0 880 /**
michael@0 881 * Layout handles positioning of this pseudo-element specially (so that content
michael@0 882 * authors can concentrate on styling the thumb without worrying about the
michael@0 883 * logic to position it). Specifically the 'margin', 'top' and 'left'
michael@0 884 * properties are ignored.
michael@0 885 */
michael@0 886 input[type=range]::-moz-range-thumb {
michael@0 887 /* Native theming is atomic for range. Set -moz-appearance on the range
michael@0 888 * to get rid of it. The thumb's -moz-appearance is fixed.
michael@0 889 */
michael@0 890 -moz-appearance: range-thumb !important;
michael@0 891 /* Prevent styling that would change the type of frame we construct. */
michael@0 892 display: inline-block !important;
michael@0 893 float: none !important;
michael@0 894 position: static !important;
michael@0 895 width: 1em;
michael@0 896 height: 1em;
michael@0 897 border: 0.1em solid grey;
michael@0 898 border-radius: 0.5em;
michael@0 899 background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><linearGradient id='g' x2='0' y2='100%'><stop stop-color='%23ddd'/><stop offset='100%' stop-color='white'/></linearGradient><rect fill='url(%23g)' width='100%' height='100%'/></svg>");
michael@0 900 /* Prevent nsFrame::HandlePress setting mouse capture to this element. */
michael@0 901 -moz-user-select: none ! important;
michael@0 902 }
michael@0 903
michael@0 904 /* As a temporary workaround until bug 677302 the rule for input[type=number]
michael@0 905 * has moved to number-control.css
michael@0 906 */
michael@0 907
michael@0 908 input[type=number]::-moz-number-wrapper {
michael@0 909 /* Prevent styling that would change the type of frame we construct. */
michael@0 910 display: flex;
michael@0 911 float: none !important;
michael@0 912 position: static !important;
michael@0 913 height: 100%;
michael@0 914 }
michael@0 915
michael@0 916 input[type=number]::-moz-number-text {
michael@0 917 -moz-appearance: none;
michael@0 918 /* work around autofocus bug 939248 on initial load */
michael@0 919 -moz-user-modify: read-write;
michael@0 920 /* This pseudo-element is also an 'input' element (nested inside and
michael@0 921 * distinct from the <input type=number> element) so we need to prevent the
michael@0 922 * explicit setting of 'text-align' by the general CSS rule for 'input'
michael@0 923 * above. We want to inherit its value from its <input type=number>
michael@0 924 * ancestor, not have that general CSS rule reset it.
michael@0 925 */
michael@0 926 text-align: inherit;
michael@0 927 flex: 1;
michael@0 928 padding: 0;
michael@0 929 border: 0;
michael@0 930 margin: 0;
michael@0 931 }
michael@0 932
michael@0 933 input[type=number]::-moz-number-spin-box {
michael@0 934 display: flex;
michael@0 935 flex-direction: column;
michael@0 936 %ifdef XP_WIN
michael@0 937 /* The Window's Theme's spin buttons have a very narrow minimum width, so
michael@0 938 * make it something reasonable:
michael@0 939 */
michael@0 940 width: 16px;
michael@0 941 %endif
michael@0 942 height: 0;
michael@0 943 align-self: center;
michael@0 944 justify-content: center;
michael@0 945 }
michael@0 946
michael@0 947 input[type=number]::-moz-number-spin-up {
michael@0 948 -moz-appearance: spinner-upbutton;
michael@0 949 display: block; /* bug 926670 */
michael@0 950 flex: none;
michael@0 951 cursor: default;
michael@0 952 /* Style for when native theming is off: */
michael@0 953 background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="6" height="5"><path d="M1,4 L3,0 5,4" fill="dimgrey"/></svg>');
michael@0 954 background-repeat: no-repeat;
michael@0 955 background-position: center bottom;
michael@0 956 border: 1px solid darkgray;
michael@0 957 border-bottom: none;
michael@0 958 border-top-left-radius: 4px;
michael@0 959 border-top-right-radius: 4px;
michael@0 960 }
michael@0 961
michael@0 962 input[type=number]::-moz-number-spin-down {
michael@0 963 -moz-appearance: spinner-downbutton;
michael@0 964 display: block; /* bug 926670 */
michael@0 965 flex: none;
michael@0 966 cursor: default;
michael@0 967 /* Style for when native theming is off: */
michael@0 968 background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="6" height="5"><path d="M1,1 L3,5 5,1" fill="dimgrey"/></svg>');
michael@0 969 background-repeat: no-repeat;
michael@0 970 background-position: center top;
michael@0 971 border: 1px solid darkgray;
michael@0 972 border-top: none;
michael@0 973 border-bottom-left-radius: 4px;
michael@0 974 border-bottom-right-radius: 4px;
michael@0 975 }
michael@0 976
michael@0 977 input[type="number"] > div > div > div:hover {
michael@0 978 /* give some indication of hover state for the up/down buttons */
michael@0 979 background-color: lightblue;
michael@0 980 }

mercurial