Web Inspector: DOM: rename "low power" to "display composited"
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 May 2019 23:08:19 +0000 (23:08 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 May 2019 23:08:19 +0000 (23:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197296

Reviewed by Joseph Pecoraro.

Removed specific ChangeLog entries since it is almost entirely mechanical changes.

Source/JavaScriptCore:

* inspector/protocol/DOM.json:

Source/WebCore:

* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:

Source/WebInspectorUI:

* UserInterface/Protocol/DOMObserver.js:
* UserInterface/Controllers/DOMManager.js:
* UserInterface/Controllers/TimelineManager.js:
* UserInterface/Models/DOMNode.js:
* UserInterface/Models/MediaInstrument.js:
* UserInterface/Models/MediaTimelineRecord.js:
* UserInterface/Models/TimelineRecording.js:
* UserInterface/Views/DOMEventsBreakdownView.js:
* UserInterface/Views/DOMEventsBreakdownView.css:
* UserInterface/Views/NetworkTableContentView.js:
* UserInterface/Views/NetworkTableContentView.css:
* UserInterface/Views/TimelineIcons.css:
* UserInterface/Views/TimelineTabContentView.js:
* UserInterface/Images/PowerEfficientPlaybackStateChanged.svg: Added.
* UserInterface/Images/LowPower.svg: Removed.
* Localizations/en.lproj/localizedStrings.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244933 268f45cc-cd09-0410-ab3c-d52691b4dbfc

22 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/protocol/DOM.json
Source/WebCore/ChangeLog
Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
Source/WebCore/inspector/agents/InspectorDOMAgent.h
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Controllers/DOMManager.js
Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js
Source/WebInspectorUI/UserInterface/Images/LowPower.svg [deleted file]
Source/WebInspectorUI/UserInterface/Images/PowerEfficientPlaybackStateChanged.svg [new file with mode: 0644]
Source/WebInspectorUI/UserInterface/Models/DOMNode.js
Source/WebInspectorUI/UserInterface/Models/MediaInstrument.js
Source/WebInspectorUI/UserInterface/Models/MediaTimelineRecord.js
Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js
Source/WebInspectorUI/UserInterface/Protocol/DOMObserver.js
Source/WebInspectorUI/UserInterface/Views/DOMEventsBreakdownView.css
Source/WebInspectorUI/UserInterface/Views/DOMEventsBreakdownView.js
Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.css
Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js
Source/WebInspectorUI/UserInterface/Views/TimelineIcons.css
Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js

index f416d56..a9497c6 100644 (file)
@@ -1,3 +1,14 @@
+2019-05-03  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: DOM: rename "low power" to "display composited"
+        https://bugs.webkit.org/show_bug.cgi?id=197296
+
+        Reviewed by Joseph Pecoraro.
+
+        Removed specific ChangeLog entries since it is almost entirely mechanical changes.
+
+        * inspector/protocol/DOM.json:
+
 2019-05-03  Basuke Suzuki  <Basuke.Suzuki@sony.com>
 
         [WinCairo] Implement and enable RemoteInspector Server.
index 1195e88..77910c9 100644 (file)
             ]
         },
         {
-            "name": "videoLowPowerChanged",
-            "description": "Called when a video element enters/exits low power mode.",
+            "name": "powerEfficientPlaybackStateChanged",
+            "description": "Called when an element enters/exits a power efficient playback state.",
             "parameters": [
                 { "name": "nodeId", "$ref": "NodeId" },
-                { "name": "timestamp", "$ref": "Network.Timestamp", "description": "Time when the video element entered/exited low power mode" },
-                { "name": "isLowPower", "type": "boolean" }
+                { "name": "timestamp", "$ref": "Network.Timestamp" },
+                { "name": "isPowerEfficient", "type": "boolean" }
             ]
         }
     ]
index 238958a..d059a87 100644 (file)
@@ -1,3 +1,15 @@
+2019-05-03  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: DOM: rename "low power" to "display composited"
+        https://bugs.webkit.org/show_bug.cgi?id=197296
+
+        Reviewed by Joseph Pecoraro.
+
+        Removed specific ChangeLog entries since it is almost entirely mechanical changes.
+
+        * inspector/agents/InspectorDOMAgent.h:
+        * inspector/agents/InspectorDOMAgent.cpp:
+
 2019-05-03  Daniel Bates  <dabates@apple.com>
 
         Pass KeyboardEvent by reference in more places
index ce6a279..f345f15 100644 (file)
@@ -2514,14 +2514,14 @@ void InspectorDOMAgent::mediaMetricsTimerFired()
             continue;
         }
 
-        bool isLowPower = (displayCompositedVideoFrames - iterator->value.displayCompositedFrames) > 0;
-        if (iterator->value.isLowPower != isLowPower) {
-            iterator->value.isLowPower = isLowPower;
+        bool isPowerEfficient = (displayCompositedVideoFrames - iterator->value.displayCompositedFrames) > 0;
+        if (iterator->value.isPowerEfficient != isPowerEfficient) {
+            iterator->value.isPowerEfficient = isPowerEfficient;
 
             int nodeId = pushNodePathToFrontend(mediaElement);
             if (nodeId) {
                 auto timestamp = m_environment.executionStopwatch()->elapsedTime().seconds();
-                m_frontendDispatcher->videoLowPowerChanged(nodeId, timestamp, iterator->value.isLowPower);
+                m_frontendDispatcher->powerEfficientPlaybackStateChanged(nodeId, timestamp, iterator->value.isPowerEfficient);
             }
         }
 
index df23ced..cb59b81 100644 (file)
@@ -264,7 +264,7 @@ private:
     Timer m_mediaMetricsTimer;
     struct MediaMetrics {
         unsigned displayCompositedFrames { 0 };
-        bool isLowPower { false };
+        bool isPowerEfficient { false };
 
         MediaMetrics() { }
 
index 3af2c0c..97206c8 100644 (file)
@@ -1,5 +1,31 @@
 2019-05-03  Devin Rousso  <drousso@apple.com>
 
+        Web Inspector: DOM: rename "low power" to "display composited"
+        https://bugs.webkit.org/show_bug.cgi?id=197296
+
+        Reviewed by Joseph Pecoraro.
+
+        Removed specific ChangeLog entries since it is almost entirely mechanical changes.
+
+        * UserInterface/Protocol/DOMObserver.js:
+        * UserInterface/Controllers/DOMManager.js:
+        * UserInterface/Controllers/TimelineManager.js:
+        * UserInterface/Models/DOMNode.js:
+        * UserInterface/Models/MediaInstrument.js:
+        * UserInterface/Models/MediaTimelineRecord.js:
+        * UserInterface/Models/TimelineRecording.js:
+        * UserInterface/Views/DOMEventsBreakdownView.js:
+        * UserInterface/Views/DOMEventsBreakdownView.css:
+        * UserInterface/Views/NetworkTableContentView.js:
+        * UserInterface/Views/NetworkTableContentView.css:
+        * UserInterface/Views/TimelineIcons.css:
+        * UserInterface/Views/TimelineTabContentView.js:
+        * UserInterface/Images/PowerEfficientPlaybackStateChanged.svg: Added.
+        * UserInterface/Images/LowPower.svg: Removed.
+        * Localizations/en.lproj/localizedStrings.js:
+
+2019-05-03  Devin Rousso  <drousso@apple.com>
+
         Web Inspector: Record actions performed on WebGL2RenderingContext
         https://bugs.webkit.org/show_bug.cgi?id=176008
         <rdar://problem/34213884>
index 51a6e85..50b23c2 100644 (file)
@@ -421,7 +421,6 @@ localizedStrings["Ensure that only one live region is used on the page."] = "Ens
 localizedStrings["Ensure that only one main content section is used on the page."] = "Ensure that only one main content section is used on the page.";
 localizedStrings["Ensure that values for \u0022%s\u0022 are valid."] = "Ensure that values for \u0022%s\u0022 are valid.";
 localizedStrings["Entered Full-Screen Mode"] = "Entered Full-Screen Mode";
-localizedStrings["Entered Low-Power Mode"] = "Entered Low-Power Mode";
 localizedStrings["Entire Recording"] = "Entire Recording";
 localizedStrings["Error"] = "Error";
 localizedStrings["Error: "] = "Error: ";
@@ -442,7 +441,6 @@ localizedStrings["Example: \u201C%s\u201D"] = "Example: \u201C%s\u201D";
 localizedStrings["Exception with thrown value: %s"] = "Exception with thrown value: %s";
 localizedStrings["Execution context for $0"] = "Execution context for $0";
 localizedStrings["Exited Full-Screen Mode"] = "Exited Full-Screen Mode";
-localizedStrings["Exited Low-Power Mode"] = "Exited Low-Power Mode";
 localizedStrings["Expand All"] = "Expand All";
 localizedStrings["Expand columns"] = "Expand columns";
 localizedStrings["Expanded"] = "Expanded";
@@ -628,7 +626,6 @@ localizedStrings["Log WebSocket"] = "Log WebSocket";
 localizedStrings["Log: "] = "Log: ";
 localizedStrings["Logs"] = "Logs";
 localizedStrings["Low"] = "Low";
-localizedStrings["Low-Power Mode"] = "Low-Power Mode";
 localizedStrings["Lowest: %s"] = "Lowest: %s";
 localizedStrings["MIME Type"] = "MIME Type";
 localizedStrings["MIME Type:"] = "MIME Type:";
@@ -763,6 +760,9 @@ localizedStrings["Play Sound"] = "Play Sound";
 localizedStrings["Polite"] = "Polite";
 localizedStrings["Pong Frame"] = "Pong Frame";
 localizedStrings["Port"] = "Port";
+localizedStrings["Power Efficient Playback"] = "Power Efficient Playback";
+localizedStrings["Power Efficient Playback Started"] = "Power Efficient Playback Started";
+localizedStrings["Power Efficient Playback Stopped"] = "Power Efficient Playback Stopped";
 localizedStrings["Prefer indent using:"] = "Prefer indent using:";
 localizedStrings["Preserve Log"] = "Preserve Log";
 localizedStrings["Press %s to import a test or result file"] = "Press %s to import a test or result file";
index f68d894..7a91b3f 100644 (file)
@@ -166,7 +166,7 @@ WI.DOMManager = class DOMManager extends WI.Object
         node.didFireEvent(eventName, timestamp, data);
     }
 
-    videoLowPowerChanged(nodeId, timestamp, isLowPower)
+    powerEfficientPlaybackStateChanged(nodeId, timestamp, isPowerEfficient)
     {
         // Called from WI.DOMObserver.
 
@@ -174,7 +174,7 @@ WI.DOMManager = class DOMManager extends WI.Object
         if (!node)
             return;
 
-        node.videoLowPowerChanged(timestamp, isLowPower);
+        node.powerEfficientPlaybackStateChanged(timestamp, isPowerEfficient);
     }
 
     // Private
index fe514c7..a04386e 100644 (file)
@@ -365,7 +365,7 @@ WI.TimelineManager = class TimelineManager extends WI.Object
         WI.memoryManager.addEventListener(WI.MemoryManager.Event.MemoryPressure, this._memoryPressure, this);
 
         WI.DOMNode.addEventListener(WI.DOMNode.Event.DidFireEvent, this._handleDOMNodeDidFireEvent, this);
-        WI.DOMNode.addEventListener(WI.DOMNode.Event.LowPowerChanged, this._handleDOMNodeLowPowerChanged, this);
+        WI.DOMNode.addEventListener(WI.DOMNode.Event.PowerEfficientPlaybackStateChanged, this._handleDOMNodePowerEfficientPlaybackStateChanged, this);
 
         this._updateCapturingState(TimelineManager.CapturingState.Active, {startTime: this._capturingStartTime});
     }
