Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Refactor websocket, fullscreen, gamepad #1104

Closed
14 tasks done
wbamberg opened this issue Feb 28, 2019 · 32 comments
Closed
14 tasks done

Refactor websocket, fullscreen, gamepad #1104

wbamberg opened this issue Feb 28, 2019 · 32 comments
Assignees
Labels
Cf:Med Confidence: Medium

Comments

@wbamberg
Copy link

wbamberg commented Feb 28, 2019

@wbamberg wbamberg added the Cf:Med Confidence: Medium label Feb 28, 2019
@irenesmith irenesmith self-assigned this Feb 28, 2019
@irenesmith irenesmith added this to the Grace Jones (S3 Q1 2019) milestone Feb 28, 2019
@wbamberg
Copy link
Author

Thanks for these changes @irenesmith !

Review comments for WebSocket events

  • interface page: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket#Events:

    • not a big thing, but most event descriptions are like "Fired when..." not "The xyz handler is executed when..."
    • the description should also have " Also available via the onxyz property.". See e.g. https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition#Events.
    • I don't understand what "with prejudice" means here and suggest it should be reworded. This wording is also in the event page itself.
  • individual pages:

    • should have "Specifications" and "Browser compatibility" sections
    • should all have "Examples" (note not "Example" even if there is only one). Ideally a live example, but that might be tricky with web sockets. But please try to find out if there is a websocket server you can use for examples.
    • "See also" does not need to link to the on* property, but should link to the other WS events in this group.

@wbamberg
Copy link
Author

wbamberg commented Mar 18, 2019

Review comments for fullscreen events

Two fullscreenchange events are fired; the first is sent to the Element which is transitioning into or out of full-screen mode, and the second is sent to the Document which owns that element.

you could say:

This event is sent to the Document which owns the Element which is transitioning into or out of full-screen mode. Another fullscreenchange event will be sent to the Element which is itself transitioning into or out of full-screen mode.

this could also reaffirm that the event is a toggling event:

To find out whether the Element is entering or exiting full-screen mode, check the value of Document.fullscreenElement: if this value is null then the element is exiting full-screen mode, otherwise it is entering full-screen mode.

const requestor = document.querySelector('div');

requestor.addEventListener('fullscreenchange', (event) => {
  if (document.fullscreenElement) {
    console.log('element entered full-screen');
  } else {
    console.log('element left full-screen');
    }
});

requestor.requestFullscreen();

