Repository navigation
Conversation
These are never accessed directly, only ever combined into the final `MEANINGFUL_ATTRIBUTES`. While it works as-is, there may be overhead in constructing the set when an array will suffice.
|
Actually, upon a more fair consideration (smaller set size), the difference is not as noticeable. A native |
|
Unfortunately, even in browsers where MEANINGFUL_ATTRIBUTES.constructor === __WEBPACK_IMPORTED_MODULE_3_babel_runtime_core_js_set__.default
// trueI think moving forward with these changes would only be worthwhile if this could be resolved. |
Agreed. |
|
Sure, let's. In the meantime, I think I'll keep |
Related: #5897
This pull request seeks to optimize the block validator, specifically in its handling of attributes, replacing use of
ArraywithSet, where lookup viaSet#hasis many magnitudes more performant thanArray#indexOf(~4x faster with CoreJS shim, ~9x faster natively). To my surprise while testing, I was not aware thatSetis supported in IE11. Our build process still applies CoreJS, though I'm unsure if it is applied as a proper shim (when not already present in environment). In any case, a further step may be to drop this, though this should probably already be handled viababel-preset-env.Testing instructions:
Verify that tests pass, and there are no regressions in the behavior of block validation (including invalidation), particularly affecting "meaningful attributes" (boolean attributes like
disabledor enumerated attributes likecontenteditable="true").