Skip to content

Remove Page macro: Feature-Policy accelerometer et al#5240

Merged
wbamberg merged 8 commits intomdn:mainfrom
hamishwillee:pagemacro_featurepolicy_accel
Jun 8, 2021
Merged

Remove Page macro: Feature-Policy accelerometer et al#5240
wbamberg merged 8 commits intomdn:mainfrom
hamishwillee:pagemacro_featurepolicy_accel

Conversation

@hamishwillee
Copy link
Copy Markdown
Collaborator

@hamishwillee hamishwillee commented May 24, 2021

Partial fix for #3196

Feature policies like Feature-Policy: accelerometer previously imported the standard definition of allowlist from Using Feature Policy.

My take on this is that the allowlist is important to have in each of the policies, and it should be duplicated rather than linked. This is partially based on the fact that Feature-Policy is "soon" to be replaced by Permission-Policy (on MDN) so there will be no further modification of the content - ie duplication creates no maintenance issue.

This duplicates the same text for allowlist in each policy. This test is a minor modification of the original. In particular it does not mention the generic "all features have a default value" as that is not necessary to mention here.

Further this fixes up the tags for Experimental, and uses browser-compat for compatibility and specs, where supported by BCD.

@hamishwillee hamishwillee changed the title Remove Page macro: Feature-Policy accelerometer Remove Page macro: Feature-Policy accelerometer et al May 24, 2021
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented May 24, 2021

Preview URLs

Flaws

Note! 28 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy
Title: Feature-Policy
on GitHub
Flaw count: 1

  • macros:
    • /en-US/docs/Web/API/Navigator/requestMIDIAccess does not exist

URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/camera
Title: Feature-Policy: camera
on GitHub
Flaw count: 1

  • macros:
    • /en-US/docs/Web/API/NotAllowedError does not exist

URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/midi
Title: Feature-Policy: midi
on GitHub
Flaw count: 1

  • macros:
    • /en-US/docs/Web/API/Navigator/requestMIDIAccess does not exist

External URLs

URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy
Title: Feature-Policy
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/fullscreen
Title: Feature-Policy: fullscreen
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/battery
Title: Feature-Policy: battery
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/magnetometer
Title: Feature-Policy: magnetometer
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/autoplay
Title: Feature-Policy: autoplay
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/camera
Title: Feature-Policy: camera
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/legacy-image-formats
Title: Feature-Policy: legacy-image-formats
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/gyroscope
Title: Feature-Policy: gyroscope
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/encrypted-media
Title: Feature-Policy: encrypted-media
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/publickey-credentials-get
Title: Feature-Policy: publickey-credentials-get
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/xr
Title: Feature-Policy: xr
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/unoptimized-images
Title: Feature-Policy: unoptimized-images
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/vr
Title: Feature-Policy: vr
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/ambient-light-sensor
Title: Feature-Policy: ambient-light-sensor
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/web-share
Title: web-share
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/unsized-media
Title: Feature-Policy: unsized-media
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/document-domain
Title: Feature-Policy: document-domain
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/geolocation
Title: Feature-Policy: geolocation
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/vibrate
Title: Feature-Policy: vibrate
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/midi
Title: Feature-Policy: midi
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/display-capture
Title: Feature-Policy: display-capture
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/oversized-images
Title: Feature-Policy: oversized-images
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/payment
Title: Feature-Policy: payment
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/accelerometer
Title: Feature-Policy: accelerometer
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/picture-in-picture
Title: Feature-Policy: picture-in-picture
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/microphone
Title: Feature-Policy: microphone
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/layout-animations
Title: Feature-Policy: layout-animations
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/usb
Title: Feature-Policy: usb
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/sync-xhr
Title: Feature-Policy: sync-xhr
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/xr-spatial-tracking
Title: Feature-Policy: xr-spatial-tracking
on GitHub

No new external URLs


URL: /en-US/docs/Web/HTTP/Headers/Feature-Policy/screen-wake-lock
Title: Feature-Policy: screen-wake-lock
on GitHub

No new external URLs

(this comment was updated 2021-06-07 02:18:57.472950)

@hamishwillee hamishwillee marked this pull request as ready for review May 24, 2021 07:32
@hamishwillee hamishwillee requested a review from a team as a code owner May 24, 2021 07:32
@hamishwillee hamishwillee requested review from chrisdavidmills, mirunacurtean and wbamberg and removed request for a team May 24, 2021 07:32
@chrisdavidmills chrisdavidmills removed their request for review May 24, 2021 07:35
@hamishwillee
Copy link
Copy Markdown
Collaborator Author

@wbamberg Could you please review this. While it looks like a lot, in fact it is mostly copy-paste. So if you are happy with the way allowlist looks for one of the docs you can be sure it will be fine for the rest.

Other than that the fixes get compat from BCD, and the spec if present. That stuff also easy to review - and I have tested it.

@wbamberg
Copy link
Copy Markdown
Collaborator

Sorry to be slow looking at this.

I think in a case like this it's better to write the thing once in (in https://pr5240.content.dev.mdn.mozit.cloud/en-US/docs/Web/HTTP/Headers/Feature-Policy#syntax probably) and link to it from the directive pages. The reason is that this is really always the same thing in all the directives, so learning it for one directive means learning it for all of them. By linking to a single definition this is made obvious to the reader. By duplicating it, it's not: they might be similar but subtly different, and a reader has to have that possibility in mind.

I don't feel terribly strongly about this though.

I'm not sure what to do about the duplication in https://developer.mozilla.org/en-US/docs/Web/HTTP/Feature_Policy/Using_Feature_Policy#allowlist. Probably keep it, since it's guide not reference content.

…rent.

Fix up feature-policy to use BCD data for compat (and spec where defined)
@hamishwillee hamishwillee force-pushed the pagemacro_featurepolicy_accel branch from 95e1fba to 220fb65 Compare June 4, 2021 05:47
@hamishwillee
Copy link
Copy Markdown
Collaborator Author

@wbamberg Thanks for the review - hard to fit everything in :-).

Much as I hate to say it, I agree. Have fixed up as you suggested, leaving the "Using" Guide topic unchanged.

Ready for re-review.

Copy link
Copy Markdown
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

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

Thanks for making these updates @hamishwillee . I like it much better like this. There was one where you changed the default policy, and a few that still have the duplicated version.

@hamishwillee
Copy link
Copy Markdown
Collaborator Author

Thanks @wbamberg - sorry about those. All fixed now I believe.

Copy link
Copy Markdown
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

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

Thanks @hamishwillee , this looks great. I'm happy the review's useful :)

@wbamberg wbamberg merged commit 03fa603 into mdn:main Jun 8, 2021
@hamishwillee hamishwillee deleted the pagemacro_featurepolicy_accel branch June 8, 2021 01:21
@hamishwillee
Copy link
Copy Markdown
Collaborator Author

I'm happy the review's useful :)

@wbamberg Well, it does ruin my air of infallibility. Amazing how careful you can think you're being and still miss the bleedingly obvious :-(

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants