@antv/g 1.0.0-alpha.29 → 1.0.0-alpha.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/Canvas.js CHANGED
@@ -42,7 +42,12 @@ function (_super) {
42
42
 
43
43
 
44
44
  _this.container = globalContainer.createChild();
45
- _this.Element = DisplayObject;
45
+ _this.Element = DisplayObject; // create document
46
+
47
+ _this.document = new Document();
48
+ _this.document.defaultView = _this; // create registry of custom elements
49
+
50
+ _this.customElements = new CustomElementRegistry();
46
51
  cleanExistedCanvas(config.container, _this);
47
52
 
48
53
  var mergedConfig = __assign(__assign({}, config), {
@@ -64,12 +69,7 @@ function (_super) {
64
69
  this.container.register({
65
70
  token: CanvasConfig,
66
71
  useValue: mergedConfig
67
- }); // create document
68
-
69
- this.document = new Document();
70
- this.document.defaultView = this; // create registry of custom elements
71
-
72
- this.customElements = new CustomElementRegistry(); // bind rendering context, shared by all renderers
72
+ }); // bind rendering context, shared by all renderers
73
73
 
74
74
  this.container.register({
75
75
  token: RenderingContext,
@@ -7,6 +7,8 @@ export declare class Transform extends Component {
7
7
  static tag: string;
8
8
  dirtyFlag: boolean;
9
9
  localDirtyFlag: boolean;
10
+ frozen: boolean;
11
+ graphDepth: number;
10
12
  /**
11
13
  * local space RTS
12
14
  */
@@ -15,6 +15,8 @@ function (_super) {
15
15
 
16
16
  _this.dirtyFlag = false;
17
17
  _this.localDirtyFlag = false;
18
+ _this.frozen = false;
19
+ _this.graphDepth = 0;
18
20
  /**
19
21
  * local space RTS
20
22
  */
@@ -16,10 +16,7 @@ export interface CustomElement<CustomElementStyleProps> {
16
16
  * @see https://yuque.antfin-inc.com/antv/czqvg5/pgqipg
17
17
  */
18
18
  export declare abstract class CustomElement<CustomElementStyleProps> extends DisplayObject<CustomElementStyleProps> {
19
- private shadowNodes;
20
19
  constructor(config: DisplayObjectConfig<CustomElementStyleProps>);
21
20
  private handleMounted;
22
- private handleChildInserted;
23
- private handleChildRemoved;
24
21
  private handleAttributeChanged;
25
22
  }
@@ -9,39 +9,35 @@ import { ElementEvent } from '../dom/interfaces';
9
9
  var CustomElement =
10
10
  /** @class */
11
11
  function (_super) {
12
- __extends(CustomElement, _super);
12
+ __extends(CustomElement, _super); // private shadowNodes: DisplayObject[] = [];
13
+
13
14
 
14
15
  function CustomElement(config) {
15
16
  var _this = _super.call(this, config) || this;
16
17
 
17
- _this.shadowNodes = [];
18
-
19
18
  _this.handleMounted = function () {
20
- _this.shadowNodes.forEach(function (node) {
21
- // every child and its children should turn into a shadow node
22
- // a shadow node doesn't mean to be unrenderable, it's just unsearchable in scenegraph
23
- node.shadow = true;
24
- });
25
-
19
+ // this.shadowNodes.forEach((node) => {
20
+ // // every child and its children should turn into a shadow node
21
+ // // a shadow node doesn't mean to be unrenderable, it's just unsearchable in scenegraph
22
+ // node.shadow = true;
23
+ // });
26
24
  if (_this.connectedCallback) {
27
25
  _this.connectedCallback();
28
26
  }
29
- };
27
+ }; // private handleChildInserted = (e: FederatedEvent) => {
28
+ // (e.target as DisplayObject).forEach((node) => {
29
+ // // append children like other shapes after mounted
30
+ // if (!this.isConnected) {
31
+ // this.shadowNodes.push(node as DisplayObject);
32
+ // }
33
+ // });
34
+ // };
35
+ // private handleChildRemoved = (e: FederatedEvent) => {
36
+ // (e.target as DisplayObject).forEach((node) => {
37
+ // node.shadow = false;
38
+ // });
39
+ // };
30
40
 
31
- _this.handleChildInserted = function (e) {
32
- e.target.forEach(function (node) {
33
- // append children like other shapes after mounted
34
- if (!_this.isConnected) {
35
- _this.shadowNodes.push(node);
36
- }
37
- });
38
- };
39
-
40
- _this.handleChildRemoved = function (e) {
41
- e.target.forEach(function (node) {
42
- node.shadow = false;
43
- });
44
- };
45
41
 
46
42
  _this.handleAttributeChanged = function (e) {
47
43
  // only listen itself
@@ -55,11 +51,9 @@ function (_super) {
55
51
  oldValue = _a.oldValue,
56
52
  newValue = _a.newValue;
57
53
  _this.attributeChangedCallback && _this.attributeChangedCallback(attributeName, oldValue, newValue);
58
- };
59
-
60
- _this.addEventListener(ElementEvent.CHILD_INSERTED, _this.handleChildInserted);
54
+ }; // this.addEventListener(ElementEvent.CHILD_INSERTED, this.handleChildInserted);
55
+ // this.addEventListener(ElementEvent.CHILD_REMOVED, this.handleChildRemoved);
61
56
 
62
- _this.addEventListener(ElementEvent.CHILD_REMOVED, _this.handleChildRemoved);
63
57
 
64
58
  if (_this.attributeChangedCallback) {
65
59
  _this.addEventListener(ElementEvent.ATTRIBUTE_CHANGED, _this.handleAttributeChanged);
@@ -43,12 +43,15 @@ export var containerModule = Module(function (register) {
43
43
  register({
44
44
  token: GeometryUpdaterFactory,
45
45
  useFactory: function useFactory(context) {
46
+ var cache = {};
46
47
  return function (tagName) {
47
- if (context.container.isBoundNamed(GeometryAABBUpdater, tagName)) {
48
- return context.container.getNamed(GeometryAABBUpdater, tagName);
48
+ if (!cache[tagName]) {
49
+ if (context.container.isBoundNamed(GeometryAABBUpdater, tagName)) {
50
+ cache[tagName] = context.container.getNamed(GeometryAABBUpdater, tagName);
51
+ }
49
52
  }
50
53
 
51
- return null;
54
+ return cache[tagName];
52
55
  };
53
56
  }
54
57
  }); // bind style property handlers
@@ -56,36 +59,45 @@ export var containerModule = Module(function (register) {
56
59
  register({
57
60
  token: StylePropertyParserFactory,
58
61
  useFactory: function useFactory(context) {
62
+ var cache = {};
59
63
  return function (propertyName) {
60
- if (context.container.isBoundNamed(StylePropertyParser, propertyName)) {
61
- return context.container.getNamed(StylePropertyParser, propertyName);
64
+ if (!cache[propertyName]) {
65
+ if (context.container.isBoundNamed(StylePropertyParser, propertyName)) {
66
+ cache[propertyName] = context.container.getNamed(StylePropertyParser, propertyName);
67
+ }
62
68
  }
63
69
 
64
- return null;
70
+ return cache[propertyName];
65
71
  };
66
72
  }
67
73
  });
68
74
  register({
69
75
  token: StylePropertyUpdaterFactory,
70
76
  useFactory: function useFactory(context) {
77
+ var cache = {};
71
78
  return function (propertyName) {
72
- if (context.container.isBoundNamed(StylePropertyUpdater, propertyName)) {
73
- return context.container.getAllNamed(StylePropertyUpdater, propertyName);
79
+ if (!cache[propertyName]) {
80
+ if (context.container.isBoundNamed(StylePropertyUpdater, propertyName)) {
81
+ cache[propertyName] = context.container.getAllNamed(StylePropertyUpdater, propertyName);
82
+ }
74
83
  }
75
84
 
76
- return null;
85
+ return cache[propertyName];
77
86
  };
78
87
  }
79
88
  });
80
89
  register({
81
90
  token: StylePropertyMergerFactory,
82
91
  useFactory: function useFactory(context) {
92
+ var cache = {};
83
93
  return function (propertyName) {
84
- if (context.container.isBoundNamed(StylePropertyMerger, propertyName)) {
85
- return context.container.getNamed(StylePropertyMerger, propertyName);
94
+ if (!cache[propertyName]) {
95
+ if (context.container.isBoundNamed(StylePropertyMerger, propertyName)) {
96
+ cache[propertyName] = context.container.getNamed(StylePropertyMerger, propertyName);
97
+ }
86
98
  }
87
99
 
88
- return null;
100
+ return cache[propertyName];
89
101
  };
90
102
  }
91
103
  });
@@ -616,11 +616,10 @@ function (_super) {
616
616
  }
617
617
 
618
618
  for (var i = 0; i < PROPAGATION_LIMIT && target !== this.rootTarget; i++) {
619
- if (Node.isNode(target) && !target.parentNode) {
620
- throw new Error('Cannot find propagation path to disconnected target');
621
- }
622
-
623
- if (Node.isNode(target)) {
619
+ // if (Node.isNode(target) && !target.parentNode) {
620
+ // throw new Error('Cannot find propagation path to disconnected target');
621
+ // }
622
+ if (Node.isNode(target) && target.parentNode) {
624
623
  // [target, parent, parent, root]
625
624
  propagationPath.push(target.parentNode);
626
625
  target = target.parentNode;
@@ -22,6 +22,7 @@ export interface PickingResult {
22
22
  export declare class RenderingService {
23
23
  private renderingPluginProvider;
24
24
  private renderingContext;
25
+ private sceneGraphService;
25
26
  private inited;
26
27
  hooks: {
27
28
  init: AsyncSeriesHook<[], import("tapable").UnsetAdditionalOptions>;
@@ -3,7 +3,7 @@ import { inject, singleton, contrib, Syringe, Contribution } from 'mana-syringe'
3
3
  import { SyncHook, SyncWaterfallHook, AsyncSeriesHook, AsyncSeriesWaterfallHook } from 'tapable';
4
4
  import { Renderable, Sortable } from '../components';
5
5
  import { RenderingContext, RENDER_REASON } from './RenderingContext';
6
- import { sortByZIndex } from './SceneGraphService';
6
+ import { SceneGraphService, sortByZIndex } from './SceneGraphService';
7
7
  export var RenderingPluginContribution = Syringe.defineToken('RenderingPluginContribution');
8
8
  /**
9
9
  * Use frame renderer implemented by `g-canvas/svg/webgl`, in every frame we do followings:
@@ -54,7 +54,6 @@ function () {
54
54
  this.renderingPluginProvider.getContributions({
55
55
  cache: false
56
56
  }).forEach(function (plugin) {
57
- console.log(plugin);
58
57
  plugin.apply(_this);
59
58
  });
60
59
  return [4
@@ -74,6 +73,8 @@ function () {
74
73
  };
75
74
 
76
75
  RenderingService.prototype.render = function () {
76
+ this.sceneGraphService.syncHierarchy(this.renderingContext.root);
77
+
77
78
  if (this.renderingContext.renderReasons.size && this.inited) {
78
79
  this.renderDisplayObject(this.renderingContext.root);
79
80
 
@@ -139,6 +140,8 @@ function () {
139
140
 
140
141
  __decorate([inject(RenderingContext), __metadata("design:type", Object)], RenderingService.prototype, "renderingContext", void 0);
141
142
 
143
+ __decorate([inject(SceneGraphService), __metadata("design:type", Object)], RenderingService.prototype, "sceneGraphService", void 0);
144
+
142
145
  RenderingService = __decorate([singleton()], RenderingService);
143
146
  return RenderingService;
144
147
  }();
@@ -37,6 +37,7 @@ export interface SceneGraphService {
37
37
  getLocalBounds(element: INode, render?: boolean): AABB | null;
38
38
  getGeometryBounds(element: INode, render?: boolean): AABB | null;
39
39
  getBoundingClientRect(element: INode): Rectangle;
40
+ syncHierarchy(element: INode): void;
40
41
  }
41
42
  /**
42
43
  * update transform in scene graph
@@ -142,5 +143,8 @@ export declare class DefaultSceneGraphService implements SceneGraphService {
142
143
  getLocalBounds(element: INode): AABB | null;
143
144
  getBoundingClientRect(element: INode): Rectangle;
144
145
  private dirtifyWorldInternal;
145
- private updateTransform;
146
+ syncHierarchy(element: INode): void;
147
+ private sync;
148
+ private updateGraphDepth;
149
+ private unfreezeParentToRoot;
146
150
  }
@@ -369,11 +369,16 @@ function () {
369
369
  sortable.dirty = true;
370
370
  }
371
371
 
372
+ this.updateGraphDepth(child);
372
373
  var transform = entity.getComponent(Transform);
373
374
 
374
375
  if (transform) {
375
376
  this.dirtifyWorld(child, transform);
376
377
  }
378
+
379
+ if (transform.frozen) {
380
+ this.unfreezeParentToRoot(child);
381
+ }
377
382
  };
378
383
 
379
384
  DefaultSceneGraphService.prototype.detach = function (child) {
@@ -530,6 +535,10 @@ function () {
530
535
  };
531
536
 
532
537
  DefaultSceneGraphService.prototype.dirtifyWorld = function (element, transform) {
538
+ if (!transform.dirtyFlag) {
539
+ this.unfreezeParentToRoot(element);
540
+ }
541
+
533
542
  this.dirtifyWorldInternal(element, transform);
534
543
  };
535
544
 
@@ -553,10 +562,6 @@ function () {
553
562
  transform = element.entity.getComponent(Transform);
554
563
  }
555
564
 
556
- if (!transform) {
557
- return mat4.create();
558
- }
559
-
560
565
  if (!transform.localDirtyFlag && !transform.dirtyFlag) {
561
566
  return transform.worldTransform;
562
567
  }
@@ -565,7 +570,7 @@ function () {
565
570
  this.getWorldTransform(element.parentNode);
566
571
  }
567
572
 
568
- this.updateTransform(element, transform);
573
+ this.sync(element, transform);
569
574
  return transform.worldTransform;
570
575
  };
571
576
 
@@ -761,13 +766,14 @@ function () {
761
766
 
762
767
  if (!transform.dirtyFlag) {
763
768
  transform.dirtyFlag = true;
769
+ transform.frozen = false;
764
770
  element.childNodes.forEach(function (child) {
765
771
  var childTransform = child.entity.getComponent(Transform);
766
772
 
767
773
  if (!childTransform.dirtyFlag) {
768
774
  _this.dirtifyWorldInternal(child, childTransform);
769
775
  }
770
- }); // emit on leaf node
776
+ }); // FIXME: emit on leaf node
771
777
 
772
778
  if (element.childNodes.length === 0) {
773
779
  dirtifyRenderable(element);
@@ -775,9 +781,30 @@ function () {
775
781
  }
776
782
  };
777
783
 
778
- DefaultSceneGraphService.prototype.updateTransform = function (element, transform) {
784
+ DefaultSceneGraphService.prototype.syncHierarchy = function (element) {
785
+ var transform = element.entity.getComponent(Transform);
786
+
787
+ if (transform.frozen) {
788
+ return;
789
+ }
790
+
791
+ transform.frozen = true;
792
+
793
+ if (transform.localDirtyFlag || transform.dirtyFlag) {
794
+ this.sync(element, transform);
795
+ }
796
+
797
+ var children = element.childNodes;
798
+
799
+ for (var i = 0; i < children.length; i++) {
800
+ this.syncHierarchy(children[i]);
801
+ }
802
+ };
803
+
804
+ DefaultSceneGraphService.prototype.sync = function (element, transform) {
779
805
  if (transform.localDirtyFlag) {
780
- this.getLocalTransform(element);
806
+ mat4.fromRotationTranslationScaleOrigin(transform.localTransform, transform.localRotation, transform.localPosition, transform.localScale, transform.origin);
807
+ transform.localDirtyFlag = false;
781
808
  }
782
809
 
783
810
  if (transform.dirtyFlag) {
@@ -791,8 +818,36 @@ function () {
791
818
  // @see https://github.com/playcanvas/engine/issues/1077#issuecomment-359765557
792
819
  mat4.multiply(transform.worldTransform, parentTransform.worldTransform, transform.localTransform);
793
820
  }
821
+ }
822
+ };
823
+
824
+ DefaultSceneGraphService.prototype.updateGraphDepth = function (element) {
825
+ var transform = element.entity.getComponent(Transform);
826
+
827
+ if (element.parentNode) {
828
+ transform.graphDepth = element.parentNode.entity.getComponent(Transform).graphDepth + 1;
829
+ } else {
830
+ transform.graphDepth = 0;
831
+ }
832
+
833
+ var children = element.childNodes;
834
+
835
+ for (var i = 0; i < children.length; i++) {
836
+ this.updateGraphDepth(children[i]);
837
+ }
838
+ };
839
+
840
+ DefaultSceneGraphService.prototype.unfreezeParentToRoot = function (child) {
841
+ var p = child.parentNode;
842
+
843
+ while (p) {
844
+ var transform = p.entity.getComponent(Transform);
845
+
846
+ if (transform) {
847
+ transform.frozen = false;
848
+ }
794
849
 
795
- transform.dirtyFlag = false;
850
+ p = p.parentNode;
796
851
  }
797
852
  };
798
853
 
package/lib/Canvas.js CHANGED
@@ -65,7 +65,12 @@ function (_super) {
65
65
 
66
66
 
67
67
  _this.container = _globalModule.globalContainer.createChild();
68
- _this.Element = _DisplayObject.DisplayObject;
68
+ _this.Element = _DisplayObject.DisplayObject; // create document
69
+
70
+ _this.document = new _dom.Document();
71
+ _this.document.defaultView = _this; // create registry of custom elements
72
+
73
+ _this.customElements = new _CustomElementRegistry.CustomElementRegistry();
69
74
  (0, _canvas.cleanExistedCanvas)(config.container, _this);
70
75
  var mergedConfig = (0, _tslib.__assign)((0, _tslib.__assign)({}, config), {
71
76
  cursor: 'default'
@@ -86,12 +91,7 @@ function (_super) {
86
91
  this.container.register({
87
92
  token: _types.CanvasConfig,
88
93
  useValue: mergedConfig
89
- }); // create document
90
-
91
- this.document = new _dom.Document();
92
- this.document.defaultView = this; // create registry of custom elements
93
-
94
- this.customElements = new _CustomElementRegistry.CustomElementRegistry(); // bind rendering context, shared by all renderers
94
+ }); // bind rendering context, shared by all renderers
95
95
 
96
96
  this.container.register({
97
97
  token: _RenderingContext.RenderingContext,
@@ -7,6 +7,8 @@ export declare class Transform extends Component {
7
7
  static tag: string;
8
8
  dirtyFlag: boolean;
9
9
  localDirtyFlag: boolean;
10
+ frozen: boolean;
11
+ graphDepth: number;
10
12
  /**
11
13
  * local space RTS
12
14
  */
@@ -24,6 +24,8 @@ function (_super) {
24
24
 
25
25
  _this.dirtyFlag = false;
26
26
  _this.localDirtyFlag = false;
27
+ _this.frozen = false;
28
+ _this.graphDepth = 0;
27
29
  /**
28
30
  * local space RTS
29
31
  */
@@ -16,10 +16,7 @@ export interface CustomElement<CustomElementStyleProps> {
16
16
  * @see https://yuque.antfin-inc.com/antv/czqvg5/pgqipg
17
17
  */
18
18
  export declare abstract class CustomElement<CustomElementStyleProps> extends DisplayObject<CustomElementStyleProps> {
19
- private shadowNodes;
20
19
  constructor(config: DisplayObjectConfig<CustomElementStyleProps>);
21
20
  private handleMounted;
22
- private handleChildInserted;
23
- private handleChildRemoved;
24
21
  private handleAttributeChanged;
25
22
  }
@@ -18,39 +18,34 @@ var _interfaces = require("../dom/interfaces");
18
18
  var CustomElement =
19
19
  /** @class */
20
20
  function (_super) {
21
- (0, _tslib.__extends)(CustomElement, _super);
21
+ (0, _tslib.__extends)(CustomElement, _super); // private shadowNodes: DisplayObject[] = [];
22
22
 
23
23
  function CustomElement(config) {
24
24
  var _this = _super.call(this, config) || this;
25
25
 
26
- _this.shadowNodes = [];
27
-
28
26
  _this.handleMounted = function () {
29
- _this.shadowNodes.forEach(function (node) {
30
- // every child and its children should turn into a shadow node
31
- // a shadow node doesn't mean to be unrenderable, it's just unsearchable in scenegraph
32
- node.shadow = true;
33
- });
34
-
27
+ // this.shadowNodes.forEach((node) => {
28
+ // // every child and its children should turn into a shadow node
29
+ // // a shadow node doesn't mean to be unrenderable, it's just unsearchable in scenegraph
30
+ // node.shadow = true;
31
+ // });
35
32
  if (_this.connectedCallback) {
36
33
  _this.connectedCallback();
37
34
  }
38
- };
39
-
40
- _this.handleChildInserted = function (e) {
41
- e.target.forEach(function (node) {
42
- // append children like other shapes after mounted
43
- if (!_this.isConnected) {
44
- _this.shadowNodes.push(node);
45
- }
46
- });
47
- };
48
-
49
- _this.handleChildRemoved = function (e) {
50
- e.target.forEach(function (node) {
51
- node.shadow = false;
52
- });
53
- };
35
+ }; // private handleChildInserted = (e: FederatedEvent) => {
36
+ // (e.target as DisplayObject).forEach((node) => {
37
+ // // append children like other shapes after mounted
38
+ // if (!this.isConnected) {
39
+ // this.shadowNodes.push(node as DisplayObject);
40
+ // }
41
+ // });
42
+ // };
43
+ // private handleChildRemoved = (e: FederatedEvent) => {
44
+ // (e.target as DisplayObject).forEach((node) => {
45
+ // node.shadow = false;
46
+ // });
47
+ // };
48
+
54
49
 
55
50
  _this.handleAttributeChanged = function (e) {
56
51
  // only listen itself
@@ -64,11 +59,9 @@ function (_super) {
64
59
  oldValue = _a.oldValue,
65
60
  newValue = _a.newValue;
66
61
  _this.attributeChangedCallback && _this.attributeChangedCallback(attributeName, oldValue, newValue);
67
- };
68
-
69
- _this.addEventListener(_interfaces.ElementEvent.CHILD_INSERTED, _this.handleChildInserted);
62
+ }; // this.addEventListener(ElementEvent.CHILD_INSERTED, this.handleChildInserted);
63
+ // this.addEventListener(ElementEvent.CHILD_REMOVED, this.handleChildRemoved);
70
64
 
71
- _this.addEventListener(_interfaces.ElementEvent.CHILD_REMOVED, _this.handleChildRemoved);
72
65
 
73
66
  if (_this.attributeChangedCallback) {
74
67
  _this.addEventListener(_interfaces.ElementEvent.ATTRIBUTE_CHANGED, _this.handleAttributeChanged);
@@ -60,12 +60,15 @@ var containerModule = (0, _manaSyringe.Module)(function (register) {
60
60
  register({
61
61
  token: _aabb.GeometryUpdaterFactory,
62
62
  useFactory: function useFactory(context) {
63
+ var cache = {};
63
64
  return function (tagName) {
64
- if (context.container.isBoundNamed(_aabb.GeometryAABBUpdater, tagName)) {
65
- return context.container.getNamed(_aabb.GeometryAABBUpdater, tagName);
65
+ if (!cache[tagName]) {
66
+ if (context.container.isBoundNamed(_aabb.GeometryAABBUpdater, tagName)) {
67
+ cache[tagName] = context.container.getNamed(_aabb.GeometryAABBUpdater, tagName);
68
+ }
66
69
  }
67
70
 
68
- return null;
71
+ return cache[tagName];
69
72
  };
70
73
  }
71
74
  }); // bind style property handlers
@@ -73,36 +76,45 @@ var containerModule = (0, _manaSyringe.Module)(function (register) {
73
76
  register({
74
77
  token: _propertyHandlers.StylePropertyParserFactory,
75
78
  useFactory: function useFactory(context) {
79
+ var cache = {};
76
80
  return function (propertyName) {
77
- if (context.container.isBoundNamed(_propertyHandlers.StylePropertyParser, propertyName)) {
78
- return context.container.getNamed(_propertyHandlers.StylePropertyParser, propertyName);
81
+ if (!cache[propertyName]) {
82
+ if (context.container.isBoundNamed(_propertyHandlers.StylePropertyParser, propertyName)) {
83
+ cache[propertyName] = context.container.getNamed(_propertyHandlers.StylePropertyParser, propertyName);
84
+ }
79
85
  }
80
86
 
81
- return null;
87
+ return cache[propertyName];
82
88
  };
83
89
  }
84
90
  });
85
91
  register({
86
92
  token: _propertyHandlers.StylePropertyUpdaterFactory,
87
93
  useFactory: function useFactory(context) {
94
+ var cache = {};
88
95
  return function (propertyName) {
89
- if (context.container.isBoundNamed(_propertyHandlers.StylePropertyUpdater, propertyName)) {
90
- return context.container.getAllNamed(_propertyHandlers.StylePropertyUpdater, propertyName);
96
+ if (!cache[propertyName]) {
97
+ if (context.container.isBoundNamed(_propertyHandlers.StylePropertyUpdater, propertyName)) {
98
+ cache[propertyName] = context.container.getAllNamed(_propertyHandlers.StylePropertyUpdater, propertyName);
99
+ }
91
100
  }
92
101
 
93
- return null;
102
+ return cache[propertyName];
94
103
  };
95
104
  }
96
105
  });
97
106
  register({
98
107
  token: _propertyHandlers.StylePropertyMergerFactory,
99
108
  useFactory: function useFactory(context) {
109
+ var cache = {};
100
110
  return function (propertyName) {
101
- if (context.container.isBoundNamed(_propertyHandlers.StylePropertyMerger, propertyName)) {
102
- return context.container.getNamed(_propertyHandlers.StylePropertyMerger, propertyName);
111
+ if (!cache[propertyName]) {
112
+ if (context.container.isBoundNamed(_propertyHandlers.StylePropertyMerger, propertyName)) {
113
+ cache[propertyName] = context.container.getNamed(_propertyHandlers.StylePropertyMerger, propertyName);
114
+ }
103
115
  }
104
116
 
105
- return null;
117
+ return cache[propertyName];
106
118
  };
107
119
  }
108
120
  });
@@ -644,11 +644,10 @@ function (_super) {
644
644
  }
645
645
 
646
646
  for (var i = 0; i < PROPAGATION_LIMIT && target !== this.rootTarget; i++) {
647
- if (_Node.Node.isNode(target) && !target.parentNode) {
648
- throw new Error('Cannot find propagation path to disconnected target');
649
- }
650
-
651
- if (_Node.Node.isNode(target)) {
647
+ // if (Node.isNode(target) && !target.parentNode) {
648
+ // throw new Error('Cannot find propagation path to disconnected target');
649
+ // }
650
+ if (_Node.Node.isNode(target) && target.parentNode) {
652
651
  // [target, parent, parent, root]
653
652
  propagationPath.push(target.parentNode);
654
653
  target = target.parentNode;
@@ -22,6 +22,7 @@ export interface PickingResult {
22
22
  export declare class RenderingService {
23
23
  private renderingPluginProvider;
24
24
  private renderingContext;
25
+ private sceneGraphService;
25
26
  private inited;
26
27
  hooks: {
27
28
  init: AsyncSeriesHook<[], import("tapable").UnsetAdditionalOptions>;