-
Notifications
You must be signed in to change notification settings - Fork 433
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Infer
renderElement
during Renderer
construction
Follow-up to [#1192][] Closes [#1303][] Remove the argument from all `Renderer` subclass constructor call sites. In its place, define the default value for the `Renderer.renderElement` property based on the `static renderElement(currentElement, newElement)` defined by the inheriting class. By automatically determining which `renderElement` implementation based on class, this commit enables a simpler Frame morphing strategy. Instead of attaching one-time event listeners, this commit maintains a private `#shouldMorphFrame` property that is set, then un-set during the rendering lifecycle of a frame. Similarly, this commit implements the `MorphingFrameRenderer.preservingPermanentElements` method in the same style as the `MorphingPageRenderer.preservingPermanentElements`. Since _instances_ of `MorphingFrameRenderer` are now being used instead of the static `MorphingFrameRenderer.renderElement`, we're able to utilize an instance method instead of passing around an additional anonymous function (which is the implementation that [#1303][] proposed). [#1192]: #1192 [#1303]: #1303 Co-authored-by: Micah Geisel <[email protected]>
- Loading branch information
1 parent
ca5899d
commit 03549a9
Showing
6 changed files
with
32 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters