Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 29 additions & 4 deletions lib/core/annotation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,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.
Expand Down Expand Up @@ -224,14 +227,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
Expand All @@ -244,8 +267,8 @@ class NgComponent extends NgAnnotation {
this.template,
this.templateUrl,
cssUrl,
this.applyAuthorStyles,
this.resetStyleInheritance,
applyAuthorStyles,
resetStyleInheritance,
this.publishAs,
module,
map,
Expand All @@ -254,6 +277,8 @@ class NgComponent extends NgAnnotation {
exportExpressions,
exportExpressionAttrs})
: _cssUrls = cssUrl,
_applyAuthorStyles = applyAuthorStyles,
_resetStyleInheritance = resetStyleInheritance,
super(selector: selector,
children: NgAnnotation.COMPILE_CHILDREN,
visibility: visibility,
Expand Down
4 changes: 0 additions & 4 deletions test/core/core_directive_spec.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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,
Expand Down
88 changes: 0 additions & 88 deletions test/core_dom/shadow_root_options_spec.dart

This file was deleted.