From 22f35c8657ef2a0c85492f69344ebb8667dca9e8 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Wed, 13 Aug 2014 10:32:06 +0200 Subject: [PATCH] fix(Component): Remove deprecated applyAuthorStyles & resetStyleInheritance Breaking Change: this commit removes deprecated features of the shadow dom. --- lib/core/annotation_src.dart | 42 ------------------- .../shadow_dom_component_factory.dart | 4 +- test/core/annotation_src_spec.dart | 2 - 3 files changed, 1 insertion(+), 47 deletions(-) diff --git a/lib/core/annotation_src.dart b/lib/core/annotation_src.dart index d40b126be..eb32042a2 100644 --- a/lib/core/annotation_src.dart +++ b/lib/core/annotation_src.dart @@ -223,10 +223,6 @@ abstract class Directive { Directive _cloneWithNewMap(newMap); } - -bool _applyAuthorStylesDeprecationWarningPrinted = false; -bool _resetStyleInheritanceDeprecationWarningPrinted = false; - /** * Annotation placed on a class which should act as a controller for the * component. Angular components are a light-weight version of web-components. @@ -261,38 +257,6 @@ class Component extends Directive { */ final _cssUrls; - /** - * Set the shadow root applyAuthorStyles property. See shadow-DOM - * documentation for further details. - * - * This feature will be removed in Chrome 35. - */ - @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. - */ - @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 * published into. This allows the expressions in the template to be referring @@ -316,8 +280,6 @@ class Component extends Directive { this.template, this.templateUrl, cssUrl, - applyAuthorStyles, - resetStyleInheritance, this.publishAs, DirectiveBinderFn module, map, @@ -328,8 +290,6 @@ class Component extends Directive { this.useShadowDom, this.useNgBaseCss: true}) : _cssUrls = cssUrl, - _applyAuthorStyles = applyAuthorStyles, - _resetStyleInheritance = resetStyleInheritance, super(selector: selector, children: Directive.COMPILE_CHILDREN, visibility: visibility, @@ -347,8 +307,6 @@ class Component extends Directive { template: template, templateUrl: templateUrl, cssUrl: cssUrls, - applyAuthorStyles: applyAuthorStyles, - resetStyleInheritance: resetStyleInheritance, publishAs: publishAs, map: newMap, module: module, diff --git a/lib/core_dom/shadow_dom_component_factory.dart b/lib/core_dom/shadow_dom_component_factory.dart index 7c8a48c9a..262457604 100644 --- a/lib/core_dom/shadow_dom_component_factory.dart +++ b/lib/core_dom/shadow_dom_component_factory.dart @@ -124,9 +124,7 @@ class BoundShadowDomComponentFactory implements BoundComponentFactory { Function call(dom.Element element) { return (DirectiveInjector injector, Scope scope, NgBaseCss baseCss, EventHandler eventHandler) { - var shadowDom = element.createShadowRoot() - ..applyAuthorStyles = _component.applyAuthorStyles - ..resetStyleInheritance = _component.resetStyleInheritance; + var shadowDom = element.createShadowRoot(); var shadowScope = scope.createChild(new HashMap()); // Isolate diff --git a/test/core/annotation_src_spec.dart b/test/core/annotation_src_spec.dart index dec1b2c9b..ac2dd81a6 100644 --- a/test/core/annotation_src_spec.dart +++ b/test/core/annotation_src_spec.dart @@ -37,8 +37,6 @@ void main() => describe('annotations', () { template: '', templateUrl: '', cssUrl: [''], - applyAuthorStyles: true, - resetStyleInheritance: true, publishAs: '', module: (i){}, map: {},