diff --git a/lib/core/directive.dart b/lib/core/directive.dart index 4e1175995..e336567bc 100644 --- a/lib/core/directive.dart +++ b/lib/core/directive.dart @@ -178,6 +178,9 @@ abstract class NgAnnotation { } +bool _applyAuthorStylesDeprecationWarningPrinted = false; +bool _resetStyleInheritanceDeprecationWarningPrinted = false; + /** * Meta-data marker placed on a class which should act as a controller for the * component. Angular components are a light-weight version of web-components. @@ -214,14 +217,34 @@ class NgComponent extends NgAnnotation { /** * Set the shadow root applyAuthorStyles property. See shadow-DOM * documentation for further details. + * + * This feature will be removed in Chrome 35. */ - final bool applyAuthorStyles; + @deprecated + bool get applyAuthorStyles { + if (!_applyAuthorStylesDeprecationWarningPrinted && _applyAuthorStyles == true) { + print("WARNING applyAuthorStyles is deprecated in component $selector"); + _applyAuthorStylesDeprecationWarningPrinted = true; + } + return _applyAuthorStyles; + } + final bool _applyAuthorStyles; /** * Set the shadow root resetStyleInheritance property. See shadow-DOM * documentation for further details. + * + * This feature will be removed in Chrome 35. */ - final bool resetStyleInheritance; + @deprecated + bool get resetStyleInheritance { + if (!_resetStyleInheritanceDeprecationWarningPrinted && _resetStyleInheritance == true) { + print("WARNING resetStyleInheritance is deprecated in component $selector"); + _resetStyleInheritanceDeprecationWarningPrinted = true; + } + return _resetStyleInheritance; + } + final bool _resetStyleInheritance; /** * An expression under which the component's controller instance will be @@ -234,8 +257,8 @@ class NgComponent extends NgAnnotation { this.template, this.templateUrl, cssUrl, - this.applyAuthorStyles, - this.resetStyleInheritance, + applyAuthorStyles, + resetStyleInheritance, this.publishAs, module, map, @@ -244,6 +267,8 @@ class NgComponent extends NgAnnotation { exportExpressions, exportExpressionAttrs}) : _cssUrls = cssUrl, + _applyAuthorStyles = applyAuthorStyles, + _resetStyleInheritance = resetStyleInheritance, super(selector: selector, children: NgAnnotation.COMPILE_CHILDREN, visibility: visibility, diff --git a/test/core/core_directive_spec.dart b/test/core/core_directive_spec.dart index 2e6168468..9f8159280 100644 --- a/test/core/core_directive_spec.dart +++ b/test/core/core_directive_spec.dart @@ -23,8 +23,6 @@ void main() { expect(annotation.template).toEqual('template'); expect(annotation.templateUrl).toEqual('templateUrl'); expect(annotation.cssUrls).toEqual(['cssUrls']); - expect(annotation.applyAuthorStyles).toEqual(true); - expect(annotation.resetStyleInheritance).toEqual(true); expect(annotation.publishAs).toEqual('ctrl'); expect(annotation.map).toEqual({ 'foo': '=>foo', @@ -83,8 +81,6 @@ class NullParser implements Parser { template: 'template', templateUrl: 'templateUrl', cssUrl: const ['cssUrls'], - applyAuthorStyles: true, - resetStyleInheritance: true, publishAs: 'ctrl', module: AnnotatedIoComponent.module, visibility: NgDirective.LOCAL_VISIBILITY, diff --git a/test/core_dom/shadow_root_options_spec.dart b/test/core_dom/shadow_root_options_spec.dart deleted file mode 100644 index 0a8770c38..000000000 --- a/test/core_dom/shadow_root_options_spec.dart +++ /dev/null @@ -1,88 +0,0 @@ -library shadow_root_options_spec; - -import '../_specs.dart'; - -@NgComponent( - selector: 'reset-style-inheritance', - template: '