From 059b76e71766329549542d3f84b5d9e5a0b2adc5 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. Closes #1345 --- example/web/animation/css_demo.dart | 3 +- example/web/animation/repeat_demo.dart | 3 +- example/web/animation/stress_demo.dart | 3 +- lib/core/annotation_src.dart | 37 ------------------- .../shadow_dom_component_factory.dart | 4 +- test/core/annotation_src_spec.dart | 2 - 6 files changed, 4 insertions(+), 48 deletions(-) diff --git a/example/web/animation/css_demo.dart b/example/web/animation/css_demo.dart index a09018595..b35e15281 100644 --- a/example/web/animation/css_demo.dart +++ b/example/web/animation/css_demo.dart @@ -22,8 +22,7 @@ part of animation; ''', - publishAs: 'ctrl', - applyAuthorStyles: true) + publishAs: 'ctrl') class CssDemo { bool stateA = false; bool stateB = false; diff --git a/example/web/animation/repeat_demo.dart b/example/web/animation/repeat_demo.dart index 6c0f9b446..69b995b9b 100644 --- a/example/web/animation/repeat_demo.dart +++ b/example/web/animation/repeat_demo.dart @@ -17,8 +17,7 @@ part of animation; ''', - publishAs: 'ctrl', - applyAuthorStyles: true) + publishAs: 'ctrl') class RepeatDemo { var thing = 0; final items = []; diff --git a/example/web/animation/stress_demo.dart b/example/web/animation/stress_demo.dart index 2f9b9a488..e23a3d26d 100644 --- a/example/web/animation/stress_demo.dart +++ b/example/web/animation/stress_demo.dart @@ -11,8 +11,7 @@ part of animation; ''', - publishAs: 'ctrl', - applyAuthorStyles: true) + publishAs: 'ctrl') class StressDemo { bool _visible = true; final numbers = [1, 2]; diff --git a/lib/core/annotation_src.dart b/lib/core/annotation_src.dart index bbddf568a..f7920a6da 100644 --- a/lib/core/annotation_src.dart +++ b/lib/core/annotation_src.dart @@ -217,9 +217,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. @@ -254,34 +251,6 @@ class Component extends Directive { */ final _cssUrls; - /** - * Set the shadow root applyAuthorStyles property. See shadow-DOM - * documentation for further details. - */ - @Deprecated('in Chrome 35') - 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. - */ - @Deprecated('in Chrome 35') - 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 @@ -305,8 +274,6 @@ class Component extends Directive { this.template, this.templateUrl, cssUrl, - applyAuthorStyles, - resetStyleInheritance, this.publishAs, DirectiveBinderFn module, map, @@ -317,8 +284,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, @@ -336,8 +301,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 7056be07f..148f15dc7 100644 --- a/lib/core_dom/shadow_dom_component_factory.dart +++ b/lib/core_dom/shadow_dom_component_factory.dart @@ -99,9 +99,7 @@ class BoundShadowDomComponentFactory implements BoundComponentFactory { ShadowBoundary parentShadowBoundary) { var s = traceEnter(View_createComponent); try { - var shadowDom = element.createShadowRoot() - ..applyAuthorStyles = _component.applyAuthorStyles - ..resetStyleInheritance = _component.resetStyleInheritance; + var shadowDom = element.createShadowRoot(); var shadowBoundary; if (_componentFactory.platformShim.shimRequired) { diff --git a/test/core/annotation_src_spec.dart b/test/core/annotation_src_spec.dart index 2c47fb49e..8c5380bb2 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: {},