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

Tie [=latest reading=] map to an origin #267

Merged
merged 1 commit into from
Sep 18, 2017

Conversation

pozdnyakov
Copy link

@pozdnyakov pozdnyakov commented Sep 15, 2017

In order to prevent unsanctioned cross-origin communication.


Preview | Diff

@pozdnyakov
Copy link
Author

@lknik PTAL

index.bs Outdated
@@ -751,14 +751,16 @@ A <dfn id=concept-sensor>sensor</dfn> has an associated [=ordered set|set=]
of <dfn>activated sensor objects</dfn>.
This set is initially [=set/is empty|empty=].

A [=sensor=] has an associated <dfn>latest reading</dfn> [=ordered map|map=]
which holds the latest available [=sensor readings=].
For the current [=browsing context=] a [=sensor=] has an associated <dfn>latest reading</dfn>
Copy link
Member

Choose a reason for hiding this comment

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

The current browsing context's sensor has

Copy link
Author

Choose a reason for hiding this comment

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

done

index.bs Outdated

Any time the UA obtains a new [=sensor reading=] for a [=sensor=] from the underlying platform,
it invokes [=update latest reading=] with the [=sensor=] and the [=sensor reading=] as arguments.
Note: User agents may share [=sensor readings=] [=ordered map|map=] between different
Copy link
Member

Choose a reason for hiding this comment

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

s/may/can/

We don't generally use RFC 2119 terms in informative notes for clarity.

Copy link
Author

Choose a reason for hiding this comment

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

done

@alexshalamov
Copy link

lgtm with @anssiko nits

In order to prevent unsanctioned cross-origin communication.
@pozdnyakov
Copy link
Author

@anssiko the patch is updated due to your comments

@lknik
Copy link
Contributor

lknik commented Sep 15, 2017

Good to see that thing!

@pozdnyakov
Copy link
Author

@anssiko could you PTAL at the latest patch?

@anssiko
Copy link
Member

anssiko commented Sep 18, 2017

LGTM.

@pozdnyakov pozdnyakov merged commit c7a76ab into w3c:master Sep 18, 2017
rakuco added a commit that referenced this pull request Feb 16, 2024
The original note was added in #267 and expanded in #347, but its advice is
impractical:
- Sharing the activated sensors objects between multiple browsing
  contexts/documents/windows means these Sensor objects could potentially be
  shared by contexts in different top-level traversables (i.e. different
  tabs).
  Furthermore, if "can expose sensor readings" passes for one context but
  not the other, "update sensor reading" would still invoke "report latest
  reading updated" with sensors that cannot expose sensor readings.
- Similarly, if the latest reading map is shared between multiple contexts,
  an update would affect all contexts, including those for which "update
  sensor reading" should not have been invoked in the first place (e.g. two
  pages with the same origin share the latest readings map, but only one is
  visible; updates to the latest reading map would be accessible from the
  other as well).

PR #267 also made the "platform sensor" concept used in this section
per-browsing context (although in a very confusing way), which on its own is
a stricter requirement than what the note allowed, so we can drop the note
without making things less secure.

Incidentally, this also gets rid of one of the usages of "browsing context"
in the spec, which helps with #444.
rakuco added a commit that referenced this pull request Feb 17, 2024
The original note was added in #267 and expanded in #347, but its advice is
impractical:
- Sharing the activated sensors objects between multiple browsing
  contexts/documents/windows means these Sensor objects could potentially be
  shared by contexts in different top-level traversables (i.e. different
  tabs).
  Furthermore, if "can expose sensor readings" passes for one context but
  not the other, "update sensor reading" would still invoke "report latest
  reading updated" with sensors that cannot expose sensor readings.
- Similarly, if the latest reading map is shared between multiple contexts,
  an update would affect all contexts, including those for which "update
  sensor reading" should not have been invoked in the first place (e.g. two
  pages with the same origin share the latest readings map, but only one is
  visible; updates to the latest reading map would be accessible from the
  other as well).

PR #267 also made the "platform sensor" concept used in this section
per-browsing context (although in a very confusing way), which on its own is
a stricter requirement than what the note allowed, so we can drop the note
without making things less secure.

Incidentally, this also gets rid of one of the usages of "browsing context"
in the spec, which helps with #444.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants