Changeset 207767 in webkit


Ignore:
Timestamp:
Oct 24, 2016 11:18:09 AM (7 years ago)
Author:
hyatt@apple.com
Message:

Remove CSSCharsetRule from the CSS OM
https://bugs.webkit.org/show_bug.cgi?id=163891

Reviewed by Darin Adler.

Source/WebCore:

Remove CSSCharsetRule from the CSS OM. All other browser engines have made this
change. This eliminates the weird overloading of isCharsetRule to match both
CSSCharsetRule and StyleRuleCharset (only used by the new parser).

Fix the destroy() method in StyleRuleBase to clean up StyleRuleCharsets created
by the new parser properly.

  • CMakeLists.txt:
  • DerivedSources.make:
  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSCSSRuleCustom.cpp:

(WebCore::toJSNewlyCreated):

  • css/CSSCharsetRule.cpp: Removed.
  • css/CSSCharsetRule.h: Removed.
  • css/CSSCharsetRule.idl: Removed.
  • css/CSSPropertySourceData.h:
  • css/CSSStyleSheet.cpp:

(WebCore::CSSStyleSheet::item):
(WebCore::CSSStyleSheet::rules):

  • css/CSSStyleSheet.h:
  • css/StyleRule.cpp:

(WebCore::StyleRuleBase::destroy):

  • inspector/InspectorStyleSheet.cpp:

(WebCore::asCSSRuleList):

Source/WebKit/mac:

  • DOM/DOMCSSCharsetRule.mm:

(-[DOMCSSCharsetRule encoding]):

LayoutTests:

  • fast/dom/Window/resources/window-properties.js:
  • fast/dom/dom-constructors-expected.txt:
  • fast/dom/dom-constructors.html:
  • fast/encoding/css-charset-default.xhtml:
  • fast/encoding/css-charset-dom-expected.txt: Removed.
  • fast/encoding/css-charset-dom.html: Removed.
  • platform/mac/fast/dom/Window/window-lookup-precedence-expected.txt:
