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.

Closes #1345
  • Loading branch information
vicb authored and vsavkin committed Sep 15, 2014
1 parent 8e92aa7 commit 059b76e
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 48 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
37 changes: 0 additions & 37 deletions lib/core/annotation_src.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -305,8 +274,6 @@ class Component extends Directive {
this.template,
this.templateUrl,
cssUrl,
applyAuthorStyles,
resetStyleInheritance,
this.publishAs,
DirectiveBinderFn module,
map,
Expand All @@ -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,
Expand All @@ -336,8 +301,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 @@ -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) {
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 059b76e

Please sign in to comment.