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

Add "proposed" attribute for IDL #1392

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

szager-chromium
Copy link
Contributor

When an IDL declaration has the 'proposed' extended attribute (i.e.,
it begins with the literal text '[proposed]'), then the generated
html for both the declaration and the definition will be enclosed in
an element with class='proposed'.

When an IDL declaration has the 'proposed' extended attribute (i.e.,
it begins with the literal text '[proposed]'), then the generated
html for both the declaration and the definition will be enclosed in
an element with class='proposed'.
@domenic
Copy link
Collaborator

domenic commented Nov 13, 2018

This seems like a bad idea given there's no Web IDL spec for such an attribute.

Instead, you could just wrap the IDL with such spans yourself.

@szager-chromium
Copy link
Contributor Author

I have wrestled quite a bit with adding those spans and getting bikeshed to do the right thing; some constructs work, others don't.

Here's an example spec produced with this patch:

http://szager-chromium.github.io/IntersectionObserver/

I tried to produce identical styling without hand-editing the output or patching bikeshed, but I couldn't.

@tabatkins
Copy link
Collaborator

Yeah, Bikeshed doesn't generally allow annotating a WebIDL block with markup; it generates its own markup (for a and dfn) and merging two markup trees isn't possible in general. (I can do it for highlighting because highlighting is, in effect, providing color to individual characters; it uses spans containing multiple characters purely for optimization purposes. Thus I can always push highlighting markup "inside of" other markup without breaking anything.)

That said, I could always remove this particular extended attribute from the WebIDL before rendering it, and just reflect it in a wrapper with a class instead.

Alternately, we could just add it to WebIDL as a no-op, or even a recognized but guaranteed invalid extended attribute.

@domenic
Copy link
Collaborator

domenic commented Nov 14, 2018

Stripping before outputting makes sense to me. That does mean Bikeshed has its own Web IDL dialect it takes as input, but maybe that's not so bad, if it's well-documented.

Alternately, it may work to just change the syntax to /* proposed */ instead of [proposed]

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.

3 participants