@@ -1248,13 +1248,13 @@ WI.TimelineManager = class TimelineManager extends WI.Object
         }));
     }
 
-    _handleDOMNodeLowPowerChanged(event)
+    _handleDOMNodePowerEfficientPlaybackStateChanged(event)
     {
-        let {timestamp, isLowPower} = event.data;
+        let {timestamp, isPowerEfficient} = event.data;
 
-        this._addRecord(new WI.MediaTimelineRecord(WI.MediaTimelineRecord.EventType.LowPower, timestamp, {
+        this._addRecord(new WI.MediaTimelineRecord(WI.MediaTimelineRecord.EventType.PowerEfficientPlaybackStateChanged, timestamp, {
             domNode: event.target,
-            isLowPower,
+            isPowerEfficient,
         }));
     }
 };
diff --git a/Source/WebInspectorUI/UserInterface/Images/LowPower.svg b/Source/WebInspectorUI/UserInterface/Images/LowPower.svg
deleted file mode 100644 (file)
index 1b6e382..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright © 2018 Apple Inc. All rights reserved. -->
-<svg xmlns="http://www.w3.org/2000/svg" id="root" version="1.1" viewBox="0 0 16 16">
-    <path fill="rgb(148, 190, 164)" d="M 13 1 L 3 1 C 1.898438 1 1 1.898438 1 3 L 1 13 C 1 14.101562 1.898438 15 3 15 L 13 15 C 14.101562 15 15 14.101562 15 13 L 15 3 C 15 1.898438 14.101562 1 13 1 Z"/>
-    <path fill="rgb(101, 161, 134)" d="M 13 1 L 3 1 C 1.898438 1 1 1.898438 1 3 L 1 13 C 1 14.101562 1.898438 15 3 15 L 13 15 C 14.101562 15 15 14.101562 15 13 L 15 3 C 15 1.898438 14.101562 1 13 1 M 13 2 C 13.550781 2 14 2.449219 14 3 L 14 13 C 14 13.550781 13.550781 14 13 14 L 3 14 C 2.449219 14 2 13.550781 2 13 L 2 3 C 2 2.449219 2.449219 2 3 2 L 13 2"/>
-    <path fill="rgb(101, 161, 134)" d="M 5 13 L 6 13 L 11 13 L 12 13 L 12 12 L 12 10.8648649 L 12 9.86486486 L 11 9.86486486 L 8.57948709 9.86486483 L 8.57948718 4 L 8.57948718 3 L 7.57948718 3 L 6 3 L 5 3 L 5 4 L 5 12 L 5 13 Z M 5 13"/>
-    <path fill="white" d="M 6 4 L 7.57948718 4 L 7.57948718 10.8648649 L 11 10.8648649 L 11 12 L 6 12 L 6 4 Z M 6 4"/>
-</svg>
diff --git a/Source/WebInspectorUI/UserInterface/Images/PowerEfficientPlaybackStateChanged.svg b/Source/WebInspectorUI/UserInterface/Images/PowerEfficientPlaybackStateChanged.svg
new file mode 100644 (file)
index 0000000..793adf0
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright © 2013 Apple Inc. All rights reserved. -->
+<svg xmlns="http://www.w3.org/2000/svg" id="root" version="1.1" viewBox="0 0 16 16">
+    <path fill="rgb(148, 190, 164)" d="M 13 1 L 3 1 C 1.898438 1 1 1.898438 1 3 L 1 13 C 1 14.101562 1.898438 15 3 15 L 13 15 C 14.101562 15 15 14.101562 15 13 L 15 3 C 15 1.898438 14.101562 1 13 1 Z"/>
+    <path fill="rgb(101, 161, 134)" d="M 13 1 L 3 1 C 1.898438 1 1 1.898438 1 3 L 1 13 C 1 14.101562 1.898438 15 3 15 L 13 15 C 14.101562 15 15 14.101562 15 13 L 15 3 C 15 1.898438 14.101562 1 13 1 M 13 2 C 13.550781 2 14 2.449219 14 3 L 14 13 C 14 13.550781 13.550781 14 13 14 L 3 14 C 2.449219 14 2 13.550781 2 13 L 2 3 C 2 2.449219 2.449219 2 3 2 L 13 2"/>
+    <path fill="white" d="M 6.78125 7.769531 L 7.136719 7.769531 C 7.757812 7.769531 8.246094 7.636719 8.605469 7.371094 C 8.96875 7.105469 9.148438 6.746094 9.148438 6.292969 C 9.148438 5.496094 8.59375 5.097656 7.488281 5.097656 L 6.78125 5.097656 Z M 5 12 L 5 4 L 8.042969 4 C 9.105469 4 9.863281 4.164062 10.316406 4.488281 C 10.773438 4.816406 11 5.359375 11 6.125 C 11 6.988281 10.695312 7.660156 10.085938 8.144531 C 9.480469 8.625 8.628906 8.863281 7.535156 8.863281 L 6.78125 8.863281 L 6.78125 12 Z"/>
+    <path fill="rgb(101, 161, 134)" d="M 7.78125 6.679688 L 7.78125 6.113281 C 8.019531 6.136719 8.117188 6.1875 8.144531 6.203125 C 8.140625 6.210938 8.148438 6.242188 8.148438 6.292969 C 8.148438 6.441406 8.105469 6.496094 8.015625 6.566406 C 7.953125 6.613281 7.875 6.648438 7.78125 6.679688 M 8.042969 3 L 4 3 L 4 13 L 7.78125 13 L 7.78125 9.863281 C 8.988281 9.824219 9.96875 9.507812 10.707031 8.925781 C 11.550781 8.257812 12 7.289062 12 6.125 C 12 4.753906 11.402344 4.035156 10.902344 3.675781 C 10.265625 3.222656 9.332031 3 8.042969 3 M 6.78125 7.769531 L 7.136719 7.769531 C 7.757812 7.769531 8.246094 7.636719 8.605469 7.371094 C 8.96875 7.105469 9.148438 6.746094 9.148438 6.292969 C 9.148438 5.496094 8.59375 5.097656 7.488281 5.097656 L 6.78125 5.097656 L 6.78125 7.769531 M 8.042969 4 C 9.105469 4 9.863281 4.164062 10.316406 4.488281 C 10.773438 4.816406 11 5.359375 11 6.125 C 11 6.988281 10.695312 7.660156 10.085938 8.144531 C 9.480469 8.625 8.628906 8.863281 7.535156 8.863281 L 6.78125 8.863281 L 6.78125 12 L 5 12 L 5 4 L 8.042969 4"/>
+</svg>
index 18b7e15..caa7e9a 100644 (file)
@@ -147,7 +147,7 @@ WI.DOMNode = class DOMNode extends WI.Object
         }
 
         this._domEvents = [];
-        this._lowPowerRanges = [];
+        this._powerEfficientPlaybackRanges = [];
 
         if (this._shouldListenForEventListeners())
             WI.DOMNode.addEventListener(WI.DOMNode.Event.DidFireEvent, this._handleDOMNodeDidFireEvent, this);
@@ -188,7 +188,7 @@ WI.DOMNode = class DOMNode extends WI.Object
 
     get frame() { return this._frame; }
     get domEvents() { return this._domEvents; }
-    get lowPowerRanges() { return this._lowPowerRanges; }
+    get powerEfficientPlaybackRanges() { return this._powerEfficientPlaybackRanges; }
 
     get attached()
     {
@@ -757,30 +757,30 @@ WI.DOMNode = class DOMNode extends WI.Object
         });
     }
 
-    videoLowPowerChanged(timestamp, isLowPower)
+    powerEfficientPlaybackStateChanged(timestamp, isPowerEfficient)
     {
         // Called from WI.DOMManager.
 
-        console.assert(this.canEnterLowPowerMode());
+        console.assert(this.canEnterPowerEfficientPlaybackState());
 
-        let lastValue = this._lowPowerRanges.lastValue;
+        let lastValue = this._powerEfficientPlaybackRanges.lastValue;
 
-        if (isLowPower) {
+        if (isPowerEfficient) {
             console.assert(!lastValue || lastValue.endTimestamp);
             if (!lastValue || lastValue.endTimestamp)
-                this._lowPowerRanges.push({startTimestamp: timestamp});
+                this._powerEfficientPlaybackRanges.push({startTimestamp: timestamp});
         } else {
             console.assert(!lastValue || lastValue.startTimestamp);
             if (!lastValue)
-                this._lowPowerRanges.push({endTimestamp: timestamp});
+                this._powerEfficientPlaybackRanges.push({endTimestamp: timestamp});
             else if (lastValue.startTimestamp)
                 lastValue.endTimestamp = timestamp;
         }
 
-        this.dispatchEventToListeners(WI.DOMNode.Event.LowPowerChanged, {isLowPower, timestamp});
+        this.dispatchEventToListeners(DOMNode.Event.PowerEfficientPlaybackStateChanged, {isPowerEfficient, timestamp});
     }
 
-    canEnterLowPowerMode()
+    canEnterPowerEfficientPlaybackState()
     {
         return this.localName() === "video" || this.nodeName().toLowerCase() === "video";
     }
@@ -957,7 +957,7 @@ WI.DOMNode.Event = {
     AttributeRemoved: "dom-node-attribute-removed",
     EventListenersChanged: "dom-node-event-listeners-changed",
     DidFireEvent: "dom-node-did-fire-event",
-    LowPowerChanged: "dom-node-video-low-power-changed",
+    PowerEfficientPlaybackStateChanged: "dom-node-power-efficient-playback-state-changed",
 };
 
 WI.DOMNode.PseudoElementType = {
index 20bf6d9..9cbc06f 100644 (file)
@@ -36,8 +36,8 @@ WI.MediaInstrument = class MediaInstrument extends WI.Instrument
 
     static supported()
     {
-        // COMPATIBILITY (iOS 12): DOM.didFireEvent and DOM.videoLowPowerChanged did not exist.
-        return window.DOMAgent && DOMAgent.hasEvent("didFireEvent") && DOMAgent.hasEvent("videoLowPowerChanged");
+        // COMPATIBILITY (iOS 12): DOM.didFireEvent.
+        return InspectorBackend.domains.DOM && InspectorBackend.domains.DOM.hasEvent("didFireEvent");
     }
 
     // Protected
index ed37070..d534732 100644 (file)
@@ -25,7 +25,7 @@
 
 WI.MediaTimelineRecord = class MediaTimelineRecord extends WI.TimelineRecord
 {
-    constructor(eventType, timestamp, {domNode, domEvent, isLowPower} = {})
+    constructor(eventType, timestamp, {domNode, domEvent, isPowerEfficient} = {})
     {
         console.assert(Object.values(WI.MediaTimelineRecord.EventType).includes(eventType));
 
@@ -34,7 +34,7 @@ WI.MediaTimelineRecord = class MediaTimelineRecord extends WI.TimelineRecord
         this._eventType = eventType;
         this._domNode = domNode || null;
         this._domEvent = domEvent || null;
-        this._isLowPower = isLowPower || false;
+        this._isPowerEfficient = isPowerEfficient || false;
     }
 
     // Import / Export
@@ -42,6 +42,11 @@ WI.MediaTimelineRecord = class MediaTimelineRecord extends WI.TimelineRecord
     static fromJSON(json)
     {
         let {eventType, timestamp} = json;
+
+        // COMPATIBILITY (iOS 12.2): isLowPower was renamed to isPowerEfficient.
+        if ("isLowPower" in json && !("isPowerEfficient" in json))
+            json.isPowerEfficient = json.isLowPower;
+
         return new WI.MediaTimelineRecord(eventType, timestamp, json);
     }
 
@@ -61,7 +66,7 @@ WI.MediaTimelineRecord = class MediaTimelineRecord extends WI.TimelineRecord
             eventType: this._eventType,
             timestamp: this.startTime,
             domEvent,
-            isLowPower: this._isLowPower,
+            isPowerEfficient: this._isPowerEfficient,
         };
     }
 
@@ -70,7 +75,7 @@ WI.MediaTimelineRecord = class MediaTimelineRecord extends WI.TimelineRecord
     get eventType() { return this._eventType; }
     get domNode() { return this._domNode; }
     get domEvent() { return this._domEvent; }
-    get isLowPower() { return this._isLowPower; }
+    get isPowerEfficient() { return this._isPowerEfficient; }
 
     get displayName()
     {
@@ -81,8 +86,8 @@ WI.MediaTimelineRecord = class MediaTimelineRecord extends WI.TimelineRecord
             return eventName;
         }
 
-        if (this._eventType === WI.MediaTimelineRecord.EventType.LowPower)
-            return this._isLowPower ? WI.UIString("Entered Low-Power Mode") : WI.UIString("Exited Low-Power Mode");
+        if (this._eventType === MediaTimelineRecord.EventType.PowerEfficientPlaybackStateChanged)
+            return this._isPowerEfficient ? WI.UIString("Power Efficient Playback Started") : WI.UIString("Power Efficient Playback Stopped");
 
         if (this._domNode)
             return this._domNode.displayName;
@@ -96,16 +101,19 @@ WI.MediaTimelineRecord = class MediaTimelineRecord extends WI.TimelineRecord
         super.saveIdentityToCookie(cookie);
 
         cookie["media-timeline-record-event-type"] = this._eventType;
+        if (this._eventType === MediaTimelineRecord.EventType.PowerEfficientPlaybackStateChanged)
+            cookie["media-timeline-record-power-efficient-playback"] = this._isPowerEfficient;
         if (this._domNode)
             cookie["media-timeline-record-dom-node"] = this._domNode.path();
-        if (this._domEvent)
+        if (this._domEvent) {
             cookie["media-timeline-record-dom-event"] = this._domEvent.eventName;
-        if (this._isLowPower || (this._domEvent && this._domEvent.data && this._domEvent.data.enabled))
-            cookie["media-timeline-record-active"] = true;
+            if (this._domEvent.data && this._domEvent.data.enabled)
+                cookie["media-timeline-record-dom-event-active"] = true;
+        }
     }
 };
 
 WI.MediaTimelineRecord.EventType = {
     DOMEvent: "dom-event",
-    LowPower: "low-power",
+    PowerEfficientPlaybackStateChanged: "power-efficient-playback-state-changed",
 };
