mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-07 04:05:49 +00:00
3a3a7216b5
This adds CSS parser error reporting for parsing of custom properties and normal properties that have variable references. When re-parsing a normal property that had a variable reference, we report any parse error to be at the beginning of the property value. This is because it is difficult to keep track of where exactly each variable substitution came from to point to the particular value that would have caused the parse error. For example, with this: :root { var-a: 1px 2px; var-b: 3px var(a); } p { margin: var(a) var(b); } we would end up resolving the value of 'margin' to: " 1px 2px 3px 1px 2px" In this string, the parse error occurs when we encounter the final "2px", but by this point we don't know where that value came from. So instead we just point to the line on which 'margin' was declared. We extend ErrorReporter with an OutputError overload that takes the specific line and column number to use in the error report to get this right, and we store the line and column number for each token stream we parse on the nsCSSValueTokenStream object. |
||
---|---|---|
.. | ||
chrome |