Modified: trunk/Source/WebCore/ChangeLog (176710 => 176711)
--- trunk/Source/WebCore/ChangeLog 2014-12-03 04:17:32 UTC (rev 176710)
+++ trunk/Source/WebCore/ChangeLog 2014-12-03 06:36:21 UTC (rev 176711)
@@ -1,3 +1,63 @@
+2014-12-02 Benjamin Poulain <[email protected]>
+
+ Little cleanup of the default stylesheet
+ https://bugs.webkit.org/show_bug.cgi?id=139168
+
+ Reviewed by Antti Koivisto.
+
+ The default stylesheet has a lot of historical junk that need cleaning. This patch addresses
+ only the bits that do not change behaviors and have positive perf and readability impact.
+
+ I have limited :matches() to attributes for now. The idea is to only target
+ simple selectors that are not used for filtering by the collectors.
+ We should eventually clean up more cases, one thing at a time.
+
+ Tests: fast/css/map-tag-default-display.html
+ fast/selectors/map-tag-default-display.html
+
+ * css/html.css:
+ (map): Deleted.
+ map was explicitely setting its display to inline. Remove that since it is the default.
+
+ (head): Deleted.
+ (meta): Deleted.
+ (title): Deleted.
+ (link): Deleted.
+ (style): Deleted.
+ (script): Deleted.
+ (div): Deleted.
+ (layer): Deleted.
+ (article, aside, footer, header, hgroup, main, nav, section): Deleted.
+ (address): Deleted.
+ (head, link, meta, script, style, title):
+ (address, article, aside, div, footer, header, hgroup, layer, main, nav, section):
+ Group the standard blocks in a single rule.
+
+ (input:matches([type="hidden"], [type="image"], [type="file"])):
+ (input:matches([type="radio"], [type="checkbox"])):
+ (input:matches([type="button"], [type="submit"], [type="reset"])):
+ (input:matches([type="button"], [type="submit"], [type="reset"]), input[type="file"]::-webkit-file-upload-button, button):
+ (input:matches([type="button"], [type="submit"], [type="reset"]):active, input[type="file"]::-webkit-file-upload-button:active, button:active):
+ (input:matches([type="button"], [type="submit"], [type="reset"]):active, input[type="file"]:active::-webkit-file-upload-button, button:active):
+ (input[type="file"]:active:disabled::-webkit-file-upload-button, button:active:disabled):
+ (input:matches([type="checkbox"], [type="radio"]):checked):
+ (input:matches([type="checkbox"], [type="radio"]):checked:disabled):
+ (select:matches([size], [multiple], [size][multiple])):
+ (select:matches([size="0"], [size="1"])):
+ (input[type="hidden"], input[type="image"], input[type="file"]): Deleted.
+ (input[type="radio"], input[type="checkbox"]): Deleted.
+ (input[type="button"], input[type="submit"], input[type="reset"]): Deleted.
+ (input[type="button"], input[type="submit"], input[type="reset"], input[type="file"]::-webkit-file-upload-button, button): Deleted.
+ (input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active, input[type="file"]::-webkit-file-upload-button:active, button:active): Deleted.
+ (input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active, input[type="file"]:active::-webkit-file-upload-button, button:active): Deleted.
+ (input[type="button"]:active:disabled, input[type="submit"]:active:disabled, input[type="reset"]:active:disabled, input[type="file"]:active:disabled::-webkit-file-upload-button, button:active:disabled): Deleted.
+ (input[type="checkbox"]:checked, input[type="radio"]:checked): Deleted.
+ (input[type="checkbox"]:checked:disabled, input[type="radio"]:checked:disabled): Deleted.
+ (select[size][multiple]): Deleted.
+ (select[size="1"]): Deleted.
+ Group every selector lists that only differentiates complex selectors through attributes
+ into a simple complex selector with :matches().
+
2014-12-02 Mark Lam <[email protected]>
Rolling out r176592, r176603, r176616, and r176705 until build and perf issues are resolved.
Modified: trunk/Source/WebCore/css/html.css (176710 => 176711)
--- trunk/Source/WebCore/css/html.css 2014-12-03 04:17:32 UTC (rev 176710)
+++ trunk/Source/WebCore/css/html.css 2014-12-03 06:36:21 UTC (rev 176711)
@@ -28,30 +28,10 @@
}
/* children of the <head> element all have display:none */
-head {
+head, link, meta, script, style, title {
display: none
}
-meta {
- display: none
-}
-
-title {
- display: none
-}
-
-link {
- display: none
-}
-
-style {
- display: none
-}
-
-script {
- display: none
-}
-
/* generic block-level elements */
body {
@@ -67,27 +47,15 @@
-webkit-margin-end: 0;
}
-div {
+address, article, aside, div, footer, header, hgroup, layer, main, nav, section {
display: block
}
-layer {
- display: block
-}
-
-article, aside, footer, header, hgroup, main, nav, section {
- display: block
-}
-
marquee {
display: inline-block;
overflow: -webkit-marquee
}
-address {
- display: block
-}
-
blockquote {
display: block;
-webkit-margin-before: 1__qem;
@@ -136,10 +104,6 @@
border-width: 1px
}
-map {
- display: inline
-}
-
video {
object-fit: contain;
}
@@ -412,8 +376,7 @@
}
input,
-input[type="password"],
-input[type="search"],
+input:matches([type="password"], [type="search"]),
#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS
textarea,
input[type="range"],
@@ -624,7 +587,7 @@
-webkit-text-security: disc !important;
}
-input[type="hidden"], input[type="image"], input[type="file"] {
+input:matches([type="hidden"], [type="image"], [type="file"]) {
-webkit-appearance: initial;
padding: initial;
background-color: initial;
@@ -647,7 +610,7 @@
color: #000000 !important;
}
-input[type="radio"], input[type="checkbox"] {
+input:matches([type="radio"], [type="checkbox"]) {
margin: 3px 2px;
#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS
border: 1px solid #4c4c4c;
@@ -659,7 +622,7 @@
#endif
}
-input[type="button"], input[type="submit"], input[type="reset"] {
+input:matches([type="button"], [type="submit"], [type="reset"]) {
-webkit-appearance: push-button;
white-space: pre
}
@@ -671,7 +634,7 @@
font-size: inherit;
}
-input[type="button"], input[type="submit"], input[type="reset"], input[type="file"]::-webkit-file-upload-button, button {
+input:matches([type="button"], [type="submit"], [type="reset"]), input[type="file"]::-webkit-file-upload-button, button {
-webkit-align-items: flex-start;
text-align: center;
cursor: default;
@@ -690,7 +653,7 @@
box-sizing: border-box
}
-input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active, input[type="file"]::-webkit-file-upload-button:active, button:active {
+input:matches([type="button"], [type="submit"], [type="reset"]):active, input[type="file"]::-webkit-file-upload-button:active, button:active {
color: ActiveButtonText;
}
@@ -746,7 +709,7 @@
}
#endif
-input[type="button"]:disabled, input[type="submit"]:disabled, input[type="reset"]:disabled,
+input:matches([type="button"], [type="submit"], [type="reset"]):disabled,
input[type="file"]:disabled::-webkit-file-upload-button, button:disabled,
select:disabled, keygen:disabled, optgroup:disabled, option:disabled,
select[disabled]>option {
@@ -754,11 +717,12 @@
}
#if !(defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS)
-input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active, input[type="file"]:active::-webkit-file-upload-button, button:active {
+input:matches([type="button"], [type="submit"], [type="reset"]):active, input[type="file"]:active::-webkit-file-upload-button, button:active {
border-style: inset
}
-input[type="button"]:active:disabled, input[type="submit"]:active:disabled, input[type="reset"]:active:disabled, input[type="file"]:active:disabled::-webkit-file-upload-button, button:active:disabled {
+input:matches([type="button"], [type="submit"], [type="reset"]):active:disabled,
+input[type="file"]:active:disabled::-webkit-file-upload-button, button:active:disabled {
border-style: outset
}
#endif
@@ -792,12 +756,12 @@
background-color: rgba(255, 255, 255, 0.01);
}
-input[type="checkbox"]:checked, input[type="radio"]:checked {
+input:matches([type="checkbox"], [type="radio"]):checked {
background:rgba(0, 0, 0, 0.8);
border-color:rgba(255, 255, 255, 0.0);
}
-input[type="checkbox"]:checked:disabled, input[type="radio"]:checked:disabled {
+input:matches([type="checkbox"], [type="radio"]):checked:disabled {
opacity:0.4;
background:rgba(0, 0, 0, 0.8);
}
@@ -884,9 +848,7 @@
}
#if !(defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS)
-select[size],
-select[multiple],
-select[size][multiple] {
+select:matches([size], [multiple], [size][multiple]) {
-webkit-appearance: listbox;
-webkit-align-items: flex-start;
border: 1px inset gray;
@@ -894,8 +856,7 @@
white-space: initial;
}
-select[size="0"],
-select[size="1"] {
+select:matches([size="0"], [size="1"]) {
-webkit-appearance: menulist;
-webkit-align-items: center;
border: 1px solid;
@@ -1131,15 +1092,7 @@
outline-offset: -2px
}
-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,
+input:matches([type="button"], [type="checkbox"], [type="file"], [type="hidden"], [type="image"], [type="radio"], [type="reset"], [type="search"], [type="submit"]):focus,
input[type="file"]:focus::-webkit-file-upload-button {
outline-offset: 0
}