[Webkit-unassigned] [Bug 45271] HTML parser should provide script column position within HTML document to JavaScript engine

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 7 12:27:41 PDT 2010


Adam Barth <abarth at webkit.org> changed:

           What    |Removed                     |Added
  Attachment #66664|review?                     |review-
               Flag|                            |

--- Comment #9 from Adam Barth <abarth at webkit.org>  2010-09-07 12:27:41 PST ---
(From update of attachment 66664)
View in context: https://bugs.webkit.org/attachment.cgi?id=66664&action=prettypatch

R- for lack of testing and for likely performance problems.  Check out how view source figures out columns.  It's fast, works, and has some amount of testing.

> WebCore/ChangeLog:8
> +        TODO(peter): fill in description.
Would be nice to have a description.

> WebCore/ChangeLog:10
> +        No new tests. (OOPS!)

> WebCore/bindings/v8/V8Proxy.cpp:402
> -        v8::Handle<v8::Script> script = compileScript(code, source.url(), source.startLine() - 1, scriptData.get());
> +        v8::Handle<v8::Script> script = compileScript(code, source.url(), source.startLine() - 1, source.startColumn() - 1, scriptData.get());
This whole +1/-1 thing is sadness.  We should leverage the C++ type system to help us here.  V8LineNumber / ScriptLineNumber or some such.

> WebCore/html/parser/HTMLScriptRunner.cpp:312
> -void HTMLScriptRunner::runScript(Element* script, int startingLineNumber)
> +void HTMLScriptRunner::runScript(Element* script, int startingLineNumber, int startingColumnNumber)
Does it make sense to put the line number and the column number together to a struct?  ScriptPosition?  Seems like you're touching all these lines of code anyway.

> WebCore/platform/text/SegmentedString.cpp:237
> +          ++cursorPosition.column;
Did you run the parser benchmark?  I bet this costs a bunch of time.  If you look at how the view source code figures out column numbers, you'll find a much faster way.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list