This repository has been archived by the owner on Sep 20, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
+2,268
−1,434
Conversation
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
Contributor
sorvell
commented
Mar 15, 2018
- for native tree access prefer using captured native accessors on IE/Edge because they are faster than TreeWalker.
- make ShadowRoot a bespoke object with DocumentFragment's prototype rather than an instance of DocumentFragment because it's faster to create.
- some micro-opts to adding nodes
On some platforms, notably Edge/IE, treewalker is slower than native getters. Therefore prefer native getters when they can be used.
Never directly access shady data storage.
* appendChild avoids looking up ownerRoot in some cases * using native descriptors now explicitly settable * native `isConnected` used where available.
On IE/Edge treewalker is especially slow, but on Chrome/FF/Safari they are marginally faster.
As a performance optimization, ShadowRoot is now not a proper DocumentFragment instance but a bespoke object with DocumentFragment's prototype in its prototype chain.
Also fix textContent setter to fast path to native impl for untracked nodes.
whoh, looking forward to having this in !! |
* must remove children to handle slot removal. * slot removal must clear assigned/flattened nodes.
* make exposed querySelector work with .call for compat * expose shadowed properties on ShadowRoot with correct values * use native accessors on Edge as well as IE
Adds `ShadyDOM.patch` to manually patch a node instance on old Chrome/Safari that do not have prototype accessors. This is needed when `textContent` or `innerHTML` is set on a node in a shadowRoot and a `<slot>` is added/removed. (Added this to `Limitations` section in Readme.)
dfreedm
approved these changes
Mar 16, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Moving all the weird shady data from adhoc into class is great!
5 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.