RESOLVED FIXED 107561
Make BackgroundHTMLParser track line/column numbers
https://bugs.webkit.org/show_bug.cgi?id=107561
Summary Make BackgroundHTMLParser track line/column numbers
Tony Gentilcore
Reported 2013-01-22 10:35:43 PST
Make BackgroundHTMLParser track line/column numbers
Attachments
Patch (6.18 KB, patch)
2013-01-22 10:36 PST, Tony Gentilcore
no flags
Patch for landing (6.16 KB, patch)
2013-01-22 12:21 PST, Tony Gentilcore
no flags
Patch for landing (6.32 KB, patch)
2013-01-22 13:39 PST, Tony Gentilcore
no flags
Tony Gentilcore
Comment 1 2013-01-22 10:36:37 PST
Eric Seidel (no email)
Comment 2 2013-01-22 11:01:26 PST
Comment on attachment 184010 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=184010&action=review > Source/WebCore/html/parser/BackgroundHTMLParser.cpp:128 > + m_pendingTokens.append(CompactHTMLToken(m_token, TextPosition(m_input.current().currentLine(), m_input.current().currentColumn()))); That's unfortunate. I guess tokens are less compact now. :)
Eric Seidel (no email)
Comment 3 2013-01-22 11:02:10 PST
I guess we need lines for each token to handle event handler lines properly?
Eric Seidel (no email)
Comment 4 2013-01-22 11:05:39 PST
This is going to conflict with bug 107317. I think we're also probably going to change compact token to just carry the deltas from the previous token. Those will take up less than 32-bits each, and allow compact token to be smaller again.
Eric Seidel (no email)
Comment 5 2013-01-22 11:06:39 PST
Then we would send the real line number separately in the "Delivery" object, and only the deltas in each token. That means that if for some reason we ever got off, we'd only be off for at max tokenLimit tokens.
WebKit Review Bot
Comment 6 2013-01-22 11:30:19 PST
Comment on attachment 184010 [details] Patch Rejecting attachment 184010 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2 cwd: /mnt/git/webkit-commit-queue Last 500 characters of output: rce/WebKit/chromium/webkit/media/crypto/ppapi/cdm --revision 173055 --non-interactive --force --accept theirs-conflict --ignore-externals' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium' 56>At revision 173055. ________ running '/usr/bin/python tools/clang/scripts/update.py --mac-only' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium' ________ running '/usr/bin/python gyp_webkit' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium' Updating webkit projects from gyp files... Full output: http://queues.webkit.org/results/16043681
Eric Seidel (no email)
Comment 7 2013-01-22 11:30:51 PST
The question of where to draw the line between line number accuracy and parser speed is a separate one we can solve after this. If we only stored per-token-deltas, then we could yield after any token where the delta would be too large. (trading speed for accuracy) or simply ignore the error, or use a solution like you did (which trades some potential speed for accuracy on all documents). I'll follow-up with a separate bug after we get perf data.
Tony Gentilcore
Comment 8 2013-01-22 12:21:59 PST
Created attachment 184033 [details] Patch for landing
WebKit Review Bot
Comment 9 2013-01-22 13:12:42 PST
Comment on attachment 184033 [details] Patch for landing Rejecting attachment 184033 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2 cwd: /mnt/git/webkit-commit-queue Last 500 characters of output: z 2 (offset 8 lines). patching file Source/WebCore/html/parser/CompactHTMLToken.h Hunk #3 succeeded at 65 with fuzz 2. Hunk #4 FAILED at 75. 1 out of 4 hunks FAILED -- saving rejects to file Source/WebCore/html/parser/CompactHTMLToken.h.rej patching file Source/WebCore/html/parser/HTMLDocumentParser.cpp patching file Source/WebCore/html/parser/HTMLDocumentParser.h Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', '--force']" exit_code: 1 cwd: /mnt/git/webkit-commit-queue Full output: http://queues.webkit.org/results/16044730
Eric Seidel (no email)
Comment 10 2013-01-22 13:14:16 PST
It appears my patch won the commit-queue race. :( We'll need to add this to "SameSizeAsCompactToken", which I can do if you'd like: http://trac.webkit.org/changeset/140453/trunk/Source/WebCore/html/parser/CompactHTMLToken.cpp
Tony Gentilcore
Comment 11 2013-01-22 13:39:07 PST
Created attachment 184041 [details] Patch for landing
WebKit Review Bot
Comment 12 2013-01-22 14:14:20 PST
Comment on attachment 184041 [details] Patch for landing Clearing flags on attachment: 184041 Committed r140467: <http://trac.webkit.org/changeset/140467>
WebKit Review Bot
Comment 13 2013-01-22 14:14:24 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.