index d09fa66..974409c 100644 (file)
@@ -467,8 +467,8 @@ WI.TimelineRecording = class TimelineRecording extends WI.Object
             if (record.eventType === WI.MediaTimelineRecord.EventType.DOMEvent) {
                 if (record.domEvent && record.domEvent.eventName)
                     key += ":" + record.domEvent.eventName;
-            } else if (record.eventType === WI.MediaTimelineRecord.EventType.LowPower)
-                key += ":" + (record.isLowPower ? "enabled" : "disabled");
+            } else if (record.eventType === WI.MediaTimelineRecord.EventType.PowerEfficientPlaybackStateChanged)
+                key += ":" + (record.isPowerEfficient ? "enabled" : "disabled");
         }
         if (record.sourceCodeLocation)
             key += ":" + record.sourceCodeLocation.lineNumber + ":" + record.sourceCodeLocation.columnNumber;
index eeddb28..73cbef3 100644 (file)
@@ -119,6 +119,12 @@ WI.DOMObserver = class DOMObserver
 
     videoLowPowerChanged(nodeId, timestamp, isLowPower)
     {
-        WI.domManager.videoLowPowerChanged(nodeId, timestamp, isLowPower);
+        // COMPATIBILITY (iOS 12.2): DOM.videoLowPowerChanged was renamed to DOM.powerEfficientPlaybackStateChanged.
+        WI.domManager.powerEfficientPlaybackStateChanged(nodeId, timestamp, isLowPower);
+    }
+
+    powerEfficientPlaybackStateChanged(nodeId, timestamp, isPowerEfficient)
+    {
+        WI.domManager.powerEfficientPlaybackStateChanged(nodeId, timestamp, isPowerEfficient);
     }
 };
