summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphilipj@opera.com <philipj@opera.com>2014-12-02 12:06:53 +0000
committerphilipj@opera.com <philipj@opera.com>2014-12-02 12:06:53 +0000
commit6264b029e7d36d1591415ee670878759d7e52923 (patch)
tree6d2765f847b6bcdf4eb505b0c521c37b13d134ea
parent89f8dcb065f465f2a6c990e778b2c5a4de4ae688 (diff)
downloadchromium_src-6264b029e7d36d1591415ee670878759d7e52923.zip
chromium_src-6264b029e7d36d1591415ee670878759d7e52923.tar.gz
chromium_src-6264b029e7d36d1591415ee670878759d7e52923.tar.bz2
Remove CSSCharsetRule
Intent to Deprecate and Remove: https://groups.google.com/a/chromium.org/d/msg/blink-dev/lwq9fhV5uF8/ikrrc76SvG4J BUG=438147 Review URL: https://codereview.chromium.org/756313002 git-svn-id: svn://svn.chromium.org/blink/trunk@186292 bbb929c8-8fbe-4397-9dbb-9b2b20218538
-rw-r--r--third_party/WebKit/LayoutTests/fast/dom/Window/resources/window-properties.js1
-rw-r--r--third_party/WebKit/LayoutTests/fast/dom/Window/window-lookup-precedence-expected.txt2
-rw-r--r--third_party/WebKit/LayoutTests/fast/dom/Window/window-property-shadowing-expected.txt1
-rw-r--r--third_party/WebKit/LayoutTests/fast/dom/Window/window-property-shadowing.html2
-rw-r--r--third_party/WebKit/LayoutTests/fast/dom/css-element-attribute-js-null-expected.txt2
-rw-r--r--third_party/WebKit/LayoutTests/fast/dom/css-element-attribute-js-null.html11
-rw-r--r--third_party/WebKit/LayoutTests/fast/dom/dom-constructors-expected.txt1
-rw-r--r--third_party/WebKit/LayoutTests/fast/dom/dom-constructors.html1
-rw-r--r--third_party/WebKit/LayoutTests/fast/dom/resources/wrapper-identity-base.js1
-rw-r--r--third_party/WebKit/LayoutTests/fast/dom/wrapper-classes.html1
-rw-r--r--third_party/WebKit/LayoutTests/fast/dom/wrapper-identity-expected.txt1
-rw-r--r--third_party/WebKit/LayoutTests/fast/encoding/css-charset-default.xhtml2
-rw-r--r--third_party/WebKit/LayoutTests/fast/encoding/css-charset-dom-expected.txt7
-rw-r--r--third_party/WebKit/LayoutTests/fast/encoding/css-charset-dom.html32
-rw-r--r--third_party/WebKit/LayoutTests/http/tests/css/resources/shared-stylesheet-mutation.js37
-rw-r--r--third_party/WebKit/LayoutTests/http/tests/css/shared-stylesheet-mutation-expected.txt16
-rw-r--r--third_party/WebKit/LayoutTests/http/tests/css/shared-stylesheet-mutation-preconstruct-expected.txt16
-rw-r--r--third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-constructors-listing-expected.txt1
-rw-r--r--third_party/WebKit/LayoutTests/webexposed/global-constructors-listing-expected.txt1
-rw-r--r--third_party/WebKit/Source/core/core.gypi3
-rw-r--r--third_party/WebKit/Source/core/css/CSSCharsetRule.cpp37
-rw-r--r--third_party/WebKit/Source/core/css/CSSCharsetRule.h59
-rw-r--r--third_party/WebKit/Source/core/css/CSSCharsetRule.idl23
-rw-r--r--third_party/WebKit/Source/core/css/CSSGroupingRule.cpp5
-rw-r--r--third_party/WebKit/Source/core/css/CSSStyleSheet.cpp23
-rw-r--r--third_party/WebKit/Source/core/css/StyleRule.h1
-rw-r--r--third_party/WebKit/Source/core/css/StyleSheetContents.cpp87
-rw-r--r--third_party/WebKit/Source/core/css/StyleSheetContents.h7
-rw-r--r--third_party/WebKit/Source/core/css/parser/CSSGrammar.y18
-rw-r--r--third_party/WebKit/Source/core/frame/UseCounter.h1
30 files changed, 48 insertions, 352 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/resources/window-properties.js b/third_party/WebKit/LayoutTests/fast/dom/Window/resources/window-properties.js
index 0c20763..b722e9b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/resources/window-properties.js
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/resources/window-properties.js
@@ -33,7 +33,6 @@ var propertyInfo = [
["Attr", "object"],
["CDATASection", "object"],
- ["CSSCharsetRule", "object"],
["CSSFontFaceRule", "object"],
["CSSImportRule", "object"],
["CSSMediaRule", "object"],
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-lookup-precedence-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-lookup-precedence-expected.txt
index 70bc7fe..ae6f835 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-lookup-precedence-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-lookup-precedence-expected.txt
@@ -68,8 +68,6 @@ PASS 'function Attr() { [native code] }' is 'function Attr() { [native code] }'
PASS 'function Attr() { [native code] }' is 'function Attr() { [native code] }'
PASS 'function CDATASection() { [native code] }' is 'function CDATASection() { [native code] }'
PASS 'function CDATASection() { [native code] }' is 'function CDATASection() { [native code] }'
-PASS 'function CSSCharsetRule() { [native code] }' is 'function CSSCharsetRule() { [native code] }'
-PASS 'function CSSCharsetRule() { [native code] }' is 'function CSSCharsetRule() { [native code] }'
PASS 'function CSSFontFaceRule() { [native code] }' is 'function CSSFontFaceRule() { [native code] }'
PASS 'function CSSFontFaceRule() { [native code] }' is 'function CSSFontFaceRule() { [native code] }'
PASS 'function CSSImportRule() { [native code] }' is 'function CSSImportRule() { [native code] }'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-property-shadowing-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-property-shadowing-expected.txt
index 2e71a03..1b415c8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-property-shadowing-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-property-shadowing-expected.txt
@@ -65,7 +65,6 @@ PASS: XSLTProcessor successfully shadowed
PASS: StyleSheet successfully shadowed
PASS: CSSStyleSheet successfully shadowed
PASS: CSSRule successfully shadowed
-PASS: CSSCharsetRule successfully shadowed
PASS: CSSFontFaceRule successfully shadowed
PASS: CSSImportRule successfully shadowed
PASS: CSSMediaRule successfully shadowed
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-property-shadowing.html b/third_party/WebKit/LayoutTests/fast/dom/Window/window-property-shadowing.html
index 53bb0f2..1aaa9f1 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-property-shadowing.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-property-shadowing.html
@@ -153,8 +153,6 @@
log(CSSStyleSheet == 1 ? "PASS: CSSStyleSheet successfully shadowed" : "FAIL: CSSStyleSheet was not shadowed");
var CSSRule = 1;
log(CSSRule == 1 ? "PASS: CSSRule successfully shadowed" : "FAIL: CSSRule was not shadowed");
- var CSSCharsetRule = 1;
- log(CSSCharsetRule == 1 ? "PASS: CSSCharsetRule successfully shadowed" : "FAIL: CSSCharsetRule was not shadowed");
var CSSFontFaceRule = 1;
log(CSSFontFaceRule == 1 ? "PASS: CSSFontFaceRule successfully shadowed" : "FAIL: CSSFontFaceRule was not shadowed");
var CSSImportRule = 1;
diff --git a/third_party/WebKit/LayoutTests/fast/dom/css-element-attribute-js-null-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/css-element-attribute-js-null-expected.txt
index f7ec71d..4980e3c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/css-element-attribute-js-null-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/css-element-attribute-js-null-expected.txt
@@ -2,8 +2,6 @@ This test setting various attributes of a CSSOM elements to JavaScript null.
TEST SUCCEEDED: The value was the string '.foo { color: black; }'. [tested CSSRule.cssText]
-TEST SUCCEEDED: The value was the string 'null'. [tested CSSCharsetRule.encoding]
-
TEST SUCCEEDED: The value was the string 'null'. [tested CSSKeyframesRule.name]
TEST SUCCEEDED: The value was the string '@page null'. [tested CSSPageRule.selectorText]
diff --git a/third_party/WebKit/LayoutTests/fast/dom/css-element-attribute-js-null.html b/third_party/WebKit/LayoutTests/fast/dom/css-element-attribute-js-null.html
index d5e0c64..8b2209f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/css-element-attribute-js-null.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/css-element-attribute-js-null.html
@@ -12,9 +12,6 @@
@keyframes name { }
@page { }
</style>
- <!-- @charset must be the first rule per spec, and additionally
- with no leading whitespace per our parser. -->
- <style>@charset "UTF-8";</style>
<script>
function printOut(msg) {
var console = document.getElementById("console");
@@ -58,7 +55,6 @@
var mediaRule = rules[1];
var keyframesRule = rules[2];
var pageRule = rules[3];
- var charsetRule = document.styleSheets[2].cssRules[0];
var style = rule.style;
var mediaList = mediaRule.media;
@@ -72,13 +68,6 @@
]
},
{
- type: 'CSSCharsetRule',
- elementToUse: charsetRule,
- attributes: [
- {name: 'encoding', expectedNull: 'null'}
- ]
- },
- {
type: 'CSSKeyframesRule',
elementToUse: keyframesRule,
attributes: [
diff --git a/third_party/WebKit/LayoutTests/fast/dom/dom-constructors-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/dom-constructors-expected.txt
index 313acd9..cf01eea 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/dom-constructors-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/dom-constructors-expected.txt
@@ -69,7 +69,6 @@ PASS TryAllocate('HTMLTitleElement') is 'exception'
PASS TryAllocate('HTMLUListElement') is 'exception'
PASS TryAllocate('HTMLElement') is 'exception'
PASS TryAllocate('CanvasRenderingContext2D') is 'exception'
-PASS TryAllocate('CSSCharsetRule') is 'exception'
PASS TryAllocate('CSSFontFaceRule') is 'exception'
PASS TryAllocate('CSSImportRule') is 'exception'
PASS TryAllocate('CSSMediaRule') is 'exception'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/dom-constructors.html b/third_party/WebKit/LayoutTests/fast/dom/dom-constructors.html
index 6054636..7913d3f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/dom-constructors.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/dom-constructors.html
@@ -79,7 +79,6 @@ var objects_exception = [
'HTMLUListElement',
'HTMLElement',
'CanvasRenderingContext2D',
- 'CSSCharsetRule',
'CSSFontFaceRule',
'CSSImportRule',
'CSSMediaRule',
diff --git a/third_party/WebKit/LayoutTests/fast/dom/resources/wrapper-identity-base.js b/third_party/WebKit/LayoutTests/fast/dom/resources/wrapper-identity-base.js
index 7b03a91..6c5e786 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/resources/wrapper-identity-base.js
+++ b/third_party/WebKit/LayoutTests/fast/dom/resources/wrapper-identity-base.js
@@ -3,7 +3,6 @@ var staticWindowProperties = [
'CSSPrimitiveValue',
'CSSRule',
'CSSStyleDeclaration',
- 'CSSCharsetRule',
'CSSImportRule',
'CSSMediaRule',
'CSSFontFaceRule',
diff --git a/third_party/WebKit/LayoutTests/fast/dom/wrapper-classes.html b/third_party/WebKit/LayoutTests/fast/dom/wrapper-classes.html
index b7c5ec3..768daed 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/wrapper-classes.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/wrapper-classes.html
@@ -263,7 +263,6 @@ function runTest()
// Not yet tested:
- // CSSCharsetRule
// CSSFontFaceRule
// CSSImportRule
// CSSMediaRule
diff --git a/third_party/WebKit/LayoutTests/fast/dom/wrapper-identity-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/wrapper-identity-expected.txt
index 7aafa3e..f6540a0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/wrapper-identity-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/wrapper-identity-expected.txt
@@ -14,7 +14,6 @@ PASS var object = new String(); isEqualJS(object, object); is true
PASS var object = window['CSSPrimitiveValue']; isEqualJS(object, object); is true
PASS var object = window['CSSRule']; isEqualJS(object, object); is true
PASS var object = window['CSSStyleDeclaration']; isEqualJS(object, object); is true
-PASS var object = window['CSSCharsetRule']; isEqualJS(object, object); is true
PASS var object = window['CSSImportRule']; isEqualJS(object, object); is true
PASS var object = window['CSSMediaRule']; isEqualJS(object, object); is true
PASS var object = window['CSSFontFaceRule']; isEqualJS(object, object); is true
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/css-charset-default.xhtml b/third_party/WebKit/LayoutTests/fast/encoding/css-charset-default.xhtml
index e44077e..42484c85 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/css-charset-default.xhtml
+++ b/third_party/WebKit/LayoutTests/fast/encoding/css-charset-default.xhtml
@@ -33,7 +33,7 @@ function test() {
document.getElementById("res2").innerHTML += document.styleSheets[1].cssRules[0].style.content;
- document.getElementById("res3").innerHTML += document.styleSheets[2].cssRules[1].styleSheet.cssRules[0].style.content;
+ document.getElementById("res3").innerHTML += document.styleSheets[2].cssRules[0].styleSheet.cssRules[0].style.content;
document.getElementById("res4").innerHTML += document.styleSheets[3].cssRules[0].styleSheet.cssRules[0].style.content;
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/css-charset-dom-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/css-charset-dom-expected.txt
deleted file mode 100644
index 3e68c0a..0000000
--- a/third_party/WebKit/LayoutTests/fast/encoding/css-charset-dom-expected.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Test for bug 10676: @charset rules not accessible via DOM
-
-cssText: @charset "utf-8";
-encoding: utf-8
-Resetting encoding...
-cssText: @charset "koi8-r";
-encoding: koi8-r
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/css-charset-dom.html b/third_party/WebKit/LayoutTests/fast/encoding/css-charset-dom.html
deleted file mode 100644
index b22372a..0000000
--- a/third_party/WebKit/LayoutTests/fast/encoding/css-charset-dom.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<html>
-<head>
- <meta content="text/html; charset=windows-1251" http-equiv="Content-Type"/>
- <link rel="stylesheet" type="text/css" href="css-charset.css" charset="windows-1251">
- <!-- The document charset and link charset have lower priority than @charset, so they
- shouldn't affect anything. -->
-</head>
-<body onload="test()">
-<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=10676">bug 10676</a>:
-@charset rules not accessible via DOM</p>
-
-<p id="result"></p>
-
-<script>
-if (window.testRunner)
- testRunner.dumpAsText();
-
-function test() {
- try {
- charsetRule = document.styleSheets[0].cssRules[0];
- document.getElementById("result").innerHTML = "cssText: " + charsetRule.cssText + "<br>encoding: " + charsetRule.encoding;
- document.getElementById("result").innerHTML += "<br>Resetting encoding...";
- charsetRule.encoding = "koi8-r";
- document.getElementById("result").innerHTML += "<br>cssText: " + charsetRule.cssText + "<br>encoding: " + charsetRule.encoding;
- } catch (ex) {
- document.getElementById("result").textContent = ex.toString();
- }
-}
-</script>
-
-</body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/css/resources/shared-stylesheet-mutation.js b/third_party/WebKit/LayoutTests/http/tests/css/resources/shared-stylesheet-mutation.js
index 85afd4e..463df00 100644
--- a/third_party/WebKit/LayoutTests/http/tests/css/resources/shared-stylesheet-mutation.js
+++ b/third_party/WebKit/LayoutTests/http/tests/css/resources/shared-stylesheet-mutation.js
@@ -77,27 +77,26 @@ function executeTests(createCSSOMObjectBeforeTest)
mutationTest(0, '', 'red');
- mutationTest(1, 'sheet.insertRule("#testdiv { background-color: green; }", 3)', 'green');
- mutationTest(2, 'sheet.deleteRule(2)');
- mutationTest(3, 'sheet.cssRules[2].insertRule("#testdiv { background-color: green; }", 1)', 'green');
- mutationTest(4, 'sheet.cssRules[2].deleteRule(0)', 'green');
- mutationTest(5, 'sheet.cssRules[2].cssRules[0].style.setProperty("background-color", "green", "")', 'green');
- mutationTest(6, 'sheet.cssRules[2].cssRules[0].style.removeProperty("background-color")', 'green');
- mutationTest(7, 'sheet.cssRules[2].cssRules[0].style.cssText = "background-color: green"', 'green');
- mutationTest(8, 'sheet.cssRules[2].cssRules[0].selectorText = "#dontmatch"', 'green');
- mutationTest(9, 'sheet.cssRules[2].media.mediaText = "print"', 'green');
+ mutationTest(1, 'sheet.insertRule("#testdiv { background-color: green; }", 2)', 'green');
+ mutationTest(2, 'sheet.deleteRule(1)');
+ mutationTest(3, 'sheet.cssRules[1].insertRule("#testdiv { background-color: green; }", 1)', 'green');
+ mutationTest(4, 'sheet.cssRules[1].deleteRule(0)', 'green');
+ mutationTest(5, 'sheet.cssRules[1].cssRules[0].style.setProperty("background-color", "green", "")', 'green');
+ mutationTest(6, 'sheet.cssRules[1].cssRules[0].style.removeProperty("background-color")', 'green');
+ mutationTest(7, 'sheet.cssRules[1].cssRules[0].style.cssText = "background-color: green"', 'green');
+ mutationTest(8, 'sheet.cssRules[1].cssRules[0].selectorText = "#dontmatch"', 'green');
+ mutationTest(9, 'sheet.cssRules[1].media.mediaText = "print"', 'green');
var testString = '\
- sheet.cssRules[2].media.appendMedium("print");\
- sheet.cssRules[2].media.deleteMedium("all");\
+ sheet.cssRules[1].media.appendMedium("print");\
+ sheet.cssRules[1].media.deleteMedium("all");\
';
mutationTest(10, testString, 'green');
var testString = '\
- sheet.deleteRule(3);\
- sheet.insertRule("#testdiv { background-color: green; }", 1);\
sheet.deleteRule(2);\
- sheet.deleteRule(0);\
+ sheet.insertRule("#testdiv { background-color: green; }", 0);\
+ sheet.deleteRule(1);\
sheet.deleteRule(3);\
sheet.deleteRule(1);\
sheet.deleteRule(1);\
@@ -105,12 +104,12 @@ function executeTests(createCSSOMObjectBeforeTest)
mutationTest(11, testString, 'green');
var importRule = '@import "data:text/css;charset=utf-8,%23testdiv%7Bbackground-color%3Agreen%20!important%7D";';
- mutationTest(12, "sheet.insertRule('"+importRule+"', 1)", 'green');
+ mutationTest(12, "sheet.insertRule('"+importRule+"', 0)", 'green');
- mutationTest(13, 'sheet.cssRules[3].selectorText = "foo"', 'red');
- mutationTest(14, 'sheet.cssRules[4].insertRule("40% { left: 40px; }")', 'red');
- mutationTest(15, 'sheet.cssRules[4].deleteRule("100%")', 'red');
- mutationTest(16, 'sheet.cssRules[5].style.setProperty("font-family", "Bar", "")', 'red');
+ mutationTest(13, 'sheet.cssRules[2].selectorText = "foo"', 'red');
+ mutationTest(14, 'sheet.cssRules[3].insertRule("40% { left: 40px; }")', 'red');
+ mutationTest(15, 'sheet.cssRules[3].deleteRule("100%")', 'red');
+ mutationTest(16, 'sheet.cssRules[4].style.setProperty("font-family", "Bar", "")', 'red');
setTimeout(finishedTests, 80);
}
diff --git a/third_party/WebKit/LayoutTests/http/tests/css/shared-stylesheet-mutation-expected.txt b/third_party/WebKit/LayoutTests/http/tests/css/shared-stylesheet-mutation-expected.txt
index 99c4fb1..9e97cb4 100644
--- a/third_party/WebKit/LayoutTests/http/tests/css/shared-stylesheet-mutation-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/css/shared-stylesheet-mutation-expected.txt
@@ -7,7 +7,6 @@ Test 0
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(255, 0, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
#testdiv { background-color: red; }
@@ -23,7 +22,6 @@ Test 1
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
#testdiv { background-color: red; }
@@ -40,7 +38,6 @@ Test 2
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@page :right { margin-left: 3cm; }
@-webkit-keyframes bounce {
@@ -53,7 +50,6 @@ Test 3
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
#testdiv { background-color: red; }
@@ -70,7 +66,6 @@ Test 4
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
}
@@ -85,7 +80,6 @@ Test 5
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
#testdiv { background-color: green; }
@@ -101,7 +95,6 @@ Test 6
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
#testdiv { }
@@ -117,7 +110,6 @@ Test 7
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
#testdiv { background-color: green; }
@@ -133,7 +125,6 @@ Test 8
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
#dontmatch { background-color: red; }
@@ -149,7 +140,6 @@ Test 9
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media print {
#testdiv { background-color: red; }
@@ -165,7 +155,6 @@ Test 10
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media print {
#testdiv { background-color: red; }
@@ -187,7 +176,6 @@ Test 12
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
-@charset "utf-8";
@import url("data:text/css;charset=utf-8,%23testdiv%7Bbackground-color%3Agreen%20!important%7D");
#testdiv { background-color: green; }
@media all {
@@ -204,7 +192,6 @@ Test 13
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(255, 0, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
#testdiv { background-color: red; }
@@ -220,7 +207,6 @@ Test 14
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(255, 0, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
#testdiv { background-color: red; }
@@ -237,7 +223,6 @@ Test 15
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(255, 0, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
#testdiv { background-color: red; }
@@ -252,7 +237,6 @@ Test 16
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(255, 0, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
#testdiv { background-color: red; }
diff --git a/third_party/WebKit/LayoutTests/http/tests/css/shared-stylesheet-mutation-preconstruct-expected.txt b/third_party/WebKit/LayoutTests/http/tests/css/shared-stylesheet-mutation-preconstruct-expected.txt
index 99c4fb1..9e97cb4 100644
--- a/third_party/WebKit/LayoutTests/http/tests/css/shared-stylesheet-mutation-preconstruct-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/css/shared-stylesheet-mutation-preconstruct-expected.txt
@@ -7,7 +7,6 @@ Test 0
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(255, 0, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
#testdiv { background-color: red; }
@@ -23,7 +22,6 @@ Test 1
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
#testdiv { background-color: red; }
@@ -40,7 +38,6 @@ Test 2
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@page :right { margin-left: 3cm; }
@-webkit-keyframes bounce {
@@ -53,7 +50,6 @@ Test 3
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
#testdiv { background-color: red; }
@@ -70,7 +66,6 @@ Test 4
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
}
@@ -85,7 +80,6 @@ Test 5
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
#testdiv { background-color: green; }
@@ -101,7 +95,6 @@ Test 6
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
#testdiv { }
@@ -117,7 +110,6 @@ Test 7
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
#testdiv { background-color: green; }
@@ -133,7 +125,6 @@ Test 8
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
#dontmatch { background-color: red; }
@@ -149,7 +140,6 @@ Test 9
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media print {
#testdiv { background-color: red; }
@@ -165,7 +155,6 @@ Test 10
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media print {
#testdiv { background-color: red; }
@@ -187,7 +176,6 @@ Test 12
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(0, 128, 0)'
-@charset "utf-8";
@import url("data:text/css;charset=utf-8,%23testdiv%7Bbackground-color%3Agreen%20!important%7D");
#testdiv { background-color: green; }
@media all {
@@ -204,7 +192,6 @@ Test 13
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(255, 0, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
#testdiv { background-color: red; }
@@ -220,7 +207,6 @@ Test 14
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(255, 0, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
#testdiv { background-color: red; }
@@ -237,7 +223,6 @@ Test 15
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(255, 0, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
#testdiv { background-color: red; }
@@ -252,7 +237,6 @@ Test 16
--------------------------------------
PASS getComputedStyle(testElement, null).getPropertyValue('background-color') is 'rgb(255, 0, 0)'
-@charset "utf-8";
#testdiv { background-color: green; }
@media all {
#testdiv { background-color: red; }
diff --git a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-constructors-listing-expected.txt b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-constructors-listing-expected.txt
index 51c57cd..f3b7166 100644
--- a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-constructors-listing-expected.txt
+++ b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-constructors-listing-expected.txt
@@ -36,7 +36,6 @@ BiquadFilterNode
Blob
Boolean
CDATASection
-CSSCharsetRule
CSSFontFaceRule
CSSImportRule
CSSKeyframeRule
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-constructors-listing-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-constructors-listing-expected.txt
index b1909bf..574a3c2 100644
--- a/third_party/WebKit/LayoutTests/webexposed/global-constructors-listing-expected.txt
+++ b/third_party/WebKit/LayoutTests/webexposed/global-constructors-listing-expected.txt
@@ -43,7 +43,6 @@ BiquadFilterNode
Blob
Boolean
CDATASection
-CSSCharsetRule
CSSFontFaceRule
CSSImportRule
CSSKeyframeRule
diff --git a/third_party/WebKit/Source/core/core.gypi b/third_party/WebKit/Source/core/core.gypi
index 105299e..0ace36e 100644
--- a/third_party/WebKit/Source/core/core.gypi
+++ b/third_party/WebKit/Source/core/core.gypi
@@ -14,7 +14,6 @@
'clipboard/DataTransfer.idl',
'clipboard/DataTransferItemList.idl',
'css/CSS.idl',
- 'css/CSSCharsetRule.idl',
'css/CSSFontFaceRule.idl',
'css/CSSImportRule.idl',
'css/CSSKeyframeRule.idl',
@@ -672,8 +671,6 @@
'css/CSSCalculationValue.h',
'css/CSSCanvasValue.cpp',
'css/CSSCanvasValue.h',
- 'css/CSSCharsetRule.cpp',
- 'css/CSSCharsetRule.h',
'css/CSSComputedStyleDeclaration.cpp',
'css/CSSContentDistributionValue.cpp',
'css/CSSContentDistributionValue.h',
diff --git a/third_party/WebKit/Source/core/css/CSSCharsetRule.cpp b/third_party/WebKit/Source/core/css/CSSCharsetRule.cpp
deleted file mode 100644
index 857462c..0000000
--- a/third_party/WebKit/Source/core/css/CSSCharsetRule.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2006, 2008, 2012 Apple Inc. All rights reserved.
- * Copyright (C) 2006 Alexey Proskuryakov (ap@macrules.ru)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "core/css/CSSCharsetRule.h"
-
-namespace blink {
-
-CSSCharsetRule::CSSCharsetRule(CSSStyleSheet* parent, const String& encoding)
- : CSSRule(parent)
- , m_encoding(encoding)
-{
-}
-
-String CSSCharsetRule::cssText() const
-{
- return "@charset \"" + m_encoding + "\";";
-}
-
-} // namespace blink
diff --git a/third_party/WebKit/Source/core/css/CSSCharsetRule.h b/third_party/WebKit/Source/core/css/CSSCharsetRule.h
deleted file mode 100644
index e6a0425..0000000
--- a/third_party/WebKit/Source/core/css/CSSCharsetRule.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * (C) 1999-2003 Lars Knoll (knoll@kde.org)
- * (C) 2002-2003 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2002, 2006, 2008, 2012 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef CSSCharsetRule_h
-#define CSSCharsetRule_h
-
-#include "core/css/CSSRule.h"
-
-namespace blink {
-
-class CSSCharsetRule final : public CSSRule {
- DEFINE_WRAPPERTYPEINFO();
-public:
- static PassRefPtrWillBeRawPtr<CSSCharsetRule> create(CSSStyleSheet* parent, const String& encoding)
- {
- return adoptRefWillBeNoop(new CSSCharsetRule(parent, encoding));
- }
-
- virtual ~CSSCharsetRule() { }
-
- virtual String cssText() const override;
- virtual void reattach(StyleRuleBase* rule) override { ASSERT_UNUSED(rule, !rule); }
-
- const String& encoding() const { return m_encoding; }
- void setEncoding(const String& encoding) { m_encoding = encoding; }
-
- virtual void trace(Visitor* visitor) override { CSSRule::trace(visitor); }
-
-private:
- CSSCharsetRule(CSSStyleSheet* parent, const String& encoding);
-
- virtual CSSRule::Type type() const override { return CHARSET_RULE; }
-
- String m_encoding;
-};
-
-DEFINE_CSS_RULE_TYPE_CASTS(CSSCharsetRule, CHARSET_RULE);
-
-} // namespace blink
-
-#endif // CSSCharsetRule_h
diff --git a/third_party/WebKit/Source/core/css/CSSCharsetRule.idl b/third_party/WebKit/Source/core/css/CSSCharsetRule.idl
deleted file mode 100644
index 1635a71..0000000
--- a/third_party/WebKit/Source/core/css/CSSCharsetRule.idl
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
- * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-interface CSSCharsetRule : CSSRule {
- [MeasureAs=CSSCharsetRuleEncoding] attribute DOMString encoding;
-};
diff --git a/third_party/WebKit/Source/core/css/CSSGroupingRule.cpp b/third_party/WebKit/Source/core/css/CSSGroupingRule.cpp
index b19fe9a..d4138f4 100644
--- a/third_party/WebKit/Source/core/css/CSSGroupingRule.cpp
+++ b/third_party/WebKit/Source/core/css/CSSGroupingRule.cpp
@@ -77,9 +77,8 @@ unsigned CSSGroupingRule::insertRule(const String& ruleString, unsigned index, E
}
if (newRule->isImportRule()) {
- // FIXME: an HierarchyRequestError should also be thrown for a @charset or a nested
- // @media rule. They are currently not getting parsed, resulting in a SyntaxError
- // to get raised above.
+ // FIXME: an HierarchyRequestError should also be thrown for a nested @media rule. They are
+ // currently not getting parsed, resulting in a SyntaxError to get raised above.
exceptionState.throwDOMException(HierarchyRequestError, "'@import' rules cannot be inserted inside a group rule.");
return 0;
}
diff --git a/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp b/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp
index 705d328..41ae5b8 100644
--- a/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp
+++ b/third_party/WebKit/Source/core/css/CSSStyleSheet.cpp
@@ -26,7 +26,6 @@
#include "bindings/core/v8/V8PerIsolateData.h"
#include "core/HTMLNames.h"
#include "core/SVGNames.h"
-#include "core/css/CSSCharsetRule.h"
#include "core/css/CSSImportRule.h"
#include "core/css/CSSRuleList.h"
#include "core/css/MediaList.h"
@@ -252,13 +251,8 @@ CSSRule* CSSStyleSheet::item(unsigned index)
ASSERT(m_childRuleCSSOMWrappers.size() == ruleCount);
RefPtrWillBeMember<CSSRule>& cssRule = m_childRuleCSSOMWrappers[index];
- if (!cssRule) {
- if (index == 0 && m_contents->hasCharsetRule()) {
- ASSERT(!m_contents->ruleAt(0));
- cssRule = CSSCharsetRule::create(this, m_contents->encodingFromCharsetRule());
- } else
- cssRule = m_contents->ruleAt(index)->createCSSOMWrapper(this);
- }
+ if (!cssRule)
+ cssRule = m_contents->ruleAt(index)->createCSSOMWrapper(this);
return cssRule.get();
}
@@ -287,18 +281,7 @@ bool CSSStyleSheet::canAccessRules() const
PassRefPtrWillBeRawPtr<CSSRuleList> CSSStyleSheet::rules()
{
- if (!canAccessRules())
- return nullptr;
- // IE behavior.
- RefPtrWillBeRawPtr<StaticCSSRuleList> nonCharsetRules(StaticCSSRuleList::create());
- unsigned ruleCount = length();
- for (unsigned i = 0; i < ruleCount; ++i) {
- CSSRule* rule = item(i);
- if (rule->type() == CSSRule::CHARSET_RULE)
- continue;
- nonCharsetRules->rules().append(rule);
- }
- return nonCharsetRules.release();
+ return cssRules();
}
unsigned CSSStyleSheet::insertRule(const String& ruleString, unsigned index, ExceptionState& exceptionState)
diff --git a/third_party/WebKit/Source/core/css/StyleRule.h b/third_party/WebKit/Source/core/css/StyleRule.h
index eab53019..3f473ac 100644
--- a/third_party/WebKit/Source/core/css/StyleRule.h
+++ b/third_party/WebKit/Source/core/css/StyleRule.h
@@ -54,7 +54,6 @@ public:
Type type() const { return static_cast<Type>(m_type); }
- bool isCharsetRule() const { return type() == Charset; }
bool isFontFaceRule() const { return type() == FontFace; }
bool isKeyframesRule() const { return type() == Keyframes; }
bool isMediaRule() const { return type() == Media; }
diff --git a/third_party/WebKit/Source/core/css/StyleSheetContents.cpp b/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
index d942156a..46856cc 100644
--- a/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
+++ b/third_party/WebKit/Source/core/css/StyleSheetContents.cpp
@@ -75,7 +75,6 @@ StyleSheetContents::StyleSheetContents(StyleRuleImport* ownerRule, const String&
StyleSheetContents::StyleSheetContents(const StyleSheetContents& o)
: m_ownerRule(nullptr)
, m_originalURL(o.m_originalURL)
- , m_encodingFromCharsetRule(o.m_encodingFromCharsetRule)
, m_importRules(o.m_importRules.size())
, m_childRules(o.m_childRules.size())
, m_namespaces(o.m_namespaces)
@@ -146,9 +145,8 @@ bool StyleSheetContents::isCacheable() const
void StyleSheetContents::parserAppendRule(PassRefPtrWillBeRawPtr<StyleRuleBase> rule)
{
- ASSERT(!rule->isCharsetRule());
if (rule->isImportRule()) {
- // Parser enforces that @import rules come before anything else except @charset.
+ // Parser enforces that @import rules come before anything else
ASSERT(m_childRules.isEmpty());
StyleRuleImport* importRule = toStyleRuleImport(rule.get());
if (importRule->mediaQueries())
@@ -179,31 +177,16 @@ StyleRuleBase* StyleSheetContents::ruleAt(unsigned index) const
{
ASSERT_WITH_SECURITY_IMPLICATION(index < ruleCount());
- unsigned childVectorIndex = index;
- if (hasCharsetRule()) {
- if (index == 0)
- return 0;
- --childVectorIndex;
- }
- if (childVectorIndex < m_importRules.size())
- return m_importRules[childVectorIndex].get();
+ if (index < m_importRules.size())
+ return m_importRules[index].get();
- childVectorIndex -= m_importRules.size();
- return m_childRules[childVectorIndex].get();
+ index -= m_importRules.size();
+ return m_childRules[index].get();
}
unsigned StyleSheetContents::ruleCount() const
{
- unsigned result = 0;
- result += hasCharsetRule() ? 1 : 0;
- result += m_importRules.size();
- result += m_childRules.size();
- return result;
-}
-
-void StyleSheetContents::clearCharsetRule()
-{
- m_encodingFromCharsetRule = String();
+ return m_importRules.size() + m_childRules.size();
}
void StyleSheetContents::clearRules()
@@ -214,34 +197,14 @@ void StyleSheetContents::clearRules()
}
m_importRules.clear();
m_childRules.clear();
- clearCharsetRule();
-}
-
-void StyleSheetContents::parserSetEncodingFromCharsetRule(const String& encoding)
-{
- // Parser enforces that there is ever only one @charset.
- ASSERT(m_encodingFromCharsetRule.isNull());
- m_encodingFromCharsetRule = encoding;
}
bool StyleSheetContents::wrapperInsertRule(PassRefPtrWillBeRawPtr<StyleRuleBase> rule, unsigned index)
{
ASSERT(m_isMutable);
ASSERT_WITH_SECURITY_IMPLICATION(index <= ruleCount());
- // Parser::parseRule doesn't currently allow @charset so we don't need to deal with it.
- ASSERT(!rule->isCharsetRule());
-
- unsigned childVectorIndex = index;
- // m_childRules does not contain @charset which is always in index 0 if it exists.
- if (hasCharsetRule()) {
- if (childVectorIndex == 0) {
- // Nothing can be inserted before @charset.
- return false;
- }
- --childVectorIndex;
- }
- if (childVectorIndex < m_importRules.size() || (childVectorIndex == m_importRules.size() && rule->isImportRule())) {
+ if (index < m_importRules.size() || (index == m_importRules.size() && rule->isImportRule())) {
// Inserting non-import rule before @import is not allowed.
if (!rule->isImportRule())
return false;
@@ -250,9 +213,9 @@ bool StyleSheetContents::wrapperInsertRule(PassRefPtrWillBeRawPtr<StyleRuleBase>
if (importRule->mediaQueries())
setHasMediaQueries();
- m_importRules.insert(childVectorIndex, importRule);
- m_importRules[childVectorIndex]->setParentStyleSheet(this);
- m_importRules[childVectorIndex]->requestStyleSheet();
+ m_importRules.insert(index, importRule);
+ m_importRules[index]->setParentStyleSheet(this);
+ m_importRules[index]->requestStyleSheet();
// FIXME: Stylesheet doesn't actually change meaningfully before the imported sheets are loaded.
return true;
}
@@ -263,11 +226,11 @@ bool StyleSheetContents::wrapperInsertRule(PassRefPtrWillBeRawPtr<StyleRuleBase>
if (rule->isMediaRule())
setHasMediaQueries();
- childVectorIndex -= m_importRules.size();
+ index -= m_importRules.size();
if (rule->isFontFaceRule())
setHasFontFaceRule(true);
- m_childRules.insert(childVectorIndex, rule);
+ m_childRules.insert(index, rule);
return true;
}
@@ -276,26 +239,18 @@ void StyleSheetContents::wrapperDeleteRule(unsigned index)
ASSERT(m_isMutable);
ASSERT_WITH_SECURITY_IMPLICATION(index < ruleCount());
- unsigned childVectorIndex = index;
- if (hasCharsetRule()) {
- if (childVectorIndex == 0) {
- clearCharsetRule();
- return;
- }
- --childVectorIndex;
- }
- if (childVectorIndex < m_importRules.size()) {
- m_importRules[childVectorIndex]->clearParentStyleSheet();
- if (m_importRules[childVectorIndex]->isFontFaceRule())
- notifyRemoveFontFaceRule(toStyleRuleFontFace(m_importRules[childVectorIndex].get()));
- m_importRules.remove(childVectorIndex);
+ if (index < m_importRules.size()) {
+ m_importRules[index]->clearParentStyleSheet();
+ if (m_importRules[index]->isFontFaceRule())
+ notifyRemoveFontFaceRule(toStyleRuleFontFace(m_importRules[index].get()));
+ m_importRules.remove(index);
return;
}
- childVectorIndex -= m_importRules.size();
+ index -= m_importRules.size();
- if (m_childRules[childVectorIndex]->isFontFaceRule())
- notifyRemoveFontFaceRule(toStyleRuleFontFace(m_childRules[childVectorIndex].get()));
- m_childRules.remove(childVectorIndex);
+ if (m_childRules[index]->isFontFaceRule())
+ notifyRemoveFontFaceRule(toStyleRuleFontFace(m_childRules[index].get()));
+ m_childRules.remove(index);
}
void StyleSheetContents::parserAddNamespace(const AtomicString& prefix, const AtomicString& uri)
diff --git a/third_party/WebKit/Source/core/css/StyleSheetContents.h b/third_party/WebKit/Source/core/css/StyleSheetContents.h
index 8463153..03df1e2 100644
--- a/third_party/WebKit/Source/core/css/StyleSheetContents.h
+++ b/third_party/WebKit/Source/core/css/StyleSheetContents.h
@@ -97,14 +97,11 @@ public:
void parserAddNamespace(const AtomicString& prefix, const AtomicString& uri);
void parserAppendRule(PassRefPtrWillBeRawPtr<StyleRuleBase>);
- void parserSetEncodingFromCharsetRule(const String& encoding);
void parserSetUsesRemUnits(bool b) { m_usesRemUnits = b; }
void clearRules();
- bool hasCharsetRule() const { return !m_encodingFromCharsetRule.isNull(); }
- String encodingFromCharsetRule() const { return m_encodingFromCharsetRule; }
- // Rules other than @charset and @import.
+ // Rules other than @import.
const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase> >& childRules() const { return m_childRules; }
const WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport> >& importRules() const { return m_importRules; }
@@ -169,13 +166,11 @@ private:
void notifyRemoveFontFaceRule(const StyleRuleFontFace*);
Document* clientSingleOwnerDocument() const;
- void clearCharsetRule();
RawPtrWillBeMember<StyleRuleImport> m_ownerRule;
String m_originalURL;
- String m_encodingFromCharsetRule;
WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport> > m_importRules;
WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase> > m_childRules;
typedef HashMap<AtomicString, AtomicString> PrefixNamespaceURIMap;
diff --git a/third_party/WebKit/Source/core/css/parser/CSSGrammar.y b/third_party/WebKit/Source/core/css/parser/CSSGrammar.y
index d9b949e..b968c71 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSGrammar.y
+++ b/third_party/WebKit/Source/core/css/parser/CSSGrammar.y
@@ -465,24 +465,10 @@ semi_or_eof:
| TOKEN_EOF
;
-before_charset_rule:
- /* empty */ {
- parser->startRule();
- parser->startRuleHeader(CSSRuleSourceData::CHARSET_RULE);
- }
-
maybe_charset:
/* empty */
- | before_charset_rule CHARSET_SYM maybe_space STRING maybe_space semi_or_eof {
- if (parser->m_styleSheet)
- parser->m_styleSheet->parserSetEncodingFromCharsetRule($4);
- parser->endRuleHeader();
- parser->startRuleBody();
- parser->endRule(true);
- }
- | before_charset_rule CHARSET_SYM at_rule_recovery {
- parser->endRule(false);
- }
+ | CHARSET_SYM maybe_space STRING maybe_space semi_or_eof
+ | CHARSET_SYM at_rule_recovery
;
rule_list:
diff --git a/third_party/WebKit/Source/core/frame/UseCounter.h b/third_party/WebKit/Source/core/frame/UseCounter.h
index 51083ed..22912da 100644
--- a/third_party/WebKit/Source/core/frame/UseCounter.h
+++ b/third_party/WebKit/Source/core/frame/UseCounter.h
@@ -377,7 +377,6 @@ public:
DocumentPointerLockElement = 422,
PrefixedCursorZoomIn = 424,
PrefixedCursorZoomOut = 425,
- CSSCharsetRuleEncoding = 426,
DocumentSetCharset = 427,
DocumentDefaultCharset = 428,
TextEncoderConstructor = 429,