(btw that example does not work in Firefox Nightly, though I don't know why. It does work in Chrome.)

@wbamberg
Copy link
Author

wbamberg commented Mar 18, 2019

Review comments for GamePad events

@wbamberg
Copy link
Author

wbamberg commented Apr 2, 2019

@irenesmith , also, I'm not clear what the status of this one is, can you give an update please?

@irenesmith
Copy link

@wbamberg I want to make sure that I incorporated all of your suggested changes. I will update this later today (after the mid-sprint meeding)

@irenesmith
Copy link

irenesmith commented Apr 11, 2019

WebSocket page event descriptions updated
WebSocket event pages updated according to comments
WebSocket BCD PR

@wbamberg
Copy link
Author

Thanks for the update @irenesmith !

Review comments for WebSocket

@irenesmith
Copy link

Just goes to show you should never edit stuff at two in the morning.

@wbamberg
Copy link
Author

@irenesmith , @chrisdavidmills, I just saw that this story doesn't seem to be in the current sprint - are you still planning to work on it in this sprint or should we plan to get to it in the next one?

@irenesmith
Copy link

@wbamberg WebSocket events and interface page have been updated.

@Elchi3
Copy link
Member

Elchi3 commented Apr 24, 2019

There is still an open BCD PR that relates to this issue: mdn/browser-compat-data#3812

@wbamberg
Copy link
Author

@wbamberg WebSocket events and interface page have been updated.

@irenesmith , please let me know when you've updated all the pages so I can review them all together.

@irenesmith
Copy link

irenesmith commented Apr 25, 2019

PR for Fullscreen events: PR #3996
PR for Gamepad events: PR #3997

@irenesmith
Copy link

irenesmith commented Apr 30, 2019

@wbamberg I have made updates according to your comments on fullscreen and gamepad events as well as the WebSocket events and all BCD information has been submitted (see pull request links on my previous comment.)

@wbamberg
Copy link
Author

Thanks @irenesmith ! This is closer but there are still some issues. Please feel free to ask if you have any questions about any of them.

https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close_event

  • Spec link is still wrong

https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/error_event

  • Spec link is still wrong

https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/message_event

  • Interface should be MessageEvent not Event
  • Spec link is still wrong

https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/open_event

  • The example source is still mangled
  • Spec link is still wrong

https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenchange_event
https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenerror_event
https://developer.mozilla.org/en-US/docs/Web/API/Element/fullscreenchange_event
https://developer.mozilla.org/en-US/docs/Web/API/Element/fullscreenerror_event

https://developer.mozilla.org/en-US/docs/Web/API/Window/gamepadconnected_event

  • Missing BCD section
  • Interface should be GamepadEvent not Event

https://developer.mozilla.org/en-US/docs/Web/API/Window/gamepadconnected_event

  • Interface should be GamepadEvent not Event

@irenesmith
Copy link

irenesmith commented May 2, 2019

@wbamberg I am not ignoring your final comments on fullscreen events. I will make those changes later this afternoon.

In the meantime, because my PR was totally and completely messed up, I have created a new pull request with a copy of the data that was accidentally pushed to github with the same branch name but different capitalization right before everything went bad.

@chrisdavidmills
Copy link
Contributor

@irenesmith

OK, so here it looks like you just need to respond to the comments at #1104 (comment)

And make sure the new PR you submitted has been merged. Can you link to it here please?

@wbamberg
Copy link
Author

BCD PR for this: mdn/browser-compat-data#4054

@wbamberg
Copy link
Author

I've closed mdn/browser-compat-data#4054 and filed mdn/browser-compat-data#4198 instead.

@chrisdavidmills
Copy link
Contributor

Thanks @wbamberg.

@wbamberg
Copy link
Author

@jswisher, I think the comments in #1104 (comment) still need to be addressed here.

@chrisdavidmills
Copy link
Contributor

I've looked at this again, and gone through all the pages related to the fullscreen events.

the following comments from @wbamberg still have not been responded to:


  • I think it would be helpful if instead of the exact same content for Document and Element to tweak the content. For example, in the Document version instead of:

Two fullscreenchange events are fired; the first is sent to the Element which is transitioning into or out of full-screen mode, and the second is sent to the Document which owns that element.

you could say:

This event is sent to the Document which owns the Element which is transitioning into or out of full-screen mode. Another fullscreenchange event will be sent to the Element which is itself transitioning into or out of full-screen mode.

this could also reaffirm that the event is a toggling event:

To find out whether the Element is entering or exiting full-screen mode, check the value of Document.fullscreenElement: if this value is null then the element is exiting full-screen mode, otherwise it is entering full-screen mode.

const requestor = document.querySelector('div');

requestor.addEventListener('fullscreenchange', (event) => {
  if (document.fullscreenElement) {
    console.log('element entered full-screen');
  } else {
    console.log('element left full-screen');
    }
});

requestor.requestFullscreen();

(btw that example does not work in Firefox Nightly, though I don't know why. It does work in Chrome.)


In addition, https://developer.mozilla.org/en-US/docs/Web/API/Element/fullscreenerror_event doesn't have the full sections filled in — Examples, Specifications, Browser compatibility, See also.

@irenesmith
Copy link

irenesmith commented Jun 12, 2019

All comments not related to the example are now implemented. However, I'm having trouble making a working example. I saw Will's comment that it only works in Chrome, but I'm trying to find a way to code an example that works in Firefox as well.

@wbamberg
Copy link
Author

The comments in #1104 (comment) are still not addressed.

@irenesmith
Copy link

irenesmith commented Jun 12, 2019

Are we looking at the same docs? I made sure that all those comments except for the example had been implemented in the docs before I made the comment.

@chrisdavidmills
Copy link
Contributor

Are we looking at the same docs? I made sure that all those comments except for the example had been implemented in the docs before I made the comment.

Well, I just checked

https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenchange_event
https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenerror_event
https://developer.mozilla.org/en-US/docs/Web/API/Element/fullscreenchange_event
https://developer.mozilla.org/en-US/docs/Web/API/Element/fullscreenerror_event

Which are the docs we are on about that still need fixes made.

Then I checked the first comment that still remains from Will's comments that were not addressed, which is as follows:


I think it would be helpful if instead of the exact same content for Document and Element to tweak the content. For example, in the Document version instead of:

Two fullscreenchange events are fired; the first is sent to the Element which is transitioning into or out of full-screen mode, and the second is sent to the Document which owns that element.

you could say:

This event is sent to the Document which owns the Element which is transitioning into or out of full-screen mode. Another fullscreenchange event will be sent to the Element which is itself transitioning into or out of full-screen mode.

You've only made this change in the first page out of the four I listed. I think you need to check them again.

@irenesmith
Copy link

I should know better than to ever say things like I did. It always seems to turn out that you're wrong. Sometimes I get too focused and miss the forest for the trees (the tree being the event I edited and the forest being the rest of the pages)

@irenesmith
Copy link

I have updated the content and, for fullscreenerror, have implemented the suggestions Will sent me in email.

@wbamberg can you please take another look?

@wbamberg
Copy link
Author

I've made most of the remaining fixes.

One last thing though. At the start of https://developer.mozilla.org/en-US/docs/Web/API/Element/fullscreenchange_event it says "The fullscreenchange event is fired immediately before an Element switches into or out of full-screen mode". But in the Examples section it says "Remember that by the time the fullscreenchange event is handled, the status of the element has already changed".

Which is true?

@irenesmith
Copy link

@wbamberg

What is true is that the event happens directly after the change because there wouldn't be a fullScreenElement otherwise. I have updated both Element and Document appropriately.

@wbamberg
Copy link
Author

Thanks for the clarification @irenesmith ! Then I think this is finished :).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Cf:Med Confidence: Medium
Projects
None yet
Development

No branches or pull requests

6 participants
@chrisdavidmills @irenesmith @Elchi3 @wbamberg @jmswisher and others