Skip to content

Commit

Permalink
Remove other unsupported CSS features from the default stylesheet
Browse files Browse the repository at this point in the history
For example, the rule `-input[type="hidden" i]` would have been ignored before,
because nwmatcher doesn't know how to handle ` i`. It would now apply (although
type would have to be "hidden", and not "HiDdEn" or "HIDDEN").
  • Loading branch information
flaviut authored and domenic committed May 20, 2017
1 parent dfc9430 commit 5151546
Showing 1 changed file with 31 additions and 33 deletions.
64 changes: 31 additions & 33 deletions lib/jsdom/browser/default-stylesheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,10 @@ q {
display: inline
}
q:before {
content: open-quote;
}
q:after {
content: close-quote;
}
/* nwmatcher does not support ::before and ::after, so we can't render q
correctly: https://html.spec.whatwg.org/multipage/rendering.html#phrasing-content-3
TODO: add q::before and q::after selectors
*/
center {
display: block;
Expand Down Expand Up @@ -425,7 +422,8 @@ input, textarea, keygen, select, button {
text-align: start;
}
input[type="hidden" i] {
/* TODO: Add " i" to attribute matchers to support case-insensitive matching */
input[type="hidden"] {
display: none
}
Expand All @@ -439,7 +437,7 @@ input {
cursor: auto;
}
input[type="search" i] {
input[type="search"] {
-webkit-appearance: searchfield;
box-sizing: border-box;
}
Expand All @@ -462,37 +460,37 @@ textarea {
word-wrap: break-word;
}
input[type="password" i] {
input[type="password"] {
-webkit-text-security: disc !important;
}
input[type="hidden" i], input[type="image" i], input[type="file" i] {
input[type="hidden"], input[type="image"], input[type="file"] {
-webkit-appearance: initial;
padding: initial;
background-color: initial;
border: initial;
}
input[type="file" i] {
input[type="file"] {
align-items: baseline;
color: inherit;
text-align: start !important;
}
input[type="radio" i], input[type="checkbox" i] {
input[type="radio"], input[type="checkbox"] {
margin: 3px 0.5ex;
padding: initial;
background-color: initial;
border: initial;
}
input[type="button" i], input[type="submit" i], input[type="reset" i] {
input[type="button"], input[type="submit"], input[type="reset"] {
-webkit-appearance: push-button;
-webkit-user-select: none;
white-space: pre
}
input[type="button" i], input[type="submit" i], input[type="reset" i], button {
input[type="button"], input[type="submit"], input[type="reset"], button {
align-items: flex-start;
text-align: center;
cursor: default;
Expand All @@ -503,25 +501,25 @@ input[type="button" i], input[type="submit" i], input[type="reset" i], button {
box-sizing: border-box
}
input[type="range" i] {
input[type="range"] {
-webkit-appearance: slider-horizontal;
padding: initial;
border: initial;
margin: 2px;
color: #909090;
}
input[type="button" i]:disabled, input[type="submit" i]:disabled, input[type="reset" i]:disabled,
input[type="button"]:disabled, input[type="submit"]:disabled, input[type="reset"]:disabled,
button:disabled, select:disabled, keygen:disabled, optgroup:disabled, option:disabled,
select[disabled]>option {
color: GrayText
}
input[type="button" i]:active, input[type="submit" i]:active, input[type="reset" i]:active, button:active {
input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active, button:active {
border-style: inset
}
input[type="button" i]:active:disabled, input[type="submit" i]:active:disabled, input[type="reset" i]:active:disabled, button:active:disabled {
input[type="button"]:active:disabled, input[type="submit"]:active:disabled, input[type="reset"]:active:disabled, button:active:disabled {
border-style: outset
}
Expand All @@ -538,17 +536,17 @@ param {
display: none
}
input[type="checkbox" i] {
input[type="checkbox"] {
-webkit-appearance: checkbox;
box-sizing: border-box;
}
input[type="radio" i] {
input[type="radio"] {
-webkit-appearance: radio;
box-sizing: border-box;
}
input[type="color" i] {
input[type="color"] {
-webkit-appearance: square-button;
width: 44px;
height: 23px;
Expand All @@ -558,7 +556,7 @@ input[type="color" i] {
padding: 1px 2px;
}
input[type="color" i][list] {
input[type="color"][list] {
-webkit-appearance: menulist;
width: 88px;
height: 23px
Expand Down Expand Up @@ -690,15 +688,15 @@ input:focus, textarea:focus, keygen:focus, select:focus {
outline-offset: -2px
}
input[type="button" i]:focus,
input[type="checkbox" i]:focus,
input[type="file" i]:focus,
input[type="hidden" i]:focus,
input[type="image" i]:focus,
input[type="radio" i]:focus,
input[type="reset" i]:focus,
input[type="search" i]:focus,
input[type="submit" i]:focus {
input[type="button"]:focus,
input[type="checkbox"]:focus,
input[type="file"]:focus,
input[type="hidden"]:focus,
input[type="image"]:focus,
input[type="radio"]:focus,
input[type="reset"]:focus,
input[type="search"]:focus,
input[type="submit"]:focus {
outline-offset: 0
}
Expand Down Expand Up @@ -761,7 +759,7 @@ bdo {
unicode-bidi: bidi-override;
}
textarea[dir=auto i] {
textarea[dir=auto] {
unicode-bidi: -webkit-plaintext;
}
Expand Down

0 comments on commit 5151546

Please sign in to comment.