Changeset 243269 in webkit
- Timestamp:
- Mar 20, 2019, 5:55:40 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 15 added
- 14 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/inspector/timeline/resources/timeline-event-utilities.js (added)
-
LayoutTests/inspector/timeline/timeline-event-CancelAnimationFrame-expected.txt (added)
-
LayoutTests/inspector/timeline/timeline-event-CancelAnimationFrame.html (added)
-
LayoutTests/inspector/timeline/timeline-event-EventDispatch-expected.txt (added)
-
LayoutTests/inspector/timeline/timeline-event-EventDispatch.html (added)
-
LayoutTests/inspector/timeline/timeline-event-FireAnimationFrame-expected.txt (added)
-
LayoutTests/inspector/timeline/timeline-event-FireAnimationFrame.html (added)
-
LayoutTests/inspector/timeline/timeline-event-RequestAnimationFrame-expected.txt (added)
-
LayoutTests/inspector/timeline/timeline-event-RequestAnimationFrame.html (added)
-
LayoutTests/inspector/timeline/timeline-event-TimerFire-expected.txt (added)
-
LayoutTests/inspector/timeline/timeline-event-TimerFire.html (added)
-
LayoutTests/inspector/timeline/timeline-event-TimerInstall-expected.txt (added)
-
LayoutTests/inspector/timeline/timeline-event-TimerInstall.html (added)
-
LayoutTests/inspector/timeline/timeline-event-TimerRemove-expected.txt (added)
-
LayoutTests/inspector/timeline/timeline-event-TimerRemove.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/EventTarget.cpp (modified) (1 diff)
-
Source/WebCore/inspector/InspectorInstrumentation.cpp (modified) (2 diffs)
-
Source/WebCore/inspector/InspectorInstrumentation.h (modified) (4 diffs)
-
Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp (modified) (1 diff)
-
Source/WebCore/inspector/agents/InspectorTimelineAgent.h (modified) (1 diff)
-
Source/WebCore/page/DOMWindow.cpp (modified) (1 diff)
-
Source/WebInspectorUI/ChangeLog (modified) (1 diff)
-
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (modified) (1 diff)
-
Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js (modified) (1 diff)
-
Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js (modified) (4 diffs)
-
Source/WebInspectorUI/UserInterface/Views/ScriptDetailsTimelineView.js (modified) (1 diff)
-
Source/WebInspectorUI/UserInterface/Views/ScriptTimelineDataGridNode.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r243264 r243269 1 2019-03-20 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Timeline should show when events preventDefault() was called on an event or not 4 https://bugs.webkit.org/show_bug.cgi?id=176824 5 <rdar://problem/34290931> 6 7 Reviewed by Timothy Hatcher. 8 9 Original patch by Joseph Pecoraro <pecoraro@apple.com>. 10 11 * inspector/timeline/resources/timeline-event-utilities.js: Added. 12 (finishRecording): 13 (TestPage.registerInitializer.InspectorTest.TimelineEvent.captureTimelineWithScript): 14 (TestPage.registerInitializer): 15 Helper code for creating a recording from a function. 16 17 * inspector/timeline/timeline-event-CancelAnimationFrame.html: Added. 18 * inspector/timeline/timeline-event-CancelAnimationFrame-expected.txt: Added. 19 * inspector/timeline/timeline-event-EventDispatch.html: Added. 20 * inspector/timeline/timeline-event-EventDispatch-expected.txt: Added. 21 * inspector/timeline/timeline-event-FireAnimationFrame.html: Added. 22 * inspector/timeline/timeline-event-FireAnimationFrame-expected.txt: Added. 23 * inspector/timeline/timeline-event-RequestAnimationFrame.html: Added. 24 * inspector/timeline/timeline-event-RequestAnimationFrame-expected.txt: Added. 25 * inspector/timeline/timeline-event-TimerFire.html: Added. 26 * inspector/timeline/timeline-event-TimerFire-expected.txt: Added. 27 * inspector/timeline/timeline-event-TimerInstall.html: Added. 28 * inspector/timeline/timeline-event-TimerInstall-expected.txt: Added. 29 * inspector/timeline/timeline-event-TimerRemove.html: Added. 30 * inspector/timeline/timeline-event-TimerRemove-expected.txt: Added. 31 1 32 2019-03-20 Devin Rousso <drousso@apple.com> 2 33 -
trunk/Source/WebCore/ChangeLog
r243266 r243269 1 2019-03-20 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Timeline should show when events preventDefault() was called on an event or not 4 https://bugs.webkit.org/show_bug.cgi?id=176824 5 <rdar://problem/34290931> 6 7 Reviewed by Timothy Hatcher. 8 9 Original patch by Joseph Pecoraro <pecoraro@apple.com>. 10 11 Tests: inspector/timeline/timeline-event-CancelAnimationFrame.html 12 inspector/timeline/timeline-event-EventDispatch.html 13 inspector/timeline/timeline-event-FireAnimationFrame.html 14 inspector/timeline/timeline-event-RequestAnimationFrame.html 15 inspector/timeline/timeline-event-TimerFire.html 16 inspector/timeline/timeline-event-TimerInstall.html 17 inspector/timeline/timeline-event-TimerRemove.html 18 19 * dom/EventTarget.cpp: 20 (WebCore::EventTarget::innerInvokeEventListeners): 21 * page/DOMWindow.cpp: 22 (WebCore::DOMWindow::dispatchEvent): 23 Include `defaultPrevented` when notifying inspector. 24 25 * inspector/InspectorInstrumentation.h: 26 (WebCore::InspectorInstrumentation::didDispatchEvent): 27 (WebCore::InspectorInstrumentation::didDispatchEventOnWindow): 28 * inspector/InspectorInstrumentation.cpp: 29 (WebCore::InspectorInstrumentation::didDispatchEventImpl): 30 (WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl): 31 Pass `defaultPrevented` on to agent. 32 33 * inspector/agents/InspectorTimelineAgent.h: 34 * inspector/agents/InspectorTimelineAgent.cpp: 35 (WebCore::InspectorTimelineAgent::didDispatchEvent): 36 Append a boolean `defaultPrevented` property on the `EventDispatch` timeline record's data. 37 1 38 2019-03-20 Antoine Quint <graouts@apple.com> 2 39 -
trunk/Source/WebCore/dom/EventTarget.cpp
r242940 r243269 317 317 318 318 if (contextIsDocument) 319 InspectorInstrumentation::didDispatchEvent(willDispatchEventCookie );319 InspectorInstrumentation::didDispatchEvent(willDispatchEventCookie, event.defaultPrevented()); 320 320 } 321 321 -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r243219 r243269 414 414 } 415 415 416 void InspectorInstrumentation::didDispatchEventImpl(const InspectorInstrumentationCookie& cookie )416 void InspectorInstrumentation::didDispatchEventImpl(const InspectorInstrumentationCookie& cookie, bool defaultPrevented) 417 417 { 418 418 if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie)) 419 timelineAgent->didDispatchEvent( );419 timelineAgent->didDispatchEvent(defaultPrevented); 420 420 } 421 421 … … 432 432 } 433 433 434 void InspectorInstrumentation::didDispatchEventOnWindowImpl(const InspectorInstrumentationCookie& cookie )434 void InspectorInstrumentation::didDispatchEventOnWindowImpl(const InspectorInstrumentationCookie& cookie, bool defaultPrevented) 435 435 { 436 436 if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie)) 437 timelineAgent->didDispatchEvent( );437 timelineAgent->didDispatchEvent(defaultPrevented); 438 438 } 439 439 -
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
r243219 r243269 153 153 static bool isEventListenerDisabled(EventTarget&, const AtomicString& eventType, EventListener&, bool capture); 154 154 static InspectorInstrumentationCookie willDispatchEvent(Document&, const Event&, bool hasEventListeners); 155 static void didDispatchEvent(const InspectorInstrumentationCookie& );155 static void didDispatchEvent(const InspectorInstrumentationCookie&, bool defaultPrevented); 156 156 static void willHandleEvent(ScriptExecutionContext&, Event&, const RegisteredEventListener&); 157 157 static void didHandleEvent(ScriptExecutionContext&); 158 158 static InspectorInstrumentationCookie willDispatchEventOnWindow(Frame*, const Event&, DOMWindow&); 159 static void didDispatchEventOnWindow(const InspectorInstrumentationCookie& );159 static void didDispatchEventOnWindow(const InspectorInstrumentationCookie&, bool defaultPrevented); 160 160 static void eventDidResetAfterDispatch(const Event&); 161 161 static InspectorInstrumentationCookie willEvaluateScript(Frame&, const String& url, int lineNumber, int columnNumber); … … 348 348 static void willHandleEventImpl(InstrumentingAgents&, Event&, const RegisteredEventListener&); 349 349 static void didHandleEventImpl(InstrumentingAgents&); 350 static void didDispatchEventImpl(const InspectorInstrumentationCookie& );350 static void didDispatchEventImpl(const InspectorInstrumentationCookie&, bool defaultPrevented); 351 351 static InspectorInstrumentationCookie willDispatchEventOnWindowImpl(InstrumentingAgents&, const Event&, DOMWindow&); 352 static void didDispatchEventOnWindowImpl(const InspectorInstrumentationCookie& );352 static void didDispatchEventOnWindowImpl(const InspectorInstrumentationCookie&, bool defaultPrevented); 353 353 static void eventDidResetAfterDispatchImpl(InstrumentingAgents&, const Event&); 354 354 static InspectorInstrumentationCookie willEvaluateScriptImpl(InstrumentingAgents&, Frame&, const String& url, int lineNumber, int columnNumber); … … 794 794 } 795 795 796 inline void InspectorInstrumentation::didDispatchEvent(const InspectorInstrumentationCookie& cookie )796 inline void InspectorInstrumentation::didDispatchEvent(const InspectorInstrumentationCookie& cookie, bool defaultPrevented) 797 797 { 798 798 FAST_RETURN_IF_NO_FRONTENDS(void()); 799 799 if (cookie.isValid()) 800 didDispatchEventImpl(cookie );800 didDispatchEventImpl(cookie, defaultPrevented); 801 801 } 802 802 … … 823 823 } 824 824 825 inline void InspectorInstrumentation::didDispatchEventOnWindow(const InspectorInstrumentationCookie& cookie )825 inline void InspectorInstrumentation::didDispatchEventOnWindow(const InspectorInstrumentationCookie& cookie, bool defaultPrevented) 826 826 { 827 827 FAST_RETURN_IF_NO_FRONTENDS(void()); 828 828 if (cookie.isValid()) 829 didDispatchEventOnWindowImpl(cookie );829 didDispatchEventOnWindowImpl(cookie, defaultPrevented); 830 830 } 831 831 -
trunk/Source/WebCore/inspector/agents/InspectorTimelineAgent.cpp
r243119 r243269 307 307 } 308 308 309 void InspectorTimelineAgent::didDispatchEvent() 310 { 309 void InspectorTimelineAgent::didDispatchEvent(bool defaultPrevented) 310 { 311 auto& entry = m_recordStack.last(); 312 ASSERT(entry.type == TimelineRecordType::EventDispatch); 313 entry.data->setBoolean("defaultPrevented"_s, defaultPrevented); 314 311 315 didCompleteCurrentRecord(TimelineRecordType::EventDispatch); 312 316 } -
trunk/Source/WebCore/inspector/agents/InspectorTimelineAgent.h
r243119 r243269 116 116 void didCallFunction(Frame*); 117 117 void willDispatchEvent(const Event&, Frame*); 118 void didDispatchEvent( );118 void didDispatchEvent(bool defaultPrevented); 119 119 void willEvaluateScript(const String&, int lineNumber, int columnNumber, Frame&); 120 120 void didEvaluateScript(Frame&); -
trunk/Source/WebCore/page/DOMWindow.cpp
r243163 r243269 2110 2110 fireEventListeners(event, EventInvokePhase::Capturing); 2111 2111 fireEventListeners(event, EventInvokePhase::Bubbling); 2112 InspectorInstrumentation::didDispatchEventOnWindow(cookie );2112 InspectorInstrumentation::didDispatchEventOnWindow(cookie, event.defaultPrevented()); 2113 2113 event.resetAfterDispatch(); 2114 2114 } -
trunk/Source/WebInspectorUI/ChangeLog
r243264 r243269 1 2019-03-20 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Timeline should show when events preventDefault() was called on an event or not 4 https://bugs.webkit.org/show_bug.cgi?id=176824 5 <rdar://problem/34290931> 6 7 Reviewed by Timothy Hatcher. 8 9 Original patch by Joseph Pecoraro <pecoraro@apple.com>. 10 11 * Localizations/en.lproj/localizedStrings.js: 12 New string. 13 14 * UserInterface/Controllers/TimelineManager.js: 15 (WI.TimelineManager.prototype._processRecord): 16 Include the whole data object as extra details. 17 18 * UserInterface/Models/ScriptTimelineRecord.js: 19 (WI.ScriptTimelineRecord): 20 (WI.ScriptTimelineRecord.prototype.get eventType): 21 Wholesale copy of the extra data instead of just a single property. 22 23 * UserInterface/Views/ScriptDetailsTimelineView.js: 24 (WI.ScriptDetailsTimelineView): 25 Give the name column more initial space, there is still extra space 26 after this adjustment but name is comfortably larger (and the most 27 likely to be expanded). 28 29 * UserInterface/Views/ScriptTimelineDataGridNode.js: 30 (WI.ScriptTimelineDataGridNode.prototype.get subtitle): 31 Include "default prevented" as the event's subtitle if it was prevented. 32 1 33 2019-03-20 Devin Rousso <drousso@apple.com> 2 34 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r243260 r243269 1181 1181 localizedStrings["computed"] = "computed"; 1182 1182 localizedStrings["default"] = "default"; 1183 localizedStrings["default prevented"] = "default prevented"; 1183 1184 localizedStrings["for changes to take effect"] = "for changes to take effect"; 1184 1185 localizedStrings["invalid HAR"] = "invalid HAR"; -
trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js
r243024 r243269 698 698 break; 699 699 case TimelineAgent.EventType.EventDispatch: 700 record = new WI.ScriptTimelineRecord(WI.ScriptTimelineRecord.EventType.EventDispatched, startTime, endTime, callFrames, sourceCodeLocation, parentRecordPayload.data.type, profileData );700 record = new WI.ScriptTimelineRecord(WI.ScriptTimelineRecord.EventType.EventDispatched, startTime, endTime, callFrames, sourceCodeLocation, parentRecordPayload.data.type, profileData, parentRecordPayload.data); 701 701 break; 702 702 case TimelineAgent.EventType.ObserverCallback: -
trunk/Source/WebInspectorUI/UserInterface/Models/ScriptTimelineRecord.js
r243024 r243269 26 26 WI.ScriptTimelineRecord = class ScriptTimelineRecord extends WI.TimelineRecord 27 27 { 28 constructor(eventType, startTime, endTime, callFrames, sourceCodeLocation, details, profilePayload )28 constructor(eventType, startTime, endTime, callFrames, sourceCodeLocation, details, profilePayload, extraDetails) 29 29 { 30 30 super(WI.TimelineRecord.Type.Script, startTime, endTime, callFrames, sourceCodeLocation); … … 39 39 this._profilePayload = profilePayload || null; 40 40 this._profile = null; 41 this._extraDetails = extraDetails || null; 41 42 42 43 // COMPATIBILITY(iOS 9): Before the ScriptProfilerAgent we did not have sample data. Return NaN to match old behavior. … … 77 78 // Public 78 79 79 get eventType() 80 { 81 return this._eventType; 82 } 83 84 get details() 85 { 86 return this._details; 87 } 80 get eventType() { return this._eventType; } 81 get details() { return this._details; } 82 get extraDetails() { return this._extraDetails; } 83 get callCountOrSamples() { return this._callCountOrSamples; } 88 84 89 85 get profile() … … 91 87 this._initializeProfileFromPayload(); 92 88 return this._profile; 93 }94 95 get callCountOrSamples()96 {97 return this._callCountOrSamples;98 89 } 99 90 -
trunk/Source/WebInspectorUI/UserInterface/Views/ScriptDetailsTimelineView.js
r243213 r243269 35 35 36 36 columns.name.title = WI.UIString("Name"); 37 columns.name.width = " 10%";37 columns.name.width = "30%"; 38 38 columns.name.icon = true; 39 39 columns.name.disclosure = true; -
trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineDataGridNode.js
r243213 r243269 87 87 else 88 88 this._subtitle = WI.UIString("%s delay").format(timeoutString); 89 } else if (this._record.eventType === WI.ScriptTimelineRecord.EventType.EventDispatched) { 90 if (this._record.extraDetails && this._record.extraDetails.defaultPrevented) 91 this._subtitle = WI.UIString("default prevented"); 89 92 } 90 93
Note:
See TracChangeset
for help on using the changeset viewer.