index 64aea24..78fb196 100644 (file)
@@ -76,7 +76,7 @@
     background-color: hsla(0, 0%, 75%, 0.25);
 }
 
-.dom-events-breakdown .graph > .area.low-power {
+.dom-events-breakdown .graph > .area.power-efficient-playback {
     background-color: hsla(83, 100%, 48%, 0.4);
 }
 
index 89ff5ff..25ff3d6 100644 (file)
@@ -34,14 +34,13 @@ WI.DOMEventsBreakdownView = class DOMEventsBreakdownView extends WI.View
         if (domNodeOrEvents instanceof WI.DOMNode) {
             this._domNode = domNodeOrEvents;
             this._domNode.addEventListener(WI.DOMNode.Event.DidFireEvent, this._handleDOMNodeDidFireEvent, this);
-            if (this._domNode.canEnterLowPowerMode())
-                this._domNode.addEventListener(WI.DOMNode.Event.LowPowerChanged, this._handleDOMNodeLowPowerChanged, this);
+            if (this._domNode.canEnterPowerEfficientPlaybackState())
+                this._domNode.addEventListener(WI.DOMNode.Event.PowerEfficientPlaybackStateChanged, this._handleDOMNodePowerEfficientPlaybackStateChanged, this);
 
             this._domEvents = null;
         } else {
             this._domNode = null;
             this._domEvents = domNodeOrEvents;
-            this._lowPowerRanges = [];
         }
 
         this._includeGraph = includeGraph || false;
@@ -112,7 +111,7 @@ WI.DOMEventsBreakdownView = class DOMEventsBreakdownView extends WI.View
                 fullscreenRanges.lastValue.originator = fullscreenDOMEvent.originator;
         }
 
-        let lowPowerRanges = this._domNode ? this._domNode.lowPowerRanges : [];
+        let powerEfficientPlaybackRanges = this._domNode ? this._domNode.powerEfficientPlaybackRanges : [];
 
         for (let domEvent of domEvents) {
             let rowElement = this._tableBodyElement.appendChild(document.createElement("tr"));
@@ -138,13 +137,13 @@ WI.DOMEventsBreakdownView = class DOMEventsBreakdownView extends WI.View
                         fullscreenArea.title = WI.UIString("Full-Screen");
                 }
 
-                let lowPowerRange = lowPowerRanges.find((range) => domEvent.timestamp >= range.startTimestamp && domEvent.timestamp <= range.endTimestamp);
-                if (lowPowerRange) {
-                    let lowPowerArea = graphCell.appendChild(document.createElement("div"));
-                    lowPowerArea.classList.add("area", "low-power");
-                    lowPowerArea.title = WI.UIString("Low-Power Mode");
-                    lowPowerArea.style.setProperty(styleAttribute, percentOfTotalTime(lowPowerRange.startTimestamp - startTimestamp) + "%");
-                    lowPowerArea.style.setProperty("width", percentOfTotalTime(lowPowerRange.endTimestamp - lowPowerRange.startTimestamp) + "%");
+                let powerEfficientPlaybackRange = powerEfficientPlaybackRanges.find((range) => domEvent.timestamp >= range.startTimestamp && domEvent.timestamp <= range.endTimestamp);
+                if (powerEfficientPlaybackRange) {
+                    let powerEfficientPlaybackArea = graphCell.appendChild(document.createElement("div"));
+                    powerEfficientPlaybackArea.classList.add("area", "power-efficient-playback");
+                    powerEfficientPlaybackArea.title = WI.UIString("Power Efficient Playback");
+                    powerEfficientPlaybackArea.style.setProperty(styleAttribute, percentOfTotalTime(powerEfficientPlaybackRange.startTimestamp - startTimestamp) + "%");
+                    powerEfficientPlaybackArea.style.setProperty("width", percentOfTotalTime(powerEfficientPlaybackRange.endTimestamp - powerEfficientPlaybackRange.startTimestamp) + "%");
                 }
 
                 let graphImage = graphCell.appendChild(document.createElement("img"));
@@ -183,7 +182,7 @@ WI.DOMEventsBreakdownView = class DOMEventsBreakdownView extends WI.View
         this.needsLayout();
     }
 
