зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to autoland. a=merge CLOSED TREE
This commit is contained in:
Коммит
4d01cad1b7
|
@ -1,5 +1,8 @@
|
|||
requestLongerTimeout(2);
|
||||
|
||||
const {PlacesTestUtils} =
|
||||
ChromeUtils.import("resource://testing-common/PlacesTestUtils.jsm", {});
|
||||
|
||||
// Bug 453440 - Test the timespan-based logic of the sanitizer code
|
||||
var now_mSec = Date.now();
|
||||
var now_uSec = now_mSec * 1000;
|
||||
|
@ -426,46 +429,37 @@ async function onHistoryReady() {
|
|||
ok(!(await downloadExists(publicList, "fakefile-old")), "Year old download should now be deleted");
|
||||
}
|
||||
|
||||
function setupHistory() {
|
||||
return new Promise(resolve => {
|
||||
async function setupHistory() {
|
||||
|
||||
let places = [];
|
||||
let places = [];
|
||||
|
||||
function addPlace(aURI, aTitle, aVisitDate) {
|
||||
places.push({
|
||||
uri: aURI,
|
||||
title: aTitle,
|
||||
visits: [{
|
||||
visitDate: aVisitDate,
|
||||
transitionType: Ci.nsINavHistoryService.TRANSITION_LINK
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
addPlace(makeURI("http://10minutes.com/"), "10 minutes ago", now_uSec - 10 * kUsecPerMin);
|
||||
addPlace(makeURI("http://1hour.com/"), "Less than 1 hour ago", now_uSec - 45 * kUsecPerMin);
|
||||
addPlace(makeURI("http://1hour10minutes.com/"), "1 hour 10 minutes ago", now_uSec - 70 * kUsecPerMin);
|
||||
addPlace(makeURI("http://2hour.com/"), "Less than 2 hours ago", now_uSec - 90 * kUsecPerMin);
|
||||
addPlace(makeURI("http://2hour10minutes.com/"), "2 hours 10 minutes ago", now_uSec - 130 * kUsecPerMin);
|
||||
addPlace(makeURI("http://4hour.com/"), "Less than 4 hours ago", now_uSec - 180 * kUsecPerMin);
|
||||
addPlace(makeURI("http://4hour10minutes.com/"), "4 hours 10 minutesago", now_uSec - 250 * kUsecPerMin);
|
||||
|
||||
let today = new Date();
|
||||
today.setHours(0);
|
||||
today.setMinutes(0);
|
||||
today.setSeconds(1);
|
||||
addPlace(makeURI("http://today.com/"), "Today", today.getTime() * 1000);
|
||||
|
||||
let lastYear = new Date();
|
||||
lastYear.setFullYear(lastYear.getFullYear() - 1);
|
||||
addPlace(makeURI("http://before-today.com/"), "Before Today", lastYear.getTime() * 1000);
|
||||
PlacesUtils.asyncHistory.updatePlaces(places, {
|
||||
handleError: () => ok(false, "Unexpected error in adding visit."),
|
||||
handleResult: () => { },
|
||||
handleCompletion: () => resolve()
|
||||
function addPlace(aURI, aTitle, aVisitDate) {
|
||||
places.push({
|
||||
uri: aURI,
|
||||
title: aTitle,
|
||||
visitDate: aVisitDate,
|
||||
transition: Ci.nsINavHistoryService.TRANSITION_LINK
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
addPlace("http://10minutes.com/", "10 minutes ago", now_uSec - 10 * kUsecPerMin);
|
||||
addPlace("http://1hour.com/", "Less than 1 hour ago", now_uSec - 45 * kUsecPerMin);
|
||||
addPlace("http://1hour10minutes.com/", "1 hour 10 minutes ago", now_uSec - 70 * kUsecPerMin);
|
||||
addPlace("http://2hour.com/", "Less than 2 hours ago", now_uSec - 90 * kUsecPerMin);
|
||||
addPlace("http://2hour10minutes.com/", "2 hours 10 minutes ago", now_uSec - 130 * kUsecPerMin);
|
||||
addPlace("http://4hour.com/", "Less than 4 hours ago", now_uSec - 180 * kUsecPerMin);
|
||||
addPlace("http://4hour10minutes.com/", "4 hours 10 minutesago", now_uSec - 250 * kUsecPerMin);
|
||||
|
||||
let today = new Date();
|
||||
today.setHours(0);
|
||||
today.setMinutes(0);
|
||||
today.setSeconds(1);
|
||||
addPlace("http://today.com/", "Today", today.getTime() * 1000);
|
||||
|
||||
let lastYear = new Date();
|
||||
lastYear.setFullYear(lastYear.getFullYear() - 1);
|
||||
addPlace("http://before-today.com/", "Before Today", lastYear.getTime() * 1000);
|
||||
await PlacesTestUtils.addVisits(places);
|
||||
}
|
||||
|
||||
async function setupFormHistory() {
|
||||
|
|
|
@ -10,59 +10,42 @@
|
|||
* are shown in it.
|
||||
*/
|
||||
|
||||
var now = Date.now();
|
||||
add_task(async function test() {
|
||||
// Add visits.
|
||||
await PlacesTestUtils.addVisits([{
|
||||
uri: "http://mozilla.org",
|
||||
transition: PlacesUtils.history.TRANSITION_TYPED
|
||||
}, {
|
||||
uri: "http://google.com",
|
||||
transition: PlacesUtils.history.TRANSITION_DOWNLOAD
|
||||
}, {
|
||||
uri: "http://en.wikipedia.org",
|
||||
transition: PlacesUtils.history.TRANSITION_TYPED
|
||||
}, {
|
||||
uri: "http://ubuntu.org",
|
||||
transition: PlacesUtils.history.TRANSITION_DOWNLOAD
|
||||
}]);
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
let library = await promiseLibrary("Downloads");
|
||||
|
||||
let onLibraryReady = function(win) {
|
||||
// Add visits to compare contents with.
|
||||
let places = [
|
||||
{ uri: NetUtil.newURI("http://mozilla.com"),
|
||||
visits: [ new VisitInfo(PlacesUtils.history.TRANSITION_TYPED) ]
|
||||
},
|
||||
{ uri: NetUtil.newURI("http://google.com"),
|
||||
visits: [ new VisitInfo(PlacesUtils.history.TRANSITION_DOWNLOAD) ]
|
||||
},
|
||||
{ uri: NetUtil.newURI("http://en.wikipedia.org"),
|
||||
visits: [ new VisitInfo(PlacesUtils.history.TRANSITION_TYPED) ]
|
||||
},
|
||||
{ uri: NetUtil.newURI("http://ubuntu.org"),
|
||||
visits: [ new VisitInfo(PlacesUtils.history.TRANSITION_DOWNLOAD) ]
|
||||
},
|
||||
];
|
||||
PlacesUtils.asyncHistory.updatePlaces(places, {
|
||||
handleResult() {},
|
||||
handleError() {
|
||||
ok(false, "gHistory.updatePlaces() failed");
|
||||
},
|
||||
handleCompletion() {
|
||||
// Make sure Downloads is present.
|
||||
isnot(win.PlacesOrganizer._places.selectedNode, null,
|
||||
"Downloads is present and selected");
|
||||
registerCleanupFunction(async () => {
|
||||
await library.close();
|
||||
await PlacesUtils.history.clear();
|
||||
});
|
||||
|
||||
// Make sure Downloads is present.
|
||||
Assert.notEqual(library.PlacesOrganizer._places.selectedNode, null,
|
||||
"Downloads is present and selected");
|
||||
|
||||
// Check results.
|
||||
let testURIs = ["http://ubuntu.org/", "http://google.com/"];
|
||||
for (let element of win.ContentArea.currentView
|
||||
.associatedElement.children) {
|
||||
is(element._shell.download.source.url, testURIs.shift(),
|
||||
"URI matches");
|
||||
}
|
||||
// Check results.
|
||||
let testURIs = ["http://ubuntu.org/", "http://google.com/"];
|
||||
|
||||
win.close();
|
||||
PlacesUtils.history.clear().then(finish);
|
||||
}
|
||||
});
|
||||
};
|
||||
await BrowserTestUtils.waitForCondition(() =>
|
||||
library.ContentArea.currentView.associatedElement.children.length == testURIs.length);
|
||||
|
||||
openLibrary(onLibraryReady, "Downloads");
|
||||
}
|
||||
|
||||
function VisitInfo(aTransitionType) {
|
||||
this.transitionType =
|
||||
aTransitionType === undefined ?
|
||||
PlacesUtils.history.TRANSITION_LINK : aTransitionType;
|
||||
this.visitDate = now++ * 1000;
|
||||
}
|
||||
VisitInfo.prototype = {};
|
||||
for (let element of library.ContentArea.currentView
|
||||
.associatedElement.children) {
|
||||
Assert.equal(element._shell.download.source.url, testURIs.shift(),
|
||||
"URI matches");
|
||||
}
|
||||
});
|
||||
|
|
|
@ -537,8 +537,11 @@ var gMainPane = {
|
|||
setEventListener("actionColumn", "click", gMainPane.sort);
|
||||
setEventListener("chooseFolder", "command", gMainPane.chooseFolder);
|
||||
setEventListener("saveWhere", "command", gMainPane.handleSaveToCommand);
|
||||
Preferences.get("browser.download.folderList").on("change",
|
||||
gMainPane.displayDownloadDirPref.bind(gMainPane));
|
||||
Preferences.get("browser.download.dir").on("change",
|
||||
gMainPane.displayDownloadDirPref.bind(gMainPane));
|
||||
gMainPane.displayDownloadDirPref();
|
||||
|
||||
// Listen for window unload so we can remove our preference observers.
|
||||
window.addEventListener("unload", this);
|
||||
|
@ -2473,27 +2476,18 @@ var gMainPane = {
|
|||
// Display a 'pretty' label or the path in the UI.
|
||||
if (folderIndex == 2) {
|
||||
// Custom path selected and is configured
|
||||
downloadFolder.label = this._getDisplayNameOfFile(currentDirPref.value);
|
||||
downloadFolder.value = currentDirPref.value ? currentDirPref.value.path : "";
|
||||
iconUrlSpec = fph.getURLSpecFromFile(currentDirPref.value);
|
||||
} else if (folderIndex == 1) {
|
||||
// 'Downloads'
|
||||
downloadFolder.label = bundlePreferences.getString("downloadsFolderName");
|
||||
downloadFolder.value = bundlePreferences.getString("downloadsFolderName");
|
||||
iconUrlSpec = fph.getURLSpecFromFile(await this._indexToFolder(1));
|
||||
} else {
|
||||
// 'Desktop'
|
||||
downloadFolder.label = bundlePreferences.getString("desktopFolderName");
|
||||
downloadFolder.value = bundlePreferences.getString("desktopFolderName");
|
||||
iconUrlSpec = fph.getURLSpecFromFile(await this._getDownloadsFolder("Desktop"));
|
||||
}
|
||||
downloadFolder.image = "moz-icon://" + iconUrlSpec + "?size=16";
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the textual path of a folder in readable form.
|
||||
*/
|
||||
_getDisplayNameOfFile(aFolder) {
|
||||
// TODO: would like to add support for 'Downloads on Macintosh HD'
|
||||
// for OS X users.
|
||||
return aFolder ? aFolder.path : "";
|
||||
downloadFolder.style.backgroundImage = "url(moz-icon://" + iconUrlSpec + "?size=16)";
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -353,28 +353,24 @@
|
|||
<radiogroup id="saveWhere"
|
||||
preference="browser.download.useDownloadDir"
|
||||
onsyncfrompreference="return gMainPane.readUseDownloadDir();">
|
||||
<hbox id="saveToRow">
|
||||
<hbox>
|
||||
<radio id="saveTo"
|
||||
value="true"
|
||||
data-l10n-id="download-save-to"
|
||||
aria-labelledby="saveTo downloadFolder"/>
|
||||
<filefield id="downloadFolder"
|
||||
flex="1"
|
||||
preference="browser.download.folderList"
|
||||
preference-editable="true"
|
||||
aria-labelledby="saveTo"
|
||||
onsyncfrompreference="return gMainPane.displayDownloadDirPref();"/>
|
||||
value="true"
|
||||
data-l10n-id="download-save-to"/>
|
||||
<textbox id="downloadFolder" flex="1"
|
||||
readonly="true"
|
||||
aria-labelledby="saveTo"/>
|
||||
<button id="chooseFolder"
|
||||
data-l10n-id="download-choose-folder"
|
||||
/>
|
||||
class="accessory-button"
|
||||
data-l10n-id="download-choose-folder"/>
|
||||
</hbox>
|
||||
<!-- Additional radio button added to support CloudStorage - Bug 1357171 -->
|
||||
<radio id="saveToCloud"
|
||||
value="true"
|
||||
hidden="true"/>
|
||||
value="true"
|
||||
hidden="true"/>
|
||||
<radio id="alwaysAsk"
|
||||
value="false"
|
||||
data-l10n-id="download-always-ask-where"/>
|
||||
value="false"
|
||||
data-l10n-id="download-always-ask-where"/>
|
||||
</radiogroup>
|
||||
</groupbox>
|
||||
|
||||
|
|
|
@ -22,22 +22,6 @@ menuitem.subviewbutton {
|
|||
-moz-appearance: none !important;
|
||||
}
|
||||
|
||||
menu.subviewbutton > .menu-right {
|
||||
-moz-appearance: none;
|
||||
list-style-image: url(chrome://browser/skin/places/bookmarks-menu-arrow.png);
|
||||
-moz-image-region: rect(0, 16px, 16px, 0);
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
menu[disabled="true"].subviewbutton > .menu-right {
|
||||
-moz-image-region: rect(0, 32px, 16px, 16px);
|
||||
}
|
||||
|
||||
menu.subviewbutton > .menu-right:-moz-locale-dir(rtl) {
|
||||
transform: scaleX(-1);
|
||||
}
|
||||
|
||||
.subviewradio > .radio-label-box {
|
||||
-moz-appearance: none;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,6 @@ browser.jar:
|
|||
skin/classic/browser/places/allBookmarks.png (places/allBookmarks.png)
|
||||
skin/classic/browser/places/bookmarksMenu.png (places/bookmarksMenu.png)
|
||||
skin/classic/browser/places/bookmarksToolbar.png (places/bookmarksToolbar.png)
|
||||
skin/classic/browser/places/bookmarks-menu-arrow.png (places/bookmarks-menu-arrow.png)
|
||||
* skin/classic/browser/places/editBookmark.css (places/editBookmark.css)
|
||||
skin/classic/browser/places/livemark-item.png (places/livemark-item.png)
|
||||
* skin/classic/browser/places/places.css (places/places.css)
|
||||
|
|
Двоичные данные
browser/themes/linux/places/bookmarks-menu-arrow.png
Двоичные данные
browser/themes/linux/places/bookmarks-menu-arrow.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 182 B |
|
@ -17,7 +17,3 @@
|
|||
margin-inline-start: 1px;
|
||||
margin-inline-end: 8px;
|
||||
}
|
||||
|
||||
filefield + button {
|
||||
margin-inline-start: -4px;
|
||||
}
|
||||
|
|
|
@ -39,18 +39,24 @@ panelmultiview .toolbaritem-combined-buttons > spacer.before-label {
|
|||
display: none;
|
||||
}
|
||||
|
||||
/* Override OSX-specific toolkit styles for the bookmarks panel */
|
||||
menu.subviewbutton > .menu-right {
|
||||
margin-inline-end: 0;
|
||||
#BMB_bookmarksPopup menupopup[placespopup=true]:-moz-lwtheme {
|
||||
-moz-appearance: none;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
menu.subviewbutton > .menu-right > image {
|
||||
/* We don't want the arrow to highlight when the .subviewbutton is hovered,
|
||||
* so we set the -moz-appearance rule on the image
|
||||
* (which doesn't inherit the _moz-menuactive attribute) instead.
|
||||
*/
|
||||
-moz-appearance: menuarrow;
|
||||
#BMB_bookmarksPopup menupopup[placespopup=true] > hbox:-moz-lwtheme {
|
||||
background: var(--arrowpanel-background);
|
||||
border-radius: var(--arrowpanel-border-radius);
|
||||
box-shadow: 0 0 0 1px var(--arrowpanel-border-color);
|
||||
color: var(--arrowpanel-color);
|
||||
border: none;
|
||||
margin: 1px;
|
||||
}
|
||||
|
||||
/* Override OSX-specific toolkit styles for the bookmarks panel */
|
||||
menu.subviewbutton > .menu-right {
|
||||
margin-inline-end: -4px;
|
||||
-moz-appearance: none;
|
||||
}
|
||||
|
||||
.PanelUI-subView menuseparator,
|
||||
|
|
|
@ -14,16 +14,6 @@
|
|||
margin-inline-end: 8px !important;
|
||||
}
|
||||
|
||||
#downloadFolder > .fileFieldContentBox {
|
||||
padding-inline-start: 3px;
|
||||
}
|
||||
|
||||
filefield + button {
|
||||
margin-inline-start: -8px;
|
||||
margin-top: 4px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
#popupPolicyRow {
|
||||
/* Override styles from
|
||||
browser/themes/osx/preferences/preferences.css */
|
||||
|
|
До Ширина: | Высота: | Размер: 390 B После Ширина: | Высота: | Размер: 390 B |
|
@ -803,6 +803,23 @@ panelview .toolbarbutton-1,
|
|||
padding-inline-start: 24px; /* This is 16px for the icon + 8px for the padding as defined below. */
|
||||
}
|
||||
|
||||
.subviewbutton > .menu-right {
|
||||
-moz-appearance: none;
|
||||
list-style-image: url(chrome://browser/skin/customizableui/menu-arrow.svg);
|
||||
-moz-context-properties: fill, fill-opacity;
|
||||
fill: currentColor;
|
||||
/* Reset the rect we inherit from the button */
|
||||
-moz-image-region: auto;
|
||||
}
|
||||
|
||||
.subviewbutton[disabled="true"] > .menu-right {
|
||||
fill-opacity: 0.6;
|
||||
}
|
||||
|
||||
.subviewbutton > .menu-right:-moz-locale-dir(rtl) {
|
||||
transform: scaleX(-1);
|
||||
}
|
||||
|
||||
.subviewbutton > .menu-right,
|
||||
.subviewbutton > .menu-accel-container > .menu-iconic-accel,
|
||||
.subviewbutton > .menu-iconic-left,
|
||||
|
|
|
@ -215,6 +215,12 @@ button > hbox > label {
|
|||
|
||||
#downloadFolder {
|
||||
margin-inline-start: 0;
|
||||
padding-inline-start: 30px;
|
||||
background: center left 8px / 16px no-repeat;
|
||||
}
|
||||
|
||||
#downloadFolder:-moz-locale-dir(rtl) {
|
||||
background-position-x: right 8px;
|
||||
}
|
||||
|
||||
#updateApp > .groupbox-body > label {
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
skin/classic/browser/customizableui/density-compact.svg (../shared/customizableui/density-compact.svg)
|
||||
skin/classic/browser/customizableui/density-normal.svg (../shared/customizableui/density-normal.svg)
|
||||
skin/classic/browser/customizableui/density-touch.svg (../shared/customizableui/density-touch.svg)
|
||||
skin/classic/browser/customizableui/menu-arrow.svg (../shared/customizableui/menu-arrow.svg)
|
||||
skin/classic/browser/customizableui/whimsy.png (../shared/customizableui/whimsy.png)
|
||||
skin/classic/browser/downloads/contentAreaDownloadsView.css (../shared/downloads/contentAreaDownloadsView.css)
|
||||
skin/classic/browser/downloads/download-blocked.svg (../shared/downloads/download-blocked.svg)
|
||||
|
|
|
@ -43,23 +43,6 @@ menuitem.subviewbutton[disabled]:not(.menuitem-iconic) {
|
|||
min-height: 22px;
|
||||
}
|
||||
|
||||
menu.subviewbutton > .menu-right {
|
||||
-moz-appearance: none;
|
||||
list-style-image: url(chrome://browser/skin/customizableui/menu-arrow.svg);
|
||||
-moz-context-properties: fill, fill-opacity;
|
||||
fill: currentColor;
|
||||
/* Reset the rect we inherit from the button: */
|
||||
-moz-image-region: auto;
|
||||
}
|
||||
|
||||
menu[disabled="true"].subviewbutton > .menu-right {
|
||||
fill-opacity: 0.6;
|
||||
}
|
||||
|
||||
menu.subviewbutton > .menu-right:-moz-locale-dir(rtl) {
|
||||
transform: scaleX(-1);
|
||||
}
|
||||
|
||||
/* Win8 and beyond. */
|
||||
@media not all and (-moz-os-version: windows-win7) {
|
||||
#BMB_bookmarksPopup menupopup[placespopup=true] > hbox,
|
||||
|
|
|
@ -18,7 +18,6 @@ browser.jar:
|
|||
skin/classic/browser/slowStartup-16.png
|
||||
skin/classic/browser/webRTC-indicator.css (../shared/webRTC-indicator.css)
|
||||
* skin/classic/browser/controlcenter/panel.css (controlcenter/panel.css)
|
||||
skin/classic/browser/customizableui/menu-arrow.svg (customizableui/menu-arrow.svg)
|
||||
* skin/classic/browser/customizableui/panelUI.css (customizableui/panelUI.css)
|
||||
* skin/classic/browser/downloads/allDownloadsView.css (downloads/allDownloadsView.css)
|
||||
* skin/classic/browser/downloads/downloads.css (downloads/downloads.css)
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
margin-inline-end: 9px;
|
||||
}
|
||||
|
||||
textbox + button,
|
||||
filefield + button {
|
||||
textbox + button {
|
||||
margin-inline-start: -4px;
|
||||
margin-top: 4px;
|
||||
margin-bottom: 4px;
|
||||
|
|
|
@ -11,9 +11,3 @@
|
|||
.actionsMenu > .menulist-label-box > .menulist-icon {
|
||||
margin-inline-end: 9px;
|
||||
}
|
||||
|
||||
filefield + button {
|
||||
margin-inline-start: -4px;
|
||||
margin-top: 4px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
This is the debugger.html project output.
|
||||
See https://github.com/devtools-html/debugger.html
|
||||
|
||||
Version 42.0
|
||||
Version 43.0
|
||||
|
||||
Comparison: https://github.com/devtools-html/debugger.html/compare/release-41...release-42
|
||||
Comparison: https://github.com/devtools-html/debugger.html/compare/release-42...release-43
|
||||
|
||||
Packages:
|
||||
- babel-plugin-transform-es2015-modules-commonjs @6.26.0
|
||||
|
|
|
@ -918,6 +918,10 @@ html[dir="rtl"] .tree-node img.arrow {
|
|||
padding: 0;
|
||||
}
|
||||
|
||||
.close-btn:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.close-btn .close {
|
||||
mask: url("chrome://devtools/skin/images/debugger/close.svg") no-repeat;
|
||||
mask-size: 100%;
|
||||
|
@ -2871,7 +2875,6 @@ debug-expression-error {
|
|||
color: var(--theme-content-color1);
|
||||
position: relative;
|
||||
transition: all 0.25s ease;
|
||||
padding: 0.5em 1em 0.5em 0.5em;
|
||||
}
|
||||
|
||||
.breakpoints-list .breakpoint-heading,
|
||||
|
@ -2884,6 +2887,10 @@ debug-expression-error {
|
|||
padding: 0 1em 0.5em 2em;
|
||||
}
|
||||
|
||||
html[dir="rtl"] .breakpoints-exceptions-caught {
|
||||
padding: 0 2em 0.5em 1em;
|
||||
}
|
||||
|
||||
.breakpoints-exceptions-options:not(.empty) {
|
||||
border-bottom: 1px solid var(--theme-splitter-color);
|
||||
}
|
||||
|
@ -3436,6 +3443,9 @@ html[dir="rtl"] .breakpoints-list .breakpoint .breakpoint-line {
|
|||
.accordion {
|
||||
background-color: var(--theme-sidebar-background);
|
||||
width: 100%;
|
||||
list-style-type: none;
|
||||
padding: 0px;
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.accordion ._header {
|
||||
|
@ -3448,6 +3458,8 @@ html[dir="rtl"] .breakpoints-list .breakpoint .breakpoint-line {
|
|||
width: 100%;
|
||||
height: 24px;
|
||||
align-items: center;
|
||||
margin: 0px;
|
||||
font-weight: normal;
|
||||
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
|
@ -3538,7 +3550,8 @@ img.reverseStepOut,
|
|||
img.replay-previous,
|
||||
img.replay-next,
|
||||
img.resume,
|
||||
img.shortcuts {
|
||||
img.shortcuts,
|
||||
img.skipPausing {
|
||||
background-color: var(--theme-body-color);
|
||||
}
|
||||
|
||||
|
@ -3620,6 +3633,15 @@ img.shortcuts {
|
|||
float: right;
|
||||
}
|
||||
|
||||
.command-bar .skipPausing {
|
||||
mask: url("chrome://devtools/skin/images/debugger/disable-pausing.svg") no-repeat;
|
||||
mask-size: 100%;
|
||||
}
|
||||
|
||||
.command-bar .active .skipPausing {
|
||||
background-color: var(--theme-highlight-blue);
|
||||
}
|
||||
|
||||
.bottom {
|
||||
border-bottom: none;
|
||||
background-color: var(--theme-body-background);
|
||||
|
|
|
@ -3230,7 +3230,7 @@ function createPendingBreakpoint(bp) {
|
|||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.replaceOriginalVariableName = exports.getPausePoints = exports.getFramework = exports.mapOriginalExpression = exports.hasSyntaxError = exports.clearSources = exports.setSource = exports.hasSource = exports.getNextStep = exports.clearASTs = exports.clearScopes = exports.clearSymbols = exports.findOutOfScopeLocations = exports.getScopes = exports.getSymbols = exports.getClosestExpression = exports.stopParserWorker = exports.startParserWorker = undefined;
|
||||
exports.replaceOriginalVariableName = exports.getPausePoints = exports.getFramework = exports.mapOriginalExpression = exports.hasSyntaxError = exports.clearSources = exports.setSource = exports.hasSource = exports.getNextStep = exports.clearASTs = exports.clearScopes = exports.clearSymbols = exports.findOutOfScopeLocations = exports.getScopes = exports.getSymbols = exports.getClosestExpression = exports.stop = exports.start = undefined;
|
||||
|
||||
var _devtoolsUtils = __webpack_require__(1363);
|
||||
|
||||
|
@ -3239,8 +3239,8 @@ const { WorkerDispatcher } = _devtoolsUtils.workerUtils; /* This Source Code For
|
|||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
const dispatcher = new WorkerDispatcher();
|
||||
const startParserWorker = exports.startParserWorker = dispatcher.start.bind(dispatcher);
|
||||
const stopParserWorker = exports.stopParserWorker = dispatcher.stop.bind(dispatcher);
|
||||
const start = exports.start = dispatcher.start.bind(dispatcher);
|
||||
const stop = exports.stop = dispatcher.stop.bind(dispatcher);
|
||||
|
||||
const getClosestExpression = exports.getClosestExpression = dispatcher.task("getClosestExpression");
|
||||
const getSymbols = exports.getSymbols = dispatcher.task("getSymbols");
|
||||
|
@ -5552,6 +5552,7 @@ exports.getSelectedScopeMappings = getSelectedScopeMappings;
|
|||
exports.getSelectedFrameId = getSelectedFrameId;
|
||||
exports.getTopFrame = getTopFrame;
|
||||
exports.getDebuggeeUrl = getDebuggeeUrl;
|
||||
exports.getSkipPausing = getSkipPausing;
|
||||
exports.getChromeScopes = getChromeScopes;
|
||||
|
||||
var _reselect = __webpack_require__(993);
|
||||
|
@ -5579,7 +5580,8 @@ const createPauseState = exports.createPauseState = () => ({
|
|||
canRewind: false,
|
||||
debuggeeUrl: "",
|
||||
command: null,
|
||||
previousLocation: null
|
||||
previousLocation: null,
|
||||
skipPausing: _prefs.prefs.skipPausing
|
||||
});
|
||||
|
||||
const emptyPauseState = {
|
||||
|
@ -5724,6 +5726,14 @@ function update(state = createPauseState(), action) {
|
|||
|
||||
case "NAVIGATE":
|
||||
return _extends({}, state, emptyPauseState, { debuggeeUrl: action.url });
|
||||
|
||||
case "TOGGLE_SKIP_PAUSING":
|
||||
{
|
||||
const { skipPausing } = action;
|
||||
_prefs.prefs.skipPausing = skipPausing;
|
||||
|
||||
return _extends({}, state, { skipPausing });
|
||||
}
|
||||
}
|
||||
|
||||
return state;
|
||||
|
@ -5881,6 +5891,10 @@ function getDebuggeeUrl(state) {
|
|||
return state.pause.debuggeeUrl;
|
||||
}
|
||||
|
||||
function getSkipPausing(state) {
|
||||
return state.pause.skipPausing;
|
||||
}
|
||||
|
||||
// NOTE: currently only used for chrome
|
||||
function getChromeScopes(state) {
|
||||
const frame = getSelectedFrame(state);
|
||||
|
@ -5900,7 +5914,7 @@ exports.default = update;
|
|||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.findSourceMatches = exports.searchSources = exports.getMatches = exports.stopSearchWorker = exports.startSearchWorker = undefined;
|
||||
exports.findSourceMatches = exports.getMatches = exports.stop = exports.start = undefined;
|
||||
|
||||
var _devtoolsUtils = __webpack_require__(1363);
|
||||
|
||||
|
@ -5909,11 +5923,10 @@ const { WorkerDispatcher } = _devtoolsUtils.workerUtils; /* This Source Code For
|
|||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
const dispatcher = new WorkerDispatcher();
|
||||
const startSearchWorker = exports.startSearchWorker = dispatcher.start.bind(dispatcher);
|
||||
const stopSearchWorker = exports.stopSearchWorker = dispatcher.stop.bind(dispatcher);
|
||||
const start = exports.start = dispatcher.start.bind(dispatcher);
|
||||
const stop = exports.stop = dispatcher.stop.bind(dispatcher);
|
||||
|
||||
const getMatches = exports.getMatches = dispatcher.task("getMatches");
|
||||
const searchSources = exports.searchSources = dispatcher.task("searchSources");
|
||||
const findSourceMatches = exports.findSourceMatches = dispatcher.task("findSourceMatches");
|
||||
|
||||
/***/ }),
|
||||
|
@ -6344,12 +6357,15 @@ async function getGeneratedLocation(state, source, location, sourceMaps) {
|
|||
const { line, sourceId, column } = await sourceMaps.getGeneratedLocation(location, source);
|
||||
|
||||
const generatedSource = (0, _selectors.getSource)(state, sourceId);
|
||||
const sourceUrl = generatedSource.get("url");
|
||||
if (!generatedSource) {
|
||||
return location;
|
||||
}
|
||||
|
||||
return {
|
||||
line,
|
||||
sourceId,
|
||||
column: column === 0 ? undefined : column,
|
||||
sourceUrl
|
||||
sourceUrl: generatedSource.url
|
||||
};
|
||||
} /* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
|
@ -9055,10 +9071,16 @@ var _devtoolsSourceMap = __webpack_require__(1360);
|
|||
|
||||
var _search = __webpack_require__(1395);
|
||||
|
||||
var search = _interopRequireWildcard(_search);
|
||||
|
||||
var _prettyPrint = __webpack_require__(1431);
|
||||
|
||||
var prettyPrint = _interopRequireWildcard(_prettyPrint);
|
||||
|
||||
var _parser = __webpack_require__(1365);
|
||||
|
||||
var parser = _interopRequireWildcard(_parser);
|
||||
|
||||
var _createStore = __webpack_require__(1658);
|
||||
|
||||
var _createStore2 = _interopRequireDefault(_createStore);
|
||||
|
@ -9118,9 +9140,10 @@ function bootstrapWorkers() {
|
|||
// When used in Firefox, the toolbox manages the source map worker.
|
||||
(0, _devtoolsSourceMap.startSourceMapWorker)((0, _devtoolsConfig.getValue)("workers.sourceMapURL"));
|
||||
}
|
||||
(0, _prettyPrint.startPrettyPrintWorker)((0, _devtoolsConfig.getValue)("workers.prettyPrintURL"));
|
||||
(0, _parser.startParserWorker)((0, _devtoolsConfig.getValue)("workers.parserURL"));
|
||||
(0, _search.startSearchWorker)((0, _devtoolsConfig.getValue)("workers.searchURL"));
|
||||
prettyPrint.start((0, _devtoolsConfig.getValue)("workers.prettyPrintURL"));
|
||||
parser.start((0, _devtoolsConfig.getValue)("workers.parserURL"));
|
||||
search.start((0, _devtoolsConfig.getValue)("workers.searchURL"));
|
||||
return { prettyPrint, parser, search };
|
||||
}
|
||||
|
||||
function teardownWorkers() {
|
||||
|
@ -9128,9 +9151,9 @@ function teardownWorkers() {
|
|||
// When used in Firefox, the toolbox manages the source map worker.
|
||||
(0, _devtoolsSourceMap.stopSourceMapWorker)();
|
||||
}
|
||||
(0, _prettyPrint.stopPrettyPrintWorker)();
|
||||
(0, _parser.stopParserWorker)();
|
||||
(0, _search.stopSearchWorker)();
|
||||
prettyPrint.stop();
|
||||
parser.stop();
|
||||
search.stop();
|
||||
}
|
||||
|
||||
function bootstrapApp(store) {
|
||||
|
@ -9161,7 +9184,7 @@ function updatePrefs(state) {
|
|||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.stopPrettyPrintWorker = exports.startPrettyPrintWorker = undefined;
|
||||
exports.stop = exports.start = undefined;
|
||||
exports.prettyPrint = prettyPrint;
|
||||
|
||||
var _devtoolsUtils = __webpack_require__(1363);
|
||||
|
@ -9179,8 +9202,8 @@ const { WorkerDispatcher } = _devtoolsUtils.workerUtils; /* This Source Code For
|
|||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
const dispatcher = new WorkerDispatcher();
|
||||
const startPrettyPrintWorker = exports.startPrettyPrintWorker = dispatcher.start.bind(dispatcher);
|
||||
const stopPrettyPrintWorker = exports.stopPrettyPrintWorker = dispatcher.stop.bind(dispatcher);
|
||||
const start = exports.start = dispatcher.start.bind(dispatcher);
|
||||
const stop = exports.stop = dispatcher.stop.bind(dispatcher);
|
||||
const _prettyPrint = dispatcher.task("prettyPrint");
|
||||
|
||||
async function prettyPrint({ source, url }) {
|
||||
|
@ -12308,6 +12331,10 @@ Object.defineProperty(exports, "__esModule", {
|
|||
});
|
||||
exports.onConnect = undefined;
|
||||
|
||||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
var _firefox = __webpack_require__(1500);
|
||||
|
||||
var firefox = _interopRequireWildcard(_firefox);
|
||||
|
@ -12320,10 +12347,6 @@ var _bootstrap = __webpack_require__(1430);
|
|||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||||
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
function loadFromPrefs(actions) {
|
||||
const { pauseOnExceptions, ignoreCaughtExceptions } = _prefs.prefs;
|
||||
if (pauseOnExceptions || ignoreCaughtExceptions) {
|
||||
|
@ -12343,7 +12366,7 @@ async function onConnect(connection, { services, toolboxActions }) {
|
|||
toolboxActions
|
||||
});
|
||||
|
||||
(0, _bootstrap.bootstrapWorkers)();
|
||||
const workers = (0, _bootstrap.bootstrapWorkers)();
|
||||
await firefox.onConnect(connection, actions);
|
||||
await loadFromPrefs(actions);
|
||||
|
||||
|
@ -12351,6 +12374,7 @@ async function onConnect(connection, { services, toolboxActions }) {
|
|||
store,
|
||||
actions,
|
||||
selectors,
|
||||
workers: _extends({}, workers, services),
|
||||
connection,
|
||||
client: firefox.clientCommands
|
||||
});
|
||||
|
@ -12704,6 +12728,14 @@ async function setPausePoints(sourceId, pausePoints) {
|
|||
return sendPacket({ to: sourceId, type: "setPausePoints", pausePoints });
|
||||
}
|
||||
|
||||
async function setSkipPausing(shouldSkip) {
|
||||
return threadClient.request({
|
||||
skip: shouldSkip,
|
||||
to: threadClient.actor,
|
||||
type: "skipPausing"
|
||||
});
|
||||
}
|
||||
|
||||
function interrupt() {
|
||||
return threadClient.interrupt();
|
||||
}
|
||||
|
@ -12802,7 +12834,8 @@ const clientCommands = {
|
|||
fetchSources,
|
||||
fetchWorkers,
|
||||
sendPacket,
|
||||
setPausePoints
|
||||
setPausePoints,
|
||||
setSkipPausing
|
||||
};
|
||||
|
||||
exports.setupCommands = setupCommands;
|
||||
|
@ -17525,9 +17558,6 @@ class Editor extends _react.PureComponent {
|
|||
}
|
||||
|
||||
componentDidMount() {
|
||||
const editor = this.setupEditor();
|
||||
|
||||
const { selectedSource } = this.props;
|
||||
const { shortcuts } = this.context;
|
||||
|
||||
const searchAgainKey = L10N.getStr("sourceSearch.search.again.key2");
|
||||
|
@ -17538,8 +17568,6 @@ class Editor extends _react.PureComponent {
|
|||
shortcuts.on("Esc", this.onEscape);
|
||||
shortcuts.on(searchAgainPrevKey, this.onSearchAgain);
|
||||
shortcuts.on(searchAgainKey, this.onSearchAgain);
|
||||
|
||||
(0, _editor.updateDocument)(editor, selectedSource);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
|
@ -17558,12 +17586,18 @@ class Editor extends _react.PureComponent {
|
|||
}
|
||||
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
const { selectedSource } = this.props;
|
||||
// NOTE: when devtools are opened, the editor is not set when
|
||||
// the source loads so we need to wait until the editor is
|
||||
// set to update the text and size.
|
||||
if (!prevState.editor && this.state.editor) {
|
||||
this.setText(this.props);
|
||||
this.setSize(this.props);
|
||||
if (!prevState.editor && selectedSource) {
|
||||
if (!this.state.editor) {
|
||||
const editor = this.setupEditor();
|
||||
(0, _editor.updateDocument)(editor, selectedSource);
|
||||
} else {
|
||||
this.setText(this.props);
|
||||
this.setSize(this.props);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17675,6 +17709,7 @@ class Editor extends _react.PureComponent {
|
|||
return;
|
||||
}
|
||||
|
||||
// check if we previously had a selected source
|
||||
if (!selectedSource) {
|
||||
return this.clearEditor();
|
||||
}
|
||||
|
@ -22905,7 +22940,7 @@ class SecondaryPanes extends _react.Component {
|
|||
} = this.props;
|
||||
const isIndeterminate = !breakpointsDisabled && breakpoints.some(x => x.disabled);
|
||||
|
||||
if (breakpoints.size == 0) {
|
||||
if (_prefs.features.skipPausing || breakpoints.size == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -23623,7 +23658,7 @@ class Expressions extends _react.Component {
|
|||
"ul",
|
||||
{ className: "pane expressions-list" },
|
||||
expressions.map(this.renderExpression),
|
||||
showInput && this.renderNewExpressionInput()
|
||||
(showInput || !expressions.size) && this.renderNewExpressionInput()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -24294,10 +24329,10 @@ class Accordion extends _react.Component {
|
|||
const { opened } = item;
|
||||
|
||||
return _react2.default.createElement(
|
||||
"div",
|
||||
{ className: item.className, key: i },
|
||||
"li",
|
||||
{ role: "listitem", className: item.className, key: i },
|
||||
_react2.default.createElement(
|
||||
"div",
|
||||
"h2",
|
||||
{
|
||||
className: "_header",
|
||||
tabIndex: "0",
|
||||
|
@ -24341,8 +24376,8 @@ class Accordion extends _react.Component {
|
|||
|
||||
render() {
|
||||
return _react2.default.createElement(
|
||||
"div",
|
||||
{ className: "accordion" },
|
||||
"ul",
|
||||
{ role: "list", className: "accordion" },
|
||||
this.props.items.map(this.renderContainer)
|
||||
);
|
||||
}
|
||||
|
@ -24595,6 +24630,26 @@ class CommandBar extends _react.Component {
|
|||
);
|
||||
}
|
||||
|
||||
renderSkipPausingButton() {
|
||||
const { skipPausing, toggleSkipPausing } = this.props;
|
||||
|
||||
if (!_prefs.features.skipPausing) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return _react2.default.createElement(
|
||||
"button",
|
||||
{
|
||||
className: (0, _classnames2.default)("command-bar-button", {
|
||||
active: skipPausing
|
||||
}),
|
||||
title: L10N.getStr("skipPausingTooltip"),
|
||||
onClick: toggleSkipPausing
|
||||
},
|
||||
_react2.default.createElement("img", { className: "skipPausing" })
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
return _react2.default.createElement(
|
||||
"div",
|
||||
|
@ -24609,7 +24664,8 @@ class CommandBar extends _react.Component {
|
|||
_react2.default.createElement("div", { className: "filler" }),
|
||||
this.replayPreviousButton(),
|
||||
this.renderStepPosition(),
|
||||
this.replayNextButton()
|
||||
this.replayNextButton(),
|
||||
this.renderSkipPausingButton()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -24624,7 +24680,8 @@ exports.default = (0, _reactRedux.connect)(state => {
|
|||
history: (0, _selectors.getHistory)(state),
|
||||
historyPosition: (0, _selectors.getHistoryPosition)(state),
|
||||
isWaitingOnBreak: (0, _selectors.getIsWaitingOnBreak)(state),
|
||||
canRewind: (0, _selectors.getCanRewind)(state)
|
||||
canRewind: (0, _selectors.getCanRewind)(state),
|
||||
skipPausing: (0, _selectors.getSkipPausing)(state)
|
||||
};
|
||||
}, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(CommandBar);
|
||||
|
||||
|
@ -25135,6 +25192,21 @@ class Tabs extends _react.PureComponent {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.updateHiddenTabs = () => {
|
||||
if (!this.refs.sourceTabs) {
|
||||
return;
|
||||
}
|
||||
const { selectedSource, tabSources, moveTab } = this.props;
|
||||
const sourceTabEls = this.refs.sourceTabs.children;
|
||||
const hiddenTabs = (0, _tabs.getHiddenTabs)(tabSources, sourceTabEls);
|
||||
|
||||
if ((0, _ui.isVisible)() && hiddenTabs.indexOf(selectedSource) !== -1) {
|
||||
return moveTab(selectedSource.url, 0);
|
||||
}
|
||||
|
||||
this.setState({ hiddenTabs });
|
||||
};
|
||||
|
||||
this.renderDropdownSource = source => {
|
||||
const { selectSpecificSource } = this.props;
|
||||
const filename = (0, _source.getFilename)(source.toJS());
|
||||
|
@ -25165,7 +25237,7 @@ class Tabs extends _react.PureComponent {
|
|||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.updateHiddenTabs();
|
||||
window.requestIdleCallback(this.updateHiddenTabs);
|
||||
window.addEventListener("resize", this.onResize);
|
||||
}
|
||||
|
||||
|
@ -25177,20 +25249,7 @@ class Tabs extends _react.PureComponent {
|
|||
* Updates the hiddenSourceTabs state, by
|
||||
* finding the source tabs which are wrapped and are not on the top row.
|
||||
*/
|
||||
updateHiddenTabs() {
|
||||
if (!this.refs.sourceTabs) {
|
||||
return;
|
||||
}
|
||||
const { selectedSource, tabSources, moveTab } = this.props;
|
||||
const sourceTabEls = this.refs.sourceTabs.children;
|
||||
const hiddenTabs = (0, _tabs.getHiddenTabs)(tabSources, sourceTabEls);
|
||||
|
||||
if ((0, _ui.isVisible)() && hiddenTabs.indexOf(selectedSource) !== -1) {
|
||||
return moveTab(selectedSource.url, 0);
|
||||
}
|
||||
|
||||
this.setState({ hiddenTabs });
|
||||
}
|
||||
|
||||
toggleSourcesDropdown(e) {
|
||||
this.setState(prevState => ({
|
||||
|
@ -26849,6 +26908,15 @@ Object.defineProperty(exports, "selectFrame", {
|
|||
}
|
||||
});
|
||||
|
||||
var _skipPausing = __webpack_require__(3640);
|
||||
|
||||
Object.defineProperty(exports, "toggleSkipPausing", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _skipPausing.toggleSkipPausing;
|
||||
}
|
||||
});
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 164:
|
||||
|
@ -34314,6 +34382,7 @@ if (isDevelopment()) {
|
|||
pref("devtools.debugger.file-search-regex-match", false);
|
||||
pref("devtools.debugger.project-directory-root", "");
|
||||
pref("devtools.debugger.prefs-schema-version", "1.0.1");
|
||||
pref("devtools.debugger.skip-pausing", false);
|
||||
pref("devtools.debugger.features.workers", true);
|
||||
pref("devtools.debugger.features.async-stepping", true);
|
||||
pref("devtools.debugger.features.wasm", true);
|
||||
|
@ -34330,6 +34399,7 @@ if (isDevelopment()) {
|
|||
pref("devtools.debugger.features.replay", true);
|
||||
pref("devtools.debugger.features.pause-points", true);
|
||||
pref("devtools.debugger.features.component-stack", true);
|
||||
pref("devtools.debugger.features.skip-pausing", false);
|
||||
}
|
||||
|
||||
const prefs = new PrefsHelper("devtools", {
|
||||
|
@ -34357,7 +34427,8 @@ const prefs = new PrefsHelper("devtools", {
|
|||
fileSearchWholeWord: ["Bool", "debugger.file-search-whole-word"],
|
||||
fileSearchRegexMatch: ["Bool", "debugger.file-search-regex-match"],
|
||||
debuggerPrefsSchemaVersion: ["Char", "debugger.prefs-schema-version"],
|
||||
projectDirectoryRoot: ["Char", "debugger.project-directory-root", ""]
|
||||
projectDirectoryRoot: ["Char", "debugger.project-directory-root", ""],
|
||||
skipPausing: ["Bool", "debugger.skip-pausing"]
|
||||
});
|
||||
/* harmony export (immutable) */ __webpack_exports__["prefs"] = prefs;
|
||||
|
||||
|
@ -34377,7 +34448,8 @@ const features = new PrefsHelper("devtools.debugger.features", {
|
|||
codeFolding: ["Bool", "code-folding"],
|
||||
replay: ["Bool", "replay"],
|
||||
pausePoints: ["Bool", "pause-points"],
|
||||
componentStack: ["Bool", "component-stack"]
|
||||
componentStack: ["Bool", "component-stack"],
|
||||
skipPausing: ["Bool", "skip-pausing"]
|
||||
});
|
||||
/* harmony export (immutable) */ __webpack_exports__["features"] = features;
|
||||
|
||||
|
@ -34661,14 +34733,6 @@ function locColumn(loc) {
|
|||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
// eslint-disable-next-line max-len
|
||||
|
||||
|
||||
exports.findGeneratedBindingFromPosition = findGeneratedBindingFromPosition;
|
||||
|
||||
var _locColumn = __webpack_require__(2349);
|
||||
|
@ -34677,116 +34741,132 @@ var _filtering = __webpack_require__(3635);
|
|||
|
||||
var _firefox = __webpack_require__(1500);
|
||||
|
||||
async function findGeneratedBindingFromPosition(sourceMaps, client, source, pos, name, type, generatedAstBindings) {
|
||||
const range = await getGeneratedLocationRange(pos, source, type, sourceMaps);
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
if (range) {
|
||||
let result;
|
||||
if (type === "import") {
|
||||
result = await findGeneratedImportReference(type, generatedAstBindings, _extends({
|
||||
type: pos.type
|
||||
}, range));
|
||||
} else {
|
||||
result = await findGeneratedReference(type, generatedAstBindings, _extends({
|
||||
type: pos.type
|
||||
}, range));
|
||||
}
|
||||
async function findGeneratedBindingFromPosition(sourceMaps, client, source, pos, name, bindingType, generatedAstBindings) {
|
||||
const locationType = pos.type;
|
||||
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
const generatedRanges = await getGeneratedLocationRanges(source, pos, bindingType, locationType, sourceMaps);
|
||||
const applicableBindings = filterApplicableBindings(generatedAstBindings, generatedRanges);
|
||||
|
||||
let result;
|
||||
if (bindingType === "import") {
|
||||
result = await findGeneratedImportReference(applicableBindings);
|
||||
} else {
|
||||
result = await findGeneratedReference(applicableBindings);
|
||||
}
|
||||
|
||||
if (type === "import" && pos.type === "decl") {
|
||||
let importRange = range;
|
||||
if (!importRange) {
|
||||
// If the imported name itself does not map to a useful range, fall back
|
||||
// to resolving the bindinding using the location of the overall
|
||||
// import declaration.
|
||||
importRange = await getGeneratedLocationRange({
|
||||
type: pos.type,
|
||||
start: pos.declaration.start,
|
||||
end: pos.declaration.end
|
||||
}, source, type, sourceMaps);
|
||||
|
||||
if (!importRange) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
if (bindingType === "import" && pos.type === "decl") {
|
||||
const importName = pos.importName;
|
||||
if (typeof importName !== "string") {
|
||||
// Should never happen, just keeping Flow happy.
|
||||
return null;
|
||||
}
|
||||
|
||||
return await findGeneratedImportDeclaration(generatedAstBindings, _extends({
|
||||
importName
|
||||
}, importRange));
|
||||
let applicableImportBindings = applicableBindings;
|
||||
if (generatedRanges.length === 0) {
|
||||
// If the imported name itself does not map to a useful range, fall back
|
||||
// to resolving the bindinding using the location of the overall
|
||||
// import declaration.
|
||||
const importRanges = await getGeneratedLocationRanges(source, pos.declaration, bindingType, locationType, sourceMaps);
|
||||
applicableImportBindings = filterApplicableBindings(generatedAstBindings, importRanges);
|
||||
|
||||
if (applicableImportBindings.length === 0) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return await findGeneratedImportDeclaration(applicableImportBindings, importName);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
// eslint-disable-next-line max-len
|
||||
|
||||
function filterApplicableBindings(bindings, mapped) {
|
||||
// Any binding overlapping a part of the mapping range.
|
||||
return (0, _filtering.filterSortedArray)(bindings, binding => {
|
||||
if (positionCmp(binding.loc.end, mapped.start) <= 0) {
|
||||
return -1;
|
||||
}
|
||||
if (positionCmp(binding.loc.start, mapped.end) >= 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
});
|
||||
function filterApplicableBindings(bindings, ranges) {
|
||||
const result = [];
|
||||
for (const range of ranges) {
|
||||
// Any binding overlapping a part of the mapping range.
|
||||
const filteredBindings = (0, _filtering.filterSortedArray)(bindings, binding => {
|
||||
if (positionCmp(binding.loc.end, range.start) <= 0) {
|
||||
return -1;
|
||||
}
|
||||
if (positionCmp(binding.loc.start, range.end) >= 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
});
|
||||
|
||||
let firstInRange = true;
|
||||
let firstOnLine = true;
|
||||
let line = -1;
|
||||
|
||||
for (const binding of filteredBindings) {
|
||||
if (binding.loc.start.line === line) {
|
||||
firstOnLine = false;
|
||||
} else {
|
||||
line = binding.loc.start.line;
|
||||
firstOnLine = true;
|
||||
}
|
||||
|
||||
result.push({
|
||||
binding,
|
||||
range,
|
||||
firstOnLine,
|
||||
firstInRange
|
||||
});
|
||||
|
||||
firstInRange = false;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a mapped range over the generated source, attempt to resolve a real
|
||||
* binding descriptor that can be used to access the value.
|
||||
*/
|
||||
async function findGeneratedReference(type, generatedAstBindings, mapped) {
|
||||
const bindings = filterApplicableBindings(generatedAstBindings, mapped);
|
||||
|
||||
let lineStart = true;
|
||||
let line = -1;
|
||||
|
||||
return bindings.reduce(async (acc, val, i) => {
|
||||
const accVal = await acc;
|
||||
if (accVal) {
|
||||
return accVal;
|
||||
async function findGeneratedReference(applicableBindings) {
|
||||
for (const applicable of applicableBindings) {
|
||||
const result = await mapBindingReferenceToDescriptor(applicable);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
if (val.loc.start.line === line) {
|
||||
lineStart = false;
|
||||
} else {
|
||||
line = val.loc.start.line;
|
||||
lineStart = true;
|
||||
}
|
||||
|
||||
return mapBindingReferenceToDescriptor(val, mapped, lineStart);
|
||||
}, null);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
async function findGeneratedImportReference(type, generatedAstBindings, mapped) {
|
||||
let bindings = filterApplicableBindings(generatedAstBindings, mapped);
|
||||
|
||||
async function findGeneratedImportReference(applicableBindings) {
|
||||
// When wrapped, for instance as `Object(ns.default)`, the `Object` binding
|
||||
// will be the first in the list. To avoid resolving `Object` as the
|
||||
// value of the import itself, we potentially skip the first binding.
|
||||
if (bindings.length > 1 && !bindings[0].loc.meta && bindings[1].loc.meta) {
|
||||
bindings = bindings.slice(1);
|
||||
}
|
||||
|
||||
return bindings.reduce(async (acc, val) => {
|
||||
const accVal = await acc;
|
||||
if (accVal) {
|
||||
return accVal;
|
||||
applicableBindings = applicableBindings.filter((applicable, i) => {
|
||||
if (!applicable.firstInRange || applicable.binding.loc.type !== "ref" || applicable.binding.loc.meta) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return mapImportReferenceToDescriptor(val, mapped);
|
||||
}, null);
|
||||
const next = i + 1 < applicableBindings.length ? applicableBindings[i + 1] : null;
|
||||
|
||||
return !next || next.binding.loc.type !== "ref" || !next.binding.loc.meta;
|
||||
});
|
||||
|
||||
for (const applicable of applicableBindings) {
|
||||
const result = await mapImportReferenceToDescriptor(applicable);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -34794,12 +34874,12 @@ async function findGeneratedImportReference(type, generatedAstBindings, mapped)
|
|||
* value that is referenced, attempt to resolve a binding descriptor for
|
||||
* the import's value.
|
||||
*/
|
||||
async function findGeneratedImportDeclaration(generatedAstBindings, mapped) {
|
||||
const bindings = filterApplicableBindings(generatedAstBindings, mapped);
|
||||
|
||||
async function findGeneratedImportDeclaration(applicableBindings, importName) {
|
||||
let result = null;
|
||||
|
||||
for (const binding of bindings) {
|
||||
for (const _ref of applicableBindings) {
|
||||
const { binding } = _ref;
|
||||
|
||||
if (binding.loc.type !== "decl") {
|
||||
continue;
|
||||
}
|
||||
|
@ -34825,8 +34905,8 @@ async function findGeneratedImportDeclaration(generatedAstBindings, mapped) {
|
|||
continue;
|
||||
}
|
||||
|
||||
const desc = await readDescriptorProperty(namespaceDesc, mapped.importName);
|
||||
const expression = `${binding.name}.${mapped.importName}`;
|
||||
const desc = await readDescriptorProperty(namespaceDesc, importName);
|
||||
const expression = `${binding.name}.${importName}`;
|
||||
|
||||
if (desc) {
|
||||
result = {
|
||||
|
@ -34845,17 +34925,22 @@ async function findGeneratedImportDeclaration(generatedAstBindings, mapped) {
|
|||
* Given a generated binding, and a range over the generated code, statically
|
||||
* check if the given binding matches the range.
|
||||
*/
|
||||
async function mapBindingReferenceToDescriptor(binding, mapped, isFirst) {
|
||||
async function mapBindingReferenceToDescriptor({
|
||||
binding,
|
||||
range,
|
||||
firstInRange,
|
||||
firstOnLine
|
||||
}) {
|
||||
// Allow the mapping to point anywhere within the generated binding
|
||||
// location to allow for less than perfect sourcemaps. Since you also
|
||||
// need at least one character between identifiers, we also give one
|
||||
// characters of space at the front the generated binding in order
|
||||
// to increase the probability of finding the right mapping.
|
||||
if (mapped.start.line === binding.loc.start.line && (
|
||||
if (range.start.line === binding.loc.start.line && (
|
||||
// If a binding is the first on a line, Babel will extend the mapping to
|
||||
// include the whitespace between the newline and the binding. To handle
|
||||
// that, we skip the range requirement for starting location.
|
||||
isFirst || (0, _locColumn.locColumn)(mapped.start) >= (0, _locColumn.locColumn)(binding.loc.start)) && (0, _locColumn.locColumn)(mapped.start) <= (0, _locColumn.locColumn)(binding.loc.end)) {
|
||||
firstInRange || firstOnLine || (0, _locColumn.locColumn)(range.start) >= (0, _locColumn.locColumn)(binding.loc.start)) && (0, _locColumn.locColumn)(range.start) <= (0, _locColumn.locColumn)(binding.loc.end)) {
|
||||
return {
|
||||
name: binding.name,
|
||||
desc: await binding.desc(),
|
||||
|
@ -34871,8 +34956,11 @@ async function mapBindingReferenceToDescriptor(binding, mapped, isFirst) {
|
|||
* evaluate accessed properties within the mapped range to resolve the actual
|
||||
* imported value.
|
||||
*/
|
||||
async function mapImportReferenceToDescriptor(binding, mapped) {
|
||||
if (mapped.type !== "ref") {
|
||||
async function mapImportReferenceToDescriptor({
|
||||
binding,
|
||||
range
|
||||
}) {
|
||||
if (binding.loc.type !== "ref") {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -34903,7 +34991,7 @@ async function mapImportReferenceToDescriptor(binding, mapped) {
|
|||
// ^^^^^^^^^^^^^^^^^
|
||||
// ^ // wrapped to column 0 of next line
|
||||
|
||||
if (!mappingContains(mapped, binding.loc)) {
|
||||
if (!mappingContains(range, binding.loc)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -34917,7 +35005,7 @@ async function mapImportReferenceToDescriptor(binding, mapped) {
|
|||
// just be more work to search more and it is very unlikely that
|
||||
// bindings would be mapped to more than a single member + inherits
|
||||
// wrapper.
|
||||
for (let op = meta, index = 0; op && mappingContains(mapped, op) && desc && index < 2; index++, op = op && op.parent) {
|
||||
for (let op = meta, index = 0; op && mappingContains(range, op) && desc && index < 2; index++, op = op && op.parent) {
|
||||
// Calling could potentially trigger side-effects, which would not
|
||||
// be ideal for this case.
|
||||
if (op.type === "call") {
|
||||
|
@ -34998,42 +35086,48 @@ function positionCmp(p1, p2) {
|
|||
return p1.line < p2.line ? -1 : 1;
|
||||
}
|
||||
|
||||
async function getGeneratedLocationRange(pos, source, type, sourceMaps) {
|
||||
const endPosition = await sourceMaps.getGeneratedLocation(pos.end, source);
|
||||
const startPosition = await sourceMaps.getGeneratedLocation(pos.start, source);
|
||||
const ranges = await sourceMaps.getGeneratedRanges(pos.start, source);
|
||||
if (ranges.length === 0) {
|
||||
return null;
|
||||
}
|
||||
async function getGeneratedLocationRanges(source, {
|
||||
start,
|
||||
end
|
||||
}, bindingType, locationType, sourceMaps) {
|
||||
const endPosition = await sourceMaps.getGeneratedLocation(end, source);
|
||||
const startPosition = await sourceMaps.getGeneratedLocation(start, source);
|
||||
|
||||
// If the start and end positions collapse into eachother, it means that
|
||||
// the range in the original content didn't _start_ at the start position.
|
||||
// Since this likely means that the range doesn't logically apply to this
|
||||
// binding location, we skip it.
|
||||
if (positionCmp(startPosition, endPosition) === 0) {
|
||||
return null;
|
||||
return [];
|
||||
}
|
||||
|
||||
const start = {
|
||||
line: ranges[0].line,
|
||||
column: ranges[0].columnStart
|
||||
};
|
||||
const end = {
|
||||
line: ranges[0].line,
|
||||
// SourceMapConsumer's 'lastColumn' is inclusive, so we add 1 to make
|
||||
// it exclusive like all other locations.
|
||||
column: ranges[0].columnEnd + 1
|
||||
};
|
||||
const ranges = await sourceMaps.getGeneratedRanges(start, source);
|
||||
|
||||
// Expand the range over any following ranges if they are contiguous.
|
||||
for (let i = 1; i < ranges.length; i++) {
|
||||
const range = ranges[i];
|
||||
if (end.column !== Infinity || range.line !== end.line + 1 || range.columnStart !== 0) {
|
||||
break;
|
||||
const resultRanges = ranges.reduce((acc, mapRange) => {
|
||||
const range = {
|
||||
start: {
|
||||
line: mapRange.line,
|
||||
column: mapRange.columnStart
|
||||
},
|
||||
end: {
|
||||
line: mapRange.line,
|
||||
// SourceMapConsumer's 'lastColumn' is inclusive, so we add 1 to make
|
||||
// it exclusive like all other locations.
|
||||
column: mapRange.columnEnd + 1
|
||||
}
|
||||
};
|
||||
|
||||
const previous = acc[acc.length - 1];
|
||||
|
||||
if (previous && (previous.end.line === range.start.line && previous.end.column === range.start.column || previous.end.line + 1 === range.start.line && previous.end.column === Infinity && range.start.column === 0)) {
|
||||
previous.end.line = range.end.line;
|
||||
previous.end.column = range.end.column;
|
||||
} else {
|
||||
acc.push(range);
|
||||
}
|
||||
end.line = range.line;
|
||||
end.column = range.columnEnd + 1;
|
||||
}
|
||||
|
||||
return acc;
|
||||
}, []);
|
||||
|
||||
// When searching for imports, we expand the range to up to the next available
|
||||
// mapping to allow for import declarations that are composed of multiple
|
||||
|
@ -35042,12 +35136,17 @@ async function getGeneratedLocationRange(pos, source, type, sourceMaps) {
|
|||
//
|
||||
// var _mod = require("mod"); // mapped from import statement
|
||||
// var _mod2 = interop(_mod); // entirely unmapped
|
||||
if (type === "import" && pos.type === "decl" && endPosition.line > end.line) {
|
||||
end.line = endPosition.line;
|
||||
end.column = endPosition.column;
|
||||
if (bindingType === "import" && locationType === "decl") {
|
||||
for (const range of resultRanges) {
|
||||
if (mappingContains(range, { start: startPosition, end: startPosition }) && positionCmp(range.end, endPosition) < 0) {
|
||||
range.end.line = endPosition.line;
|
||||
range.end.column = endPosition.column;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return { start, end };
|
||||
return resultRanges;
|
||||
}
|
||||
|
||||
/***/ }),
|
||||
|
@ -38848,7 +38947,7 @@ class FrameworkComponent extends _react.PureComponent {
|
|||
|
||||
render() {
|
||||
const { selectedFrame } = this.props;
|
||||
if ((0, _preview.isReactComponent)(selectedFrame.this)) {
|
||||
if (selectedFrame && (0, _preview.isReactComponent)(selectedFrame.this)) {
|
||||
return this.renderReactComponent();
|
||||
}
|
||||
|
||||
|
@ -39182,10 +39281,14 @@ function findInsertionLocation(array, callback) {
|
|||
|
||||
// Ensure the value is the start of any set of matches.
|
||||
let i = left;
|
||||
while (i > 0 && callback(array[i]) >= 0) {
|
||||
i--;
|
||||
if (i < array.length) {
|
||||
while (i > 0 && callback(array[i]) >= 0) {
|
||||
i--;
|
||||
}
|
||||
return i + 1;
|
||||
}
|
||||
return i + 1;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
function filterSortedArray(array, callback) {
|
||||
|
@ -39812,6 +39915,40 @@ module.exports = "<!-- This Source Code Form is subject to the terms of the Mozi
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3640:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.toggleSkipPausing = toggleSkipPausing;
|
||||
|
||||
var _selectors = __webpack_require__(3590);
|
||||
|
||||
/**
|
||||
* @memberof actions/pause
|
||||
* @static
|
||||
*/
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
|
||||
|
||||
function toggleSkipPausing() {
|
||||
return async ({ dispatch, client, getState, sourceMaps }) => {
|
||||
const skipPausing = !(0, _selectors.getSkipPausing)(getState());
|
||||
|
||||
// NOTE: enable this when we land the endpoint in m-c
|
||||
// await client.setSkipPausing(skipPausing);
|
||||
|
||||
dispatch({ type: "TOGGLE_SKIP_PAUSING", skipPausing });
|
||||
};
|
||||
}
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 365:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
|
|
|
@ -1322,7 +1322,7 @@ function isYieldExpression(path) {
|
|||
}
|
||||
|
||||
function isObjectShorthand(parent) {
|
||||
return t.isProperty(parent) && parent.key.start == parent.value.start && parent.key.loc.identifierName === parent.value.loc.identifierName;
|
||||
return t.isObjectProperty(parent) && parent.key.start == parent.value.start && parent.key.loc.identifierName === parent.value.loc.identifierName;
|
||||
}
|
||||
|
||||
function getObjectExpressionValue(node) {
|
||||
|
@ -19622,6 +19622,19 @@ const scopeCollectionVisitor = {
|
|||
state.freeVariables.set(node.name, freeVariables);
|
||||
}
|
||||
|
||||
freeVariables.push({
|
||||
type: "ref",
|
||||
start: fromBabelLocation(node.loc.start, state.sourceId),
|
||||
end: fromBabelLocation(node.loc.end, state.sourceId),
|
||||
meta: buildMetaBindings(state.sourceId, node, ancestors)
|
||||
});
|
||||
} else if (isOpeningJSXIdentifier(node, ancestors)) {
|
||||
let freeVariables = state.freeVariables.get(node.name);
|
||||
if (!freeVariables) {
|
||||
freeVariables = [];
|
||||
state.freeVariables.set(node.name, freeVariables);
|
||||
}
|
||||
|
||||
freeVariables.push({
|
||||
type: "ref",
|
||||
start: fromBabelLocation(node.loc.start, state.sourceId),
|
||||
|
@ -19704,6 +19717,24 @@ const scopeCollectionVisitor = {
|
|||
}
|
||||
};
|
||||
|
||||
function isOpeningJSXIdentifier(node, ancestors) {
|
||||
if (!t.isJSXIdentifier(node)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (let i = ancestors.length - 1; i >= 0; i--) {
|
||||
const { node: parent, key } = ancestors[i];
|
||||
|
||||
if (t.isJSXOpeningElement(parent) && key === "name") {
|
||||
return true;
|
||||
} else if (!t.isJSXMemberExpression(parent) || key !== "object") {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function buildMetaBindings(sourceId, node, ancestors, parentIndex = ancestors.length - 1) {
|
||||
if (parentIndex <= 1) {
|
||||
return null;
|
||||
|
@ -21231,9 +21262,8 @@ function onEnter(node, ancestors, state) {
|
|||
|
||||
if (isCall(value) || t.isFunction(parentNode)) {
|
||||
return addEmptyPoint(state, startLocation);
|
||||
} else {
|
||||
return addStopPoint(state, startLocation);
|
||||
}
|
||||
return addStopPoint(state, startLocation);
|
||||
}
|
||||
|
||||
if (isCall(node)) {
|
||||
|
|
|
@ -154,7 +154,6 @@ skip-if = (os == "win" && ccov) # Bug 1448523
|
|||
[browser_dbg-breaking.js]
|
||||
[browser_dbg-breaking-from-console.js]
|
||||
[browser_dbg-breakpoints.js]
|
||||
[browser_dbg-breakpoints-toggle.js]
|
||||
[browser_dbg-breakpoints-reloading.js]
|
||||
[browser_dbg-breakpoints-cond.js]
|
||||
[browser_dbg-browser-content-toolbox.js]
|
||||
|
|
|
@ -103,7 +103,7 @@ add_task(async function() {
|
|||
{ line: 8, column: 6 },
|
||||
[
|
||||
"arrow",
|
||||
["argArrow", "(unmapped)"],
|
||||
["argArrow", '"arrow-arg"'],
|
||||
"Block",
|
||||
"arrow()",
|
||||
"fn",
|
||||
|
@ -132,6 +132,7 @@ add_task(async function() {
|
|||
["aNamespace", "{\u2026}"],
|
||||
["aNamespace2", "{\u2026}"],
|
||||
["aNamespace3", "{\u2026}"],
|
||||
["example", "(optimized away)"],
|
||||
["optimizedOut", "(optimized away)"],
|
||||
"root()"
|
||||
]);
|
||||
|
@ -284,6 +285,7 @@ add_task(async function() {
|
|||
["aNamespace", "{\u2026}"],
|
||||
["aNamespace2", "{\u2026}"],
|
||||
["aNamespace3", "{\u2026}"],
|
||||
["example", "(optimized away)"],
|
||||
["optimizedOut", "(optimized away)"],
|
||||
"root()"
|
||||
]);
|
||||
|
@ -302,6 +304,7 @@ add_task(async function() {
|
|||
["aNamespace", "{\u2026}"],
|
||||
["aNamespace2", "{\u2026}"],
|
||||
["aNamespace3", "{\u2026}"],
|
||||
["example", "(optimized away)"],
|
||||
["optimizedOut", "(optimized away)"],
|
||||
"root()"
|
||||
]);
|
||||
|
|
|
@ -1,89 +0,0 @@
|
|||
function toggleBreakpoint(dbg, index) {
|
||||
const bp = findAllElements(dbg, "breakpointItems")[index];
|
||||
const input = bp.querySelector("input");
|
||||
input.click();
|
||||
}
|
||||
|
||||
async function removeBreakpoint(dbg, index) {
|
||||
const removed = waitForDispatch(dbg, "REMOVE_BREAKPOINT");
|
||||
const bp = findAllElements(dbg, "breakpointItems")[index];
|
||||
bp.querySelector(".close-btn").click();
|
||||
await removed;
|
||||
}
|
||||
|
||||
async function disableBreakpoint(dbg, index) {
|
||||
const disabled = waitForDispatch(dbg, "DISABLE_BREAKPOINT");
|
||||
toggleBreakpoint(dbg, index);
|
||||
await disabled;
|
||||
}
|
||||
|
||||
async function enableBreakpoint(dbg, index) {
|
||||
const enabled = waitForDispatch(dbg, "ENABLE_BREAKPOINT");
|
||||
toggleBreakpoint(dbg, index);
|
||||
await enabled;
|
||||
}
|
||||
|
||||
function toggleBreakpoints(dbg, count) {
|
||||
clickElement(dbg, "toggleBreakpoints");
|
||||
}
|
||||
|
||||
function disableBreakpoints(dbg, count) {
|
||||
const toggled = waitForDispatch(dbg, "DISABLE_ALL_BREAKPOINTS", count);
|
||||
toggleBreakpoints(dbg);
|
||||
return toggled;
|
||||
}
|
||||
|
||||
function enableBreakpoints(dbg, count) {
|
||||
const enabled = waitForDispatch(dbg, "ENABLE_ALL_BREAKPOINTS", count);
|
||||
toggleBreakpoints(dbg);
|
||||
return enabled;
|
||||
}
|
||||
|
||||
function findBreakpoint(dbg, url, line) {
|
||||
const { selectors: { getBreakpoint }, getState } = dbg;
|
||||
const source = findSource(dbg, url);
|
||||
return getBreakpoint(getState(), { sourceId: source.id, line });
|
||||
}
|
||||
|
||||
function findBreakpoints(dbg) {
|
||||
const { selectors: { getBreakpoints }, getState } = dbg;
|
||||
return getBreakpoints(getState());
|
||||
}
|
||||
|
||||
// toggle all breakpoints
|
||||
add_task(async function() {
|
||||
const dbg = await initDebugger("doc-scripts.html", "simple2");
|
||||
|
||||
// Create two breakpoints
|
||||
await selectSource(dbg, "simple2");
|
||||
await addBreakpoint(dbg, "simple2", 3);
|
||||
await addBreakpoint(dbg, "simple2", 5);
|
||||
|
||||
// Disable all of the breakpoints
|
||||
await disableBreakpoints(dbg, 1);
|
||||
let bp1 = findBreakpoint(dbg, "simple2", 3);
|
||||
let bp2 = findBreakpoint(dbg, "simple2", 5);
|
||||
|
||||
if (!bp2) {
|
||||
debugger;
|
||||
}
|
||||
|
||||
is(bp1.disabled, true, "first breakpoint is disabled");
|
||||
is(bp2.disabled, true, "second breakpoint is disabled");
|
||||
|
||||
// Enable all of the breakpoints
|
||||
await enableBreakpoints(dbg, 1);
|
||||
bp1 = findBreakpoint(dbg, "simple2", 3);
|
||||
bp2 = findBreakpoint(dbg, "simple2", 5);
|
||||
|
||||
is(bp1.disabled, false, "first breakpoint is enabled");
|
||||
is(bp2.disabled, false, "second breakpoint is enabled");
|
||||
|
||||
// Remove the breakpoints
|
||||
await removeBreakpoint(dbg, 0);
|
||||
await removeBreakpoint(dbg, 0);
|
||||
|
||||
const bps = findBreakpoints(dbg);
|
||||
|
||||
is(bps.size, 0, "breakpoints are removed");
|
||||
});
|
|
@ -41,3 +41,10 @@ export default function root() {
|
|||
console.log(new aNamespace3());
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
export function example(){}
|
||||
|
||||
// The build harness sets the wrong global, so just override it.
|
||||
Promise.resolve().then(() => {
|
||||
window.importedBindings = root;
|
||||
});
|
||||
|
|
|
@ -75,6 +75,7 @@ Object.defineProperty(exports, "__esModule", {
|
|||
value: true
|
||||
});
|
||||
exports.default = root;
|
||||
exports.example = example;
|
||||
|
||||
var _mod = __webpack_require__(1);
|
||||
|
||||
|
@ -147,7 +148,13 @@ function root() {
|
|||
console.log(new aNamespace3());
|
||||
} catch (e) {}
|
||||
}
|
||||
module.exports = exports["default"];
|
||||
|
||||
function example() {}
|
||||
|
||||
// The build harness sets the wrong global, so just override it.
|
||||
Promise.resolve().then(function () {
|
||||
window.importedBindings = root;
|
||||
});
|
||||
|
||||
/***/ }),
|
||||
/* 1 */
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -42,6 +42,8 @@ export default function root() {
|
|||
} catch (e) {}
|
||||
}
|
||||
|
||||
export function example(){}
|
||||
|
||||
// The build harness sets the wrong global, so just override it.
|
||||
Promise.resolve().then(() => {
|
||||
window.webpackModulesEs6 = root;
|
||||
|
|
|
@ -71,6 +71,7 @@ var webpackModulesEs6 =
|
|||
"use strict";
|
||||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
||||
/* harmony export (immutable) */ __webpack_exports__["default"] = root;
|
||||
/* harmony export (immutable) */ __webpack_exports__["example"] = example;
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__src_mod1__ = __webpack_require__(1);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__src_mod2__ = __webpack_require__(2);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__src_mod3__ = __webpack_require__(3);
|
||||
|
@ -128,6 +129,8 @@ function root() {
|
|||
} catch (e) {}
|
||||
}
|
||||
|
||||
function example() {}
|
||||
|
||||
// The build harness sets the wrong global, so just override it.
|
||||
Promise.resolve().then(() => {
|
||||
window.webpackModulesEs6 = root;
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -42,6 +42,8 @@ export default function root() {
|
|||
} catch (e) {}
|
||||
}
|
||||
|
||||
export function example(){}
|
||||
|
||||
// The build harness sets the wrong global, so just override it.
|
||||
Promise.resolve().then(() => {
|
||||
window.webpackModules = root;
|
||||
|
|
|
@ -71,6 +71,7 @@ var webpackModules =
|
|||
"use strict";
|
||||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
||||
/* harmony export (immutable) */ __webpack_exports__["default"] = root;
|
||||
/* harmony export (immutable) */ __webpack_exports__["example"] = example;
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__src_mod1__ = __webpack_require__(1);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__src_mod2__ = __webpack_require__(2);
|
||||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__src_mod3__ = __webpack_require__(3);
|
||||
|
@ -128,6 +129,8 @@ function root() {
|
|||
} catch (e) {}
|
||||
}
|
||||
|
||||
function example() {}
|
||||
|
||||
// The build harness sets the wrong global, so just override it.
|
||||
Promise.resolve().then(function () {
|
||||
window.webpackModules = root;
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -5,6 +5,8 @@ const _ = require("lodash");
|
|||
const fixtures = path.join(__dirname, "fixtures");
|
||||
|
||||
const tests = fs.readdirSync(fixtures).map(name => {
|
||||
if (name[0] === ".") return;
|
||||
|
||||
const dirname = path.relative(__dirname, path.join(fixtures, name));
|
||||
|
||||
return {
|
||||
|
@ -13,7 +15,7 @@ const tests = fs.readdirSync(fixtures).map(name => {
|
|||
input: `./${path.join(dirname, "input.js")}`,
|
||||
output: path.join(dirname, "output.js")
|
||||
};
|
||||
});
|
||||
}).filter(Boolean);
|
||||
|
||||
const html = path.join(__dirname, "..", "doc-babel.html");
|
||||
|
||||
|
|
|
@ -272,6 +272,7 @@ devtools.jar:
|
|||
skin/images/debugger/breakpoint.svg (themes/images/debugger/breakpoint.svg)
|
||||
skin/images/debugger/close.svg (themes/images/debugger/close.svg)
|
||||
skin/images/debugger/coffeescript.svg (themes/images/debugger/coffeescript.svg)
|
||||
skin/images/debugger/disable-pausing.svg (themes/images/debugger/disable-pausing.svg)
|
||||
skin/images/debugger/domain.svg (themes/images/debugger/domain.svg)
|
||||
skin/images/debugger/extension.svg (themes/images/debugger/extension.svg)
|
||||
skin/images/debugger/file.svg (themes/images/debugger/file.svg)
|
||||
|
|
|
@ -81,6 +81,10 @@ stepInTooltip=Step in %S
|
|||
# button that steps out of a function call.
|
||||
stepOutTooltip=Step out %S
|
||||
|
||||
# LOCALIZATION NOTE (skipPausingTooltip): The tooltip text for disabling all
|
||||
# breakpoints and pausing triggers
|
||||
skipPausingTooltip=Skip all pausing
|
||||
|
||||
# LOCALIZATION NOTE (pauseButtonItem): The label that is displayed for the dropdown pause
|
||||
# list item when the debugger is in a running state.
|
||||
pauseButtonItem=Pause on Next Statement
|
||||
|
|
|
@ -44,8 +44,8 @@ pref("devtools.debugger.expressions", "[]");
|
|||
pref("devtools.debugger.file-search-case-sensitive", false);
|
||||
pref("devtools.debugger.file-search-whole-word", false);
|
||||
pref("devtools.debugger.file-search-regex-match", false);
|
||||
pref("devtools.debugger.features.async-stepping", true);
|
||||
pref("devtools.debugger.project-directory-root", "");
|
||||
pref("devtools.debugger.skip-pausing", false);
|
||||
|
||||
pref("devtools.debugger.features.wasm", true);
|
||||
pref("devtools.debugger.features.shortcuts", true);
|
||||
|
@ -62,3 +62,5 @@ pref("devtools.debugger.features.outline", true);
|
|||
pref("devtools.debugger.features.replay", false);
|
||||
pref("devtools.debugger.features.pause-points", true);
|
||||
pref("devtools.debugger.features.component-stack", false);
|
||||
pref("devtools.debugger.features.async-stepping", true);
|
||||
pref("devtools.debugger.features.skip-pausing", false);
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<svg height="16" viewBox="0 0 15 16" width="15" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" transform="translate(0 1)"><path d="m1.5 13.5 10-13" stroke="#000" stroke-linecap="square"/><path d="m7.58013626 3-.75408823 1h-4.82604803c-.53612439 0-.77556634.12770238-.9020017.32999894-.07178403.11485445-.0979983.24068295-.0979983.27000106v4.8c0 .02931811.02621427.15514661.0979983.27000106.12643536.20229656.36587731.32999894.9020017.32999894h.30151865l-.73328118.9724077c-1.56823747-.2118785-1.56823747-1.5724077-1.56823747-1.5724077v-4.8s0-1.6 2-1.6zm3.94638894.52652517 3.4734748 3.47347483-4 4h-5.10913424l.75408823-1h3.94083241l3-3-2.6672362-2.66723627z" fill="#000" fill-rule="nonzero"/></g></svg>
|
После Ширина: | Высота: | Размер: 726 B |
|
@ -3219,6 +3219,24 @@ nsFocusManager::IsHostOrSlot(nsIContent* aContent)
|
|||
aContent->IsHTMLElement(nsGkAtoms::slot); // slot
|
||||
}
|
||||
|
||||
int32_t
|
||||
nsFocusManager::HostOrSlotTabIndexValue(nsIContent* aContent)
|
||||
{
|
||||
MOZ_ASSERT(IsHostOrSlot(aContent));
|
||||
|
||||
const nsAttrValue* attrVal =
|
||||
aContent->AsElement()->GetParsedAttr(nsGkAtoms::tabindex);
|
||||
if (!attrVal) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (attrVal->Type() == nsAttrValue::eInteger) {
|
||||
return attrVal->GetIntegerValue();
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
nsIContent*
|
||||
nsFocusManager::GetNextTabbableContentInScope(nsIContent* aOwner,
|
||||
nsIContent* aStartContent,
|
||||
|
@ -3330,7 +3348,7 @@ nsFocusManager::GetNextTabbableContentInAncestorScopes(
|
|||
MOZ_ASSERT(owner->GetShadowRoot());
|
||||
|
||||
*aStartContent = owner;
|
||||
owner->IsFocusable(aCurrentTabIndex);
|
||||
*aCurrentTabIndex = HostOrSlotTabIndexValue(owner);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3500,6 +3518,29 @@ nsFocusManager::GetNextTabbableContent(nsIPresShell* aPresShell,
|
|||
}
|
||||
}
|
||||
|
||||
// As of now, 2018/04/12, sequential focus navigation is still
|
||||
// in the obsolete Shadow DOM specification.
|
||||
// http://w3c.github.io/webcomponents/spec/shadow/#sequential-focus-navigation
|
||||
// "if ELEMENT is focusable, a shadow host, or a slot element,
|
||||
// append ELEMENT to NAVIGATION-ORDER."
|
||||
// and later in "For each element ELEMENT in NAVIGATION-ORDER: "
|
||||
// hosts and slots are handled before other elements.
|
||||
if (currentContent && nsDocument::IsShadowDOMEnabled(currentContent) &&
|
||||
IsHostOrSlot(currentContent)) {
|
||||
int32_t tabIndex = HostOrSlotTabIndexValue(currentContent);
|
||||
if (tabIndex >= 0 &&
|
||||
(aIgnoreTabIndex || aCurrentTabIndex == tabIndex)) {
|
||||
nsIContent* contentToFocus =
|
||||
GetNextTabbableContentInScope(currentContent, currentContent, aForward,
|
||||
aForward ? 1 : 0, aIgnoreTabIndex,
|
||||
true /* aSkipOwner */);
|
||||
if (contentToFocus) {
|
||||
NS_ADDREF(*aResultContent = contentToFocus);
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TabIndex not set defaults to 0 for form elements, anchors and other
|
||||
// elements that are normally focusable. Tabindex defaults to -1
|
||||
// for elements that are not normally focusable.
|
||||
|
|
|
@ -443,6 +443,13 @@ protected:
|
|||
*/
|
||||
bool IsHostOrSlot(nsIContent* aContent);
|
||||
|
||||
/**
|
||||
* Host and Slot elements need to be handled as if they had tabindex 0 even
|
||||
* when they don't have the attribute. This is a helper method to get the right
|
||||
* value for focus navigation.
|
||||
*/
|
||||
int32_t HostOrSlotTabIndexValue(nsIContent* aContent);
|
||||
|
||||
/**
|
||||
* Retrieve the next tabbable element in scope owned by aOwner, using
|
||||
* focusability and tabindex to determine the tab order.
|
||||
|
|
|
@ -0,0 +1,137 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Test for Bug 1453693</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<script>
|
||||
|
||||
var lastFocusTarget;
|
||||
function focusLogger(event) {
|
||||
lastFocusTarget = event.target;
|
||||
console.log(event.target + " under " + event.target.parentNode);
|
||||
}
|
||||
|
||||
function testTabbingThroughShadowDOMWithTabIndexes() {
|
||||
var anchor = document.createElement("a");
|
||||
anchor.onfocus = focusLogger;
|
||||
anchor.href = "#";
|
||||
anchor.textContent = "in light DOM";
|
||||
document.body.appendChild(anchor);
|
||||
|
||||
var host = document.createElement("div");
|
||||
document.body.appendChild(host);
|
||||
|
||||
var sr = host.attachShadow({mode: "open"});
|
||||
var shadowAnchor = anchor.cloneNode(false);
|
||||
shadowAnchor.onfocus = focusLogger;
|
||||
shadowAnchor.textContent = "in shadow DOM";
|
||||
sr.appendChild(shadowAnchor);
|
||||
var shadowInput = document.createElement("input");
|
||||
shadowInput.onfocus = focusLogger;
|
||||
shadowInput.tabIndex = 1;
|
||||
sr.appendChild(shadowInput);
|
||||
|
||||
var input = document.createElement("input");
|
||||
input.onfocus = focusLogger;
|
||||
input.tabIndex = 1;
|
||||
document.body.appendChild(input);
|
||||
|
||||
var input2 = document.createElement("input");
|
||||
input2.onfocus = focusLogger;
|
||||
document.body.appendChild(input2);
|
||||
|
||||
document.body.offsetLeft;
|
||||
|
||||
synthesizeKey("KEY_Tab");
|
||||
opener.is(lastFocusTarget, input, "Should have focused input element. (3)");
|
||||
synthesizeKey("KEY_Tab");
|
||||
opener.is(lastFocusTarget, anchor, "Should have focused anchor element. (3)");
|
||||
synthesizeKey("KEY_Tab");
|
||||
opener.is(lastFocusTarget, shadowInput, "Should have focused input element in shadow DOM. (3)");
|
||||
synthesizeKey("KEY_Tab");
|
||||
opener.is(lastFocusTarget, shadowAnchor, "Should have focused anchor element in shadow DOM. (3)");
|
||||
synthesizeKey("KEY_Tab");
|
||||
opener.is(lastFocusTarget, input2, "Should have focused input[2] element. (3)");
|
||||
|
||||
// Backwards
|
||||
synthesizeKey("KEY_Tab", {shiftKey: true});
|
||||
opener.is(lastFocusTarget, shadowAnchor, "Should have focused anchor element in shadow DOM. (4)");
|
||||
synthesizeKey("KEY_Tab", {shiftKey: true});
|
||||
opener.is(lastFocusTarget, shadowInput, "Should have focused input element in shadow DOM. (4)");
|
||||
synthesizeKey("KEY_Tab", {shiftKey: true});
|
||||
opener.is(lastFocusTarget, anchor, "Should have focused anchor element. (4)");
|
||||
synthesizeKey("KEY_Tab", {shiftKey: true});
|
||||
opener.is(lastFocusTarget, input, "Should have focused input element. (4)");
|
||||
|
||||
document.body.innerHTML = null;
|
||||
}
|
||||
|
||||
function testTabbingThroughSimpleShadowDOM() {
|
||||
var anchor = document.createElement("a");
|
||||
anchor.onfocus = focusLogger;
|
||||
anchor.href = "#";
|
||||
anchor.textContent = "in light DOM";
|
||||
document.body.appendChild(anchor);
|
||||
anchor.focus();
|
||||
|
||||
var host = document.createElement("div");
|
||||
document.body.appendChild(host);
|
||||
|
||||
var sr = host.attachShadow({mode: "open"});
|
||||
var shadowAnchor = anchor.cloneNode(false);
|
||||
shadowAnchor.onfocus = focusLogger;
|
||||
shadowAnchor.textContent = "in shadow DOM";
|
||||
sr.appendChild(shadowAnchor);
|
||||
var shadowInput = document.createElement("input");
|
||||
shadowInput.onfocus = focusLogger;
|
||||
sr.appendChild(shadowInput);
|
||||
|
||||
var input = document.createElement("input");
|
||||
input.onfocus = focusLogger;
|
||||
document.body.appendChild(input);
|
||||
|
||||
var input2 = document.createElement("input");
|
||||
input2.onfocus = focusLogger;
|
||||
document.body.appendChild(input2);
|
||||
|
||||
document.body.offsetLeft;
|
||||
|
||||
synthesizeKey("KEY_Tab");
|
||||
opener.is(lastFocusTarget, shadowAnchor, "Should have focused anchor element in shadow DOM.");
|
||||
synthesizeKey("KEY_Tab");
|
||||
opener.is(lastFocusTarget, shadowInput, "Should have focused input element in shadow DOM.");
|
||||
synthesizeKey("KEY_Tab");
|
||||
opener.is(lastFocusTarget, input, "Should have focused input element.");
|
||||
synthesizeKey("KEY_Tab");
|
||||
opener.is(lastFocusTarget, input2, "Should have focused input[2] element.");
|
||||
|
||||
// Backwards
|
||||
synthesizeKey("KEY_Tab", {shiftKey: true});
|
||||
opener.is(lastFocusTarget, input, "Should have focused input element. (2)");
|
||||
synthesizeKey("KEY_Tab", {shiftKey: true});
|
||||
opener.is(lastFocusTarget, shadowInput, "Should have focused input element in shadow DOM. (2)");
|
||||
synthesizeKey("KEY_Tab", {shiftKey: true});
|
||||
opener.is(lastFocusTarget, shadowAnchor, "Should have focused anchor element in shadow DOM. (2)");
|
||||
synthesizeKey("KEY_Tab", {shiftKey: true});
|
||||
opener.is(lastFocusTarget, anchor, "Should have focused anchor element. (2)");
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
|
||||
testTabbingThroughShadowDOMWithTabIndexes();
|
||||
testTabbingThroughSimpleShadowDOM();
|
||||
|
||||
opener.didRunTests();
|
||||
window.close();
|
||||
}
|
||||
|
||||
function init() {
|
||||
SimpleTest.waitForFocus(runTest);
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
</body>
|
||||
</html>
|
|
@ -126,6 +126,7 @@ support-files =
|
|||
file_bug907892.html
|
||||
file_bug945152.jar
|
||||
file_bug1274806.html
|
||||
file_bug1453693.html
|
||||
file_domwindowutils_animation.html
|
||||
file_general_document.html
|
||||
file_history_document_open.html
|
||||
|
@ -612,6 +613,8 @@ skip-if = toolkit == 'android'
|
|||
[test_bug1404385.html]
|
||||
[test_bug1406102.html]
|
||||
[test_bug1421568.html]
|
||||
[test_bug1453693.html]
|
||||
skip-if = os == "mac"
|
||||
[test_caretPositionFromPoint.html]
|
||||
[test_change_policy.html]
|
||||
[test_clearTimeoutIntervalNoArg.html]
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1453693
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1453693</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for Bug 1453693 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function init() {
|
||||
SpecialPowers.pushPrefEnv(
|
||||
{
|
||||
"set": [["dom.webcomponents.shadowdom.enabled", true]]
|
||||
},
|
||||
runTests);
|
||||
}
|
||||
|
||||
function runTests() {
|
||||
win = window.open("file_bug1453693.html", "", "width=300, height=300");
|
||||
}
|
||||
|
||||
function didRunTests() {
|
||||
setTimeout("SimpleTest.finish()");
|
||||
}
|
||||
|
||||
SimpleTest.waitForFocus(init);
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1453693">Mozilla Bug 1453693</a>
|
||||
</body>
|
||||
</html>
|
|
@ -15,103 +15,6 @@
|
|||
|
||||
namespace js {
|
||||
|
||||
static inline Value
|
||||
GetUnboxedValue(uint8_t* p, JSValueType type, bool maybeUninitialized)
|
||||
{
|
||||
switch (type) {
|
||||
case JSVAL_TYPE_BOOLEAN:
|
||||
return BooleanValue(*p != 0);
|
||||
|
||||
case JSVAL_TYPE_INT32:
|
||||
return Int32Value(*reinterpret_cast<int32_t*>(p));
|
||||
|
||||
case JSVAL_TYPE_DOUBLE: {
|
||||
// During unboxed plain object creation, non-GC thing properties are
|
||||
// left uninitialized. This is normally fine, since the properties will
|
||||
// be filled in shortly, but if they are read before that happens we
|
||||
// need to make sure that doubles are canonical.
|
||||
double d = *reinterpret_cast<double*>(p);
|
||||
if (maybeUninitialized)
|
||||
return DoubleValue(JS::CanonicalizeNaN(d));
|
||||
return DoubleValue(d);
|
||||
}
|
||||
|
||||
case JSVAL_TYPE_STRING:
|
||||
return StringValue(*reinterpret_cast<JSString**>(p));
|
||||
|
||||
case JSVAL_TYPE_OBJECT:
|
||||
return ObjectOrNullValue(*reinterpret_cast<JSObject**>(p));
|
||||
|
||||
default:
|
||||
MOZ_CRASH("Invalid type for unboxed value");
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool
|
||||
SetUnboxedValue(JSContext* cx, JSObject* unboxedObject, jsid id,
|
||||
uint8_t* p, JSValueType type, const Value& v, bool preBarrier)
|
||||
{
|
||||
switch (type) {
|
||||
case JSVAL_TYPE_BOOLEAN:
|
||||
if (v.isBoolean()) {
|
||||
*p = v.toBoolean();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
case JSVAL_TYPE_INT32:
|
||||
if (v.isInt32()) {
|
||||
*reinterpret_cast<int32_t*>(p) = v.toInt32();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
case JSVAL_TYPE_DOUBLE:
|
||||
if (v.isNumber()) {
|
||||
*reinterpret_cast<double*>(p) = v.toNumber();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
case JSVAL_TYPE_STRING:
|
||||
if (v.isString()) {
|
||||
JSString** np = reinterpret_cast<JSString**>(p);
|
||||
if (IsInsideNursery(v.toString()) && !IsInsideNursery(unboxedObject))
|
||||
v.toString()->storeBuffer()->putWholeCell(unboxedObject);
|
||||
|
||||
if (preBarrier)
|
||||
JSString::writeBarrierPre(*np);
|
||||
*np = v.toString();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
case JSVAL_TYPE_OBJECT:
|
||||
if (v.isObjectOrNull()) {
|
||||
JSObject** np = reinterpret_cast<JSObject**>(p);
|
||||
|
||||
// Update property types when writing object properties. Types for
|
||||
// other properties were captured when the unboxed layout was
|
||||
// created.
|
||||
AddTypePropertyId(cx, unboxedObject, id, v);
|
||||
|
||||
// As above, trigger post barriers on the whole object.
|
||||
JSObject* obj = v.toObjectOrNull();
|
||||
if (IsInsideNursery(obj) && !IsInsideNursery(unboxedObject))
|
||||
obj->storeBuffer()->putWholeCell(unboxedObject);
|
||||
|
||||
if (preBarrier)
|
||||
JSObject::writeBarrierPre(*np);
|
||||
*np = obj;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
default:
|
||||
MOZ_CRASH("Invalid type for unboxed value");
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// UnboxedPlainObject
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
#include "vm/UnboxedObject-inl.h"
|
||||
|
||||
#include "mozilla/MemoryChecking.h"
|
||||
|
||||
#include "jit/BaselineIC.h"
|
||||
#include "jit/ExecutableAllocator.h"
|
||||
#include "jit/JitCommon.h"
|
||||
|
@ -306,6 +308,111 @@ UnboxedLayout::detachFromCompartment()
|
|||
remove();
|
||||
}
|
||||
|
||||
static Value
|
||||
GetUnboxedValue(uint8_t* p, JSValueType type, bool maybeUninitialized)
|
||||
{
|
||||
switch (type) {
|
||||
case JSVAL_TYPE_BOOLEAN:
|
||||
if (maybeUninitialized) {
|
||||
// Squelch Valgrind/MSan errors.
|
||||
MOZ_MAKE_MEM_DEFINED(p, 1);
|
||||
}
|
||||
return BooleanValue(*p != 0);
|
||||
|
||||
case JSVAL_TYPE_INT32:
|
||||
if (maybeUninitialized)
|
||||
MOZ_MAKE_MEM_DEFINED(p, sizeof(int32_t));
|
||||
return Int32Value(*reinterpret_cast<int32_t*>(p));
|
||||
|
||||
case JSVAL_TYPE_DOUBLE: {
|
||||
// During unboxed plain object creation, non-GC thing properties are
|
||||
// left uninitialized. This is normally fine, since the properties will
|
||||
// be filled in shortly, but if they are read before that happens we
|
||||
// need to make sure that doubles are canonical.
|
||||
if (maybeUninitialized)
|
||||
MOZ_MAKE_MEM_DEFINED(p, sizeof(double));
|
||||
double d = *reinterpret_cast<double*>(p);
|
||||
if (maybeUninitialized)
|
||||
return DoubleValue(JS::CanonicalizeNaN(d));
|
||||
return DoubleValue(d);
|
||||
}
|
||||
|
||||
case JSVAL_TYPE_STRING:
|
||||
return StringValue(*reinterpret_cast<JSString**>(p));
|
||||
|
||||
case JSVAL_TYPE_OBJECT:
|
||||
return ObjectOrNullValue(*reinterpret_cast<JSObject**>(p));
|
||||
|
||||
default:
|
||||
MOZ_CRASH("Invalid type for unboxed value");
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
SetUnboxedValue(JSContext* cx, JSObject* unboxedObject, jsid id,
|
||||
uint8_t* p, JSValueType type, const Value& v, bool preBarrier)
|
||||
{
|
||||
switch (type) {
|
||||
case JSVAL_TYPE_BOOLEAN:
|
||||
if (v.isBoolean()) {
|
||||
*p = v.toBoolean();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
case JSVAL_TYPE_INT32:
|
||||
if (v.isInt32()) {
|
||||
*reinterpret_cast<int32_t*>(p) = v.toInt32();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
case JSVAL_TYPE_DOUBLE:
|
||||
if (v.isNumber()) {
|
||||
*reinterpret_cast<double*>(p) = v.toNumber();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
case JSVAL_TYPE_STRING:
|
||||
if (v.isString()) {
|
||||
JSString** np = reinterpret_cast<JSString**>(p);
|
||||
if (IsInsideNursery(v.toString()) && !IsInsideNursery(unboxedObject))
|
||||
v.toString()->storeBuffer()->putWholeCell(unboxedObject);
|
||||
|
||||
if (preBarrier)
|
||||
JSString::writeBarrierPre(*np);
|
||||
*np = v.toString();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
case JSVAL_TYPE_OBJECT:
|
||||
if (v.isObjectOrNull()) {
|
||||
JSObject** np = reinterpret_cast<JSObject**>(p);
|
||||
|
||||
// Update property types when writing object properties. Types for
|
||||
// other properties were captured when the unboxed layout was
|
||||
// created.
|
||||
AddTypePropertyId(cx, unboxedObject, id, v);
|
||||
|
||||
// As above, trigger post barriers on the whole object.
|
||||
JSObject* obj = v.toObjectOrNull();
|
||||
if (IsInsideNursery(obj) && !IsInsideNursery(unboxedObject))
|
||||
obj->storeBuffer()->putWholeCell(unboxedObject);
|
||||
|
||||
if (preBarrier)
|
||||
JSObject::writeBarrierPre(*np);
|
||||
*np = obj;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
default:
|
||||
MOZ_CRASH("Invalid type for unboxed value");
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// UnboxedPlainObject
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -1805,6 +1805,7 @@ nsStandardURL::SetPassword(const nsACString &input)
|
|||
if (password.IsEmpty()) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(this->Password().IsEmpty());
|
||||
}
|
||||
Unused << this; // silence compiler -Wunused-lambda-capture
|
||||
});
|
||||
|
||||
LOG(("nsStandardURL::SetPassword [password=%s]\n", password.get()));
|
||||
|
|
|
@ -421,8 +421,16 @@ var DownloadHistoryList = function(publicList, place) {
|
|||
publicList.addView(this).catch(Cu.reportError);
|
||||
let query = {}, options = {};
|
||||
PlacesUtils.history.queryStringToQuery(place, query, options);
|
||||
|
||||
// NB: The addObserver call sets our nsINavHistoryResultObserver.result.
|
||||
let result = PlacesUtils.history.executeQuery(query.value, options.value);
|
||||
result.addObserver(this);
|
||||
|
||||
// Our history result observer is long lived for fast shared views, so free
|
||||
// the reference on shutdown to prevent leaks.
|
||||
Services.obs.addObserver(() => {
|
||||
this.result = null;
|
||||
}, "quit-application-granted");
|
||||
};
|
||||
|
||||
this.DownloadHistoryList.prototype = {
|
||||
|
@ -454,17 +462,6 @@ this.DownloadHistoryList.prototype = {
|
|||
},
|
||||
_result: null,
|
||||
|
||||
/**
|
||||
* Remove the view that belongs to this list via DownloadList's removeView. In
|
||||
* addition, delete the result object to ensure there are no memory leaks.
|
||||
*/
|
||||
removeView(aView) {
|
||||
DownloadList.prototype.removeView.call(this, aView);
|
||||
|
||||
// Clean up any active results that might still be observing. See bug 1455737
|
||||
this.result = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Index of the first slot that contains a session download. This is equal to
|
||||
* the length of the list when there are no session downloads.
|
||||
|
|
|
@ -258,6 +258,14 @@ add_task(async function test_DownloadHistory() {
|
|||
await allHistoryList2.addView(allView2);
|
||||
await allView2.waitForExpected();
|
||||
|
||||
// Create a dummy list and view like the previous limited one to just add and
|
||||
// remove its view to make sure it doesn't break other lists' updates.
|
||||
let dummyList = await DownloadHistory.getList({ type: Downloads.ALL,
|
||||
maxHistoryResults: 3 });
|
||||
let dummyView = new TestView([]);
|
||||
await dummyList.addView(dummyView);
|
||||
await dummyList.removeView(dummyView);
|
||||
|
||||
// Clear history and check that session downloads with partial data remain.
|
||||
// Private downloads are also not cleared when clearing history.
|
||||
view.expected = view.expected.filter(d => d.hasPartialData);
|
||||
|
@ -266,4 +274,8 @@ add_task(async function test_DownloadHistory() {
|
|||
await PlacesUtils.history.clear();
|
||||
await view.waitForExpected();
|
||||
await allView.waitForExpected();
|
||||
|
||||
// Check that the dummy view above did not prevent the limited from updating.
|
||||
allView2.expected = allView.expected;
|
||||
await allView2.waitForExpected();
|
||||
});
|
||||
|
|
|
@ -9,25 +9,23 @@ var visit_count = 0;
|
|||
|
||||
// Returns the Place ID corresponding to an added visit.
|
||||
async function task_add_visit(aURI, aVisitType) {
|
||||
// Add the visit asynchronously, and save its visit ID.
|
||||
let deferUpdatePlaces = new Promise((resolve, reject) => {
|
||||
PlacesUtils.asyncHistory.updatePlaces({
|
||||
uri: aURI,
|
||||
visits: [{ transitionType: aVisitType, visitDate: Date.now() * 1000 }]
|
||||
}, {
|
||||
handleError: function TAV_handleError() {
|
||||
reject(new Error("Unexpected error in adding visit."));
|
||||
},
|
||||
handleResult(aPlaceInfo) {
|
||||
this.visitId = aPlaceInfo.visits[0].visitId;
|
||||
},
|
||||
handleCompletion: function TAV_handleCompletion() {
|
||||
resolve(this.visitId);
|
||||
}
|
||||
});
|
||||
});
|
||||
// Wait for a visits notification and get the visitId.
|
||||
let visitId;
|
||||
let visitsPromise = PlacesTestUtils.waitForNotification("onVisits", visits => {
|
||||
visitId = visits[0].visitId;
|
||||
let {uri} = visits[0];
|
||||
return uri.equals(aURI);
|
||||
}, "history");
|
||||
|
||||
let visitId = await deferUpdatePlaces;
|
||||
// Add visits.
|
||||
await PlacesTestUtils.addVisits([{
|
||||
uri: aURI,
|
||||
transition: aVisitType
|
||||
}]);
|
||||
|
||||
if (aVisitType != TRANSITION_EMBED) {
|
||||
await visitsPromise;
|
||||
}
|
||||
|
||||
// Increase visit_count if applicable
|
||||
if (aVisitType != 0 &&
|
||||
|
|
|
@ -154,34 +154,41 @@ add_task(async function test_dh_addBookmarkRemoveDownload() {
|
|||
});
|
||||
});
|
||||
|
||||
add_test(function test_dh_addDownload_referrer() {
|
||||
waitForOnVisit(function DHAD_prepareReferrer(aURI, aVisitID) {
|
||||
Assert.ok(aURI.equals(REFERRER_URI));
|
||||
let referrerVisitId = aVisitID;
|
||||
add_task(async function test_dh_addDownload_referrer() {
|
||||
// Wait for visits notification and get the visit id.
|
||||
let visitId;
|
||||
let referrerPromise = PlacesTestUtils.waitForNotification("onVisits", visits => {
|
||||
visitId = visits[0].visitId;
|
||||
let {uri} = visits[0];
|
||||
return uri.equals(REFERRER_URI);
|
||||
}, "history");
|
||||
|
||||
waitForOnVisit(function DHAD_onVisit(aVisitedURI, unused, unused2, unused3,
|
||||
aReferringID) {
|
||||
Assert.ok(aVisitedURI.equals(DOWNLOAD_URI));
|
||||
Assert.equal(aReferringID, referrerVisitId);
|
||||
|
||||
// Verify that the URI is already available in results at this time.
|
||||
Assert.ok(!!page_in_database(DOWNLOAD_URI));
|
||||
|
||||
PlacesUtils.history.clear().then(run_next_test);
|
||||
});
|
||||
|
||||
gDownloadHistory.addDownload(DOWNLOAD_URI, REFERRER_URI, Date.now() * 1000);
|
||||
});
|
||||
|
||||
// Note that we don't pass the optional callback argument here because we must
|
||||
// ensure that we receive the onVisits notification before we call addDownload.
|
||||
PlacesUtils.asyncHistory.updatePlaces({
|
||||
await PlacesTestUtils.addVisits([{
|
||||
uri: REFERRER_URI,
|
||||
visits: [{
|
||||
transitionType: Ci.nsINavHistoryService.TRANSITION_TYPED,
|
||||
visitDate: Date.now() * 1000
|
||||
}]
|
||||
});
|
||||
transition: Ci.nsINavHistoryService.TRANSITION_TYPED
|
||||
}]);
|
||||
await referrerPromise;
|
||||
|
||||
// Verify results for referrer uri.
|
||||
Assert.ok(!!PlacesTestUtils.isPageInDB(REFERRER_URI));
|
||||
Assert.equal(visitId, 1);
|
||||
|
||||
// Wait for visits notification and get the referrer Id.
|
||||
let referrerId;
|
||||
let downloadPromise = PlacesTestUtils.waitForNotification("onVisits", visits => {
|
||||
referrerId = visits[0].referrerId;
|
||||
let {uri} = visits[0];
|
||||
return uri.equals(DOWNLOAD_URI);
|
||||
}, "history");
|
||||
|
||||
gDownloadHistory.addDownload(DOWNLOAD_URI, REFERRER_URI, Date.now() * 1000);
|
||||
await downloadPromise;
|
||||
|
||||
// Verify results for download uri.
|
||||
Assert.ok(!!PlacesTestUtils.isPageInDB(DOWNLOAD_URI));
|
||||
Assert.equal(visitId, referrerId);
|
||||
|
||||
await PlacesUtils.history.clear();
|
||||
});
|
||||
|
||||
add_test(function test_dh_addDownload_disabledHistory() {
|
||||
|
|
|
@ -23,59 +23,46 @@ const SCHEMES = {
|
|||
"javascript:": false,
|
||||
};
|
||||
|
||||
var gRunner;
|
||||
function run_test() {
|
||||
do_test_pending();
|
||||
gRunner = step();
|
||||
gRunner.next();
|
||||
}
|
||||
|
||||
function* step() {
|
||||
add_task(async function test_isURIVisited() {
|
||||
let history = Cc["@mozilla.org/browser/history;1"]
|
||||
.getService(Ci.mozIAsyncHistory);
|
||||
|
||||
function visitsPromise(uri) {
|
||||
return new Promise(resolve => {
|
||||
history.isURIVisited(uri, (receivedURI, visited) => {
|
||||
resolve([receivedURI, visited]);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
for (let scheme in SCHEMES) {
|
||||
info("Testing scheme " + scheme);
|
||||
for (let t in PlacesUtils.history.TRANSITIONS) {
|
||||
info("With transition " + t);
|
||||
let transition = PlacesUtils.history.TRANSITIONS[t];
|
||||
let aTransition = PlacesUtils.history.TRANSITIONS[t];
|
||||
|
||||
let uri = NetUtil.newURI(scheme + "mozilla.org/");
|
||||
let aURI = Services.io.newURI(scheme + "mozilla.org/");
|
||||
|
||||
history.isURIVisited(uri, function(aURI, aIsVisited) {
|
||||
Assert.ok(uri.equals(aURI));
|
||||
Assert.ok(!aIsVisited);
|
||||
let [receivedURI1, visited1] = await visitsPromise(aURI);
|
||||
Assert.ok(aURI.equals(receivedURI1));
|
||||
Assert.ok(!visited1);
|
||||
|
||||
let callback = {
|
||||
handleError() {},
|
||||
handleResult() {},
|
||||
handleCompletion() {
|
||||
info("Added visit to " + uri.spec);
|
||||
if (PlacesUtils.history.canAddURI(aURI)) {
|
||||
await PlacesTestUtils.addVisits([{
|
||||
uri: aURI,
|
||||
transition: aTransition
|
||||
}]);
|
||||
info("Added visit for " + aURI.spec);
|
||||
}
|
||||
|
||||
history.isURIVisited(uri, function(aURI2, aIsVisited2) {
|
||||
Assert.ok(uri.equals(aURI2));
|
||||
Assert.ok(SCHEMES[scheme] ? aIsVisited2 : !aIsVisited2);
|
||||
let [receivedURI2, visited2] = await visitsPromise(aURI);
|
||||
Assert.ok(aURI.equals(receivedURI2));
|
||||
Assert.equal(SCHEMES[scheme], visited2);
|
||||
|
||||
PlacesUtils.history.clear().then(function() {
|
||||
history.isURIVisited(uri, function(aURI3, aIsVisited3) {
|
||||
Assert.ok(uri.equals(aURI3));
|
||||
Assert.ok(!aIsVisited3);
|
||||
gRunner.next();
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
history.updatePlaces({ uri,
|
||||
visits: [ { transitionType: transition,
|
||||
visitDate: Date.now() * 1000
|
||||
} ]
|
||||
}, callback);
|
||||
});
|
||||
yield undefined;
|
||||
await PlacesUtils.history.clear();
|
||||
let [receivedURI3, visited3] = await visitsPromise(aURI);
|
||||
Assert.ok(aURI.equals(receivedURI3));
|
||||
Assert.ok(!visited3);
|
||||
}
|
||||
}
|
||||
|
||||
do_test_finished();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -74,7 +74,6 @@ toolkit.jar:
|
|||
content/global/bindings/datetimebox.css (widgets/datetimebox.css)
|
||||
* content/global/bindings/dialog.xml (widgets/dialog.xml)
|
||||
content/global/bindings/editor.xml (widgets/editor.xml)
|
||||
content/global/bindings/filefield.xml (widgets/filefield.xml)
|
||||
* content/global/bindings/findbar.xml (widgets/findbar.xml)
|
||||
content/global/bindings/general.xml (widgets/general.xml)
|
||||
content/global/bindings/groupbox.xml (widgets/groupbox.xml)
|
||||
|
|
|
@ -446,7 +446,7 @@ const Preferences = window.Preferences = (function() {
|
|||
case "menulist":
|
||||
return true;
|
||||
}
|
||||
return aElement.getAttribute("preference-editable") == "true";
|
||||
return false;
|
||||
}
|
||||
|
||||
updateElements() {
|
||||
|
|
|
@ -1,93 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
|
||||
<bindings id="filefieldBindings"
|
||||
xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<binding id="filefield" extends="chrome://global/content/bindings/general.xml#basetext">
|
||||
<resources>
|
||||
<stylesheet src="chrome://global/skin/filefield.css"/>
|
||||
</resources>
|
||||
<content>
|
||||
<xul:stringbundle anonid="bundle" src="chrome://global/locale/filefield.properties"/>
|
||||
<xul:hbox class="fileFieldContentBox" align="center" flex="1" xbl:inherits="disabled">
|
||||
<xul:image class="fileFieldIcon" xbl:inherits="src=image,disabled"/>
|
||||
<xul:textbox class="fileFieldLabel" xbl:inherits="value=label,disabled,accesskey,tabindex,aria-labelledby" flex="1" readonly="true"/>
|
||||
</xul:hbox>
|
||||
</content>
|
||||
<implementation implements="nsIDOMXULLabeledControlElement">
|
||||
<property name="label" onget="return this.getAttribute('label');">
|
||||
<setter>
|
||||
this.setAttribute("label", val);
|
||||
var elt = document.getAnonymousElementByAttribute(this, "class", "fileFieldLabel");
|
||||
return (elt.value = val);
|
||||
</setter>
|
||||
</property>
|
||||
|
||||
<field name="_file">null</field>
|
||||
<property name="file" onget="return this._file">
|
||||
<setter>
|
||||
<![CDATA[
|
||||
this._file = val;
|
||||
if (val) {
|
||||
this.image = this._getIconURLForFile(val);
|
||||
this.label = this._getDisplayNameForFile(val);
|
||||
} else {
|
||||
this.removeAttribute("image");
|
||||
var bundle = document.getAnonymousElementByAttribute(this, "anonid", "bundle");
|
||||
this.label = bundle.getString("downloadHelperNoneSelected");
|
||||
}
|
||||
return val;
|
||||
]]>
|
||||
</setter>
|
||||
</property>
|
||||
<method name="_getDisplayNameForFile">
|
||||
<parameter name="aFile"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (/Win/.test(navigator.platform)) {
|
||||
var lfw = aFile.QueryInterface(Ci.nsILocalFileWin);
|
||||
try {
|
||||
return lfw.getVersionInfoField("FileDescription");
|
||||
} catch (e) {
|
||||
// fall through to the filename
|
||||
}
|
||||
} else if (/Mac/.test(navigator.platform)) {
|
||||
var lfm = aFile.QueryInterface(Ci.nsILocalFileMac);
|
||||
try {
|
||||
return lfm.bundleDisplayName;
|
||||
} catch (e) {
|
||||
// fall through to the file name
|
||||
}
|
||||
}
|
||||
var ios = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Ci.nsIIOService);
|
||||
var url = ios.newFileURI(aFile).QueryInterface(Ci.nsIURL);
|
||||
return url.fileName;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="_getIconURLForFile">
|
||||
<parameter name="aFile"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (!aFile)
|
||||
return "";
|
||||
var ios = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Ci.nsIIOService);
|
||||
var fph = ios.getProtocolHandler("file")
|
||||
.QueryInterface(Ci.nsIFileProtocolHandler);
|
||||
var urlspec = fph.getURLSpecFromFile(aFile);
|
||||
return "moz-icon://" + urlspec + "?size=16";
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
</implementation>
|
||||
</binding>
|
||||
</bindings>
|
|
@ -962,12 +962,6 @@ findbar {
|
|||
-moz-binding: url("chrome://global/content/bindings/findbar.xml#findbar-textbox");
|
||||
}
|
||||
|
||||
|
||||
/*********** filefield ************/
|
||||
filefield {
|
||||
-moz-binding: url("chrome://global/content/bindings/filefield.xml#filefield");
|
||||
}
|
||||
|
||||
/*********** tabmodalprompt ************/
|
||||
tabmodalprompt {
|
||||
-moz-binding: url("chrome://global/content/tabprompts.xml#tabmodalprompt");
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#### Change Action
|
||||
|
||||
downloadHelperNoneSelected=None Selected
|
|
@ -40,7 +40,6 @@
|
|||
#endif
|
||||
locale/@AB_CD@/global/extensions.properties (%chrome/global/extensions.properties)
|
||||
locale/@AB_CD@/global/fallbackMenubar.properties (%chrome/global/fallbackMenubar.properties)
|
||||
locale/@AB_CD@/global/filefield.properties (%chrome/global/filefield.properties)
|
||||
locale/@AB_CD@/global/filepicker.properties (%chrome/global/filepicker.properties)
|
||||
#ifndef MOZ_FENNEC
|
||||
locale/@AB_CD@/global/findbar.dtd (%chrome/global/findbar.dtd)
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
/*
|
||||
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
.fileFieldIcon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.fileFieldIcon[disabled="true"] {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
filefield {
|
||||
margin: 4px;
|
||||
margin-inline-start: 27px;
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
|
||||
.fileFieldContentBox {
|
||||
margin: -3px;
|
||||
background-color: rgba(230, 230, 230, 0.6);
|
||||
color: -moz-DialogText;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
padding-inline-start: 5px;
|
||||
padding-inline-end: 3px;
|
||||
}
|
||||
|
||||
.fileFieldLabel {
|
||||
-moz-appearance: none;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
margin: 0 4px;
|
||||
}
|
|
@ -12,7 +12,6 @@ toolkit.jar:
|
|||
skin/classic/global/commonDialog.css
|
||||
skin/classic/global/dialog.css
|
||||
skin/classic/global/dropmarker.css
|
||||
skin/classic/global/filefield.css
|
||||
* skin/classic/global/findBar.css
|
||||
* skin/classic/global/global.css
|
||||
skin/classic/global/groupbox.css
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
*
|
||||
* It works like this:
|
||||
* For every combination of two different widgets (where widget is one of
|
||||
* label, radio, checkbox, button, textbox, menulist, menulist[editable="true"] or
|
||||
* filefield), there's a stack with two layers. The back layer in the stack is
|
||||
* label, radio, checkbox, button, textbox, menulist, menulist[editable="true"]),
|
||||
* there's a stack with two layers. The back layer in the stack is
|
||||
* just a vertically centered label with a bunch of underscores. This is the
|
||||
* baseline that the text on the widgets should hit.
|
||||
* On the foreground layer in the stack we've placed the pair of widgets we're
|
||||
|
@ -130,18 +130,13 @@ function createEditableMenulist(v) {
|
|||
list.setAttribute("editable", "true");
|
||||
return list;
|
||||
}
|
||||
function createFileField(v) {
|
||||
let field = elWithValue("filefield", v);
|
||||
field.setAttribute("image", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAChJREFUSMftzUEBAAAEBLCjf2dK8NsKrCaTT51nAoFAIBAIBAKB4MoCtVsCPjrGuiwAAAAASUVORK5CYII=");
|
||||
return field;
|
||||
}
|
||||
function loaded() {
|
||||
let template = document.getElementById("template");
|
||||
["regular", "small"].forEach(function(size) {
|
||||
let wrapper = document.querySelectorAll("#wrapper > ." + size)[0];
|
||||
allPairs([
|
||||
createLabel, createRadio, createCheckbox, createButton, createMenulist, createTextField,
|
||||
/* createEditableMenulist, createFileField, */ /* These don't inherit "color" properly */
|
||||
/* createEditableMenulist, */ /* These don't inherit "color" properly */
|
||||
]).forEach(function(elemList) {
|
||||
let newBox = template.cloneNode(true);
|
||||
newBox.className = "spacer";
|
||||
|
|
|
@ -746,45 +746,6 @@ xul|*.radio-label-box {
|
|||
-moz-user-select: none;
|
||||
}
|
||||
|
||||
/* File fields */
|
||||
|
||||
xul|filefield {
|
||||
-moz-appearance: none;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
xul|*.fileFieldContentBox {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
xul|*.fileFieldIcon {
|
||||
margin-inline-start: 10px;
|
||||
margin-inline-end: 0;
|
||||
}
|
||||
|
||||
xul|*.fileFieldLabel {
|
||||
margin-inline-start: -26px;
|
||||
padding-inline-start: 36px;
|
||||
}
|
||||
|
||||
xul|*.fileFieldLabel:-moz-locale-dir(rtl),
|
||||
xul|filefield + xul|button:-moz-locale-dir(ltr) {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
|
||||
xul|*.fileFieldLabel:-moz-locale-dir(ltr),
|
||||
xul|filefield + xul|button:-moz-locale-dir(rtl) {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
|
||||
xul|filefield + xul|button {
|
||||
border-inline-start: none;
|
||||
}
|
||||
|
||||
/* List boxes */
|
||||
|
||||
html|select[size][multiple],
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include jar.inc.mn
|
||||
|
||||
skin/classic/global/dialog.css (../../windows/global/dialog.css)
|
||||
skin/classic/global/filefield.css (../../windows/global/filefield.css)
|
||||
skin/classic/global/progressmeter.css (../../windows/global/progressmeter.css)
|
||||
skin/classic/global/resizer.css (../../windows/global/resizer.css)
|
||||
skin/classic/global/richlistbox.css (../../windows/global/richlistbox.css)
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
/*
|
||||
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
/* File Field Widget */
|
||||
filefield {
|
||||
margin: 2px 4px;
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
|
||||
.fileFieldContentBox {
|
||||
background-color: -moz-Dialog;
|
||||
}
|
||||
|
||||
.fileFieldIcon[disabled="true"] {
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
.fileFieldIcon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-top: 1px;
|
||||
margin-bottom: 1px;
|
||||
margin-inline-start: 1px;
|
||||
margin-inline-end: 4px;
|
||||
}
|
||||
|
||||
.fileFieldLabel {
|
||||
-moz-appearance: none;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
margin: 0px;
|
||||
}
|
Загрузка…
Ссылка в новой задаче