Bug 1528181 - Enable the scrollable badge for good; r=mtigley

Differential Revision: https://phabricator.services.mozilla.com/D19909

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Patrick Brosset 2019-02-15 16:22:55 +00:00
Родитель ab4bcb3e97
Коммит 3aea607fb0
4 изменённых файлов: 2 добавлений и 21 удалений

Просмотреть файл

@ -41,7 +41,6 @@ const DRAG_DROP_HEIGHT_TO_SPEED_MIN = 0.5;
const DRAG_DROP_HEIGHT_TO_SPEED_MAX = 1; const DRAG_DROP_HEIGHT_TO_SPEED_MAX = 1;
const ATTR_COLLAPSE_ENABLED_PREF = "devtools.markup.collapseAttributes"; const ATTR_COLLAPSE_ENABLED_PREF = "devtools.markup.collapseAttributes";
const ATTR_COLLAPSE_LENGTH_PREF = "devtools.markup.collapseAttributeLength"; const ATTR_COLLAPSE_LENGTH_PREF = "devtools.markup.collapseAttributeLength";
const SCROLLABLE_BADGE_PREF = "devtools.inspector.scrollable-badges.enabled";
/** /**
* Vocabulary for the purposes of this file: * Vocabulary for the purposes of this file:
@ -82,7 +81,6 @@ function MarkupView(inspector, frame, controllerWindow) {
this.collapseAttributes = Services.prefs.getBoolPref(ATTR_COLLAPSE_ENABLED_PREF); this.collapseAttributes = Services.prefs.getBoolPref(ATTR_COLLAPSE_ENABLED_PREF);
this.collapseAttributeLength = Services.prefs.getIntPref(ATTR_COLLAPSE_LENGTH_PREF); this.collapseAttributeLength = Services.prefs.getIntPref(ATTR_COLLAPSE_LENGTH_PREF);
this.isScrollableBadgesEnabled = Services.prefs.getBoolPref(SCROLLABLE_BADGE_PREF);
// Creating the popup to be used to show CSS suggestions. // Creating the popup to be used to show CSS suggestions.
// The popup will be attached to the toolbox document. // The popup will be attached to the toolbox document.
@ -120,9 +118,7 @@ function MarkupView(inspector, frame, controllerWindow) {
this._frame.addEventListener("focus", this._onFocus); this._frame.addEventListener("focus", this._onFocus);
this.inspector.selection.on("new-node-front", this._onNewSelection); this.inspector.selection.on("new-node-front", this._onNewSelection);
this.walker.on("display-change", this._onWalkerNodeStatesChanged); this.walker.on("display-change", this._onWalkerNodeStatesChanged);
if (this.isScrollableBadgesEnabled) { this.walker.on("scrollable-change", this._onWalkerNodeStatesChanged);
this.walker.on("scrollable-change", this._onWalkerNodeStatesChanged);
}
this.walker.on("mutations", this._mutationObserver); this.walker.on("mutations", this._mutationObserver);
this.win.addEventListener("copy", this._onCopy); this.win.addEventListener("copy", this._onCopy);
this.win.addEventListener("mouseup", this._onMouseUp); this.win.addEventListener("mouseup", this._onMouseUp);
@ -1964,9 +1960,7 @@ MarkupView.prototype = {
"picker-node-hovered", this._onToolboxPickerHover "picker-node-hovered", this._onToolboxPickerHover
); );
this.walker.off("display-change", this._onWalkerNodeStatesChanged); this.walker.off("display-change", this._onWalkerNodeStatesChanged);
if (this.isScrollableBadgesEnabled) { this.walker.off("scrollable-change", this._onWalkerNodeStatesChanged);
this.walker.off("scrollable-change", this._onWalkerNodeStatesChanged);
}
this.walker.off("mutations", this._mutationObserver); this.walker.off("mutations", this._mutationObserver);
this.win.removeEventListener("copy", this._onCopy); this.win.removeEventListener("copy", this._onCopy);
this.win.removeEventListener("mouseup", this._onMouseUp); this.win.removeEventListener("mouseup", this._onMouseUp);

Просмотреть файл

@ -26,9 +26,6 @@ const TEST_URI = `
`; `;
add_task(async function() { add_task(async function() {
info("Enable the scrollable badge feature");
await pushPref("devtools.inspector.scrollable-badges.enabled", true);
const { inspector } = await openInspectorForURL( const { inspector } = await openInspectorForURL(
"data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI)); "data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));

Просмотреть файл

@ -297,10 +297,6 @@ ElementEditor.prototype = {
}, },
updateScrollableBadge: function() { updateScrollableBadge: function() {
if (!this.markup.isScrollableBadgesEnabled) {
return;
}
if (this.node.isScrollable && !this._scrollableBadge) { if (this.node.isScrollable && !this._scrollableBadge) {
this._createScrollableBadge(); this._createScrollableBadge();
} else if (this._scrollableBadge && !this.node.isScrollable) { } else if (this._scrollableBadge && !this.node.isScrollable) {

Просмотреть файл

@ -56,12 +56,6 @@ pref("devtools.inspector.fonthighlighter.enabled", true);
pref("devtools.inspector.changes.enabled", true); pref("devtools.inspector.changes.enabled", true);
// Enable the new Rules View // Enable the new Rules View
pref("devtools.inspector.new-rulesview.enabled", false); pref("devtools.inspector.new-rulesview.enabled", false);
// Enable the 'scrollable' markup-badges in nightly only for now
#if defined(NIGHTLY_BUILD)
pref("devtools.inspector.scrollable-badges.enabled", true);
#else
pref("devtools.inspector.scrollable-badges.enabled", false);
#endif
// Flexbox preferences // Flexbox preferences
// Whether or not to show the combined flexbox and box model highlighter. // Whether or not to show the combined flexbox and box model highlighter.