Skip to content
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

sensors: Do nothing in Sensor.start() when the document is not fully active. #32514

Merged
merged 1 commit into from
Jan 25, 2022

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Jan 24, 2022

When a sensor is created on e.g. an iframe that is later removed from
its parent via removeChild(), we end up in a situation where a sensor
instance did get created but which does not have a valid
ExecutionContext by the time start() is invoked.

Check for a valid ExecutionContext when start() is called and bail out
early if it is null. w3c/sensors#415 tracks
handling non-fully active documents from a spec perspective; once that
one is fixed we should probably throw an error in this case rather than
silently doing nothing.

Bug: 1289924
Change-Id: I2b033252d93347ba7c91385bdb510b69b8298aa2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3412476
Reviewed-by: Reilly Grant <[email protected]>
Commit-Queue: Raphael Kubo Da Costa <[email protected]>
Cr-Commit-Position: refs/heads/main@{#962930}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

…active.

When a sensor is created on e.g. an iframe that is later removed from
its parent via removeChild(), we end up in a situation where a sensor
instance did get created but which does not have a valid
ExecutionContext by the time start() is invoked.

Check for a valid ExecutionContext when start() is called and bail out
early if it is null. w3c/sensors#415 tracks
handling non-fully active documents from a spec perspective; once that
one is fixed we should probably throw an error in this case rather than
silently doing nothing.

Bug: 1289924
Change-Id: I2b033252d93347ba7c91385bdb510b69b8298aa2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3412476
Reviewed-by: Reilly Grant <[email protected]>
Commit-Queue: Raphael Kubo Da Costa <[email protected]>
Cr-Commit-Position: refs/heads/main@{#962930}
@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 57fbbb2 into master Jan 25, 2022
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-3412476 branch January 25, 2022 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants