Add back CssCharsetRule for Safari support

BUG=

Review URL: https://codereview.chromium.org/1777683002 .
This commit is contained in:
Alan Knight 2016-03-08 14:40:57 -08:00
parent 1fa1b388c1
commit 1f9395fb30
5 changed files with 75 additions and 3 deletions

View file

@ -60,6 +60,7 @@ dynamic resolver(String s) {
if (s == "CHROMIUMSubscribeUniform") return BlinkCHROMIUMSubscribeUniform.instance;
if (s == "CHROMIUMValuebuffer") return BlinkCHROMIUMValuebuffer.instance;
if (s == "CSS") return BlinkCSS.instance;
if (s == "CSSCharsetRule") return BlinkCSSCharsetRule.instance;
if (s == "CSSFontFaceRule") return BlinkCSSFontFaceRule.instance;
if (s == "CSSGroupingRule") return BlinkCSSGroupingRule.instance;
if (s == "CSSImportRule") return BlinkCSSImportRule.instance;
@ -1716,6 +1717,15 @@ class BlinkCSS {
}
class BlinkCSSCharsetRule extends BlinkCSSRule {
static final instance = new BlinkCSSCharsetRule();
encoding_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "encoding");
encoding_Setter_(mthis, __arg_0) => mthis["encoding"] = __arg_0;
}
class BlinkCSSFontFaceRule extends BlinkCSSRule {
static final instance = new BlinkCSSFontFaceRule();

View file

@ -3772,6 +3772,24 @@ class Css extends Interceptor {
// BSD-style license that can be found in the LICENSE file.
@DocsEditable()
@DomName('CSSCharsetRule')
// http://dev.w3.org/csswg/cssom/#the-csscharsetrule-interface
@Experimental()
@Native("CSSCharsetRule")
class CssCharsetRule extends CssRule {
// To suppress missing implicit constructor warnings.
factory CssCharsetRule._() { throw new UnsupportedError("Not supported"); }
@DomName('CSSCharsetRule.encoding')
@DocsEditable()
String encoding;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DocsEditable()
@DomName('CSSFontFaceRule')
@Native("CSSFontFaceRule")

View file

@ -158,6 +158,7 @@ final htmlBlinkMap = {
'CDATASection': () => CDataSection,
'CHROMIUMValuebuffer': () => ChromiumValuebuffer,
'CSS': () => Css,
'CSSCharsetRule': () => CssCharsetRule,
'CSSFontFaceRule': () => CssFontFaceRule,
'CSSGroupingRule': () => CssGroupingRule,
'CSSImportRule': () => CssImportRule,
@ -699,6 +700,7 @@ final htmlBlinkFunctionMap = {
'CDATASection': () => CDataSection.internalCreateCDataSection,
'CHROMIUMValuebuffer': () => ChromiumValuebuffer.internalCreateChromiumValuebuffer,
'CSS': () => Css.internalCreateCss,
'CSSCharsetRule': () => CssCharsetRule.internalCreateCssCharsetRule,
'CSSFontFaceRule': () => CssFontFaceRule.internalCreateCssFontFaceRule,
'CSSGroupingRule': () => CssGroupingRule.internalCreateCssGroupingRule,
'CSSImportRule': () => CssImportRule.internalCreateCssImportRule,
@ -6106,6 +6108,42 @@ class Css extends DartHtmlDomObject {
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSSCharsetRule')
// http://dev.w3.org/csswg/cssom/#the-csscharsetrule-interface
@Experimental()
class CssCharsetRule extends CssRule {
// To suppress missing implicit constructor warnings.
factory CssCharsetRule._() { throw new UnsupportedError("Not supported"); }
@Deprecated("Internal Use Only")
static CssCharsetRule internalCreateCssCharsetRule() {
return new CssCharsetRule._internalWrap();
}
external factory CssCharsetRule._internalWrap();
@Deprecated("Internal Use Only")
CssCharsetRule.internal_() : super.internal_();
@DomName('CSSCharsetRule.encoding')
@DocsEditable()
String get encoding => _blink.BlinkCSSCharsetRule.instance.encoding_Getter_(unwrap_jso(this));
@DomName('CSSCharsetRule.encoding')
@DocsEditable()
set encoding(String value) => _blink.BlinkCSSCharsetRule.instance.encoding_Setter_(unwrap_jso(this), value);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// WARNING: Do not edit - generated code.
@DocsEditable()
@DomName('CSSFontFaceRule')
class CssFontFaceRule extends CssRule {
@ -40366,10 +40404,10 @@ class Url extends DartHtmlDomObject implements UrlUtils {
if ((blob_OR_source_OR_stream is Blob || blob_OR_source_OR_stream == null)) {
return _blink.BlinkURL.instance.createObjectURL_Callback_1_(unwrap_jso(blob_OR_source_OR_stream));
}
if ((blob_OR_source_OR_stream is MediaStream)) {
if ((blob_OR_source_OR_stream is MediaSource)) {
return _blink.BlinkURL.instance.createObjectURL_Callback_1_(unwrap_jso(blob_OR_source_OR_stream));
}
if ((blob_OR_source_OR_stream is MediaSource)) {
if ((blob_OR_source_OR_stream is MediaStream)) {
return _blink.BlinkURL.instance.createObjectURL_Callback_1_(unwrap_jso(blob_OR_source_OR_stream));
}
throw new ArgumentError("Incorrect number or type of arguments");

View file

@ -3736,7 +3736,6 @@ LayoutTests/fast/dynamic/crash-generated-text_t01: RuntimeError # Please triage
LayoutTests/fast/dynamic/insertAdjacentElement_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dynamic/insertAdjacentHTML_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dynamic/recursive-layout_t01: RuntimeError # Please triage this failure
LayoutTests/fast/encoding/css-charset-dom_t01: RuntimeError # Issue 25941
LayoutTests/fast/events/add-event-without-document_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/clipboard-clearData_t01: Skip # Times out. Please triage this failure
LayoutTests/fast/events/clipboard-dataTransferItemList_t01: Skip # Times out. Please triage this failure

View file

@ -423,3 +423,10 @@ interface MIDIOutput : MIDIPort {
};
Element implements GlobalEventHandlers;
// This only exists in Safari, and is deprecated there. But include it anyway
// because otherwise iterating CSSRules in Safari can yield unknown JS objects.
interface CSSCharsetRule : CSSRule {
[MeasureAs=CSSCharsetRuleEncoding] attribute DOMString encoding;
};