[editorial] Make algorithm headers clickable#621
Conversation
index.bs
Outdated
| parsed, the object's [=policy/directive set=] will be empty. | ||
| Given a [=string=] |serialized|, a [=policy/source=] |source|, and a [=policy/disposition=] | ||
| |disposition|, the following algorithm returns a parsed [=Content Security Policy object=]. | ||
| If |serialized| could not be parsed, the object's [=policy/directive set=] will be empty. |
There was a problem hiding this comment.
I think I'd have expected the shift to go the other way, moving from treating the header as the definition to explicitly adding a <dfn> to each algorithm. That's what I was suggesting in #618 (comment).
That said, you're doing the work, and I'm fine with this approach if it works...
There was a problem hiding this comment.
I misread your comment then. Putting all definitions in prose is a bit more work, since there are quite a few algorithms. It will also require fixing links from other specs. I can do it, it's just a bit more work.
There was a problem hiding this comment.
That's my preference, but I'll defer to you on whether it's worth doing the work.
There was a problem hiding this comment.
Ok, I finally found the time to make the change. Unfortunately it ended up in a quite huge diff (CSP defines a lot of algorithms!)
Let me know what you think when you have the time to have a look.
index.bs
Outdated
| </pre> | ||
|
|
||
| <h4 id="parse-serialized-policy" algorithm> | ||
| <h4 id="parse-serialized-policy" algorithm dfn> |
There was a problem hiding this comment.
This changes the type from abstract-op to a dfn. I'm a little surprised that didn't break any links.
|
Given the discussion on whatwg/fetch#1714 I made two additional changes. I replaced "should be" with "is" in the various algorithms and I made the exported algorithms return booleans instead of "Allowed"/"Blocked". The changes are in separate commits for easier reviews (I can also split them in different PRs). |
mikewest
left a comment
There was a problem hiding this comment.
This is a very large diff indeed. :)
I very quickly skimmed it, and the kinds of changes you're making look right. I'll go over it again later this morning to see if anything jumps out at me as looking weird.
Adding the
dfnattribute to algorithm headers makes them clickable and makes it possible to find their references.A couple algorithms where defined both in headers and in prose, and we just remove the in-prose-definition for consistency.
Fixes #618.