feat(shadowdom): turn on ShadowDom Emulated Mode by default.
Closes: #526
This commit is contained in:
@@ -9,11 +9,11 @@ describe('ng2 naive infinite scroll benchmark', function () {
|
||||
it('should not throw errors', function() {
|
||||
browser.get(URL);
|
||||
var expectedRowCount = 18;
|
||||
var expectedCellsPerRow = 11;
|
||||
var allScrollItems = 'scroll-app /deep/ #testArea /deep/ scroll-item';
|
||||
var cells = `${ allScrollItems } /deep/ .row *`;
|
||||
var expectedCellsPerRow = 28;
|
||||
var allScrollItems = 'scroll-app #testArea scroll-item';
|
||||
var cells = `${ allScrollItems } .row *`;
|
||||
var stageButtons =
|
||||
`${ allScrollItems } /deep/ .row stage-buttons /deep/ button`;
|
||||
`${ allScrollItems } .row stage-buttons button`;
|
||||
|
||||
var count = function(selector) {
|
||||
return browser.executeScript(
|
||||
|
||||
@@ -6,12 +6,14 @@ import {Parser, Lexer, ChangeDetector, ChangeDetection}
|
||||
from 'angular2/change_detection';
|
||||
import {ExceptionHandler} from 'angular2/src/core/exception_handler';
|
||||
import {
|
||||
bootstrap, Component, Viewport, Template, ViewContainer, Compiler, onChange
|
||||
bootstrap, Component, Viewport, Template, ViewContainer, Compiler, onChange, NgElement, Decorator
|
||||
} from 'angular2/angular2';
|
||||
import {Reflector, reflector} from 'angular2/src/reflection/reflection';
|
||||
import {CompilerCache} from 'angular2/src/core/compiler/compiler';
|
||||
import {DirectiveMetadataReader} from 'angular2/src/core/compiler/directive_metadata_reader';
|
||||
import {ShadowDomStrategy, NativeShadowDomStrategy} from 'angular2/src/core/compiler/shadow_dom_strategy';
|
||||
import {ShadowDomStrategy, NativeShadowDomStrategy, EmulatedUnscopedShadowDomStrategy} from 'angular2/src/core/compiler/shadow_dom_strategy';
|
||||
import {Content} from 'angular2/src/core/compiler/shadow_dom_emulation/content_tag';
|
||||
import {DestinationLightDom} from 'angular2/src/core/compiler/shadow_dom_emulation/light_dom';
|
||||
import {TemplateLoader} from 'angular2/src/core/compiler/template_loader';
|
||||
import {TemplateResolver} from 'angular2/src/core/compiler/template_resolver';
|
||||
import {LifeCycle} from 'angular2/src/core/life_cycle/life_cycle';
|
||||
@@ -256,6 +258,12 @@ export function setupReflectorForAngular() {
|
||||
"annotations": []
|
||||
});
|
||||
|
||||
reflector.registerType(EmulatedUnscopedShadowDomStrategy, {
|
||||
"factory": (styleUrlResolver) => new EmulatedUnscopedShadowDomStrategy(styleUrlResolver, null),
|
||||
"parameters": [[StyleUrlResolver]],
|
||||
"annotations": []
|
||||
});
|
||||
|
||||
reflector.registerType(StyleUrlResolver, {
|
||||
"factory": (urlResolver) => new StyleUrlResolver(urlResolver),
|
||||
"parameters": [[UrlResolver]],
|
||||
@@ -274,6 +282,12 @@ export function setupReflectorForAngular() {
|
||||
"annotations": []
|
||||
});
|
||||
|
||||
reflector.registerType(Content, {
|
||||
"factory": (lightDom, el) => new Content(lightDom, el),
|
||||
"parameters": [[DestinationLightDom], [NgElement]],
|
||||
"annotations" : [new Decorator({selector: '[content]'})]
|
||||
});
|
||||
|
||||
reflector.registerType(StyleInliner, {
|
||||
"factory": (xhr, styleUrlResolver, urlResolver) =>
|
||||
new StyleInliner(xhr, styleUrlResolver, urlResolver),
|
||||
|
||||
@@ -2,13 +2,15 @@ import {Parser, Lexer, ChangeDetector, ChangeDetection, jitChangeDetection}
|
||||
from 'angular2/change_detection';
|
||||
import {ExceptionHandler} from 'angular2/src/core/exception_handler';
|
||||
|
||||
import {bootstrap, Component, Viewport, Template, ViewContainer, Compiler} from 'angular2/angular2';
|
||||
import {bootstrap, Component, Viewport, Template, ViewContainer, Compiler, NgElement, Decorator} from 'angular2/angular2';
|
||||
|
||||
import {CompilerCache} from 'angular2/src/core/compiler/compiler';
|
||||
import {DirectiveMetadataReader} from 'angular2/src/core/compiler/directive_metadata_reader';
|
||||
import {TemplateLoader} from 'angular2/src/core/compiler/template_loader';
|
||||
import {TemplateResolver} from 'angular2/src/core/compiler/template_resolver';
|
||||
import {ShadowDomStrategy, NativeShadowDomStrategy} from 'angular2/src/core/compiler/shadow_dom_strategy';
|
||||
import {ShadowDomStrategy, NativeShadowDomStrategy, EmulatedUnscopedShadowDomStrategy} from 'angular2/src/core/compiler/shadow_dom_strategy';
|
||||
import {Content} from 'angular2/src/core/compiler/shadow_dom_emulation/content_tag';
|
||||
import {DestinationLightDom} from 'angular2/src/core/compiler/shadow_dom_emulation/light_dom';
|
||||
import {LifeCycle} from 'angular2/src/core/life_cycle/life_cycle';
|
||||
import {UrlResolver} from 'angular2/src/core/compiler/url_resolver';
|
||||
import {StyleUrlResolver} from 'angular2/src/core/compiler/style_url_resolver';
|
||||
@@ -127,12 +129,24 @@ function setupReflector() {
|
||||
"annotations": []
|
||||
});
|
||||
|
||||
reflector.registerType(EmulatedUnscopedShadowDomStrategy, {
|
||||
"factory": (styleUrlResolver) => new EmulatedUnscopedShadowDomStrategy(styleUrlResolver, null),
|
||||
"parameters": [[StyleUrlResolver]],
|
||||
"annotations": []
|
||||
});
|
||||
|
||||
reflector.registerType(StyleUrlResolver, {
|
||||
"factory": (urlResolver) => new StyleUrlResolver(urlResolver),
|
||||
"parameters": [[UrlResolver]],
|
||||
"annotations": []
|
||||
});
|
||||
|
||||
reflector.registerType(Content, {
|
||||
"factory": (lightDom, el) => new Content(lightDom, el),
|
||||
"parameters": [[DestinationLightDom], [NgElement]],
|
||||
"annotations" : [new Decorator({selector: '[content]'})]
|
||||
});
|
||||
|
||||
reflector.registerType(UrlResolver, {
|
||||
"factory": () => new UrlResolver(),
|
||||
"parameters": [],
|
||||
|
||||
Reference in New Issue
Block a user