forked from jsantell/firefox-patches
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1110878-dropdown-audio-inspector.patch
70 lines (60 loc) · 2.76 KB
/
1110878-dropdown-audio-inspector.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
From 9fbf20ea060fbebf340ef5bc468534d250449486 Mon Sep 17 00:00:00 2001
From: Jordan Santell <[email protected]>
Date: Wed, 17 Dec 2014 12:07:05 -0800
Subject: Bug 1110878 - Don't display arrow dropdowns on web audio
inspector variables. r=jryans
---
.../test/browser_wa_properties-view-params-objects.js | 8 ++++++++
browser/devtools/webaudioeditor/views/inspector.js | 5 ++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/browser/devtools/webaudioeditor/test/browser_wa_properties-view-params-objects.js b/browser/devtools/webaudioeditor/test/browser_wa_properties-view-params-objects.js
index 5ddca09..7fb6ec1 100644
--- a/browser/devtools/webaudioeditor/test/browser_wa_properties-view-params-objects.js
+++ b/browser/devtools/webaudioeditor/test/browser_wa_properties-view-params-objects.js
@@ -23,17 +23,25 @@ function spawnTest() {
let nodeIds = actors.map(actor => actor.actorID);
click(panelWin, findGraphNode(panelWin, nodeIds[2]));
yield once(panelWin, EVENTS.UI_INSPECTOR_NODE_SET);
checkVariableView(gVars, 0, {
"curve": "Float32Array"
}, "WaveShaper's `curve` is listed as an `Float32Array`.");
+ let aVar = gVars.getScopeAtIndex(0).get("curve")
+ let state = aVar.target.querySelector(".theme-twisty").hasAttribute("invisible");
+ ok(state, "Float32Array property should not have a dropdown.");
+
click(panelWin, findGraphNode(panelWin, nodeIds[1]));
yield once(panelWin, EVENTS.UI_INSPECTOR_NODE_SET);
checkVariableView(gVars, 0, {
"buffer": "AudioBuffer"
}, "AudioBufferSourceNode's `buffer` is listed as an `AudioBuffer`.");
+ aVar = gVars.getScopeAtIndex(0).get("buffer")
+ state = aVar.target.querySelector(".theme-twisty").hasAttribute("invisible");
+ ok(state, "AudioBuffer property should not have a dropdown.");
+
yield teardown(panel);
finish();
}
diff --git a/browser/devtools/webaudioeditor/views/inspector.js b/browser/devtools/webaudioeditor/views/inspector.js
index 0a80755..4997b52 100644
--- a/browser/devtools/webaudioeditor/views/inspector.js
+++ b/browser/devtools/webaudioeditor/views/inspector.js
@@ -145,17 +145,20 @@ let InspectorView = {
// when there are no props i.e. AudioDestinationNode
this._togglePropertiesView(!!props.length);
props.forEach(({ param, value, flags }) => {
let descriptor = {
value: value,
writable: !flags || !flags.readonly,
};
- audioParamsScope.addItem(param, descriptor);
+ let item = audioParamsScope.addItem(param, descriptor);
+
+ // No items should currently display a dropdown
+ item.twisty = false;
});
audioParamsScope.expanded = true;
window.emit(EVENTS.UI_PROPERTIES_TAB_RENDERED, node.id);
}),
_togglePropertiesView: function (show) {
--
1.8.4.2