-    _handleDOMNodeLowPowerChanged(event)
+    _handleDOMNodePowerEfficientPlaybackStateChanged(event)
     {
         this.needsLayout();
     }
index 6e3dd1e..09a002c 100644 (file)
@@ -211,7 +211,7 @@ body[dir=rtl] .network-table .cell.name > .status {
     background-color: hsla(0, 0%, 75%, 0.75);
 }
 
-.network-table :not(.header) .cell.waterfall .waterfall-container > .area.low-power {
+.network-table :not(.header) .cell.waterfall .waterfall-container > .area.power-efficient-playback {
     background-color: var(--network-request-color);
 }
 
index a7a9fc7..33b9163 100644 (file)
@@ -822,15 +822,15 @@ WI.NetworkTableContentView = class NetworkTableContentView extends WI.ContentVie
                 }
             }
 
-            for (let lowPowerRange of domNode.lowPowerRanges) {
-                let startTimestamp = lowPowerRange.startTimestamp || graphStartTime;
-                let endTimestamp = lowPowerRange.endTimestamp || collection.waterfallEndTime;
-
-                let lowPowerElement = container.appendChild(document.createElement("div"));
-                lowPowerElement.classList.add("area", "low-power");
-                lowPowerElement.title = WI.UIString("Low-Power Mode");
-                positionByStartOffset(lowPowerElement, startTimestamp);
-                setWidthForDuration(lowPowerElement, startTimestamp, endTimestamp);
+            for (let powerEfficientPlaybackRange of domNode.powerEfficientPlaybackRanges) {
+                let startTimestamp = powerEfficientPlaybackRange.startTimestamp || graphStartTime;
+                let endTimestamp = powerEfficientPlaybackRange.endTimestamp || collection.waterfallEndTime;
+
+                let powerEfficientPlaybackRangeElement = container.appendChild(document.createElement("div"));
+                powerEfficientPlaybackRangeElement.classList.add("area", "power-efficient-playback");
+                powerEfficientPlaybackRangeElement.title = WI.UIString("Power Efficient Playback");
+                positionByStartOffset(powerEfficientPlaybackRangeElement, startTimestamp);
+                setWidthForDuration(powerEfficientPlaybackRangeElement, startTimestamp, endTimestamp);
             }
 
             let playing = false;
@@ -1819,8 +1819,8 @@ WI.NetworkTableContentView = class NetworkTableContentView extends WI.ContentVie
             this._domNodeEntries.set(resource.initiatorNode, nodeEntry);
 
             resource.initiatorNode.addEventListener(WI.DOMNode.Event.DidFireEvent, this._handleNodeDidFireEvent, this);
-            if (resource.initiatorNode.canEnterLowPowerMode())
-                resource.initiatorNode.addEventListener(WI.DOMNode.Event.LowPowerChanged, this._handleNodeLowPowerChanged, this);
+            if (resource.initiatorNode.canEnterPowerEfficientPlaybackState())
+                resource.initiatorNode.addEventListener(WI.DOMNode.Event.PowerEfficientPlaybackStateChanged, this._handleDOMNodePowerEfficientPlaybackStateChanged, this);
         }
 
         if (!this._entriesSortComparator)
@@ -1858,7 +1858,7 @@ WI.NetworkTableContentView = class NetworkTableContentView extends WI.ContentVie
         });
     }
 
-    _handleNodeLowPowerChanged(event)
+    _handleDOMNodePowerEfficientPlaybackStateChanged(event)
     {
         this._runForMainCollection((collection, wasMain) => {
             let domNode = event.target;
index ca8e893..7e41245 100644 (file)
     content: url(../Images/DOMEventFullscreen.svg);
 }
 
-.low-power-record .icon {
-    content: url(../Images/LowPower.svg);
+.power-efficient-playback-state-changed-record .icon {
+    content: url(../Images/PowerEfficientPlaybackStateChanged.svg);
 }
 
 @media (prefers-color-scheme: dark) {
index aed5ecf..32d9215 100644 (file)
@@ -251,8 +251,8 @@ WI.TimelineTabContentView = class TimelineTabContentView extends WI.ContentBrows
             switch (timelineRecord.eventType) {
             case WI.MediaTimelineRecord.EventType.DOMEvent:
                 return "dom-event-record";
-            case WI.MediaTimelineRecord.EventType.LowPower:
-                return "low-power-record";
+            case WI.MediaTimelineRecord.EventType.PowerEfficientPlaybackStateChanged:
+                return "power-efficient-playback-state-changed-record";
             default:
                 console.error("Unknown MediaTimelineRecord eventType: " + timelineRecord.eventType, timelineRecord);
             }