-
Notifications
You must be signed in to change notification settings - Fork 25
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
Refine Specifications Definitions data model #336
Comments
The versions with arguments are required when you have overloads, which are distinct entities in WebIDL and must be independently linkable. It's unfortunate that this ends up causing a lot of annoyance and confusion, but I don't see a way around it besides "Bikeshed doesn't support overloads". (Technically overloads must be unique according to argument types, not names, but that would be even worse to deal with for spec authors and autolinks, and in practice argument names almost always naturally uniquify an overload set.) |
We've had the same struggles with overloads... I've been considering using something like C++ name mangling to address it. Another thing that's come up recently is making sure the letter casing of exported terms in retained. I think bikeshed's data normalizes to lowercase, which can be confusing for things like About the headings, we could definitely add the |
I noticed that as well in #332 - right now, the definition extraction from Rreffy keep the case of the extracted terms as-is. I think it should be on the consumer side that, based on the type of the definition, case-sensitivity should be taken into account (e.g. CSS properties are case insensitive, IDL names aren't). |
That makes a lot more sense now, thanks for the explanation. I wonder if we could limit that behavior to methods that actually have overloads. Now that WebIDL requires overloads to be defined in a single place, I believe ReSpec/Bikeshed could detect this and expose the arguments only in that case. Since overloads are rather exceptional in any case, I think special-casing them would be OK. List of overloads known in Reffy{ "https://html.spec.whatwg.org/multipage/": [ "HTMLInputElement.setRangeText", "HTMLSelectElement.remove", "HTMLTextAreaElement.setRangeText", "CanvasTransform.setTransform", "CanvasDrawPath.fill", "CanvasDrawPath.stroke", "CanvasDrawPath.clip", "CanvasDrawPath.isPointInPath", "CanvasDrawPath.isPointInStroke", "CanvasUserInterface.drawFocusIfNeeded", "CanvasUserInterface.scrollPathIntoView", "CanvasDrawImage.drawImage", "CanvasImageData.createImageData", "CanvasImageData.putImageData", "DataTransferItemList.add", "Window.alert", "Window.postMessage", "WindowOrWorkerGlobalScope.createImageBitmap", "WebSocket.send", "MessagePort.postMessage", "DedicatedWorkerGlobalScope.postMessage", "Worker.postMessage" ], "https://wicg.github.io/cookie-store/": [ "CookieStore.get", "CookieStore.getAll", "CookieStore.set", "CookieStore.delete" ], "https://wicg.github.io/web-locks/": [ "LockManager.request" ], "https://www.khronos.org/registry/webgl/specs/latest/1.0/": [ "WebGLRenderingContextOverloads.bufferData", "WebGLRenderingContextOverloads.texImage2D", "WebGLRenderingContextOverloads.texSubImage2D" ], "https://www.khronos.org/registry/webgl/specs/latest/2.0/": [ "WebGL2RenderingContextBase.texImage3D", "WebGL2RenderingContextBase.texSubImage3D", "WebGL2RenderingContextBase.compressedTexImage3D", "WebGL2RenderingContextBase.compressedTexSubImage3D", "WebGL2RenderingContextOverloads.bufferData", "WebGL2RenderingContextOverloads.bufferSubData", "WebGL2RenderingContextOverloads.texImage2D", "WebGL2RenderingContextOverloads.texSubImage2D", "WebGL2RenderingContextOverloads.compressedTexImage2D", "WebGL2RenderingContextOverloads.compressedTexSubImage2D", "WebGL2RenderingContextOverloads.readPixels" ], "https://www.w3.org/TR/presentation-api/": [ "PresentationConnection.send" ], "https://www.w3.org/TR/service-workers-1/": [ "ServiceWorker.postMessage", "Client.postMessage" ], "https://www.w3.org/TR/wasm-js-api-1/": [ "WebAssembly.instantiate" ], "https://www.w3.org/TR/webaudio/": [ "AudioNode.connect", "AudioNode.disconnect" ], "https://www.w3.org/TR/webrtc/": [ "RTCPeerConnection.createOffer", "RTCPeerConnection.createAnswer", "RTCPeerConnection.setLocalDescription", "RTCPeerConnection.setRemoteDescription", "RTCPeerConnection.addIceCandidate", "RTCDataChannel.send" ], "https://xhr.spec.whatwg.org/": [ "XMLHttpRequest.open", "FormData.append", "FormData.set" ] }(at least in the case of RTCDataChannel.send and WebSocket.send, they could be rewritten as Union) |
Re case sensitivity, some related discussions on this: speced/bikeshed#861 speced/bikeshed#1705 |
For overloads, I'm happy to add support for whatever, but just need a clear specification is needed in terms of markup. |
we should confirm if an empty |
We can explicitly |
(I need to check, but I think ReSpec never defines partials... I recall we always "xref" them and assume they are defined in another specification). |
I see that this (and presumably some other of the points I identified) are actually done in bikeshed import of shepherd rather than shepherd directly https://github.com/tabatkins/bikeshed/blob/master/bikeshed/update/updateCrossRefs.py |
Ooooh, I didn't realize that restriction was in place now. Yeah, in that case I'm totally in favor of only doing argument stuff when an overload is actually present, and in all other cases just dfn'ing the argless term. |
Back to refining the specifications definitions data model, I note the need to clarify the "comma-separated value" rule, as noted in #229 (comment) |
Another potential addition to the data model that we discussed the other day with @marcoscaceres : it would probably be useful to have algorithm dfn-type, and to be able to annotate it optionally with the expected type of its input/output. (the latter would be useful in ensuring that users of a given algorithm update their input/output when the said algorithm evolves) |
Closing this issue as I believe all points raised here got raised in the speced/spec-dfn-contract repo, where they should get addressed. |
Bikeshed defines the contract that specifications need to follow to have their definitions included in the bikeshed list of references, which ReSpec imports as well.
Reffy aims to provide a new source of data for these definitions with more up-to-date and accurate data (given e.g. its capability to parse ReSpec live-generated editors draft), and while there are a few remaining issues (#333, #334, #335), the gist of the diff between what Reffy finds and what Shepherd finds comes from rules that Shepherd applies that aren't described in the contract.
This issue aims at gathering input from @tabatkins, @marcoscaceres @sidvishnoi and @plinss on refinements to the spec definition parsing contract, to make sure what reffy produces aligns with what editing tools outputs and what editing tools would want to consume for cross-references.
Analyzing the diff between reffy and shepherd, the following aspects need clarification:
dfn-type
dfn
, shepherd seems to convert curly quotes (’
) into straight ones ('
) - is that something we want to preserve?dfn-type
enum-value
, bikeshed includes a version of the linking text which includes the surrounding"
, whereas respec only has the"
-less version; shepherd strips them (per the above), but it would seem better to align the editing tools heretype-dfn
to other elements, and when applied to headings that get auto-numbered, currently following the spec definition contract also extracts the section number (which is of course not wanted); shepherd seems to be stripping it, but maybe instead the spec tools should turn<h3 data-type=dfn>Foo</h3>
into<h3>4.2 <dfn>Foo</dfn></h3>
?The text was updated successfully, but these errors were encountered: