Changeset 237431 in webkit
- Timestamp:
- Oct 25, 2018 3:59:29 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r237426 r237431 1 2018-10-25 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: display fullscreen enter/exit events in Timelines and Network node waterfalls 4 https://bugs.webkit.org/show_bug.cgi?id=189874 5 <rdar://problem/44700000> 6 7 Reviewed by Joseph Pecoraro. 8 9 * http/tests/inspector/dom/didFireEvent-expected.txt: 10 * http/tests/inspector/dom/didFireEvent.html: 11 1 12 2018-10-25 Alexey Proskuryakov <ap@apple.com> 2 13 -
trunk/LayoutTests/http/tests/inspector/dom/didFireEvent-expected.txt
r237028 r237431 4 4 5 5 == Running test suite: DOM.didFireEvent 6 -- Running test case: DOM.didFireEvent 6 -- Running test case: DOM.didFireEvent.Basic 7 7 Adding video source "resources/white.mp4"... 8 PASS: Should rec ieve a "loadstart" event.8 PASS: Should receive a "loadstart" event. 9 9 PASS: Event timestamp should be greater than 0. 10 10 11 -- Running test case: DOM.didFireEvent.Fullscreen 12 Entering fullscreen on #video... 13 PASS: Should receive a "webkitfullscreenchange" event. 14 PASS: Event timestamp should be greater than 0. 15 PASS: Event should have data. 16 PASS: Fullscreen should be true. 17 Target: video#video 18 Exiting fullscreen... 19 PASS: Should receive a "webkitfullscreenchange" event. 20 PASS: Event timestamp should be greater than 0. 21 PASS: Event should have data. 22 PASS: Fullscreen should be false. 23 Target: video#video 24 25 -- Running test case: DOM.didFireEvent.Inherited 26 Entering fullscreen on #container... 27 PASS: Should receive a "webkitfullscreenchange" event. 28 PASS: Event timestamp should be greater than 0. 29 PASS: Event should have data. 30 PASS: Fullscreen should be true. 31 Target: video#video 32 Originator: div#container 33 Exiting fullscreen... 34 PASS: Should receive a "webkitfullscreenchange" event. 35 PASS: Event timestamp should be greater than 0. 36 PASS: Event should have data. 37 PASS: Fullscreen should be false. 38 Target: video#video 39 Originator: div#container 40 -
trunk/LayoutTests/http/tests/inspector/dom/didFireEvent.html
r237028 r237431 12 12 } 13 13 14 function enterFullscreen(element) { 15 document.addEventListener("keydown", (event) => { 16 document.addEventListener("webkitfullscreenchange", (event) => { 17 console.assert(document.webkitFullscreenElement === element); 18 19 TestPage.dispatchEventToFrontend("TestPage-enteredFullscreen"); 20 }, {once: true}); 21 22 element.webkitRequestFullscreen(); 23 }, {once: true}); 24 25 if (window.testRunner) { 26 // DumpRenderTree changes the firstResponder to the WebInspector window when it opens. 27 // This refocuses the test page, ensuring it gets the event. 28 if (window.testRunner.setMainFrameIsFirstResponder) 29 window.testRunner.setMainFrameIsFirstResponder(true); 30 31 eventSender.keyDown(" "); 32 } 33 } 34 35 function exitFullscreen() { 36 document.addEventListener("webkitfullscreenchange", (event) => { 37 console.assert(!document.webkitFullscreenElement); 38 39 TestPage.dispatchEventToFrontend("TestPage-exitedFullscreen"); 40 }, {once: true}); 41 42 document.webkitExitFullscreen(); 43 } 44 14 45 function test() 15 46 { 47 InspectorTest.debug(); 48 16 49 let suite = InspectorTest.createAsyncSuite("DOM.didFireEvent"); 17 50 18 51 let videoNode = null; 19 52 53 function fullscreenTest(fullscreenElementId, resolve, reject) { 54 InspectorTest.awaitEvent("TestPage-exitedFullscreen") 55 .then(resolve, reject); 56 57 InspectorTest.awaitEvent("TestPage-enteredFullscreen") 58 .then((event) => { 59 InspectorTest.log("Exiting fullscreen..."); 60 InspectorTest.evaluateInPage(`exitFullscreen()`).catch(reject); 61 }); 62 63 let enabled = false; 64 let listener = videoNode.addEventListener(WI.DOMNode.Event.DidFireEvent, (event) => { 65 let {domEvent} = event.data; 66 if (domEvent.eventName !== "webkitfullscreenchange") 67 return; 68 69 InspectorTest.pass(`Should receive a "webkitfullscreenchange" event.`); 70 InspectorTest.expectGreaterThan(domEvent.timestamp, 0, "Event timestamp should be greater than 0."); 71 InspectorTest.expectThat(domEvent.data, "Event should have data."); 72 InspectorTest.expectNotEqual(domEvent.data.enabled, enabled, `Fullscreen should be ${!enabled}.`); 73 InspectorTest.log("Target: " + event.target.displayName); 74 if (domEvent.originator) 75 InspectorTest.log("Originator: " + domEvent.originator.displayName); 76 77 enabled = domEvent.data.enabled; 78 if (!enabled) 79 videoNode.removeEventListener(WI.DOMNode.Event.DidFireEvent, listener); 80 }); 81 82 InspectorTest.log(`Entering fullscreen on #${fullscreenElementId}...`); 83 InspectorTest.evaluateInPage(`enterFullscreen(document.getElementById("${fullscreenElementId}"))`).catch(reject); 84 } 85 20 86 suite.addTestCase({ 21 name: "DOM.didFireEvent ",87 name: "DOM.didFireEvent.Basic", 22 88 description: "Check that HTMLMediaElement events work.", 23 89 test(resolve, reject) { … … 29 95 return; 30 96 31 InspectorTest.pass(`Should rec ieve a "loadstart" event.`)97 InspectorTest.pass(`Should receive a "loadstart" event.`) 32 98 InspectorTest.expectGreaterThan(domEvent.timestamp, 0, "Event timestamp should be greater than 0."); 33 99 … … 38 104 InspectorTest.log(`Adding video source "resources/${file}"...`); 39 105 InspectorTest.evaluateInPage(`loadSource("resources/${file}", "video/mp4")`); 106 } 107 }); 108 109 suite.addTestCase({ 110 name: "DOM.didFireEvent.Fullscreen", 111 description: "Check that fullscreen events work.", 112 test(resolve, reject) { 113 fullscreenTest("video", resolve, reject); 114 } 115 }); 116 117 suite.addTestCase({ 118 name: "DOM.didFireEvent.Inherited", 119 description: "Check that inherited events work.", 120 test(resolve, reject) { 121 fullscreenTest("container", resolve, reject); 40 122 } 41 123 }); … … 57 139 <body onload="runTest()"> 58 140 <p>Tests that listeners registered by InspectorDOMAgent::addEventListenersToNode are working.</p> 59 <video id="video" muted autoplay></video> 141 <div id="container"> 142 <video id="video" muted autoplay></video> 143 </div> 60 144 </body> 61 145 </html> -
trunk/Source/JavaScriptCore/ChangeLog
r237429 r237431 1 2018-10-25 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: display fullscreen enter/exit events in Timelines and Network node waterfalls 4 https://bugs.webkit.org/show_bug.cgi?id=189874 5 <rdar://problem/44700000> 6 7 Reviewed by Joseph Pecoraro. 8 9 * inspector/protocol/DOM.json: 10 Allow `data` to be passed to the frontend with `didFireEvent`. 11 1 12 2018-10-25 Ross Kirsling <ross.kirsling@sony.com> 2 13 -
trunk/Source/JavaScriptCore/inspector/protocol/DOM.json
r237028 r237431 667 667 { "name": "nodeId", "$ref": "NodeId" }, 668 668 { "name": "eventName", "type": "string" }, 669 { "name": "timestamp", "$ref": "Network.Timestamp", "description": "Time when the event was fired" } 669 { "name": "timestamp", "$ref": "Network.Timestamp", "description": "Time when the event was fired" }, 670 { "name": "data", "type": "object", "optional": true, "description": "Holds ancillary information about the event or its target." } 670 671 ] 671 672 } -
trunk/Source/WebCore/ChangeLog
r237424 r237431 1 2018-10-25 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: display fullscreen enter/exit events in Timelines and Network node waterfalls 4 https://bugs.webkit.org/show_bug.cgi?id=189874 5 <rdar://problem/44700000> 6 7 Reviewed by Joseph Pecoraro. 8 9 Updated existing test: http/tests/inspector/dom/didFireEvent.html 10 11 * inspector/agents/InspectorDOMAgent.h: 12 * inspector/agents/InspectorDOMAgent.cpp: 13 (WebCore::EventFiredCallback::handleEvent): 14 (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend): 15 (WebCore::InspectorDOMAgent::addEventListenersToNode): 16 (WebCore::InspectorDOMAgent::discardBindings): 17 (WebCore::InspectorDOMAgent::eventDidResetAfterDispatch): Added. 18 Prevent the same event from being sent to the frontend more than once. 19 20 * dom/Event.cpp: 21 (WebCore::Event::resetAfterDispatch): 22 23 * dom/Document.cpp: 24 (WebCore::Document::Document): 25 26 * inspector/InspectorInstrumentation.h: 27 (WebCore::InspectorInstrumentation::eventDidResetAfterDispatch): Added. 28 * inspector/InspectorInstrumentation.cpp: 29 (WebCore::InspectorInstrumentation::eventDidResetAfterDispatchImpl): Added. 30 1 31 2018-10-25 Michael Catanzaro <mcatanzaro@igalia.com> 2 32 -
trunk/Source/WebCore/dom/Document.cpp
r237306 r237431 561 561 for (auto& nodeListAndCollectionCount : m_nodeListAndCollectionCounts) 562 562 nodeListAndCollectionCount = 0; 563 564 InspectorInstrumentation::addEventListenersToNode(*this); 563 565 } 564 566 -
trunk/Source/WebCore/dom/Event.cpp
r237228 r237431 172 172 m_propagationStopped = false; 173 173 m_immediatePropagationStopped = false; 174 175 InspectorInstrumentation::eventDidResetAfterDispatch(*this); 174 176 } 175 177 -
trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp
r237028 r237431 430 430 } 431 431 432 void InspectorInstrumentation::eventDidResetAfterDispatchImpl(InstrumentingAgents& instrumentingAgents, const Event& event) 433 { 434 if (auto* domAgent = instrumentingAgents.inspectorDOMAgent()) 435 domAgent->eventDidResetAfterDispatch(event); 436 } 437 432 438 InspectorInstrumentationCookie InspectorInstrumentation::willEvaluateScriptImpl(InstrumentingAgents& instrumentingAgents, Frame& frame, const String& url, int lineNumber) 433 439 { -
trunk/Source/WebCore/inspector/InspectorInstrumentation.h
r237028 r237431 158 158 static InspectorInstrumentationCookie willDispatchEventOnWindow(Frame*, const Event&, DOMWindow&); 159 159 static void didDispatchEventOnWindow(const InspectorInstrumentationCookie&); 160 static void eventDidResetAfterDispatch(const Event&); 160 161 static InspectorInstrumentationCookie willEvaluateScript(Frame&, const String& url, int lineNumber); 161 162 static void didEvaluateScript(const InspectorInstrumentationCookie&, Frame&); … … 344 345 static InspectorInstrumentationCookie willDispatchEventOnWindowImpl(InstrumentingAgents&, const Event&, DOMWindow&); 345 346 static void didDispatchEventOnWindowImpl(const InspectorInstrumentationCookie&); 347 static void eventDidResetAfterDispatchImpl(InstrumentingAgents&, const Event&); 346 348 static InspectorInstrumentationCookie willEvaluateScriptImpl(InstrumentingAgents&, Frame&, const String& url, int lineNumber); 347 349 static void didEvaluateScriptImpl(const InspectorInstrumentationCookie&, Frame&); … … 810 812 } 811 813 814 inline void InspectorInstrumentation::eventDidResetAfterDispatch(const Event& event) 815 { 816 FAST_RETURN_IF_NO_FRONTENDS(void()); 817 818 if (!is<Node>(event.target())) 819 return; 820 821 auto* node = downcast<Node>(event.target()); 822 if (auto* instrumentingAgents = instrumentingAgentsForContext(node->scriptExecutionContext())) 823 return eventDidResetAfterDispatchImpl(*instrumentingAgents, event); 824 } 825 812 826 inline InspectorInstrumentationCookie InspectorInstrumentation::willEvaluateScript(Frame& frame, const String& url, int lineNumber) 813 827 { -
trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
r237028 r237431 235 235 void handleEvent(ScriptExecutionContext&, Event& event) final 236 236 { 237 if (!is<Node>(event.target()) )237 if (!is<Node>(event.target()) || m_domAgent.m_dispatchedEvents.contains(&event)) 238 238 return; 239 239 … … 243 243 return; 244 244 245 m_domAgent.m_dispatchedEvents.add(&event); 246 247 RefPtr<JSON::Object> data = JSON::Object::create(); 248 249 if (event.type() == eventNames().webkitfullscreenchangeEvent) 250 data->setBoolean("enabled"_s, !!node->document().webkitFullscreenElement()); 251 245 252 auto timestamp = m_domAgent.m_environment.executionStopwatch()->elapsedTime().seconds(); 246 m_domAgent.m_frontendDispatcher->didFireEvent(nodeId, event.type(), timestamp );253 m_domAgent.m_frontendDispatcher->didFireEvent(nodeId, event.type(), timestamp, data->size() ? WTFMove(data) : nullptr); 247 254 } 248 255 … … 290 297 m_instrumentingAgents.setInspectorDOMAgent(this); 291 298 m_document = m_pageAgent->mainFrame().document(); 299 300 if (m_document) 301 addEventListenersToNode(*m_document); 292 302 293 303 for (auto* mediaElement : HTMLMediaElement::allMediaElements()) … … 524 534 m_documentNodeToIdMap.clear(); 525 535 m_idToNode.clear(); 536 m_dispatchedEvents.clear(); 526 537 m_eventListenerEntries.clear(); 527 538 releaseDanglingNodes(); … … 2139 2150 }; 2140 2151 2141 if (is<HTMLMediaElement>(node)) { 2152 if (is<Document>(node)) 2153 createEventListener(eventNames().webkitfullscreenchangeEvent); 2154 else if (is<HTMLMediaElement>(node)) { 2155 createEventListener(eventNames().webkitfullscreenchangeEvent); 2142 2156 createEventListener(eventNames().abortEvent); 2143 2157 createEventListener(eventNames().canplayEvent); … … 2407 2421 } 2408 2422 2423 void InspectorDOMAgent::eventDidResetAfterDispatch(const Event& event) 2424 { 2425 m_dispatchedEvents.remove(&event); 2426 } 2427 2409 2428 bool InspectorDOMAgent::hasBreakpointForEventListener(EventTarget& target, const AtomicString& eventType, EventListener& listener, bool capture) 2410 2429 { -
trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.h
r237028 r237431 178 178 void willRemoveEventListener(EventTarget&, const AtomicString& eventType, EventListener&, bool capture); 179 179 bool isEventListenerDisabled(EventTarget&, const AtomicString& eventType, EventListener&, bool capture); 180 void eventDidResetAfterDispatch(const Event&); 180 181 181 182 // Callbacks that don't directly correspond to an instrumentation entry point. … … 320 321 friend class EventFiredCallback; 321 322 323 HashSet<const Event*> m_dispatchedEvents; 322 324 HashMap<int, InspectorEventListener> m_eventListenerEntries; 323 325 int m_lastEventListenerId { 1 }; -
trunk/Source/WebInspectorUI/ChangeLog
r237430 r237431 1 2018-10-25 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: display fullscreen enter/exit events in Timelines and Network node waterfalls 4 https://bugs.webkit.org/show_bug.cgi?id=189874 5 <rdar://problem/44700000> 6 7 Reviewed by Joseph Pecoraro. 8 9 * Localizations/en.lproj/localizedStrings.js: 10 11 * UserInterface/Protocol/DOMObserver.js: 12 (WI.DOMObserver.prototype.didFireEvent): 13 * UserInterface/Controllers/DOMManager.js: 14 (WI.DOMManager.prototype.didFireEvent): 15 Allow `data` to be passed to the frontend with `didFireEvent`. 16 17 * UserInterface/Models/DOMNode.js: 18 (WI.DOMNode): 19 (WI.DOMNode.getFullscreenDOMEvents): Added. 20 (WI.DOMNode.prototype.didFireEvent): 21 (WI.DOMNode.prototype._handleDOMNodeDidFireEvent): Added. 22 (WI.DOMNode.prototype._addDOMEvent): 23 (WI.DOMNode.prototype._shouldListenForEventListeners): Added. 24 If an event is fired on an ancestor of this node, also record that event in this node's 25 `domEvents`, including the `originator` node. 26 27 * UserInterface/Views/NetworkTableContentView.js: 28 (WI.NetworkTableContentView.prototype._populateWaterfallGraph): 29 * UserInterface/Views/NetworkTableContentView.css: 30 (.network-table :not(.header) .cell.waterfall .waterfall-container > .dom-fullscreen): Added. 31 32 * UserInterface/Views/DOMEventsBreakdownView.js: 33 (WI.DOMEventsBreakdownView.prototype.initialLayout): 34 (WI.DOMEventsBreakdownView.prototype._populateTable): 35 * UserInterface/Views/DOMEventsBreakdownView.css: 36 (.dom-events-breakdown .graph > .area.fullscreen): Added. 37 (.dom-events-breakdown .inherited > .name, .dom-events-breakdown .inherited > .graph > .point): Added. 38 (.dom-events-breakdown:not(.has-inherited) .originator): Added. 39 1 40 2018-10-25 Devin Rousso <drousso@apple.com> 2 41 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r237151 r237431 405 405 localizedStrings["Full Garbage Collection"] = "Full Garbage Collection"; 406 406 localizedStrings["Full URL"] = "Full URL"; 407 localizedStrings["Fullscreen from “%s“"] = "Fullscreen from “%s“"; 407 408 localizedStrings["Function"] = "Function"; 408 409 localizedStrings["Function Name Variable"] = "Function Name Variable"; … … 595 596 localizedStrings["Original formatting"] = "Original formatting"; 596 597 localizedStrings["Originally %s"] = "Originally %s"; 598 localizedStrings["Originator"] = "Originator"; 597 599 localizedStrings["Other"] = "Other"; 598 600 localizedStrings["Other Issue"] = "Other Issue"; -
trunk/Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js
r237028 r237431 123 123 } 124 124 125 didFireEvent(nodeId, eventName, timestamp )125 didFireEvent(nodeId, eventName, timestamp, data) 126 126 { 127 127 // Called from WI.DOMObserver. … … 131 131 return; 132 132 133 node.didFireEvent(eventName, timestamp );133 node.didFireEvent(eventName, timestamp, data); 134 134 } 135 135 -
trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js
r237028 r237431 140 140 141 141 this._domEvents = []; 142 143 if (this._shouldListenForEventListeners()) 144 WI.DOMNode.addEventListener(WI.DOMNode.Event.DidFireEvent, this._handleDOMNodeDidFireEvent, this); 145 } 146 147 // Static 148 149 static getFullscreenDOMEvents(domEvents) 150 { 151 return domEvents.reduce((accumulator, current) => { 152 if (current.eventName === "webkitfullscreenchange" && current.data && (!accumulator.length || accumulator.lastValue.data.enabled !== current.data.enabled)) 153 accumulator.push(current); 154 return accumulator; 155 }, []); 142 156 } 143 157 … … 702 716 } 703 717 704 didFireEvent(eventName, timestamp )718 didFireEvent(eventName, timestamp, data) 705 719 { 706 720 // Called from WI.DOMManager. … … 709 723 eventName, 710 724 timestamp: WI.timelineManager.computeElapsedTime(timestamp), 725 data, 711 726 }); 712 727 } 713 728 729 _handleDOMNodeDidFireEvent(event) 730 { 731 if (event.target === this || !event.target.isAncestor(this)) 732 return; 733 734 let domEvent = Object.shallowCopy(event.data.domEvent); 735 domEvent.originator = event.target; 736 737 this._addDOMEvent(domEvent); 738 } 739 714 740 _addDOMEvent(domEvent) 715 741 { … … 717 743 718 744 this.dispatchEventToListeners(WI.DOMNode.Event.DidFireEvent, {domEvent}); 745 } 746 747 _shouldListenForEventListeners() 748 { 749 let lowerCaseName = this.localName() || this.nodeName().toLowerCase(); 750 return lowerCaseName === "video" || lowerCaseName === "audio"; 719 751 } 720 752 -
trunk/Source/WebInspectorUI/UserInterface/Protocol/DOMObserver.js
r237028 r237431 113 113 } 114 114 115 didFireEvent(nodeId, eventName, timestamp )115 didFireEvent(nodeId, eventName, timestamp, data) 116 116 { 117 WI.domManager.didFireEvent(nodeId, eventName, timestamp );117 WI.domManager.didFireEvent(nodeId, eventName, timestamp, data); 118 118 } 119 119 }; -
trunk/Source/WebInspectorUI/UserInterface/Views/DOMEventsBreakdownView.css
r237028 r237431 70 70 } 71 71 72 .dom-events-breakdown .graph > .area.fullscreen { 73 top: 0; 74 height: 100%; 75 background-color: var(--panel-background-color); 76 } 77 72 78 .dom-events-breakdown .time { 73 79 text-align: end; 74 80 } 81 82 .dom-events-breakdown .inherited > .name, 83 .dom-events-breakdown .inherited > .graph > .point { 84 opacity: 0.5; 85 } 86 87 .dom-events-breakdown:not(.has-inherited) .originator { 88 display: none; 89 } -
trunk/Source/WebInspectorUI/UserInterface/Views/DOMEventsBreakdownView.js
r237028 r237431 70 70 timeHeadCell.textContent = WI.UIString("Time"); 71 71 72 let originatorHeadCell = headRowElement.appendChild(document.createElement("th")); 73 originatorHeadCell.classList.add("originator"); 74 originatorHeadCell.textContent = WI.UIString("Originator"); 75 72 76 this._tableBodyElement = tableElement.appendChild(document.createElement("tbody")); 73 77 … … 90 94 } 91 95 96 let fullscreenRanges = []; 97 let fullscreenDOMEvents = WI.DOMNode.getFullscreenDOMEvents(this._domEvents); 98 for (let fullscreenDOMEvent of fullscreenDOMEvents) { 99 let {enabled} = fullscreenDOMEvent.data; 100 if (enabled || !fullscreenRanges.length) { 101 fullscreenRanges.push({ 102 startTimestamp: enabled ? fullscreenDOMEvent.timestamp : startTimestamp, 103 }); 104 } 105 fullscreenRanges.lastValue.endTimestamp = (enabled && fullscreenDOMEvent === fullscreenDOMEvents.lastValue) ? endTimestamp : fullscreenDOMEvent.timestamp; 106 } 107 92 108 for (let domEvent of this._domEvents) { 93 109 let rowElement = this._tableBodyElement.appendChild(document.createElement("tr")); … … 101 117 graphCell.classList.add("graph"); 102 118 119 let fullscreenRange = fullscreenRanges.find((range) => domEvent.timestamp >= range.startTimestamp && domEvent.timestamp <= range.endTimestamp); 120 if (fullscreenRange) { 121 let fullscreenArea = graphCell.appendChild(document.createElement("div")); 122 fullscreenArea.classList.add("area", "fullscreen"); 123 fullscreenArea.style.setProperty(styleAttribute, percentOfTotalTime(fullscreenRange.startTimestamp - startTimestamp) + "%"); 124 fullscreenArea.style.setProperty("width", percentOfTotalTime(fullscreenRange.endTimestamp - fullscreenRange.startTimestamp) + "%"); 125 } 126 103 127 let graphPoint = graphCell.appendChild(document.createElement("div")); 104 128 graphPoint.classList.add("point"); … … 111 135 const higherResolution = true; 112 136 timeCell.textContent = Number.secondsToString(domEvent.timestamp - this._startTimestamp, higherResolution); 137 138 let originatorCell = rowElement.appendChild(document.createElement("td")); 139 originatorCell.classList.add("originator"); 140 if (domEvent.originator) { 141 originatorCell.appendChild(WI.linkifyNodeReference(domEvent.originator)); 142 143 rowElement.classList.add("inherited"); 144 this.element.classList.add("has-inherited"); 145 } 113 146 } 114 147 } -
trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.css
r237028 r237431 183 183 } 184 184 185 .network-table :not(.header) .cell.waterfall .waterfall-container > .dom-fullscreen { 186 position: absolute; 187 top: var(--dom-fullscreen-vertical-padding); 188 height: calc(100% - (var(--dom-fullscreen-vertical-padding) * 2)); 189 background-color: lightgrey; 190 191 /* Half of the vertical space above any .dom-event node */ 192 --dom-fullscreen-vertical-padding: calc((50% - (var(--node-waterfall-dom-event-size) / 2)) / 2); 193 } 194 185 195 .network-table .timeline-ruler > .header { 186 196 top: calc(var(--navigation-bar-height) - var(--timeline-ruler-height)); -
trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js
r237430 r237431 661 661 const domEventElementSize = 8; // Keep this in sync with `--node-waterfall-dom-event-size`. 662 662 663 let groupedDOMEvents = domNode.domEvents.reduce((accumulator, current) => { 664 if (!accumulator.length || (current.timestamp - accumulator.lastValue.endTimestamp) >= (domEventElementSize * secondsPerPixel)) { 665 accumulator.push({ 666 startTimestamp: current.timestamp, 663 let groupedDOMEvents = []; 664 for (let domEvent of domNode.domEvents) { 665 if (domEvent.originator) 666 continue; 667 668 if (!groupedDOMEvents.length || (domEvent.timestamp - groupedDOMEvents.lastValue.endTimestamp) >= (domEventElementSize * secondsPerPixel)) { 669 groupedDOMEvents.push({ 670 startTimestamp: domEvent.timestamp, 667 671 domEvents: [], 668 672 }); 669 673 } 670 accumulator.lastValue.endTimestamp = current.timestamp; 671 accumulator.lastValue.domEvents.push(current); 672 return accumulator; 673 }, []); 674 groupedDOMEvents.lastValue.endTimestamp = domEvent.timestamp; 675 groupedDOMEvents.lastValue.domEvents.push(domEvent); 676 } 677 678 let fullscreenDOMEvents = WI.DOMNode.getFullscreenDOMEvents(domNode.domEvents); 679 if (fullscreenDOMEvents.length) { 680 if (!fullscreenDOMEvents[0].data.enabled) 681 fullscreenDOMEvents.unshift({timestamp: graphStartTime}); 682 683 if (fullscreenDOMEvents.lastValue.data.enabled) 684 fullscreenDOMEvents.push({timestamp: this._waterfallEndTime}); 685 686 console.assert((fullscreenDOMEvents.length % 2) === 0, "Every enter/exit of fullscreen should have a corresponding exit/enter."); 687 688 for (let i = 0; i < fullscreenDOMEvents.length; i += 2) { 689 let fullscreenElement = container.appendChild(document.createElement("div")); 690 fullscreenElement.classList.add("dom-fullscreen"); 691 positionByStartOffset(fullscreenElement, fullscreenDOMEvents[i].timestamp); 692 setWidthForDuration(fullscreenElement, fullscreenDOMEvents[i].timestamp, fullscreenDOMEvents[i + 1].timestamp); 693 694 let originator = fullscreenDOMEvents[i].originator || fullscreenDOMEvents[i + 1].originator; 695 if (originator) 696 fullscreenElement.title = WI.UIString("Fullscreen from “%s“").format(originator.displayName); 697 } 698 } 674 699 675 700 let playing = false;
Note: See TracChangeset
for help on using the changeset viewer.