-
Notifications
You must be signed in to change notification settings - Fork 64
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
Support for automatically generating backreferences for SDOs #276
Conversation
I don't see |
|
||
sdoBox.deactiveTimeout = null; | ||
[].forEach.call(document.querySelectorAll('emu-grammar[type=definition] emu-rhs'), function (node) { | ||
node.addEventListener('pointerenter', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure whether event delegation would be better for these two listeners. We should ask somebody who does more frontend stuff to advise.
c2d25bb
to
24719dc
Compare
Updated. I uploaded a build of ecma262 made using this PR here so you can see how it looks. |
js/menu.js
Outdated
var parentName = rhs.parentNode.getAttribute('name') | ||
rhs = rhs.cloneNode(true); | ||
rhs.querySelectorAll('emu-params,emu-constraints').forEach(function (e) { e.remove(); }); | ||
rhs.querySelectorAll('emu-opt').forEach(function (e) { e.innerHTML = '_opt' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the styling of the productions in the menu header. I think it's acceptable this way, but I'd prefer the styling to be the same as in the main body (family, weight, italics). But other than subscripting the optionality mark as I mentioned above, I think that can wait until a follow-up PR. |
} | ||
let mainId = match.id; | ||
if (rhs.id == '') { | ||
rhs.id = 'prod-' + sha(`[${sdoName}] ${name} ${rhs.textContent}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You know I'd prefer this to be an hmac. This should be fine, though, if we don't have an hmac function handy.
In pursuit of tc39/ecma262#1950, specifically tc39/ecma262#1950 (comment).
Marked as draft until I've tried it out on the full spec, with tc39/ecma262#1950 done.