WebKit Bugzilla
Attachment 359835 Details for
Bug 116191
: Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-116191-20190122191457.patch (text/plain), 31.76 KB, created by
Devin Rousso
on 2019-01-22 19:14:58 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2019-01-22 19:14:58 PST
Size:
31.76 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d9ef453f48665c98734ef9afb53cddd3db4fbab4..048209bd9c9421db8c643392ec42dc8a532308bd 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,40 @@ >+2019-01-22 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number >+ https://bugs.webkit.org/show_bug.cgi?id=116191 >+ <rdar://problem/13905910> >+ >+ Reviewed by Joseph Pecoraro. >+ >+ Test inspector/timeline/line-column.html >+ >+ * bindings/js/ScriptController.cpp: >+ (WebCore::ScriptController::evaluateInWorld): >+ (WebCore::ScriptController::evaluateModule): >+ >+ * bindings/js/JSExecStateInstrumentation.h: >+ (WebCore::JSExecState::instrumentFunctionInternal): >+ >+ * inspector/InspectorInstrumentation.h: >+ (WebCore::InspectorInstrumentation::willCallFunction): >+ (WebCore::InspectorInstrumentation::willEvaluateScript): >+ * inspector/InspectorInstrumentation.cpp: >+ (WebCore::InspectorInstrumentation::willCallFunctionImpl): >+ (WebCore::InspectorInstrumentation::willEvaluateScriptImpl): >+ >+ * inspector/agents/InspectorTimelineAgent.h: >+ * inspector/agents/InspectorTimelineAgent.cpp: >+ (WebCore::InspectorTimelineAgent::willCallFunction): >+ (WebCore::InspectorTimelineAgent::willEvaluateScript): >+ >+ * inspector/TimelineRecordFactory.h: >+ * inspector/TimelineRecordFactory.cpp: >+ (WebCore::TimelineRecordFactory::createFunctionCallData): >+ (WebCore::TimelineRecordFactory::createEvaluateScriptData): >+ >+ * bindings/js/ScriptSourceCode.h: >+ (WebCore::ScriptSourceCode::startColumn const): Added. >+ > 2019-01-22 Alex Christensen <achristensen@webkit.org> > > Fix more builds. >diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 67cdda3ec3a96450140d666744689c76e4f911e5..535dcc78a4849d6cc84098d19dbb8e8be8fffacc 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,14 @@ >+2019-01-22 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number >+ https://bugs.webkit.org/show_bug.cgi?id=116191 >+ <rdar://problem/13905910> >+ >+ Reviewed by Joseph Pecoraro. >+ >+ * UserInterface/Controllers/TimelineManager.js: >+ (WI.TimelineManager.prototype._processRecord): >+ > 2019-01-22 Joseph Pecoraro <pecoraro@apple.com> > > Web Inspector: Network Table appears broken after filter - rows look collapsed >diff --git a/Source/WebCore/bindings/js/JSExecStateInstrumentation.h b/Source/WebCore/bindings/js/JSExecStateInstrumentation.h >index 7a653e5478ff942fae18eb9a810b160161041d35..553dc3dac95284864f8063d73d2e17488ef9d8b1 100644 >--- a/Source/WebCore/bindings/js/JSExecStateInstrumentation.h >+++ b/Source/WebCore/bindings/js/JSExecStateInstrumentation.h >@@ -39,12 +39,14 @@ inline InspectorInstrumentationCookie JSExecState::instrumentFunctionInternal(Sc > return InspectorInstrumentationCookie(); > String resourceName; > int lineNumber = 1; >+ int columnNumber = 1; > if (callType == jsType) { > resourceName = callData.js.functionExecutable->sourceURL(); > lineNumber = callData.js.functionExecutable->firstLine(); >+ columnNumber = callData.js.functionExecutable->startColumn(); > } else > resourceName = "undefined"; >- return InspectorInstrumentation::willCallFunction(context, resourceName, lineNumber); >+ return InspectorInstrumentation::willCallFunction(context, resourceName, lineNumber, columnNumber); > } > > inline InspectorInstrumentationCookie JSExecState::instrumentFunctionCall(ScriptExecutionContext* context, JSC::CallType type, const JSC::CallData& data) >diff --git a/Source/WebCore/bindings/js/ScriptController.cpp b/Source/WebCore/bindings/js/ScriptController.cpp >index 785c66ec47a27a313b8cb0e4f2df836634dbe255..784ae540635a0cfb42ba025715f520357d0c8ef7 100644 >--- a/Source/WebCore/bindings/js/ScriptController.cpp >+++ b/Source/WebCore/bindings/js/ScriptController.cpp >@@ -125,7 +125,7 @@ JSValue ScriptController::evaluateInWorld(const ScriptSourceCode& sourceCode, DO > > Ref<Frame> protector(m_frame); > >- InspectorInstrumentationCookie cookie = InspectorInstrumentation::willEvaluateScript(m_frame, sourceURL, sourceCode.startLine()); >+ InspectorInstrumentationCookie cookie = InspectorInstrumentation::willEvaluateScript(m_frame, sourceURL, sourceCode.startLine(), sourceCode.startColumn()); > > NakedPtr<JSC::Exception> evaluationException; > JSValue returnValue = JSExecState::profiledEvaluate(&exec, JSC::ProfilingReason::Other, jsSourceCode, &proxy, evaluationException); >@@ -218,7 +218,7 @@ JSC::JSValue ScriptController::evaluateModule(const URL& sourceURL, JSModuleReco > > Ref<Frame> protector(m_frame); > >- auto cookie = InspectorInstrumentation::willEvaluateScript(m_frame, sourceURL, jsSourceCode.firstLine().oneBasedInt()); >+ auto cookie = InspectorInstrumentation::willEvaluateScript(m_frame, sourceURL, jsSourceCode.firstLine().oneBasedInt(), jsSourceCode.startColumn().oneBasedInt()); > > auto returnValue = moduleRecord.evaluate(&state); > InspectorInstrumentation::didEvaluateScript(cookie, m_frame); >diff --git a/Source/WebCore/bindings/js/ScriptSourceCode.h b/Source/WebCore/bindings/js/ScriptSourceCode.h >index 286a344f22e99bf83e59b97aea2d0f42b7a51273..fca574cfdaac49badf4d829f192002111437198b 100644 >--- a/Source/WebCore/bindings/js/ScriptSourceCode.h >+++ b/Source/WebCore/bindings/js/ScriptSourceCode.h >@@ -70,6 +70,7 @@ public: > StringView source() const { return m_provider->source(); } > > int startLine() const { return m_code.firstLine().oneBasedInt(); } >+ int startColumn() const { return m_code.startColumn().oneBasedInt(); } > > CachedScript* cachedScript() const { return m_cachedScript.get(); } > >diff --git a/Source/WebCore/inspector/InspectorInstrumentation.cpp b/Source/WebCore/inspector/InspectorInstrumentation.cpp >index cc8f1f033b0c420c056b34a613d96ee607414464..b50303c76e6244a83e96261a3f1296ad24ed7ca1 100644 >--- a/Source/WebCore/inspector/InspectorInstrumentation.cpp >+++ b/Source/WebCore/inspector/InspectorInstrumentation.cpp >@@ -368,11 +368,11 @@ void InspectorInstrumentation::didDispatchPostMessageImpl(InstrumentingAgents& i > pageDebuggerAgent->didDispatchPostMessage(timer); > } > >-InspectorInstrumentationCookie InspectorInstrumentation::willCallFunctionImpl(InstrumentingAgents& instrumentingAgents, const String& scriptName, int scriptLine, ScriptExecutionContext* context) >+InspectorInstrumentationCookie InspectorInstrumentation::willCallFunctionImpl(InstrumentingAgents& instrumentingAgents, const String& scriptName, int scriptLine, int scriptColumn, ScriptExecutionContext* context) > { > int timelineAgentId = 0; > if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent()) { >- timelineAgent->willCallFunction(scriptName, scriptLine, frameForScriptExecutionContext(context)); >+ timelineAgent->willCallFunction(scriptName, scriptLine, scriptColumn, frameForScriptExecutionContext(context)); > timelineAgentId = timelineAgent->id(); > } > return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId); >@@ -441,11 +441,11 @@ void InspectorInstrumentation::eventDidResetAfterDispatchImpl(InstrumentingAgent > domAgent->eventDidResetAfterDispatch(event); > } > >-InspectorInstrumentationCookie InspectorInstrumentation::willEvaluateScriptImpl(InstrumentingAgents& instrumentingAgents, Frame& frame, const String& url, int lineNumber) >+InspectorInstrumentationCookie InspectorInstrumentation::willEvaluateScriptImpl(InstrumentingAgents& instrumentingAgents, Frame& frame, const String& url, int lineNumber, int columnNumber) > { > int timelineAgentId = 0; > if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent()) { >- timelineAgent->willEvaluateScript(url, lineNumber, frame); >+ timelineAgent->willEvaluateScript(url, lineNumber, columnNumber, frame); > timelineAgentId = timelineAgent->id(); > } > return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId); >diff --git a/Source/WebCore/inspector/InspectorInstrumentation.h b/Source/WebCore/inspector/InspectorInstrumentation.h >index fdaea62164ad41a658c1c0338a59d844a4c9e6b0..d559c861a55073ccceaeae4859ea3d03100e218e 100644 >--- a/Source/WebCore/inspector/InspectorInstrumentation.h >+++ b/Source/WebCore/inspector/InspectorInstrumentation.h >@@ -146,7 +146,7 @@ public: > static void willDispatchPostMessage(Frame&, TimerBase&); > static void didDispatchPostMessage(Frame&, TimerBase&); > >- static InspectorInstrumentationCookie willCallFunction(ScriptExecutionContext*, const String& scriptName, int scriptLine); >+ static InspectorInstrumentationCookie willCallFunction(ScriptExecutionContext*, const String& scriptName, int scriptLine, int scriptColumn); > static void didCallFunction(const InspectorInstrumentationCookie&, ScriptExecutionContext*); > static void didAddEventListener(EventTarget&, const AtomicString& eventType, EventListener&, bool capture); > static void willRemoveEventListener(EventTarget&, const AtomicString& eventType, EventListener&, bool capture); >@@ -158,7 +158,7 @@ public: > static InspectorInstrumentationCookie willDispatchEventOnWindow(Frame*, const Event&, DOMWindow&); > static void didDispatchEventOnWindow(const InspectorInstrumentationCookie&); > static void eventDidResetAfterDispatch(const Event&); >- static InspectorInstrumentationCookie willEvaluateScript(Frame&, const String& url, int lineNumber); >+ static InspectorInstrumentationCookie willEvaluateScript(Frame&, const String& url, int lineNumber, int columnNumber); > static void didEvaluateScript(const InspectorInstrumentationCookie&, Frame&); > static InspectorInstrumentationCookie willFireTimer(ScriptExecutionContext&, int timerId, bool oneShot); > static void didFireTimer(const InspectorInstrumentationCookie&); >@@ -338,7 +338,7 @@ private: > static void willDispatchPostMessageImpl(InstrumentingAgents&, const TimerBase&); > static void didDispatchPostMessageImpl(InstrumentingAgents&, const TimerBase&); > >- static InspectorInstrumentationCookie willCallFunctionImpl(InstrumentingAgents&, const String& scriptName, int scriptLine, ScriptExecutionContext*); >+ static InspectorInstrumentationCookie willCallFunctionImpl(InstrumentingAgents&, const String& scriptName, int scriptLine, int scriptColumn, ScriptExecutionContext*); > static void didCallFunctionImpl(const InspectorInstrumentationCookie&, ScriptExecutionContext*); > static void didAddEventListenerImpl(InstrumentingAgents&, EventTarget&, const AtomicString& eventType, EventListener&, bool capture); > static void willRemoveEventListenerImpl(InstrumentingAgents&, EventTarget&, const AtomicString& eventType, EventListener&, bool capture); >@@ -350,7 +350,7 @@ private: > static InspectorInstrumentationCookie willDispatchEventOnWindowImpl(InstrumentingAgents&, const Event&, DOMWindow&); > static void didDispatchEventOnWindowImpl(const InspectorInstrumentationCookie&); > static void eventDidResetAfterDispatchImpl(InstrumentingAgents&, const Event&); >- static InspectorInstrumentationCookie willEvaluateScriptImpl(InstrumentingAgents&, Frame&, const String& url, int lineNumber); >+ static InspectorInstrumentationCookie willEvaluateScriptImpl(InstrumentingAgents&, Frame&, const String& url, int lineNumber, int columnNumber); > static void didEvaluateScriptImpl(const InspectorInstrumentationCookie&, Frame&); > static InspectorInstrumentationCookie willFireTimerImpl(InstrumentingAgents&, int timerId, bool oneShot, ScriptExecutionContext&); > static void didFireTimerImpl(const InspectorInstrumentationCookie&); >@@ -768,11 +768,11 @@ inline void InspectorInstrumentation::didDispatchPostMessage(Frame& frame, Timer > didDispatchPostMessageImpl(*instrumentingAgents, timer); > } > >-inline InspectorInstrumentationCookie InspectorInstrumentation::willCallFunction(ScriptExecutionContext* context, const String& scriptName, int scriptLine) >+inline InspectorInstrumentationCookie InspectorInstrumentation::willCallFunction(ScriptExecutionContext* context, const String& scriptName, int scriptLine, int scriptColumn) > { > FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie()); > if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context)) >- return willCallFunctionImpl(*instrumentingAgents, scriptName, scriptLine, context); >+ return willCallFunctionImpl(*instrumentingAgents, scriptName, scriptLine, scriptColumn, context); > return InspectorInstrumentationCookie(); > } > >@@ -839,11 +839,11 @@ inline void InspectorInstrumentation::eventDidResetAfterDispatch(const Event& ev > return eventDidResetAfterDispatchImpl(*instrumentingAgents, event); > } > >-inline InspectorInstrumentationCookie InspectorInstrumentation::willEvaluateScript(Frame& frame, const String& url, int lineNumber) >+inline InspectorInstrumentationCookie InspectorInstrumentation::willEvaluateScript(Frame& frame, const String& url, int lineNumber, int columnNumber) > { > FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie()); > if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame)) >- return willEvaluateScriptImpl(*instrumentingAgents, frame, url, lineNumber); >+ return willEvaluateScriptImpl(*instrumentingAgents, frame, url, lineNumber, columnNumber); > return InspectorInstrumentationCookie(); > } > >diff --git a/Source/WebCore/inspector/TimelineRecordFactory.cpp b/Source/WebCore/inspector/TimelineRecordFactory.cpp >index 0cab454fc10fb399a8f3a82acbdbb8c6d6df0248..cc45b1f4c2b1126daa1e20de16b87a2c66b792cc 100644 >--- a/Source/WebCore/inspector/TimelineRecordFactory.cpp >+++ b/Source/WebCore/inspector/TimelineRecordFactory.cpp >@@ -57,11 +57,12 @@ Ref<JSON::Object> TimelineRecordFactory::createGenericRecord(double startTime, i > return record; > } > >-Ref<JSON::Object> TimelineRecordFactory::createFunctionCallData(const String& scriptName, int scriptLine) >+Ref<JSON::Object> TimelineRecordFactory::createFunctionCallData(const String& scriptName, int scriptLine, int scriptColumn) > { > Ref<JSON::Object> data = JSON::Object::create(); > data->setString("scriptName"_s, scriptName); > data->setInteger("scriptLine"_s, scriptLine); >+ data->setInteger("scriptColumn"_s, scriptColumn); > return data; > } > >@@ -103,11 +104,12 @@ Ref<JSON::Object> TimelineRecordFactory::createTimerInstallData(int timerId, Sec > return data; > } > >-Ref<JSON::Object> TimelineRecordFactory::createEvaluateScriptData(const String& url, double lineNumber) >+Ref<JSON::Object> TimelineRecordFactory::createEvaluateScriptData(const String& url, int lineNumber, int columnNumber) > { > Ref<JSON::Object> data = JSON::Object::create(); > data->setString("url"_s, url); > data->setInteger("lineNumber"_s, lineNumber); >+ data->setInteger("columnNumber"_s, columnNumber); > return data; > } > >diff --git a/Source/WebCore/inspector/TimelineRecordFactory.h b/Source/WebCore/inspector/TimelineRecordFactory.h >index d5c13ff764dde3b7994a7f13d69f78a1d04da856..5307558759a38385bb8b85e9b9cdd170b13d8281 100644 >--- a/Source/WebCore/inspector/TimelineRecordFactory.h >+++ b/Source/WebCore/inspector/TimelineRecordFactory.h >@@ -49,13 +49,13 @@ class TimelineRecordFactory { > public: > static Ref<JSON::Object> createGenericRecord(double startTime, int maxCallStackDepth); > >- static Ref<JSON::Object> createFunctionCallData(const String& scriptName, int scriptLine); >+ static Ref<JSON::Object> createFunctionCallData(const String& scriptName, int scriptLine, int scriptColumn); > static Ref<JSON::Object> createConsoleProfileData(const String& title); > static Ref<JSON::Object> createProbeSampleData(const Inspector::ScriptBreakpointAction&, unsigned sampleId); > static Ref<JSON::Object> createEventDispatchData(const Event&); > static Ref<JSON::Object> createGenericTimerData(int timerId); > static Ref<JSON::Object> createTimerInstallData(int timerId, Seconds timeout, bool singleShot); >- static Ref<JSON::Object> createEvaluateScriptData(const String&, double lineNumber); >+ static Ref<JSON::Object> createEvaluateScriptData(const String&, int lineNumber, int columnNumber); > static Ref<JSON::Object> createTimeStampData(const String&); > static Ref<JSON::Object> createAnimationFrameData(int callbackId); > static Ref<JSON::Object> createObserverCallbackData(const String& callbackType); >diff --git a/Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp b/Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp >index be026616361ba0de52c103ddc5e3c187c019dc5f..2e270d46a826e2c1cd203a6ef51b5d4c7ffcf269 100644 >--- a/Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp >+++ b/Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp >@@ -293,9 +293,9 @@ void InspectorTimelineAgent::stopFromConsole(JSC::ExecState*, const String& titl > } > } > >-void InspectorTimelineAgent::willCallFunction(const String& scriptName, int scriptLine, Frame* frame) >+void InspectorTimelineAgent::willCallFunction(const String& scriptName, int scriptLine, int scriptColumn, Frame* frame) > { >- pushCurrentRecord(TimelineRecordFactory::createFunctionCallData(scriptName, scriptLine), TimelineRecordType::FunctionCall, true, frame); >+ pushCurrentRecord(TimelineRecordFactory::createFunctionCallData(scriptName, scriptLine, scriptColumn), TimelineRecordType::FunctionCall, true, frame); > } > > void InspectorTimelineAgent::didCallFunction(Frame*) >@@ -402,9 +402,9 @@ void InspectorTimelineAgent::didFireTimer() > didCompleteCurrentRecord(TimelineRecordType::TimerFire); > } > >-void InspectorTimelineAgent::willEvaluateScript(const String& url, int lineNumber, Frame& frame) >+void InspectorTimelineAgent::willEvaluateScript(const String& url, int lineNumber, int columnNumber, Frame& frame) > { >- pushCurrentRecord(TimelineRecordFactory::createEvaluateScriptData(url, lineNumber), TimelineRecordType::EvaluateScript, true, &frame); >+ pushCurrentRecord(TimelineRecordFactory::createEvaluateScriptData(url, lineNumber, columnNumber), TimelineRecordType::EvaluateScript, true, &frame); > } > > void InspectorTimelineAgent::didEvaluateScript(Frame&) >diff --git a/Source/WebCore/inspector/agents/InspectorTimelineAgent.h b/Source/WebCore/inspector/agents/InspectorTimelineAgent.h >index cf2635ee2588913e7673269737847258cc1c231b..4033cdfe17134bf6d76bbc7921e885a8ae2afb1c 100644 >--- a/Source/WebCore/inspector/agents/InspectorTimelineAgent.h >+++ b/Source/WebCore/inspector/agents/InspectorTimelineAgent.h >@@ -118,11 +118,11 @@ public: > void didRemoveTimer(int timerId, Frame*); > void willFireTimer(int timerId, Frame*); > void didFireTimer(); >- void willCallFunction(const String& scriptName, int scriptLine, Frame*); >+ void willCallFunction(const String& scriptName, int scriptLine, int scriptColumn, Frame*); > void didCallFunction(Frame*); > void willDispatchEvent(const Event&, Frame*); > void didDispatchEvent(); >- void willEvaluateScript(const String&, int, Frame&); >+ void willEvaluateScript(const String&, int lineNumber, int columnNumber, Frame&); > void didEvaluateScript(Frame&); > void didInvalidateLayout(Frame&); > void willLayout(Frame&); >diff --git a/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js b/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js >index a254f0059f20411c49f3381e014f75cc8ad65ff3..df8d04f8c0aeeb4bb7abfaec2c14c0d9b38be0c8 100644 >--- a/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js >+++ b/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js >@@ -532,10 +532,9 @@ WI.TimelineManager = class TimelineManager extends WI.Object > var scriptResource = mainFrame.url === recordPayload.data.url ? mainFrame.mainResource : mainFrame.resourceForURL(recordPayload.data.url, true); > if (scriptResource) { > // The lineNumber is 1-based, but we expect 0-based. >- var lineNumber = recordPayload.data.lineNumber - 1; >- >- // FIXME: No column number is provided. >- sourceCodeLocation = scriptResource.createSourceCodeLocation(lineNumber, 0); >+ let lineNumber = recordPayload.data.lineNumber - 1; >+ let columnNumber = "columnNumber" in recordPayload.data ? recordPayload.data.columnNumber - 1 : 0; >+ sourceCodeLocation = scriptResource.createSourceCodeLocation(lineNumber, columnNumber); > } > } > >@@ -586,10 +585,9 @@ WI.TimelineManager = class TimelineManager extends WI.Object > var scriptResource = mainFrame.url === recordPayload.data.scriptName ? mainFrame.mainResource : mainFrame.resourceForURL(recordPayload.data.scriptName, true); > if (scriptResource) { > // The lineNumber is 1-based, but we expect 0-based. >- var lineNumber = recordPayload.data.scriptLine - 1; >- >- // FIXME: No column number is provided. >- sourceCodeLocation = scriptResource.createSourceCodeLocation(lineNumber, 0); >+ let lineNumber = recordPayload.data.scriptLine - 1; >+ let columnNumber = "scriptColumn" in recordPayload.data ? recordPayload.data.scriptColumn - 1 : 0; >+ sourceCodeLocation = scriptResource.createSourceCodeLocation(lineNumber, columnNumber); > } > } > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index c90ff2522694442acb58d914bdfd086cff8dc8ec..d14cbc29367e292f743cd4e6fa2375768b315a2b 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2019-01-22 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number >+ https://bugs.webkit.org/show_bug.cgi?id=116191 >+ <rdar://problem/13905910> >+ >+ Reviewed by Joseph Pecoraro. >+ >+ * inspector/timeline/line-column.html: Added. >+ * inspector/timeline/line-column-expected.txt: Added. >+ > 2019-01-22 Michael Catanzaro <mcatanzaro@igalia.com> > > Unreviewed, skip all resource load statistics tests on GTK >diff --git a/LayoutTests/inspector/timeline/line-column-expected.txt b/LayoutTests/inspector/timeline/line-column-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..532ff95635936aa8140111e2a49d7e277b84fa01 >--- /dev/null >+++ b/LayoutTests/inspector/timeline/line-column-expected.txt >@@ -0,0 +1,238 @@ >+Test that script Timeline records have column numbers. >+ >+ >+ >+== Running test suite: Timeline.LineColumn >+-- Running test case: Timeline.LineColumn.willCallFunction >+Evaluating in page... >+PASS: Capturing started. >+{ >+ "startTime": "<filtered>", >+ "data": {}, >+ "children": [ >+ { >+ "startTime": "<filtered>", >+ "stackTrace": [ >+ { >+ "functionName": "click", >+ "url": "[native code]", >+ "scriptId": "<filtered>", >+ "lineNumber": 0, >+ "columnNumber": 0 >+ }, >+ { >+ "functionName": "willCallFunctionTest", >+ "url": "timeline/line-column.html", >+ "scriptId": "<filtered>", >+ "lineNumber": 26, >+ "columnNumber": 44 >+ }, >+ { >+ "functionName": "global code", >+ "url": "", >+ "scriptId": "<filtered>", >+ "lineNumber": 1, >+ "columnNumber": 21 >+ }, >+ { >+ "functionName": "evaluateWithScopeExtension", >+ "url": "[native code]", >+ "scriptId": "<filtered>", >+ "lineNumber": 0, >+ "columnNumber": 0 >+ }, >+ { >+ "functionName": "", >+ "url": "", >+ "scriptId": "<filtered>", >+ "lineNumber": 134, >+ "columnNumber": 97 >+ } >+ ], >+ "data": {}, >+ "frameId": "<filtered>", >+ "type": "ScheduleStyleRecalculation" >+ }, >+ { >+ "startTime": "<filtered>", >+ "frameId": "<filtered>", >+ "data": { >+ "type": "click" >+ }, >+ "children": [], >+ "endTime": "<filtered>", >+ "type": "EventDispatch" >+ }, >+ { >+ "startTime": "<filtered>", >+ "frameId": "<filtered>", >+ "data": { >+ "type": "click" >+ }, >+ "children": [ >+ { >+ "startTime": "<filtered>", >+ "stackTrace": [ >+ { >+ "functionName": "click", >+ "url": "[native code]", >+ "scriptId": "<filtered>", >+ "lineNumber": 0, >+ "columnNumber": 0 >+ }, >+ { >+ "functionName": "willCallFunctionTest", >+ "url": "timeline/line-column.html", >+ "scriptId": "<filtered>", >+ "lineNumber": 26, >+ "columnNumber": 44 >+ }, >+ { >+ "functionName": "global code", >+ "url": "", >+ "scriptId": "<filtered>", >+ "lineNumber": 1, >+ "columnNumber": 21 >+ }, >+ { >+ "functionName": "evaluateWithScopeExtension", >+ "url": "[native code]", >+ "scriptId": "<filtered>", >+ "lineNumber": 0, >+ "columnNumber": 0 >+ }, >+ { >+ "functionName": "", >+ "url": "", >+ "scriptId": "<filtered>", >+ "lineNumber": 134, >+ "columnNumber": 97 >+ } >+ ], >+ "frameId": "<filtered>", >+ "data": { >+ "scriptName": "timeline/line-column.html", >+ "scriptLine": 17, >+ "scriptColumn": 65 >+ }, >+ "children": [], >+ "endTime": "<filtered>", >+ "type": "FunctionCall" >+ } >+ ], >+ "endTime": "<filtered>", >+ "type": "EventDispatch" >+ }, >+ { >+ "startTime": "<filtered>", >+ "stackTrace": [ >+ { >+ "functionName": "profile", >+ "url": "[native code]", >+ "scriptId": "<filtered>", >+ "lineNumber": 0, >+ "columnNumber": 0 >+ }, >+ { >+ "functionName": "willCallFunctionTest", >+ "url": "timeline/line-column.html", >+ "scriptId": "<filtered>", >+ "lineNumber": 25, >+ "columnNumber": 20 >+ }, >+ { >+ "functionName": "global code", >+ "url": "", >+ "scriptId": "<filtered>", >+ "lineNumber": 1, >+ "columnNumber": 21 >+ }, >+ { >+ "functionName": "evaluateWithScopeExtension", >+ "url": "[native code]", >+ "scriptId": "<filtered>", >+ "lineNumber": 0, >+ "columnNumber": 0 >+ }, >+ { >+ "functionName": "", >+ "url": "", >+ "scriptId": "<filtered>", >+ "lineNumber": 134, >+ "columnNumber": 97 >+ } >+ ], >+ "frameId": "<filtered>", >+ "data": { >+ "title": "" >+ }, >+ "children": [], >+ "endTime": "<filtered>", >+ "type": "ConsoleProfile" >+ } >+ ], >+ "endTime": "<filtered>", >+ "type": "RenderingFrame" >+} >+PASS: Capturing stopped. >+ >+-- Running test case: Timeline.LineColumn.willEvaluateScript >+Evaluating in page... >+PASS: Capturing started. >+{ >+ "startTime": "<filtered>", >+ "data": {}, >+ "children": [ >+ { >+ "startTime": "<filtered>", >+ "stackTrace": [ >+ { >+ "functionName": "profile", >+ "url": "[native code]", >+ "scriptId": "<filtered>", >+ "lineNumber": 0, >+ "columnNumber": 0 >+ }, >+ { >+ "functionName": "willEvaluateScriptTest", >+ "url": "timeline/line-column.html", >+ "scriptId": "<filtered>", >+ "lineNumber": 31, >+ "columnNumber": 20 >+ }, >+ { >+ "functionName": "global code", >+ "url": "", >+ "scriptId": "<filtered>", >+ "lineNumber": 1, >+ "columnNumber": 23 >+ }, >+ { >+ "functionName": "evaluateWithScopeExtension", >+ "url": "[native code]", >+ "scriptId": "<filtered>", >+ "lineNumber": 0, >+ "columnNumber": 0 >+ }, >+ { >+ "functionName": "", >+ "url": "", >+ "scriptId": "<filtered>", >+ "lineNumber": 134, >+ "columnNumber": 97 >+ } >+ ], >+ "frameId": "<filtered>", >+ "data": { >+ "title": "" >+ }, >+ "children": [], >+ "endTime": "<filtered>", >+ "type": "ConsoleProfile" >+ } >+ ], >+ "endTime": "<filtered>", >+ "type": "RenderingFrame" >+} >+PASS: Capturing stopped. >+ >diff --git a/LayoutTests/inspector/timeline/line-column.html b/LayoutTests/inspector/timeline/line-column.html >new file mode 100644 >index 0000000000000000000000000000000000000000..dd9c5aea5034773ee8fed332565eb692b343f723 >--- /dev/null >+++ b/LayoutTests/inspector/timeline/line-column.html >@@ -0,0 +1,107 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<script src="../../http/tests/inspector/resources/protocol-test.js"></script> >+<script> >+ >+function bar(x) >+{ >+ return x * 10; >+} >+ >+function foo() { >+ bar(42); >+} >+ >+function load() { >+ document.querySelector("#button").addEventListener("click", (event) => { >+ foo(); >+ }); >+ >+ runTest(); >+} >+ >+function willCallFunctionTest() { >+ console.profile(); >+ document.querySelector("#button").click(); >+ console.profileEnd(); >+} >+ >+function willEvaluateScriptTest() { >+ console.profile(); >+ foo(); >+ console.profileEnd(); >+} >+ >+function test() { >+ ProtocolTest.debug(); >+ >+ let suite = ProtocolTest.createAsyncSuite("Timeline.LineColumn"); >+ >+ function replacer(key, value) { >+ if (key === "startTime" || key === "endTime" || key === "scriptId" || key === "frameId") >+ return "<filtered>"; >+ if (key === "url" || key === "scriptName") >+ return value.replace(/^.+LayoutTests\/inspector\//, ""); >+ return value; >+ } >+ >+ const tests = [ >+ { >+ name: "Timeline.LineColumn.willCallFunction", >+ description: "Test that column numbers are passed through the willCallFunction instrumentation point.", >+ expression: `willCallFunctionTest()`, >+ }, >+ { >+ name: "Timeline.LineColumn.willEvaluateScript", >+ description: "Test that column numbers are passed through the willEvaluateScript instrumentation point.", >+ expression: `willEvaluateScriptTest()`, >+ }, >+ ]; >+ >+ for (let {name, description, expression} of tests) { >+ suite.addTestCase({ >+ name, >+ description, >+ test(resolve, reject) { >+ let eventNames = []; >+ >+ function handleEvent(eventName, handler) { >+ eventNames.push(eventName); >+ InspectorProtocol.eventHandler[eventName] = handler; >+ } >+ >+ handleEvent("Timeline.eventRecorded", (event) => { >+ ProtocolTest.log(JSON.stringify(event.params.record, replacer, 2)); >+ }); >+ >+ handleEvent("Timeline.programmaticCaptureStarted", () => { >+ ProtocolTest.pass("Capturing started."); >+ }); >+ >+ handleEvent("Timeline.programmaticCaptureStopped", () => { >+ ProtocolTest.pass("Capturing stopped."); >+ >+ for (let eventName of eventNames) >+ delete InspectorProtocol.eventHandler[eventName]; >+ >+ resolve(); >+ }); >+ >+ ProtocolTest.log("Evaluating in page..."); >+ ProtocolTest.evaluateInPage(expression) >+ .catch(reject); >+ }, >+ }); >+ } >+ >+ suite.runTestCasesAndFinish(); >+} >+ >+</script> >+</head> >+<body onload="load()"> >+ <p>Test that script Timeline records have column numbers.</p> >+ <button id="button"></button> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 116191
:
358715
| 359835