Location:
trunk
Files:
5 deleted
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r207764 r207767  
     12016-10-24  Dave Hyatt  <hyatt@apple.com>
     2
     3        Remove CSSCharsetRule from the CSS OM
     4        https://bugs.webkit.org/show_bug.cgi?id=163891
     5
     6        Reviewed by Darin Adler.
     7
     8        * fast/dom/Window/resources/window-properties.js:
     9        * fast/dom/dom-constructors-expected.txt:
     10        * fast/dom/dom-constructors.html:
     11        * fast/encoding/css-charset-default.xhtml:
     12        * fast/encoding/css-charset-dom-expected.txt: Removed.
     13        * fast/encoding/css-charset-dom.html: Removed.
     14        * platform/mac/fast/dom/Window/window-lookup-precedence-expected.txt:
     15
    1162016-10-24  Eric Carlson  <eric.carlson@apple.com>
    217
  • trunk/LayoutTests/fast/dom/Window/resources/window-properties.js

    r204935 r207767  
    3434    ["Attr", "object"],
    3535    ["CDATASection", "object"],
    36     ["CSSCharsetRule", "object"],
    3736    ["CSSFontFaceRule", "object"],
    3837    ["CSSImportRule", "object"],
  • trunk/LayoutTests/fast/dom/dom-constructors-expected.txt

    r191423 r207767  
    7070PASS TryAllocate('CanvasRenderingContext2D') is 'exception'
    7171PASS TryAllocate('Counter') is 'exception'
    72 PASS TryAllocate('CSSCharsetRule') is 'exception'
    7372PASS TryAllocate('CSSFontFaceRule') is 'exception'
    7473PASS TryAllocate('CSSImportRule') is 'exception'
  • trunk/LayoutTests/fast/dom/dom-constructors.html

    r191423 r207767  
    8080    'CanvasRenderingContext2D',
    8181    'Counter',
    82     'CSSCharsetRule',
    8382    'CSSFontFaceRule',
    8483    'CSSImportRule',
  • trunk/LayoutTests/fast/encoding/css-charset-default.xhtml

    r195497 r207767  
    3131    document.getElementById("res2").innerHTML += document.styleSheets[1].cssRules[0].style.content;
    3232   
    33     document.getElementById("res3").innerHTML += document.styleSheets[2].cssRules[1].styleSheet.cssRules[0].style.content;
     33    document.getElementById("res3").innerHTML += document.styleSheets[2].cssRules[0].styleSheet.cssRules[0].style.content;
    3434
    3535    document.getElementById("res4").innerHTML += document.styleSheets[3].cssRules[0].styleSheet.cssRules[0].style.content;
  • trunk/LayoutTests/http/tests/css/resources/shared-stylesheet-mutation.js

    r191158 r207767  
    7979
    8080    mutationTest(1, 'sheet.insertRule("#testdiv { background-color: green; }", 3)', 'green');
    81     mutationTest(2, 'sheet.deleteRule(2)');
    82     mutationTest(3, 'sheet.cssRules[2].insertRule("#testdiv { background-color: green; }", 1)', 'green');
    83     mutationTest(4, 'sheet.cssRules[2].deleteRule(0)', 'green');
    84     mutationTest(5, 'sheet.cssRules[2].cssRules[0].style.setProperty("background-color", "green", "")', 'green');
    85     mutationTest(6, 'sheet.cssRules[2].cssRules[0].style.removeProperty("background-color")', 'green');
    86     mutationTest(7, 'sheet.cssRules[2].cssRules[0].style.cssText = "background-color: green"', 'green');
    87     mutationTest(8, 'sheet.cssRules[2].cssRules[0].selectorText = "#dontmatch"', 'green');
    88     mutationTest(9, 'sheet.cssRules[2].media.mediaText = "print"', 'green');
     81    mutationTest(2, 'sheet.deleteRule(1)');
     82    mutationTest(3, 'sheet.cssRules[1].insertRule("#testdiv { background-color: green; }", 1)', 'green');
     83    mutationTest(4, 'sheet.cssRules[1].deleteRule(0)', 'green');
     84    mutationTest(5, 'sheet.cssRules[1].cssRules[0].style.setProperty("background-color", "green", "")', 'green');
     85    mutationTest(6, 'sheet.cssRules[1].cssRules[0].style.removeProperty("background-color")', 'green');
     86    mutationTest(7, 'sheet.cssRules[1].cssRules[0].style.cssText = "background-color: green"', 'green');
     87    mutationTest(8, 'sheet.cssRules[1].cssRules[0].selectorText = "#dontmatch"', 'green');
     88    mutationTest(9, 'sheet.cssRules[1].media.mediaText = "print"', 'green');
    8989   
    9090    var testString = '\
    91         sheet.cssRules[2].media.appendMedium("print");\
    92         sheet.cssRules[2].media.deleteMedium("all");\
     91        sheet.cssRules[1].media.appendMedium("print");\
     92        sheet.cssRules[1].media.deleteMedium("all");\
    9393    ';
    9494    mutationTest(10, testString, 'green');
    9595   
    9696    var testString = '\
    97         sheet.deleteRule(3);\
    98         sheet.insertRule("#testdiv { background-color: green; }", 1);\
    9997        sheet.deleteRule(2);\
    100         sheet.deleteRule(0);\
     98        sheet.insertRule("#testdiv { background-color: green; }", 0);\
     99        sheet.deleteRule(1);\
    101100        sheet.deleteRule(3);\
    102101        sheet.deleteRule(1);\
     
    106105
    107106    var importRule = '@import "data:text/css;charset=utf-8,%23testdiv%7Bbackground-color%3Agreen%20!important%7D";';
    108     mutationTest(12, "sheet.insertRule('"+importRule+"', 1)", 'green');
     107    mutationTest(12, "sheet.insertRule('"+importRule+"', 0)", 'green');
    109108
    110     mutationTest(13, 'sheet.cssRules[3].selectorText = "foo"', 'red');
    111     mutationTest(14, 'sheet.cssRules[4].insertRule("40% { left: 40px; }")', 'red');
    112     mutationTest(15, 'sheet.cssRules[4].deleteRule("100%")', 'red');
    113     mutationTest(16, 'sheet.cssRules[5].style.setProperty("font-family", "Bar", "")', 'red');
     109    mutationTest(13, 'sheet.cssRules[2].selectorText = "foo"', 'red');
     110    mutationTest(14, 'sheet.cssRules[3].insertRule("40% { left: 40px; }")', 'red');
     111    mutationTest(15, 'sheet.cssRules[3].deleteRule("100%")', 'red');
     112    mutationTest(16, 'sheet.cssRules[4].style.setProperty("font-family", "Bar", "")', 'red');
    114113
    115114    setTimeout(finishedTests, 80);
  • trunk/LayoutTests/http/tests/css/shared-stylesheet-mutation-expected.txt

    r191158 r207767  
    99PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(255, 0, 0)'
    1010
    11 @charset "utf-8";
    1211#testdiv { background-color: green; }
    1312@media all {
     
    2524PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
    2625
    27 @charset "utf-8";
    28 #testdiv { background-color: green; }
    29 @media all {
    30   #testdiv { background-color: red; }
    31 }
    32 #testdiv { background-color: green; }
    33 @page :right { margin-left: 3cm; }
     26#testdiv { background-color: green; }
     27@media all {
     28  #testdiv { background-color: red; }
     29}
     30@page :right { margin-left: 3cm; }
     31#testdiv { background-color: green; }
    3432@-webkit-keyframes bounce {
    3533  0% { left: 0px; }
     
    4240PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
    4341
    44 @charset "utf-8";
    4542#testdiv { background-color: green; }
    4643@page :right { margin-left: 3cm; }
     
    5552PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
    5653
    57 @charset "utf-8";
    5854#testdiv { background-color: green; }
    5955@media all {
     
    7268PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
    7369
    74 @charset "utf-8";
    7570#testdiv { background-color: green; }
    7671@media all {
     
    8782PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
    8883
    89 @charset "utf-8";
    9084#testdiv { background-color: green; }
    9185@media all {
     
    10397PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
    10498
    105 @charset "utf-8";
    10699#testdiv { background-color: green; }
    107100@media all {
     
    119112PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
    120113
    121 @charset "utf-8";
    122114#testdiv { background-color: green; }
    123115@media all {
     
    135127PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
    136128
    137 @charset "utf-8";
    138129#testdiv { background-color: green; }
    139130@media all {
     
    151142PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
    152143
    153 @charset "utf-8";
    154144#testdiv { background-color: green; }
    155145@media print {
     
    167157PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
    168158
    169 @charset "utf-8";
    170159#testdiv { background-color: green; }
    171160@media print {
     
    189178PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
    190179
    191 @charset "utf-8";
    192180@import url("data:text/css;charset=utf-8,%23testdiv%7Bbackground-color%3Agreen%20!important%7D");
    193181#testdiv { background-color: green; }
     
    206194PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(255, 0, 0)'
    207195
    208 @charset "utf-8";
    209196#testdiv { background-color: green; }
    210197@media all {
     
    222209PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(255, 0, 0)'
    223210
    224 @charset "utf-8";
    225211#testdiv { background-color: green; }
    226212@media all {
     
    239225PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(255, 0, 0)'
    240226
    241 @charset "utf-8";
    242227#testdiv { background-color: green; }
    243228@media all {
     
    254239PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(255, 0, 0)'
    255240
    256 @charset "utf-8";
    257241#testdiv { background-color: green; }
    258242@media all {
  • trunk/LayoutTests/http/tests/css/shared-stylesheet-mutation-preconstruct-expected.txt

    r191158 r207767  
    99PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(255, 0, 0)'
    1010
    11 @charset "utf-8";
    1211#testdiv { background-color: green; }
    1312@media all {
     
    2524PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
    2625
    27 @charset "utf-8";
    28 #testdiv { background-color: green; }
    29 @media all {
    30   #testdiv { background-color: red; }
    31 }
    32 #testdiv { background-color: green; }
    33 @page :right { margin-left: 3cm; }
     26#testdiv { background-color: green; }
     27@media all {
     28  #testdiv { background-color: red; }
     29}
     30@page :right { margin-left: 3cm; }
     31#testdiv { background-color: green; }
    3432@-webkit-keyframes bounce {
    3533  0% { left: 0px; }
     
    4240PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
    4341
    44 @charset "utf-8";
    4542#testdiv { background-color: green; }
    4643@page :right { margin-left: 3cm; }
     
    5552PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
    5653
    57 @charset "utf-8";
    5854#testdiv { background-color: green; }
    5955@media all {
     
    7268PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
    7369
    74 @charset "utf-8";
    7570#testdiv { background-color: green; }
    7671@media all {
     
    8782PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
    8883
    89 @charset "utf-8";
    9084#testdiv { background-color: green; }
    9185@media all {
     
    10397PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
    10498
    105 @charset "utf-8";
    10699#testdiv { background-color: green; }
    107100@media all {
     
    119112PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
    120113
    121 @charset "utf-8";
    122114#testdiv { background-color: green; }
    123115@media all {
     
    135127PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
    136128
    137 @charset "utf-8";
    138129#testdiv { background-color: green; }
    139130@media all {
     
    151142PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
    152143
    153 @charset "utf-8";
    154144#testdiv { background-color: green; }
    155145@media print {
     
    167157PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
    168158
    169 @charset "utf-8";
    170159#testdiv { background-color: green; }
    171160@media print {
     
    189178PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
    190179
    191 @charset "utf-8";
    192180@import url("data:text/css;charset=utf-8,%23testdiv%7Bbackground-color%3Agreen%20!important%7D");
    193181#testdiv { background-color: green; }
     
    206194PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(255, 0, 0)'
    207195
    208 @charset "utf-8";
    209196#testdiv { background-color: green; }
    210197@media all {
     
    222209PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(255, 0, 0)'
    223210
    224 @charset "utf-8";
    225211#testdiv { background-color: green; }
    226212@media all {
     
    239225PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(255, 0, 0)'
    240226
    241 @charset "utf-8";
    242227#testdiv { background-color: green; }
    243228@media all {
     
    254239PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(255, 0, 0)'
    255240
    256 @charset "utf-8";
    257241#testdiv { background-color: green; }
    258242@media all {
  • trunk/LayoutTests/platform/mac/fast/dom/Window/window-lookup-precedence-expected.txt

    r204935 r207767  
    6969PASS 'function CDATASection() {    [native code]}' is 'function CDATASection() {    [native code]}'
    7070PASS 'function CDATASection() {    [native code]}' is 'function CDATASection() {    [native code]}'
    71 PASS 'function CSSCharsetRule() {    [native code]}' is 'function CSSCharsetRule() {    [native code]}'
    72 PASS 'function CSSCharsetRule() {    [native code]}' is 'function CSSCharsetRule() {    [native code]}'
    7371PASS 'function CSSFontFaceRule() {    [native code]}' is 'function CSSFontFaceRule() {    [native code]}'
    7472PASS 'function CSSFontFaceRule() {    [native code]}' is 'function CSSFontFaceRule() {    [native code]}'
  • trunk/Source/WebCore/CMakeLists.txt

    r207670 r207767  
    333333    crypto/WebKitSubtleCrypto.idl
    334334
    335     css/CSSCharsetRule.idl
    336335    css/CSSFontFaceLoadEvent.idl
    337336    css/CSSFontFaceRule.idl
     
    12601259    css/CSSCalculationValue.cpp
    12611260    css/CSSCanvasValue.cpp
    1262     css/CSSCharsetRule.cpp
    12631261    css/CSSComputedStyleDeclaration.cpp
    12641262    css/CSSContentDistributionValue.cpp
  • trunk/Source/WebCore/ChangeLog

    r207766 r207767  
     12016-10-24  Dave Hyatt  <hyatt@apple.com>
     2
     3        Remove CSSCharsetRule from the CSS OM
     4        https://bugs.webkit.org/show_bug.cgi?id=163891
     5
     6        Reviewed by Darin Adler.
     7
     8        Remove CSSCharsetRule from the CSS OM. All other browser engines have made this
     9        change. This eliminates the weird overloading of isCharsetRule to match both
     10        CSSCharsetRule and StyleRuleCharset (only used by the new parser).
     11
     12        Fix the destroy() method in StyleRuleBase to clean up StyleRuleCharsets created
     13        by the new parser properly.
     14
     15        * CMakeLists.txt:
     16        * DerivedSources.make:
     17        * WebCore.xcodeproj/project.pbxproj:
     18        * bindings/js/JSCSSRuleCustom.cpp:
     19        (WebCore::toJSNewlyCreated):
     20        * css/CSSCharsetRule.cpp: Removed.
     21        * css/CSSCharsetRule.h: Removed.
     22        * css/CSSCharsetRule.idl: Removed.
     23        * css/CSSPropertySourceData.h:
     24        * css/CSSStyleSheet.cpp:
     25        (WebCore::CSSStyleSheet::item):
     26        (WebCore::CSSStyleSheet::rules):
     27        * css/CSSStyleSheet.h:
     28        * css/StyleRule.cpp:
     29        (WebCore::StyleRuleBase::destroy):
     30        * inspector/InspectorStyleSheet.cpp:
     31        (WebCore::asCSSRuleList):
     32
    1332016-10-24  Zan Dobersek  <zdobersek@igalia.com>
    234
  • trunk/Source/WebCore/DerivedSources.make

    r207762 r207767  
    242242    $(WebCore)/crypto/SubtleCrypto.idl \
    243243    $(WebCore)/crypto/WebKitSubtleCrypto.idl \
    244     $(WebCore)/css/CSSCharsetRule.idl \
    245244    $(WebCore)/css/CSSFontFaceLoadEvent.idl \
    246245    $(WebCore)/css/CSSFontFaceRule.idl \
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r207762 r207767  
    39953995                A80E6CF60A1989CA007FB8C5 /* CSSImportRule.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E6CCC0A1989CA007FB8C5 /* CSSImportRule.h */; settings = {ATTRIBUTES = (Private, ); }; };
    39963996                A80E6CF70A1989CA007FB8C5 /* CSSProperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E6CCD0A1989CA007FB8C5 /* CSSProperty.cpp */; };
    3997                 A80E6CF90A1989CA007FB8C5 /* CSSCharsetRule.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E6CCF0A1989CA007FB8C5 /* CSSCharsetRule.h */; settings = {ATTRIBUTES = (Private, ); }; };
    39983997                A80E6CFA0A1989CA007FB8C5 /* CSSImageValue.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E6CD00A1989CA007FB8C5 /* CSSImageValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
    39993998                A80E6CFB0A1989CA007FB8C5 /* Pair.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E6CD10A1989CA007FB8C5 /* Pair.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    51355134                BC4368E80C226E32005EFB5F /* Rect.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4368E70C226E32005EFB5F /* Rect.h */; settings = {ATTRIBUTES = (Private, ); }; };
    51365135                BC46C1EE0C0DDBDF0020CFC3 /* JSCSSRuleCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC46C1ED0C0DDBDF0020CFC3 /* JSCSSRuleCustom.cpp */; };
    5137                 BC46C1FA0C0DDC8F0020CFC3 /* JSCSSCharsetRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC46C1F00C0DDC8F0020CFC3 /* JSCSSCharsetRule.cpp */; };
    5138                 BC46C1FB0C0DDC8F0020CFC3 /* JSCSSCharsetRule.h in Headers */ = {isa = PBXBuildFile; fileRef = BC46C1F10C0DDC8F0020CFC3 /* JSCSSCharsetRule.h */; };
    51395136                BC46C1FC0C0DDC8F0020CFC3 /* JSCSSFontFaceRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC46C1F20C0DDC8F0020CFC3 /* JSCSSFontFaceRule.cpp */; };
    51405137                BC46C1FD0C0DDC8F0020CFC3 /* JSCSSFontFaceRule.h in Headers */ = {isa = PBXBuildFile; fileRef = BC46C1F30C0DDC8F0020CFC3 /* JSCSSFontFaceRule.h */; };
     
    61446141                E1E6EEA40B628DA8005F2F70 /* JSHTMLSelectElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1E6EEA30B628DA8005F2F70 /* JSHTMLSelectElement.cpp */; };
    61456142                E1E6EEA80B628DB3005F2F70 /* JSHTMLSelectElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E1E6EEA70B628DB3005F2F70 /* JSHTMLSelectElement.h */; };
    6146                 E1EBBBD40AAC9B87001FE8E2 /* CSSCharsetRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EBBBD30AAC9B87001FE8E2 /* CSSCharsetRule.cpp */; };
    61476143                E1EC299F0BB04C6B00EA187B /* XPathNodeSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EC299D0BB04C6B00EA187B /* XPathNodeSet.cpp */; };
    61486144                E1EC29A00BB04C6B00EA187B /* XPathNodeSet.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EC299E0BB04C6B00EA187B /* XPathNodeSet.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    1042710423                85C56CA60AA89D5F00D95755 /* CSSPageRule.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CSSPageRule.idl; sourceTree = "<group>"; };
    1042810424                85C56CA90AA89E6600D95755 /* CSSImportRule.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CSSImportRule.idl; sourceTree = "<group>"; };
    10429                 85C56CAC0AA89F8E00D95755 /* CSSCharsetRule.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CSSCharsetRule.idl; sourceTree = "<group>"; };
    1043010425                85C56CAD0AA89FE000D95755 /* CSSUnknownRule.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = CSSUnknownRule.idl; sourceTree = "<group>"; };
    1043110426                85DF2F690AA3C74300AD64C5 /* HTMLCollection.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = HTMLCollection.idl; sourceTree = "<group>"; };
     
    1146211457                A80E6CCD0A1989CA007FB8C5 /* CSSProperty.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSSProperty.cpp; sourceTree = "<group>"; };
    1146311458                A80E6CCE0A1989CA007FB8C5 /* CSSUnknownRule.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSUnknownRule.h; sourceTree = "<group>"; };
    11464                 A80E6CCF0A1989CA007FB8C5 /* CSSCharsetRule.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSCharsetRule.h; sourceTree = "<group>"; };
    1146511459                A80E6CD00A1989CA007FB8C5 /* CSSImageValue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSImageValue.h; sourceTree = "<group>"; };
    1146611460                A80E6CD10A1989CA007FB8C5 /* Pair.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Pair.h; sourceTree = "<group>"; };
     
    1278912783                BC4368E70C226E32005EFB5F /* Rect.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Rect.h; sourceTree = "<group>"; };
    1279012784                BC46C1ED0C0DDBDF0020CFC3 /* JSCSSRuleCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = JSCSSRuleCustom.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
    12791                 BC46C1F00C0DDC8F0020CFC3 /* JSCSSCharsetRule.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSCharsetRule.cpp; sourceTree = "<group>"; };
    12792                 BC46C1F10C0DDC8F0020CFC3 /* JSCSSCharsetRule.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSCSSCharsetRule.h; sourceTree = "<group>"; };
    1279312785                BC46C1F20C0DDC8F0020CFC3 /* JSCSSFontFaceRule.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSFontFaceRule.cpp; sourceTree = "<group>"; };
    1279412786                BC46C1F30C0DDC8F0020CFC3 /* JSCSSFontFaceRule.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSCSSFontFaceRule.h; sourceTree = "<group>"; };
     
    1392713919                E1E6EEA30B628DA8005F2F70 /* JSHTMLSelectElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLSelectElement.cpp; sourceTree = "<group>"; };
    1392813920                E1E6EEA70B628DB3005F2F70 /* JSHTMLSelectElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = JSHTMLSelectElement.h; sourceTree = "<group>"; };
    13929                 E1EBBBD30AAC9B87001FE8E2 /* CSSCharsetRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSCharsetRule.cpp; sourceTree = "<group>"; };
    1393013921                E1EC299D0BB04C6B00EA187B /* XPathNodeSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XPathNodeSet.cpp; sourceTree = "<group>"; };
    1393113922                E1EC299E0BB04C6B00EA187B /* XPathNodeSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPathNodeSet.h; sourceTree = "<group>"; };
     
    1992319914                                930705D709E0C9B700B17FE4 /* JSCounter.cpp */,
    1992419915                                930705D909E0C9BF00B17FE4 /* JSCounter.h */,
    19925                                 BC46C1F00C0DDC8F0020CFC3 /* JSCSSCharsetRule.cpp */,
    19926                                 BC46C1F10C0DDC8F0020CFC3 /* JSCSSCharsetRule.h */,
    1992719916                                BC46C1F20C0DDC8F0020CFC3 /* JSCSSFontFaceRule.cpp */,
    1992819917                                BC46C1F30C0DDC8F0020CFC3 /* JSCSSFontFaceRule.h */,
     
    2279122780                                BC604A420DB5634E00204739 /* CSSCanvasValue.cpp */,
    2279222781                                BC6049CB0DB560C200204739 /* CSSCanvasValue.h */,
    22793                                 E1EBBBD30AAC9B87001FE8E2 /* CSSCharsetRule.cpp */,
    22794                                 A80E6CCF0A1989CA007FB8C5 /* CSSCharsetRule.h */,
    22795                                 85C56CAC0AA89F8E00D95755 /* CSSCharsetRule.idl */,
    2279622782                                BCEA477C097CAAC80094C9E4 /* CSSComputedStyleDeclaration.cpp */,
    2279722783                                BCEA477D097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h */,
     
    2464024626                                49AE2D8F134EE50C0072920A /* CSSCalculationValue.h in Headers */,
    2464124627                                BC6049CC0DB560C200204739 /* CSSCanvasValue.h in Headers */,
    24642                                 A80E6CF90A1989CA007FB8C5 /* CSSCharsetRule.h in Headers */,
    2464324628                                BCEA4790097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h in Headers */,
    2464424629                                9DAC7C551AF2CAA200437C44 /* CSSContentDistributionValue.h in Headers */,
     
    2548225467                                E125F85218283A5600D84CD9 /* JSCryptoKeySerializationJWK.h in Headers */,
    2548325468                                E125F83E182411E700D84CD9 /* JSCryptoOperationData.h in Headers */,
    25484                                 BC46C1FB0C0DDC8F0020CFC3 /* JSCSSCharsetRule.h in Headers */,
    2548525469                                409EBDC316B7F3A600CBA3FC /* JSCSSFontFaceLoadEvent.h in Headers */,
    2548625470                                BC46C1FD0C0DDC8F0020CFC3 /* JSCSSFontFaceRule.h in Headers */,
     
    2840228386                                49AE2D8E134EE50C0072920A /* CSSCalculationValue.cpp in Sources */,
    2840328387                                BC604A430DB5634E00204739 /* CSSCanvasValue.cpp in Sources */,
    28404                                 E1EBBBD40AAC9B87001FE8E2 /* CSSCharsetRule.cpp in Sources */,
    2840528388                                BCEA478F097CAAC80094C9E4 /* CSSComputedStyleDeclaration.cpp in Sources */,
    2840628389                                9DAC7C541AF2CAA100437C44 /* CSSContentDistributionValue.cpp in Sources */,
     
    2915929142                                E125F85118283A5600D84CD9 /* JSCryptoKeySerializationJWK.cpp in Sources */,
    2916029143                                E125F83D182411E700D84CD9 /* JSCryptoOperationData.cpp in Sources */,
    29161                                 BC46C1FA0C0DDC8F0020CFC3 /* JSCSSCharsetRule.cpp in Sources */,
    2916229144                                409EBDC516B7F3CA00CBA3FC /* JSCSSFontFaceLoadEvent.cpp in Sources */,
    2916329145                                BC46C1FC0C0DDC8F0020CFC3 /* JSCSSFontFaceRule.cpp in Sources */,
  • trunk/Source/WebCore/bindings/js/JSCSSRuleCustom.cpp

    r205422 r207767  
    2727#include "JSCSSRule.h"
    2828
    29 #include "CSSCharsetRule.h"
    3029#include "CSSFontFaceRule.h"
    3130#include "CSSImportRule.h"
     
    3635#include "CSSStyleRule.h"
    3736#include "CSSSupportsRule.h"
    38 #include "JSCSSCharsetRule.h"
    3937#include "JSCSSFontFaceRule.h"
    4038#include "JSCSSImportRule.h"
     
    7472    case CSSRule::IMPORT_RULE:
    7573        return createWrapper<CSSImportRule>(globalObject, WTFMove(rule));
    76     case CSSRule::CHARSET_RULE:
    77         return createWrapper<CSSCharsetRule>(globalObject, WTFMove(rule));
    7874    case CSSRule::KEYFRAME_RULE:
    7975        return createWrapper<CSSKeyframeRule>(globalObject, WTFMove(rule));
  • trunk/Source/WebCore/css/CSSPropertySourceData.h

    r201290 r207767  
    8484        UNKNOWN_RULE,
    8585        STYLE_RULE,
    86         CHARSET_RULE,
    8786        IMPORT_RULE,
    8887        MEDIA_RULE,
  • trunk/Source/WebCore/css/CSSStyleSheet.cpp

    r207669 r207767  
    2222#include "CSSStyleSheet.h"
    2323
    24 #include "CSSCharsetRule.h"
    2524#include "CSSFontFaceRule.h"
    2625#include "CSSImportRule.h"
     
    246245   
    247246    RefPtr<CSSRule>& cssRule = m_childRuleCSSOMWrappers[index];
    248     if (!cssRule) {
    249         if (index == 0 && m_contents->hasCharsetRule()) {
    250             ASSERT(!m_contents->ruleAt(0));
    251             cssRule = CSSCharsetRule::create(this, m_contents->encodingFromCharsetRule());
    252         } else
    253             cssRule = m_contents->ruleAt(index)->createCSSOMWrapper(this);
    254     }
     247    if (!cssRule)
     248        cssRule = m_contents->ruleAt(index)->createCSSOMWrapper(this);
    255249    return cssRule.get();
    256250}
     
    275269        return nullptr;
    276270    // IE behavior.
    277     RefPtr<StaticCSSRuleList> nonCharsetRules = StaticCSSRuleList::create();
     271    RefPtr<StaticCSSRuleList> ruleList = StaticCSSRuleList::create();
    278272    unsigned ruleCount = length();
    279     for (unsigned i = 0; i < ruleCount; ++i) {
    280         CSSRule* rule = item(i);
    281         if (rule->type() == CSSRule::CHARSET_RULE)
    282             continue;
    283         nonCharsetRules->rules().append(rule);
    284     }
    285     return nonCharsetRules;
     273    for (unsigned i = 0; i < ruleCount; ++i)
     274        ruleList->rules().append(item(i));
     275    return ruleList;
    286276}
    287277
  • trunk/Source/WebCore/css/CSSStyleSheet.h

    r207396 r207767  
    3333namespace WebCore {
    3434
    35 class CSSCharsetRule;
    3635class CSSImportRule;
    3736class CSSParser;
  • trunk/Source/WebCore/css/StyleRule.cpp

    r207677 r207767  
    2323#include "StyleRule.h"
    2424
    25 #include "CSSCharsetRule.h"
    2625#include "CSSFontFaceRule.h"
    2726#include "CSSImportRule.h"
     
    9796        delete downcast<StyleKeyframe>(this);
    9897        return;
     98    case Charset:
     99        delete downcast<StyleRuleCharset>(this);
     100        return;
    99101    case Unknown:
    100     case Charset:
    101102#if !ENABLE(CSS_REGIONS)
    102103    case Region:
  • trunk/Source/WebCore/css/StyleRule.h

    r207677 r207767  
    351351SPECIALIZE_TYPE_TRAITS_END()
    352352
     353SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::StyleRuleCharset)
     354static bool isType(const WebCore::StyleRuleBase& rule) { return rule.isCharsetRule(); }
     355SPECIALIZE_TYPE_TRAITS_END()
     356
  • trunk/Source/WebCore/css/StyleSheetContents.cpp

    r206641 r207767  
    161161   
    162162    unsigned childVectorIndex = index;
    163     if (hasCharsetRule()) {
    164         if (index == 0)
    165             return 0;
    166         --childVectorIndex;
    167     }
    168163    if (childVectorIndex < m_importRules.size())
    169164        return m_importRules[childVectorIndex].get();
     
    176171{
    177172    unsigned result = 0;
    178     result += hasCharsetRule() ? 1 : 0;
    179173    result += m_importRules.size();
    180174    result += m_childRules.size();
     
    213207   
    214208    unsigned childVectorIndex = index;
    215     // m_childRules does not contain @charset which is always in index 0 if it exists.
    216     if (hasCharsetRule()) {
    217         if (childVectorIndex == 0) {
    218             // Nothing can be inserted before @charset.
    219             return false;
    220         }
    221         --childVectorIndex;
    222     }
    223    
    224209    if (childVectorIndex < m_importRules.size() || (childVectorIndex == m_importRules.size() && rule->isImportRule())) {
    225210        // Inserting non-import rule before @import is not allowed.
     
    251236
    252237    unsigned childVectorIndex = index;
    253     if (hasCharsetRule()) {
    254         if (childVectorIndex == 0) {
    255             clearCharsetRule();
    256             return;
    257         }
    258         --childVectorIndex;
    259     }
    260238    if (childVectorIndex < m_importRules.size()) {
    261239        m_importRules[childVectorIndex]->clearParentStyleSheet();
  • trunk/Source/WebCore/css/StyleSheetContents.h

    r206641 r207767  
    101101    void clearRules();
    102102
    103     bool hasCharsetRule() const { return !m_encodingFromCharsetRule.isNull(); }
    104103    String encodingFromCharsetRule() const { return m_encodingFromCharsetRule; }
    105104    // Rules other than @charset and @import.
  • trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp

    r207396 r207767  
    196196    RefPtr<StaticCSSRuleList> list = StaticCSSRuleList::create();
    197197    Vector<RefPtr<CSSRule>>& listRules = list->rules();
    198     for (unsigned i = 0, size = styleSheet->length(); i < size; ++i) {
    199         CSSRule* item = styleSheet->item(i);
    200         if (item->type() == CSSRule::CHARSET_RULE)
    201             continue;
    202         listRules.append(item);
    203     }
     198    for (unsigned i = 0, size = styleSheet->length(); i < size; ++i)
     199        listRules.append(styleSheet->item(i));
    204200    return WTFMove(list);
    205201}
  • trunk/Source/WebKit/mac/ChangeLog

    r207762 r207767  
     12016-10-24  Dave Hyatt  <hyatt@apple.com>
     2
     3        Remove CSSCharsetRule from the CSS OM
     4        https://bugs.webkit.org/show_bug.cgi?id=163891
     5
     6        Reviewed by Darin Adler.
     7
     8        * DOM/DOMCSSCharsetRule.mm:
     9        (-[DOMCSSCharsetRule encoding]):
     10
    1112016-10-24  Youenn Fablet  <youenn@apple.com>
    212
  • trunk/Source/WebKit/mac/DOM/DOMCSSCharsetRule.mm

    r204717 r207767  
    2626#import "DOMCSSCharsetRule.h"
    2727
    28 #import <WebCore/CSSCharsetRule.h>
    2928#import "DOMCSSRuleInternal.h"
    3029#import "DOMNodeInternal.h"
     
    3635#import <wtf/GetPtr.h>
    3736
    38 #define IMPL static_cast<WebCore::CSSCharsetRule*>(reinterpret_cast<WebCore::CSSRule*>(_internal))
    39 
    4037@implementation DOMCSSCharsetRule
    4138
     
    4340{
    4441    WebCore::JSMainThreadNullState state;
    45     return IMPL->encoding();
     42
     43    // This has been removed from the CSS OM, so we're just keeping this around to not crash.
     44    return nil;
    4645}
    4746
Note: See TracChangeset for help on using the changeset viewer.