Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Commit

Permalink
fix(Component): Remove deprecated applyAuthorStyles & resetStyleInher…
Browse files Browse the repository at this point in the history
…itance

Breaking Change: this commit removes deprecated features of the shadow
dom.
  • Loading branch information
vicb committed Aug 26, 2014
1 parent 30cea03 commit 5fb69c5
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 53 deletions.
3 changes: 1 addition & 2 deletions example/web/animation/css_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ part of animation;
</div>
</div>
''',
publishAs: 'ctrl',
applyAuthorStyles: true)
publishAs: 'ctrl')
class CssDemo {
bool stateA = false;
bool stateB = false;
Expand Down
3 changes: 1 addition & 2 deletions example/web/animation/repeat_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ part of animation;
</ul>
</div>
''',
publishAs: 'ctrl',
applyAuthorStyles: true)
publishAs: 'ctrl')
class RepeatDemo {
var thing = 0;
final items = [];
Expand Down
3 changes: 1 addition & 2 deletions example/web/animation/stress_demo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ part of animation;
</div>
</div>
''',
publishAs: 'ctrl',
applyAuthorStyles: true)
publishAs: 'ctrl')
class StressDemo {
bool _visible = true;
final numbers = <int>[1, 2];
Expand Down
42 changes: 0 additions & 42 deletions lib/core/annotation_src.dart
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,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.
Expand Down Expand Up @@ -263,38 +259,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
Expand All @@ -318,8 +282,6 @@ class Component extends Directive {
this.template,
this.templateUrl,
cssUrl,
applyAuthorStyles,
resetStyleInheritance,
this.publishAs,
DirectiveBinderFn module,
map,
Expand All @@ -330,8 +292,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,
Expand All @@ -349,8 +309,6 @@ class Component extends Directive {
template: template,
templateUrl: templateUrl,
cssUrl: cssUrls,
applyAuthorStyles: applyAuthorStyles,
resetStyleInheritance: resetStyleInheritance,
publishAs: publishAs,
map: newMap,
module: module,
Expand Down
4 changes: 1 addition & 3 deletions lib/core_dom/shadow_dom_component_factory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,7 @@ class BoundShadowDomComponentFactory implements BoundComponentFactory {
EventHandler _) {
var s = traceEnter(View_createComponent);
try {
var shadowDom = element.createShadowRoot()
..applyAuthorStyles = _component.applyAuthorStyles
..resetStyleInheritance = _component.resetStyleInheritance;
var shadowDom = element.createShadowRoot();

var shadowScope = scope.createChild(new HashMap()); // Isolate

Expand Down
2 changes: 0 additions & 2 deletions test/core/annotation_src_spec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ void main() => describe('annotations', () {
template: '',
templateUrl: '',
cssUrl: [''],
applyAuthorStyles: true,
resetStyleInheritance: true,
publishAs: '',
module: (i){},
map: {},
Expand Down

0 comments on commit 5fb69c5

Please sign in to comment.