-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: provide a way to disable document patching #1221
fix: provide a way to disable document patching #1221
Conversation
function isGlobalPatchingSkipped() { | ||
if (isUndefined(skipGlobalPatching)) { | ||
skipGlobalPatching = | ||
document.body.getAttribute('data-global-patching-skipped-temporarily') === |
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.
open to suggestions for the attribute name and value
const filtered = ArrayFilter.call(elements, elm => getNodeOwnerKey(elm) === ownerKey); | ||
const filtered = ArrayFilter.call( | ||
elements, | ||
elm => getNodeOwnerKey(elm) === ownerKey || isGlobalPatchingSkipped() |
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.
This check could go outside the ArrayFilter, but I wanted to leave it in here so that it gives us the performance cost of document patching. In effect, we execute the filtering rule and skip it. The core perf scripts will measure the cost of document patching.
function isGlobalPatchingSkipped() { | ||
if (isUndefined(skipGlobalPatching)) { | ||
skipGlobalPatching = | ||
document.body.getAttribute('data-global-patching-skipped-temporarily') === |
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.
Liked this data attribute approach better than the url approach. This is subtle and hidden from plain sight where as the url would have been more visible and more people would notice it(and start abusing it)
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.
If you must.... :(
* fix: provide a way to disable document patching * fix: update names and move function out
* fix(engine): fixes #1199 and #1198 - disconnecting bug (#1202) (#1209) * fix(engine): issues #1199 and #1198 when disconnecting * fix(engine): PR 1202 feedback * fix(engine): undefined elm needs protection * fix(engine): adding tests for PR 1202 * fix(engine): test fix for native shadow * fix: refactor mutation observer polyfill to fix memory leaks (#1200) * fix: refactor mutation observer polyfill to fix memory leaks * fix: address pr feedback * test(integration-karma): migrate nested-template-event-target (#1207) * test(integration-karma): migrate nested-template-event-target * test(integration-karma): migrate root-listener-event-target * test(integration-karma): migrate slotted-custome-element-event-target * test(integration-karma): migrate nested-render-conditional * test: increase timeout for two tests that flap in ie11 * fix(synthetic-shadow): types and bugs in preparation for final split (#1192) * fix(synthetic-shadow): types and bugs * fix(synthetic-shadow): activeElement only works if patch on doc * fix(synthetic-shadow): PR 1192 feedback * fix(synthetic-shadow): bug fix for async retargeting * fix: prevent tabbing into subtrees with tabindex -1 (#1206) * test: adjust tests to reproduce issue * refactor: tabIndex setter comment * refactor: keyboard focus handling relative to current context * test: failing test for internal negative tabindex * fix: correct tabbing when negative tabindex in zero tabindex * chore: remove .only * chore: use getOwnerDocument instead of ownerDocumentGetter * chore: refactor test to use blocking selenium api * test(integration-karma): migrate misc tests from integration-test (#1212) * test(integration-karma): migrate non-composed-events-on-custom-element * test(integration-karma): migrate events/slotted-native-element * test(integration-karma): migrate events/window-event-listiner * test(integration-karma): roolback migrate window-event-listener * test(integration-karma): migrate rendering/duplicate-text-rendering * test(integration-karma): migrate rendering/form-tag * test(integration-karma): migrate rendering/nested-state * test(integration-karma): migrate rendering/null-logging * feat(babel): add filename/location to error (#1208) * feat(babel): add filename/location to error * wip: fix tests * wip: return consistent location object * wip: review comments * fix: provide a way to disable document patching (#1221) * fix: provide a way to disable document patching * fix: update names and move function out
* fix: provide a way to disable document patching * fix: update names and move function out
* fix: provide a way to disable document patching * fix: update names and move function out
Details
Provide a way for core folks to bypass shadow semantics on document and document.body(shoot themselves in the foot)
Does this PR introduce a breaking change?