зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-c to graphics
MozReview-Commit-ID: 9XwZUWIhGir
This commit is contained in:
Коммит
7259e787f4
|
@ -1142,9 +1142,8 @@ nsAccessibilityService::CreateAccessible(nsINode* aNode,
|
|||
// accessible for it.
|
||||
if (!newAcc && aContext->IsXULTabpanels() &&
|
||||
content->GetParent() == aContext->GetContent()) {
|
||||
nsIAtom* frameType = frame->GetType();
|
||||
if (frameType == nsGkAtoms::boxFrame ||
|
||||
frameType == nsGkAtoms::scrollFrame) {
|
||||
FrameType frameType = frame->Type();
|
||||
if (frameType == FrameType::Box || frameType == FrameType::Scroll) {
|
||||
newAcc = new XULTabpanelAccessible(content, document);
|
||||
}
|
||||
}
|
||||
|
@ -1615,12 +1614,12 @@ nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame,
|
|||
if (table) {
|
||||
nsIContent* parentContent = aContent->GetParent();
|
||||
nsIFrame* parentFrame = parentContent->GetPrimaryFrame();
|
||||
if (parentFrame->GetType() != nsGkAtoms::tableWrapperFrame) {
|
||||
if (!parentFrame->IsTableWrapperFrame()) {
|
||||
parentContent = parentContent->GetParent();
|
||||
parentFrame = parentContent->GetPrimaryFrame();
|
||||
}
|
||||
|
||||
if (parentFrame->GetType() == nsGkAtoms::tableWrapperFrame &&
|
||||
if (parentFrame->IsTableWrapperFrame() &&
|
||||
table->GetContent() == parentContent) {
|
||||
newAcc = new HTMLTableRowAccessible(aContent, document);
|
||||
}
|
||||
|
|
|
@ -385,7 +385,7 @@ Accessible::VisibilityState()
|
|||
// marked invisible.
|
||||
// XXX Can we just remove this check? Why do we need to mark empty
|
||||
// text invisible?
|
||||
if (frame->GetType() == nsGkAtoms::textFrame &&
|
||||
if (frame->IsTextFrame() &&
|
||||
!(frame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) &&
|
||||
frame->GetRect().IsEmpty()) {
|
||||
nsIFrame::RenderedText text = frame->GetRenderedText(0,
|
||||
|
@ -636,7 +636,8 @@ Accessible::RelativeBounds(nsIFrame** aBoundingFrame) const
|
|||
// Find a canvas frame the found hit region is relative to.
|
||||
nsIFrame* canvasFrame = frame->GetParent();
|
||||
if (canvasFrame) {
|
||||
canvasFrame = nsLayoutUtils::GetClosestFrameOfType(canvasFrame, nsGkAtoms::HTMLCanvasFrame);
|
||||
canvasFrame = nsLayoutUtils::GetClosestFrameOfType(
|
||||
canvasFrame, FrameType::HTMLCanvas);
|
||||
}
|
||||
|
||||
// make the canvas the bounding frame
|
||||
|
@ -1888,7 +1889,7 @@ Accessible::AppendTextTo(nsAString& aText, uint32_t aStartOffset,
|
|||
NS_ASSERTION(mParent,
|
||||
"Called on accessible unbound from tree. Result can be wrong.");
|
||||
|
||||
if (frame->GetType() == nsGkAtoms::brFrame) {
|
||||
if (frame->IsBrFrame()) {
|
||||
aText += kForcedNewLineChar;
|
||||
} else if (mParent && nsAccUtils::MustPrune(mParent)) {
|
||||
// Expose the embedded object accessible as imaginary embedded object
|
||||
|
|
|
@ -1481,6 +1481,9 @@ DocAccessible::DoInitialUpdate()
|
|||
if (RefPtr<dom::TabChild> tabChild = dom::TabChild::GetFrom(docShell)) {
|
||||
DocAccessibleChild* ipcDoc = new DocAccessibleChild(this, tabChild);
|
||||
SetIPCDoc(ipcDoc);
|
||||
if (IsRoot()) {
|
||||
tabChild->SetTopLevelDocAccessibleChild(ipcDoc);
|
||||
}
|
||||
|
||||
#if defined(XP_WIN)
|
||||
IAccessibleHolder holder(CreateHolderFromAccessible(this));
|
||||
|
|
|
@ -65,7 +65,7 @@ HyperTextAccessible::NativeRole()
|
|||
return r;
|
||||
|
||||
nsIFrame* frame = GetFrame();
|
||||
if (frame && frame->GetType() == nsGkAtoms::inlineFrame)
|
||||
if (frame && frame->IsInlineFrame())
|
||||
return roles::TEXT;
|
||||
|
||||
return roles::TEXT_CONTAINER;
|
||||
|
@ -96,7 +96,7 @@ HyperTextAccessible::GetBoundsInFrame(nsIFrame* aFrame,
|
|||
uint32_t aEndRenderedOffset)
|
||||
{
|
||||
nsPresContext* presContext = mDoc->PresContext();
|
||||
if (aFrame->GetType() != nsGkAtoms::textFrame) {
|
||||
if (!aFrame->IsTextFrame()) {
|
||||
return aFrame->GetScreenRectInAppUnits().
|
||||
ToNearestPixels(presContext->AppUnitsPerDevPixel());
|
||||
}
|
||||
|
@ -539,7 +539,7 @@ HyperTextAccessible::FindOffset(uint32_t aOffset, nsDirection aDirection,
|
|||
|
||||
int32_t innerContentOffset = innerOffset;
|
||||
if (child->IsTextLeaf()) {
|
||||
NS_ASSERTION(childFrame->GetType() == nsGkAtoms::textFrame, "Wrong frame!");
|
||||
NS_ASSERTION(childFrame->IsTextFrame(), "Wrong frame!");
|
||||
RenderedToContentOffset(childFrame, innerOffset, &innerContentOffset);
|
||||
}
|
||||
|
||||
|
@ -917,7 +917,7 @@ HyperTextAccessible::TextAttributes(bool aIncludeDefAttrs, int32_t aOffset,
|
|||
|
||||
// Compute spelling attributes on text accessible only.
|
||||
nsIFrame *offsetFrame = accAtOffset->GetFrame();
|
||||
if (offsetFrame && offsetFrame->GetType() == nsGkAtoms::textFrame) {
|
||||
if (offsetFrame && offsetFrame->IsTextFrame()) {
|
||||
int32_t nodeOffset = 0;
|
||||
RenderedToContentOffset(offsetFrame, offsetInAcc, &nodeOffset);
|
||||
|
||||
|
@ -1109,7 +1109,7 @@ HyperTextAccessible::NativeAttributes()
|
|||
// 'formatting' attribute is deprecated, 'display' attribute should be
|
||||
// instead.
|
||||
nsIFrame *frame = GetFrame();
|
||||
if (frame && frame->GetType() == nsGkAtoms::blockFrame) {
|
||||
if (frame && frame->IsBlockFrame()) {
|
||||
nsAutoString unused;
|
||||
attributes->SetStringProperty(NS_LITERAL_CSTRING("formatting"),
|
||||
NS_LITERAL_STRING("block"), unused);
|
||||
|
@ -1223,7 +1223,7 @@ HyperTextAccessible::OffsetAtPoint(int32_t aX, int32_t aY, uint32_t aCoordType)
|
|||
nsSize frameSize = frame->GetSize();
|
||||
if (pointInFrame.x < frameSize.width && pointInFrame.y < frameSize.height) {
|
||||
// Finished
|
||||
if (frame->GetType() == nsGkAtoms::textFrame) {
|
||||
if (frame->IsTextFrame()) {
|
||||
nsIFrame::ContentOffsets contentOffsets =
|
||||
frame->GetContentOffsetsFromPointExternal(pointInFrame, nsIFrame::IGNORE_SELECTION_STYLE);
|
||||
if (contentOffsets.IsNull() || contentOffsets.content != content) {
|
||||
|
@ -1971,8 +1971,7 @@ HyperTextAccessible::ContentToRenderedOffset(nsIFrame* aFrame, int32_t aContentO
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_ASSERTION(aFrame->GetType() == nsGkAtoms::textFrame,
|
||||
"Need text frame for offset conversion");
|
||||
NS_ASSERTION(aFrame->IsTextFrame(), "Need text frame for offset conversion");
|
||||
NS_ASSERTION(aFrame->GetPrevContinuation() == nullptr,
|
||||
"Call on primary frame only");
|
||||
|
||||
|
@ -1996,8 +1995,7 @@ HyperTextAccessible::RenderedToContentOffset(nsIFrame* aFrame, uint32_t aRendere
|
|||
*aContentOffset = 0;
|
||||
NS_ENSURE_TRUE(aFrame, NS_ERROR_FAILURE);
|
||||
|
||||
NS_ASSERTION(aFrame->GetType() == nsGkAtoms::textFrame,
|
||||
"Need text frame for offset conversion");
|
||||
NS_ASSERTION(aFrame->IsTextFrame(), "Need text frame for offset conversion");
|
||||
NS_ASSERTION(aFrame->GetPrevContinuation() == nullptr,
|
||||
"Call on primary frame only");
|
||||
|
||||
|
@ -2100,7 +2098,7 @@ HyperTextAccessible::GetDOMPointByFrameOffset(nsIFrame* aFrame, int32_t aOffset,
|
|||
aPoint->idx = parent->IndexOf(content) + 1;
|
||||
aPoint->node = parent;
|
||||
|
||||
} else if (aFrame->GetType() == nsGkAtoms::textFrame) {
|
||||
} else if (aFrame->IsTextFrame()) {
|
||||
nsIContent* content = aFrame->GetContent();
|
||||
NS_ENSURE_STATE(content);
|
||||
|
||||
|
|
|
@ -102,18 +102,8 @@ DocAccessibleChild::PushDeferredEvent(UniquePtr<DeferredEvent> aEvent)
|
|||
return;
|
||||
}
|
||||
|
||||
nsTArray<PDocAccessibleChild*> ipcDocAccs;
|
||||
tabChild->ManagedPDocAccessibleChild(ipcDocAccs);
|
||||
|
||||
// Look for the top-level DocAccessibleChild - there will only be one
|
||||
// per TabChild.
|
||||
for (uint32_t i = 0, l = ipcDocAccs.Length(); i < l; ++i) {
|
||||
auto ipcDocAcc = static_cast<DocAccessibleChild*>(ipcDocAccs[i]);
|
||||
if (ipcDocAcc->mDoc && ipcDocAcc->mDoc->IsRoot()) {
|
||||
topLevelIPCDoc = ipcDocAcc;
|
||||
break;
|
||||
}
|
||||
}
|
||||
topLevelIPCDoc =
|
||||
static_cast<DocAccessibleChild*>(tabChild->GetTopLevelDocAccessibleChild());
|
||||
}
|
||||
|
||||
if (topLevelIPCDoc) {
|
||||
|
|
|
@ -3488,23 +3488,41 @@ function getPEMString(cert) {
|
|||
|
||||
var PrintPreviewListener = {
|
||||
_printPreviewTab: null,
|
||||
_simplifiedPrintPreviewTab: null,
|
||||
_tabBeforePrintPreview: null,
|
||||
_simplifyPageTab: null,
|
||||
_lastRequestedPrintPreviewTab: null,
|
||||
|
||||
_createPPBrowser() {
|
||||
if (!this._tabBeforePrintPreview) {
|
||||
this._tabBeforePrintPreview = gBrowser.selectedTab;
|
||||
}
|
||||
let browser = this._tabBeforePrintPreview.linkedBrowser;
|
||||
let preferredRemoteType = browser.remoteType;
|
||||
return gBrowser.loadOneTab("about:printpreview", {
|
||||
inBackground: true,
|
||||
preferredRemoteType,
|
||||
sameProcessAsFrameLoader: browser.frameLoader
|
||||
});
|
||||
},
|
||||
getPrintPreviewBrowser() {
|
||||
if (!this._printPreviewTab) {
|
||||
let browser = gBrowser.selectedBrowser;
|
||||
let preferredRemoteType = browser.remoteType;
|
||||
this._tabBeforePrintPreview = gBrowser.selectedTab;
|
||||
this._printPreviewTab = gBrowser.loadOneTab("about:printpreview", {
|
||||
inBackground: false,
|
||||
preferredRemoteType,
|
||||
sameProcessAsFrameLoader: browser.frameLoader
|
||||
});
|
||||
gBrowser.selectedTab = this._printPreviewTab;
|
||||
this._printPreviewTab = this._createPPBrowser();
|
||||
}
|
||||
gBrowser._allowTabChange = true;
|
||||
this._lastRequestedPrintPreviewTab = gBrowser.selectedTab = this._printPreviewTab;
|
||||
gBrowser._allowTabChange = false;
|
||||
return gBrowser.getBrowserForTab(this._printPreviewTab);
|
||||
},
|
||||
getSimplifiedPrintPreviewBrowser() {
|
||||
if (!this._simplifiedPrintPreviewTab) {
|
||||
this._simplifiedPrintPreviewTab = this._createPPBrowser();
|
||||
}
|
||||
gBrowser._allowTabChange = true;
|
||||
this._lastRequestedPrintPreviewTab = gBrowser.selectedTab = this._simplifiedPrintPreviewTab;
|
||||
gBrowser._allowTabChange = false;
|
||||
return gBrowser.getBrowserForTab(this._simplifiedPrintPreviewTab);
|
||||
},
|
||||
createSimplifiedBrowser() {
|
||||
let browser = this._tabBeforePrintPreview.linkedBrowser;
|
||||
this._simplifyPageTab = gBrowser.loadOneTab("about:printpreview", {
|
||||
|
@ -3527,8 +3545,8 @@ var PrintPreviewListener = {
|
|||
onEnter() {
|
||||
// We might have accidentally switched tabs since the user invoked print
|
||||
// preview
|
||||
if (gBrowser.selectedTab != this._printPreviewTab) {
|
||||
gBrowser.selectedTab = this._printPreviewTab;
|
||||
if (gBrowser.selectedTab != this._lastRequestedPrintPreviewTab) {
|
||||
gBrowser.selectedTab = this._lastRequestedPrintPreviewTab;
|
||||
}
|
||||
gInPrintPreviewMode = true;
|
||||
this._toggleAffectedChrome();
|
||||
|
@ -3538,13 +3556,15 @@ var PrintPreviewListener = {
|
|||
this._tabBeforePrintPreview = null;
|
||||
gInPrintPreviewMode = false;
|
||||
this._toggleAffectedChrome();
|
||||
if (this._simplifyPageTab) {
|
||||
gBrowser.removeTab(this._simplifyPageTab);
|
||||
this._simplifyPageTab = null;
|
||||
let tabsToRemove = ["_simplifyPageTab", "_printPreviewTab", "_simplifiedPrintPreviewTab"];
|
||||
for (let tabProp of tabsToRemove) {
|
||||
if (this[tabProp]) {
|
||||
gBrowser.removeTab(this[tabProp]);
|
||||
this[tabProp] = null;
|
||||
}
|
||||
}
|
||||
gBrowser.removeTab(this._printPreviewTab);
|
||||
gBrowser.deactivatePrintPreviewBrowsers();
|
||||
this._printPreviewTab = null;
|
||||
this._lastRequestedPrintPreviewTab = null;
|
||||
},
|
||||
_toggleAffectedChrome() {
|
||||
gNavToolbox.collapsed = gInPrintPreviewMode;
|
||||
|
@ -4282,6 +4302,8 @@ function updateEditUIVisibility() {
|
|||
let contextMenuPopupState = document.getElementById("contentAreaContextMenu").state;
|
||||
let placesContextMenuPopupState = document.getElementById("placesContext").state;
|
||||
|
||||
let oldVisible = gEditUIVisible;
|
||||
|
||||
// The UI is visible if the Edit menu is opening or open, if the context menu
|
||||
// is open, or if the toolbar has been customized to include the Cut, Copy,
|
||||
// or Paste toolbar buttons.
|
||||
|
@ -4290,18 +4312,35 @@ function updateEditUIVisibility() {
|
|||
contextMenuPopupState == "showing" ||
|
||||
contextMenuPopupState == "open" ||
|
||||
placesContextMenuPopupState == "showing" ||
|
||||
placesContextMenuPopupState == "open" ||
|
||||
document.getElementById("edit-controls") ? true : false;
|
||||
placesContextMenuPopupState == "open";
|
||||
if (!gEditUIVisible) {
|
||||
// Now check the edit-controls toolbar buttons.
|
||||
let placement = CustomizableUI.getPlacementOfWidget("edit-controls");
|
||||
let areaType = placement ? CustomizableUI.getAreaType(placement.area) : "";
|
||||
if (areaType == CustomizableUI.TYPE_MENU_PANEL) {
|
||||
let panelUIMenuPopupState = document.getElementById("PanelUI-popup").state;
|
||||
if (panelUIMenuPopupState == "showing" || panelUIMenuPopupState == "open") {
|
||||
gEditUIVisible = true;
|
||||
}
|
||||
} else if (areaType == CustomizableUI.TYPE_TOOLBAR) {
|
||||
// The edit controls are on a toolbar, so they are visible.
|
||||
gEditUIVisible = true;
|
||||
}
|
||||
}
|
||||
|
||||
// No need to update commands if the edit UI visibility has not changed.
|
||||
if (gEditUIVisible == oldVisible) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If UI is visible, update the edit commands' enabled state to reflect
|
||||
// whether or not they are actually enabled for the current focus/selection.
|
||||
if (gEditUIVisible)
|
||||
if (gEditUIVisible) {
|
||||
goUpdateGlobalEditMenuItems();
|
||||
|
||||
// Otherwise, enable all commands, so that keyboard shortcuts still work,
|
||||
// then lazily determine their actual enabled state when the user presses
|
||||
// a keyboard shortcut.
|
||||
else {
|
||||
} else {
|
||||
// Otherwise, enable all commands, so that keyboard shortcuts still work,
|
||||
// then lazily determine their actual enabled state when the user presses
|
||||
// a keyboard shortcut.
|
||||
goSetCommandEnabled("cmd_undo", true);
|
||||
goSetCommandEnabled("cmd_redo", true);
|
||||
goSetCommandEnabled("cmd_cut", true);
|
||||
|
@ -6429,6 +6468,11 @@ function CanCloseWindow() {
|
|||
let timedOutProcesses = new WeakSet();
|
||||
|
||||
for (let browser of gBrowser.browsers) {
|
||||
// Don't instantiate lazy browsers.
|
||||
if (!browser.isConnected) {
|
||||
continue;
|
||||
}
|
||||
|
||||
let pmm = browser.messageManager.processMessageManager;
|
||||
|
||||
if (timedOutProcesses.has(pmm)) {
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
<?xml-stylesheet href="chrome://browser/content/browser.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/content/places/places.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/content/usercontext/usercontext.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://devtools/skin/devtools-browser.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/controlcenter/panel.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/customizableui/panelUI.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
|
||||
|
|
|
@ -1065,6 +1065,8 @@
|
|||
return;
|
||||
|
||||
if (!aForceUpdate) {
|
||||
document.commandDispatcher.lock();
|
||||
|
||||
TelemetryStopwatch.start("FX_TAB_SWITCH_UPDATE_MS");
|
||||
if (!gMultiProcessBrowser) {
|
||||
// old way of measuring tab paint which is not valid with e10s.
|
||||
|
@ -1274,6 +1276,8 @@
|
|||
this.tabContainer._setPositionalAttributes();
|
||||
|
||||
if (!gMultiProcessBrowser) {
|
||||
document.commandDispatcher.unlock();
|
||||
|
||||
let event = new CustomEvent("TabSwitchDone", {
|
||||
bubbles: true,
|
||||
cancelable: true
|
||||
|
@ -3401,7 +3405,7 @@
|
|||
</getter>
|
||||
<setter>
|
||||
<![CDATA[
|
||||
if (gNavToolbox.collapsed) {
|
||||
if (gNavToolbox.collapsed && !this._allowTabChange) {
|
||||
return this.mTabBox.selectedTab;
|
||||
}
|
||||
// Update the tab
|
||||
|
@ -3981,6 +3985,8 @@
|
|||
fromBrowser.removeAttribute("primary");
|
||||
}
|
||||
|
||||
document.commandDispatcher.unlock();
|
||||
|
||||
let event = new CustomEvent("TabSwitchDone", {
|
||||
bubbles: true,
|
||||
cancelable: true
|
||||
|
|
|
@ -16,4 +16,5 @@ skip-if = os == 'mac'
|
|||
skip-if = !e10s # Pref and test only relevant for e10s.
|
||||
[browser_opened_file_tab_navigated_to_web.js]
|
||||
[browser_reload_deleted_file.js]
|
||||
[browser_tabswitch_updatecommands.js]
|
||||
[browser_viewsource_of_data_URI_in_file_process.js]
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
// This test ensures that only one command update happens when switching tabs.
|
||||
|
||||
"use strict";
|
||||
|
||||
add_task(function* () {
|
||||
const uri = "data:text/html,<body><input>";
|
||||
let tab1 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, uri);
|
||||
let tab2 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, uri);
|
||||
|
||||
let updates = 0;
|
||||
function countUpdates(event) { updates++; }
|
||||
let updater = document.getElementById("editMenuCommandSetAll");
|
||||
updater.addEventListener("commandupdate", countUpdates, true);
|
||||
yield BrowserTestUtils.switchTab(gBrowser, tab1);
|
||||
|
||||
is(updates, 1, "only one command update per tab switch");
|
||||
|
||||
updater.removeEventListener("commandupdate", countUpdates, true);
|
||||
yield BrowserTestUtils.removeTab(tab1);
|
||||
yield BrowserTestUtils.removeTab(tab2);
|
||||
});
|
|
@ -1,3 +1,2 @@
|
|||
[DEFAULT]
|
||||
[browser_toolbariconcolor_restyles.js]
|
||||
skip-if = (os == "mac" || os == "win") && debug # Bug 1358356
|
||||
|
|
|
@ -24,12 +24,12 @@ add_task(function* test_toolbar_element_restyles_on_activation() {
|
|||
restyles.win2.initial = utils2.elementsRestyled;
|
||||
|
||||
// switch back to 1st window, and snapshot elementsStyled
|
||||
win1.focus();
|
||||
Services.focus.activeWindow = win1;
|
||||
restyles.win1.activate = utils1.elementsRestyled;
|
||||
restyles.win2.deactivate = utils2.elementsRestyled;
|
||||
|
||||
// switch back to 2nd window, and snapshot elementsStyled
|
||||
win2.focus();
|
||||
Services.focus.activeWindow = win2;
|
||||
restyles.win2.activate = utils2.elementsRestyled;
|
||||
restyles.win1.deactivate = utils1.elementsRestyled;
|
||||
|
||||
|
|
|
@ -520,7 +520,12 @@ const CustomizableWidgets = [
|
|||
// respects different buttons (eg, to open in a new tab).
|
||||
item.addEventListener("click", e => {
|
||||
doc.defaultView.openUILink(tabInfo.url, e);
|
||||
CustomizableUI.hidePanelForNode(item);
|
||||
if (doc.defaultView.whereToOpenLink(e) != "current") {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
} else {
|
||||
CustomizableUI.hidePanelForNode(item);
|
||||
}
|
||||
BrowserUITelemetry.countSyncedTabEvent("open", "toolbarbutton-subview");
|
||||
});
|
||||
return item;
|
||||
|
|
|
@ -160,11 +160,6 @@ const PanelUI = {
|
|||
return;
|
||||
}
|
||||
|
||||
let editControlPlacement = CustomizableUI.getPlacementOfWidget("edit-controls");
|
||||
if (editControlPlacement && editControlPlacement.area == CustomizableUI.AREA_PANEL) {
|
||||
updateEditUIVisibility();
|
||||
}
|
||||
|
||||
let personalBookmarksPlacement = CustomizableUI.getPlacementOfWidget("personal-bookmarks");
|
||||
if (personalBookmarksPlacement &&
|
||||
personalBookmarksPlacement.area == CustomizableUI.AREA_PANEL) {
|
||||
|
@ -292,10 +287,14 @@ const PanelUI = {
|
|||
switch (aEvent.type) {
|
||||
case "popupshowing":
|
||||
this._adjustLabelsForAutoHyphens();
|
||||
updateEditUIVisibility();
|
||||
// Fall through
|
||||
case "popupshown":
|
||||
// Fall through
|
||||
case "popuphiding":
|
||||
if (aEvent.type == "popuphiding") {
|
||||
updateEditUIVisibility();
|
||||
}
|
||||
// Fall through
|
||||
case "popuphidden":
|
||||
this._updateNotifications();
|
||||
|
|
|
@ -155,3 +155,5 @@ skip-if = os == "mac"
|
|||
[browser_switch_to_customize_mode.js]
|
||||
[browser_synced_tabs_menu.js]
|
||||
[browser_check_tooltips_in_navbar.js]
|
||||
[browser_editcontrols_update.js]
|
||||
subsuite = clipboard
|
||||
|
|
|
@ -0,0 +1,162 @@
|
|||
// This test checks that the edit command enabled state (cut/paste) is updated
|
||||
// properly when the edit controls are on the toolbar, popup and not present.
|
||||
// It also verifies that the performance optimiation implemented by
|
||||
// updateEditUIVisibility in browser.js is applied.
|
||||
|
||||
let isMac = navigator.platform.indexOf("Mac") == 0;
|
||||
|
||||
function checkState(allowCut, desc, testWindow = window) {
|
||||
is(testWindow.document.getElementById("cmd_cut").getAttribute("disabled") == "true", !allowCut, desc + " - cut");
|
||||
is(testWindow.document.getElementById("cmd_paste").getAttribute("disabled") == "true", false, desc + " - paste");
|
||||
}
|
||||
|
||||
// Add a special controller to the urlbar and browser to listen in on when
|
||||
// commands are being updated. Return a promise that resolves when 'count'
|
||||
// updates have occurred.
|
||||
function expectCommandUpdate(count, testWindow = window) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let overrideController = {
|
||||
supportsCommand(cmd) { return cmd == "cmd_delete"; },
|
||||
isCommandEnabled(cmd) {
|
||||
if (!count) {
|
||||
ok(false, "unexpected update");
|
||||
reject();
|
||||
}
|
||||
|
||||
if (!--count) {
|
||||
testWindow.gURLBar.controllers.removeControllerAt(0, overrideController);
|
||||
testWindow.gBrowser.selectedBrowser.controllers.removeControllerAt(0, overrideController);
|
||||
resolve(true);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (!count) {
|
||||
SimpleTest.executeSoon(() => {
|
||||
testWindow.gURLBar.controllers.removeControllerAt(0, overrideController);
|
||||
testWindow.gBrowser.selectedBrowser.controllers.removeControllerAt(0, overrideController);
|
||||
resolve(false);
|
||||
});
|
||||
}
|
||||
|
||||
testWindow.gURLBar.controllers.insertControllerAt(0, overrideController);
|
||||
testWindow.gBrowser.selectedBrowser.controllers.insertControllerAt(0, overrideController);
|
||||
});
|
||||
}
|
||||
|
||||
add_task(function* test_init() {
|
||||
// Put something on the clipboard to verify that the paste button is properly enabled during the test.
|
||||
let clipboardHelper = Cc["@mozilla.org/widget/clipboardhelper;1"].getService(Ci.nsIClipboardHelper);
|
||||
yield new Promise(resolve => {
|
||||
SimpleTest.waitForClipboard("Sample", function() { clipboardHelper.copyString("Sample"); }, resolve);
|
||||
});
|
||||
|
||||
// Open and close the panel first so that it is fully initialized.
|
||||
yield PanelUI.show();
|
||||
let hiddenPromise = promisePanelHidden(window);
|
||||
PanelUI.hide();
|
||||
yield hiddenPromise;
|
||||
});
|
||||
|
||||
// Test updating when the panel is open with the edit-controls on the panel.
|
||||
// Updates should occur.
|
||||
add_task(function* test_panelui_opened() {
|
||||
gURLBar.focus();
|
||||
gURLBar.value = "test";
|
||||
|
||||
yield PanelUI.show();
|
||||
|
||||
checkState(false, "Update when edit-controls is on panel and visible");
|
||||
|
||||
let overridePromise = expectCommandUpdate(1);
|
||||
gURLBar.select();
|
||||
yield overridePromise;
|
||||
|
||||
checkState(true, "Update when edit-controls is on panel and selection changed");
|
||||
|
||||
overridePromise = expectCommandUpdate(0);
|
||||
let hiddenPromise = promisePanelHidden(window);
|
||||
PanelUI.hide();
|
||||
yield hiddenPromise;
|
||||
yield overridePromise;
|
||||
|
||||
// Check that updates do not occur after the panel has been closed.
|
||||
checkState(true, "Update when edit-controls is on panel and hidden");
|
||||
|
||||
// Mac will update the enabled st1ate even when the panel is closed so that
|
||||
// main menubar shortcuts will work properly.
|
||||
overridePromise = expectCommandUpdate(isMac ? 1 : 0);
|
||||
gURLBar.select();
|
||||
yield overridePromise;
|
||||
checkState(true, "Update when edit-controls is on panel, hidden and selection changed");
|
||||
});
|
||||
|
||||
// Test updating when the edit-controls are moved to the toolbar.
|
||||
add_task(function* test_panelui_customize_to_toolbar() {
|
||||
yield startCustomizing();
|
||||
let navbar = document.getElementById("nav-bar").customizationTarget;
|
||||
simulateItemDrag(document.getElementById("edit-controls"), navbar);
|
||||
yield endCustomizing();
|
||||
|
||||
// updateEditUIVisibility should be called when customization ends but isn't. See bug 1359790.
|
||||
updateEditUIVisibility();
|
||||
|
||||
let overridePromise = expectCommandUpdate(1);
|
||||
gURLBar.select();
|
||||
gURLBar.focus();
|
||||
gURLBar.value = "other";
|
||||
yield overridePromise;
|
||||
checkState(false, "Update when edit-controls on toolbar and focused");
|
||||
|
||||
overridePromise = expectCommandUpdate(1);
|
||||
gURLBar.select();
|
||||
yield overridePromise;
|
||||
checkState(true, "Update when edit-controls on toolbar and selection changed");
|
||||
});
|
||||
|
||||
// Test updating when the edit-controls are moved to the palette.
|
||||
add_task(function* test_panelui_customize_to_palette() {
|
||||
yield startCustomizing();
|
||||
let palette = document.getElementById("customization-palette");
|
||||
simulateItemDrag(document.getElementById("edit-controls"), palette);
|
||||
yield endCustomizing();
|
||||
|
||||
// updateEditUIVisibility should be called when customization ends but isn't. See bug 1359790.
|
||||
updateEditUIVisibility();
|
||||
|
||||
let overridePromise = expectCommandUpdate(isMac ? 1 : 0);
|
||||
gURLBar.focus();
|
||||
gURLBar.value = "other";
|
||||
gURLBar.select();
|
||||
yield overridePromise;
|
||||
|
||||
// If the UI isn't found, the command is set to be enabled.
|
||||
checkState(true, "Update when edit-controls is on palette, hidden and selection changed");
|
||||
});
|
||||
|
||||
add_task(function* finish() {
|
||||
yield resetCustomization();
|
||||
});
|
||||
|
||||
// Test updating in the initial state when the edit-controls are on the panel but
|
||||
// have not yet been created. This needs to be done in a new window to ensure that
|
||||
// other tests haven't opened the panel.
|
||||
add_task(function* test_initial_state() {
|
||||
let testWindow = yield BrowserTestUtils.openNewBrowserWindow();
|
||||
yield SimpleTest.promiseFocus(testWindow);
|
||||
|
||||
let overridePromise = expectCommandUpdate(isMac, testWindow);
|
||||
|
||||
testWindow.gURLBar.focus();
|
||||
testWindow.gURLBar.value = "test";
|
||||
|
||||
yield overridePromise;
|
||||
|
||||
// Commands won't update when no edit UI is present. They default to being
|
||||
// enabled so that keyboard shortcuts will work. The real enabled state will
|
||||
// be checked when shortcut is pressed.
|
||||
checkState(!isMac, "No update when edit-controls is on panel and not visible", testWindow);
|
||||
|
||||
yield BrowserTestUtils.closeWindow(testWindow);
|
||||
yield SimpleTest.promiseFocus(window);
|
||||
});
|
|
@ -11,5 +11,6 @@ skip-if = os == "linux" # Bug 952422
|
|||
[browser_indicatorDrop.js]
|
||||
[browser_libraryDrop.js]
|
||||
[browser_downloads_panel_block.js]
|
||||
skip-if = true # Bug 1352792
|
||||
[browser_downloads_panel_footer.js]
|
||||
[browser_downloads_panel_height.js]
|
||||
|
|
|
@ -22,6 +22,9 @@ with Files("tests/unit/test_distribution.js"):
|
|||
with Files("safebrowsing/**"):
|
||||
BUG_COMPONENT = ("Toolkit", "Safe Browsing")
|
||||
|
||||
with Files('controlcenter/**'):
|
||||
BUG_COMPONENT = ('Firefox', 'General')
|
||||
|
||||
|
||||
DIRS += [
|
||||
'about',
|
||||
|
@ -77,9 +80,3 @@ BROWSER_CHROME_MANIFESTS += [
|
|||
XPCSHELL_TESTS_MANIFESTS += [
|
||||
'tests/unit/xpcshell.ini'
|
||||
]
|
||||
|
||||
with Files('safebrowsing/*'):
|
||||
BUG_COMPONENT = ('Toolkit', 'Phishing Protection')
|
||||
|
||||
with Files('controlcenter/**'):
|
||||
BUG_COMPONENT = ('Firefox', 'General')
|
||||
|
|
|
@ -4,16 +4,14 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
/* globals XPCOMUtils, NewTabPrefsProvider, Services */
|
||||
/* globals XPCOMUtils, Preferences, Services */
|
||||
"use strict";
|
||||
|
||||
const {utils: Cu, interfaces: Ci} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "NewTabPrefsProvider",
|
||||
"resource:///modules/NewTabPrefsProvider.jsm");
|
||||
Cu.import("resource://gre/modules/Preferences.jsm");
|
||||
|
||||
const LOCAL_NEWTAB_URL = "chrome://browser/content/newtab/newTab.xhtml";
|
||||
|
||||
|
@ -25,7 +23,7 @@ const ABOUT_URL = "about:newtab";
|
|||
const PREF_ACTIVITY_STREAM_ENABLED = "browser.newtabpage.activity-stream.enabled";
|
||||
|
||||
function AboutNewTabService() {
|
||||
NewTabPrefsProvider.prefs.on(PREF_ACTIVITY_STREAM_ENABLED, this._handleToggleEvent.bind(this));
|
||||
Preferences.observe(PREF_ACTIVITY_STREAM_ENABLED, this._handleToggleEvent.bind(this));
|
||||
this.toggleActivityStream(Services.prefs.getBoolPref(PREF_ACTIVITY_STREAM_ENABLED));
|
||||
}
|
||||
|
||||
|
@ -75,8 +73,8 @@ AboutNewTabService.prototype = {
|
|||
service: true
|
||||
}],
|
||||
|
||||
_handleToggleEvent(prefName, stateEnabled, forceState) { // jshint unused:false
|
||||
if (this.toggleActivityStream(stateEnabled, forceState)) {
|
||||
_handleToggleEvent(stateEnabled) {
|
||||
if (this.toggleActivityStream(stateEnabled)) {
|
||||
Services.obs.notifyObservers(null, "newtab-url-changed", ABOUT_URL);
|
||||
}
|
||||
},
|
||||
|
@ -95,7 +93,7 @@ AboutNewTabService.prototype = {
|
|||
* @param {Boolean} stateEnabled activity stream enabled state to set to
|
||||
* @param {Boolean} forceState force state change
|
||||
*/
|
||||
toggleActivityStream(stateEnabled, forceState) {
|
||||
toggleActivityStream(stateEnabled, forceState = false) {
|
||||
|
||||
if (!forceState && (this.overridden || stateEnabled === this.activityStreamEnabled)) {
|
||||
// exit there is no change of state
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
/* globals Services, XPCOMUtils, NewTabPrefsProvider, Preferences, aboutNewTabService, do_register_cleanup */
|
||||
/* globals Services, XPCOMUtils, Preferences, aboutNewTabService, do_register_cleanup */
|
||||
|
||||
"use strict";
|
||||
|
||||
|
@ -11,9 +11,6 @@ Cu.import("resource://gre/modules/Services.jsm");
|
|||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Preferences.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "NewTabPrefsProvider",
|
||||
"resource:///modules/NewTabPrefsProvider.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
|
||||
"@mozilla.org/browser/aboutnewtab-service;1",
|
||||
"nsIAboutNewTabService");
|
||||
|
@ -25,7 +22,6 @@ const DOWNLOADS_URL = "chrome://browser/content/downloads/contentAreaDownloadsVi
|
|||
function cleanup() {
|
||||
Services.prefs.setBoolPref("browser.newtabpage.activity-stream.enabled", false);
|
||||
aboutNewTabService.resetNewTabURL();
|
||||
NewTabPrefsProvider.prefs.uninit();
|
||||
}
|
||||
|
||||
do_register_cleanup(cleanup);
|
||||
|
@ -34,7 +30,6 @@ do_register_cleanup(cleanup);
|
|||
* Test the overriding of the default URL
|
||||
*/
|
||||
add_task(function* test_override_activity_stream_disabled() {
|
||||
NewTabPrefsProvider.prefs.init();
|
||||
let notificationPromise;
|
||||
Services.prefs.setBoolPref("browser.newtabpage.activity-stream.enabled", false);
|
||||
|
||||
|
@ -69,7 +64,6 @@ add_task(function* test_override_activity_stream_disabled() {
|
|||
});
|
||||
|
||||
add_task(function* test_override_activity_stream_enabled() {
|
||||
NewTabPrefsProvider.prefs.init();
|
||||
let notificationPromise;
|
||||
// change newtab page to activity stream
|
||||
notificationPromise = nextChangeNotificationPromise("about:newtab");
|
||||
|
@ -105,7 +99,6 @@ add_task(function* test_updates() {
|
|||
Preferences.set("browser.newtabpage.activity-stream.enabled", true);
|
||||
aboutNewTabService.resetNewTabURL(); // need to set manually because pref notifs are off
|
||||
let notificationPromise;
|
||||
NewTabPrefsProvider.prefs.init();
|
||||
|
||||
// test update fires on override and reset
|
||||
let testURL = "https://example.com/";
|
||||
|
|
|
@ -2,15 +2,13 @@
|
|||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
/* globals Services, NewTabURL, XPCOMUtils, aboutNewTabService, NewTabPrefsProvider */
|
||||
/* globals Services, NewTabURL, XPCOMUtils, aboutNewTabService */
|
||||
"use strict";
|
||||
|
||||
const {utils: Cu} = Components;
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource:///modules/NewTabURL.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "NewTabPrefsProvider",
|
||||
"resource:///modules/NewTabPrefsProvider.jsm");
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
|
||||
"@mozilla.org/browser/aboutnewtab-service;1",
|
||||
"nsIAboutNewTabService");
|
||||
|
@ -34,11 +32,9 @@ add_task(function*() {
|
|||
Assert.equal(NewTabURL.get(), defaultURL, "Newtab URL should be the default");
|
||||
|
||||
// change newtab page to activity stream
|
||||
NewTabPrefsProvider.prefs.init();
|
||||
Services.prefs.setBoolPref("browser.newtabpage.activity-stream.enabled", true);
|
||||
Assert.equal(NewTabURL.get(), "about:newtab", `Newtab URL should be about:newtab`);
|
||||
Assert.ok(!NewTabURL.overridden, "Newtab URL should not be overridden");
|
||||
NewTabPrefsProvider.prefs.uninit();
|
||||
});
|
||||
|
||||
function promiseNewtabURLNotification(aNewURL) {
|
||||
|
|
|
@ -1110,8 +1110,13 @@ this.PlacesUIUtils = {
|
|||
return this.leftPaneQueries;
|
||||
},
|
||||
|
||||
// Get the folder id for the organizer left-pane folder.
|
||||
get leftPaneFolderId() {
|
||||
delete this.leftPaneFolderId;
|
||||
return this.leftPaneFolderId = this.maybeRebuildLeftPane();
|
||||
},
|
||||
|
||||
// Get the folder id for the organizer left-pane folder.
|
||||
maybeRebuildLeftPane() {
|
||||
let leftPaneRoot = -1;
|
||||
let allBookmarksId;
|
||||
|
||||
|
@ -1163,8 +1168,8 @@ this.PlacesUIUtils = {
|
|||
// Returns true if item really exists, false otherwise.
|
||||
function itemExists(aItemId) {
|
||||
try {
|
||||
bs.getItemIndex(aItemId);
|
||||
return true;
|
||||
let index = bs.getItemIndex(aItemId);
|
||||
return index > -1;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
|
@ -1251,8 +1256,7 @@ this.PlacesUIUtils = {
|
|||
safeRemoveItem(leftPaneRoot);
|
||||
} else {
|
||||
// Everything is fine, return the current left pane folder.
|
||||
delete this.leftPaneFolderId;
|
||||
return this.leftPaneFolderId = leftPaneRoot;
|
||||
return leftPaneRoot;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1345,8 +1349,7 @@ this.PlacesUIUtils = {
|
|||
};
|
||||
bs.runInBatchMode(callback, null);
|
||||
|
||||
delete this.leftPaneFolderId;
|
||||
return this.leftPaneFolderId = leftPaneRoot;
|
||||
return leftPaneRoot;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,6 +6,7 @@ Components.utils.import("resource://gre/modules/NetUtil.jsm");
|
|||
|
||||
const storageManagerDisabled = !SpecialPowers.getBoolPref("browser.storageManager.enabled");
|
||||
const offlineGroupDisabled = !SpecialPowers.getBoolPref("browser.preferences.offlineGroup.enabled");
|
||||
const browserContainersGroupDisabled = !SpecialPowers.getBoolPref("privacy.userContext.ui.enabled");
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
@ -38,6 +39,11 @@ function checkElements(expectedPane) {
|
|||
is_element_hidden(element, "Disabled offlineGroup should be hidden");
|
||||
continue;
|
||||
}
|
||||
// The browserContainersGroup is still only pref-on on Nightly
|
||||
if (element.id == "browserContainersGroup" && browserContainersGroupDisabled) {
|
||||
is_element_hidden(element, "Disabled browserContainersGroup should be hidden");
|
||||
continue;
|
||||
}
|
||||
|
||||
let attributeValue = element.getAttribute("data-category");
|
||||
let suffix = " (id=" + element.id + ")";
|
||||
|
|
|
@ -21,7 +21,8 @@ function test() {
|
|||
["browser.cache.disk.enable", false],
|
||||
["browser.cache.memory.enable", false],
|
||||
["browser.storageManager.enabled", true],
|
||||
["browser.preferences.offlineGroup.enabled", true]
|
||||
["browser.preferences.offlineGroup.enabled", true],
|
||||
["privacy.userContext.ui.enabled", true]
|
||||
]}).then(() => open_preferences(runTest));
|
||||
}
|
||||
|
||||
|
@ -39,9 +40,9 @@ function runTest(win) {
|
|||
}
|
||||
let attributeValue = element.getAttribute("data-category");
|
||||
if (attributeValue == "panePrivacy") {
|
||||
is_element_visible(element, "Privacy elements should be visible");
|
||||
is_element_visible(element, `Privacy element of id=${element.id} should be visible`);
|
||||
} else {
|
||||
is_element_hidden(element, "Non-Privacy elements should be hidden");
|
||||
is_element_hidden(element, `Non-Privacy element of id=${element.id} should be hidden`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,5 +12,7 @@ STRIP_FLAGS="--strip-debug"
|
|||
|
||||
ac_add_options --with-branding=browser/branding/aurora
|
||||
|
||||
mk_add_options MOZ_PGO=1
|
||||
|
||||
. "$topsrcdir/build/mozconfig.common.override"
|
||||
. "$topsrcdir/build/mozconfig.cache"
|
||||
|
|
|
@ -12,5 +12,7 @@ STRIP_FLAGS="--strip-debug"
|
|||
|
||||
ac_add_options --with-branding=browser/branding/aurora
|
||||
|
||||
mk_add_options MOZ_PGO=1
|
||||
|
||||
. "$topsrcdir/build/mozconfig.common.override"
|
||||
. "$topsrcdir/build/mozconfig.cache"
|
||||
|
|
|
@ -8,5 +8,7 @@ ac_add_options --enable-verify-mar
|
|||
|
||||
ac_add_options --with-branding=browser/branding/aurora
|
||||
|
||||
mk_add_options MOZ_PGO=1
|
||||
|
||||
. "$topsrcdir/build/mozconfig.common.override"
|
||||
. "$topsrcdir/build/mozconfig.cache"
|
||||
|
|
|
@ -9,5 +9,7 @@ ac_add_options --enable-verify-mar
|
|||
|
||||
ac_add_options --with-branding=browser/branding/aurora
|
||||
|
||||
mk_add_options MOZ_PGO=1
|
||||
|
||||
. "$topsrcdir/build/mozconfig.common.override"
|
||||
. "$topsrcdir/build/mozconfig.cache"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
[
|
||||
{
|
||||
"version": "clang 3.9.0",
|
||||
"size": 184678304,
|
||||
"digest": "cfde9a0f7f59823200f94422b4adb9a2fb5d4d07f240bbd1142c792434f6a1cbb4096d25c9853d77008fc40db0d827daa7003e78016f51241f621d6040ccc635",
|
||||
"size": 185632474,
|
||||
"digest": "0e1a556b65d6398fa812b9ceb5ce5e2dec3eda77d4a032a818182b34fc8ce602412f42388bb1fda6bea265d35c1dde3847a730b264fec01cd7e3dcfd39941660",
|
||||
"algorithm": "sha512",
|
||||
"filename": "clang.tar.bz2",
|
||||
"unpack": true
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
[
|
||||
{
|
||||
"version": "clang 3.9.0",
|
||||
"size": 184678304,
|
||||
"digest": "cfde9a0f7f59823200f94422b4adb9a2fb5d4d07f240bbd1142c792434f6a1cbb4096d25c9853d77008fc40db0d827daa7003e78016f51241f621d6040ccc635",
|
||||
"size": 185632474,
|
||||
"digest": "0e1a556b65d6398fa812b9ceb5ce5e2dec3eda77d4a032a818182b34fc8ce602412f42388bb1fda6bea265d35c1dde3847a730b264fec01cd7e3dcfd39941660",
|
||||
"algorithm": "sha512",
|
||||
"filename": "clang.tar.bz2",
|
||||
"unpack": true
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
This is the pdf.js project output, https://github.com/mozilla/pdf.js
|
||||
This is the PDF.js project output, https://github.com/mozilla/pdf.js
|
||||
|
||||
Current extension version is: 1.8.269
|
||||
Current extension version is: 1.8.290
|
||||
|
||||
Taken from upstream commit: 60c232bc
|
||||
|
|
|
@ -794,10 +794,10 @@ class FindEventManager {
|
|||
}
|
||||
|
||||
bind() {
|
||||
var unload = function(e) {
|
||||
var unload = (evt) => {
|
||||
this.unbind();
|
||||
this.contentWindow.removeEventListener(e.type, unload);
|
||||
}.bind(this);
|
||||
this.contentWindow.removeEventListener(evt.type, unload);
|
||||
};
|
||||
this.contentWindow.addEventListener("unload", unload);
|
||||
|
||||
// We cannot directly attach listeners to for the find events
|
||||
|
|
|
@ -966,7 +966,7 @@ var createBlob = function createBlob(data, contentType) {
|
|||
var createObjectURL = function createObjectURLClosure() {
|
||||
var digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
||||
return function createObjectURL(data, contentType, forceDataSchema = false) {
|
||||
if (!forceDataSchema) {
|
||||
if (!forceDataSchema && URL.createObjectURL) {
|
||||
var blob = createBlob(data, contentType);
|
||||
return URL.createObjectURL(blob);
|
||||
}
|
||||
|
@ -3391,8 +3391,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
|
|||
}();
|
||||
var version, build;
|
||||
{
|
||||
exports.version = version = '1.8.269';
|
||||
exports.build = build = 'acdfc2d8';
|
||||
exports.version = version = '1.8.290';
|
||||
exports.build = build = '60c232bc';
|
||||
}
|
||||
exports.getDocument = getDocument;
|
||||
exports.PDFDataRangeTransport = PDFDataRangeTransport;
|
||||
|
@ -4394,8 +4394,8 @@ if (!_util.globalScope.PDFJS) {
|
|||
}
|
||||
var PDFJS = _util.globalScope.PDFJS;
|
||||
{
|
||||
PDFJS.version = '1.8.269';
|
||||
PDFJS.build = 'acdfc2d8';
|
||||
PDFJS.version = '1.8.290';
|
||||
PDFJS.build = '60c232bc';
|
||||
}
|
||||
PDFJS.pdfBug = false;
|
||||
if (PDFJS.verbosity !== undefined) {
|
||||
|
@ -6708,8 +6708,8 @@ exports.TilingPattern = TilingPattern;
|
|||
"use strict";
|
||||
|
||||
|
||||
var pdfjsVersion = '1.8.269';
|
||||
var pdfjsBuild = 'acdfc2d8';
|
||||
var pdfjsVersion = '1.8.290';
|
||||
var pdfjsBuild = '60c232bc';
|
||||
var pdfjsSharedUtil = __w_pdfjs_require__(0);
|
||||
var pdfjsDisplayGlobal = __w_pdfjs_require__(8);
|
||||
var pdfjsDisplayAPI = __w_pdfjs_require__(3);
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -459,14 +459,14 @@ var Stats = (function Stats() {
|
|||
name: 'Stats',
|
||||
panel: null,
|
||||
manager: null,
|
||||
init: function init(pdfjsLib) {
|
||||
init(pdfjsLib) {
|
||||
this.panel.setAttribute('style', 'padding: 5px;');
|
||||
pdfjsLib.PDFJS.enableStats = true;
|
||||
},
|
||||
enabled: false,
|
||||
active: false,
|
||||
// Stats specific functions.
|
||||
add: function(pageNumber, stat) {
|
||||
add(pageNumber, stat) {
|
||||
if (!stat) {
|
||||
return;
|
||||
}
|
||||
|
@ -485,7 +485,7 @@ var Stats = (function Stats() {
|
|||
statsDiv.textContent = stat.toString();
|
||||
wrapper.appendChild(title);
|
||||
wrapper.appendChild(statsDiv);
|
||||
stats.push({ pageNumber: pageNumber, div: wrapper });
|
||||
stats.push({ pageNumber, div: wrapper, });
|
||||
stats.sort(function(a, b) {
|
||||
return a.pageNumber - b.pageNumber;
|
||||
});
|
||||
|
@ -494,7 +494,7 @@ var Stats = (function Stats() {
|
|||
this.panel.appendChild(stats[i].div);
|
||||
}
|
||||
},
|
||||
cleanup: function () {
|
||||
cleanup() {
|
||||
stats = [];
|
||||
clear(this.panel);
|
||||
}
|
||||
|
@ -513,7 +513,7 @@ window.PDFBug = (function PDFBugClosure() {
|
|||
StepperManager,
|
||||
Stats
|
||||
],
|
||||
enable: function(ids) {
|
||||
enable(ids) {
|
||||
var all = false, tools = this.tools;
|
||||
if (ids.length === 1 && ids[0] === 'all') {
|
||||
all = true;
|
||||
|
@ -535,7 +535,7 @@ window.PDFBug = (function PDFBugClosure() {
|
|||
});
|
||||
}
|
||||
},
|
||||
init: function init(pdfjsLib, container) {
|
||||
init(pdfjsLib, container) {
|
||||
/*
|
||||
* Basic Layout:
|
||||
* PDFBug
|
||||
|
@ -588,14 +588,14 @@ window.PDFBug = (function PDFBugClosure() {
|
|||
}
|
||||
this.selectPanel(0);
|
||||
},
|
||||
cleanup: function cleanup() {
|
||||
cleanup() {
|
||||
for (var i = 0, ii = this.tools.length; i < ii; i++) {
|
||||
if (this.tools[i].enabled) {
|
||||
this.tools[i].cleanup();
|
||||
}
|
||||
}
|
||||
},
|
||||
selectPanel: function selectPanel(index) {
|
||||
selectPanel(index) {
|
||||
if (typeof index !== 'number') {
|
||||
index = this.tools.indexOf(index);
|
||||
}
|
||||
|
|
|
@ -291,7 +291,7 @@ function getVisibleElements(scrollEl, views, sortByVisibility) {
|
|||
id: view.id,
|
||||
x: currentWidth,
|
||||
y: currentHeight,
|
||||
view: view,
|
||||
view,
|
||||
percent: percentHeight
|
||||
});
|
||||
}
|
||||
|
@ -307,8 +307,8 @@ function getVisibleElements(scrollEl, views, sortByVisibility) {
|
|||
});
|
||||
}
|
||||
return {
|
||||
first: first,
|
||||
last: last,
|
||||
first,
|
||||
last,
|
||||
views: visible
|
||||
};
|
||||
}
|
||||
|
@ -812,11 +812,11 @@ function configure(PDFJS) {
|
|||
PDFJS.cMapPacked = true;
|
||||
}
|
||||
var DefaultExternalServices = {
|
||||
updateFindControlState: function (data) {},
|
||||
initPassiveLoading: function (callbacks) {},
|
||||
fallback: function (data, callback) {},
|
||||
reportTelemetry: function (data) {},
|
||||
createDownloadManager: function () {
|
||||
updateFindControlState(data) {},
|
||||
initPassiveLoading(callbacks) {},
|
||||
fallback(data, callback) {},
|
||||
reportTelemetry(data) {},
|
||||
createDownloadManager() {
|
||||
throw new Error('Not implemented: createDownloadManager');
|
||||
},
|
||||
createPreferences() {
|
||||
|
@ -887,7 +887,7 @@ var PDFViewerApplication = {
|
|||
this.initialized = true;
|
||||
});
|
||||
},
|
||||
_readPreferences: function () {
|
||||
_readPreferences() {
|
||||
var { preferences, viewerPrefs } = this;
|
||||
return Promise.all([preferences.get('enableWebGL').then(function resolved(value) {
|
||||
_pdfjs.PDFJS.disableWebGL = !value;
|
||||
|
@ -940,28 +940,28 @@ var PDFViewerApplication = {
|
|||
viewerPrefs['enablePrintAutoRotate'] = value;
|
||||
})]).catch(function (reason) {});
|
||||
},
|
||||
_initializeViewerComponents: function () {
|
||||
_initializeViewerComponents() {
|
||||
var self = this;
|
||||
var appConfig = this.appConfig;
|
||||
return new Promise((resolve, reject) => {
|
||||
var eventBus = appConfig.eventBus || (0, _dom_events.getGlobalEventBus)();
|
||||
self.eventBus = eventBus;
|
||||
this.eventBus = eventBus;
|
||||
var pdfRenderingQueue = new _pdf_rendering_queue.PDFRenderingQueue();
|
||||
pdfRenderingQueue.onIdle = self.cleanup.bind(self);
|
||||
self.pdfRenderingQueue = pdfRenderingQueue;
|
||||
var pdfLinkService = new _pdf_link_service.PDFLinkService({ eventBus: eventBus });
|
||||
var pdfLinkService = new _pdf_link_service.PDFLinkService({ eventBus });
|
||||
self.pdfLinkService = pdfLinkService;
|
||||
var downloadManager = self.externalServices.createDownloadManager();
|
||||
self.downloadManager = downloadManager;
|
||||
var container = appConfig.mainContainer;
|
||||
var viewer = appConfig.viewerContainer;
|
||||
self.pdfViewer = new _pdf_viewer.PDFViewer({
|
||||
container: container,
|
||||
viewer: viewer,
|
||||
eventBus: eventBus,
|
||||
container,
|
||||
viewer,
|
||||
eventBus,
|
||||
renderingQueue: pdfRenderingQueue,
|
||||
linkService: pdfLinkService,
|
||||
downloadManager: downloadManager,
|
||||
downloadManager,
|
||||
renderer: self.viewerPrefs['renderer'],
|
||||
enhanceTextSelection: self.viewerPrefs['enhanceTextSelection'],
|
||||
renderInteractiveForms: self.viewerPrefs['renderInteractiveForms'],
|
||||
|
@ -978,7 +978,7 @@ var PDFViewerApplication = {
|
|||
pdfRenderingQueue.setThumbnailViewer(self.pdfThumbnailViewer);
|
||||
self.pdfHistory = new _pdf_history.PDFHistory({
|
||||
linkService: pdfLinkService,
|
||||
eventBus: eventBus
|
||||
eventBus
|
||||
});
|
||||
pdfLinkService.setHistory(self.pdfHistory);
|
||||
self.findController = new _pdf_find_controller.PDFFindController({ pdfViewer: self.pdfViewer });
|
||||
|
@ -1014,23 +1014,23 @@ var PDFViewerApplication = {
|
|||
self.secondaryToolbar = new _secondary_toolbar.SecondaryToolbar(appConfig.secondaryToolbar, container, eventBus);
|
||||
if (self.supportsFullscreen) {
|
||||
self.pdfPresentationMode = new _pdf_presentation_mode.PDFPresentationMode({
|
||||
container: container,
|
||||
viewer: viewer,
|
||||
container,
|
||||
viewer,
|
||||
pdfViewer: self.pdfViewer,
|
||||
eventBus: eventBus,
|
||||
eventBus,
|
||||
contextMenuItems: appConfig.fullscreen
|
||||
});
|
||||
}
|
||||
self.passwordPrompt = new _password_prompt.PasswordPrompt(appConfig.passwordOverlay);
|
||||
self.pdfOutlineViewer = new _pdf_outline_viewer.PDFOutlineViewer({
|
||||
container: appConfig.sidebar.outlineView,
|
||||
eventBus: eventBus,
|
||||
eventBus,
|
||||
linkService: pdfLinkService
|
||||
});
|
||||
self.pdfAttachmentViewer = new _pdf_attachment_viewer.PDFAttachmentViewer({
|
||||
container: appConfig.sidebar.attachmentsView,
|
||||
eventBus: eventBus,
|
||||
downloadManager: downloadManager
|
||||
eventBus,
|
||||
downloadManager
|
||||
});
|
||||
var sidebarConfig = Object.create(appConfig.sidebar);
|
||||
sidebarConfig.pdfViewer = self.pdfViewer;
|
||||
|
@ -1104,33 +1104,33 @@ var PDFViewerApplication = {
|
|||
},
|
||||
initPassiveLoading: function pdfViewInitPassiveLoading() {
|
||||
this.externalServices.initPassiveLoading({
|
||||
onOpenWithTransport: function (url, length, transport) {
|
||||
onOpenWithTransport(url, length, transport) {
|
||||
PDFViewerApplication.open(url, { range: transport });
|
||||
if (length) {
|
||||
PDFViewerApplication.pdfDocumentProperties.setFileSize(length);
|
||||
}
|
||||
},
|
||||
onOpenWithData: function (data) {
|
||||
onOpenWithData(data) {
|
||||
PDFViewerApplication.open(data);
|
||||
},
|
||||
onOpenWithURL: function (url, length, originalURL) {
|
||||
onOpenWithURL(url, length, originalURL) {
|
||||
var file = url,
|
||||
args = null;
|
||||
if (length !== undefined) {
|
||||
args = { length: length };
|
||||
args = { length };
|
||||
}
|
||||
if (originalURL !== undefined) {
|
||||
file = {
|
||||
file: url,
|
||||
originalURL: originalURL
|
||||
originalURL
|
||||
};
|
||||
}
|
||||
PDFViewerApplication.open(file, args);
|
||||
},
|
||||
onError: function (e) {
|
||||
PDFViewerApplication.error(_ui_utils.mozL10n.get('loading_error', null, 'An error occurred while loading the PDF.'), e);
|
||||
onError(err) {
|
||||
PDFViewerApplication.error(_ui_utils.mozL10n.get('loading_error', null, 'An error occurred while loading the PDF.'), err);
|
||||
},
|
||||
onProgress: function (loaded, total) {
|
||||
onProgress(loaded, total) {
|
||||
PDFViewerApplication.progress(loaded / total);
|
||||
}
|
||||
});
|
||||
|
@ -1236,7 +1236,7 @@ var PDFViewerApplication = {
|
|||
} else if (exception instanceof _pdfjs.UnexpectedResponseException) {
|
||||
loadingErrorMessage = _ui_utils.mozL10n.get('unexpected_response_error', null, 'Unexpected server response.');
|
||||
}
|
||||
var moreInfo = { message: message };
|
||||
var moreInfo = { message };
|
||||
self.error(loadingErrorMessage, moreInfo);
|
||||
throw new Error(loadingErrorMessage);
|
||||
});
|
||||
|
@ -1270,7 +1270,7 @@ var PDFViewerApplication = {
|
|||
}
|
||||
this.fellback = true;
|
||||
this.externalServices.fallback({
|
||||
featureId: featureId,
|
||||
featureId,
|
||||
url: this.baseUrl
|
||||
}, function response(download) {
|
||||
if (!download) {
|
||||
|
@ -1454,10 +1454,10 @@ var PDFViewerApplication = {
|
|||
});
|
||||
Promise.all([onePageRendered, _ui_utils.animationStarted]).then(function () {
|
||||
pdfDocument.getOutline().then(function (outline) {
|
||||
self.pdfOutlineViewer.render({ outline: outline });
|
||||
self.pdfOutlineViewer.render({ outline });
|
||||
});
|
||||
pdfDocument.getAttachments().then(function (attachments) {
|
||||
self.pdfAttachmentViewer.render({ attachments: attachments });
|
||||
self.pdfAttachmentViewer.render({ attachments });
|
||||
});
|
||||
});
|
||||
pdfDocument.getMetadata().then(function (data) {
|
||||
|
@ -1500,7 +1500,7 @@ var PDFViewerApplication = {
|
|||
type: 'documentInfo',
|
||||
version: versionId,
|
||||
generator: generatorId,
|
||||
formType: formType
|
||||
formType
|
||||
});
|
||||
});
|
||||
},
|
||||
|
@ -1788,7 +1788,7 @@ function webViewerPageRendered(e) {
|
|||
PDFViewerApplication.pdfDocument.getStats().then(function (stats) {
|
||||
PDFViewerApplication.externalServices.reportTelemetry({
|
||||
type: 'documentStats',
|
||||
stats: stats
|
||||
stats
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -2251,7 +2251,7 @@ _ui_utils.localized.then(function webViewerLocalized() {
|
|||
var PDFPrintServiceFactory = {
|
||||
instance: {
|
||||
supportsPrinting: false,
|
||||
createPrintService: function () {
|
||||
createPrintService() {
|
||||
throw new Error('Not implemented: createPrintService');
|
||||
}
|
||||
}
|
||||
|
@ -2282,8 +2282,8 @@ var OverlayManager = {
|
|||
throw new Error('The overlay is already registered.');
|
||||
}
|
||||
this.overlays[name] = {
|
||||
element: element,
|
||||
container: container,
|
||||
element,
|
||||
container,
|
||||
callerCloseMethod: callerCloseMethod || null,
|
||||
canForceClose: canForceClose || false
|
||||
};
|
||||
|
@ -2425,12 +2425,12 @@ var PDFLinkService = function PDFLinkServiceClosure() {
|
|||
return;
|
||||
}
|
||||
self.pdfViewer.scrollPageIntoView({
|
||||
pageNumber: pageNumber,
|
||||
pageNumber,
|
||||
destArray: dest
|
||||
});
|
||||
if (self.pdfHistory) {
|
||||
self.pdfHistory.push({
|
||||
dest: dest,
|
||||
dest,
|
||||
hash: destString,
|
||||
page: pageNumber
|
||||
});
|
||||
|
@ -2582,10 +2582,10 @@ var PDFLinkService = function PDFLinkServiceClosure() {
|
|||
}
|
||||
this.eventBus.dispatch('namedaction', {
|
||||
source: this,
|
||||
action: action
|
||||
action
|
||||
});
|
||||
},
|
||||
onFileAttachmentAnnotation: function (params) {
|
||||
onFileAttachmentAnnotation(params = {}) {
|
||||
this.eventBus.dispatch('fileattachmentannotation', {
|
||||
source: this,
|
||||
id: params.id,
|
||||
|
@ -2662,17 +2662,17 @@ var SimpleLinkService = function SimpleLinkServiceClosure() {
|
|||
return 0;
|
||||
},
|
||||
set page(value) {},
|
||||
navigateTo: function (dest) {},
|
||||
getDestinationHash: function (dest) {
|
||||
navigateTo(dest) {},
|
||||
getDestinationHash(dest) {
|
||||
return '#';
|
||||
},
|
||||
getAnchorUrl: function (hash) {
|
||||
getAnchorUrl(hash) {
|
||||
return '#';
|
||||
},
|
||||
setHash: function (hash) {},
|
||||
executeNamedAction: function (action) {},
|
||||
onFileAttachmentAnnotation: function (params) {},
|
||||
cachePageRef: function (pageNum, pageRef) {}
|
||||
setHash(hash) {},
|
||||
executeNamedAction(action) {},
|
||||
onFileAttachmentAnnotation(params) {},
|
||||
cachePageRef(pageNum, pageRef) {}
|
||||
};
|
||||
return SimpleLinkService;
|
||||
}();
|
||||
|
@ -3110,7 +3110,7 @@ function FirefoxPrintService(pdfDocument, pagesOverview, printContainer) {
|
|||
this.printContainer = printContainer;
|
||||
}
|
||||
FirefoxPrintService.prototype = {
|
||||
layout: function () {
|
||||
layout() {
|
||||
var pdfDocument = this.pdfDocument;
|
||||
var printContainer = this.printContainer;
|
||||
var body = document.querySelector('body');
|
||||
|
@ -3119,7 +3119,7 @@ FirefoxPrintService.prototype = {
|
|||
composePage(pdfDocument, i + 1, this.pagesOverview[i], printContainer);
|
||||
}
|
||||
},
|
||||
destroy: function () {
|
||||
destroy() {
|
||||
this.printContainer.textContent = '';
|
||||
}
|
||||
};
|
||||
|
@ -3129,7 +3129,7 @@ _app.PDFPrintServiceFactory.instance = {
|
|||
var value = 'mozPrintCallback' in canvas;
|
||||
return (0, _pdfjs.shadow)(this, 'supportsPrinting', value);
|
||||
},
|
||||
createPrintService: function (pdfDocument, pagesOverview, printContainer) {
|
||||
createPrintService(pdfDocument, pagesOverview, printContainer) {
|
||||
return new FirefoxPrintService(pdfDocument, pagesOverview, printContainer);
|
||||
}
|
||||
};
|
||||
|
@ -3156,13 +3156,13 @@ var _app = __webpack_require__(4);
|
|||
;
|
||||
var FirefoxCom = function FirefoxComClosure() {
|
||||
return {
|
||||
requestSync: function (action, data) {
|
||||
requestSync(action, data) {
|
||||
var request = document.createTextNode('');
|
||||
document.documentElement.appendChild(request);
|
||||
var sender = document.createEvent('CustomEvent');
|
||||
sender.initCustomEvent('pdf.js.message', true, false, {
|
||||
action: action,
|
||||
data: data,
|
||||
action,
|
||||
data,
|
||||
sync: true
|
||||
});
|
||||
request.dispatchEvent(sender);
|
||||
|
@ -3170,7 +3170,7 @@ var FirefoxCom = function FirefoxComClosure() {
|
|||
document.documentElement.removeChild(request);
|
||||
return response;
|
||||
},
|
||||
request: function (action, data, callback) {
|
||||
request(action, data, callback) {
|
||||
var request = document.createTextNode('');
|
||||
if (callback) {
|
||||
document.addEventListener('pdf.js.response', function listener(event) {
|
||||
|
@ -3184,8 +3184,8 @@ var FirefoxCom = function FirefoxComClosure() {
|
|||
document.documentElement.appendChild(request);
|
||||
var sender = document.createEvent('CustomEvent');
|
||||
sender.initCustomEvent('pdf.js.message', true, false, {
|
||||
action: action,
|
||||
data: data,
|
||||
action,
|
||||
data,
|
||||
sync: false,
|
||||
responseExpected: !!callback
|
||||
});
|
||||
|
@ -3199,24 +3199,24 @@ var DownloadManager = function DownloadManagerClosure() {
|
|||
downloadUrl: function DownloadManager_downloadUrl(url, filename) {
|
||||
FirefoxCom.request('download', {
|
||||
originalUrl: url,
|
||||
filename: filename
|
||||
filename
|
||||
});
|
||||
},
|
||||
downloadData: function DownloadManager_downloadData(data, filename, contentType) {
|
||||
var blobUrl = (0, _pdfjs.createObjectURL)(data, contentType, false);
|
||||
FirefoxCom.request('download', {
|
||||
blobUrl: blobUrl,
|
||||
blobUrl,
|
||||
originalUrl: blobUrl,
|
||||
filename: filename,
|
||||
filename,
|
||||
isAttachment: true
|
||||
});
|
||||
},
|
||||
download: function DownloadManager_download(blob, url, filename) {
|
||||
var blobUrl = window.URL.createObjectURL(blob);
|
||||
FirefoxCom.request('download', {
|
||||
blobUrl: blobUrl,
|
||||
blobUrl,
|
||||
originalUrl: url,
|
||||
filename: filename
|
||||
filename
|
||||
}, function response(err) {
|
||||
if (err && this.onerror) {
|
||||
this.onerror(err);
|
||||
|
@ -3268,18 +3268,18 @@ function FirefoxComDataRangeTransport(length, initialData) {
|
|||
FirefoxComDataRangeTransport.prototype = Object.create(_pdfjs.PDFDataRangeTransport.prototype);
|
||||
FirefoxComDataRangeTransport.prototype.requestDataRange = function FirefoxComDataRangeTransport_requestDataRange(begin, end) {
|
||||
FirefoxCom.request('requestDataRange', {
|
||||
begin: begin,
|
||||
end: end
|
||||
begin,
|
||||
end
|
||||
});
|
||||
};
|
||||
FirefoxComDataRangeTransport.prototype.abort = function FirefoxComDataRangeTransport_abort() {
|
||||
FirefoxCom.requestSync('abortLoading', null);
|
||||
};
|
||||
_app.PDFViewerApplication.externalServices = {
|
||||
updateFindControlState: function (data) {
|
||||
updateFindControlState(data) {
|
||||
FirefoxCom.request('updateFindControlState', data);
|
||||
},
|
||||
initPassiveLoading: function (callbacks) {
|
||||
initPassiveLoading(callbacks) {
|
||||
var pdfDataRangeTransport;
|
||||
window.addEventListener('message', function windowMessage(e) {
|
||||
if (e.source !== null) {
|
||||
|
@ -3318,13 +3318,13 @@ _app.PDFViewerApplication.externalServices = {
|
|||
});
|
||||
FirefoxCom.requestSync('initPassiveLoading', null);
|
||||
},
|
||||
fallback: function (data, callback) {
|
||||
fallback(data, callback) {
|
||||
FirefoxCom.request('fallback', data, callback);
|
||||
},
|
||||
reportTelemetry: function (data) {
|
||||
reportTelemetry(data) {
|
||||
FirefoxCom.request('reportTelemetry', JSON.stringify(data));
|
||||
},
|
||||
createDownloadManager: function () {
|
||||
createDownloadManager() {
|
||||
return new DownloadManager();
|
||||
},
|
||||
createPreferences() {
|
||||
|
@ -3348,10 +3348,10 @@ _app.PDFViewerApplication.externalServices = {
|
|||
}
|
||||
};
|
||||
document.mozL10n.setExternalLocalizerServices({
|
||||
getLocale: function () {
|
||||
getLocale() {
|
||||
return FirefoxCom.requestSync('getLocale', null);
|
||||
},
|
||||
getStrings: function (key) {
|
||||
getStrings(key) {
|
||||
return FirefoxCom.requestSync('getStrings', key);
|
||||
}
|
||||
});
|
||||
|
@ -3598,9 +3598,9 @@ var HandTool = function HandToolClosure() {
|
|||
this.wasActive = false;
|
||||
this.handTool = new _grab_to_pan.GrabToPan({
|
||||
element: this.container,
|
||||
onActiveChanged: function (isActive) {
|
||||
this.eventBus.dispatch('handtoolchanged', { isActive: isActive });
|
||||
}.bind(this)
|
||||
onActiveChanged: isActive => {
|
||||
this.eventBus.dispatch('handtoolchanged', { isActive });
|
||||
}
|
||||
});
|
||||
this.eventBus.on('togglehandtool', this.toggle.bind(this));
|
||||
Promise.all([_ui_utils.localized, preferences.get('enableHandToolOnLoad')]).then(values => {
|
||||
|
@ -4654,7 +4654,7 @@ var PDFPageView = function PDFPageViewClosure() {
|
|||
this.pdfPage.cleanup();
|
||||
}
|
||||
},
|
||||
_resetZoomLayer: function (removeFromDOM) {
|
||||
_resetZoomLayer(removeFromDOM = false) {
|
||||
if (!this.zoomLayer) {
|
||||
return;
|
||||
}
|
||||
|
@ -4933,14 +4933,14 @@ var PDFPageView = function PDFPageViewClosure() {
|
|||
}
|
||||
return resultPromise;
|
||||
},
|
||||
paintOnCanvas: function (canvasWrapper) {
|
||||
paintOnCanvas(canvasWrapper) {
|
||||
var renderCapability = (0, _pdfjs.createPromiseCapability)();
|
||||
var result = {
|
||||
promise: renderCapability.promise,
|
||||
onRenderContinue: function (cont) {
|
||||
onRenderContinue(cont) {
|
||||
cont();
|
||||
},
|
||||
cancel: function () {
|
||||
cancel() {
|
||||
renderTask.cancel();
|
||||
}
|
||||
};
|
||||
|
@ -4989,7 +4989,7 @@ var PDFPageView = function PDFPageViewClosure() {
|
|||
var transform = !outputScale.scaled ? null : [outputScale.sx, 0, 0, outputScale.sy, 0, 0];
|
||||
var renderContext = {
|
||||
canvasContext: ctx,
|
||||
transform: transform,
|
||||
transform,
|
||||
viewport: this.viewport,
|
||||
renderInteractiveForms: this.renderInteractiveForms
|
||||
};
|
||||
|
@ -5014,8 +5014,8 @@ var PDFPageView = function PDFPageViewClosure() {
|
|||
paintOnSvg: function PDFPageView_paintOnSvg(wrapper) {
|
||||
return {
|
||||
promise: Promise.reject(new Error('SVG rendering is not supported.')),
|
||||
onRenderContinue: function (cont) {},
|
||||
cancel: function () {}
|
||||
onRenderContinue(cont) {},
|
||||
cancel() {}
|
||||
};
|
||||
},
|
||||
setPageLabel: function PDFView_setPageLabel(label) {
|
||||
|
@ -6061,7 +6061,7 @@ var PDFThumbnailViewer = function PDFThumbnailViewerClosure() {
|
|||
thumbnailView.setPageLabel(label);
|
||||
}
|
||||
},
|
||||
_ensurePdfPageLoaded: function PDFThumbnailViewer_ensurePdfPageLoaded(thumbView) {
|
||||
_ensurePdfPageLoaded(thumbView) {
|
||||
if (thumbView.pdfPage) {
|
||||
return Promise.resolve(thumbView.pdfPage);
|
||||
}
|
||||
|
@ -6069,21 +6069,21 @@ var PDFThumbnailViewer = function PDFThumbnailViewerClosure() {
|
|||
if (this._pagesRequests[pageNumber]) {
|
||||
return this._pagesRequests[pageNumber];
|
||||
}
|
||||
var promise = this.pdfDocument.getPage(pageNumber).then(function (pdfPage) {
|
||||
var promise = this.pdfDocument.getPage(pageNumber).then(pdfPage => {
|
||||
thumbView.setPdfPage(pdfPage);
|
||||
this._pagesRequests[pageNumber] = null;
|
||||
return pdfPage;
|
||||
}.bind(this));
|
||||
});
|
||||
this._pagesRequests[pageNumber] = promise;
|
||||
return promise;
|
||||
},
|
||||
forceRendering: function () {
|
||||
forceRendering() {
|
||||
var visibleThumbs = this._getVisibleThumbs();
|
||||
var thumbView = this.renderingQueue.getHighestPriority(visibleThumbs, this.thumbnails, this.scroll.down);
|
||||
if (thumbView) {
|
||||
this._ensurePdfPageLoaded(thumbView).then(function () {
|
||||
this._ensurePdfPageLoaded(thumbView).then(() => {
|
||||
this.renderingQueue.renderView(thumbView);
|
||||
}.bind(this));
|
||||
});
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -6189,7 +6189,7 @@ var PDFViewer = function pdfViewer() {
|
|||
get pagesCount() {
|
||||
return this._pages.length;
|
||||
},
|
||||
getPageView: function (index) {
|
||||
getPageView(index) {
|
||||
return this._pages[index];
|
||||
},
|
||||
get pageViewsReady() {
|
||||
|
@ -6289,7 +6289,7 @@ var PDFViewer = function pdfViewer() {
|
|||
this.update();
|
||||
}
|
||||
},
|
||||
setDocument: function (pdfDocument) {
|
||||
setDocument(pdfDocument) {
|
||||
if (this.pdfDocument) {
|
||||
this._cancelRendering();
|
||||
this._resetView();
|
||||
|
@ -6336,10 +6336,10 @@ var PDFViewer = function pdfViewer() {
|
|||
container: this.viewer,
|
||||
eventBus: this.eventBus,
|
||||
id: pageNum,
|
||||
scale: scale,
|
||||
scale,
|
||||
defaultViewport: viewport.clone(),
|
||||
renderingQueue: this.renderingQueue,
|
||||
textLayerFactory: textLayerFactory,
|
||||
textLayerFactory,
|
||||
annotationLayerFactory: this,
|
||||
enhanceTextSelection: this.enhanceTextSelection,
|
||||
renderInteractiveForms: this.renderInteractiveForms,
|
||||
|
@ -6394,7 +6394,7 @@ var PDFViewer = function pdfViewer() {
|
|||
pageView.setPageLabel(label);
|
||||
}
|
||||
},
|
||||
_resetView: function () {
|
||||
_resetView() {
|
||||
this._pages = [];
|
||||
this._currentPageNumber = 1;
|
||||
this._currentScale = _ui_utils.UNKNOWN_SCALE;
|
||||
|
@ -6493,7 +6493,7 @@ var PDFViewer = function pdfViewer() {
|
|||
this._setScaleUpdatePages(scale, value, noScroll, true);
|
||||
}
|
||||
},
|
||||
_resetCurrentPageView: function () {
|
||||
_resetCurrentPageView() {
|
||||
if (this.isInPresentationMode) {
|
||||
this._setScale(this._currentScaleValue, true);
|
||||
}
|
||||
|
@ -6586,11 +6586,11 @@ var PDFViewer = function pdfViewer() {
|
|||
top = Math.max(top, 0);
|
||||
}
|
||||
(0, _ui_utils.scrollIntoView)(pageView.div, {
|
||||
left: left,
|
||||
top: top
|
||||
left,
|
||||
top
|
||||
});
|
||||
},
|
||||
_updateLocation: function (firstPage) {
|
||||
_updateLocation(firstPage) {
|
||||
var currentScale = this._currentScale;
|
||||
var currentScaleValue = this._currentScaleValue;
|
||||
var normalizedScaleValue = parseFloat(currentScaleValue) === currentScale ? Math.round(currentScale * 10000) / 100 : currentScaleValue;
|
||||
|
@ -6604,11 +6604,11 @@ var PDFViewer = function pdfViewer() {
|
|||
var intTop = Math.round(topLeft[1]);
|
||||
pdfOpenParams += ',' + intLeft + ',' + intTop;
|
||||
this._location = {
|
||||
pageNumber: pageNumber,
|
||||
pageNumber,
|
||||
scale: normalizedScaleValue,
|
||||
top: intTop,
|
||||
left: intLeft,
|
||||
pdfOpenParams: pdfOpenParams
|
||||
pdfOpenParams
|
||||
};
|
||||
},
|
||||
update: function PDFViewer_update() {
|
||||
|
@ -6644,10 +6644,10 @@ var PDFViewer = function pdfViewer() {
|
|||
location: this._location
|
||||
});
|
||||
},
|
||||
containsElement: function (element) {
|
||||
containsElement(element) {
|
||||
return this.container.contains(element);
|
||||
},
|
||||
focus: function () {
|
||||
focus() {
|
||||
this.container.focus();
|
||||
},
|
||||
get isInPresentationMode() {
|
||||
|
@ -6659,7 +6659,7 @@ var PDFViewer = function pdfViewer() {
|
|||
get isHorizontalScrollbarEnabled() {
|
||||
return this.isInPresentationMode ? false : this.container.scrollWidth > this.container.clientWidth;
|
||||
},
|
||||
_getVisiblePages: function () {
|
||||
_getVisiblePages() {
|
||||
if (!this.isInPresentationMode) {
|
||||
return (0, _ui_utils.getVisibleElements)(this.container, this._pages, true);
|
||||
}
|
||||
|
@ -6675,7 +6675,7 @@ var PDFViewer = function pdfViewer() {
|
|||
views: visible
|
||||
};
|
||||
},
|
||||
cleanup: function () {
|
||||
cleanup() {
|
||||
for (var i = 0, ii = this._pages.length; i < ii; i++) {
|
||||
if (this._pages[i] && this._pages[i].renderingState !== _pdf_rendering_queue.RenderingStates.FINISHED) {
|
||||
this._pages[i].reset();
|
||||
|
@ -6689,7 +6689,7 @@ var PDFViewer = function pdfViewer() {
|
|||
}
|
||||
}
|
||||
},
|
||||
_ensurePdfPageLoaded: function (pageView) {
|
||||
_ensurePdfPageLoaded(pageView) {
|
||||
if (pageView.pdfPage) {
|
||||
return Promise.resolve(pageView.pdfPage);
|
||||
}
|
||||
|
@ -6707,7 +6707,7 @@ var PDFViewer = function pdfViewer() {
|
|||
this._pagesRequests[pageNumber] = promise;
|
||||
return promise;
|
||||
},
|
||||
forceRendering: function (currentlyVisiblePages) {
|
||||
forceRendering(currentlyVisiblePages) {
|
||||
var visiblePages = currentlyVisiblePages || this._getVisiblePages();
|
||||
var pageView = this.renderingQueue.getHighestPriority(visiblePages, this._pages, this.scroll.down);
|
||||
if (pageView) {
|
||||
|
@ -6718,34 +6718,34 @@ var PDFViewer = function pdfViewer() {
|
|||
}
|
||||
return false;
|
||||
},
|
||||
getPageTextContent: function (pageIndex) {
|
||||
getPageTextContent(pageIndex) {
|
||||
return this.pdfDocument.getPage(pageIndex + 1).then(function (page) {
|
||||
return page.getTextContent({ normalizeWhitespace: true });
|
||||
});
|
||||
},
|
||||
createTextLayerBuilder: function (textLayerDiv, pageIndex, viewport, enhanceTextSelection) {
|
||||
createTextLayerBuilder(textLayerDiv, pageIndex, viewport, enhanceTextSelection = false) {
|
||||
return new _text_layer_builder.TextLayerBuilder({
|
||||
textLayerDiv: textLayerDiv,
|
||||
textLayerDiv,
|
||||
eventBus: this.eventBus,
|
||||
pageIndex: pageIndex,
|
||||
viewport: viewport,
|
||||
pageIndex,
|
||||
viewport,
|
||||
findController: this.isInPresentationMode ? null : this.findController,
|
||||
enhanceTextSelection: this.isInPresentationMode ? false : enhanceTextSelection
|
||||
});
|
||||
},
|
||||
createAnnotationLayerBuilder: function (pageDiv, pdfPage, renderInteractiveForms) {
|
||||
createAnnotationLayerBuilder(pageDiv, pdfPage, renderInteractiveForms = false) {
|
||||
return new _annotation_layer_builder.AnnotationLayerBuilder({
|
||||
pageDiv: pageDiv,
|
||||
pdfPage: pdfPage,
|
||||
renderInteractiveForms: renderInteractiveForms,
|
||||
pageDiv,
|
||||
pdfPage,
|
||||
renderInteractiveForms,
|
||||
linkService: this.linkService,
|
||||
downloadManager: this.downloadManager
|
||||
});
|
||||
},
|
||||
setFindController: function (findController) {
|
||||
setFindController(findController) {
|
||||
this.findController = findController;
|
||||
},
|
||||
getPagesOverview: function () {
|
||||
getPagesOverview() {
|
||||
var pagesOverview = this._pages.map(function (pageView) {
|
||||
var viewport = pageView.pdfPage.getViewport(1);
|
||||
return {
|
||||
|
@ -7138,7 +7138,7 @@ var TextLayerBuilder = function TextLayerBuilderClosure() {
|
|||
container: textLayerFrag,
|
||||
viewport: this.viewport,
|
||||
textDivs: this.textDivs,
|
||||
timeout: timeout,
|
||||
timeout,
|
||||
enhanceTextSelection: this.enhanceTextSelection
|
||||
});
|
||||
this.textLayerRenderTask.promise.then(function () {
|
||||
|
@ -7333,12 +7333,12 @@ var TextLayerBuilder = function TextLayerBuilderClosure() {
|
|||
}();
|
||||
function DefaultTextLayerFactory() {}
|
||||
DefaultTextLayerFactory.prototype = {
|
||||
createTextLayerBuilder: function (textLayerDiv, pageIndex, viewport, enhanceTextSelection) {
|
||||
createTextLayerBuilder(textLayerDiv, pageIndex, viewport, enhanceTextSelection = false) {
|
||||
return new TextLayerBuilder({
|
||||
textLayerDiv: textLayerDiv,
|
||||
pageIndex: pageIndex,
|
||||
viewport: viewport,
|
||||
enhanceTextSelection: enhanceTextSelection
|
||||
textLayerDiv,
|
||||
pageIndex,
|
||||
viewport,
|
||||
enhanceTextSelection
|
||||
});
|
||||
}
|
||||
};
|
||||
|
@ -7373,22 +7373,22 @@ var Toolbar = function ToolbarClosure() {
|
|||
this._bindListeners();
|
||||
}
|
||||
Toolbar.prototype = {
|
||||
setPageNumber: function (pageNumber, pageLabel) {
|
||||
setPageNumber(pageNumber, pageLabel) {
|
||||
this.pageNumber = pageNumber;
|
||||
this.pageLabel = pageLabel;
|
||||
this._updateUIState(false);
|
||||
},
|
||||
setPagesCount: function (pagesCount, hasPageLabels) {
|
||||
setPagesCount(pagesCount, hasPageLabels) {
|
||||
this.pagesCount = pagesCount;
|
||||
this.hasPageLabels = hasPageLabels;
|
||||
this._updateUIState(true);
|
||||
},
|
||||
setPageScale: function (pageScaleValue, pageScale) {
|
||||
setPageScale(pageScaleValue, pageScale) {
|
||||
this.pageScaleValue = pageScaleValue;
|
||||
this.pageScale = pageScale;
|
||||
this._updateUIState(false);
|
||||
},
|
||||
reset: function () {
|
||||
reset() {
|
||||
this.pageNumber = 0;
|
||||
this.pageLabel = null;
|
||||
this.hasPageLabels = false;
|
||||
|
@ -7483,15 +7483,15 @@ var Toolbar = function ToolbarClosure() {
|
|||
items.pageNumber.type = 'text';
|
||||
} else {
|
||||
items.pageNumber.type = 'number';
|
||||
items.numPages.textContent = _ui_utils.mozL10n.get('of_pages', { pagesCount: pagesCount }, 'of {{pagesCount}}');
|
||||
items.numPages.textContent = _ui_utils.mozL10n.get('of_pages', { pagesCount }, 'of {{pagesCount}}');
|
||||
}
|
||||
items.pageNumber.max = pagesCount;
|
||||
}
|
||||
if (this.hasPageLabels) {
|
||||
items.pageNumber.value = this.pageLabel;
|
||||
items.numPages.textContent = _ui_utils.mozL10n.get('page_of_pages', {
|
||||
pageNumber: pageNumber,
|
||||
pagesCount: pagesCount
|
||||
pageNumber,
|
||||
pagesCount
|
||||
}, '({{pageNumber}} of {{pagesCount}})');
|
||||
} else {
|
||||
items.pageNumber.value = pageNumber;
|
||||
|
|
|
@ -1493,8 +1493,6 @@ toolbarbutton.chevron > .toolbarbutton-icon {
|
|||
|
||||
%include ../shared/fullscreen/warning.inc.css
|
||||
%include ../shared/ctrlTab.inc.css
|
||||
%include ../../../devtools/client/themes/responsivedesign.inc.css
|
||||
%include ../../../devtools/client/themes/commandline.inc.css
|
||||
%include ../shared/plugin-doorhanger.inc.css
|
||||
|
||||
notification.pluginVulnerable > .notification-inner > .messageCloseButton:not(:hover) {
|
||||
|
|
|
@ -3105,8 +3105,6 @@ html|*.addon-webext-perm-list {
|
|||
|
||||
%include ../shared/fullscreen/warning.inc.css
|
||||
%include ../shared/ctrlTab.inc.css
|
||||
%include ../../../devtools/client/themes/responsivedesign.inc.css
|
||||
%include ../../../devtools/client/themes/commandline.inc.css
|
||||
%include ../shared/plugin-doorhanger.inc.css
|
||||
|
||||
%include downloads/indicator.css
|
||||
|
|
|
@ -2267,8 +2267,6 @@ notification[value="translation"] {
|
|||
|
||||
%include ../shared/fullscreen/warning.inc.css
|
||||
%include ../shared/ctrlTab.inc.css
|
||||
%include ../../../devtools/client/themes/responsivedesign.inc.css
|
||||
%include ../../../devtools/client/themes/commandline.inc.css
|
||||
%include ../shared/plugin-doorhanger.inc.css
|
||||
|
||||
notification.pluginVulnerable > .notification-inner > .messageCloseButton {
|
||||
|
|
|
@ -251,11 +251,7 @@ if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -a -z "$DEVELOPER_OPTIONS"; then
|
|||
fi
|
||||
|
||||
# bionic in Android < 4.1 doesn't support PIE
|
||||
# On OSX, the linker defaults to building PIE programs when targetting OSX 10.7+,
|
||||
# but not when targetting OSX < 10.7. OSX < 10.7 doesn't support running PIE
|
||||
# programs, so as long as support for OSX 10.6 is kept, we can't build PIE.
|
||||
# Even after dropping 10.6 support, MOZ_PIE would not be useful since it's the
|
||||
# default (and clang says the -pie option is not used).
|
||||
# On OSX, the linker defaults to building PIE programs when targeting OSX 10.7.
|
||||
# On other Unix systems, some file managers (Nautilus) can't start PIE programs
|
||||
if test -n "$gonkdir" && test "$ANDROID_VERSION" -ge 16; then
|
||||
MOZ_PIE=1
|
||||
|
@ -268,7 +264,7 @@ MOZ_ARG_ENABLE_BOOL(pie,
|
|||
MOZ_PIE=1,
|
||||
MOZ_PIE= )
|
||||
|
||||
if test "$GNU_CC" -a -n "$MOZ_PIE"; then
|
||||
if test "$GNU_CC$CLANG_CC" -a -n "$MOZ_PIE"; then
|
||||
AC_MSG_CHECKING([for PIE support])
|
||||
_SAVE_LDFLAGS=$LDFLAGS
|
||||
LDFLAGS="$LDFLAGS -pie"
|
||||
|
|
|
@ -428,7 +428,8 @@ def get_vc_paths(topsrcdir):
|
|||
|
||||
yield (Version(install['installationVersion']), {
|
||||
'x64': [os.path.join(path, r'VC\bin\amd64')],
|
||||
'x86': [os.path.join(path, r'VC\bin\amd64_x86')],
|
||||
# The x64->x86 cross toolchain requires DLLs from the native x64 toolchain.
|
||||
'x86': [os.path.join(path, r'VC\bin\amd64_x86'), os.path.join(path, r'VC\bin\amd64')],
|
||||
})
|
||||
# Then VS2017 and newer.
|
||||
for install in vswhere(['-requires', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64']):
|
||||
|
|
|
@ -1,270 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# 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/.
|
||||
#
|
||||
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
from subprocess import call
|
||||
from shutil import rmtree
|
||||
|
||||
import logging
|
||||
import unittest
|
||||
import mozunit
|
||||
|
||||
|
||||
def banner():
|
||||
"""
|
||||
Display interpreter and system info for the test env
|
||||
"""
|
||||
print '*' * 75
|
||||
cmd = os.path.basename(__file__)
|
||||
print "%s: python version is %s" % (cmd, sys.version)
|
||||
print '*' * 75
|
||||
|
||||
|
||||
def myopts(vals):
|
||||
"""
|
||||
Storage for extra command line args passed.
|
||||
|
||||
Returns:
|
||||
hash - argparse::Namespace object values
|
||||
"""
|
||||
|
||||
if not hasattr(myopts, 'vals'):
|
||||
if 'argparse' in sys.modules:
|
||||
tmp = { } # key existance enables unittest module debug
|
||||
else:
|
||||
tmp = { 'debug': False, 'verbose': False }
|
||||
|
||||
for k in dir(vals):
|
||||
if k[0:1] == '_':
|
||||
continue
|
||||
tmp[k] = getattr(vals, k)
|
||||
myopts.vals = tmp
|
||||
|
||||
return myopts.vals
|
||||
|
||||
|
||||
def path2posix(src):
|
||||
"""
|
||||
Normalize directory path syntax
|
||||
|
||||
Keyword arguments:
|
||||
src - path to normalize
|
||||
|
||||
Returns:
|
||||
scalar - a file path with drive separators and windows slashes removed
|
||||
|
||||
Todo:
|
||||
move to {build,config,tools,toolkit}/python for use in a library
|
||||
"""
|
||||
|
||||
## (drive, tail) = os.path.splitdrive(src)
|
||||
## Support path testing on all platforms
|
||||
drive = ''
|
||||
winpath = src.find(':')
|
||||
if -1 != winpath and 10 > winpath:
|
||||
(drive, tail) = src.split(':', 1)
|
||||
|
||||
if drive:
|
||||
todo = [ '', drive.rstrip(':').lstrip('/').lstrip('\\') ]
|
||||
todo.extend( tail.lstrip('/').lstrip('\\').split('\\') ) # c:\a => [a]
|
||||
else: # os.name == 'posix'
|
||||
todo = src.split('\\')
|
||||
|
||||
dst = '/'.join(todo)
|
||||
return dst
|
||||
|
||||
|
||||
def checkMkdir(work, debug=False):
|
||||
"""
|
||||
Verify arg permutations for directory mutex creation.
|
||||
|
||||
Keyword arguments:
|
||||
None
|
||||
|
||||
Returns:
|
||||
Exception on error
|
||||
|
||||
Note:
|
||||
Exception() rather than self.assertTrue() is used in this test
|
||||
function to enable scatch cleanup on test exit/failure conditions.
|
||||
Not guaranteed by python closures on early exit.
|
||||
"""
|
||||
|
||||
logging.debug("Testing: checkMkdir")
|
||||
|
||||
# On Windows, don't convert paths to POSIX
|
||||
skipposix = sys.platform == "win32"
|
||||
if skipposix:
|
||||
path = os.path.abspath(__file__)
|
||||
dirname_fun = os.path.dirname
|
||||
else:
|
||||
path = path2posix(os.path.abspath(__file__))
|
||||
import posixpath
|
||||
dirname_fun = posixpath.dirname
|
||||
|
||||
src = dirname_fun(path)
|
||||
# root is 5 directories up from path
|
||||
root = reduce(lambda x, _: dirname_fun(x), xrange(5), path)
|
||||
|
||||
rootP = path2posix(root)
|
||||
srcP = path2posix(src)
|
||||
workP = path2posix(work)
|
||||
|
||||
# C:\foo -vs- /c/foo
|
||||
# [0] command paths use /c/foo
|
||||
# [1] os.path.exists() on mingw() requires C:\
|
||||
paths = [
|
||||
"mkdir_bycall", # function generated
|
||||
"mkdir_bydep", # explicit dependency
|
||||
"mkdir_bygen", # by GENERATED_DIRS macro
|
||||
]
|
||||
|
||||
## Use make from the parent "make check" call when available
|
||||
cmd = { 'make': 'make' }
|
||||
shell0 = os.environ.get('MAKE')
|
||||
if shell0:
|
||||
shell = os.path.splitext(shell0)[0] # strip: .exe, .py
|
||||
if -1 != shell.find('make'):
|
||||
print "MAKE COMMAND FOUND: %s" % (shell0)
|
||||
cmd['make'] = shell0 if skipposix else path2posix(shell0)
|
||||
|
||||
args = []
|
||||
args.append('%s' % (cmd['make']))
|
||||
args.append('-C %s' % (work if skipposix else workP))
|
||||
args.append("-f %s/testor.tmpl" % (src if skipposix else srcP))
|
||||
args.append('topsrcdir=%s' % (root if skipposix else rootP))
|
||||
args.append('deps_mkdir_bycall=%s' % paths[0])
|
||||
args.append('deps_mkdir_bydep=%s' % paths[1])
|
||||
args.append('deps_mkdir_bygen=%s' % paths[2])
|
||||
args.append('checkup') # target
|
||||
|
||||
# Call will fail on mingw with output redirected ?!?
|
||||
if debug:
|
||||
pass
|
||||
if False: # if not debug:
|
||||
args.append('>/dev/null')
|
||||
|
||||
cmd = '%s' % (' '.join(args))
|
||||
logging.debug("Running: %s" % (cmd))
|
||||
rc = call(cmd, shell=True)
|
||||
if rc:
|
||||
raise Exception("make failed ($?=%s): cmd=%s" % (rc, cmd))
|
||||
|
||||
for i in paths:
|
||||
path = os.path.join(work, i)
|
||||
logging.debug("Did testing mkdir(%s) succeed?" % (path))
|
||||
if not os.path.exists(path):
|
||||
raise Exception("Test path %s does not exist" % (path))
|
||||
|
||||
|
||||
def parseargs():
|
||||
"""
|
||||
Support additional command line arguments for testing
|
||||
|
||||
Returns:
|
||||
hash - arguments of interested parsed from the command line
|
||||
"""
|
||||
|
||||
opts = None
|
||||
try:
|
||||
import argparse2
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--debug',
|
||||
action="store_true",
|
||||
default=False,
|
||||
help='Enable debug mode')
|
||||
# Cannot overload verbose, Verbose: False enables debugging
|
||||
parser.add_argument('--verbose',
|
||||
action="store_true",
|
||||
default=False,
|
||||
help='Enable verbose mode')
|
||||
parser.add_argument('unittest_args',
|
||||
nargs='*'
|
||||
# help='Slurp/pass remaining args to unittest'
|
||||
)
|
||||
opts = parser.parse_args()
|
||||
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
return opts
|
||||
|
||||
|
||||
class TestMakeLogic(unittest.TestCase):
|
||||
"""
|
||||
Test suite used to validate makefile library rules and macros
|
||||
"""
|
||||
|
||||
def setUp(self):
|
||||
opts = myopts(None) # NameSpace object not hash
|
||||
self.debug = opts['debug']
|
||||
self.verbose = opts['verbose']
|
||||
|
||||
if self.debug:
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
|
||||
if self.verbose:
|
||||
print
|
||||
print "ENVIRONMENT DUMP:"
|
||||
print '=' * 75
|
||||
for k,v in os.environ.items():
|
||||
print "env{%s} => %s" % (k, v)
|
||||
print
|
||||
|
||||
|
||||
def test_path2posix(self):
|
||||
|
||||
todo = {
|
||||
'/dev/null' : '/dev/null',
|
||||
'A:\\a\\b\\c' : '/A/a/b/c',
|
||||
'B:/x/y' : '/B/x/y',
|
||||
'C:/x\\y/z' : '/C/x/y/z',
|
||||
'//FOO/bar/tans': '//FOO/bar/tans',
|
||||
'//X\\a/b\\c/d' : '//X/a/b/c/d',
|
||||
'\\c:mozilla\\sandbox': '/c/mozilla/sandbox',
|
||||
}
|
||||
|
||||
for val,exp in todo.items():
|
||||
found = path2posix(val)
|
||||
tst = "posix2path(%s): %s != %s)" % (val, exp, found)
|
||||
self.assertEqual(exp, found, "%s: invalid path detected" % (tst))
|
||||
|
||||
|
||||
def test_mkdir(self):
|
||||
"""
|
||||
Verify directory creation rules and macros
|
||||
"""
|
||||
|
||||
failed = True
|
||||
|
||||
# Exception handling is used to cleanup scratch space on error
|
||||
try:
|
||||
work = tempfile.mkdtemp()
|
||||
checkMkdir(work, self.debug)
|
||||
failed = False
|
||||
finally:
|
||||
if os.path.exists(work):
|
||||
rmtree(work)
|
||||
|
||||
self.assertFalse(failed, "Unit test failure detected")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
banner()
|
||||
opts = parseargs()
|
||||
myopts(opts)
|
||||
|
||||
if opts:
|
||||
if hasattr(opts, 'unittest_args'):
|
||||
sys.argv[1:] = opts.unittest_args
|
||||
else:
|
||||
sys.argv[1:] = []
|
||||
|
||||
mozunit.main()
|
|
@ -1,64 +0,0 @@
|
|||
# -*- makefile -*-
|
||||
#
|
||||
# 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/.
|
||||
#
|
||||
|
||||
###########################################################################
|
||||
## Intent: Standalone unit tests for makefile rules and target logic
|
||||
###########################################################################
|
||||
|
||||
deps =$(NULL)
|
||||
tgts =$(NULL)
|
||||
|
||||
ifdef VERBOSE
|
||||
tgts += show
|
||||
endif
|
||||
|
||||
# Define macros
|
||||
include $(topsrcdir)/config/makefiles/makeutils.mk
|
||||
include $(topsrcdir)/config/makefiles/autotargets.mk
|
||||
|
||||
##########################
|
||||
## Verify threadsafe mkdir
|
||||
##########################
|
||||
ifdef deps_mkdir_bycall
|
||||
deps += $(call mkdir_deps,deps_mkdir_bycall)
|
||||
tgts += check_mkdir
|
||||
endif
|
||||
ifdef deps_mkdir_bydep
|
||||
deps += $(foreach dir,$(deps_mkdir_bydep),$(dir)/.mkdir.done)
|
||||
tgts += check_mkdir
|
||||
endif
|
||||
ifdef deps_mkdir_bygen
|
||||
GENERATED_DIRS += $(deps_mkdir_bygen)
|
||||
tgts += check_mkdir
|
||||
endif
|
||||
|
||||
###########################
|
||||
## Minimal environment load
|
||||
###########################
|
||||
MKDIR ?= mkdir -p
|
||||
TOUCH ?= touch
|
||||
|
||||
INCLUDED_CONFIG_MK = 1
|
||||
MOZILLA_DIR := $(topsrcdir)
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
##-------------------##
|
||||
##---] TARGETS [---##
|
||||
##-------------------##
|
||||
all::
|
||||
|
||||
# Quarks:
|
||||
# o Use of 'all' would trigger export target processing
|
||||
checkup: $(tgts)
|
||||
|
||||
# AUTO_DEPS - verify GENERATED_DIRS
|
||||
check_mkdir: $(deps) $(AUTO_DEPS)
|
||||
|
||||
show:
|
||||
@echo "tgts=[$(tgts)]"
|
||||
@echo "deps=[$(deps)]"
|
||||
find $(dir $(deps)) -print
|
|
@ -3,4 +3,3 @@
|
|||
[unit-mozunit.py]
|
||||
[unit-nsinstall.py]
|
||||
[unit-printprereleasesuffix.py]
|
||||
[makefiles/autodeps/check_mkdir.py]
|
||||
|
|
|
@ -13,6 +13,8 @@ function setConditionalBreakpoint(dbg, index, condition) {
|
|||
selectMenuItem(dbg, 2);
|
||||
yield waitForElement(dbg, ".conditional-breakpoint-panel input");
|
||||
findElementWithSelector(dbg, ".conditional-breakpoint-panel input").focus();
|
||||
// Position cursor reliably at the end of the text.
|
||||
pressKey(dbg, "End")
|
||||
type(dbg, condition);
|
||||
pressKey(dbg, "Enter");
|
||||
});
|
||||
|
|
|
@ -32,6 +32,8 @@ async function addExpression(dbg, input) {
|
|||
async function editExpression(dbg, input) {
|
||||
info("updating the expression");
|
||||
dblClickElement(dbg, "expressionNode", 1);
|
||||
// Position cursor reliably at the end of the text.
|
||||
pressKey(dbg, "End")
|
||||
type(dbg, input);
|
||||
pressKey(dbg, "Enter");
|
||||
await waitForDispatch(dbg, "EVALUATE_EXPRESSION");
|
||||
|
|
|
@ -553,13 +553,27 @@ function invokeInTab(fnc) {
|
|||
}
|
||||
|
||||
const isLinux = Services.appinfo.OS === "Linux";
|
||||
const isMac = Services.appinfo.OS === "Darwin";
|
||||
const cmdOrCtrl = isLinux ? { ctrlKey: true } : { metaKey: true };
|
||||
// On Mac, going to beginning/end only works with meta+left/right. On
|
||||
// Windows, it only works with home/end. On Linux, apparently, either
|
||||
// ctrl+left/right or home/end work.
|
||||
const endKey = isMac ?
|
||||
{ code: "VK_RIGHT", modifiers: cmdOrCtrl } :
|
||||
{ code: "VK_END" };
|
||||
const startKey = isMac ?
|
||||
{ code: "VK_LEFT", modifiers: cmdOrCtrl } :
|
||||
{ code: "VK_HOME" };
|
||||
const keyMappings = {
|
||||
sourceSearch: { code: "p", modifiers: cmdOrCtrl },
|
||||
fileSearch: { code: "f", modifiers: cmdOrCtrl },
|
||||
Enter: { code: "VK_RETURN" },
|
||||
Up: { code: "VK_UP" },
|
||||
Down: { code: "VK_DOWN" },
|
||||
Right: { code: "VK_RIGHT" },
|
||||
Left: { code: "VK_LEFT" },
|
||||
End: endKey,
|
||||
Start: startKey,
|
||||
Tab: { code: "VK_TAB" },
|
||||
Escape: { code: "VK_ESCAPE" },
|
||||
pauseKey: { code: "VK_F8" },
|
||||
|
|
|
@ -25,6 +25,7 @@ loader.lazyRequireGetter(this, "DebuggerServer", "devtools/server/main", true);
|
|||
loader.lazyRequireGetter(this, "DebuggerClient", "devtools/shared/client/main", true);
|
||||
loader.lazyRequireGetter(this, "BrowserMenus", "devtools/client/framework/browser-menus");
|
||||
loader.lazyRequireGetter(this, "findCssSelector", "devtools/shared/inspector/css-logic", true);
|
||||
loader.lazyRequireGetter(this, "appendStyleSheet", "devtools/client/shared/stylesheet-utils", true);
|
||||
|
||||
loader.lazyImporter(this, "CustomizableUI", "resource:///modules/CustomizableUI.jsm");
|
||||
loader.lazyImporter(this, "AppConstants", "resource://gre/modules/AppConstants.jsm");
|
||||
|
@ -41,6 +42,8 @@ const TABS_PINNED_AVG_HISTOGRAM = "DEVTOOLS_TABS_PINNED_AVERAGE_LINEAR";
|
|||
const COMPACT_LIGHT_ID = "firefox-compact-light@mozilla.org";
|
||||
const COMPACT_DARK_ID = "firefox-compact-dark@mozilla.org";
|
||||
|
||||
const BROWSER_STYLESHEET_URL = "chrome://devtools/skin/devtools-browser.css";
|
||||
|
||||
/**
|
||||
* gDevToolsBrowser exposes functions to connect the gDevTools instance with a
|
||||
* Firefox instance.
|
||||
|
@ -52,6 +55,12 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
|
|||
*/
|
||||
_trackedBrowserWindows: new Set(),
|
||||
|
||||
/**
|
||||
* WeakMap keeping track of the devtools-browser stylesheets loaded in the various
|
||||
* tracked windows.
|
||||
*/
|
||||
_browserStyleSheets: new WeakMap(),
|
||||
|
||||
_telemetry: new Telemetry(),
|
||||
|
||||
_tabStats: {
|
||||
|
@ -490,6 +499,25 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
|
|||
return !!(widgetWrapper && widgetWrapper.provider == CustomizableUI.PROVIDER_API);
|
||||
},
|
||||
|
||||
/**
|
||||
* Add the devtools-browser stylesheet to browser window's document. Returns a promise.
|
||||
*
|
||||
* @param {Window} win
|
||||
* The window on which the stylesheet should be added.
|
||||
* @return {Promise} promise that resolves when the stylesheet is loaded (or rejects
|
||||
* if it fails to load).
|
||||
*/
|
||||
loadBrowserStyleSheet: function (win) {
|
||||
if (this._browserStyleSheets.has(win)) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
let doc = win.document;
|
||||
let {styleSheet, loadPromise} = appendStyleSheet(doc, BROWSER_STYLESHEET_URL);
|
||||
this._browserStyleSheets.set(win, styleSheet);
|
||||
return loadPromise;
|
||||
},
|
||||
|
||||
/**
|
||||
* The deferred promise will be resolved by WebIDE's UI.init()
|
||||
*/
|
||||
|
@ -753,6 +781,12 @@ var gDevToolsBrowser = exports.gDevToolsBrowser = {
|
|||
}
|
||||
}
|
||||
|
||||
let styleSheet = this._browserStyleSheets.get(win);
|
||||
if (styleSheet) {
|
||||
styleSheet.remove();
|
||||
this._browserStyleSheets.delete(win);
|
||||
}
|
||||
|
||||
// Destroy the Developer toolbar if it has been accessed
|
||||
let desc = Object.getOwnPropertyDescriptor(win, "DeveloperToolbar");
|
||||
if (desc && !desc.get) {
|
||||
|
|
|
@ -13,6 +13,7 @@ const Services = require("Services");
|
|||
const {DOMHelpers} = require("resource://devtools/client/shared/DOMHelpers.jsm");
|
||||
|
||||
loader.lazyRequireGetter(this, "system", "devtools/shared/system");
|
||||
loader.lazyRequireGetter(this, "gDevToolsBrowser", "devtools/client/framework/devtools-browser", true);
|
||||
|
||||
/* A host should always allow this much space for the page to be displayed.
|
||||
* There is also a min-height on the browser, but we still don't want to set
|
||||
|
@ -53,8 +54,8 @@ BottomHost.prototype = {
|
|||
/**
|
||||
* Create a box at the bottom of the host tab.
|
||||
*/
|
||||
create: function () {
|
||||
let deferred = defer();
|
||||
create: async function () {
|
||||
await gDevToolsBrowser.loadBrowserStyleSheet(this.hostTab.ownerGlobal);
|
||||
|
||||
let gBrowser = this.hostTab.ownerDocument.defaultView.gBrowser;
|
||||
let ownerDocument = gBrowser.ownerDocument;
|
||||
|
@ -75,22 +76,22 @@ BottomHost.prototype = {
|
|||
this._nbox.appendChild(this._splitter);
|
||||
this._nbox.appendChild(this.frame);
|
||||
|
||||
let frameLoad = () => {
|
||||
this.emit("ready", this.frame);
|
||||
deferred.resolve(this.frame);
|
||||
};
|
||||
|
||||
this.frame.tooltip = "aHTMLTooltip";
|
||||
|
||||
// we have to load something so we can switch documents if we have to
|
||||
this.frame.setAttribute("src", "about:blank");
|
||||
|
||||
let domHelper = new DOMHelpers(this.frame.contentWindow);
|
||||
domHelper.onceDOMReady(frameLoad);
|
||||
let frame = await new Promise(resolve => {
|
||||
let domHelper = new DOMHelpers(this.frame.contentWindow);
|
||||
let frameLoad = () => {
|
||||
this.emit("ready", this.frame);
|
||||
resolve(this.frame);
|
||||
};
|
||||
domHelper.onceDOMReady(frameLoad);
|
||||
focusTab(this.hostTab);
|
||||
});
|
||||
|
||||
focusTab(this.hostTab);
|
||||
|
||||
return deferred.promise;
|
||||
return frame;
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -199,8 +200,8 @@ SidebarHost.prototype = {
|
|||
/**
|
||||
* Create a box in the sidebar of the host tab.
|
||||
*/
|
||||
create: function () {
|
||||
let deferred = defer();
|
||||
create: async function () {
|
||||
await gDevToolsBrowser.loadBrowserStyleSheet(this.hostTab.ownerGlobal);
|
||||
|
||||
let gBrowser = this.hostTab.ownerDocument.defaultView.gBrowser;
|
||||
let ownerDocument = gBrowser.ownerDocument;
|
||||
|
@ -220,20 +221,20 @@ SidebarHost.prototype = {
|
|||
this._sidebar.appendChild(this._splitter);
|
||||
this._sidebar.appendChild(this.frame);
|
||||
|
||||
let frameLoad = () => {
|
||||
this.emit("ready", this.frame);
|
||||
deferred.resolve(this.frame);
|
||||
};
|
||||
|
||||
this.frame.tooltip = "aHTMLTooltip";
|
||||
this.frame.setAttribute("src", "about:blank");
|
||||
|
||||
let domHelper = new DOMHelpers(this.frame.contentWindow);
|
||||
domHelper.onceDOMReady(frameLoad);
|
||||
let frame = await new Promise(resolve => {
|
||||
let domHelper = new DOMHelpers(this.frame.contentWindow);
|
||||
let frameLoad = () => {
|
||||
this.emit("ready", this.frame);
|
||||
resolve(this.frame);
|
||||
};
|
||||
domHelper.onceDOMReady(frameLoad);
|
||||
focusTab(this.hostTab);
|
||||
});
|
||||
|
||||
focusTab(this.hostTab);
|
||||
|
||||
return deferred.promise;
|
||||
return frame;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const SOURCE_MAP_WORKER = "resource://devtools/client/shared/source-map/worker.js";
|
||||
|
||||
const MAX_ORDINAL = 99;
|
||||
const SPLITCONSOLE_ENABLED_PREF = "devtools.toolbox.splitconsoleEnabled";
|
||||
const SPLITCONSOLE_HEIGHT_PREF = "devtools.toolbox.splitconsoleHeight";
|
||||
|
@ -546,6 +548,7 @@ Toolbox.prototype = {
|
|||
// Uses browser loader to access the `Worker` global.
|
||||
this._sourceMapService =
|
||||
this.browserRequire("devtools/client/shared/source-map/index");
|
||||
this._sourceMapService.startSourceMapWorker(SOURCE_MAP_WORKER);
|
||||
return this._sourceMapService;
|
||||
},
|
||||
|
||||
|
@ -2297,7 +2300,7 @@ Toolbox.prototype = {
|
|||
}
|
||||
|
||||
if (this._sourceMapService) {
|
||||
this._sourceMapService.destroyWorker();
|
||||
this._sourceMapService.stopSourceMapWorker();
|
||||
this._sourceMapService = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -501,6 +501,10 @@ netmonitor.toolbar.cookies=Cookies
|
|||
# See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie
|
||||
netmonitor.toolbar.setCookies=Set-Cookies
|
||||
|
||||
# LOCALIZATION NOTE (netmonitor.toolbar.cookies): This is the label displayed
|
||||
# in the network table toolbar, above the "scheme" column.
|
||||
netmonitor.toolbar.scheme=Scheme
|
||||
|
||||
# LOCALIZATION NOTE (netmonitor.toolbar.transferred): This is the label displayed
|
||||
# in the network table toolbar, above the "transferred" column, which is the
|
||||
# compressed / encoded size.
|
||||
|
|
|
@ -24,7 +24,7 @@ EventEmitter.decorate(window);
|
|||
pref("devtools.netmonitor.enabled", true);
|
||||
pref("devtools.netmonitor.filters", "[\"all\"]");
|
||||
pref("devtools.netmonitor.hiddenColumns",
|
||||
"[\"cookies\",\"protocol\",\"remoteip\",\"setCookies\"]");
|
||||
"[\"cookies\",\"protocol\",\"remoteip\",\"scheme\",\"setCookies\"]");
|
||||
pref("devtools.netmonitor.panes-network-details-width", 550);
|
||||
pref("devtools.netmonitor.panes-network-details-height", 450);
|
||||
pref("devtools.netmonitor.har.defaultLogDir", "");
|
||||
|
|
|
@ -447,6 +447,12 @@ body,
|
|||
width: 8%;
|
||||
}
|
||||
|
||||
/* Scheme column */
|
||||
|
||||
.requests-list-scheme {
|
||||
width: 8%;
|
||||
}
|
||||
|
||||
/* Domain column */
|
||||
|
||||
.requests-list-domain {
|
||||
|
|
|
@ -20,6 +20,7 @@ DevToolsModules(
|
|||
'request-list-column-method.js',
|
||||
'request-list-column-protocol.js',
|
||||
'request-list-column-remote-ip.js',
|
||||
'request-list-column-scheme.js',
|
||||
'request-list-column-set-cookies.js',
|
||||
'request-list-column-status.js',
|
||||
'request-list-column-transferred-size.js',
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
/* 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/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
const {
|
||||
createClass,
|
||||
DOM,
|
||||
PropTypes,
|
||||
} = require("devtools/client/shared/vendor/react");
|
||||
|
||||
const { div } = DOM;
|
||||
|
||||
const RequestListColumnScheme = createClass({
|
||||
displayName: "RequestListColumnScheme",
|
||||
|
||||
propTypes: {
|
||||
item: PropTypes.object.isRequired,
|
||||
},
|
||||
|
||||
shouldComponentUpdate(nextProps) {
|
||||
return this.props.item.urlDetails.scheme !== nextProps.item.urlDetails.scheme;
|
||||
},
|
||||
|
||||
render() {
|
||||
const { urlDetails } = this.props.item;
|
||||
return (
|
||||
div({
|
||||
className: "requests-list-column requests-list-scheme",
|
||||
title: urlDetails.scheme
|
||||
},
|
||||
urlDetails.scheme
|
||||
)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = RequestListColumnScheme;
|
|
@ -22,6 +22,7 @@ const RequestListColumnFile = createFactory(require("./request-list-column-file"
|
|||
const RequestListColumnMethod = createFactory(require("./request-list-column-method"));
|
||||
const RequestListColumnProtocol = createFactory(require("./request-list-column-protocol"));
|
||||
const RequestListColumnRemoteIP = createFactory(require("./request-list-column-remote-ip"));
|
||||
const RequestListColumnScheme = createFactory(require("./request-list-column-scheme"));
|
||||
const RequestListColumnSetCookies = createFactory(require("./request-list-column-set-cookies"));
|
||||
const RequestListColumnStatus = createFactory(require("./request-list-column-status"));
|
||||
const RequestListColumnTransferredSize = createFactory(require("./request-list-column-transferred-size"));
|
||||
|
@ -135,6 +136,7 @@ const RequestListItem = createClass({
|
|||
columns.get("method") && RequestListColumnMethod({ item }),
|
||||
columns.get("file") && RequestListColumnFile({ item }),
|
||||
columns.get("protocol") && RequestListColumnProtocol({ item }),
|
||||
columns.get("scheme") && RequestListColumnScheme({ item }),
|
||||
columns.get("domain") && RequestListColumnDomain({ item, onSecurityIconClick }),
|
||||
columns.get("remoteip") && RequestListColumnRemoteIP({ item }),
|
||||
columns.get("cause") && RequestListColumnCause({ item, onCauseBadgeClick }),
|
||||
|
|
|
@ -117,6 +117,10 @@ const HEADERS = [
|
|||
name: "protocol",
|
||||
canFilter: true,
|
||||
},
|
||||
{
|
||||
name: "scheme",
|
||||
canFilter: true,
|
||||
},
|
||||
{
|
||||
name: "domain",
|
||||
canFilter: true,
|
||||
|
|
|
@ -23,6 +23,7 @@ const Columns = I.Record({
|
|||
method: true,
|
||||
file: true,
|
||||
protocol: false,
|
||||
scheme: false,
|
||||
domain: true,
|
||||
remoteip: false,
|
||||
cause: true,
|
||||
|
|
|
@ -38,7 +38,6 @@ const HEADER_FILTERS = HEADERS
|
|||
|
||||
const FILTER_FLAGS = [
|
||||
...HEADER_FILTERS,
|
||||
"scheme",
|
||||
"set-cookie-domain",
|
||||
"set-cookie-name",
|
||||
"set-cookie-value",
|
||||
|
@ -182,8 +181,7 @@ function isFlagFilterMatch(item, { type, value, negative }) {
|
|||
}
|
||||
break;
|
||||
case "scheme":
|
||||
let scheme = new URL(item.url).protocol.replace(":", "").toLowerCase();
|
||||
match = scheme === value;
|
||||
match = item.urlDetails.scheme === value;
|
||||
break;
|
||||
case "regexp":
|
||||
try {
|
||||
|
|
|
@ -176,6 +176,17 @@ function getUrlHost(url) {
|
|||
return decodeUnicodeUrl((new URL(url)).host);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helpers for getting the shceme portion of a url.
|
||||
* For example helper returns "http" from http://domain.com/path/basename
|
||||
*
|
||||
* @param {string} url - url string
|
||||
* @return {string} string scheme of a url
|
||||
*/
|
||||
function getUrlScheme(url) {
|
||||
return (new URL(url)).protocol.replace(":", "").toLowerCase();
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract several details fields from a URL at once.
|
||||
*/
|
||||
|
@ -184,6 +195,7 @@ function getUrlDetails(url) {
|
|||
let host = getUrlHost(url);
|
||||
let hostname = getUrlHostName(url);
|
||||
let unicodeUrl = decodeUnicodeUrl(url);
|
||||
let scheme = getUrlScheme(url);
|
||||
|
||||
// Mark local hosts specially, where "local" is as defined in the W3C
|
||||
// spec for secure contexts.
|
||||
|
@ -202,6 +214,7 @@ function getUrlDetails(url) {
|
|||
return {
|
||||
baseNameWithQuery,
|
||||
host,
|
||||
scheme,
|
||||
unicodeUrl,
|
||||
isLocal
|
||||
};
|
||||
|
@ -296,11 +309,12 @@ module.exports = {
|
|||
decodeUnicodeUrl,
|
||||
getAbbreviatedMimeType,
|
||||
getUrlBaseName,
|
||||
getUrlQuery,
|
||||
getUrlBaseNameWithQuery,
|
||||
getUrlHostName,
|
||||
getUrlHost,
|
||||
getUrlDetails,
|
||||
getUrlHost,
|
||||
getUrlHostName,
|
||||
getUrlQuery,
|
||||
getUrlScheme,
|
||||
parseQueryString,
|
||||
parseFormData,
|
||||
propertiesEqual,
|
||||
|
|
|
@ -56,6 +56,11 @@ function protocol(first, second) {
|
|||
return result || waterfall(first, second);
|
||||
}
|
||||
|
||||
function scheme(first, second) {
|
||||
const result = compareValues(first.urlDetails.scheme, second.urlDetails.scheme);
|
||||
return result || waterfall(first, second);
|
||||
}
|
||||
|
||||
function domain(first, second) {
|
||||
const firstDomain = first.urlDetails.host.toLowerCase();
|
||||
const secondDomain = second.urlDetails.host.toLowerCase();
|
||||
|
@ -119,6 +124,7 @@ exports.Sorters = {
|
|||
method,
|
||||
file,
|
||||
protocol,
|
||||
scheme,
|
||||
cookies,
|
||||
setCookies,
|
||||
domain,
|
||||
|
|
|
@ -20,8 +20,9 @@ const {
|
|||
const {
|
||||
decodeUnicodeUrl,
|
||||
getUrlBaseName,
|
||||
getUrlQuery,
|
||||
getUrlHost,
|
||||
getUrlQuery,
|
||||
getUrlScheme,
|
||||
} = require("devtools/client/netmonitor/src/utils/request-utils");
|
||||
|
||||
/* eslint-disable no-unused-vars, max-len */
|
||||
|
@ -380,6 +381,7 @@ function verifyRequestItemTarget(document, requestList, requestItem, method,
|
|||
let name = getUrlBaseName(url);
|
||||
let query = getUrlQuery(url);
|
||||
let host = getUrlHost(url);
|
||||
let scheme = getUrlScheme(url);
|
||||
let { httpVersion = "", remoteAddress, remotePort } = requestItem;
|
||||
let formattedIPPort = getFormattedIPAndPort(remoteAddress, remotePort);
|
||||
let remoteIP = remoteAddress ? `${formattedIPPort}` : "unknown";
|
||||
|
@ -427,6 +429,12 @@ function verifyRequestItemTarget(document, requestList, requestItem, method,
|
|||
is(target.querySelector(".requests-list-remoteip").getAttribute("title"),
|
||||
remoteIP, "The tooltip remote IP is correct.");
|
||||
|
||||
is(target.querySelector(".requests-list-scheme").textContent,
|
||||
scheme, "The displayed scheme is correct.");
|
||||
|
||||
is(target.querySelector(".requests-list-scheme").getAttribute("title"),
|
||||
scheme, "The tooltip scheme is correct.");
|
||||
|
||||
if (status !== undefined) {
|
||||
let value = target.querySelector(".requests-list-status-icon")
|
||||
.getAttribute("data-code");
|
||||
|
|
|
@ -150,7 +150,8 @@ pref("devtools.netmonitor.enabled", true);
|
|||
pref("devtools.netmonitor.panes-network-details-width", 550);
|
||||
pref("devtools.netmonitor.panes-network-details-height", 450);
|
||||
pref("devtools.netmonitor.filters", "[\"all\"]");
|
||||
pref("devtools.netmonitor.hiddenColumns", "[\"cookies\",\"protocol\",\"remoteip\",\"setCookies\"]");
|
||||
pref("devtools.netmonitor.hiddenColumns",
|
||||
"[\"cookies\",\"protocol\",\"remoteip\",\"scheme\",\"setCookies\"]");
|
||||
|
||||
// The default Network monitor HAR export setting
|
||||
pref("devtools.netmonitor.har.defaultLogDir", "");
|
||||
|
|
|
@ -19,6 +19,8 @@ loader.lazyImporter(this, "BrowserUtils",
|
|||
loader.lazyRequireGetter(this, "Telemetry", "devtools/client/shared/telemetry");
|
||||
loader.lazyRequireGetter(this, "showDoorhanger",
|
||||
"devtools/client/shared/doorhanger", true);
|
||||
loader.lazyRequireGetter(this, "gDevToolsBrowser",
|
||||
"devtools/client/framework/devtools-browser", true);
|
||||
loader.lazyRequireGetter(this, "TouchEventSimulator",
|
||||
"devtools/shared/touch/simulator", true);
|
||||
loader.lazyRequireGetter(this, "flags",
|
||||
|
@ -227,6 +229,8 @@ ResponsiveUI.prototype = {
|
|||
this.mm.loadFrameScript("resource://devtools/client/responsivedesign/responsivedesign-child.js", true);
|
||||
yield ready;
|
||||
|
||||
yield gDevToolsBrowser.loadBrowserStyleSheet(this.mainWindow);
|
||||
|
||||
let requiresFloatingScrollbars =
|
||||
!this.mainWindow.matchMedia("(-moz-overlay-scrollbars)").matches;
|
||||
let started = this.waitForMessage("ResponsiveMode:Start:Done");
|
||||
|
|
|
@ -378,6 +378,9 @@ DeveloperToolbar.prototype.show = function (focus) {
|
|||
// to do any real work.
|
||||
yield this._hidePromise;
|
||||
|
||||
// Append the browser-level stylesheet to the browser document.
|
||||
yield gDevToolsBrowser.loadBrowserStyleSheet(this._chromeWindow);
|
||||
|
||||
this.createToolbar();
|
||||
|
||||
Services.prefs.setBoolPref("devtools.toolbar.visible", true);
|
||||
|
|
|
@ -49,6 +49,7 @@ DevToolsModules(
|
|||
'scroll.js',
|
||||
'source-utils.js',
|
||||
'SplitView.jsm',
|
||||
'stylesheet-utils.js',
|
||||
'suggestion-picker.js',
|
||||
'telemetry.js',
|
||||
'theme.js',
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,43 @@
|
|||
/* 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-env browser */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
* Append a stylesheet to the provided XUL document.
|
||||
*
|
||||
* @param {Document} xulDocument
|
||||
* The XUL document where the stylesheet should be appended.
|
||||
* @param {String} url
|
||||
* The url of the stylesheet to load.
|
||||
* @return {Object}
|
||||
* - styleSheet {XMLStylesheetProcessingInstruction} the instruction node created.
|
||||
* - loadPromise {Promise} that will resolve/reject when the stylesheet finishes
|
||||
* or fails to load.
|
||||
*/
|
||||
function appendStyleSheet(xulDocument, url) {
|
||||
let styleSheetAttr = `href="${url}" type="text/css"`;
|
||||
let styleSheet = xulDocument.createProcessingInstruction(
|
||||
"xml-stylesheet", styleSheetAttr);
|
||||
let loadPromise = new Promise((resolve, reject) => {
|
||||
function onload() {
|
||||
styleSheet.removeEventListener("load", onload);
|
||||
styleSheet.removeEventListener("error", onerror);
|
||||
resolve();
|
||||
}
|
||||
function onerror() {
|
||||
styleSheet.removeEventListener("load", onload);
|
||||
styleSheet.removeEventListener("error", onerror);
|
||||
reject("Failed to load theme file " + url);
|
||||
}
|
||||
|
||||
styleSheet.addEventListener("load", onload);
|
||||
styleSheet.addEventListener("error", onerror);
|
||||
});
|
||||
xulDocument.insertBefore(styleSheet, xulDocument.documentElement);
|
||||
return {styleSheet, loadPromise};
|
||||
}
|
||||
|
||||
exports.appendStyleSheet = appendStyleSheet;
|
|
@ -10,6 +10,8 @@
|
|||
const Services = require("Services");
|
||||
const { gDevTools } = require("devtools/client/framework/devtools");
|
||||
const { watchCSS } = require("devtools/client/shared/css-reload");
|
||||
const { appendStyleSheet } = require("devtools/client/shared/stylesheet-utils");
|
||||
|
||||
let documentElement = document.documentElement;
|
||||
|
||||
let os;
|
||||
|
@ -49,34 +51,6 @@
|
|||
documentElement.style.display = display;
|
||||
}
|
||||
|
||||
/*
|
||||
* Append a new processing instruction and return an object with
|
||||
* - styleSheet: DOMNode
|
||||
* - loadPromise: Promise that resolves once the sheets loads or errors
|
||||
*/
|
||||
function appendStyleSheet(url) {
|
||||
let styleSheetAttr = `href="${url}" type="text/css"`;
|
||||
let styleSheet = document.createProcessingInstruction(
|
||||
"xml-stylesheet", styleSheetAttr);
|
||||
let loadPromise = new Promise((resolve, reject) => {
|
||||
function onload() {
|
||||
styleSheet.removeEventListener("load", onload);
|
||||
styleSheet.removeEventListener("error", onerror);
|
||||
resolve();
|
||||
}
|
||||
function onerror() {
|
||||
styleSheet.removeEventListener("load", onload);
|
||||
styleSheet.removeEventListener("error", onerror);
|
||||
reject("Failed to load theme file " + url);
|
||||
}
|
||||
|
||||
styleSheet.addEventListener("load", onload);
|
||||
styleSheet.addEventListener("error", onerror);
|
||||
});
|
||||
document.insertBefore(styleSheet, documentElement);
|
||||
return {styleSheet, loadPromise};
|
||||
}
|
||||
|
||||
/*
|
||||
* Notify the window that a theme switch finished so tests can check the DOM
|
||||
*/
|
||||
|
@ -112,7 +86,7 @@
|
|||
|
||||
let loadEvents = [];
|
||||
for (let url of newThemeDef.stylesheets) {
|
||||
let {styleSheet, loadPromise} = appendStyleSheet(url);
|
||||
let {styleSheet, loadPromise} = appendStyleSheet(document, url);
|
||||
devtoolsStyleSheets.get(newThemeDef).push(styleSheet);
|
||||
loadEvents.push(loadPromise);
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
%if 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/. */
|
||||
%endif
|
||||
|
||||
/* Developer toolbar */
|
||||
|
||||
@namespace html url("http://www.w3.org/1999/xhtml");
|
||||
|
||||
/* NOTE: THESE NEED TO STAY IN SYNC WITH LIGHT-THEME.CSS AND DARK-THEME.CSS.
|
||||
We are copy/pasting variables from light-theme and dark-theme,
|
||||
since they aren't loaded in this context (within browser.css). */
|
|
@ -3,6 +3,8 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
@import url("resource://devtools/client/themes/splitters.css");
|
||||
@import url("resource://devtools/client/themes/commandline-browser.css");
|
||||
@import url("resource://devtools/client/themes/responsivedesign.css");
|
||||
|
||||
/* Bottom-docked toolbox minimize transition */
|
||||
.devtools-toolbox-bottom-iframe {
|
||||
|
|
|
@ -9,7 +9,9 @@ DIRS += [
|
|||
]
|
||||
|
||||
DevToolsModules(
|
||||
'commandline-browser.css',
|
||||
'common.css',
|
||||
'responsivedesign.css',
|
||||
'splitters.css',
|
||||
'toolbars.css',
|
||||
'variables.css',
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
%if 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/. */
|
||||
%endif
|
||||
|
||||
/* Responsive Mode */
|
||||
|
||||
@namespace html url("http://www.w3.org/1999/xhtml");
|
||||
|
||||
.browserContainer[responsivemode] {
|
||||
background-color: #222;
|
||||
padding: 0 20px 20px 20px;
|
|
@ -8,6 +8,7 @@
|
|||
const { l10n } = require("devtools/client/webconsole/new-console-output/utils/messages");
|
||||
const { getAllFilters } = require("devtools/client/webconsole/new-console-output/selectors/filters");
|
||||
const { getLogLimit } = require("devtools/client/webconsole/new-console-output/selectors/prefs");
|
||||
const { getGripPreviewItems } = require("devtools/client/shared/components/reps/reps");
|
||||
const {
|
||||
MESSAGE_TYPE,
|
||||
MESSAGE_SOURCE
|
||||
|
@ -108,9 +109,8 @@ function matchSearchFilters(message, filters) {
|
|||
let text = filters.text || "";
|
||||
return (
|
||||
text === ""
|
||||
// @TODO currently we return true for any object grip. We should find a way to
|
||||
// search object grips.
|
||||
|| (message.parameters !== null && !Array.isArray(message.parameters))
|
||||
// Look for a match in parameters.
|
||||
|| isTextInParameters(text, message.parameters)
|
||||
// Look for a match in location.
|
||||
|| isTextInFrame(text, message.frame)
|
||||
// Look for a match in stacktrace.
|
||||
|
@ -146,18 +146,56 @@ function matchSearchFilters(message, filters) {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if given text is included in provided stack frame.
|
||||
*/
|
||||
function isTextInFrame(text, frame) {
|
||||
if (!frame) {
|
||||
return false;
|
||||
}
|
||||
// @TODO Change this to Object.values once it's supported in Node's version of V8
|
||||
return Object.keys(frame)
|
||||
.map(key => frame[key])
|
||||
return Object.values(frame)
|
||||
.join(":")
|
||||
.toLocaleLowerCase()
|
||||
.includes(text.toLocaleLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if given text is included in provided parameters.
|
||||
*/
|
||||
function isTextInParameters(text, parameters) {
|
||||
if (!parameters) {
|
||||
return false;
|
||||
}
|
||||
|
||||
text = text.toLocaleLowerCase();
|
||||
return getAllProps(parameters).find(prop =>
|
||||
(prop + "").toLocaleLowerCase().includes(text)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a flat array of all the grips and their properties.
|
||||
*
|
||||
* @param {Array} Grips
|
||||
* @return {Array} Flat array of the grips and their properties.
|
||||
*/
|
||||
function getAllProps(grips) {
|
||||
let result = grips.reduce((res, grip) => {
|
||||
let previewItems = getGripPreviewItems(grip);
|
||||
let allProps = previewItems.length > 0 ? getAllProps(previewItems) : [];
|
||||
return [...res, grip, grip.class, ...allProps];
|
||||
}, []);
|
||||
|
||||
// We are interested only in primitive props (to search for)
|
||||
// not in objects and undefined previews.
|
||||
result = result.filter(grip =>
|
||||
typeof grip != "object" &&
|
||||
typeof grip != "undefined"
|
||||
);
|
||||
|
||||
return [...new Set(result)];
|
||||
}
|
||||
|
||||
function prune(messages, logLimit) {
|
||||
let messageCount = messages.count();
|
||||
if (messageCount > logLimit) {
|
||||
|
|
|
@ -18,11 +18,24 @@ const consoleApiCommands = [
|
|||
"console.log('hello \\nfrom \\rthe \\\"string world!')",
|
||||
"console.log('\xFA\u1E47\u0129\xE7\xF6d\xEA \u021B\u0115\u0219\u0165')",
|
||||
"console.dirxml(window)",
|
||||
"console.log('myarray', ['red', 'green', 'blue'])",
|
||||
"console.log('myregex', /a.b.c/)",
|
||||
"console.table(['red', 'green', 'blue']);",
|
||||
"console.log('myobject', {red: 'redValue', green: 'greenValue', blue: 'blueValue'});",
|
||||
];
|
||||
|
||||
let consoleApi = new Map(consoleApiCommands.map(
|
||||
cmd => [cmd, {keys: [cmd], code: cmd}]));
|
||||
|
||||
consoleApi.set("console.map('mymap')", {
|
||||
keys: ["console.map('mymap')"],
|
||||
code: `
|
||||
var map = new Map();
|
||||
map.set("key1", "value1");
|
||||
map.set("key2", "value2");
|
||||
console.log('mymap', map);
|
||||
`});
|
||||
|
||||
consoleApi.set("console.trace()", {
|
||||
keys: ["console.trace()"],
|
||||
code: `
|
||||
|
|
|
@ -359,6 +359,233 @@ stubPreparedMessages.set("console.dirxml(window)", new ConsoleMessage({
|
|||
"notes": null
|
||||
}));
|
||||
|
||||
stubPreparedMessages.set("console.log('myarray', ['red', 'green', 'blue'])", new ConsoleMessage({
|
||||
"id": "1",
|
||||
"allowRepeating": true,
|
||||
"source": "console-api",
|
||||
"timeStamp": 1493123239624,
|
||||
"type": "log",
|
||||
"level": "log",
|
||||
"messageText": null,
|
||||
"parameters": [
|
||||
"myarray",
|
||||
{
|
||||
"type": "object",
|
||||
"actor": "server1.conn0.child1/obj32",
|
||||
"class": "Array",
|
||||
"extensible": true,
|
||||
"frozen": false,
|
||||
"sealed": false,
|
||||
"ownPropertyLength": 4,
|
||||
"preview": {
|
||||
"kind": "ArrayLike",
|
||||
"length": 3,
|
||||
"items": [
|
||||
"red",
|
||||
"green",
|
||||
"blue"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"repeat": 1,
|
||||
"repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"timeStamp\":1493123239624,\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[\"myarray\",{\"type\":\"object\",\"actor\":\"server1.conn0.child1/obj32\",\"class\":\"Array\",\"extensible\":true,\"frozen\":false,\"sealed\":false,\"ownPropertyLength\":4,\"preview\":{\"kind\":\"ArrayLike\",\"length\":3,\"items\":[\"red\",\"green\",\"blue\"]}}],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html\",\"line\":1,\"column\":27},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[],\"notes\":null}",
|
||||
"stacktrace": null,
|
||||
"frame": {
|
||||
"source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html",
|
||||
"line": 1,
|
||||
"column": 27
|
||||
},
|
||||
"groupId": null,
|
||||
"exceptionDocURL": null,
|
||||
"userProvidedStyles": [],
|
||||
"notes": null
|
||||
}));
|
||||
|
||||
stubPreparedMessages.set("console.log('myregex', /a.b.c/)", new ConsoleMessage({
|
||||
"id": "1",
|
||||
"allowRepeating": true,
|
||||
"source": "console-api",
|
||||
"timeStamp": 1493123770223,
|
||||
"type": "log",
|
||||
"level": "log",
|
||||
"messageText": null,
|
||||
"parameters": [
|
||||
"myregex",
|
||||
{
|
||||
"type": "object",
|
||||
"actor": "server1.conn0.child1/obj33",
|
||||
"class": "RegExp",
|
||||
"extensible": true,
|
||||
"frozen": false,
|
||||
"sealed": false,
|
||||
"ownPropertyLength": 1,
|
||||
"displayString": "/a.b.c/"
|
||||
}
|
||||
],
|
||||
"repeat": 1,
|
||||
"repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"timeStamp\":1493123770223,\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[\"myregex\",{\"type\":\"object\",\"actor\":\"server1.conn0.child1/obj33\",\"class\":\"RegExp\",\"extensible\":true,\"frozen\":false,\"sealed\":false,\"ownPropertyLength\":1,\"displayString\":\"/a.b.c/\"}],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html\",\"line\":1,\"column\":27},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[],\"notes\":null}",
|
||||
"stacktrace": null,
|
||||
"frame": {
|
||||
"source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html",
|
||||
"line": 1,
|
||||
"column": 27
|
||||
},
|
||||
"groupId": null,
|
||||
"exceptionDocURL": null,
|
||||
"userProvidedStyles": [],
|
||||
"notes": null
|
||||
}));
|
||||
|
||||
stubPreparedMessages.set("console.table(['red', 'green', 'blue']);", new ConsoleMessage({
|
||||
"id": "1",
|
||||
"allowRepeating": true,
|
||||
"source": "console-api",
|
||||
"timeStamp": 1493124761377,
|
||||
"type": "table",
|
||||
"level": "log",
|
||||
"messageText": null,
|
||||
"parameters": [
|
||||
{
|
||||
"type": "object",
|
||||
"actor": "server1.conn0.child1/obj34",
|
||||
"class": "Array",
|
||||
"extensible": true,
|
||||
"frozen": false,
|
||||
"sealed": false,
|
||||
"ownPropertyLength": 4,
|
||||
"preview": {
|
||||
"kind": "ArrayLike",
|
||||
"length": 3,
|
||||
"items": [
|
||||
"red",
|
||||
"green",
|
||||
"blue"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"repeat": 1,
|
||||
"repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"timeStamp\":1493124761377,\"type\":\"table\",\"level\":\"log\",\"messageText\":null,\"parameters\":[{\"type\":\"object\",\"actor\":\"server1.conn0.child1/obj34\",\"class\":\"Array\",\"extensible\":true,\"frozen\":false,\"sealed\":false,\"ownPropertyLength\":4,\"preview\":{\"kind\":\"ArrayLike\",\"length\":3,\"items\":[\"red\",\"green\",\"blue\"]}}],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html\",\"line\":1,\"column\":27},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[],\"notes\":null}",
|
||||
"stacktrace": null,
|
||||
"frame": {
|
||||
"source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html",
|
||||
"line": 1,
|
||||
"column": 27
|
||||
},
|
||||
"groupId": null,
|
||||
"exceptionDocURL": null,
|
||||
"userProvidedStyles": [],
|
||||
"notes": null
|
||||
}));
|
||||
|
||||
stubPreparedMessages.set("console.log('myobject', {red: 'redValue', green: 'greenValue', blue: 'blueValue'});", new ConsoleMessage({
|
||||
"id": "1",
|
||||
"allowRepeating": true,
|
||||
"source": "console-api",
|
||||
"timeStamp": 1493125748177,
|
||||
"type": "log",
|
||||
"level": "log",
|
||||
"messageText": null,
|
||||
"parameters": [
|
||||
"myobject",
|
||||
{
|
||||
"type": "object",
|
||||
"actor": "server1.conn0.child1/obj35",
|
||||
"class": "Object",
|
||||
"extensible": true,
|
||||
"frozen": false,
|
||||
"sealed": false,
|
||||
"ownPropertyLength": 3,
|
||||
"preview": {
|
||||
"kind": "Object",
|
||||
"ownProperties": {
|
||||
"red": {
|
||||
"configurable": true,
|
||||
"enumerable": true,
|
||||
"writable": true,
|
||||
"value": "redValue"
|
||||
},
|
||||
"green": {
|
||||
"configurable": true,
|
||||
"enumerable": true,
|
||||
"writable": true,
|
||||
"value": "greenValue"
|
||||
},
|
||||
"blue": {
|
||||
"configurable": true,
|
||||
"enumerable": true,
|
||||
"writable": true,
|
||||
"value": "blueValue"
|
||||
}
|
||||
},
|
||||
"ownPropertiesLength": 3,
|
||||
"safeGetterValues": {}
|
||||
}
|
||||
}
|
||||
],
|
||||
"repeat": 1,
|
||||
"repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"timeStamp\":1493125748177,\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[\"myobject\",{\"type\":\"object\",\"actor\":\"server1.conn0.child1/obj35\",\"class\":\"Object\",\"extensible\":true,\"frozen\":false,\"sealed\":false,\"ownPropertyLength\":3,\"preview\":{\"kind\":\"Object\",\"ownProperties\":{\"red\":{\"configurable\":true,\"enumerable\":true,\"writable\":true,\"value\":\"redValue\"},\"green\":{\"configurable\":true,\"enumerable\":true,\"writable\":true,\"value\":\"greenValue\"},\"blue\":{\"configurable\":true,\"enumerable\":true,\"writable\":true,\"value\":\"blueValue\"}},\"ownPropertiesLength\":3,\"safeGetterValues\":{}}}],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html\",\"line\":1,\"column\":27},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[],\"notes\":null}",
|
||||
"stacktrace": null,
|
||||
"frame": {
|
||||
"source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html",
|
||||
"line": 1,
|
||||
"column": 27
|
||||
},
|
||||
"groupId": null,
|
||||
"exceptionDocURL": null,
|
||||
"userProvidedStyles": [],
|
||||
"notes": null
|
||||
}));
|
||||
|
||||
stubPreparedMessages.set("console.map('mymap')", new ConsoleMessage({
|
||||
"id": "1",
|
||||
"allowRepeating": true,
|
||||
"source": "console-api",
|
||||
"timeStamp": 1493125410207,
|
||||
"type": "log",
|
||||
"level": "log",
|
||||
"messageText": null,
|
||||
"parameters": [
|
||||
"mymap",
|
||||
{
|
||||
"type": "object",
|
||||
"actor": "server1.conn0.child1/obj36",
|
||||
"class": "Map",
|
||||
"extensible": true,
|
||||
"frozen": false,
|
||||
"sealed": false,
|
||||
"ownPropertyLength": 0,
|
||||
"preview": {
|
||||
"kind": "MapLike",
|
||||
"size": 2,
|
||||
"entries": [
|
||||
[
|
||||
"key1",
|
||||
"value1"
|
||||
],
|
||||
[
|
||||
"key2",
|
||||
"value2"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"repeat": 1,
|
||||
"repeatId": "{\"id\":null,\"allowRepeating\":true,\"source\":\"console-api\",\"timeStamp\":1493125410207,\"type\":\"log\",\"level\":\"log\",\"messageText\":null,\"parameters\":[\"mymap\",{\"type\":\"object\",\"actor\":\"server1.conn0.child1/obj36\",\"class\":\"Map\",\"extensible\":true,\"frozen\":false,\"sealed\":false,\"ownPropertyLength\":0,\"preview\":{\"kind\":\"MapLike\",\"size\":2,\"entries\":[[\"key1\",\"value1\"],[\"key2\",\"value2\"]]}}],\"repeatId\":null,\"stacktrace\":null,\"frame\":{\"source\":\"http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html\",\"line\":5,\"column\":1},\"groupId\":null,\"exceptionDocURL\":null,\"userProvidedStyles\":[],\"notes\":null}",
|
||||
"stacktrace": null,
|
||||
"frame": {
|
||||
"source": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html",
|
||||
"line": 5,
|
||||
"column": 1
|
||||
},
|
||||
"groupId": null,
|
||||
"exceptionDocURL": null,
|
||||
"userProvidedStyles": [],
|
||||
"notes": null
|
||||
}));
|
||||
|
||||
stubPreparedMessages.set("console.trace()", new ConsoleMessage({
|
||||
"id": "1",
|
||||
"allowRepeating": true,
|
||||
|
@ -1132,6 +1359,228 @@ stubPackets.set("console.dirxml(window)", {
|
|||
}
|
||||
});
|
||||
|
||||
stubPackets.set("console.log('myarray', ['red', 'green', 'blue'])", {
|
||||
"from": "server1.conn0.child1/consoleActor2",
|
||||
"type": "consoleAPICall",
|
||||
"message": {
|
||||
"addonId": "",
|
||||
"arguments": [
|
||||
"myarray",
|
||||
{
|
||||
"type": "object",
|
||||
"actor": "server1.conn0.child1/obj32",
|
||||
"class": "Array",
|
||||
"extensible": true,
|
||||
"frozen": false,
|
||||
"sealed": false,
|
||||
"ownPropertyLength": 4,
|
||||
"preview": {
|
||||
"kind": "ArrayLike",
|
||||
"length": 3,
|
||||
"items": [
|
||||
"red",
|
||||
"green",
|
||||
"blue"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"columnNumber": 27,
|
||||
"counter": null,
|
||||
"filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html",
|
||||
"functionName": "triggerPacket",
|
||||
"groupName": "",
|
||||
"level": "log",
|
||||
"lineNumber": 1,
|
||||
"private": false,
|
||||
"styles": [],
|
||||
"timeStamp": 1493123239624,
|
||||
"timer": null,
|
||||
"workerType": "none",
|
||||
"category": "webdev"
|
||||
}
|
||||
});
|
||||
|
||||
stubPackets.set("console.log('myregex', /a.b.c/)", {
|
||||
"from": "server1.conn0.child1/consoleActor2",
|
||||
"type": "consoleAPICall",
|
||||
"message": {
|
||||
"addonId": "",
|
||||
"arguments": [
|
||||
"myregex",
|
||||
{
|
||||
"type": "object",
|
||||
"actor": "server1.conn0.child1/obj33",
|
||||
"class": "RegExp",
|
||||
"extensible": true,
|
||||
"frozen": false,
|
||||
"sealed": false,
|
||||
"ownPropertyLength": 1,
|
||||
"displayString": "/a.b.c/"
|
||||
}
|
||||
],
|
||||
"columnNumber": 27,
|
||||
"counter": null,
|
||||
"filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html",
|
||||
"functionName": "triggerPacket",
|
||||
"groupName": "",
|
||||
"level": "log",
|
||||
"lineNumber": 1,
|
||||
"private": false,
|
||||
"styles": [],
|
||||
"timeStamp": 1493123770223,
|
||||
"timer": null,
|
||||
"workerType": "none",
|
||||
"category": "webdev"
|
||||
}
|
||||
});
|
||||
|
||||
stubPackets.set("console.table(['red', 'green', 'blue']);", {
|
||||
"from": "server1.conn0.child1/consoleActor2",
|
||||
"type": "consoleAPICall",
|
||||
"message": {
|
||||
"addonId": "",
|
||||
"arguments": [
|
||||
{
|
||||
"type": "object",
|
||||
"actor": "server1.conn0.child1/obj34",
|
||||
"class": "Array",
|
||||
"extensible": true,
|
||||
"frozen": false,
|
||||
"sealed": false,
|
||||
"ownPropertyLength": 4,
|
||||
"preview": {
|
||||
"kind": "ArrayLike",
|
||||
"length": 3,
|
||||
"items": [
|
||||
"red",
|
||||
"green",
|
||||
"blue"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"columnNumber": 27,
|
||||
"counter": null,
|
||||
"filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html",
|
||||
"functionName": "triggerPacket",
|
||||
"groupName": "",
|
||||
"level": "table",
|
||||
"lineNumber": 1,
|
||||
"private": false,
|
||||
"timeStamp": 1493124761377,
|
||||
"timer": null,
|
||||
"workerType": "none",
|
||||
"styles": [],
|
||||
"category": "webdev"
|
||||
}
|
||||
});
|
||||
|
||||
stubPackets.set("console.log('myobject', {red: 'redValue', green: 'greenValue', blue: 'blueValue'});", {
|
||||
"from": "server1.conn0.child1/consoleActor2",
|
||||
"type": "consoleAPICall",
|
||||
"message": {
|
||||
"addonId": "",
|
||||
"arguments": [
|
||||
"myobject",
|
||||
{
|
||||
"type": "object",
|
||||
"actor": "server1.conn0.child1/obj35",
|
||||
"class": "Object",
|
||||
"extensible": true,
|
||||
"frozen": false,
|
||||
"sealed": false,
|
||||
"ownPropertyLength": 3,
|
||||
"preview": {
|
||||
"kind": "Object",
|
||||
"ownProperties": {
|
||||
"red": {
|
||||
"configurable": true,
|
||||
"enumerable": true,
|
||||
"writable": true,
|
||||
"value": "redValue"
|
||||
},
|
||||
"green": {
|
||||
"configurable": true,
|
||||
"enumerable": true,
|
||||
"writable": true,
|
||||
"value": "greenValue"
|
||||
},
|
||||
"blue": {
|
||||
"configurable": true,
|
||||
"enumerable": true,
|
||||
"writable": true,
|
||||
"value": "blueValue"
|
||||
}
|
||||
},
|
||||
"ownPropertiesLength": 3,
|
||||
"safeGetterValues": {}
|
||||
}
|
||||
}
|
||||
],
|
||||
"columnNumber": 27,
|
||||
"counter": null,
|
||||
"filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html",
|
||||
"functionName": "triggerPacket",
|
||||
"groupName": "",
|
||||
"level": "log",
|
||||
"lineNumber": 1,
|
||||
"private": false,
|
||||
"styles": [],
|
||||
"timeStamp": 1493125748177,
|
||||
"timer": null,
|
||||
"workerType": "none",
|
||||
"category": "webdev"
|
||||
}
|
||||
});
|
||||
|
||||
stubPackets.set("console.map('mymap')", {
|
||||
"from": "server1.conn0.child1/consoleActor2",
|
||||
"type": "consoleAPICall",
|
||||
"message": {
|
||||
"addonId": "",
|
||||
"arguments": [
|
||||
"mymap",
|
||||
{
|
||||
"type": "object",
|
||||
"actor": "server1.conn0.child1/obj36",
|
||||
"class": "Map",
|
||||
"extensible": true,
|
||||
"frozen": false,
|
||||
"sealed": false,
|
||||
"ownPropertyLength": 0,
|
||||
"preview": {
|
||||
"kind": "MapLike",
|
||||
"size": 2,
|
||||
"entries": [
|
||||
[
|
||||
"key1",
|
||||
"value1"
|
||||
],
|
||||
[
|
||||
"key2",
|
||||
"value2"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"columnNumber": 1,
|
||||
"counter": null,
|
||||
"filename": "http://example.com/browser/devtools/client/webconsole/new-console-output/test/fixtures/stub-generators/test-console-api.html",
|
||||
"functionName": "triggerPacket",
|
||||
"groupName": "",
|
||||
"level": "log",
|
||||
"lineNumber": 5,
|
||||
"private": false,
|
||||
"styles": [],
|
||||
"timeStamp": 1493125410207,
|
||||
"timer": null,
|
||||
"workerType": "none",
|
||||
"category": "webdev"
|
||||
}
|
||||
});
|
||||
|
||||
stubPackets.set("console.trace()", {
|
||||
"from": "server1.conn12.child1/consoleActor2",
|
||||
"type": "consoleAPICall",
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
const expect = require("expect");
|
||||
|
||||
const actions = require("devtools/client/webconsole/new-console-output/actions/index");
|
||||
const { getAllMessages } = require("devtools/client/webconsole/new-console-output/selectors/messages");
|
||||
const { setupStore } = require("devtools/client/webconsole/new-console-output/test/helpers");
|
||||
|
||||
describe("Searching in grips", () => {
|
||||
let store;
|
||||
|
||||
beforeEach(() => {
|
||||
store = prepareBaseStore();
|
||||
store.dispatch(actions.filtersClear());
|
||||
});
|
||||
|
||||
describe("Search in table & array & object props", () => {
|
||||
it("matches on value grips", () => {
|
||||
store.dispatch(actions.filterTextSet("red"));
|
||||
expect(getAllMessages(store.getState()).size).toEqual(3);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Search in object value", () => {
|
||||
it("matches on value grips", () => {
|
||||
store.dispatch(actions.filterTextSet("redValue"));
|
||||
expect(getAllMessages(store.getState()).size).toEqual(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Search in regex", () => {
|
||||
it("matches on value grips", () => {
|
||||
store.dispatch(actions.filterTextSet("a.b.c"));
|
||||
expect(getAllMessages(store.getState()).size).toEqual(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Search in map values", () => {
|
||||
it("matches on value grips", () => {
|
||||
store.dispatch(actions.filterTextSet("value1"));
|
||||
expect(getAllMessages(store.getState()).size).toEqual(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Search in map keys", () => {
|
||||
it("matches on value grips", () => {
|
||||
store.dispatch(actions.filterTextSet("key1"));
|
||||
expect(getAllMessages(store.getState()).size).toEqual(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Search in text", () => {
|
||||
it("matches on value grips", () => {
|
||||
store.dispatch(actions.filterTextSet("myobj"));
|
||||
expect(getAllMessages(store.getState()).size).toEqual(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function prepareBaseStore() {
|
||||
const store = setupStore([
|
||||
"console.log('foobar', 'test')",
|
||||
"console.warn('danger, will robinson!')",
|
||||
"console.table(['red', 'green', 'blue']);",
|
||||
"console.count('bar')",
|
||||
"console.log('myarray', ['red', 'green', 'blue'])",
|
||||
"console.log('myregex', /a.b.c/)",
|
||||
"console.map('mymap')",
|
||||
"console.log('myobject', {red: 'redValue', green: 'greenValue', blue: 'blueValue'});",
|
||||
]);
|
||||
|
||||
return store;
|
||||
}
|
|
@ -1525,8 +1525,8 @@ Animation::ComposeStyle<RefPtr<AnimValuesStyleRule>&>(
|
|||
|
||||
template
|
||||
void
|
||||
Animation::ComposeStyle<const RawServoAnimationValueMap&>(
|
||||
const RawServoAnimationValueMap& aAnimationValues,
|
||||
Animation::ComposeStyle<RawServoAnimationValueMap&>(
|
||||
RawServoAnimationValueMap& aAnimationValues,
|
||||
const nsCSSPropertyIDSet& aPropertiesToSkip);
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -476,7 +476,7 @@ EffectCompositor::GetServoAnimationRule(
|
|||
const dom::Element* aElement,
|
||||
CSSPseudoElementType aPseudoType,
|
||||
CascadeLevel aCascadeLevel,
|
||||
RawServoAnimationValueMapBorrowed aAnimationValues)
|
||||
RawServoAnimationValueMapBorrowedMut aAnimationValues)
|
||||
{
|
||||
MOZ_ASSERT(aAnimationValues);
|
||||
MOZ_ASSERT(mPresContext && mPresContext->IsDynamic(),
|
||||
|
|
|
@ -25,7 +25,7 @@ class nsIStyleRule;
|
|||
class nsPresContext;
|
||||
class nsStyleContext;
|
||||
struct RawServoAnimationValueMap;
|
||||
typedef RawServoAnimationValueMap const* RawServoAnimationValueMapBorrowed;
|
||||
typedef RawServoAnimationValueMap* RawServoAnimationValueMapBorrowedMut;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
@ -163,7 +163,7 @@ public:
|
|||
const dom::Element* aElement,
|
||||
CSSPseudoElementType aPseudoType,
|
||||
CascadeLevel aCascadeLevel,
|
||||
RawServoAnimationValueMapBorrowed aAnimationValues);
|
||||
RawServoAnimationValueMapBorrowedMut aAnimationValues);
|
||||
|
||||
bool HasPendingStyleUpdates() const;
|
||||
bool HasThrottledStyleUpdates() const;
|
||||
|
|
|
@ -42,6 +42,10 @@ EffectSet::Traverse(nsCycleCollectionTraversalCallback& aCallback)
|
|||
EffectSet::GetEffectSet(const dom::Element* aElement,
|
||||
CSSPseudoElementType aPseudoType)
|
||||
{
|
||||
if (!aElement->MayHaveAnimations()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsIAtom* propName = GetEffectSetPropertyAtom(aPseudoType);
|
||||
return static_cast<EffectSet*>(aElement->GetProperty(propName));
|
||||
}
|
||||
|
@ -56,10 +60,6 @@ EffectSet::GetEffectSet(const nsIFrame* aFrame)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
if (!target->mElement->MayHaveAnimations()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return GetEffectSet(target->mElement, target->mPseudoType);
|
||||
}
|
||||
|
||||
|
|
|
@ -661,7 +661,7 @@ KeyframeEffectReadOnly::ComposeStyleRule(
|
|||
// better to remove the duplicated code.
|
||||
void
|
||||
KeyframeEffectReadOnly::ComposeStyleRule(
|
||||
const RawServoAnimationValueMap& aAnimationValues,
|
||||
RawServoAnimationValueMap& aAnimationValues,
|
||||
const AnimationProperty& aProperty,
|
||||
const AnimationPropertySegment& aSegment,
|
||||
const ComputedTiming& aComputedTiming)
|
||||
|
@ -1881,8 +1881,8 @@ KeyframeEffectReadOnly::ComposeStyle<RefPtr<AnimValuesStyleRule>&>(
|
|||
|
||||
template
|
||||
void
|
||||
KeyframeEffectReadOnly::ComposeStyle<const RawServoAnimationValueMap&>(
|
||||
const RawServoAnimationValueMap& aAnimationValues,
|
||||
KeyframeEffectReadOnly::ComposeStyle<RawServoAnimationValueMap&>(
|
||||
RawServoAnimationValueMap& aAnimationValues,
|
||||
const nsCSSPropertyIDSet& aPropertiesToSkip);
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -431,7 +431,7 @@ private:
|
|||
const AnimationPropertySegment& aSegment,
|
||||
const ComputedTiming& aComputedTiming);
|
||||
|
||||
void ComposeStyleRule(const RawServoAnimationValueMap& aAnimationValues,
|
||||
void ComposeStyleRule(RawServoAnimationValueMap& aAnimationValues,
|
||||
const AnimationProperty& aProperty,
|
||||
const AnimationPropertySegment& aSegment,
|
||||
const ComputedTiming& aComputedTiming);
|
||||
|
|
|
@ -266,7 +266,7 @@ DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time
|
|||
root = mRoot;
|
||||
rootFrame = root->GetPrimaryFrame();
|
||||
if (rootFrame) {
|
||||
if (rootFrame->GetType() == nsGkAtoms::scrollFrame) {
|
||||
if (rootFrame->IsScrollFrame()) {
|
||||
nsIScrollableFrame* scrollFrame = do_QueryFrame(rootFrame);
|
||||
rootRect = nsLayoutUtils::TransformFrameRectToAncestor(
|
||||
rootFrame,
|
||||
|
@ -353,7 +353,7 @@ DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time
|
|||
|
||||
nsIFrame* containerFrame = nsLayoutUtils::GetCrossDocParentFrame(targetFrame);
|
||||
while (containerFrame && containerFrame != rootFrame) {
|
||||
if (containerFrame->GetType() == nsGkAtoms::scrollFrame) {
|
||||
if (containerFrame->IsScrollFrame()) {
|
||||
nsIScrollableFrame* scrollFrame = do_QueryFrame(containerFrame);
|
||||
nsRect subFrameRect = scrollFrame->GetScrollPortRect();
|
||||
nsRect intersectionRectRelativeToContainer =
|
||||
|
|
|
@ -648,8 +648,8 @@ Element::GetScrollFrame(nsIFrame **aStyledFrame, bool aFlushLayout)
|
|||
|
||||
// menu frames implement GetScrollTargetFrame but we don't want
|
||||
// to use it here. Similar for comboboxes.
|
||||
nsIAtom* type = frame->GetType();
|
||||
if (type != nsGkAtoms::menuFrame && type != nsGkAtoms::comboboxControlFrame) {
|
||||
FrameType type = frame->Type();
|
||||
if (type != FrameType::Menu && type != FrameType::ComboboxControl) {
|
||||
nsIScrollableFrame *scrollFrame = frame->GetScrollTargetFrame();
|
||||
if (scrollFrame)
|
||||
return scrollFrame;
|
||||
|
|
|
@ -837,9 +837,6 @@ public:
|
|||
GetElementsByClassName(const nsAString& aClassNames);
|
||||
|
||||
CSSPseudoElementType GetPseudoElementType() const {
|
||||
if (!HasProperties()) {
|
||||
return CSSPseudoElementType::NotPseudo;
|
||||
}
|
||||
nsresult rv = NS_OK;
|
||||
auto raw = GetProperty(nsGkAtoms::pseudoProperty, &rv);
|
||||
if (rv == NS_PROPTABLE_PROP_NOT_THERE) {
|
||||
|
|
|
@ -22,7 +22,7 @@ load 330925-1.xhtml
|
|||
load 336381-1.xhtml
|
||||
load 336715-1.xhtml
|
||||
load 338391-1.xhtml
|
||||
load 338674-1.xhtml
|
||||
skip-if(stylo) load 338674-1.xhtml # bug 1361235
|
||||
load 340733-1.html
|
||||
load 343730-1.xhtml
|
||||
load 343850-1.xhtml
|
||||
|
@ -37,7 +37,7 @@ load 354645-1.xul
|
|||
load 359432-1.xhtml
|
||||
load 360599-1.html
|
||||
load 366200-1.xhtml
|
||||
load 369219-1.xhtml
|
||||
skip-if(stylo) load 369219-1.xhtml # bug 1361235
|
||||
load 369413-1.html
|
||||
load 371124-1.html
|
||||
load 371124-2.html
|
||||
|
@ -45,8 +45,8 @@ load 371466-1.xhtml
|
|||
load 372554-1.html
|
||||
load 375399-1.html
|
||||
load 377360-1.xhtml
|
||||
load 377960-1.html
|
||||
load 377960-2.html
|
||||
skip-if(stylo) load 377960-1.html # bug 1361235
|
||||
skip-if(stylo) load 377960-2.html # bug 1361235
|
||||
load 384663-1.html
|
||||
load 386000-1.html
|
||||
load 386794-1.html
|
||||
|
@ -63,7 +63,7 @@ load 410860-1.xml
|
|||
load 411882-1.xhtml
|
||||
load 416734-1.html
|
||||
load 417852-1.html
|
||||
load 418928-1.html
|
||||
skip-if(stylo) load 418928-1.html # bug 1361235
|
||||
load 420620-1.html
|
||||
load 424276-1.html
|
||||
load 426987-1.html
|
||||
|
@ -97,7 +97,7 @@ load 551631-1.html
|
|||
load 552651.html
|
||||
load 554230-1.xhtml
|
||||
load 558973.html
|
||||
load 561981-1.html
|
||||
skip-if(stylo) load 561981-1.html # bug 1361235
|
||||
load 561981-2.html
|
||||
load 564079-1.html
|
||||
load 564114.html
|
||||
|
@ -107,8 +107,8 @@ load 582601.html
|
|||
load 590395-1.html
|
||||
load 593302-1.html
|
||||
load 593302-2.html
|
||||
load 595606-1.html
|
||||
load 595606-2.html
|
||||
skip-if(stylo) load 595606-1.html # bug 1361235
|
||||
skip-if(stylo) load 595606-2.html # bug 1361235
|
||||
load 601247.html
|
||||
load 603531.html
|
||||
load 604262-1.html
|
||||
|
@ -173,8 +173,8 @@ load 830098.html
|
|||
load 831287.html
|
||||
load 832644.html
|
||||
load 836890.html
|
||||
load 838489-1.html
|
||||
load 838489-2.html
|
||||
skip-if(stylo) load 838489-1.html # bug 1361235
|
||||
skip-if(stylo) load 838489-2.html # bug 1361235
|
||||
load 841205.html
|
||||
load 844404.html
|
||||
load 845093-1.html
|
||||
|
|
|
@ -297,6 +297,7 @@ bool nsContentUtils::sUseActivityCursor = false;
|
|||
bool nsContentUtils::sAnimationsAPICoreEnabled = false;
|
||||
bool nsContentUtils::sAnimationsAPIElementAnimateEnabled = false;
|
||||
bool nsContentUtils::sGetBoxQuadsEnabled = false;
|
||||
bool nsContentUtils::sSkipCursorMoveForSameValueSet = false;
|
||||
|
||||
int32_t nsContentUtils::sPrivacyMaxInnerWidth = 1000;
|
||||
int32_t nsContentUtils::sPrivacyMaxInnerHeight = 1000;
|
||||
|
@ -645,6 +646,10 @@ nsContentUtils::Init()
|
|||
Preferences::AddBoolVarCache(&sGetBoxQuadsEnabled,
|
||||
"layout.css.getBoxQuads.enabled", false);
|
||||
|
||||
Preferences::AddBoolVarCache(&sSkipCursorMoveForSameValueSet,
|
||||
"dom.input.skip_cursor_move_for_same_value_set",
|
||||
true);
|
||||
|
||||
Element::InitCCCallbacks();
|
||||
|
||||
nsCOMPtr<nsIUUIDGenerator> uuidGenerator =
|
||||
|
|
|
@ -2888,6 +2888,13 @@ public:
|
|||
*/
|
||||
static uint64_t GenerateTabId();
|
||||
|
||||
/**
|
||||
* Check whether we should skip moving the cursor for a same-value .value set
|
||||
* on a text input or textarea.
|
||||
*/
|
||||
static bool
|
||||
SkipCursorMoveForSameValueSet() { return sSkipCursorMoveForSameValueSet; }
|
||||
|
||||
private:
|
||||
static bool InitializeEventTable();
|
||||
|
||||
|
@ -3012,6 +3019,7 @@ private:
|
|||
static bool sAnimationsAPICoreEnabled;
|
||||
static bool sAnimationsAPIElementAnimateEnabled;
|
||||
static bool sGetBoxQuadsEnabled;
|
||||
static bool sSkipCursorMoveForSameValueSet;
|
||||
static uint32_t sCookiesLifetimePolicy;
|
||||
static uint32_t sCookiesBehavior;
|
||||
|
||||
|
|
|
@ -1058,8 +1058,9 @@ nsFocusManager::FireDelayedEvents(nsIDocument* aDocument)
|
|||
nsCOMPtr<nsIPresShell> presShell = mDelayedBlurFocusEvents[i].mPresShell;
|
||||
nsCOMPtr<EventTarget> relatedTarget = mDelayedBlurFocusEvents[i].mRelatedTarget;
|
||||
mDelayedBlurFocusEvents.RemoveElementAt(i);
|
||||
SendFocusOrBlurEvent(message, presShell, aDocument, target, 0,
|
||||
false, false, relatedTarget);
|
||||
|
||||
FireFocusOrBlurEvent(message, presShell, target, false, false,
|
||||
relatedTarget);
|
||||
--i;
|
||||
}
|
||||
}
|
||||
|
@ -2081,7 +2082,7 @@ GetDocumentHelper(EventTarget* aTarget)
|
|||
return node->OwnerDoc();
|
||||
}
|
||||
|
||||
void nsFocusManager::SendFocusInOrOutEvent(EventMessage aEventMessage,
|
||||
void nsFocusManager::FireFocusInOrOutEvent(EventMessage aEventMessage,
|
||||
nsIPresShell* aPresShell,
|
||||
nsISupports* aTarget,
|
||||
nsPIDOMWindowOuter* aCurrentFocusedWindow,
|
||||
|
@ -2089,7 +2090,7 @@ void nsFocusManager::SendFocusInOrOutEvent(EventMessage aEventMessage,
|
|||
EventTarget* aRelatedTarget)
|
||||
{
|
||||
NS_ASSERTION(aEventMessage == eFocusIn || aEventMessage == eFocusOut,
|
||||
"Wrong event type for SendFocusInOrOutEvent");
|
||||
"Wrong event type for FireFocusInOrOutEvent");
|
||||
|
||||
nsContentUtils::AddScriptRunner(
|
||||
new FocusInOutEvent(
|
||||
|
@ -2117,11 +2118,6 @@ nsFocusManager::SendFocusOrBlurEvent(EventMessage aEventMessage,
|
|||
nsCOMPtr<EventTarget> eventTarget = do_QueryInterface(aTarget);
|
||||
nsCOMPtr<nsIDocument> eventTargetDoc = GetDocumentHelper(eventTarget);
|
||||
nsCOMPtr<nsIDocument> relatedTargetDoc = GetDocumentHelper(aRelatedTarget);
|
||||
nsCOMPtr<nsPIDOMWindowOuter> currentWindow = mFocusedWindow;
|
||||
nsCOMPtr<nsPIDOMWindowInner> targetWindow = do_QueryInterface(aTarget);
|
||||
nsCOMPtr<nsIDocument> targetDocument = do_QueryInterface(aTarget);
|
||||
nsCOMPtr<nsIContent> currentFocusedContent = currentWindow ?
|
||||
currentWindow->GetFocusedNode() : nullptr;
|
||||
|
||||
// set aRelatedTarget to null if it's not in the same document as eventTarget
|
||||
if (eventTargetDoc != relatedTargetDoc) {
|
||||
|
@ -2149,6 +2145,36 @@ nsFocusManager::SendFocusOrBlurEvent(EventMessage aEventMessage,
|
|||
return;
|
||||
}
|
||||
|
||||
// If mDelayedBlurFocusEvents queue is not empty, check if there are events
|
||||
// that belongs to this doc, if yes, fire them first.
|
||||
if (aDocument && !aDocument->EventHandlingSuppressed() &&
|
||||
mDelayedBlurFocusEvents.Length()) {
|
||||
FireDelayedEvents(aDocument);
|
||||
}
|
||||
|
||||
FireFocusOrBlurEvent(aEventMessage, aPresShell, aTarget, aWindowRaised,
|
||||
aIsRefocus, aRelatedTarget);
|
||||
}
|
||||
|
||||
void
|
||||
nsFocusManager::FireFocusOrBlurEvent(EventMessage aEventMessage,
|
||||
nsIPresShell* aPresShell,
|
||||
nsISupports* aTarget,
|
||||
bool aWindowRaised,
|
||||
bool aIsRefocus,
|
||||
EventTarget* aRelatedTarget)
|
||||
{
|
||||
nsCOMPtr<EventTarget> eventTarget = do_QueryInterface(aTarget);
|
||||
nsCOMPtr<nsIDocument> eventTargetDoc = GetDocumentHelper(eventTarget);
|
||||
nsCOMPtr<nsPIDOMWindowOuter> currentWindow = mFocusedWindow;
|
||||
nsCOMPtr<nsPIDOMWindowInner> targetWindow = do_QueryInterface(aTarget);
|
||||
nsCOMPtr<nsIDocument> targetDocument = do_QueryInterface(aTarget);
|
||||
nsCOMPtr<nsIContent> currentFocusedContent = currentWindow ?
|
||||
currentWindow->GetFocusedNode() : nullptr;
|
||||
|
||||
bool dontDispatchEvent =
|
||||
eventTargetDoc && nsContentUtils::IsUserFocusIgnored(eventTargetDoc);
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
nsAccessibilityService* accService = GetAccService();
|
||||
if (accService) {
|
||||
|
@ -2174,7 +2200,7 @@ nsFocusManager::SendFocusOrBlurEvent(EventMessage aEventMessage,
|
|||
// resolved.
|
||||
if (!targetWindow && !targetDocument) {
|
||||
EventMessage focusInOrOutMessage = aEventMessage == eFocus ? eFocusIn : eFocusOut;
|
||||
SendFocusInOrOutEvent(focusInOrOutMessage, aPresShell, aTarget,
|
||||
FireFocusInOrOutEvent(focusInOrOutMessage, aPresShell, aTarget,
|
||||
currentWindow, currentFocusedContent, aRelatedTarget);
|
||||
}
|
||||
}
|
||||
|
@ -2690,8 +2716,8 @@ nsFocusManager::DetermineElementToMoveFocus(nsPIDOMWindowOuter* aWindow,
|
|||
// autocomplete widget use the noautofocus attribute to allow the focus to
|
||||
// remain outside the popup when it is opened.
|
||||
if (frame) {
|
||||
popupFrame = nsLayoutUtils::GetClosestFrameOfType(frame,
|
||||
nsGkAtoms::menuPopupFrame);
|
||||
popupFrame =
|
||||
nsLayoutUtils::GetClosestFrameOfType(frame, FrameType::MenuPopup);
|
||||
}
|
||||
|
||||
if (popupFrame && !forDocumentNavigation) {
|
||||
|
@ -2917,8 +2943,8 @@ nsFocusManager::DetermineElementToMoveFocus(nsPIDOMWindowOuter* aWindow,
|
|||
// navigation would move outside the popup when tabbing outside the
|
||||
// iframe.
|
||||
if (!forDocumentNavigation) {
|
||||
popupFrame = nsLayoutUtils::GetClosestFrameOfType(frame,
|
||||
nsGkAtoms::menuPopupFrame);
|
||||
popupFrame =
|
||||
nsLayoutUtils::GetClosestFrameOfType(frame, FrameType::MenuPopup);
|
||||
if (popupFrame) {
|
||||
rootContent = popupFrame->GetContent();
|
||||
NS_ASSERTION(rootContent, "Popup frame doesn't have a content node");
|
||||
|
|
|
@ -280,7 +280,8 @@ protected:
|
|||
nsIContent* aContentLostFocus = nullptr);
|
||||
|
||||
/**
|
||||
* Fires a focus or blur event at aTarget.
|
||||
* Send a focus or blur event at aTarget. It may be added to the delayed
|
||||
* event queue if the document is suppressing events.
|
||||
*
|
||||
* aEventMessage should be either eFocus or eBlur.
|
||||
* For blur events, aFocusMethod should normally be non-zero.
|
||||
|
@ -297,7 +298,22 @@ protected:
|
|||
mozilla::dom::EventTarget* aRelatedTarget = nullptr);
|
||||
|
||||
/**
|
||||
* Send a focusin or focusout event
|
||||
* Fire a focus or blur event at aTarget.
|
||||
*
|
||||
* aEventMessage should be either eFocus or eBlur.
|
||||
* For blur events, aFocusMethod should normally be non-zero.
|
||||
*
|
||||
* aWindowRaised should only be true if called from WindowRaised.
|
||||
*/
|
||||
void FireFocusOrBlurEvent(mozilla::EventMessage aEventMessage,
|
||||
nsIPresShell* aPresShell,
|
||||
nsISupports* aTarget,
|
||||
bool aWindowRaised,
|
||||
bool aIsRefocus = false,
|
||||
mozilla::dom::EventTarget* aRelatedTarget = nullptr);
|
||||
|
||||
/**
|
||||
* Fire a focusin or focusout event
|
||||
*
|
||||
* aEventMessage should be either eFocusIn or eFocusOut.
|
||||
*
|
||||
|
@ -313,7 +329,7 @@ protected:
|
|||
* aRelatedTarget is the content related to the event (the object
|
||||
* losing focus for focusin, the object getting focus for focusout).
|
||||
*/
|
||||
void SendFocusInOrOutEvent(mozilla::EventMessage aEventMessage,
|
||||
void FireFocusInOrOutEvent(mozilla::EventMessage aEventMessage,
|
||||
nsIPresShell* aPresShell,
|
||||
nsISupports* aTarget,
|
||||
nsPIDOMWindowOuter* aCurrentFocusedWindow,
|
||||
|
|
|
@ -126,7 +126,6 @@ GK_ATOM(autoplay, "autoplay")
|
|||
GK_ATOM(autorepeatbutton, "autorepeatbutton")
|
||||
GK_ATOM(axis, "axis")
|
||||
GK_ATOM(b, "b")
|
||||
GK_ATOM(backdropFrame, "BackdropFrame")
|
||||
GK_ATOM(background, "background")
|
||||
GK_ATOM(base, "base")
|
||||
GK_ATOM(basefont, "basefont")
|
||||
|
@ -1978,101 +1977,11 @@ GK_ATOM(processingInstructionTagName, "#processing-instruction")
|
|||
GK_ATOM(textTagName, "#text")
|
||||
|
||||
// Frame types
|
||||
GK_ATOM(bcTableCellFrame, "BCTableCellFrame") // table cell in border collapsing model
|
||||
GK_ATOM(blockFrame, "BlockFrame")
|
||||
GK_ATOM(boxFrame, "BoxFrame")
|
||||
GK_ATOM(brFrame, "BRFrame")
|
||||
GK_ATOM(bulletFrame, "BulletFrame")
|
||||
GK_ATOM(colorControlFrame, "colorControlFrame")
|
||||
GK_ATOM(columnSetFrame, "ColumnSetFrame")
|
||||
GK_ATOM(comboboxControlFrame, "ComboboxControlFrame")
|
||||
GK_ATOM(comboboxDisplayFrame, "ComboboxDisplayFrame")
|
||||
GK_ATOM(dateTimeControlFrame, "DateTimeControlFrame")
|
||||
GK_ATOM(deckFrame, "DeckFrame")
|
||||
GK_ATOM(detailsFrame, "DetailsFrame")
|
||||
GK_ATOM(fieldSetFrame, "FieldSetFrame")
|
||||
GK_ATOM(flexContainerFrame, "FlexContainerFrame")
|
||||
GK_ATOM(formControlFrame, "FormControlFrame") // radio or checkbox
|
||||
GK_ATOM(frameSetFrame, "FrameSetFrame")
|
||||
GK_ATOM(gfxButtonControlFrame, "gfxButtonControlFrame")
|
||||
GK_ATOM(gridContainerFrame, "GridContainerFrame")
|
||||
GK_ATOM(HTMLButtonControlFrame, "HTMLButtonControlFrame")
|
||||
GK_ATOM(HTMLCanvasFrame, "HTMLCanvasFrame")
|
||||
GK_ATOM(subDocumentFrame, "subDocumentFrame")
|
||||
GK_ATOM(imageBoxFrame, "ImageBoxFrame")
|
||||
GK_ATOM(imageFrame, "ImageFrame")
|
||||
GK_ATOM(imageControlFrame, "ImageControlFrame")
|
||||
GK_ATOM(inlineFrame, "InlineFrame")
|
||||
GK_ATOM(leafBoxFrame, "LeafBoxFrame")
|
||||
GK_ATOM(legendFrame, "LegendFrame")
|
||||
GK_ATOM(letterFrame, "LetterFrame")
|
||||
GK_ATOM(lineFrame, "LineFrame")
|
||||
GK_ATOM(listControlFrame,"ListControlFrame")
|
||||
GK_ATOM(menuFrame,"MenuFrame")
|
||||
GK_ATOM(meterFrame, "MeterFrame")
|
||||
GK_ATOM(menuPopupFrame,"MenuPopupFrame")
|
||||
GK_ATOM(numberControlFrame, "NumberControlFrame")
|
||||
GK_ATOM(objectFrame, "ObjectFrame")
|
||||
GK_ATOM(pageFrame, "PageFrame")
|
||||
GK_ATOM(pageBreakFrame, "PageBreakFrame")
|
||||
GK_ATOM(pageContentFrame, "PageContentFrame")
|
||||
//
|
||||
// TODO(emilio): Rename this? This is only used now to mark the style context of
|
||||
// the placeholder with a dummy pseudo.
|
||||
GK_ATOM(placeholderFrame, "PlaceholderFrame")
|
||||
GK_ATOM(popupSetFrame, "PopupSetFrame")
|
||||
GK_ATOM(progressFrame, "ProgressFrame")
|
||||
GK_ATOM(canvasFrame, "CanvasFrame")
|
||||
GK_ATOM(rangeFrame, "RangeFrame")
|
||||
GK_ATOM(rootFrame, "RootFrame")
|
||||
GK_ATOM(rubyBaseContainerFrame, "RubyBaseContainerFrame")
|
||||
GK_ATOM(rubyBaseFrame, "RubyBaseFrame")
|
||||
GK_ATOM(rubyFrame, "RubyFrame")
|
||||
GK_ATOM(rubyTextContainerFrame, "RubyTextContainerFrame")
|
||||
GK_ATOM(rubyTextFrame, "RubyTextFrame")
|
||||
GK_ATOM(scrollFrame, "ScrollFrame")
|
||||
GK_ATOM(scrollbarFrame, "ScrollbarFrame")
|
||||
GK_ATOM(sequenceFrame, "SequenceFrame")
|
||||
GK_ATOM(sliderFrame, "sliderFrame")
|
||||
GK_ATOM(tableCellFrame, "TableCellFrame")
|
||||
GK_ATOM(tableColFrame, "TableColFrame")
|
||||
GK_ATOM(tableColGroupFrame, "TableColGroupFrame")
|
||||
GK_ATOM(tableFrame, "TableFrame")
|
||||
GK_ATOM(tableWrapperFrame, "TableWrapperFrame")
|
||||
GK_ATOM(tableRowGroupFrame, "TableRowGroupFrame")
|
||||
GK_ATOM(tableRowFrame, "TableRowFrame")
|
||||
GK_ATOM(textInputFrame,"TextInputFrame")
|
||||
GK_ATOM(textFrame, "TextFrame")
|
||||
GK_ATOM(viewportFrame, "ViewportFrame")
|
||||
#ifdef MOZ_XUL
|
||||
GK_ATOM(XULLabelFrame, "XULLabelFrame")
|
||||
#endif
|
||||
GK_ATOM(svgAFrame, "SVGAFrame")
|
||||
GK_ATOM(svgClipPathFrame, "SVGClipPathFrame")
|
||||
GK_ATOM(svgDefsFrame, "SVGDefsFrame")
|
||||
GK_ATOM(svgFEContainerFrame, "SVGFEContainerFrame")
|
||||
GK_ATOM(svgFEImageFrame, "SVGFEImageFrame")
|
||||
GK_ATOM(svgFELeafFrame, "SVGFELeafFrame")
|
||||
GK_ATOM(svgFEUnstyledLeafFrame, "SVGFEUnstyledLeafFrame")
|
||||
GK_ATOM(svgFilterFrame, "SVGFilterFrame")
|
||||
GK_ATOM(svgForeignObjectFrame, "SVGForeignObjectFrame")
|
||||
GK_ATOM(svgGenericContainerFrame, "SVGGenericContainerFrame")
|
||||
GK_ATOM(svgGeometryFrame, "SVGGeometryFrame")
|
||||
GK_ATOM(svgGFrame, "SVGGFrame")
|
||||
GK_ATOM(svgGradientFrame, "SVGGradientFrame")
|
||||
GK_ATOM(svgImageFrame, "SVGImageFrame")
|
||||
GK_ATOM(svgInnerSVGFrame, "SVGInnerSVGFrame")
|
||||
GK_ATOM(svgLinearGradientFrame, "SVGLinearGradientFrame")
|
||||
GK_ATOM(svgMarkerFrame, "SVGMarkerFrame")
|
||||
GK_ATOM(svgMarkerAnonChildFrame, "SVGMarkerAnonChildFrame")
|
||||
GK_ATOM(svgMaskFrame, "SVGMaskFrame")
|
||||
GK_ATOM(svgOuterSVGFrame, "SVGOuterSVGFrame")
|
||||
GK_ATOM(svgOuterSVGAnonChildFrame, "SVGOuterSVGAnonChildFrame")
|
||||
GK_ATOM(svgPatternFrame, "SVGPatternFrame")
|
||||
GK_ATOM(svgRadialGradientFrame, "SVGRadialGradientFrame")
|
||||
GK_ATOM(svgStopFrame, "SVGStopFrame")
|
||||
GK_ATOM(svgSwitchFrame, "SVGSwitchFrame")
|
||||
GK_ATOM(svgTextFrame, "SVGTextFrame")
|
||||
GK_ATOM(svgUseFrame, "SVGUseFrame")
|
||||
GK_ATOM(svgViewFrame, "SVGViewFrame")
|
||||
GK_ATOM(HTMLVideoFrame, "VideoFrame")
|
||||
|
||||
GK_ATOM(onloadend, "onloadend")
|
||||
GK_ATOM(onloadstart, "onloadstart")
|
||||
GK_ATOM(onprogress, "onprogress")
|
||||
|
@ -2367,7 +2276,6 @@ GK_ATOM(aria_valuenow, "aria-valuenow")
|
|||
GK_ATOM(aria_valuemin, "aria-valuemin")
|
||||
GK_ATOM(aria_valuemax, "aria-valuemax")
|
||||
GK_ATOM(aria_valuetext, "aria-valuetext")
|
||||
GK_ATOM(AreaFrame, "AreaFrame")
|
||||
GK_ATOM(auto_generated, "auto-generated")
|
||||
GK_ATOM(banner, "banner")
|
||||
GK_ATOM(checkable, "checkable")
|
||||
|
@ -2388,7 +2296,6 @@ GK_ATOM(grammar, "grammar")
|
|||
GK_ATOM(gridcell, "gridcell")
|
||||
GK_ATOM(heading, "heading")
|
||||
GK_ATOM(hitregion, "hitregion")
|
||||
GK_ATOM(InlineBlockFrame, "InlineBlockFrame")
|
||||
GK_ATOM(inlinevalue, "inline")
|
||||
GK_ATOM(invalid, "invalid")
|
||||
GK_ATOM(item, "item")
|
||||
|
|
|
@ -103,6 +103,7 @@
|
|||
#include "nsIDocShell.h"
|
||||
#include "nsIDocCharset.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDocumentInlines.h"
|
||||
#include "Crypto.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMElement.h"
|
||||
|
@ -977,6 +978,7 @@ nsPIDOMWindow<T>::nsPIDOMWindow(nsPIDOMWindowOuter *aOuterWindow)
|
|||
mIsHandlingResizeEvent(false), mIsInnerWindow(aOuterWindow != nullptr),
|
||||
mMayHavePaintEventListener(false), mMayHaveTouchEventListener(false),
|
||||
mMayHaveMouseEnterLeaveEventListener(false),
|
||||
mMayHaveMouseMoveEventListener(false),
|
||||
mMayHavePointerEnterLeaveEventListener(false),
|
||||
mInnerObjectsFreed(false),
|
||||
mIsModalContentWindow(false),
|
||||
|
@ -2044,6 +2046,23 @@ nsGlobalWindow::FreeInnerObjects()
|
|||
{
|
||||
NS_ASSERTION(IsInnerWindow(), "Don't free inner objects on an outer window");
|
||||
|
||||
if (mDoc && !nsContentUtils::IsSystemPrincipal(mDoc->NodePrincipal())) {
|
||||
EventTarget* win = this;
|
||||
EventTarget* html = mDoc->GetHtmlElement();
|
||||
EventTarget* body = mDoc->GetBodyElement();
|
||||
|
||||
bool mouseAware = AsInner()->HasMouseMoveEventListeners();
|
||||
bool keyboardAware = win->MayHaveAPZAwareKeyEventListener() ||
|
||||
mDoc->MayHaveAPZAwareKeyEventListener() ||
|
||||
(html && html->MayHaveAPZAwareKeyEventListener()) ||
|
||||
(body && body->MayHaveAPZAwareKeyEventListener());
|
||||
|
||||
Telemetry::Accumulate(Telemetry::APZ_AWARE_MOUSEMOVE_LISTENERS,
|
||||
mouseAware ? 1 : 0);
|
||||
Telemetry::Accumulate(Telemetry::APZ_AWARE_KEY_LISTENERS,
|
||||
keyboardAware ? 1 : 0);
|
||||
}
|
||||
|
||||
// Make sure that this is called before we null out the document and
|
||||
// other members that the window destroyed observers could
|
||||
// re-create.
|
||||
|
@ -14028,7 +14047,7 @@ nsGlobalWindow::BeginWindowMove(Event& aMouseDownEvent, Element* aPanel,
|
|||
#ifdef MOZ_XUL
|
||||
if (aPanel) {
|
||||
nsIFrame* frame = aPanel->GetPrimaryFrame();
|
||||
if (!frame || frame->GetType() != nsGkAtoms::menuPopupFrame) {
|
||||
if (!frame || !frame->IsMenuPopupFrame()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1477,9 +1477,20 @@ nsJSContext::RunCycleCollectorSlice()
|
|||
TimeStamp now = TimeStamp::Now();
|
||||
|
||||
// Only run a limited slice if we're within the max running time.
|
||||
if (TimeBetween(gCCStats.mBeginTime, now) < kMaxICCDuration) {
|
||||
float sliceMultiplier = std::max(TimeBetween(gCCStats.mEndSliceTime, now) / (float)kICCIntersliceDelay, 1.0f);
|
||||
budget = js::SliceBudget(js::TimeBudget(kICCSliceBudget * sliceMultiplier));
|
||||
uint32_t runningTime = TimeBetween(gCCStats.mBeginTime, now);
|
||||
if (runningTime < kMaxICCDuration) {
|
||||
// Try to make up for a delay in running this slice.
|
||||
float sliceDelayMultiplier = TimeBetween(gCCStats.mEndSliceTime, now) / (float)kICCIntersliceDelay;
|
||||
float delaySliceBudget = kICCSliceBudget * sliceDelayMultiplier;
|
||||
|
||||
// Increase slice budgets up to |maxLaterSlice| as we approach
|
||||
// half way through the ICC, to avoid large sync CCs.
|
||||
float percentToHalfDone = std::min(2.0f * runningTime / kMaxICCDuration, 1.0f);
|
||||
const float maxLaterSlice = 40.0f;
|
||||
float laterSliceBudget = maxLaterSlice * percentToHalfDone;
|
||||
|
||||
budget = js::SliceBudget(js::TimeBudget(std::max({delaySliceBudget,
|
||||
laterSliceBudget, (float)kICCSliceBudget})));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -539,6 +539,9 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, bool aClone, bool aDeep,
|
|||
if (elm->MayHaveTouchEventListener()) {
|
||||
window->SetHasTouchEventListeners();
|
||||
}
|
||||
if (elm->MayHaveMouseMoveEventListener()) {
|
||||
window->SetHasMouseMoveEventListeners();
|
||||
}
|
||||
if (elm->MayHaveMouseEnterLeaveEventListener()) {
|
||||
window->SetHasMouseEnterLeaveEventListeners();
|
||||
}
|
||||
|
|
|
@ -669,6 +669,7 @@ protected:
|
|||
bool mMayHavePaintEventListener;
|
||||
bool mMayHaveTouchEventListener;
|
||||
bool mMayHaveMouseEnterLeaveEventListener;
|
||||
bool mMayHaveMouseMoveEventListener;
|
||||
bool mMayHavePointerEnterLeaveEventListener;
|
||||
|
||||
// Used to detect whether we have called FreeInnerObjects() (e.g. to ensure
|
||||
|
@ -814,6 +815,24 @@ public:
|
|||
mMutationBits |= aType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this to check whether some node (this window, its document,
|
||||
* or content in that document) has or had a mousemove event listener.
|
||||
*/
|
||||
bool HasMouseMoveEventListeners()
|
||||
{
|
||||
return mMayHaveMouseMoveEventListener;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this to indicate that some node (this window, its document,
|
||||
* or content in that document) has or had a mousemove event listener.
|
||||
*/
|
||||
void SetHasMouseMoveEventListeners()
|
||||
{
|
||||
mMayHaveMouseMoveEventListener = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this to check whether some node (this window, its document,
|
||||
* or content in that document) has a mouseenter/leave event listener.
|
||||
|
|
|
@ -2973,7 +2973,7 @@ GetTextFrameForContent(nsIContent* aContent, bool aFlushLayout)
|
|||
}
|
||||
|
||||
nsIFrame* frame = aContent->GetPrimaryFrame();
|
||||
if (frame && frame->GetType() == nsGkAtoms::textFrame) {
|
||||
if (frame && frame->IsTextFrame()) {
|
||||
return static_cast<nsTextFrame*>(frame);
|
||||
}
|
||||
}
|
||||
|
@ -3513,9 +3513,8 @@ GetRequiredInnerTextLineBreakCount(nsIFrame* aFrame)
|
|||
static bool
|
||||
IsLastCellOfRow(nsIFrame* aFrame)
|
||||
{
|
||||
nsIAtom* type = aFrame->GetType();
|
||||
if (type != nsGkAtoms::tableCellFrame &&
|
||||
type != nsGkAtoms::bcTableCellFrame) {
|
||||
FrameType type = aFrame->Type();
|
||||
if (type != FrameType::TableCell && type != FrameType::BCTableCell) {
|
||||
return true;
|
||||
}
|
||||
for (nsIFrame* c = aFrame; c; c = c->GetNextContinuation()) {
|
||||
|
@ -3529,7 +3528,7 @@ IsLastCellOfRow(nsIFrame* aFrame)
|
|||
static bool
|
||||
IsLastRowOfRowGroup(nsIFrame* aFrame)
|
||||
{
|
||||
if (aFrame->GetType() != nsGkAtoms::tableRowFrame) {
|
||||
if (!aFrame->IsTableRowFrame()) {
|
||||
return true;
|
||||
}
|
||||
for (nsIFrame* c = aFrame; c; c = c->GetNextContinuation()) {
|
||||
|
@ -3543,7 +3542,7 @@ IsLastRowOfRowGroup(nsIFrame* aFrame)
|
|||
static bool
|
||||
IsLastNonemptyRowGroupOfTable(nsIFrame* aFrame)
|
||||
{
|
||||
if (aFrame->GetType() != nsGkAtoms::tableRowGroupFrame) {
|
||||
if (!aFrame->IsTableRowGroupFrame()) {
|
||||
return true;
|
||||
}
|
||||
for (nsIFrame* c = aFrame; c; c = c->GetNextContinuation()) {
|
||||
|
|
|
@ -3990,11 +3990,15 @@ class CGUpdateMemberSlotsMethod(CGAbstractStaticMethod):
|
|||
body += fill(
|
||||
"""
|
||||
|
||||
static_assert(${slot} < js::shadow::Object::MAX_FIXED_SLOTS,
|
||||
"Not enough fixed slots to fit '${interface}.${member}. Ion's visitGetDOMMemberV/visitGetDOMMemberT assume StoreInSlot things are all in fixed slots.");
|
||||
if (!get_${member}(aCx, aWrapper, aObject, args)) {
|
||||
return false;
|
||||
}
|
||||
// Getter handled setting our reserved slots
|
||||
""",
|
||||
slot=memberReservedSlot(m, self.descriptor),
|
||||
interface=self.descriptor.interface.identifier.name,
|
||||
member=m.identifier.name)
|
||||
|
||||
body += "\nreturn true;\n"
|
||||
|
|
|
@ -573,7 +573,10 @@ class IDLExternalInterface(IDLObjectWithIdentifier, IDLExposureMixins):
|
|||
return False
|
||||
|
||||
def addExtendedAttributes(self, attrs):
|
||||
assert len(attrs) == 0
|
||||
if len(attrs) != 0:
|
||||
raise WebIDLError("There are no extended attributes that are "
|
||||
"allowed on external interfaces",
|
||||
[attrs[0].location, self.location])
|
||||
|
||||
def resolve(self, parentScope):
|
||||
pass
|
||||
|
@ -1932,7 +1935,10 @@ class IDLDictionary(IDLObjectWithScope):
|
|||
[member.location] + locations)
|
||||
|
||||
def addExtendedAttributes(self, attrs):
|
||||
assert len(attrs) == 0
|
||||
if len(attrs) != 0:
|
||||
raise WebIDLError("There are no extended attributes that are "
|
||||
"allowed on dictionaries",
|
||||
[attrs[0].location, self.location])
|
||||
|
||||
def _getDependentObjects(self):
|
||||
deps = set(self.members)
|
||||
|
@ -1966,7 +1972,10 @@ class IDLEnum(IDLObjectWithIdentifier):
|
|||
return True
|
||||
|
||||
def addExtendedAttributes(self, attrs):
|
||||
assert len(attrs) == 0
|
||||
if len(attrs) != 0:
|
||||
raise WebIDLError("There are no extended attributes that are "
|
||||
"allowed on enums",
|
||||
[attrs[0].location, self.location])
|
||||
|
||||
def _getDependentObjects(self):
|
||||
return set()
|
||||
|
@ -2139,7 +2148,11 @@ class IDLType(IDLObject):
|
|||
return self.nullable() and self.inner.callback._treatNonObjectAsNull
|
||||
|
||||
def addExtendedAttributes(self, attrs):
|
||||
assert len(attrs) == 0
|
||||
if len(attrs) != 0:
|
||||
raise WebIDLError("There are no extended attributes that are "
|
||||
"allowed on types, for now (but this is "
|
||||
"changing; see bug 1359269)",
|
||||
[attrs[0].location, self.location])
|
||||
|
||||
def resolveType(self, parentScope):
|
||||
pass
|
||||
|
@ -2707,7 +2720,10 @@ class IDLTypedef(IDLObjectWithIdentifier):
|
|||
return True
|
||||
|
||||
def addExtendedAttributes(self, attrs):
|
||||
assert len(attrs) == 0
|
||||
if len(attrs) != 0:
|
||||
raise WebIDLError("There are no extended attributes that are "
|
||||
"allowed on typedefs",
|
||||
[attrs[0].location, self.location])
|
||||
|
||||
def _getDependentObjects(self):
|
||||
return self.innerType._getDependentObjects()
|
||||
|
@ -5108,7 +5124,10 @@ class IDLImplementsStatement(IDLObject):
|
|||
pass
|
||||
|
||||
def addExtendedAttributes(self, attrs):
|
||||
assert len(attrs) == 0
|
||||
if len(attrs) != 0:
|
||||
raise WebIDLError("There are no extended attributes that are "
|
||||
"allowed on implements statements",
|
||||
[attrs[0].location, self.location])
|
||||
|
||||
|
||||
class IDLExtendedAttribute(IDLObject):
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче