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

Editorial: Add a missing ref-name for requestPointerLock method #48

Merged
merged 3 commits into from
Jul 16, 2019

Conversation

NavidZ
Copy link
Member

@NavidZ NavidZ commented Jul 15, 2019

Change the ref-name of the functions to make it
easier in the follow up changes to add parameters


Preview | Diff

@NavidZ
Copy link
Member Author

NavidZ commented Jul 15, 2019

@marcoscaceres There was another place in the spec that was referring to requestPointerLock but with no link at the moment.
Context:
... used to enter fullscreen it is sufficient for a subsequent requestPointerLock.

When I change that to <a>requestPointerLock</a> ReSpec complains that it cannot find the reference. Do you know why? Is that a bug in ReSpec or am I missing something?

@marcoscaceres
Copy link
Member

Do you know why? Is that a bug in ReSpec or am I missing something?

You are probably missing: data-link-for="Element" near where you are trying the link... you can add it to the <div class="note" data-link-for="Element"> and it should work.

Copy link
Member

@marcoscaceres marcoscaceres left a comment

Choose a reason for hiding this comment

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

hmm... convention is to have methods as "foo()" throughout the spec. Are you sure you want to change them?

@marcoscaceres
Copy link
Member

Added data-link-for="Element" to the closest <p>, so hopefully now should link ok.

@NavidZ
Copy link
Member Author

NavidZ commented Jul 16, 2019

hmm... convention is to have methods as "foo()" throughout the spec. Are you sure you want to change them?

Convention through out this spec or across W3C specs? At least I know we haven't followed this in PointerEvent spec. Is that written somewhere so I can take a look and see how it generally applies? How does that apply to the functions with parameter? Should we just drop the parameters in links or should we mention them all every time in a link?

Added data-link-for="Element" to the closest

, so hopefully now should link ok.

Yup. This fixed it. Thanks.
For my understanding, I tried reading the meaning of data-link-for here but I got even more confused. Why the link to the exitPointerLock method in the previous paragraph works fine but not in this paragraph? There is only one definition of these functions throughout the spec anyway.

@marcoscaceres
Copy link
Member

Convention through out this spec or across W3C specs?

W3C.

Is that written somewhere so I can take a look and see how it generally applies?

Not explicitly, but you can see examples, for instance, in the TAG's API Design Guidelines:
https://w3ctag.github.io/design-principles/#live-vs-static

And also in the other specs created by the WG:
https://github.com/w3c/webappswg

(open any, search for "()" to find methods)

How does that apply to the functions with parameter?

There are a number of different ways, depending on what you prefer.

Payment Request defines the methods in a h2, then uses <var>, like so:

<h2><dfn>show()</dfn></h2>
<p>
   The <code>show(optional <var data-type="Promise">detailsPromise</var>)</code> method MUST act as follows:
</p>
<ul class="algorithm">
    <!--- stuff -->
</ul>

What is neat about the above is that the type information propagates in the algorithm.

Alternative, if you ever need to just define a method inline with arguments:

<p>
   <dfn data-lt="requestPointerLock()">requestPointerLock(DOMString <var data-type="DOMString">someArg</var>)</dfn>
</p>

Eventually, plan on adding support support for function parameters to the {{ }} syntax too.

@NavidZ NavidZ changed the title Editorial: Change the ref-name of the functions Editorial: Add a missing ref-name for requestPointerLock method Jul 16, 2019
@NavidZ
Copy link
Member Author

NavidZ commented Jul 16, 2019

Fair enough. So let's follow the pattern here then. I removed my changes and also change the new reference to {{}} as from what you said it seems that will get more support and seems to be the recommended way of referencing here.
I'll follow what you suggested here in the following patches that I will send for adding new params.

@marcoscaceres
Copy link
Member

Sounds great. Happy to review changes once new params are added. Looking forward to discussing those.

@NavidZ NavidZ merged commit 6229776 into gh-pages Jul 16, 2019
@NavidZ NavidZ deleted the function-refname branch July 16, 2019 03:02
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.

2 participants