On 2013-02-12 1:37 AM, Robert O'Callahan wrote:
On Tue, Feb 12, 2013 at 6:32 PM, Zack Weinberg <za...@panix.com> wrote:

You want to do this as lazily as possible, since with high probability no
human will ever look at any given CSS error message.  However, I would
still go for the "add source location information to every token" approach
in a greenfields design.  It should be possible to make it be two machine
words per token: a pointer into the text of the entire style sheet, and a
line number.  That's not bad compared to the data that already has to be
carried around for every token.

Couldn't you just make it a pointer into the text of the style sheet? Then
an auxiliary data structure could be used to quickly extract a line number
given such a pointer. (E.g. for each 256 byte boundary in the style sheet,
store the line number at that boundary.)

That's a cute idea. I had previously looked at and rejected the notion of completely-lazy line numbering because some CSSOM objects expose their source line number, but this sounds like a plausible way to split the difference. Might even be worth doing in Gecko.

zw

_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo

Reply via email to