-
Notifications
You must be signed in to change notification settings - Fork 144
Description
This issue refers to the "Parsing timing specifiers" subsection of this spec: https://www.w3.org/TR/2001/REC-smil-animation-20010904/#TimingAttrValGrammars
The parsing instructions listed do not match the specified begin-value-list and end-value-list grammars with respect to identifiers, which has led to inconsistencies in browser implementations. Identifiers are allowed to contain plus and minus signs, but implementations that follow the instructions explicitly fail to parse identifiers which contain plus or minus signs if not escaped.
Step 5 is the troublesome line:
Else: Build a token substring up to but not including any sign indicator (i.e. strip off any offset).
Given a begin-value-list of begin="first-animation.begin+1s", the grammar yields a parse tree of a syncbase-value:
Syncbase-element of first-animation
Time-symbol of begin
Clock-value of 1s.
If we follow the line above, the string is broken into the tokens first and animation.begin+1s. Since first does not contain a ., it should be parsed as an Event-value. This fails since there is no event called first. Furthermore, animation.begin+1s should then be parsed as a Clock-value, but this also fails.
Plus and minus signs may be escaped, but as the specification does not call this out as it does for dots, I don't believe this was meant to be a requirement. Additionally, the part of the line in parens,
(i.e. strip off any offset)
leads me to believe that the line was meant to read:
"Else: Build a token substring up to but not including the last sign indicator (i.e. strip off any offset)."
This would allow the instructions to better match the grammar and remove the need to escape sign indicators.
Chromium-based browsers appear to have implemented it this way, whereas Firefox has followed the instructions verbatim, resulting in different behaviors. You can see the related issue here: https://bugzilla.mozilla.org/show_bug.cgi?id=1572208
This is a fairly important distinction as it is common for users to include hypens in identifier names.