⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 176711 in webkit


Ignore:
Timestamp:
Dec 2, 2014, 10:36:21 PM (12 years ago)
Author:
benjamin@webkit.org
Message:

Little cleanup of the default stylesheet
https://bugs.webkit.org/show_bug.cgi?id=139168

Reviewed by Antti Koivisto.

Source/WebCore:

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().

LayoutTests:

Test the default display type of <map> since it is not longer explicitely set.

  • fast/css/map-tag-default-display-expected.html: Added.
  • fast/css/map-tag-default-display.html: Added.
  • fast/selectors/map-tag-default-display-expected.txt: Added.
  • fast/selectors/map-tag-default-display.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r176706 r176711  
     12014-12-02  Benjamin Poulain  <benjamin@webkit.org>
     2
     3        Little cleanup of the default stylesheet
     4        https://bugs.webkit.org/show_bug.cgi?id=139168
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Test the default display type of <map> since it is not longer explicitely set.
     9
     10        * fast/css/map-tag-default-display-expected.html: Added.
     11        * fast/css/map-tag-default-display.html: Added.
     12        * fast/selectors/map-tag-default-display-expected.txt: Added.
     13        * fast/selectors/map-tag-default-display.html: Added.
     14
    1152014-12-02  Joanmarie Diggs  <jdiggs@igalia.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r176709 r176711  
     12014-12-02  Benjamin Poulain  <benjamin@webkit.org>
     2
     3        Little cleanup of the default stylesheet
     4        https://bugs.webkit.org/show_bug.cgi?id=139168
     5
     6        Reviewed by Antti Koivisto.
     7
     8        The default stylesheet has a lot of historical junk that need cleaning. This patch addresses
     9        only the bits that do not change behaviors and have positive perf and readability impact.
     10
     11        I have limited :matches() to attributes for now. The idea is to only target
     12        simple selectors that are not used for filtering by the collectors.
     13        We should eventually clean up more cases, one thing at a time.
     14
     15        Tests: fast/css/map-tag-default-display.html
     16               fast/selectors/map-tag-default-display.html
     17
     18        * css/html.css:
     19        (map): Deleted.
     20        map was explicitely setting its display to inline. Remove that since it is the default.
     21
     22        (head): Deleted.
     23        (meta): Deleted.
     24        (title): Deleted.
     25        (link): Deleted.
     26        (style): Deleted.
     27        (script): Deleted.
     28        (div): Deleted.
     29        (layer): Deleted.
     30        (article, aside, footer, header, hgroup, main, nav, section): Deleted.
     31        (address): Deleted.
     32        (head, link, meta, script, style, title):
     33        (address, article, aside, div, footer, header, hgroup, layer, main, nav, section):
     34        Group the standard blocks in a single rule.
     35
     36        (input:matches([type="hidden"], [type="image"], [type="file"])):
     37        (input:matches([type="radio"], [type="checkbox"])):
     38        (input:matches([type="button"], [type="submit"], [type="reset"])):
     39        (input:matches([type="button"], [type="submit"], [type="reset"]), input[type="file"]::-webkit-file-upload-button, button):
     40        (input:matches([type="button"], [type="submit"], [type="reset"]):active, input[type="file"]::-webkit-file-upload-button:active, button:active):
     41        (input:matches([type="button"], [type="submit"], [type="reset"]):active, input[type="file"]:active::-webkit-file-upload-button, button:active):
     42        (input[type="file"]:active:disabled::-webkit-file-upload-button, button:active:disabled):
     43        (input:matches([type="checkbox"], [type="radio"]):checked):
     44        (input:matches([type="checkbox"], [type="radio"]):checked:disabled):
     45        (select:matches([size], [multiple], [size][multiple])):
     46        (select:matches([size="0"], [size="1"])):
     47        (input[type="hidden"], input[type="image"], input[type="file"]): Deleted.
     48        (input[type="radio"], input[type="checkbox"]): Deleted.
     49        (input[type="button"], input[type="submit"], input[type="reset"]): Deleted.
     50        (input[type="button"], input[type="submit"], input[type="reset"], input[type="file"]::-webkit-file-upload-button, button): Deleted.
     51        (input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active, input[type="file"]::-webkit-file-upload-button:active, button:active): Deleted.
     52        (input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active, input[type="file"]:active::-webkit-file-upload-button, button:active): Deleted.
     53        (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.
     54        (input[type="checkbox"]:checked, input[type="radio"]:checked): Deleted.
     55        (input[type="checkbox"]:checked:disabled, input[type="radio"]:checked:disabled): Deleted.
     56        (select[size][multiple]): Deleted.
     57        (select[size="1"]): Deleted.
     58        Group every selector lists that only differentiates complex selectors through attributes
     59        into a simple complex selector with :matches().
     60
    1612014-12-02  Mark Lam  <mark.lam@apple.com>
    262
  • trunk/Source/WebCore/css/html.css

    r173928 r176711  
    2929
    3030/* children of the <head> element all have display:none */
    31 head {
    32     display: none
    33 }
    34 
    35 meta {
    36     display: none
    37 }
    38 
    39 title {
    40     display: none
    41 }
    42 
    43 link {
    44     display: none
    45 }
    46 
    47 style {
    48     display: none
    49 }
    50 
    51 script {
     31head, link, meta, script, style, title {
    5232    display: none
    5333}
     
    6848}
    6949
    70 div {
    71     display: block
    72 }
    73 
    74 layer {
    75     display: block
    76 }
    77 
    78 article, aside, footer, header, hgroup, main, nav, section {
     50address, article, aside, div, footer, header, hgroup, layer, main, nav, section {
    7951    display: block
    8052}
     
    8355    display: inline-block;
    8456    overflow: -webkit-marquee
    85 }
    86 
    87 address {
    88     display: block
    8957}
    9058
     
    135103    border-style: inset;
    136104    border-width: 1px
    137 }
    138 
    139 map {
    140     display: inline
    141105}
    142106
     
    413377
    414378input,
    415 input[type="password"],
    416 input[type="search"],
     379input:matches([type="password"], [type="search"]),
    417380#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS
    418381textarea,
     
    625588}
    626589
    627 input[type="hidden"], input[type="image"], input[type="file"] {
     590input:matches([type="hidden"], [type="image"], [type="file"]) {
    628591    -webkit-appearance: initial;
    629592    padding: initial;
     
    648611}
    649612
    650 input[type="radio"], input[type="checkbox"] {
     613input:matches([type="radio"], [type="checkbox"]) {
    651614    margin: 3px 2px;
    652615#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS
     
    660623}
    661624
    662 input[type="button"], input[type="submit"], input[type="reset"] {
     625input:matches([type="button"], [type="submit"], [type="reset"]) {
    663626    -webkit-appearance: push-button;
    664627    white-space: pre
     
    672635}
    673636
    674 input[type="button"], input[type="submit"], input[type="reset"], input[type="file"]::-webkit-file-upload-button, button {
     637input:matches([type="button"], [type="submit"], [type="reset"]), input[type="file"]::-webkit-file-upload-button, button {
    675638    -webkit-align-items: flex-start;
    676639    text-align: center;
     
    691654}
    692655
    693 input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active, input[type="file"]::-webkit-file-upload-button:active, button:active {
     656input:matches([type="button"], [type="submit"], [type="reset"]):active, input[type="file"]::-webkit-file-upload-button:active, button:active {
    694657    color: ActiveButtonText;
    695658}
     
    747710#endif
    748711
    749 input[type="button"]:disabled, input[type="submit"]:disabled, input[type="reset"]:disabled,
     712input:matches([type="button"], [type="submit"], [type="reset"]):disabled,
    750713input[type="file"]:disabled::-webkit-file-upload-button, button:disabled,
    751714select:disabled, keygen:disabled, optgroup:disabled, option:disabled,
     
    755718
    756719#if !(defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS)
    757 input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active, input[type="file"]:active::-webkit-file-upload-button, button:active {
     720input:matches([type="button"], [type="submit"], [type="reset"]):active, input[type="file"]:active::-webkit-file-upload-button, button:active {
    758721    border-style: inset
    759722}
    760723
    761 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 {
     724input:matches([type="button"], [type="submit"], [type="reset"]):active:disabled,
     725input[type="file"]:active:disabled::-webkit-file-upload-button, button:active:disabled {
    762726    border-style: outset
    763727}
     
    793757}
    794758
    795 input[type="checkbox"]:checked, input[type="radio"]:checked {
     759input:matches([type="checkbox"], [type="radio"]):checked {
    796760    background:rgba(0, 0, 0, 0.8);
    797761    border-color:rgba(255, 255, 255, 0.0);
    798762}
    799763
    800 input[type="checkbox"]:checked:disabled, input[type="radio"]:checked:disabled {
     764input:matches([type="checkbox"], [type="radio"]):checked:disabled {
    801765    opacity:0.4;
    802766    background:rgba(0, 0, 0, 0.8);
     
    885849
    886850#if !(defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS)
    887 select[size],
    888 select[multiple],
    889 select[size][multiple] {
     851select:matches([size], [multiple], [size][multiple]) {
    890852    -webkit-appearance: listbox;
    891853    -webkit-align-items: flex-start;
     
    895857}
    896858
    897 select[size="0"],
    898 select[size="1"] {
     859select:matches([size="0"], [size="1"]) {
    899860    -webkit-appearance: menulist;
    900861    -webkit-align-items: center;
     
    11321093}
    11331094
    1134 input[type="button"]:focus,
    1135 input[type="checkbox"]:focus,
    1136 input[type="file"]:focus,
    1137 input[type="hidden"]:focus,
    1138 input[type="image"]:focus,
    1139 input[type="radio"]:focus,
    1140 input[type="reset"]:focus,
    1141 input[type="search"]:focus,
    1142 input[type="submit"]:focus,
     1095input:matches([type="button"], [type="checkbox"], [type="file"], [type="hidden"], [type="image"], [type="radio"], [type="reset"], [type="search"], [type="submit"]):focus,
    11431096input[type="file"]:focus::-webkit-file-upload-button {
    11441097    outline-offset: 0
Note: See TracChangeset for help on using the changeset viewer.