Ignore:
Timestamp:
Nov 3, 2011, 5:02:05 AM (14 years ago)
Author:
[email protected]
Message:

Web Inspector: preserve script location for inline handlers.
https://bugs.webkit.org/show_bug.cgi?id=71367

Source/JavaScriptCore:

Makes SourceCode factories receive TextPosition instead of the line number;
Stores consistent position values in SourceCode and SourceProvider;

Patch by Pavel Feldman <[email protected]> on 2011-11-03
Reviewed by Yury Semikhatsky.

  • API/JSBase.cpp:

(JSEvaluateScript):
(JSCheckScriptSyntax):

  • API/JSObjectRef.cpp:

(JSObjectMakeFunction):

  • parser/SourceCode.h:

(JSC::makeSource):

  • parser/SourceProvider.h:

(JSC::SourceProvider::SourceProvider):
(JSC::SourceProvider::startPosition):
(JSC::UStringSourceProvider::create):
(JSC::UStringSourceProvider::UStringSourceProvider):

  • runtime/FunctionConstructor.cpp:

(JSC::constructFunction):
(JSC::constructFunctionSkippingEvalEnabledCheck):

  • runtime/FunctionConstructor.h:

Source/WebCore:

Makes eventHandler report position, not line number;

Patch by Pavel Feldman <[email protected]> on 2011-11-03
Reviewed by Yury Semikhatsky.

  • bindings/js/CachedScriptSourceProvider.h:

(WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):

  • bindings/js/JSLazyEventListener.cpp:

(WebCore::JSLazyEventListener::JSLazyEventListener):
(WebCore::JSLazyEventListener::initializeJSFunction):

  • bindings/js/JSLazyEventListener.h:

(WebCore::JSLazyEventListener::create):

  • bindings/js/ScriptController.cpp:

(WebCore::ScriptController::eventHandlerPosition):

  • bindings/js/ScriptController.h:
  • bindings/js/ScriptEventListener.cpp:

(WebCore::createAttributeEventListener):

  • bindings/js/ScriptSourceProvider.h:

(WebCore::ScriptSourceProvider::ScriptSourceProvider):

  • bindings/js/StringSourceProvider.h:

(WebCore::StringSourceProvider::create):
(WebCore::StringSourceProvider::StringSourceProvider):
(WebCore::makeSource):

LayoutTests:

Linkifier test reimplemented for simplisity.

Patch by Pavel Feldman <[email protected]> on 2011-11-03
Reviewed by Yury Semikhatsky.

  • inspector/debugger/debugger-scripts-expected.txt:
  • inspector/debugger/debugger-scripts.html:
  • inspector/debugger/linkifier-expected.txt:
  • inspector/debugger/linkifier.html:
  • platform/chromium/inspector/debugger/debugger-scripts-expected.txt: Copied from LayoutTests/inspector/debugger/debugger-scripts-expected.txt.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/SourceCode.h

    r98887 r99167  
    8585    };
    8686
    87     inline SourceCode makeSource(const UString& source, const UString& url = UString(), int firstLine = 1)
     87    inline SourceCode makeSource(const UString& source, const UString& url = UString(), const TextPosition& startPosition = TextPosition::minimumPosition())
    8888    {
    89         return SourceCode(UStringSourceProvider::create(source, url), firstLine);
     89        return SourceCode(UStringSourceProvider::create(source, url, startPosition), startPosition.m_line.oneBasedInt());
    9090    }
    9191   
Note: See TracChangeset for help on using the changeset viewer.