Merge mozilla-central to services-central.
@ -106,7 +106,9 @@ nsARIAGridAccessible::GetColumnCount(PRInt32 *acolumnCount)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
AccIterator rowIter(this, filters::GetRow);
|
||||
nsAccessible *row = rowIter.GetNext();
|
||||
nsAccessible* row = rowIter.GetNext();
|
||||
if (!row)
|
||||
return NS_OK;
|
||||
|
||||
AccIterator cellIter(row, filters::GetCell);
|
||||
nsAccessible *cell = nsnull;
|
||||
|
@ -43,7 +43,7 @@
|
||||
It is designed to be used as inline input to nsAccessibilityAtoms.cpp *only*
|
||||
through the magic of C preprocessing.
|
||||
|
||||
All entires must be enclosed in the macro ACCESSIBILITY_ATOM which will have cruel
|
||||
All entries must be enclosed in the macro ACCESSIBILITY_ATOM which will have cruel
|
||||
and unusual things done to it
|
||||
|
||||
It is recommended (but not strictly necessary) to keep all entries
|
||||
|
@ -663,6 +663,11 @@ PRUint64
|
||||
nsAccessible::NativeState()
|
||||
{
|
||||
PRUint64 state = 0;
|
||||
|
||||
nsDocAccessible* document = GetDocAccessible();
|
||||
if (!document || !document->IsInDocument(this))
|
||||
state |= states::STALE;
|
||||
|
||||
PRBool disabled = PR_FALSE;
|
||||
if (mContent->IsElement()) {
|
||||
nsEventStates elementState = mContent->AsElement()->State();
|
||||
|
@ -235,9 +235,19 @@ public:
|
||||
/**
|
||||
* Return whether the given DOM node has an accessible or not.
|
||||
*/
|
||||
inline bool HasAccessible(nsINode* aNode)
|
||||
inline bool HasAccessible(nsINode* aNode) const
|
||||
{ return GetAccessible(aNode); }
|
||||
|
||||
/**
|
||||
* Return true if the given accessible is in document.
|
||||
*/
|
||||
inline bool IsInDocument(nsAccessible* aAccessible) const
|
||||
{
|
||||
return GetAccessible(aNode);
|
||||
nsAccessible* acc = aAccessible;
|
||||
while (acc && !acc->IsPrimaryForNode())
|
||||
acc = acc->Parent();
|
||||
|
||||
return acc ? mNodeToAccessibleMap.Get(acc->GetNode()) : false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -24,6 +24,8 @@
|
||||
src="../role.js" />
|
||||
<script type="application/javascript"
|
||||
src="../relations.js" />
|
||||
<script type="application/javascript"
|
||||
src="../events.js" />
|
||||
|
||||
<script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
|
||||
<script type="application/javascript">
|
||||
@ -49,19 +51,28 @@
|
||||
{
|
||||
var tabBrowser = document.getElementById("tabbrowser");
|
||||
|
||||
var progressListener =
|
||||
{
|
||||
onStateChange: function onStateChange(aWebProgress,
|
||||
aRequest,
|
||||
aStateFlags,
|
||||
aStatus)
|
||||
{
|
||||
if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP)
|
||||
testRelations();
|
||||
}
|
||||
};
|
||||
// Load documents into tabs and wait for reorder events caused by these
|
||||
// documents load before we start the test.
|
||||
var docURIs = ["about:", "about:mozilla"];
|
||||
|
||||
tabBrowser.addProgressListener(progressListener);
|
||||
var handler = {
|
||||
handleEvent: function handleEvent(aEvent) {
|
||||
var target = aEvent.accessible;
|
||||
if (target.role == ROLE_INTERNAL_FRAME &&
|
||||
target.parent.parent == getAccessible(this.tabBrowser.mTabBox.tabpanels)) {
|
||||
this.reorderCnt++;
|
||||
}
|
||||
|
||||
if (this.reorderCnt == docURIs.length) {
|
||||
unregisterA11yEventListener(EVENT_REORDER, this);
|
||||
testAccTree();
|
||||
}
|
||||
},
|
||||
|
||||
tabBrowser: tabBrowser,
|
||||
reorderCnt: 0
|
||||
};
|
||||
registerA11yEventListener(EVENT_REORDER, handler);
|
||||
|
||||
tabBrowser.loadTabs(["about:", "about:mozilla"], false, true);
|
||||
}
|
||||
|
@ -58,6 +58,7 @@ _TEST_FILES =\
|
||||
test_inputs.xul \
|
||||
test_link.html \
|
||||
test_popup.xul \
|
||||
test_stale.html \
|
||||
test_textbox.xul \
|
||||
test_tree.xul \
|
||||
z_frames.html \
|
||||
|
115
accessible/tests/mochitest/states/test_stale.html
Normal file
@ -0,0 +1,115 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Stale state testing</title>
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/MochiKit/packed.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../events.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
function addChild(aContainerID)
|
||||
{
|
||||
this.containerNode = getNode(aContainerID);
|
||||
this.childNode = null;
|
||||
|
||||
this.eventSeq = [
|
||||
new invokerChecker(EVENT_REORDER, this.containerNode)
|
||||
];
|
||||
|
||||
this.invoke = function addChild_invoke()
|
||||
{
|
||||
this.childNode = document.createElement("div");
|
||||
this.containerNode.appendChild(this.childNode);
|
||||
}
|
||||
|
||||
this.finalCheck = function addChild_finalCheck()
|
||||
{
|
||||
// no stale state should be set
|
||||
testStates(this.childNode, 0, 0, 0, EXT_STATE_STALE);
|
||||
}
|
||||
|
||||
this.getID = function addChild_getID()
|
||||
{
|
||||
return "add child for " + prettyName(aContainerID);
|
||||
}
|
||||
}
|
||||
|
||||
function removeChildChecker(aInvoker)
|
||||
{
|
||||
this.type = EVENT_HIDE;
|
||||
this.__defineGetter__("target", function() { return aInvoker.child; });
|
||||
|
||||
this.check = function removeChildChecker_check()
|
||||
{
|
||||
// stale state should be set
|
||||
testStates(aInvoker.child, 0, EXT_STATE_STALE);
|
||||
}
|
||||
}
|
||||
|
||||
function removeChild(aContainerID)
|
||||
{
|
||||
this.containerNode = getNode(aContainerID);
|
||||
this.child = null;
|
||||
|
||||
this.eventSeq = [
|
||||
new removeChildChecker(this)
|
||||
];
|
||||
|
||||
this.invoke = function removeChild_invoke()
|
||||
{
|
||||
var childNode = this.containerNode.firstChild;
|
||||
this.child = getAccessible(childNode);
|
||||
|
||||
this.containerNode.removeChild(childNode);
|
||||
}
|
||||
|
||||
this.getID = function removeChild_getID()
|
||||
{
|
||||
return "remove child from " + prettyName(aContainerID);
|
||||
}
|
||||
}
|
||||
|
||||
//gA11yEventDumpToConsole = true; //debugging
|
||||
|
||||
var gQueue = null;
|
||||
function doTest()
|
||||
{
|
||||
gQueue = new eventQueue();
|
||||
|
||||
gQueue.push(new addChild("container"));
|
||||
gQueue.push(new removeChild("container"));
|
||||
|
||||
gQueue.invoke(); // will call SimpleTest.finish()
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body role="">
|
||||
|
||||
<a target="_blank"
|
||||
title="Expose stale state on accessibles unattached from tree"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=676267">Mozilla Bug 676267</a>
|
||||
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
|
||||
<div id="container"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -48,7 +48,7 @@ function testTableStruct(aIdentifier, aCellsArray, aColHeaderType,
|
||||
tableNode.localName == "tree";
|
||||
|
||||
var rowCount = aCellsArray.length;
|
||||
var colsCount = aCellsArray[0].length;
|
||||
var colsCount = aCellsArray[0] ? aCellsArray[0].length : 0;
|
||||
|
||||
// Test table accessible tree.
|
||||
var tableObj = {
|
||||
|
@ -50,6 +50,14 @@
|
||||
|
||||
testTableStruct("grid2", cellsArray);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// ARIA grid of wrong markup
|
||||
cellsArray = [ ];
|
||||
testTableStruct("grid3", cellsArray);
|
||||
|
||||
cellsArray = [ [] ];
|
||||
testTableStruct("grid4", cellsArray);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
@ -68,6 +76,9 @@
|
||||
<a target="_blank"
|
||||
title="nsHTMLTableCellAccessible is used in dojo's crazy ARIA grid"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=513848">Mozilla Bug 513848</a>
|
||||
<a target="_blank"
|
||||
title="Crash [@ AccIterator::GetNext()]"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=675861">Mozilla Bug 675861</a>
|
||||
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
@ -133,5 +144,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Wrong markup ARIA grid -->
|
||||
<div role="grid" id="grid3"></div>
|
||||
<div role="grid" id="grid4"><div role="row"></div></div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -23,6 +23,8 @@
|
||||
src="../common.js" />
|
||||
<script type="application/javascript"
|
||||
src="../role.js" />
|
||||
<script type="application/javascript"
|
||||
src="../events.js" />
|
||||
|
||||
<script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
|
||||
<script type="application/javascript">
|
||||
@ -47,24 +49,31 @@
|
||||
{
|
||||
var tabBrowser = document.getElementById("tabbrowser");
|
||||
|
||||
var progressListener =
|
||||
{
|
||||
onStateChange: function onStateChange(aWebProgress,
|
||||
aRequest,
|
||||
aStateFlags,
|
||||
aStatus)
|
||||
{
|
||||
if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP) {
|
||||
tabBrowser.removeProgressListener(progressListener);
|
||||
// Load documents into tabs and wait for reorder events caused by these
|
||||
// documents load before we start the test.
|
||||
var docURIs = ["about:", "about:mozilla"];
|
||||
|
||||
SimpleTest.executeSoon(testAccTree);
|
||||
var handler = {
|
||||
handleEvent: function handleEvent(aEvent) {
|
||||
var target = aEvent.accessible;
|
||||
if (target.role == ROLE_INTERNAL_FRAME &&
|
||||
target.parent.parent == getAccessible(this.tabBrowser.mTabBox.tabpanels)) {
|
||||
this.reorderCnt++;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.reorderCnt == docURIs.length) {
|
||||
unregisterA11yEventListener(EVENT_REORDER, this);
|
||||
testAccTree();
|
||||
}
|
||||
},
|
||||
|
||||
tabBrowser: tabBrowser,
|
||||
reorderCnt: 0
|
||||
};
|
||||
tabBrowser.addProgressListener(progressListener);
|
||||
registerA11yEventListener(EVENT_REORDER, handler);
|
||||
|
||||
// Test XUL and HTML documents.
|
||||
tabBrowser.loadTabs(["about:", "about:mozilla"], false, true);
|
||||
tabBrowser.loadTabs(docURIs, false, true);
|
||||
}
|
||||
|
||||
function testAccTree()
|
||||
|
@ -205,13 +205,6 @@ libs::
|
||||
$(INSTALL) $(IFLAGS1) $(DIST)/branding/default48.png $(DIST)/bin/chrome/icons/default
|
||||
endif
|
||||
|
||||
ifdef MOZ_SPLASHSCREEN
|
||||
ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
|
||||
libs::
|
||||
$(INSTALL) $(IFLAGS1) $(DIST)/branding/splash.bmp $(DIST)/bin
|
||||
endif
|
||||
endif
|
||||
|
||||
libs:: $(srcdir)/profile/prefs.js
|
||||
$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/defaults/profile
|
||||
|
||||
|
@ -0,0 +1,213 @@
|
||||
<?xml version="1.0"?>
|
||||
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1311096050000">
|
||||
<emItems>
|
||||
<emItem blockID="i41" id="{99079a25-328f-4bd4-be04-00955acaa0a7}">
|
||||
<versionRange minVersion="0.1" maxVersion="4.3.0.00" severity="1">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i8" id="{B13721C7-F507-4982-B2E5-502A71474FED}">
|
||||
<versionRange minVersion=" " severity="1">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i38" id="{B7082FAA-CB62-4872-9106-E42DD88EDE45}">
|
||||
<versionRange minVersion="0.1" maxVersion="3.3.0.*">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.7a1" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
<versionRange minVersion="3.3.1" maxVersion="*">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="5.0a1" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i19" id="{46551EC9-40F0-4e47-8E18-8E5CF550CFB8}">
|
||||
<versionRange minVersion="1.1b1" maxVersion="1.1b1">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i16" id="{27182e60-b5f3-411c-b545-b44205977502}">
|
||||
<versionRange minVersion="1.0" maxVersion="1.0">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i39" id="{c2d64ff7-0ab8-4263-89c9-ea3b0f8f050c}">
|
||||
<versionRange minVersion="0.1" maxVersion="4.3.0.00" severity="1">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i10" id="{8CE11043-9A15-4207-A565-0C94C42D590D}">
|
||||
</emItem>
|
||||
<emItem blockID="i1" id="mozilla_cc@internetdownloadmanager.com">
|
||||
<versionRange minVersion="2.1" maxVersion="3.3">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.0a1" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
<versionRange minVersion=" " maxVersion="6.9.8">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.7a1pre" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i18" id="msntoolbar@msn.com">
|
||||
<versionRange minVersion=" " maxVersion="6.*">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i13" id="{E8E88AB0-7182-11DF-904E-6045E0D72085}">
|
||||
</emItem>
|
||||
<emItem blockID="i4" id="{4B3803EA-5230-4DC3-A7FC-33638F3D3542}">
|
||||
<versionRange minVersion="1.2" maxVersion="1.2">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.0a1" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i40" id="{28387537-e3f9-4ed7-860c-11e69af4a8a0}">
|
||||
<versionRange minVersion="0.1" maxVersion="4.3.0.00" severity="1">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i23" id="firefox@bandoo.com">
|
||||
<versionRange minVersion="5.0" maxVersion="5.0" severity="1">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.7a1pre" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i22" id="ShopperReports@ShopperReports.com">
|
||||
<versionRange minVersion="3.1.22.0" maxVersion="3.1.22.0">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i2" id="fdm_ffext@freedownloadmanager.org">
|
||||
<versionRange minVersion="1.0" maxVersion="1.3.1">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.0a1" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i5" id="support@daemon-tools.cc">
|
||||
<versionRange minVersion=" " maxVersion="1.0.0.5">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i6" id="{3f963a5b-e555-4543-90e2-c3908898db71}">
|
||||
<versionRange minVersion=" " maxVersion="8.5">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i12" id="masterfiler@gmail.com">
|
||||
<versionRange severity="3">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i20" id="{AB2CE124-6272-4b12-94A9-7303C7397BD1}">
|
||||
<versionRange minVersion="0.1" maxVersion="5.2.0.7164" severity="1">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i11" id="yslow@yahoo-inc.com">
|
||||
<versionRange minVersion="2.0.5" maxVersion="2.0.5">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.5.7" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i17" id="{3252b9ae-c69a-4eaf-9502-dc9c1f6c009e}">
|
||||
<versionRange minVersion="2.2" maxVersion="2.2">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i3" id="langpack-vi-VN@firefox.mozilla.org">
|
||||
<versionRange minVersion="2.0" maxVersion="2.0">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i7" id="{2224e955-00e9-4613-a844-ce69fccaae91}">
|
||||
</emItem>
|
||||
<emItem blockID="i24" id="{6E19037A-12E3-4295-8915-ED48BC341614}">
|
||||
<versionRange minVersion="0.1" maxVersion="1.3.328.4" severity="1">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.7a1pre" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i15" id="personas@christopher.beard">
|
||||
<versionRange minVersion="1.6" maxVersion="1.6">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.6" maxVersion="3.6.*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i21" id="support@update-firefox.com">
|
||||
</emItem>
|
||||
</emItems>
|
||||
|
||||
<pluginItems>
|
||||
<pluginItem blockID="p26">
|
||||
<match name="name" exp="^Yahoo Application State Plugin$" /> <match name="description" exp="^Yahoo Application State Plugin$" /> <match name="filename" exp="npYState.dll" /> <versionRange >
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.0a1" maxVersion="3.*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
<pluginItem blockID="p27">
|
||||
<match name="name" exp="QuickTime Plug-in 7[.]1[.]" /> <match name="filename" exp="npqtplugin.?[.]dll" /> <versionRange >
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.0a1" maxVersion="3.*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
<pluginItem blockID="p28">
|
||||
<match name="filename" exp="NPFFAddOn.dll" /> <versionRange >
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
<pluginItem blockID="p31">
|
||||
<match name="filename" exp="NPMySrch.dll" /> <versionRange >
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
<pluginItem blockID="p32">
|
||||
<match name="filename" exp="npViewpoint.dll" /> <versionRange >
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.0" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
<pluginItem blockID="p33">
|
||||
<match name="name" exp="[0-6]\.0\.[01]\d{2}\.\d+" /> <match name="filename" exp="npdeploytk.dll" /> <versionRange severity="1">
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
<pluginItem blockID="p34">
|
||||
<match name="filename" exp="[Nn][Pp][Jj][Pp][Ii]1[56]0_[0-9]+\.[Dd][Ll][Ll]" /> <versionRange >
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="3.6a1pre" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
</pluginItems>
|
||||
|
||||
<gfxItems>
|
||||
<gfxBlacklistEntry blockID="g35">
|
||||
<os>WINNT 6.1</os>
|
||||
<vendor>0x10de</vendor>
|
||||
<devices>
|
||||
<device>0x0a6c</device>
|
||||
</devices>
|
||||
<feature>DIRECT2D</feature>
|
||||
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
|
||||
<driverVersion>8.17.12.5896</driverVersion>
|
||||
<driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator>
|
||||
</gfxBlacklistEntry>
|
||||
<gfxBlacklistEntry blockID="g36">
|
||||
<os>WINNT 6.1</os>
|
||||
<vendor>0x10de</vendor>
|
||||
<devices>
|
||||
<device>0x0a6c</device>
|
||||
</devices>
|
||||
<feature>DIRECT3D_9_LAYERS</feature>
|
||||
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
|
||||
<driverVersion>8.17.12.5896</driverVersion>
|
||||
<driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator>
|
||||
</gfxBlacklistEntry>
|
||||
<gfxBlacklistEntry blockID="g37">
|
||||
<os>WINNT 5.1</os>
|
||||
<vendor>0x10de</vendor>
|
||||
<feature>DIRECT3D_9_LAYERS</feature>
|
||||
<featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
|
||||
<driverVersion>7.0.0.0</driverVersion>
|
||||
<driverVersionComparator>GREATER_THAN_OR_EQUAL</driverVersionComparator>
|
||||
</gfxBlacklistEntry>
|
||||
</gfxItems>
|
||||
|
||||
|
||||
</blocklist>
|
@ -964,6 +964,7 @@
|
||||
|
||||
<vbox id="browser-bottombox" layer="true">
|
||||
<toolbar id="inspector-toolbar"
|
||||
nowindowdrag="true"
|
||||
hidden="true">
|
||||
<toolbarbutton id="inspector-inspect-toolbutton"
|
||||
label="&inspectButton.label;"
|
||||
|
@ -768,7 +768,7 @@ var InspectorUI = {
|
||||
|
||||
this.openTreePanel();
|
||||
|
||||
this.toolbar.hidden = null;
|
||||
this.toolbar.hidden = false;
|
||||
this.inspectCmd.setAttribute("checked", true);
|
||||
},
|
||||
|
||||
|
@ -433,7 +433,8 @@ let UI = {
|
||||
Utils.assert(item, "item must be given");
|
||||
|
||||
if (item.isATabItem) {
|
||||
GroupItems.setActiveGroupItem(item.parent);
|
||||
if (item.parent)
|
||||
GroupItems.setActiveGroupItem(item.parent);
|
||||
this._setActiveTab(item);
|
||||
} else {
|
||||
GroupItems.setActiveGroupItem(item);
|
||||
|
@ -22,7 +22,7 @@ function onTabViewLoadedAndShown() {
|
||||
ok(TabView.isVisible(), "Tab View is visible");
|
||||
|
||||
// Establish initial state
|
||||
contentWindow = document.getElementById("tab-view").contentWindow;
|
||||
contentWindow = TabView.getContentWindow();
|
||||
verifyCleanState("start");
|
||||
|
||||
// register a clean up for private browsing just in case
|
||||
@ -50,40 +50,37 @@ function onTabViewLoadedAndShown() {
|
||||
}
|
||||
|
||||
// Create a second tab
|
||||
gBrowser.loadOneTab("about:robots", { inBackground: false });
|
||||
gBrowser.addTab("about:robots");
|
||||
is(gBrowser.tabs.length, 2, "we now have 2 tabs");
|
||||
registerCleanupFunction(function() {
|
||||
gBrowser.removeTab(gBrowser.tabs[1]);
|
||||
});
|
||||
|
||||
afterAllTabsLoaded(function() {
|
||||
showTabView(function() {
|
||||
// Get normal tab urls
|
||||
for (let a = 0; a < gBrowser.tabs.length; a++)
|
||||
normalURLs.push(gBrowser.tabs[a].linkedBrowser.currentURI.spec);
|
||||
// Get normal tab urls
|
||||
for (let a = 0; a < gBrowser.tabs.length; a++)
|
||||
normalURLs.push(gBrowser.tabs[a].linkedBrowser.currentURI.spec);
|
||||
|
||||
// verify that we're all set up for our test
|
||||
verifyNormal();
|
||||
// verify that we're all set up for our test
|
||||
verifyNormal();
|
||||
|
||||
// go into private browsing and make sure Tab View becomes hidden
|
||||
togglePBAndThen(function() {
|
||||
whenTabViewIsHidden(function() {
|
||||
ok(!TabView.isVisible(), "Tab View is no longer visible");
|
||||
// go into private browsing and make sure Tab View becomes hidden
|
||||
togglePBAndThen(function() {
|
||||
whenTabViewIsHidden(function() {
|
||||
ok(!TabView.isVisible(), "Tab View is no longer visible");
|
||||
verifyPB();
|
||||
|
||||
verifyPB();
|
||||
// exit private browsing and make sure Tab View is shown again
|
||||
togglePBAndThen(function() {
|
||||
whenTabViewIsShown(function() {
|
||||
ok(TabView.isVisible(), "Tab View is visible again");
|
||||
verifyNormal();
|
||||
|
||||
// exit private browsing and make sure Tab View is shown again
|
||||
togglePBAndThen(function() {
|
||||
whenTabViewIsShown(function() {
|
||||
ok(TabView.isVisible(), "Tab View is visible again");
|
||||
verifyNormal();
|
||||
|
||||
hideTabView(onTabViewHidden);
|
||||
});
|
||||
hideTabView(onTabViewHidden);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -103,6 +100,8 @@ function onTabViewHidden() {
|
||||
// end game
|
||||
ok(!TabView.isVisible(), "we finish with Tab View not visible");
|
||||
registerCleanupFunction(verifyCleanState); // verify after all cleanups
|
||||
|
||||
gBrowser.selectedTab = gBrowser.tabs[0];
|
||||
finish();
|
||||
});
|
||||
});
|
||||
|
@ -60,10 +60,6 @@ WINDOWS_BRANDING_FILES = \
|
||||
wizWatermark.bmp \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_SPLASHSCREEN
|
||||
WINDOWS_BRANDING_FILES += splash.bmp
|
||||
endif
|
||||
|
||||
OSX_BRANDING_FILES = \
|
||||
background.png \
|
||||
firefox.icns \
|
||||
|
Before Width: | Height: | Size: 232 KiB |
@ -60,10 +60,6 @@ WINDOWS_BRANDING_FILES = \
|
||||
wizWatermark.bmp \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_SPLASHSCREEN
|
||||
WINDOWS_BRANDING_FILES += splash.bmp
|
||||
endif
|
||||
|
||||
OSX_BRANDING_FILES = \
|
||||
background.png \
|
||||
firefox.icns \
|
||||
|
Before Width: | Height: | Size: 232 KiB |
@ -60,10 +60,6 @@ WINDOWS_BRANDING_FILES = \
|
||||
wizWatermark.bmp \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_SPLASHSCREEN
|
||||
WINDOWS_BRANDING_FILES += splash.bmp
|
||||
endif
|
||||
|
||||
OSX_BRANDING_FILES = \
|
||||
background.png \
|
||||
firefox.icns \
|
||||
|
Before Width: | Height: | Size: 232 KiB |
@ -60,10 +60,6 @@ WINDOWS_BRANDING_FILES = \
|
||||
wizWatermark.bmp \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_SPLASHSCREEN
|
||||
WINDOWS_BRANDING_FILES += splash.bmp
|
||||
endif
|
||||
|
||||
OSX_BRANDING_FILES = \
|
||||
background.png \
|
||||
firefox.icns \
|
||||
|
Before Width: | Height: | Size: 232 KiB |
@ -72,7 +72,7 @@ var PlacesOrganizer = {
|
||||
this._initFolderTree();
|
||||
|
||||
var leftPaneSelection = "AllBookmarks"; // default to all-bookmarks
|
||||
if ("arguments" in window && window.arguments.length > 0)
|
||||
if (window.arguments && window.arguments[0])
|
||||
leftPaneSelection = window.arguments[0];
|
||||
|
||||
this.selectLeftPaneQuery(leftPaneSelection);
|
||||
|
@ -56,7 +56,7 @@ XPCOMUtils.defineLazyGetter(this, "PlacesUtils", function() {
|
||||
});
|
||||
|
||||
var PlacesUIUtils = {
|
||||
ORGANIZER_LEFTPANE_VERSION: 6,
|
||||
ORGANIZER_LEFTPANE_VERSION: 7,
|
||||
ORGANIZER_FOLDER_ANNO: "PlacesOrganizer/OrganizerFolder",
|
||||
ORGANIZER_QUERY_ANNO: "PlacesOrganizer/OrganizerQuery",
|
||||
|
||||
@ -812,8 +812,10 @@ var PlacesUIUtils = {
|
||||
}
|
||||
|
||||
var loadInBackground = where == "tabshifted" ? true : false;
|
||||
var replaceCurrentTab = where == "tab" ? false : true;
|
||||
browserWindow.gBrowser.loadTabs(urls, loadInBackground, replaceCurrentTab);
|
||||
// For consistency, we want all the bookmarks to open in new tabs, instead
|
||||
// of having one of them replace the currently focused tab. Hence we call
|
||||
// loadTabs with aReplace set to false.
|
||||
browserWindow.gBrowser.loadTabs(urls, loadInBackground, false);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -986,6 +988,7 @@ var PlacesUIUtils = {
|
||||
let queries = {
|
||||
"PlacesRoot": { title: "" },
|
||||
"History": { title: this.getString("OrganizerQueryHistory") },
|
||||
"Downloads": { title: this.getString("OrganizerQueryDownloads") },
|
||||
"Tags": { title: this.getString("OrganizerQueryTags") },
|
||||
"AllBookmarks": { title: this.getString("OrganizerQueryAllBookmarks") },
|
||||
"BookmarksToolbar":
|
||||
@ -1002,7 +1005,7 @@ var PlacesUIUtils = {
|
||||
concreteId: PlacesUtils.unfiledBookmarksFolderId },
|
||||
};
|
||||
// All queries but PlacesRoot.
|
||||
const EXPECTED_QUERY_COUNT = 6;
|
||||
const EXPECTED_QUERY_COUNT = 7;
|
||||
|
||||
// Removes an item and associated annotations, ignoring eventual errors.
|
||||
function safeRemoveItem(aItemId) {
|
||||
@ -1175,7 +1178,12 @@ var PlacesUIUtils = {
|
||||
"&sort=" +
|
||||
Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING);
|
||||
|
||||
// XXX: Downloads.
|
||||
// Downloads.
|
||||
this.create_query("Downloads", leftPaneRoot,
|
||||
"place:transition=" +
|
||||
Ci.nsINavHistoryService.TRANSITION_DOWNLOAD +
|
||||
"&sort=" +
|
||||
Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING);
|
||||
|
||||
// Tags Query.
|
||||
this.create_query("Tags", leftPaneRoot,
|
||||
|
@ -74,6 +74,7 @@ _BROWSER_TEST_FILES = \
|
||||
browser_library_batch_delete.js \
|
||||
browser_555547.js \
|
||||
browser_416459_cut.js \
|
||||
browser_library_downloads.js \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_BROWSER_TEST_FILES)
|
||||
|
@ -0,0 +1,89 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Places test code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2010
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Mehdi Mulani <mmulani@mozilla.com> (original author)
|
||||
* Jared Wein <jwein@mozilla.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*
|
||||
* Tests bug 564900: Add folder specifically for downloads to Library left pane.
|
||||
* https://bugzilla.mozilla.org/show_bug.cgi?id=564900
|
||||
* This test visits various pages then opens the Library and ensures
|
||||
* that both the Downloads folder shows up and that the correct visits
|
||||
* are shown in it.
|
||||
*/
|
||||
|
||||
let now = Date.now();
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
function onLibraryReady(win) {
|
||||
// Add visits to compare contents with.
|
||||
fastAddVisit("http://mozilla.com",
|
||||
PlacesUtils.history.TRANSITION_TYPED);
|
||||
fastAddVisit("http://google.com",
|
||||
PlacesUtils.history.TRANSITION_DOWNLOAD);
|
||||
fastAddVisit("http://en.wikipedia.org",
|
||||
PlacesUtils.history.TRANSITION_TYPED);
|
||||
fastAddVisit("http://ubuntu.org",
|
||||
PlacesUtils.history.TRANSITION_DOWNLOAD);
|
||||
|
||||
// Make sure Downloads is present.
|
||||
isnot(win.PlacesOrganizer._places.selectedNode, null,
|
||||
"Downloads is present and selected");
|
||||
|
||||
// Make sure content in right pane exists.
|
||||
let tree = win.document.getElementById("placeContent");
|
||||
isnot(tree, null, "placeContent tree exists");
|
||||
|
||||
// Check results.
|
||||
var contentRoot = tree.result.root;
|
||||
var len = contentRoot.childCount;
|
||||
var testUris = ["http://ubuntu.org/", "http://google.com/"];
|
||||
for (var i = 0; i < len; i++) {
|
||||
is(contentRoot.getChild(i).uri, testUris[i],
|
||||
"Comparing downloads shown at index " + i);
|
||||
}
|
||||
|
||||
win.close();
|
||||
waitForClearHistory(finish);
|
||||
}
|
||||
|
||||
openLibrary(onLibraryReady, "Downloads");
|
||||
}
|
||||
|
||||
function fastAddVisit(uri, transition) {
|
||||
PlacesUtils.history.addVisit(PlacesUtils._uri(uri), now++ * 1000,
|
||||
null, transition, false, 0);
|
||||
}
|
@ -1,3 +1,7 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Components.utils.import("resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
// We need to cache this before test runs...
|
||||
let cachedLeftPaneFolderIdGetter;
|
||||
@ -14,10 +18,10 @@ registerCleanupFunction(function(){
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function openLibrary(callback) {
|
||||
function openLibrary(callback, aLeftPaneRoot) {
|
||||
let library = window.openDialog("chrome://browser/content/places/places.xul",
|
||||
"", "chrome,toolbar=yes,dialog=no,resizable");
|
||||
"", "chrome,toolbar=yes,dialog=no,resizable",
|
||||
aLeftPaneRoot);
|
||||
waitForFocus(function () {
|
||||
callback(library);
|
||||
}, library);
|
||||
@ -25,4 +29,10 @@ function openLibrary(callback) {
|
||||
return library;
|
||||
}
|
||||
|
||||
Components.utils.import("resource://gre/modules/NetUtil.jsm");
|
||||
function waitForClearHistory(aCallback) {
|
||||
Services.obs.addObserver(function observeCH(aSubject, aTopic, aData) {
|
||||
Services.obs.removeObserver(observeCH, PlacesUtils.TOPIC_EXPIRATION_FINISHED);
|
||||
aCallback();
|
||||
}, PlacesUtils.TOPIC_EXPIRATION_FINISHED, false);
|
||||
PlacesUtils.bhistory.removeAllPages();
|
||||
}
|
||||
|
@ -97,6 +97,10 @@
|
||||
// Bug 510634
|
||||
let cachedLeftPaneFolderIdGetter =
|
||||
PlacesUIUtils.__lookupGetter__("leftPaneFolderId");
|
||||
// Must also cache and restore this getter as it is affected by
|
||||
// leftPaneFolderId, from bug 564900.
|
||||
let cachedAllBookmarksFolderIdGetter =
|
||||
PlacesUIUtils.__lookupGetter__("allBookmarksFolderId");
|
||||
|
||||
let leftPaneFolderId = PlacesUIUtils.leftPaneFolderId;
|
||||
|
||||
@ -107,28 +111,36 @@
|
||||
let tree = document.getElementById("tree");
|
||||
tree.place = "place:queryType=1&folder=" + leftPaneFolderId;
|
||||
|
||||
// Open All Bookmarks
|
||||
PlacesUtils.asContainer(tree.view.nodeForTreeIndex(2)).containerOpen = true;
|
||||
|
||||
// The query-property is set on the title column for each row.
|
||||
let titleColumn = tree.treeBoxObject.columns.getColumnAt(0);
|
||||
|
||||
["History", "Tags", "AllBookmarks", "BookmarksToolbar",
|
||||
// Open All Bookmarks
|
||||
tree.selectItems([PlacesUIUtils.leftPaneQueries["AllBookmarks"]]);
|
||||
PlacesUtils.asContainer(tree.selectedNode).containerOpen = true;
|
||||
is(PlacesUIUtils.allBookmarksFolderId, tree.selectedNode.itemId,
|
||||
"Opened All Bookmarks");
|
||||
|
||||
["History", "Downloads", "Tags", "AllBookmarks", "BookmarksToolbar",
|
||||
"BookmarksMenu", "UnfiledBookmarks"].forEach(
|
||||
function(aQueryName, aRow) {
|
||||
let rowProperties = createSupportsArray();
|
||||
tree.view.getCellProperties(aRow, titleColumn, rowProperties);
|
||||
rowProperties = convertPropertiesToJSArray(rowProperties);
|
||||
ok(rowProperties.indexOf("OrganizerQuery_" + aQueryName) != -1,
|
||||
"OrganizerQuery_" + aQueryName + " is set");
|
||||
}
|
||||
);
|
||||
function(aQueryName, aRow) {
|
||||
let found = false;
|
||||
for (let i = 0; i < tree.view.rowCount && !found; i++) {
|
||||
let rowProperties = createSupportsArray();
|
||||
tree.view.getCellProperties(i, titleColumn, rowProperties);
|
||||
rowProperties = convertPropertiesToJSArray(rowProperties);
|
||||
found = rowProperties.indexOf("OrganizerQuery_" + aQueryName) != -1;
|
||||
}
|
||||
ok(found, "OrganizerQuery_" + aQueryName + " is set");
|
||||
}
|
||||
);
|
||||
|
||||
// Close the root node
|
||||
tree.result.root.containerOpen = false;
|
||||
|
||||
// Restore the getter for the next test.
|
||||
// Restore the getters for the next test.
|
||||
PlacesUIUtils.__defineGetter__("leftPaneFolderId", cachedLeftPaneFolderIdGetter);
|
||||
PlacesUIUtils.__defineGetter__("allBookmarksFolderId",
|
||||
cachedAllBookmarksFolderIdGetter);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
@ -85,7 +85,7 @@
|
||||
}
|
||||
|
||||
// Add a bookmark.
|
||||
var itemId = bs.insertBookmark(bs.toolbarFolder,
|
||||
var itemId = bs.insertBookmark(PlacesUtils.toolbarFolderId,
|
||||
uri("http://www.example.com/"),
|
||||
bs.DEFAULT_INDEX,
|
||||
"mozilla");
|
||||
|
@ -92,18 +92,28 @@ Site.prototype = {
|
||||
* A callback function that takes a favicon image URL as a parameter.
|
||||
*/
|
||||
getFavicon: function Site_getFavicon(aCallback) {
|
||||
let callbackExecuted = false;
|
||||
function faviconDataCallback(aURI, aDataLen, aData, aMimeType) {
|
||||
// We don't need a second callback, so we can ignore it to avoid making
|
||||
// a second database query for the favicon data.
|
||||
if (callbackExecuted) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
aCallback(aURI.spec);
|
||||
// Use getFaviconLinkForIcon to get image data from the database instead
|
||||
// of using the favicon URI to fetch image data over the network.
|
||||
aCallback(gFaviconService.getFaviconLinkForIcon(aURI).spec);
|
||||
callbackExecuted = true;
|
||||
} catch (e) {
|
||||
Cu.reportError("AboutPermissions: " + e);
|
||||
}
|
||||
}
|
||||
|
||||
// Try to find favicion for both URIs. Callback will only be called if a
|
||||
// favicon URI is found, so this means we'll always prefer the https favicon.
|
||||
gFaviconService.getFaviconURLForPage(this.httpURI, faviconDataCallback);
|
||||
// favicon URI is found. We'll ignore the second callback if it is called,
|
||||
// so this means we'll always prefer the https favicon.
|
||||
gFaviconService.getFaviconURLForPage(this.httpsURI, faviconDataCallback);
|
||||
gFaviconService.getFaviconURLForPage(this.httpURI, faviconDataCallback);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -503,41 +503,43 @@ PrivateBrowsingService.prototype = {
|
||||
if (this._currentStatus != STATE_IDLE)
|
||||
throw Cr.NS_ERROR_FAILURE;
|
||||
|
||||
if (val == this._inPrivateBrowsing)
|
||||
return;
|
||||
|
||||
try {
|
||||
if (val) {
|
||||
if (!this._canEnterPrivateBrowsingMode())
|
||||
return;
|
||||
}
|
||||
else {
|
||||
if (!this._canLeavePrivateBrowsingMode())
|
||||
return;
|
||||
}
|
||||
|
||||
this._ensureCanCloseWindows();
|
||||
|
||||
// start the transition now that we know that we can
|
||||
this._currentStatus = STATE_TRANSITION_STARTED;
|
||||
|
||||
if (val != this._inPrivateBrowsing) {
|
||||
if (val) {
|
||||
if (!this._canEnterPrivateBrowsingMode())
|
||||
return;
|
||||
}
|
||||
else {
|
||||
if (!this._canLeavePrivateBrowsingMode())
|
||||
return;
|
||||
}
|
||||
this._autoStarted = this._prefs.getBoolPref("browser.privatebrowsing.autostart");
|
||||
this._inPrivateBrowsing = val != false;
|
||||
|
||||
this._ensureCanCloseWindows();
|
||||
let data = val ? "enter" : "exit";
|
||||
|
||||
this._autoStarted = this._prefs.getBoolPref("browser.privatebrowsing.autostart");
|
||||
this._inPrivateBrowsing = val != false;
|
||||
let quitting = Cc["@mozilla.org/supports-PRBool;1"].
|
||||
createInstance(Ci.nsISupportsPRBool);
|
||||
quitting.data = this._quitting;
|
||||
|
||||
let data = val ? "enter" : "exit";
|
||||
// notify observers of the pending private browsing mode change
|
||||
this._obs.notifyObservers(quitting, "private-browsing-change-granted", data);
|
||||
|
||||
let quitting = Cc["@mozilla.org/supports-PRBool;1"].
|
||||
createInstance(Ci.nsISupportsPRBool);
|
||||
quitting.data = this._quitting;
|
||||
// destroy the current session and start initial cleanup
|
||||
this._onBeforePrivateBrowsingModeChange();
|
||||
|
||||
// notify observers of the pending private browsing mode change
|
||||
this._obs.notifyObservers(quitting, "private-browsing-change-granted", data);
|
||||
this._obs.notifyObservers(quitting, "private-browsing", data);
|
||||
|
||||
// destroy the current session and start initial cleanup
|
||||
this._onBeforePrivateBrowsingModeChange();
|
||||
|
||||
this._obs.notifyObservers(quitting, "private-browsing", data);
|
||||
|
||||
// load the appropriate session
|
||||
this._onAfterPrivateBrowsingModeChange();
|
||||
}
|
||||
// load the appropriate session
|
||||
this._onAfterPrivateBrowsingModeChange();
|
||||
} catch (ex) {
|
||||
// We aborted the transition to/from private browsing, we must restore the
|
||||
// beforeunload handling on all the windows for which we switched it off.
|
||||
|
@ -48,12 +48,8 @@ window.onload = function() {
|
||||
// (for when the tab is closed or the session crashes right again)
|
||||
var sessionData = document.getElementById("sessionData");
|
||||
if (!sessionData.value) {
|
||||
var ss = Cc["@mozilla.org/browser/sessionstartup;1"].getService(Ci.nsISessionStartup);
|
||||
sessionData.value = ss.state;
|
||||
if (!sessionData.value) {
|
||||
document.getElementById("errorTryAgain").disabled = true;
|
||||
return;
|
||||
}
|
||||
document.getElementById("errorTryAgain").disabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// remove unneeded braces (added for compatibility with Firefox 2.0 and 3.0)
|
||||
|
@ -86,7 +86,6 @@
|
||||
|
||||
<!-- Short Description -->
|
||||
<div id="errorTrailerDesc">
|
||||
<p> </p>
|
||||
<tree xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
id="tabList" flex="1" seltype="single" hidecolumnpicker="true"
|
||||
onclick="onListClick(event);" onkeydown="onListKeyDown(event);"
|
||||
|
@ -112,8 +112,9 @@ SessionStartup.prototype = {
|
||||
getService(Ci.nsIProperties);
|
||||
let sessionFile = dirService.get("ProfD", Ci.nsILocalFile);
|
||||
sessionFile.append("sessionstore.js");
|
||||
|
||||
let doResumeSession = prefBranch.getBoolPref("sessionstore.resume_session_once") ||
|
||||
|
||||
let doResumeSessionOnce = prefBranch.getBoolPref("sessionstore.resume_session_once");
|
||||
let doResumeSession = doResumeSessionOnce ||
|
||||
prefBranch.getIntPref("startup.page") == 3;
|
||||
|
||||
// only continue if the session file exists
|
||||
@ -137,6 +138,10 @@ SessionStartup.prototype = {
|
||||
var s = new Cu.Sandbox("about:blank");
|
||||
this._initialState = Cu.evalInSandbox("(" + iniString + ")", s);
|
||||
}
|
||||
|
||||
// If this is a normal restore then throw away any previous session
|
||||
if (!doResumeSessionOnce)
|
||||
delete this._initialState.lastSessionState;
|
||||
}
|
||||
catch (ex) { debug("The session file is invalid: " + ex); }
|
||||
|
||||
|
@ -235,7 +235,10 @@ SessionStoreService.prototype = {
|
||||
// whether to restore hidden tabs or not, pref controlled.
|
||||
_restoreHiddenTabs: null,
|
||||
|
||||
// The state from the previous session (after restoring pinned tabs)
|
||||
// The state from the previous session (after restoring pinned tabs). This
|
||||
// state is persisted and passed through to the next session during an app
|
||||
// restart to make the third party add-on warning not trash the deferred
|
||||
// session
|
||||
_lastSessionState: null,
|
||||
|
||||
// Whether we've been initialized
|
||||
@ -331,6 +334,10 @@ SessionStoreService.prototype = {
|
||||
this._lastSessionState = remainingState;
|
||||
}
|
||||
else {
|
||||
// Get the last deferred session in case the user still wants to
|
||||
// restore it
|
||||
this._lastSessionState = this._initialState.lastSessionState;
|
||||
|
||||
let lastSessionCrashed =
|
||||
this._initialState.session && this._initialState.session.state &&
|
||||
this._initialState.session.state == STATE_RUNNING_STR;
|
||||
@ -488,6 +495,12 @@ SessionStoreService.prototype = {
|
||||
this._prefBranch.setBoolPref("sessionstore.resume_session_once",
|
||||
this._resume_session_once_on_shutdown);
|
||||
}
|
||||
|
||||
if (aData != "restart") {
|
||||
// Throw away the previous session on shutdown
|
||||
this._lastSessionState = null;
|
||||
}
|
||||
|
||||
this._loadState = STATE_QUITTING; // just to be sure
|
||||
this._uninit();
|
||||
break;
|
||||
@ -3485,6 +3498,10 @@ SessionStoreService.prototype = {
|
||||
if (this._recentCrashes)
|
||||
oState.session.recentCrashes = this._recentCrashes;
|
||||
|
||||
// Persist the last session if we deferred restoring it
|
||||
if (this._lastSessionState)
|
||||
oState.lastSessionState = this._lastSessionState;
|
||||
|
||||
this._saveStateObject(oState);
|
||||
},
|
||||
|
||||
|
@ -7,19 +7,35 @@ function test() {
|
||||
{entries: [{url: "about:robots"}], hidden: true}
|
||||
] }] };
|
||||
|
||||
let finalState = { windows: [{ tabs: [
|
||||
{entries: [{url: "about:blank"}]}
|
||||
] }] };
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
waitForBrowserState(state, function () {
|
||||
is(gBrowser.tabs.length, 2, "two tabs were restored");
|
||||
is(gBrowser.visibleTabs.length, 1, "one tab is visible");
|
||||
newWindowWithState(state, function (win) {
|
||||
registerCleanupFunction(function () win.close());
|
||||
|
||||
let tab = gBrowser.visibleTabs[0];
|
||||
is(win.gBrowser.tabs.length, 2, "two tabs were restored");
|
||||
is(win.gBrowser.visibleTabs.length, 1, "one tab is visible");
|
||||
|
||||
let tab = win.gBrowser.visibleTabs[0];
|
||||
is(tab.linkedBrowser.currentURI.spec, "about:mozilla", "visible tab is about:mozilla");
|
||||
|
||||
waitForBrowserState(finalState, finish);
|
||||
finish();
|
||||
});
|
||||
}
|
||||
|
||||
function newWindowWithState(state, callback) {
|
||||
let opts = "chrome,all,dialog=no,height=800,width=800";
|
||||
let win = window.openDialog(getBrowserURL(), "_blank", opts);
|
||||
|
||||
win.addEventListener("load", function onLoad() {
|
||||
win.removeEventListener("load", onLoad, false);
|
||||
|
||||
executeSoon(function () {
|
||||
win.addEventListener("SSWindowStateReady", function onReady() {
|
||||
win.removeEventListener("SSWindowStateReady", onReady, false);
|
||||
executeSoon(function () callback(win));
|
||||
}, false);
|
||||
|
||||
ss.setWindowState(win, JSON.stringify(state), true);
|
||||
});
|
||||
}, false);
|
||||
}
|
||||
|
@ -1,11 +1,7 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
let stateBackup = ss.getBrowserState();
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
let oldState = {
|
||||
windows: [{
|
||||
tabs: [
|
||||
@ -20,24 +16,26 @@ function test() {
|
||||
};
|
||||
let state = { windows: [{ tabs: [{ entries: [pageData] }] }] };
|
||||
|
||||
// The form data will be restored before SSTabRestored, so we want to listen
|
||||
// for that on the currently selected tab (it will be reused)
|
||||
gBrowser.selectedTab.addEventListener("SSTabRestored", onSSTabRestored, true);
|
||||
waitForExplicitFinish();
|
||||
|
||||
ss.setBrowserState(JSON.stringify(state));
|
||||
newWindowWithState(state, function (win) {
|
||||
registerCleanupFunction(function () win.close());
|
||||
|
||||
is(gBrowser.tabs.length, 1, "The total number of tabs should be 1");
|
||||
is(gBrowser.visibleTabs.length, 1, "The total number of visible tabs should be 1");
|
||||
|
||||
executeSoon(function () {
|
||||
waitForFocus(function () {
|
||||
middleClickTest(win);
|
||||
finish();
|
||||
}, win);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function onSSTabRestored(aEvent) {
|
||||
gBrowser.selectedTab.removeEventListener("SSTabRestored", onSSTabRestored, true);
|
||||
|
||||
is(gBrowser.tabs.length, 1, "The total number of tabs should be 1");
|
||||
is(gBrowser.visibleTabs.length, 1, "The total number of visible tabs should be 1");
|
||||
|
||||
executeSoon(middleClickTest);
|
||||
}
|
||||
|
||||
function middleClickTest() {
|
||||
let tree = gBrowser.selectedBrowser.contentDocument.getElementById("tabList");
|
||||
function middleClickTest(win) {
|
||||
let browser = win.gBrowser.selectedBrowser;
|
||||
let tree = browser.contentDocument.getElementById("tabList");
|
||||
is(tree.view.rowCount, 3, "There should be three items");
|
||||
|
||||
let x = {}, y = {}, width = {}, height = {};
|
||||
@ -45,21 +43,36 @@ function middleClickTest() {
|
||||
// click on the first tab item
|
||||
tree.treeBoxObject.getCoordsForCellItem(1, tree.columns[1], "text", x, y, width, height);
|
||||
EventUtils.synthesizeMouse(tree.body, x.value, y.value, { button: 1 },
|
||||
gBrowser.selectedBrowser.contentWindow);
|
||||
browser.contentWindow);
|
||||
// click on the second tab item
|
||||
tree.treeBoxObject.getCoordsForCellItem(2, tree.columns[1], "text", x, y, width, height);
|
||||
EventUtils.synthesizeMouse(tree.body, x.value, y.value, { button: 1 },
|
||||
gBrowser.selectedBrowser.contentWindow);
|
||||
browser.contentWindow);
|
||||
|
||||
is(gBrowser.tabs.length, 3,
|
||||
is(win.gBrowser.tabs.length, 3,
|
||||
"The total number of tabs should be 3 after restoring 2 tabs by middle click.");
|
||||
is(gBrowser.visibleTabs.length, 3,
|
||||
is(win.gBrowser.visibleTabs.length, 3,
|
||||
"The total number of visible tabs should be 3 after restoring 2 tabs by middle click");
|
||||
|
||||
cleanup();
|
||||
}
|
||||
|
||||
function cleanup() {
|
||||
ss.setBrowserState(stateBackup);
|
||||
executeSoon(finish);
|
||||
function newWindowWithState(state, callback) {
|
||||
let opts = "chrome,all,dialog=no,height=800,width=800";
|
||||
let win = window.openDialog(getBrowserURL(), "_blank", opts);
|
||||
|
||||
win.addEventListener("load", function onLoad() {
|
||||
win.removeEventListener("load", onLoad, false);
|
||||
|
||||
let tab = win.gBrowser.selectedTab;
|
||||
|
||||
// The form data will be restored before SSTabRestored, so we want to listen
|
||||
// for that on the currently selected tab (it will be reused)
|
||||
tab.addEventListener("SSTabRestored", function onRestored() {
|
||||
tab.removeEventListener("SSTabRestored", onRestored, true);
|
||||
callback(win);
|
||||
}, true);
|
||||
|
||||
executeSoon(function () {
|
||||
ss.setWindowState(win, JSON.stringify(state), true);
|
||||
});
|
||||
}, false);
|
||||
}
|
||||
|
@ -186,12 +186,12 @@
|
||||
<menu id="sp-edit-menu" label="&editMenu.label;"
|
||||
accesskey="&editMenu.accesskey;">
|
||||
<menupopup id="sp-menu_editpopup">
|
||||
<menuitem id="sp-menu_undo"
|
||||
<menuitem id="sp-menu-undo"
|
||||
label="&undoCmd.label;"
|
||||
key="key_undo"
|
||||
accesskey="&undoCmd.accesskey;"
|
||||
disabled="true"
|
||||
oncommand="cmd_undo"/>
|
||||
command="cmd_undo"/>
|
||||
<menuitem id="sp-menu-redo"
|
||||
label="&redoCmd.label;"
|
||||
key="key_redo"
|
||||
|
@ -466,7 +466,6 @@ ResponseListener.prototype =
|
||||
}
|
||||
});
|
||||
this.httpActivity.response.isDone = true;
|
||||
this.httpActivity.response.listener = null;
|
||||
this.httpActivity = null;
|
||||
this.receivedData = "";
|
||||
this.request = null;
|
||||
@ -1278,6 +1277,37 @@ function HUD_SERVICE()
|
||||
// bytes).
|
||||
this.responsePipeSegmentSize =
|
||||
Services.prefs.getIntPref("network.buffer.cache.size");
|
||||
|
||||
/**
|
||||
* Collection of HUDIds that map to the tabs/windows/contexts
|
||||
* that a HeadsUpDisplay can be activated for.
|
||||
*/
|
||||
this.activatedContexts = [];
|
||||
|
||||
/**
|
||||
* Collection of outer window IDs mapping to HUD IDs.
|
||||
*/
|
||||
this.windowIds = {};
|
||||
|
||||
/**
|
||||
* Each HeadsUpDisplay has a set of filter preferences
|
||||
*/
|
||||
this.filterPrefs = {};
|
||||
|
||||
/**
|
||||
* Keeps a reference for each HeadsUpDisplay that is created
|
||||
*/
|
||||
this.hudReferences = {};
|
||||
|
||||
/**
|
||||
* Requests that haven't finished yet.
|
||||
*/
|
||||
this.openRequests = {};
|
||||
|
||||
/**
|
||||
* Response headers for requests that haven't finished yet.
|
||||
*/
|
||||
this.openResponseHeaders = {};
|
||||
};
|
||||
|
||||
HUD_SERVICE.prototype =
|
||||
@ -1313,28 +1343,12 @@ HUD_SERVICE.prototype =
|
||||
return HeadsUpDisplayUICommands;
|
||||
},
|
||||
|
||||
/**
|
||||
* Collection of HUDIds that map to the tabs/windows/contexts
|
||||
* that a HeadsUpDisplay can be activated for.
|
||||
*/
|
||||
activatedContexts: [],
|
||||
|
||||
/**
|
||||
* Collection of outer window IDs mapping to HUD IDs.
|
||||
*/
|
||||
windowIds: {},
|
||||
|
||||
/**
|
||||
* The sequencer is a generator (after initialization) that returns unique
|
||||
* integers
|
||||
*/
|
||||
sequencer: null,
|
||||
|
||||
/**
|
||||
* Each HeadsUpDisplay has a set of filter preferences
|
||||
*/
|
||||
filterPrefs: {},
|
||||
|
||||
/**
|
||||
* Gets the ID of the outer window of this DOM window
|
||||
*
|
||||
@ -1681,11 +1695,6 @@ HUD_SERVICE.prototype =
|
||||
this.regroupOutput(outputNode);
|
||||
},
|
||||
|
||||
/**
|
||||
* Keeps a reference for each HeadsUpDisplay that is created
|
||||
*/
|
||||
hudReferences: {},
|
||||
|
||||
/**
|
||||
* Register a reference of each HeadsUpDisplay that is created
|
||||
*/
|
||||
@ -1730,6 +1739,8 @@ HUD_SERVICE.prototype =
|
||||
// remove the nodes then.
|
||||
hud.jsterm.clearOutput();
|
||||
|
||||
hud.destroy();
|
||||
|
||||
// Make sure that the console panel does not try to call
|
||||
// deactivateHUDForContext() again.
|
||||
hud.consoleWindowUnregisterOnHide = false;
|
||||
@ -1826,6 +1837,8 @@ HUD_SERVICE.prototype =
|
||||
delete this.defaultFilterPrefs;
|
||||
delete this.defaultGlobalConsolePrefs;
|
||||
|
||||
delete this.lastFinishedRequestCallback;
|
||||
|
||||
HUDWindowObserver.uninit();
|
||||
HUDConsoleObserver.uninit();
|
||||
ConsoleAPIObserver.shutdown();
|
||||
@ -2124,16 +2137,6 @@ HUD_SERVICE.prototype =
|
||||
*/
|
||||
applicationHooks: null,
|
||||
|
||||
/**
|
||||
* Requests that haven't finished yet.
|
||||
*/
|
||||
openRequests: {},
|
||||
|
||||
/**
|
||||
* Response headers for requests that haven't finished yet.
|
||||
*/
|
||||
openResponseHeaders: {},
|
||||
|
||||
/**
|
||||
* Assign a function to this property to listen for finished httpRequests.
|
||||
* Used by unit tests.
|
||||
@ -2239,15 +2242,8 @@ HUD_SERVICE.prototype =
|
||||
return;
|
||||
}
|
||||
|
||||
// Add listener for the response body.
|
||||
let newListener = new ResponseListener(httpActivity);
|
||||
aChannel.QueryInterface(Ci.nsITraceableChannel);
|
||||
|
||||
httpActivity.response.listener = newListener;
|
||||
|
||||
let tee = Cc["@mozilla.org/network/stream-listener-tee;1"].
|
||||
createInstance(Ci.nsIStreamListenerTee);
|
||||
|
||||
// The response will be written into the outputStream of this pipe.
|
||||
// This allows us to buffer the data we are receiving and read it
|
||||
// asynchronously.
|
||||
@ -2259,11 +2255,17 @@ HUD_SERVICE.prototype =
|
||||
sink.init(false, false, HUDService.responsePipeSegmentSize,
|
||||
PR_UINT32_MAX, null);
|
||||
|
||||
// Add listener for the response body.
|
||||
let newListener = new ResponseListener(httpActivity);
|
||||
|
||||
// Remember the input stream, so it isn't released by GC.
|
||||
newListener.inputStream = sink.inputStream;
|
||||
newListener.sink = sink;
|
||||
|
||||
let tee = Cc["@mozilla.org/network/stream-listener-tee;1"].
|
||||
createInstance(Ci.nsIStreamListenerTee);
|
||||
|
||||
let originalListener = aChannel.setNewListener(tee);
|
||||
newListener.sink = sink;
|
||||
|
||||
tee.init(originalListener, sink.outputStream, newListener);
|
||||
|
||||
@ -2307,7 +2309,7 @@ HUD_SERVICE.prototype =
|
||||
// Iterate over all currently ongoing requests. If aChannel can't
|
||||
// be found within them, then exit this function.
|
||||
let httpActivity = null;
|
||||
for each (var item in self.openRequests) {
|
||||
for each (let item in self.openRequests) {
|
||||
if (item.channel !== aChannel) {
|
||||
continue;
|
||||
}
|
||||
@ -2420,7 +2422,8 @@ HUD_SERVICE.prototype =
|
||||
msgObject.messageNode.clipboardText =
|
||||
clipboardTextPieces.join(" ");
|
||||
|
||||
delete self.openRequests[item.id];
|
||||
delete httpActivity.messageObject;
|
||||
delete self.openRequests[httpActivity.id];
|
||||
updatePanel = true;
|
||||
break;
|
||||
}
|
||||
@ -2657,14 +2660,25 @@ HUD_SERVICE.prototype =
|
||||
*/
|
||||
onWindowUnload: function HS_onWindowUnload(aEvent)
|
||||
{
|
||||
let gBrowser = aEvent.target.defaultView.gBrowser;
|
||||
let window = aEvent.target.defaultView;
|
||||
|
||||
window.removeEventListener("unload", this.onWindowUnload, false);
|
||||
|
||||
let gBrowser = window.gBrowser;
|
||||
let tabContainer = gBrowser.tabContainer;
|
||||
|
||||
tabContainer.removeEventListener("TabClose", this.onTabClose, false);
|
||||
|
||||
let tab = tabContainer.firstChild;
|
||||
while (tab != null) {
|
||||
this.deactivateHUDForContext(tab, false);
|
||||
tab = tab.nextSibling;
|
||||
}
|
||||
|
||||
if (window.webConsoleCommandController) {
|
||||
window.controllers.removeController(window.webConsoleCommandController);
|
||||
window.webConsoleCommandController = null;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@ -2690,13 +2704,8 @@ HUD_SERVICE.prototype =
|
||||
return;
|
||||
}
|
||||
|
||||
xulWindow.addEventListener("unload", this.onWindowUnload, false);
|
||||
|
||||
let gBrowser = xulWindow.gBrowser;
|
||||
|
||||
let container = gBrowser.tabContainer;
|
||||
container.addEventListener("TabClose", this.onTabClose, false);
|
||||
|
||||
let _browser = gBrowser.
|
||||
getBrowserForDocument(aContentWindow.top.document);
|
||||
let nBox = gBrowser.getNotificationBox(_browser);
|
||||
@ -2716,6 +2725,9 @@ HUD_SERVICE.prototype =
|
||||
return;
|
||||
}
|
||||
|
||||
xulWindow.addEventListener("unload", this.onWindowUnload, false);
|
||||
gBrowser.tabContainer.addEventListener("TabClose", this.onTabClose, false);
|
||||
|
||||
this.registerDisplay(hudId);
|
||||
|
||||
let hudNode;
|
||||
@ -2775,9 +2787,10 @@ HUD_SERVICE.prototype =
|
||||
*/
|
||||
createController: function HUD_createController(aWindow)
|
||||
{
|
||||
if (aWindow.commandController == null) {
|
||||
aWindow.commandController = new CommandController(aWindow);
|
||||
aWindow.controllers.insertControllerAt(0, aWindow.commandController);
|
||||
if (aWindow.webConsoleCommandController == null) {
|
||||
aWindow.webConsoleCommandController = new CommandController(aWindow);
|
||||
aWindow.controllers.insertControllerAt(0,
|
||||
aWindow.webConsoleCommandController);
|
||||
}
|
||||
},
|
||||
|
||||
@ -3611,7 +3624,16 @@ HeadsUpDisplay.prototype = {
|
||||
*/
|
||||
createPositionUI: function HUD_createPositionUI()
|
||||
{
|
||||
let self = this;
|
||||
this._positionConsoleAbove = (function HUD_positionAbove() {
|
||||
this.positionConsole("above");
|
||||
}).bind(this);
|
||||
|
||||
this._positionConsoleBelow = (function HUD_positionBelow() {
|
||||
this.positionConsole("below");
|
||||
}).bind(this);
|
||||
this._positionConsoleWindow = (function HUD_positionWindow() {
|
||||
this.positionConsole("window");
|
||||
}).bind(this);
|
||||
|
||||
let button = this.makeXULNode("toolbarbutton");
|
||||
button.setAttribute("type", "menu");
|
||||
@ -3625,27 +3647,21 @@ HeadsUpDisplay.prototype = {
|
||||
itemAbove.setAttribute("label", this.getStr("webConsolePositionAbove"));
|
||||
itemAbove.setAttribute("type", "checkbox");
|
||||
itemAbove.setAttribute("autocheck", "false");
|
||||
itemAbove.addEventListener("command", function() {
|
||||
self.positionConsole("above");
|
||||
}, false);
|
||||
itemAbove.addEventListener("command", this._positionConsoleAbove, false);
|
||||
menuPopup.appendChild(itemAbove);
|
||||
|
||||
let itemBelow = this.makeXULNode("menuitem");
|
||||
itemBelow.setAttribute("label", this.getStr("webConsolePositionBelow"));
|
||||
itemBelow.setAttribute("type", "checkbox");
|
||||
itemBelow.setAttribute("autocheck", "false");
|
||||
itemBelow.addEventListener("command", function() {
|
||||
self.positionConsole("below");
|
||||
}, false);
|
||||
itemBelow.addEventListener("command", this._positionConsoleBelow, false);
|
||||
menuPopup.appendChild(itemBelow);
|
||||
|
||||
let itemWindow = this.makeXULNode("menuitem");
|
||||
itemWindow.setAttribute("label", this.getStr("webConsolePositionWindow"));
|
||||
itemWindow.setAttribute("type", "checkbox");
|
||||
itemWindow.setAttribute("autocheck", "false");
|
||||
itemWindow.addEventListener("command", function() {
|
||||
self.positionConsole("window");
|
||||
}, false);
|
||||
itemWindow.addEventListener("command", this._positionConsoleWindow, false);
|
||||
menuPopup.appendChild(itemWindow);
|
||||
|
||||
this.positionMenuitems = {
|
||||
@ -3771,16 +3787,17 @@ HeadsUpDisplay.prototype = {
|
||||
*/
|
||||
makeCloseButton: function HUD_makeCloseButton(aToolbar)
|
||||
{
|
||||
let onCommand = (function HUD_closeButton_onCommand() {
|
||||
this.closeButtonOnCommand = (function HUD_closeButton_onCommand() {
|
||||
HUDService.animate(this.hudId, ANIMATE_OUT, (function() {
|
||||
HUDService.deactivateHUDForContext(this.tab, true);
|
||||
}).bind(this));
|
||||
}).bind(this);
|
||||
|
||||
let closeButton = this.makeXULNode("toolbarbutton");
|
||||
closeButton.classList.add("webconsole-close-button");
|
||||
closeButton.addEventListener("command", onCommand, false);
|
||||
aToolbar.appendChild(closeButton);
|
||||
this.closeButton = this.makeXULNode("toolbarbutton");
|
||||
this.closeButton.classList.add("webconsole-close-button");
|
||||
this.closeButton.addEventListener("command",
|
||||
this.closeButtonOnCommand, false);
|
||||
aToolbar.appendChild(this.closeButton);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -3859,7 +3876,26 @@ HeadsUpDisplay.prototype = {
|
||||
HUD_BOX_DOES_NOT_EXIST: "Heads Up Display does not exist",
|
||||
TAB_ID_REQUIRED: "Tab DOM ID is required",
|
||||
PARENTNODE_NOT_FOUND: "parentNode element not found"
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Destroy the HUD object. Call this method to avoid memory leaks when the Web
|
||||
* Console is closed.
|
||||
*/
|
||||
destroy: function HUD_destroy()
|
||||
{
|
||||
this.jsterm.destroy();
|
||||
|
||||
this.positionMenuitems.above.removeEventListener("command",
|
||||
this._positionConsoleAbove, false);
|
||||
this.positionMenuitems.below.removeEventListener("command",
|
||||
this._positionConsoleBelow, false);
|
||||
this.positionMenuitems.window.removeEventListener("command",
|
||||
this._positionConsoleWindow, false);
|
||||
|
||||
this.closeButton.removeEventListener("command",
|
||||
this.closeButtonOnCommand, false);
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@ -4459,12 +4495,15 @@ JSTerm.prototype = {
|
||||
this.outputNode = this.mixins.outputNode;
|
||||
this.completeNode = this.mixins.completeNode;
|
||||
|
||||
this._keyPress = this.keyPress.bind(this);
|
||||
this._inputEventHandler = this.inputEventHandler.bind(this);
|
||||
|
||||
this.inputNode.addEventListener("keypress",
|
||||
this.keyPress.bind(this), false);
|
||||
this._keyPress, false);
|
||||
this.inputNode.addEventListener("input",
|
||||
this.inputEventHandler.bind(this), false);
|
||||
this._inputEventHandler, false);
|
||||
this.inputNode.addEventListener("keyup",
|
||||
this.inputEventHandler.bind(this), false);
|
||||
this._inputEventHandler, false);
|
||||
},
|
||||
|
||||
get codeInputString()
|
||||
@ -5245,6 +5284,16 @@ JSTerm.prototype = {
|
||||
let prefix = aSuffix ? this.inputNode.value.replace(/[\S]/g, " ") : "";
|
||||
this.completeNode.value = prefix + aSuffix;
|
||||
},
|
||||
|
||||
/**
|
||||
* Destroy the JSTerm object. Call this method to avoid memory leaks.
|
||||
*/
|
||||
destroy: function JST_destroy()
|
||||
{
|
||||
this.inputNode.removeEventListener("keypress", this._keyPress, false);
|
||||
this.inputNode.removeEventListener("input", this._inputEventHandler, false);
|
||||
this.inputNode.removeEventListener("keyup", this._inputEventHandler, false);
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
@ -6399,8 +6448,7 @@ CommandController.prototype = {
|
||||
|
||||
supportsCommand: function CommandController_supportsCommand(aCommand)
|
||||
{
|
||||
return this.isCommandEnabled(aCommand) &&
|
||||
this._getFocusedOutputNode() != null;
|
||||
return this.isCommandEnabled(aCommand);
|
||||
},
|
||||
|
||||
isCommandEnabled: function CommandController_isCommandEnabled(aCommand)
|
||||
|
@ -49,6 +49,7 @@ EXTRA_JS_MODULES = \
|
||||
PropertyPanel.jsm \
|
||||
NetworkHelper.jsm \
|
||||
AutocompletePopup.jsm \
|
||||
gcli.jsm \
|
||||
$(NULL)
|
||||
|
||||
ifdef ENABLE_TESTS
|
||||
|
567
browser/devtools/webconsole/gcli.jsm
Normal file
@ -0,0 +1,567 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is GCLI.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* The Mozilla Foundation
|
||||
* Portions created by the Initial Developer are Copyright (C) 2011
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Joe Walker <jwalker@mozilla.com> (Original Author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*********************************** WARNING ***********************************
|
||||
*
|
||||
* Do not edit this file without understanding where it comes from,
|
||||
* Your changes are likely to be overwritten without warning.
|
||||
*
|
||||
* The original source for this file is:
|
||||
* https://github.com/mozilla/gcli/
|
||||
*
|
||||
*******************************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
* This build of GCLI for Firefox is really 4 bits of code:
|
||||
* - Browser support code - Currently just an implementation of the console
|
||||
* object that uses dump. We may need to add other browser shims to this.
|
||||
* - A very basic commonjs AMD (Asynchronous Modules Definition) 'require'
|
||||
* implementation (which is just good enough to load GCLI). For more, see
|
||||
* http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition.
|
||||
* This alleviates the need for requirejs (http://requirejs.org/) which is
|
||||
* used when running in the browser.
|
||||
* This section of code is a copy of mini_require.js without the header and
|
||||
* footers. Changes to one should be reflected in the other.
|
||||
* - A build of GCLI itself, packaged using dryice (for more details see the
|
||||
* project https://github.com/mozilla/dryice and the build file in this
|
||||
* project at Makefile.dryice.js)
|
||||
* - Lastly, code to require the gcli object as needed by EXPORTED_SYMBOLS.
|
||||
*/
|
||||
|
||||
var EXPORTED_SYMBOLS = [ "gcli" ];
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
* This creates a console object that somewhat replicates Firebug's console
|
||||
* object. It currently writes to dump(), but should write to the web
|
||||
* console's chrome error section (when it has one)
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* String utility to ensure that strings are a specified length. Strings
|
||||
* that are too long are truncated to the max length and the last char is
|
||||
* set to "_". Strings that are too short are left padded with spaces.
|
||||
*
|
||||
* @param {string} aStr
|
||||
* The string to format to the correct length
|
||||
* @param {number} aMaxLen
|
||||
* The maximum allowed length of the returned string
|
||||
* @param {number} aMinLen (optional)
|
||||
* The minimum allowed length of the returned string. If undefined,
|
||||
* then aMaxLen will be used
|
||||
* @param {object} aOptions (optional)
|
||||
* An object allowing format customization. The only customization
|
||||
* allowed currently is 'truncate' which can take the value "start" to
|
||||
* truncate strings from the start as opposed to the end.
|
||||
* @return {string}
|
||||
* The original string formatted to fit the specified lengths
|
||||
*/
|
||||
function fmt(aStr, aMaxLen, aMinLen, aOptions) {
|
||||
if (aMinLen == undefined) {
|
||||
aMinLen = aMaxLen;
|
||||
}
|
||||
if (aStr == null) {
|
||||
aStr = "";
|
||||
}
|
||||
if (aStr.length > aMaxLen) {
|
||||
if (aOptions && aOptions.truncate == "start") {
|
||||
return "_" + aStr.substring(aStr.length - aMaxLen + 1);
|
||||
}
|
||||
else {
|
||||
return aStr.substring(0, aMaxLen - 1) + "_";
|
||||
}
|
||||
}
|
||||
if (aStr.length < aMinLen) {
|
||||
return Array(aMinLen - aStr.length + 1).join(" ") + aStr;
|
||||
}
|
||||
return aStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility to extract the constructor name of an object.
|
||||
* Object.toString gives: "[object ?????]"; we want the "?????".
|
||||
*
|
||||
* @param {object} aObj
|
||||
* The object from which to extract the constructor name
|
||||
* @return {string}
|
||||
* The constructor name
|
||||
*/
|
||||
function getCtorName(aObj) {
|
||||
return Object.prototype.toString.call(aObj).slice(8, -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* A single line stringification of an object designed for use by humans
|
||||
*
|
||||
* @param {any} aThing
|
||||
* The object to be stringified
|
||||
* @return {string}
|
||||
* A single line representation of aThing, which will generally be at
|
||||
* most 60 chars long
|
||||
*/
|
||||
function stringify(aThing) {
|
||||
if (aThing === undefined) {
|
||||
return "undefined";
|
||||
}
|
||||
|
||||
if (aThing === null) {
|
||||
return "null";
|
||||
}
|
||||
|
||||
if (typeof aThing == "object") {
|
||||
try {
|
||||
return getCtorName(aThing) + " " + fmt(JSON.stringify(aThing), 50, 0);
|
||||
}
|
||||
catch (ex) {
|
||||
return "[stringify error]";
|
||||
}
|
||||
}
|
||||
|
||||
var str = aThing.toString().replace(/\s+/g, " ");
|
||||
return fmt(str, 60, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* A multi line stringification of an object, designed for use by humans
|
||||
*
|
||||
* @param {any} aThing
|
||||
* The object to be stringified
|
||||
* @return {string}
|
||||
* A multi line representation of aThing
|
||||
*/
|
||||
function log(aThing) {
|
||||
if (aThing == null) {
|
||||
return "null";
|
||||
}
|
||||
|
||||
if (aThing == undefined) {
|
||||
return "undefined";
|
||||
}
|
||||
|
||||
if (typeof aThing == "object") {
|
||||
var reply = "";
|
||||
var type = getCtorName(aThing);
|
||||
if (type == "Error") {
|
||||
reply += " " + aThing.message + "\n";
|
||||
reply += logProperty("stack", aThing.stack);
|
||||
}
|
||||
else {
|
||||
var keys = Object.getOwnPropertyNames(aThing);
|
||||
if (keys.length > 0) {
|
||||
reply += type + "\n";
|
||||
keys.forEach(function(aProp) {
|
||||
reply += logProperty(aProp, aThing[aProp]);
|
||||
}, this);
|
||||
}
|
||||
else {
|
||||
reply += type + " (enumerated with for-in)\n";
|
||||
var prop;
|
||||
for (prop in aThing) {
|
||||
reply += logProperty(prop, aThing[prop]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return reply;
|
||||
}
|
||||
|
||||
return " " + aThing.toString() + "\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper for log() which converts a property/value pair into an output
|
||||
* string
|
||||
*
|
||||
* @param {string} aProp
|
||||
* The name of the property to include in the output string
|
||||
* @param {object} aValue
|
||||
* Value assigned to aProp to be converted to a single line string
|
||||
* @return {string}
|
||||
* Multi line output string describing the property/value pair
|
||||
*/
|
||||
function logProperty(aProp, aValue) {
|
||||
var reply = "";
|
||||
if (aProp == "stack" && typeof value == "string") {
|
||||
var trace = parseStack(aValue);
|
||||
reply += formatTrace(trace);
|
||||
}
|
||||
else {
|
||||
reply += " - " + aProp + " = " + stringify(aValue) + "\n";
|
||||
}
|
||||
return reply;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a stack trace, returning an array of stack frame objects, where
|
||||
* each has file/line/call members
|
||||
*
|
||||
* @param {string} aStack
|
||||
* The serialized stack trace
|
||||
* @return {object[]}
|
||||
* Array of { file: "...", line: NNN, call: "..." } objects
|
||||
*/
|
||||
function parseStack(aStack) {
|
||||
var trace = [];
|
||||
aStack.split("\n").forEach(function(line) {
|
||||
if (!line) {
|
||||
return;
|
||||
}
|
||||
var at = line.lastIndexOf("@");
|
||||
var posn = line.substring(at + 1);
|
||||
trace.push({
|
||||
file: posn.split(":")[0],
|
||||
line: posn.split(":")[1],
|
||||
call: line.substring(0, at)
|
||||
});
|
||||
}, this);
|
||||
return trace;
|
||||
}
|
||||
|
||||
/**
|
||||
* parseStack() takes output from an exception from which it creates the an
|
||||
* array of stack frame objects, this has the same output but using data from
|
||||
* Components.stack
|
||||
*
|
||||
* @param {string} aFrame
|
||||
* The stack frame from which to begin the walk
|
||||
* @return {object[]}
|
||||
* Array of { file: "...", line: NNN, call: "..." } objects
|
||||
*/
|
||||
function getStack(aFrame) {
|
||||
if (!aFrame) {
|
||||
aFrame = Components.stack.caller;
|
||||
}
|
||||
var trace = [];
|
||||
while (aFrame) {
|
||||
trace.push({
|
||||
file: aFrame.filename,
|
||||
line: aFrame.lineNumber,
|
||||
call: aFrame.name
|
||||
});
|
||||
aFrame = aFrame.caller;
|
||||
}
|
||||
return trace;
|
||||
};
|
||||
|
||||
/**
|
||||
* Take the output from parseStack() and convert it to nice readable
|
||||
* output
|
||||
*
|
||||
* @param {object[]} aTrace
|
||||
* Array of trace objects as created by parseStack()
|
||||
* @return {string} Multi line report of the stack trace
|
||||
*/
|
||||
function formatTrace(aTrace) {
|
||||
var reply = "";
|
||||
aTrace.forEach(function(frame) {
|
||||
reply += fmt(frame.file, 20, 20, { truncate: "start" }) + " " +
|
||||
fmt(frame.line, 5, 5) + " " +
|
||||
fmt(frame.call, 75, 75) + "\n";
|
||||
});
|
||||
return reply;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a function which will output a concise level of output when used
|
||||
* as a logging function
|
||||
*
|
||||
* @param {string} aLevel
|
||||
* A prefix to all output generated from this function detailing the
|
||||
* level at which output occurred
|
||||
* @return {function}
|
||||
* A logging function
|
||||
* @see createMultiLineDumper()
|
||||
*/
|
||||
function createDumper(aLevel) {
|
||||
return function() {
|
||||
var args = Array.prototype.slice.call(arguments, 0);
|
||||
var data = args.map(function(arg) {
|
||||
return stringify(arg);
|
||||
});
|
||||
dump(aLevel + ": " + data.join(", ") + "\n");
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a function which will output more detailed level of output when
|
||||
* used as a logging function
|
||||
*
|
||||
* @param {string} aLevel
|
||||
* A prefix to all output generated from this function detailing the
|
||||
* level at which output occurred
|
||||
* @return {function}
|
||||
* A logging function
|
||||
* @see createDumper()
|
||||
*/
|
||||
function createMultiLineDumper(aLevel) {
|
||||
return function() {
|
||||
dump(aLevel + "\n");
|
||||
var args = Array.prototype.slice.call(arguments, 0);
|
||||
args.forEach(function(arg) {
|
||||
dump(log(arg));
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* The console object to expose
|
||||
*/
|
||||
var console = {
|
||||
debug: createMultiLineDumper("debug"),
|
||||
log: createDumper("log"),
|
||||
info: createDumper("info"),
|
||||
warn: createDumper("warn"),
|
||||
error: createMultiLineDumper("error"),
|
||||
trace: function Console_trace() {
|
||||
var trace = getStack(Components.stack.caller);
|
||||
dump(formatTrace(trace) + "\n");
|
||||
},
|
||||
clear: function Console_clear() {},
|
||||
|
||||
dir: createMultiLineDumper("dir"),
|
||||
dirxml: createMultiLineDumper("dirxml"),
|
||||
group: createDumper("group"),
|
||||
groupEnd: createDumper("groupEnd")
|
||||
};
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// There are 2 virtually identical copies of this code:
|
||||
// - $GCLI_HOME/build/prefix-gcli.jsm
|
||||
// - $GCLI_HOME/build/mini_require.js
|
||||
// They should both be kept in sync
|
||||
|
||||
var debugDependencies = false;
|
||||
|
||||
/**
|
||||
* Define a module along with a payload.
|
||||
* @param {string} moduleName Name for the payload
|
||||
* @param {ignored} deps Ignored. For compatibility with CommonJS AMD Spec
|
||||
* @param {function} payload Function with (require, exports, module) params
|
||||
*/
|
||||
function define(moduleName, deps, payload) {
|
||||
if (typeof moduleName != "string") {
|
||||
console.error(this.depth + " Error: Module name is not a string.");
|
||||
console.trace();
|
||||
return;
|
||||
}
|
||||
|
||||
if (arguments.length == 2) {
|
||||
payload = deps;
|
||||
}
|
||||
|
||||
if (debugDependencies) {
|
||||
console.log("define: " + moduleName + " -> " + payload.toString()
|
||||
.slice(0, 40).replace(/\n/, '\\n').replace(/\r/, '\\r') + "...");
|
||||
}
|
||||
|
||||
if (moduleName in define.modules) {
|
||||
console.error(this.depth + " Error: Redefining module: " + moduleName);
|
||||
}
|
||||
define.modules[moduleName] = payload;
|
||||
};
|
||||
|
||||
/**
|
||||
* The global store of un-instantiated modules
|
||||
*/
|
||||
define.modules = {};
|
||||
|
||||
|
||||
/**
|
||||
* We invoke require() in the context of a Domain so we can have multiple
|
||||
* sets of modules running separate from each other.
|
||||
* This contrasts with JSMs which are singletons, Domains allows us to
|
||||
* optionally load a CommonJS module twice with separate data each time.
|
||||
* Perhaps you want 2 command lines with a different set of commands in each,
|
||||
* for example.
|
||||
*/
|
||||
function Domain() {
|
||||
this.modules = {};
|
||||
|
||||
if (debugDependencies) {
|
||||
this.depth = "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Lookup module names and resolve them by calling the definition function if
|
||||
* needed.
|
||||
* There are 2 ways to call this, either with an array of dependencies and a
|
||||
* callback to call when the dependencies are found (which can happen
|
||||
* asynchronously in an in-page context) or with a single string an no callback
|
||||
* where the dependency is resolved synchronously and returned.
|
||||
* The API is designed to be compatible with the CommonJS AMD spec and
|
||||
* RequireJS.
|
||||
* @param {string[]|string} deps A name, or names for the payload
|
||||
* @param {function|undefined} callback Function to call when the dependencies
|
||||
* are resolved
|
||||
* @return {undefined|object} The module required or undefined for
|
||||
* array/callback method
|
||||
*/
|
||||
Domain.prototype.require = function(deps, callback) {
|
||||
if (Array.isArray(deps)) {
|
||||
var params = deps.map(function(dep) {
|
||||
return this.lookup(dep);
|
||||
}, this);
|
||||
if (callback) {
|
||||
callback.apply(null, params);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
else {
|
||||
return this.lookup(deps);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Lookup module names and resolve them by calling the definition function if
|
||||
* needed.
|
||||
* @param {string} moduleName A name for the payload to lookup
|
||||
* @return {object} The module specified by aModuleName or null if not found.
|
||||
*/
|
||||
Domain.prototype.lookup = function(moduleName) {
|
||||
if (moduleName in this.modules) {
|
||||
var module = this.modules[moduleName];
|
||||
if (debugDependencies) {
|
||||
console.log(this.depth + " Using module: " + moduleName);
|
||||
}
|
||||
return module;
|
||||
}
|
||||
|
||||
if (!(moduleName in define.modules)) {
|
||||
console.error(this.depth + " Missing module: " + moduleName);
|
||||
return null;
|
||||
}
|
||||
|
||||
var module = define.modules[moduleName];
|
||||
|
||||
if (debugDependencies) {
|
||||
console.log(this.depth + " Compiling module: " + moduleName);
|
||||
}
|
||||
|
||||
if (typeof module == "function") {
|
||||
if (debugDependencies) {
|
||||
this.depth += ".";
|
||||
}
|
||||
|
||||
var exports = {};
|
||||
try {
|
||||
module(this.require.bind(this), exports, { id: moduleName, uri: "" });
|
||||
}
|
||||
catch (ex) {
|
||||
console.error("Error using module: " + moduleName, ex);
|
||||
throw ex;
|
||||
}
|
||||
module = exports;
|
||||
|
||||
if (debugDependencies) {
|
||||
this.depth = this.depth.slice(0, -1);
|
||||
}
|
||||
}
|
||||
|
||||
// cache the resulting module object for next time
|
||||
this.modules[moduleName] = module;
|
||||
|
||||
return module;
|
||||
};
|
||||
|
||||
/**
|
||||
* Expose the Domain constructor and a global domain (on the define function
|
||||
* to avoid exporting more than we need. This is a common pattern with require
|
||||
* systems)
|
||||
*/
|
||||
define.Domain = Domain;
|
||||
define.globalDomain = new Domain();
|
||||
|
||||
/**
|
||||
* Expose a default require function which is the require of the global
|
||||
* sandbox to make it easy to use.
|
||||
*/
|
||||
var require = define.globalDomain.require.bind(define.globalDomain);
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
* The API of interest to people wanting to create GCLI commands is as
|
||||
* follows. The implementation of this API is left to bug 659061 and other
|
||||
* bugs.
|
||||
*/
|
||||
|
||||
define('gcli/index', [ ], function(require, exports, module) {
|
||||
|
||||
exports.addCommand = function() { /* implementation goes here */ };
|
||||
exports.removeCommand = function() { /* implementation goes here */ };
|
||||
exports.startup = function() { /* implementation goes here */ };
|
||||
exports.shutdown = function() { /* implementation goes here */ };
|
||||
|
||||
});
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
* require GCLI so it can be exported as declared in EXPORTED_SYMBOLS
|
||||
* The dependencies specified here should be the same as in Makefile.dryice.js
|
||||
*/
|
||||
var gcli = require("gcli/index");
|
||||
gcli.createView = require("gcli/ui/start/firefox");
|
||||
gcli._internal = { require: require, define: define, console: console };
|
||||
|
@ -108,6 +108,7 @@ _BROWSER_TEST_FILES = \
|
||||
browser_webconsole_bug_600183_charset.js \
|
||||
browser_webconsole_bug_601177_log_levels.js \
|
||||
browser_webconsole_bug_597460_filter_scroll.js \
|
||||
browser_webconsole_gcli_require.js \
|
||||
browser_webconsole_console_extras.js \
|
||||
browser_webconsole_bug_598357_jsterm_output.js \
|
||||
browser_webconsole_bug_603750_websocket.js \
|
||||
|
@ -36,7 +36,7 @@ function testSelectionWhenMovingBetweenBoxes() {
|
||||
|
||||
// Test that the global Firefox "Select All" functionality (e.g. Edit >
|
||||
// Select All) works properly in the Web Console.
|
||||
let commandController = window.commandController;
|
||||
let commandController = window.webConsoleCommandController;
|
||||
ok(commandController != null, "the window has a command controller object");
|
||||
|
||||
commandController.selectAll(outputNode);
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
let itemsSet;
|
||||
let itemsSet, HUD;
|
||||
|
||||
function test() {
|
||||
addTab("data:text/html,Web Console test for bug 626484");
|
||||
@ -30,6 +30,7 @@ function nextTest() {
|
||||
if (itemsSet.length === 0) {
|
||||
outputNode.clearSelection();
|
||||
HUD.jsterm.clearOutput();
|
||||
HUD = null;
|
||||
finish();
|
||||
}
|
||||
else {
|
||||
|
@ -0,0 +1,122 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Tests that source URLs in the Web Console can be clicked to display the
|
||||
// standard View Source window.
|
||||
|
||||
var modules = { gcli: null };
|
||||
|
||||
Components.utils.import("resource:///modules/gcli.jsm", modules);
|
||||
|
||||
var define, require, console;
|
||||
|
||||
function test() {
|
||||
|
||||
define = modules.gcli._internal.define;
|
||||
require = modules.gcli._internal.require;
|
||||
console = modules.gcli._internal.console;
|
||||
|
||||
define('gclitest/requirable', [], function(require, exports, module) {
|
||||
exports.thing1 = 'thing1';
|
||||
exports.thing2 = 2;
|
||||
|
||||
let status = 'initial';
|
||||
exports.setStatus = function(aStatus) { status = aStatus; };
|
||||
exports.getStatus = function() { return status; };
|
||||
});
|
||||
|
||||
define('gclitest/unrequirable', [], function(require, exports, module) {
|
||||
null.throwNPE();
|
||||
});
|
||||
|
||||
define('gclitest/recurse', [], function(require, exports, module) {
|
||||
require('gclitest/recurse');
|
||||
});
|
||||
|
||||
testWorking();
|
||||
testLeakage();
|
||||
testMultiImport();
|
||||
testRecursive();
|
||||
testUncompilable();
|
||||
|
||||
finishTest();
|
||||
|
||||
delete define.modules['gclitest/requirable'];
|
||||
delete define.globalDomain.modules['gclitest/requirable'];
|
||||
delete define.modules['gclitest/unrequirable'];
|
||||
delete define.globalDomain.modules['gclitest/unrequirable'];
|
||||
delete define.modules['gclitest/recurse'];
|
||||
delete define.globalDomain.modules['gclitest/recurse'];
|
||||
|
||||
define = null;
|
||||
require = null;
|
||||
console = null;
|
||||
|
||||
modules = null;
|
||||
}
|
||||
|
||||
function testWorking() {
|
||||
// There are lots of requirement tests that we could be doing here
|
||||
// The fact that we can get anything at all working is a testament to
|
||||
// require doing what it should - we don't need to test the
|
||||
let requireable = require('gclitest/requirable');
|
||||
ok('thing1' == requireable.thing1, 'thing1 was required');
|
||||
ok(2 == requireable.thing2, 'thing2 was required');
|
||||
ok(requireable.thing3 === undefined, 'thing3 was not required');
|
||||
}
|
||||
|
||||
function testDomains() {
|
||||
let requireable = require('gclitest/requirable');
|
||||
ok(requireable.status === undefined, 'requirable has no status');
|
||||
requireable.setStatus(null);
|
||||
ok(null === requireable.getStatus(), 'requirable.getStatus changed to null');
|
||||
ok(requireable.status === undefined, 'requirable still has no status');
|
||||
requireable.setStatus('42');
|
||||
ok('42' == requireable.getStatus(), 'requirable.getStatus changed to 42');
|
||||
ok(requireable.status === undefined, 'requirable *still* has no status');
|
||||
|
||||
let domain = new define.Domain();
|
||||
let requireable2 = domain.require('gclitest/requirable');
|
||||
ok(requireable2.status === undefined, 'requirable2 has no status');
|
||||
ok('initial' === requireable2.getStatus(), 'requirable2.getStatus is initial');
|
||||
requireable2.setStatus(999);
|
||||
ok(999 === requireable2.getStatus(), 'requirable2.getStatus changed to 999');
|
||||
ok(requireable2.status === undefined, 'requirable2 still has no status');
|
||||
|
||||
t.verifyEqual('42', requireable.getStatus());
|
||||
ok(requireable.status === undefined, 'requirable has no status (as expected)');
|
||||
|
||||
delete domain.modules['gclitest/requirable'];
|
||||
}
|
||||
|
||||
function testLeakage() {
|
||||
let requireable = require('gclitest/requirable');
|
||||
ok(requireable.setup == null, 'leakage of setup');
|
||||
ok(requireable.shutdown == null, 'leakage of shutdown');
|
||||
ok(requireable.testWorking == null, 'leakage of testWorking');
|
||||
}
|
||||
|
||||
function testMultiImport() {
|
||||
let r1 = require('gclitest/requirable');
|
||||
let r2 = require('gclitest/requirable');
|
||||
ok(r1 === r2, 'double require was strict equal');
|
||||
}
|
||||
|
||||
function testUncompilable() {
|
||||
// It's not totally clear how a module loader should perform with unusable
|
||||
// modules, however at least it should go into a flat spin ...
|
||||
// GCLI mini_require reports an error as it should
|
||||
try {
|
||||
let unrequireable = require('gclitest/unrequirable');
|
||||
fail();
|
||||
}
|
||||
catch (ex) {
|
||||
// an exception is expected
|
||||
}
|
||||
}
|
||||
|
||||
function testRecursive() {
|
||||
// See Bug 658583
|
||||
// require('gclitest/recurse');
|
||||
// Also see the comments in the testRecursive() function
|
||||
}
|
@ -57,8 +57,6 @@ function pprint(aObj)
|
||||
|
||||
let tab, browser, hudId, hud, hudBox, filterBox, outputNode, cs;
|
||||
|
||||
let win = gBrowser.selectedBrowser;
|
||||
|
||||
function addTab(aURL)
|
||||
{
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
@ -185,6 +183,3 @@ registerCleanupFunction(tearDown);
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
// removed tests:
|
||||
// browser_webconsole_bug_580030_errors_after_page_reload.js \
|
||||
// browser_webconsole_bug_595350_multiple_windows_and_tabs.js \
|
||||
|
@ -108,9 +108,6 @@
|
||||
@BINPATH@/mozilla-xremote-client
|
||||
#endif
|
||||
#endif
|
||||
#ifdef MOZ_SPLASHSCREEN
|
||||
@BINPATH@/splash.bmp
|
||||
#endif
|
||||
|
||||
; [Components]
|
||||
@BINPATH@/components/components.manifest
|
||||
|
@ -64,7 +64,7 @@
|
||||
<!ENTITY enableAddonsUpdate2.label "Add-ons">
|
||||
<!ENTITY enableAddonsUpdate2.accesskey "n">
|
||||
<!ENTITY enableSearchUpdate.label "Search Engines">
|
||||
<!ENTITY enableSearchUpdate.accesskey "h">
|
||||
<!ENTITY enableSearchUpdate.accesskey "E">
|
||||
<!ENTITY whenUpdatesFound.label "When updates to &brandShortName; are found:">
|
||||
<!ENTITY askMe.label "Ask me what I want to do">
|
||||
<!ENTITY askMe.accesskey "k">
|
||||
|
@ -37,13 +37,39 @@
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
%endif
|
||||
|
||||
html {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#errorPageContainer {
|
||||
background-image: url("moz-icon://stock/gtk-dialog-warning?size=dialog");
|
||||
display: -moz-box;
|
||||
width: -moz-available;
|
||||
height: 70%;
|
||||
-moz-box-orient: vertical;
|
||||
text-align: start;
|
||||
}
|
||||
|
||||
#errorShortDesc > p {
|
||||
margin-top: 0.4em;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#errorLongContent, #errorTrailerDesc {
|
||||
display: -moz-box;
|
||||
-moz-box-flex: 1;
|
||||
-moz-box-orient: vertical;
|
||||
}
|
||||
|
||||
#tabList {
|
||||
margin-top: 2.5em;
|
||||
width: 100%;
|
||||
height: 12em;
|
||||
min-height: 12em;
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-image(icon),
|
||||
|
@ -1318,6 +1318,8 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
|
||||
background-origin: border-box;
|
||||
border: none;
|
||||
-moz-border-start: 1px solid rgba(0,0,0,.35);
|
||||
box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
|
||||
-1px -1px 1px rgba(255,255,255,.2) inset;
|
||||
}
|
||||
|
||||
#urlbar:-moz-locale-dir(ltr) > toolbarbutton {
|
||||
@ -1330,9 +1332,14 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
|
||||
border-bottom-left-radius: 2px;
|
||||
}
|
||||
|
||||
#urlbar > toolbarbutton:not([disabled]):active:hover {
|
||||
#urlbar > toolbarbutton:not([disabled]):active:hover,
|
||||
#urlbar-reload-button:not(:hover) {
|
||||
-moz-border-start-style: none;
|
||||
-moz-padding-start: 4px;
|
||||
-moz-border-start: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
#urlbar > toolbarbutton:not([disabled]):active:hover {
|
||||
box-shadow: 0 0 6.5px rgba(0,0,0,.4) inset,
|
||||
0 0 2px rgba(0,0,0,.4) inset;
|
||||
}
|
||||
@ -1340,8 +1347,6 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
|
||||
#urlbar-go-button {
|
||||
-moz-image-region: rect(0px, 56px, 14px, 42px);
|
||||
background-image: -moz-linear-gradient(rgb(143,219,69), rgb(115,177,57));
|
||||
box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
|
||||
-1px -1px 0 rgba(255,255,255,.2) inset;
|
||||
}
|
||||
|
||||
#urlbar-go-button:-moz-locale-dir(rtl) > .toolbarbutton-icon {
|
||||
@ -1359,15 +1364,11 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
|
||||
#urlbar-reload-button:not([disabled]):hover {
|
||||
-moz-image-region: rect(0px, 28px, 14px, 14px);
|
||||
background-image: -moz-linear-gradient(rgb(137,183,233), rgb(79,130,195));
|
||||
box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
|
||||
-1px -1px 0 rgba(255,255,255,.2) inset;
|
||||
}
|
||||
|
||||
#urlbar-stop-button {
|
||||
-moz-image-region: rect(0px, 42px, 14px, 28px);
|
||||
background-image: -moz-linear-gradient(rgb(226,99,99), rgb(199,68,68));
|
||||
box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
|
||||
-1px -1px 0 rgba(255,255,255,.2) inset;
|
||||
}
|
||||
|
||||
#urlbar-stop-button:hover {
|
||||
|
@ -63,6 +63,7 @@ browser.jar:
|
||||
skin/classic/browser/places/tag.png (places/tag.png)
|
||||
skin/classic/browser/places/toolbarDropMarker.png (places/toolbarDropMarker.png)
|
||||
skin/classic/browser/places/unsortedBookmarks.png (places/unsortedBookmarks.png)
|
||||
skin/classic/browser/places/downloads.png (places/downloads.png)
|
||||
skin/classic/browser/preferences/alwaysAsk.png (preferences/alwaysAsk.png)
|
||||
skin/classic/browser/preferences/mail.png (preferences/mail.png)
|
||||
skin/classic/browser/preferences/Options.png (preferences/Options.png)
|
||||
|
BIN
browser/themes/gnomestripe/browser/places/downloads.png
Normal file
After Width: | Height: | Size: 599 B |
@ -70,6 +70,11 @@ treechildren::-moz-tree-image(title, query) {
|
||||
list-style-image: url("chrome://browser/skin/places/query.png");
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-image(query, OrganizerQuery_Downloads) {
|
||||
list-style-image: url("chrome://browser/skin/places/downloads.png");
|
||||
-moz-image-region: auto;
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-image(title, query, tagContainer),
|
||||
treechildren::-moz-tree-image(query, OrganizerQuery_Tags) {
|
||||
list-style-image: url("chrome://mozapps/skin/places/tagContainerIcon.png");
|
||||
|
@ -36,13 +36,39 @@
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
%endif
|
||||
|
||||
html {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#errorPageContainer {
|
||||
background-image: url("chrome://global/skin/icons/warning-64.png");
|
||||
display: -moz-box;
|
||||
width: -moz-available;
|
||||
height: 70%;
|
||||
-moz-box-orient: vertical;
|
||||
text-align: start;
|
||||
}
|
||||
|
||||
#errorShortDesc > p {
|
||||
margin-top: 0.4em;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#errorLongContent, #errorTrailerDesc {
|
||||
display: -moz-box;
|
||||
-moz-box-flex: 1;
|
||||
-moz-box-orient: vertical;
|
||||
}
|
||||
|
||||
#tabList {
|
||||
margin-top: 2.5em;
|
||||
width: 100%;
|
||||
height: 12em;
|
||||
min-height: 12em;
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-image(icon),
|
||||
|
@ -1042,6 +1042,8 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
|
||||
background-origin: border-box;
|
||||
border: none;
|
||||
-moz-border-start: 1px solid rgba(0,0,0,.25);
|
||||
box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
|
||||
-1px -1px 1px rgba(255,255,255,.15) inset;
|
||||
}
|
||||
|
||||
#urlbar:-moz-locale-dir(ltr) > toolbarbutton {
|
||||
@ -1054,17 +1056,20 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
|
||||
border-bottom-left-radius: 2px;
|
||||
}
|
||||
|
||||
#urlbar > toolbarbutton:not([disabled]):active:hover,
|
||||
#urlbar-reload-button:not(:hover) {
|
||||
-moz-border-start-style: none;
|
||||
-moz-padding-start: 4px;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
#urlbar > toolbarbutton:not([disabled]):active:hover {
|
||||
box-shadow: @toolbarbuttonPressedInnerShadow@;
|
||||
-moz-padding-start: 4px;
|
||||
-moz-border-start: none;
|
||||
}
|
||||
|
||||
#urlbar-go-button {
|
||||
-moz-image-region: rect(0px, 56px, 14px, 42px);
|
||||
background-image: -moz-linear-gradient(rgb(184,221,142), rgb(154,201,111) 49%, rgb(130,187,92) 51%, rgb(114,171,79));
|
||||
box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
|
||||
-1px -1px 1px rgba(255,255,255,.15) inset;
|
||||
}
|
||||
|
||||
#urlbar-go-button:-moz-locale-dir(rtl) > .toolbarbutton-icon {
|
||||
@ -1078,15 +1083,11 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
|
||||
#urlbar-reload-button:not([disabled]):hover {
|
||||
-moz-image-region: rect(0px, 28px, 14px, 14px);
|
||||
background-image: -moz-linear-gradient(rgb(162,207,241), rgb(111,178,225) 49%, rgb(91,159,217) 51%, rgb(62,138,200));
|
||||
box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
|
||||
-1px -1px 1px rgba(255,255,255,.15) inset;
|
||||
}
|
||||
|
||||
#urlbar-stop-button {
|
||||
-moz-image-region: rect(0px, 42px, 14px, 28px);
|
||||
background-image: -moz-linear-gradient(rgb(231,162,140), rgb(209,119,100) 49%, rgb(193,92,78) 51%, rgb(173,72,58));
|
||||
box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
|
||||
-1px -1px 1px rgba(255,255,255,.15) inset;
|
||||
}
|
||||
|
||||
/* POPUP BLOCKER BUTTON */
|
||||
|
@ -83,6 +83,7 @@ browser.jar:
|
||||
skin/classic/browser/places/twisty-open.gif (places/twisty-open.gif)
|
||||
skin/classic/browser/places/twisty-closed.gif (places/twisty-closed.gif)
|
||||
skin/classic/browser/places/tag.png (places/tag.png)
|
||||
skin/classic/browser/places/downloads.png (places/downloads.png)
|
||||
skin/classic/browser/places/expander-closed-active.png (places/expander-closed-active.png)
|
||||
skin/classic/browser/places/expander-closed.png (places/expander-closed.png)
|
||||
skin/classic/browser/places/expander-open-active.png (places/expander-open-active.png)
|
||||
|
BIN
browser/themes/pinstripe/browser/places/downloads.png
Normal file
After Width: | Height: | Size: 678 B |
@ -144,6 +144,10 @@ treechildren::-moz-tree-image(query) {
|
||||
list-style-image: url("chrome://browser/skin/places/query.png");
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-image(query, OrganizerQuery_Downloads) {
|
||||
list-style-image: url("chrome://browser/skin/places/downloads.png");
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-image(title, query, tagContainer),
|
||||
treechildren::-moz-tree-image(query, OrganizerQuery_Tags) {
|
||||
list-style-image: url("chrome://mozapps/skin/places/tagContainerIcon.png");
|
||||
|
@ -36,13 +36,39 @@
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
%endif
|
||||
|
||||
html {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#errorPageContainer {
|
||||
background-image: url("chrome://global/skin/icons/warning-large.png");
|
||||
display: -moz-box;
|
||||
width: -moz-available;
|
||||
height: 70%;
|
||||
-moz-box-orient: vertical;
|
||||
text-align: start;
|
||||
}
|
||||
|
||||
#errorShortDesc > p {
|
||||
margin-top: 0.4em;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#errorLongContent, #errorTrailerDesc {
|
||||
display: -moz-box;
|
||||
-moz-box-flex: 1;
|
||||
-moz-box-orient: vertical;
|
||||
}
|
||||
|
||||
#tabList {
|
||||
margin-top: 2.5em;
|
||||
width: 100%;
|
||||
height: 12em;
|
||||
min-height: 12em;
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-image(icon),
|
||||
|
@ -141,10 +141,10 @@
|
||||
border-right-style: none !important;
|
||||
}
|
||||
|
||||
#toolbar-menubar :-moz-any(@primaryToolbarButtons@):not(#alltabs-button):not(#tabview-button):not(#new-tab-button) > .toolbarbutton-icon:not(:-moz-lwtheme),
|
||||
#TabsToolbar[tabsontop=true] :-moz-any(@primaryToolbarButtons@):not(#alltabs-button):not(#tabview-button):not(#new-tab-button) > .toolbarbutton-icon:not(:-moz-lwtheme),
|
||||
#navigator-toolbox[tabsontop=false] > #nav-bar :-moz-any(@primaryToolbarButtons@):not(#alltabs-button):not(#tabview-button):not(#new-tab-button) > .toolbarbutton-icon:not(:-moz-lwtheme),
|
||||
#nav-bar + #customToolbars + #PersonalToolbar[collapsed=true] + #TabsToolbar[tabsontop=false]:last-child :-moz-any(@primaryToolbarButtons@):not(#alltabs-button):not(#tabview-button):not(#new-tab-button) > .toolbarbutton-icon:not(:-moz-lwtheme) {
|
||||
#toolbar-menubar :-moz-any(@primaryToolbarButtons@):not(:-moz-any(#alltabs-button,#tabview-button,#new-tab-button,#sync-button[status])) > .toolbarbutton-icon:not(:-moz-lwtheme),
|
||||
#TabsToolbar[tabsontop=true] :-moz-any(@primaryToolbarButtons@):not(:-moz-any(#alltabs-button,#tabview-button,#new-tab-button,#sync-button[status])) > .toolbarbutton-icon:not(:-moz-lwtheme),
|
||||
#navigator-toolbox[tabsontop=false] > #nav-bar :-moz-any(@primaryToolbarButtons@):not(:-moz-any(#alltabs-button,#tabview-button,#new-tab-button,#sync-button[status])) > .toolbarbutton-icon:not(:-moz-lwtheme),
|
||||
#nav-bar + #customToolbars + #PersonalToolbar[collapsed=true] + #TabsToolbar[tabsontop=false]:last-child :-moz-any(@primaryToolbarButtons@):not(:-moz-any(#alltabs-button,#tabview-button,#new-tab-button,#sync-button[status])) > .toolbarbutton-icon:not(:-moz-lwtheme) {
|
||||
list-style-image: url("chrome://browser/skin/Toolbar-inverted.png");
|
||||
}
|
||||
|
||||
|
@ -674,7 +674,7 @@ menuitem.bookmark-item {
|
||||
-moz-padding-end: 2px;
|
||||
}
|
||||
|
||||
@navbarLargeIcons@ :-moz-any(@primaryToolbarButtons@):not(#alltabs-button):not(#tabview-button):not(#new-tab-button) > .toolbarbutton-icon {
|
||||
@navbarLargeIcons@ :-moz-any(@primaryToolbarButtons@):not(:-moz-any(#alltabs-button,#tabview-button,#new-tab-button,#sync-button[status])) > .toolbarbutton-icon {
|
||||
list-style-image: url("chrome://browser/skin/Toolbar.png") !important;
|
||||
}
|
||||
|
||||
@ -1488,6 +1488,8 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
|
||||
background-origin: border-box;
|
||||
border: none;
|
||||
-moz-border-start: 1px solid rgba(0,0,0,.25);
|
||||
box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
|
||||
-1px -1px 1px rgba(255,255,255,.25) inset;
|
||||
}
|
||||
|
||||
#urlbar:-moz-locale-dir(ltr) > toolbarbutton {
|
||||
@ -1500,9 +1502,14 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
|
||||
border-bottom-left-radius: 2px;
|
||||
}
|
||||
|
||||
#urlbar > toolbarbutton:not([disabled]):active:hover {
|
||||
#urlbar > toolbarbutton:not([disabled]):active:hover,
|
||||
#urlbar-reload-button:not(:hover) {
|
||||
-moz-border-start-style: none;
|
||||
-moz-padding-start: 4px;
|
||||
-moz-border-start: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
#urlbar > toolbarbutton:not([disabled]):active:hover {
|
||||
box-shadow: 0 0 6.5px rgba(0,0,0,.4) inset,
|
||||
0 0 2px rgba(0,0,0,.4) inset;
|
||||
}
|
||||
@ -1510,8 +1517,6 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
|
||||
#urlbar-go-button {
|
||||
-moz-image-region: rect(0px, 56px, 14px, 42px);
|
||||
background-image: -moz-linear-gradient(rgb(115,213,115), rgb(96,190,96) 49%, rgb(82,174,82) 51%, rgb(79,155,79));
|
||||
box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
|
||||
-1px -1px 1px rgba(255,255,255,.25) inset;
|
||||
}
|
||||
|
||||
#urlbar-go-button:-moz-locale-dir(rtl) > .toolbarbutton-icon {
|
||||
@ -1529,15 +1534,11 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
|
||||
#urlbar-reload-button:not([disabled]):hover {
|
||||
-moz-image-region: rect(0px, 28px, 14px, 14px);
|
||||
background-image: -moz-linear-gradient(rgb(162,207,241), rgb(111,178,225) 49%, rgb(91,159,217) 51%, rgb(62,138,200));
|
||||
box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
|
||||
-1px -1px 1px rgba(255,255,255,.25) inset;
|
||||
}
|
||||
|
||||
#urlbar-stop-button {
|
||||
-moz-image-region: rect(0px, 42px, 14px, 28px);
|
||||
background-image: -moz-linear-gradient(rgb(231,162,140), rgb(209,119,100) 49%, rgb(193,92,78) 51%, rgb(173,72,58));
|
||||
box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
|
||||
-1px -1px 1px rgba(255,255,255,.25) inset;
|
||||
}
|
||||
|
||||
#urlbar-stop-button:hover {
|
||||
|
@ -75,6 +75,7 @@ browser.jar:
|
||||
skin/classic/browser/places/allBookmarks.png (places/allBookmarks.png)
|
||||
skin/classic/browser/places/unsortedBookmarks.png (places/unsortedBookmarks.png)
|
||||
skin/classic/browser/places/searching_16.png (places/searching_16.png)
|
||||
skin/classic/browser/places/downloads.png (places/downloads.png)
|
||||
skin/classic/browser/preferences/alwaysAsk.png (preferences/alwaysAsk.png)
|
||||
skin/classic/browser/preferences/application.png (preferences/application.png)
|
||||
skin/classic/browser/preferences/mail.png (preferences/mail.png)
|
||||
@ -189,6 +190,7 @@ browser.jar:
|
||||
skin/classic/aero/browser/places/allBookmarks.png (places/allBookmarks-aero.png)
|
||||
skin/classic/aero/browser/places/unsortedBookmarks.png (places/unsortedBookmarks-aero.png)
|
||||
skin/classic/aero/browser/places/searching_16.png (places/searching_16-aero.png)
|
||||
skin/classic/aero/browser/places/downloads.png (places/downloads.png)
|
||||
skin/classic/aero/browser/preferences/alwaysAsk.png (preferences/alwaysAsk-aero.png)
|
||||
skin/classic/aero/browser/preferences/application.png (preferences/application-aero.png)
|
||||
skin/classic/aero/browser/preferences/mail.png (preferences/mail-aero.png)
|
||||
|
BIN
browser/themes/winstripe/browser/places/downloads.png
Normal file
After Width: | Height: | Size: 674 B |
@ -85,6 +85,11 @@ treechildren::-moz-tree-image(query, OrganizerQuery_Tags) {
|
||||
-moz-image-region: auto;
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-image(query, OrganizerQuery_Downloads) {
|
||||
list-style-image: url("chrome://browser/skin/places/downloads.png");
|
||||
-moz-image-region: auto;
|
||||
}
|
||||
|
||||
/* calendar icon for folders grouping items by date */
|
||||
treechildren::-moz-tree-image(title, query, dayContainer) {
|
||||
list-style-image: url("chrome://browser/skin/places/calendar.png");
|
||||
|
@ -676,8 +676,6 @@ HAVE_ARM_SIMD = @HAVE_ARM_SIMD@
|
||||
HAVE_ARM_NEON = @HAVE_ARM_NEON@
|
||||
HAVE_GCC_ALIGN_ARG_POINTER = @HAVE_GCC_ALIGN_ARG_POINTER@
|
||||
|
||||
MOZ_SPLASHSCREEN = @MOZ_SPLASHSCREEN@
|
||||
|
||||
MOZ_THEME_FASTSTRIPE = @MOZ_THEME_FASTSTRIPE@
|
||||
|
||||
MOZ_SERVICES_SYNC = @MOZ_SERVICES_SYNC@
|
||||
|
@ -59,9 +59,6 @@ endif
|
||||
ABS_DIST = $(call core_abspath,$(DIST))
|
||||
|
||||
libs::
|
||||
# Temporary, until bug 655058 lands on nspr. When that happens, we can
|
||||
# revert the config/nspr/* part of bug 654975.
|
||||
$(MAKE) -C $(DEPTH)/nsprpub PROFILE_USE_CFLAGS="$(PROFILE_USE_CFLAGS)"
|
||||
$(MAKE) -C $(DEPTH)/nsprpub install prefix=$(ABS_DIST)/sdk exec_prefix=$(ABS_DIST)/sdk bindir=$(ABS_DIST)/sdk/dummy includedir=$(ABS_DIST)/include libdir=$(ABS_DIST)/sdk/lib datadir=$(ABS_DIST)/sdk/dummy DESTDIR=
|
||||
$(INSTALL) $(DEPTH)/nsprpub/config/nspr-config $(DIST)/sdk/bin
|
||||
$(RM) -rf $(DIST)/sdk/dummy
|
||||
@ -76,6 +73,3 @@ install::
|
||||
$(MAKE) -C $(DEPTH)/nsprpub install DESTDIR=$(DESTDIR) libdir=$(mozappdir) includedir=$(includedir)/nspr
|
||||
$(RM) -f $(addprefix $(DESTDIR)$(mozappdir)/$(LIB_PREFIX), $(addsuffix .$(LIB_SUFFIX), nspr4 plds4 plc4))
|
||||
$(RM) -f $(addprefix $(DESTDIR)$(bindir)/,nspr-config compile-et.pl prerr.properties)
|
||||
|
||||
clean distclean::
|
||||
$(MAKE) -C $(DEPTH)/nsprpub $@
|
||||
|
@ -38,5 +38,6 @@
|
||||
TIERS += nspr
|
||||
|
||||
ifndef MOZ_NATIVE_NSPR
|
||||
tier_nspr_staticdirs += nsprpub
|
||||
tier_nspr_dirs += config/nspr
|
||||
endif
|
||||
|
16
configure.in
@ -4854,7 +4854,6 @@ MOZ_REFLOW_PERF=
|
||||
MOZ_SAFE_BROWSING=
|
||||
MOZ_HELP_VIEWER=
|
||||
MOZ_SPELLCHECK=1
|
||||
MOZ_SPLASHSCREEN=
|
||||
MOZ_STORAGE=1
|
||||
MOZ_SVG_DLISTS=
|
||||
MOZ_TOOLKIT_SEARCH=1
|
||||
@ -6048,18 +6047,6 @@ linux*)
|
||||
esac
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl Splashscreen
|
||||
dnl ========================================================
|
||||
AC_ARG_ENABLE(splashscreen,
|
||||
[ --enable-splashscreen display splashscreen while loading (default=no)],
|
||||
[enable_splash="yes"],[enable_splash=""])
|
||||
if test "x$enable_splash" = "xyes"; then
|
||||
MOZ_SPLASHSCREEN=1
|
||||
AC_DEFINE(MOZ_SPLASHSCREEN)
|
||||
fi
|
||||
AC_SUBST(MOZ_SPLASHSCREEN)
|
||||
|
||||
dnl ========================================================
|
||||
dnl Permissions System
|
||||
dnl ========================================================
|
||||
@ -6994,8 +6981,6 @@ arm-Android)
|
||||
MOZ_ARCH=armv7-a
|
||||
MOZ_FPU=vfp
|
||||
MOZ_FLOAT_ABI=softfp
|
||||
# Temporarily set nspr flags via configure, until bug 674880 lands
|
||||
NSPR_CONFIGURE_FLAGS="--with-thumb --with-arch=armv7-a --with-fpu=vfp --with-float-abi=softfp"
|
||||
;;
|
||||
arm-*)
|
||||
if test -n "$MOZ_PLATFORM_MAEMO"; then
|
||||
@ -9572,7 +9557,6 @@ if test -z "$MOZ_NATIVE_NSPR"; then
|
||||
if test -n "$USE_ARM_KUSER"; then
|
||||
ac_configure_args="$ac_configure_args --with-arm-kuser"
|
||||
fi
|
||||
ac_configure_args="$ac_configure_args $NSPR_CONFIGURE_FLAGS"
|
||||
AC_OUTPUT_SUBDIRS(nsprpub)
|
||||
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
|
||||
fi
|
||||
|
@ -609,6 +609,9 @@ nsContentSink::ProcessLinkHeader(nsIContent* aElement,
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
// keep track where we are within the header field
|
||||
PRBool seenParameters = PR_FALSE;
|
||||
|
||||
// parse link content and call process style link
|
||||
nsAutoString href;
|
||||
nsAutoString rel;
|
||||
@ -704,12 +707,15 @@ nsContentSink::ProcessLinkHeader(nsIContent* aElement,
|
||||
if ((*start == kLessThan) && (*last == kGreaterThan)) {
|
||||
*last = kNullCh;
|
||||
|
||||
if (href.IsEmpty()) { // first one wins
|
||||
// first instance of <...> wins
|
||||
// also, do not allow hrefs after the first param was seen
|
||||
if (href.IsEmpty() && !seenParameters) {
|
||||
href = (start + 1);
|
||||
href.StripWhitespace();
|
||||
}
|
||||
} else {
|
||||
PRUnichar* equals = start;
|
||||
seenParameters = PR_TRUE;
|
||||
|
||||
while ((*equals != kNullCh) && (*equals != kEqual)) {
|
||||
equals++;
|
||||
@ -791,6 +797,8 @@ nsContentSink::ProcessLinkHeader(nsIContent* aElement,
|
||||
type.Truncate();
|
||||
media.Truncate();
|
||||
anchor.Truncate();
|
||||
|
||||
seenParameters = PR_FALSE;
|
||||
}
|
||||
|
||||
start = ++end;
|
||||
|
@ -44,7 +44,7 @@
|
||||
This file is designed to be used as inline input to nsGkAtoms.cpp and nsGkAtoms.h
|
||||
*only* through the magic of C preprocessing.
|
||||
|
||||
All entires must be enclosed in the macro GK_ATOM which will have cruel
|
||||
All entries must be enclosed in the macro GK_ATOM which will have cruel
|
||||
and unusual things done to it
|
||||
|
||||
The first argument to GK_ATOM is the C++ name of the atom
|
||||
|
@ -187,13 +187,13 @@ CreateImageData(JSContext* cx,
|
||||
}
|
||||
|
||||
if (self) {
|
||||
js::TypedArray* tdest = js::TypedArray::fromJSObject(darray);
|
||||
JSObject *tdest = js::TypedArray::getTypedArray(darray);
|
||||
|
||||
// make the call
|
||||
nsresult rv =
|
||||
self->GetImageData_explicit(x, y, w, h,
|
||||
static_cast<PRUint8*>(tdest->data),
|
||||
tdest->byteLength);
|
||||
static_cast<PRUint8*>(JS_GetTypedArrayData(tdest)),
|
||||
JS_GetTypedArrayByteLength(tdest));
|
||||
if (NS_FAILED(rv)) {
|
||||
return xpc_qsThrowMethodFailed(cx, rv, vp);
|
||||
}
|
||||
@ -416,11 +416,11 @@ nsIDOMCanvasRenderingContext2D_PutImageData(JSContext *cx, uintN argc, jsval *vp
|
||||
|
||||
js::AutoValueRooter tsrc_tvr(cx);
|
||||
|
||||
js::TypedArray *tsrc = NULL;
|
||||
JSObject *tsrc = NULL;
|
||||
if (darray->getClass() == &js::TypedArray::fastClasses[js::TypedArray::TYPE_UINT8] ||
|
||||
darray->getClass() == &js::TypedArray::fastClasses[js::TypedArray::TYPE_UINT8_CLAMPED])
|
||||
{
|
||||
tsrc = js::TypedArray::fromJSObject(darray);
|
||||
tsrc = js::TypedArray::getTypedArray(darray);
|
||||
} else if (JS_IsArrayObject(cx, darray) || js_IsTypedArray(darray)) {
|
||||
// ugh, this isn't a uint8 typed array, someone made their own object; convert it to a typed array
|
||||
JSObject *nobj = js_CreateTypedArrayWithArray(cx, js::TypedArray::TYPE_UINT8, darray);
|
||||
@ -428,14 +428,14 @@ nsIDOMCanvasRenderingContext2D_PutImageData(JSContext *cx, uintN argc, jsval *vp
|
||||
return JS_FALSE;
|
||||
|
||||
*tsrc_tvr.jsval_addr() = OBJECT_TO_JSVAL(nobj);
|
||||
tsrc = js::TypedArray::fromJSObject(nobj);
|
||||
tsrc = js::TypedArray::getTypedArray(nobj);
|
||||
} else {
|
||||
// yeah, no.
|
||||
return xpc_qsThrow(cx, NS_ERROR_DOM_TYPE_MISMATCH_ERR);
|
||||
}
|
||||
|
||||
// make the call
|
||||
rv = self->PutImageData_explicit(x, y, w, h, (PRUint8*) tsrc->data, tsrc->byteLength, hasDirtyRect, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
|
||||
rv = self->PutImageData_explicit(x, y, w, h, (PRUint8*) JS_GetTypedArrayData(tsrc), JS_GetTypedArrayByteLength(tsrc), hasDirtyRect, dirtyX, dirtyY, dirtyWidth, dirtyHeight);
|
||||
if (NS_FAILED(rv))
|
||||
return xpc_qsThrowMethodFailed(cx, rv, vp);
|
||||
|
||||
|
@ -101,7 +101,7 @@ nsIDOMWebGLRenderingContext_BufferData(JSContext *cx, uintN argc, jsval *vp)
|
||||
jsval *argv = JS_ARGV(cx, vp);
|
||||
|
||||
int32 target;
|
||||
js::TypedArray *wa = 0;
|
||||
JSObject *wa = 0;
|
||||
JSObject *wb = 0;
|
||||
int32 size;
|
||||
int32 usage;
|
||||
@ -120,7 +120,7 @@ nsIDOMWebGLRenderingContext_BufferData(JSContext *cx, uintN argc, jsval *vp)
|
||||
if (js_IsArrayBuffer(arg2)) {
|
||||
wb = js::ArrayBuffer::getArrayBuffer(arg2);
|
||||
} else if (js_IsTypedArray(arg2)) {
|
||||
wa = js::TypedArray::fromJSObject(arg2);
|
||||
wa = js::TypedArray::getTypedArray(arg2);
|
||||
}
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ nsIDOMWebGLRenderingContext_BufferSubData(JSContext *cx, uintN argc, jsval *vp)
|
||||
|
||||
int32 target;
|
||||
int32 offset;
|
||||
js::TypedArray *wa = 0;
|
||||
JSObject *wa = 0;
|
||||
JSObject *wb = 0;
|
||||
|
||||
if (!JS_ValueToECMAInt32(cx, argv[0], &target))
|
||||
@ -195,7 +195,7 @@ nsIDOMWebGLRenderingContext_BufferSubData(JSContext *cx, uintN argc, jsval *vp)
|
||||
if (js_IsArrayBuffer(arg3)) {
|
||||
wb = js::ArrayBuffer::getArrayBuffer(arg3);
|
||||
} else if (js_IsTypedArray(arg3)) {
|
||||
wa = js::TypedArray::fromJSObject(arg3);
|
||||
wa = js::TypedArray::getTypedArray(arg3);
|
||||
} else {
|
||||
xpc_qsThrowBadArg(cx, NS_ERROR_FAILURE, vp, 2);
|
||||
return JS_FALSE;
|
||||
@ -265,7 +265,7 @@ nsIDOMWebGLRenderingContext_ReadPixels(JSContext *cx, uintN argc, jsval *vp)
|
||||
} else if (js_IsTypedArray(argv6)) {
|
||||
rv = self->ReadPixels_array(argv0, argv1, argv2, argv3,
|
||||
argv4, argv5,
|
||||
js::TypedArray::fromJSObject(argv6));
|
||||
js::TypedArray::getTypedArray(argv6));
|
||||
} else {
|
||||
xpc_qsThrowBadArg(cx, NS_ERROR_FAILURE, vp, 6);
|
||||
return JS_FALSE;
|
||||
@ -365,7 +365,7 @@ nsIDOMWebGLRenderingContext_TexImage2D(JSContext *cx, uintN argc, jsval *vp)
|
||||
}
|
||||
rv = self->TexImage2D_imageData(argv0, argv1, argv2,
|
||||
int_width, int_height, 0,
|
||||
argv3, argv4, js::TypedArray::fromJSObject(obj_data));
|
||||
argv3, argv4, js::TypedArray::getTypedArray(obj_data));
|
||||
}
|
||||
} else if (argc > 8 &&
|
||||
JSVAL_IS_OBJECT(argv[8])) // here, we allow null !
|
||||
@ -392,7 +392,7 @@ nsIDOMWebGLRenderingContext_TexImage2D(JSContext *cx, uintN argc, jsval *vp)
|
||||
} else if (js_IsTypedArray(argv8)) {
|
||||
rv = self->TexImage2D_array(argv0, argv1, argv2, argv3,
|
||||
argv4, argv5, argv6, argv7,
|
||||
js::TypedArray::fromJSObject(argv8));
|
||||
js::TypedArray::getTypedArray(argv8));
|
||||
} else {
|
||||
xpc_qsThrowBadArg(cx, NS_ERROR_FAILURE, vp, 8);
|
||||
return JS_FALSE;
|
||||
@ -491,7 +491,7 @@ nsIDOMWebGLRenderingContext_TexSubImage2D(JSContext *cx, uintN argc, jsval *vp)
|
||||
rv = self->TexSubImage2D_imageData(argv0, argv1, argv2, argv3,
|
||||
int_width, int_height,
|
||||
argv4, argv5,
|
||||
js::TypedArray::fromJSObject(obj_data));
|
||||
js::TypedArray::getTypedArray(obj_data));
|
||||
}
|
||||
} else if (argc > 8 &&
|
||||
!JSVAL_IS_PRIMITIVE(argv[8]))
|
||||
@ -511,7 +511,7 @@ nsIDOMWebGLRenderingContext_TexSubImage2D(JSContext *cx, uintN argc, jsval *vp)
|
||||
} else if (js_IsTypedArray(argv8)) {
|
||||
rv = self->TexSubImage2D_array(argv0, argv1, argv2, argv3,
|
||||
argv4, argv5, argv6, argv7,
|
||||
js::TypedArray::fromJSObject(argv8));
|
||||
js::TypedArray::getTypedArray(argv8));
|
||||
} else {
|
||||
xpc_qsThrowBadArg(cx, NS_ERROR_FAILURE, vp, 8);
|
||||
return JS_FALSE;
|
||||
@ -567,10 +567,10 @@ helper_nsIDOMWebGLRenderingContext_Uniform_x_iv(JSContext *cx, uintN argc, jsval
|
||||
|
||||
js::AutoValueRooter obj_tvr(cx);
|
||||
|
||||
js::TypedArray *wa = 0;
|
||||
JSObject *wa = 0;
|
||||
|
||||
if (helper_isInt32Array(arg1)) {
|
||||
wa = js::TypedArray::fromJSObject(arg1);
|
||||
wa = js::TypedArray::getTypedArray(arg1);
|
||||
} else if (JS_IsArrayObject(cx, arg1)) {
|
||||
JSObject *nobj = js_CreateTypedArrayWithArray(cx, js::TypedArray::TYPE_INT32, arg1);
|
||||
if (!nobj) {
|
||||
@ -579,7 +579,7 @@ helper_nsIDOMWebGLRenderingContext_Uniform_x_iv(JSContext *cx, uintN argc, jsval
|
||||
}
|
||||
|
||||
*obj_tvr.jsval_addr() = OBJECT_TO_JSVAL(nobj);
|
||||
wa = js::TypedArray::fromJSObject(nobj);
|
||||
wa = js::TypedArray::getTypedArray(nobj);
|
||||
} else {
|
||||
xpc_qsThrowBadArg(cx, NS_ERROR_FAILURE, vp, 1);
|
||||
return JS_FALSE;
|
||||
@ -641,10 +641,10 @@ helper_nsIDOMWebGLRenderingContext_Uniform_x_fv(JSContext *cx, uintN argc, jsval
|
||||
|
||||
js::AutoValueRooter obj_tvr(cx);
|
||||
|
||||
js::TypedArray *wa = 0;
|
||||
JSObject *wa = 0;
|
||||
|
||||
if (helper_isFloat32Array(arg1)) {
|
||||
wa = js::TypedArray::fromJSObject(arg1);
|
||||
wa = js::TypedArray::getTypedArray(arg1);
|
||||
} else if (JS_IsArrayObject(cx, arg1)) {
|
||||
JSObject *nobj = js_CreateTypedArrayWithArray(cx, js::TypedArray::TYPE_FLOAT32, arg1);
|
||||
if (!nobj) {
|
||||
@ -653,7 +653,7 @@ helper_nsIDOMWebGLRenderingContext_Uniform_x_fv(JSContext *cx, uintN argc, jsval
|
||||
}
|
||||
|
||||
*obj_tvr.jsval_addr() = OBJECT_TO_JSVAL(nobj);
|
||||
wa = js::TypedArray::fromJSObject(nobj);
|
||||
wa = js::TypedArray::getTypedArray(nobj);
|
||||
} else {
|
||||
xpc_qsThrowBadArg(cx, NS_ERROR_FAILURE, vp, 1);
|
||||
return JS_FALSE;
|
||||
@ -717,10 +717,10 @@ helper_nsIDOMWebGLRenderingContext_UniformMatrix_x_fv(JSContext *cx, uintN argc,
|
||||
|
||||
js::AutoValueRooter obj_tvr(cx);
|
||||
|
||||
js::TypedArray *wa = 0;
|
||||
JSObject *wa = 0;
|
||||
|
||||
if (helper_isFloat32Array(arg2)) {
|
||||
wa = js::TypedArray::fromJSObject(arg2);
|
||||
wa = js::TypedArray::getTypedArray(arg2);
|
||||
} else if (JS_IsArrayObject(cx, arg2)) {
|
||||
JSObject *nobj = js_CreateTypedArrayWithArray(cx, js::TypedArray::TYPE_FLOAT32, arg2);
|
||||
if (!nobj) {
|
||||
@ -729,7 +729,7 @@ helper_nsIDOMWebGLRenderingContext_UniformMatrix_x_fv(JSContext *cx, uintN argc,
|
||||
}
|
||||
|
||||
*obj_tvr.jsval_addr() = OBJECT_TO_JSVAL(nobj);
|
||||
wa = js::TypedArray::fromJSObject(nobj);
|
||||
wa = js::TypedArray::getTypedArray(nobj);
|
||||
} else {
|
||||
xpc_qsThrowBadArg(cx, NS_ERROR_FAILURE, vp, 2);
|
||||
return JS_FALSE;
|
||||
@ -782,10 +782,10 @@ helper_nsIDOMWebGLRenderingContext_VertexAttrib_x_fv(JSContext *cx, uintN argc,
|
||||
|
||||
js::AutoValueRooter obj_tvr(cx);
|
||||
|
||||
js::TypedArray *wa = 0;
|
||||
JSObject *wa = 0;
|
||||
|
||||
if (helper_isFloat32Array(arg1)) {
|
||||
wa = js::TypedArray::fromJSObject(arg1);
|
||||
wa = js::TypedArray::getTypedArray(arg1);
|
||||
} else if (JS_IsArrayObject(cx, arg1)) {
|
||||
JSObject *nobj = js_CreateTypedArrayWithArray(cx, js::TypedArray::TYPE_FLOAT32, arg1);
|
||||
if (!nobj) {
|
||||
@ -794,7 +794,7 @@ helper_nsIDOMWebGLRenderingContext_VertexAttrib_x_fv(JSContext *cx, uintN argc,
|
||||
}
|
||||
|
||||
*obj_tvr.jsval_addr() = OBJECT_TO_JSVAL(nobj);
|
||||
wa = js::TypedArray::fromJSObject(nobj);
|
||||
wa = js::TypedArray::getTypedArray(nobj);
|
||||
} else {
|
||||
xpc_qsThrowBadArg(cx, NS_ERROR_FAILURE, vp, 1);
|
||||
return JS_FALSE;
|
||||
@ -944,10 +944,10 @@ helper_nsIDOMWebGLRenderingContext_Uniform_x_iv_tn(JSContext *cx, JSObject *obj,
|
||||
return;
|
||||
}
|
||||
|
||||
js::TypedArray *wa = 0;
|
||||
JSObject *wa = 0;
|
||||
|
||||
if (helper_isInt32Array(arg)) {
|
||||
wa = js::TypedArray::fromJSObject(arg);
|
||||
wa = js::TypedArray::getTypedArray(arg);
|
||||
} else if (JS_IsArrayObject(cx, arg)) {
|
||||
JSObject *nobj = js_CreateTypedArrayWithArray(cx, js::TypedArray::TYPE_INT32, arg);
|
||||
if (!nobj) {
|
||||
@ -957,7 +957,7 @@ helper_nsIDOMWebGLRenderingContext_Uniform_x_iv_tn(JSContext *cx, JSObject *obj,
|
||||
}
|
||||
|
||||
*obj_tvr.jsval_addr() = OBJECT_TO_JSVAL(nobj);
|
||||
wa = js::TypedArray::fromJSObject(nobj);
|
||||
wa = js::TypedArray::getTypedArray(nobj);
|
||||
} else {
|
||||
xpc_qsThrowMethodFailedWithDetails(cx, NS_ERROR_FAILURE, "nsIDOMWebGLRenderingContext", "uniformNiv");
|
||||
js_SetTraceableNativeFailed(cx);
|
||||
@ -1015,10 +1015,10 @@ helper_nsIDOMWebGLRenderingContext_Uniform_x_fv_tn(JSContext *cx, JSObject *obj,
|
||||
return;
|
||||
}
|
||||
|
||||
js::TypedArray *wa = 0;
|
||||
JSObject *wa = 0;
|
||||
|
||||
if (helper_isFloat32Array(arg)) {
|
||||
wa = js::TypedArray::fromJSObject(arg);
|
||||
wa = js::TypedArray::getTypedArray(arg);
|
||||
} else if (JS_IsArrayObject(cx, arg)) {
|
||||
JSObject *nobj = js_CreateTypedArrayWithArray(cx, js::TypedArray::TYPE_FLOAT32, arg);
|
||||
if (!nobj) {
|
||||
@ -1028,7 +1028,7 @@ helper_nsIDOMWebGLRenderingContext_Uniform_x_fv_tn(JSContext *cx, JSObject *obj,
|
||||
}
|
||||
|
||||
*obj_tvr.jsval_addr() = OBJECT_TO_JSVAL(nobj);
|
||||
wa = js::TypedArray::fromJSObject(nobj);
|
||||
wa = js::TypedArray::getTypedArray(nobj);
|
||||
} else {
|
||||
xpc_qsThrowMethodFailedWithDetails(cx, NS_ERROR_FAILURE, "nsIDOMWebGLRenderingContext", "uniformNfv");
|
||||
js_SetTraceableNativeFailed(cx);
|
||||
@ -1088,10 +1088,10 @@ helper_nsIDOMWebGLRenderingContext_UniformMatrix_x_fv_tn(JSContext *cx, JSObject
|
||||
return;
|
||||
}
|
||||
|
||||
js::TypedArray *wa = 0;
|
||||
JSObject *wa = 0;
|
||||
|
||||
if (helper_isFloat32Array(arg)) {
|
||||
wa = js::TypedArray::fromJSObject(arg);
|
||||
wa = js::TypedArray::getTypedArray(arg);
|
||||
} else if (JS_IsArrayObject(cx, arg)) {
|
||||
JSObject *nobj = js_CreateTypedArrayWithArray(cx, js::TypedArray::TYPE_FLOAT32, arg);
|
||||
if (!nobj) {
|
||||
@ -1101,7 +1101,7 @@ helper_nsIDOMWebGLRenderingContext_UniformMatrix_x_fv_tn(JSContext *cx, JSObject
|
||||
}
|
||||
|
||||
*obj_tvr.jsval_addr() = OBJECT_TO_JSVAL(nobj);
|
||||
wa = js::TypedArray::fromJSObject(nobj);
|
||||
wa = js::TypedArray::getTypedArray(nobj);
|
||||
} else {
|
||||
xpc_qsThrowMethodFailedWithDetails(cx, NS_ERROR_FAILURE, "nsIDOMWebGLRenderingContext", "uniformMatrixNfv");
|
||||
js_SetTraceableNativeFailed(cx);
|
||||
|
@ -487,7 +487,7 @@ WebGLContext::BufferData_buf(WebGLenum target, JSObject *wb, WebGLenum usage)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
WebGLContext::BufferData_array(WebGLenum target, js::TypedArray *wa, WebGLenum usage)
|
||||
WebGLContext::BufferData_array(WebGLenum target, JSObject *wa, WebGLenum usage)
|
||||
{
|
||||
WebGLBuffer *boundBuffer = NULL;
|
||||
|
||||
@ -508,17 +508,17 @@ WebGLContext::BufferData_array(WebGLenum target, js::TypedArray *wa, WebGLenum u
|
||||
MakeContextCurrent();
|
||||
|
||||
GLenum error = CheckedBufferData(target,
|
||||
wa->byteLength,
|
||||
wa->data,
|
||||
JS_GetTypedArrayByteLength(wa),
|
||||
JS_GetTypedArrayData(wa),
|
||||
usage);
|
||||
if (error) {
|
||||
LogMessageIfVerbose("bufferData generated error %s", ErrorName(error));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
boundBuffer->SetByteLength(wa->byteLength);
|
||||
boundBuffer->SetByteLength(JS_GetTypedArrayByteLength(wa));
|
||||
boundBuffer->InvalidateCachedMaxElements();
|
||||
if (!boundBuffer->CopyDataIfElementArray(wa->data))
|
||||
if (!boundBuffer->CopyDataIfElementArray(JS_GetTypedArrayData(wa)))
|
||||
return ErrorOutOfMemory("bufferData: out of memory");
|
||||
|
||||
return NS_OK;
|
||||
@ -574,7 +574,7 @@ WebGLContext::BufferSubData_buf(GLenum target, WebGLsizei byteOffset, JSObject *
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
WebGLContext::BufferSubData_array(WebGLenum target, WebGLsizei byteOffset, js::TypedArray *wa)
|
||||
WebGLContext::BufferSubData_array(WebGLenum target, WebGLsizei byteOffset, JSObject *wa)
|
||||
{
|
||||
WebGLBuffer *boundBuffer = NULL;
|
||||
|
||||
@ -592,20 +592,20 @@ WebGLContext::BufferSubData_array(WebGLenum target, WebGLsizei byteOffset, js::T
|
||||
if (!boundBuffer)
|
||||
return ErrorInvalidOperation("BufferData: no buffer bound!");
|
||||
|
||||
CheckedUint32 checked_neededByteLength = CheckedUint32(byteOffset) + wa->byteLength;
|
||||
CheckedUint32 checked_neededByteLength = CheckedUint32(byteOffset) + JS_GetTypedArrayByteLength(wa);
|
||||
if (!checked_neededByteLength.valid())
|
||||
return ErrorInvalidOperation("bufferSubData: integer overflow computing the needed byte length");
|
||||
|
||||
if (checked_neededByteLength.value() > boundBuffer->ByteLength())
|
||||
return ErrorInvalidOperation("BufferSubData: not enough data -- operation requires %d bytes, but buffer only has %d bytes",
|
||||
byteOffset, wa->byteLength, boundBuffer->ByteLength());
|
||||
byteOffset, JS_GetTypedArrayByteLength(wa), boundBuffer->ByteLength());
|
||||
|
||||
MakeContextCurrent();
|
||||
|
||||
boundBuffer->CopySubDataIfElementArray(byteOffset, wa->byteLength, wa->data);
|
||||
boundBuffer->CopySubDataIfElementArray(byteOffset, JS_GetTypedArrayByteLength(wa), JS_GetTypedArrayData(wa));
|
||||
boundBuffer->InvalidateCachedMaxElements();
|
||||
|
||||
gl->fBufferSubData(target, byteOffset, wa->byteLength, wa->data);
|
||||
gl->fBufferSubData(target, byteOffset, JS_GetTypedArrayByteLength(wa), JS_GetTypedArrayData(wa));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -3140,11 +3140,11 @@ WebGLContext::ReadPixels_base(WebGLint x, WebGLint y, WebGLsizei width, WebGLsiz
|
||||
|
||||
NS_IMETHODIMP
|
||||
WebGLContext::ReadPixels_array(WebGLint x, WebGLint y, WebGLsizei width, WebGLsizei height,
|
||||
WebGLenum format, WebGLenum type, js::TypedArray *pixels)
|
||||
WebGLenum format, WebGLenum type, JSObject *pixels)
|
||||
{
|
||||
return ReadPixels_base(x, y, width, height, format, type,
|
||||
pixels ? pixels->data : 0,
|
||||
pixels ? pixels->byteLength : 0);
|
||||
pixels ? JS_GetTypedArrayData(pixels) : 0,
|
||||
pixels ? JS_GetTypedArrayByteLength(pixels) : 0);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
@ -3661,15 +3661,15 @@ WebGLContext::name(PRInt32) { \
|
||||
return NS_ERROR_NOT_IMPLEMENTED; \
|
||||
} \
|
||||
NS_IMETHODIMP \
|
||||
WebGLContext::name##_array(nsIWebGLUniformLocation *ploc, js::TypedArray *wa) \
|
||||
WebGLContext::name##_array(nsIWebGLUniformLocation *ploc, JSObject *wa) \
|
||||
{ \
|
||||
OBTAIN_UNIFORM_LOCATION(#name ": location") \
|
||||
if (!wa || wa->type != js::TypedArray::arrayType) \
|
||||
if (!wa || JS_GetTypedArrayType(wa) != js::TypedArray::arrayType) \
|
||||
return ErrorInvalidOperation(#name ": array must be " #arrayType); \
|
||||
if (wa->length == 0 || wa->length % cnt != 0) \
|
||||
if (JS_GetTypedArrayLength(wa) == 0 || JS_GetTypedArrayLength(wa) % cnt != 0)\
|
||||
return ErrorInvalidValue(#name ": array must be > 0 elements and have a length multiple of %d", cnt); \
|
||||
MakeContextCurrent(); \
|
||||
gl->f##name(location, wa->length / cnt, (ptrType *)wa->data); \
|
||||
gl->f##name(location, JS_GetTypedArrayLength(wa) / cnt, (ptrType *)JS_GetTypedArrayData(wa)); \
|
||||
return NS_OK; \
|
||||
}
|
||||
|
||||
@ -3679,17 +3679,17 @@ WebGLContext::name(PRInt32) { \
|
||||
return NS_ERROR_NOT_IMPLEMENTED; \
|
||||
} \
|
||||
NS_IMETHODIMP \
|
||||
WebGLContext::name##_array(nsIWebGLUniformLocation *ploc, WebGLboolean transpose, js::TypedArray *wa) \
|
||||
WebGLContext::name##_array(nsIWebGLUniformLocation *ploc, WebGLboolean transpose, JSObject *wa) \
|
||||
{ \
|
||||
OBTAIN_UNIFORM_LOCATION(#name ": location") \
|
||||
if (!wa || wa->type != js::TypedArray::arrayType) \
|
||||
if (!wa || JS_GetTypedArrayType(wa) != js::TypedArray::arrayType) \
|
||||
return ErrorInvalidValue(#name ": array must be " #arrayType); \
|
||||
if (wa->length == 0 || wa->length % (dim*dim) != 0) \
|
||||
if (JS_GetTypedArrayLength(wa) == 0 || JS_GetTypedArrayLength(wa) % (dim*dim) != 0) \
|
||||
return ErrorInvalidValue(#name ": array length must be >0 and multiple of %d", dim*dim); \
|
||||
if (transpose) \
|
||||
return ErrorInvalidValue(#name ": transpose must be FALSE as per the OpenGL ES 2.0 spec"); \
|
||||
MakeContextCurrent(); \
|
||||
gl->f##name(location, wa->length / (dim*dim), transpose, (ptrType *)wa->data); \
|
||||
gl->f##name(location, JS_GetTypedArrayLength(wa) / (dim*dim), transpose, (ptrType *)JS_GetTypedArrayData(wa)); \
|
||||
return NS_OK; \
|
||||
}
|
||||
|
||||
@ -3824,14 +3824,14 @@ WebGLContext::name(PRInt32) { \
|
||||
return NS_ERROR_NOT_IMPLEMENTED; \
|
||||
} \
|
||||
NS_IMETHODIMP \
|
||||
WebGLContext::name##_array(WebGLuint idx, js::TypedArray *wa) \
|
||||
WebGLContext::name##_array(WebGLuint idx, JSObject *wa) \
|
||||
{ \
|
||||
if (!wa || wa->type != js::TypedArray::arrayType) \
|
||||
if (!wa || JS_GetTypedArrayType(wa) != js::TypedArray::arrayType) \
|
||||
return ErrorInvalidOperation(#name ": array must be " #arrayType); \
|
||||
if (wa->length < cnt) \
|
||||
if (JS_GetTypedArrayLength(wa) < cnt) \
|
||||
return ErrorInvalidOperation(#name ": array must be >= %d elements", cnt); \
|
||||
MakeContextCurrent(); \
|
||||
ptrType *ptr = (ptrType *)wa->data; \
|
||||
ptrType *ptr = (ptrType *)JS_GetTypedArrayData(wa); \
|
||||
if (idx) { \
|
||||
gl->f##name(idx, ptr); \
|
||||
} else { \
|
||||
@ -4428,12 +4428,12 @@ NS_IMETHODIMP
|
||||
WebGLContext::TexImage2D_array(WebGLenum target, WebGLint level, WebGLenum internalformat,
|
||||
WebGLsizei width, WebGLsizei height, WebGLint border,
|
||||
WebGLenum format, WebGLenum type,
|
||||
js::TypedArray *pixels)
|
||||
JSObject *pixels)
|
||||
{
|
||||
return TexImage2D_base(target, level, internalformat, width, height, 0, border, format, type,
|
||||
pixels ? pixels->data : 0,
|
||||
pixels ? pixels->byteLength : 0,
|
||||
(int) pixels->type,
|
||||
pixels ? JS_GetTypedArrayData(pixels) : 0,
|
||||
pixels ? JS_GetTypedArrayByteLength(pixels) : 0,
|
||||
(int) JS_GetTypedArrayType(pixels),
|
||||
WebGLTexelFormat::Auto, PR_FALSE);
|
||||
}
|
||||
|
||||
@ -4441,11 +4441,11 @@ NS_IMETHODIMP
|
||||
WebGLContext::TexImage2D_imageData(WebGLenum target, WebGLint level, WebGLenum internalformat,
|
||||
WebGLsizei width, WebGLsizei height, WebGLint border,
|
||||
WebGLenum format, WebGLenum type,
|
||||
js::TypedArray *pixels)
|
||||
JSObject *pixels)
|
||||
{
|
||||
return TexImage2D_base(target, level, internalformat, width, height, 4*width, border, format, type,
|
||||
pixels ? pixels->data : 0,
|
||||
pixels ? pixels->byteLength : 0,
|
||||
pixels ? JS_GetTypedArrayData(pixels) : 0,
|
||||
pixels ? JS_GetTypedArrayByteLength(pixels) : 0,
|
||||
-1,
|
||||
WebGLTexelFormat::RGBA8, PR_FALSE);
|
||||
}
|
||||
@ -4612,15 +4612,15 @@ WebGLContext::TexSubImage2D_array(WebGLenum target, WebGLint level,
|
||||
WebGLint xoffset, WebGLint yoffset,
|
||||
WebGLsizei width, WebGLsizei height,
|
||||
WebGLenum format, WebGLenum type,
|
||||
js::TypedArray *pixels)
|
||||
JSObject *pixels)
|
||||
{
|
||||
if (!pixels)
|
||||
return ErrorInvalidValue("TexSubImage2D: pixels must not be null!");
|
||||
|
||||
return TexSubImage2D_base(target, level, xoffset, yoffset,
|
||||
width, height, 0, format, type,
|
||||
pixels->data, pixels->byteLength,
|
||||
pixels->type,
|
||||
JS_GetTypedArrayData(pixels), JS_GetTypedArrayByteLength(pixels),
|
||||
JS_GetTypedArrayType(pixels),
|
||||
WebGLTexelFormat::Auto, PR_FALSE);
|
||||
}
|
||||
|
||||
@ -4629,14 +4629,14 @@ WebGLContext::TexSubImage2D_imageData(WebGLenum target, WebGLint level,
|
||||
WebGLint xoffset, WebGLint yoffset,
|
||||
WebGLsizei width, WebGLsizei height,
|
||||
WebGLenum format, WebGLenum type,
|
||||
js::TypedArray *pixels)
|
||||
JSObject *pixels)
|
||||
{
|
||||
if (!pixels)
|
||||
return ErrorInvalidValue("TexSubImage2D: pixels must not be null!");
|
||||
|
||||
return TexSubImage2D_base(target, level, xoffset, yoffset,
|
||||
width, height, 4*width, format, type,
|
||||
pixels->data, pixels->byteLength,
|
||||
JS_GetTypedArrayData(pixels), JS_GetTypedArrayByteLength(pixels),
|
||||
-1,
|
||||
WebGLTexelFormat::RGBA8, PR_FALSE);
|
||||
}
|
||||
|
@ -118,8 +118,8 @@ nsDOMNotifyAudioAvailableEvent::GetFrameBuffer(JSContext* aCx, jsval* aResult)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
js::TypedArray *tdest = js::TypedArray::fromJSObject(mCachedArray);
|
||||
memcpy(tdest->data, mFrameBuffer.get(), mFrameBufferLength * sizeof(float));
|
||||
JSObject *tdest = js::TypedArray::getTypedArray(mCachedArray);
|
||||
memcpy(JS_GetTypedArrayData(tdest), mFrameBuffer.get(), mFrameBufferLength * sizeof(float));
|
||||
|
||||
*aResult = OBJECT_TO_JSVAL(mCachedArray);
|
||||
return NS_OK;
|
||||
|
@ -1515,8 +1515,8 @@ nsEventStateManager::GetAccessKeyLabelPrefix(nsAString& aPrefix)
|
||||
nsAutoString separator, modifierText;
|
||||
nsContentUtils::GetModifierSeparatorText(separator);
|
||||
|
||||
nsCOMPtr<nsISupports> container = mPresContext->GetContainer();
|
||||
PRInt32 modifier = GetAccessModifierMask(container);
|
||||
nsCOMPtr<nsISupports> container = mPresContext->GetContainer();
|
||||
PRInt32 modifier = GetAccessModifierMask(container);
|
||||
|
||||
if (modifier & NS_MODIFIER_CONTROL) {
|
||||
nsContentUtils::GetControlText(modifierText);
|
||||
|
@ -49,8 +49,8 @@ class nsTextControlFrame;
|
||||
|
||||
// IID for the nsITextControl interface
|
||||
#define NS_ITEXTCONTROLELEMENT_IID \
|
||||
{ 0x66545dde, 0x3f4a, 0x49fd, \
|
||||
{ 0x82, 0x73, 0x69, 0x7e, 0xab, 0x54, 0x06, 0x0a } }
|
||||
{ 0x2e758eee, 0xd023, 0x4fd1, \
|
||||
{ 0x97, 0x93, 0xae, 0xeb, 0xbb, 0xf3, 0xa8, 0x3f } }
|
||||
|
||||
/**
|
||||
* This interface is used for the text control frame to get the editor and
|
||||
@ -218,6 +218,14 @@ public:
|
||||
|
||||
static PRBool
|
||||
GetWrapPropertyEnum(nsIContent* aContent, nsHTMLTextWrap& aWrapProp);
|
||||
|
||||
/**
|
||||
* Does the editor have a selection cache?
|
||||
*
|
||||
* Note that this function has the side effect of making the editor for input
|
||||
* elements be initialized eagerly.
|
||||
*/
|
||||
NS_IMETHOD_(PRBool) HasCachedSelection() = 0;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsITextControlElement,
|
||||
|
@ -826,9 +826,6 @@ nsGenericHTMLElement::InsertAdjacentHTML(const nsAString& aPosition,
|
||||
nsIDocument* doc = GetOwnerDoc();
|
||||
NS_ENSURE_STATE(doc);
|
||||
|
||||
// Needed when insertAdjacentHTML is used in combination with contenteditable
|
||||
mozAutoDocUpdate updateBatch(doc, UPDATE_CONTENT_MODEL, PR_TRUE);
|
||||
|
||||
// Batch possible DOMSubtreeModified events.
|
||||
mozAutoSubtreeModified subtree(doc, nsnull);
|
||||
|
||||
@ -837,6 +834,9 @@ nsGenericHTMLElement::InsertAdjacentHTML(const nsAString& aPosition,
|
||||
(position == eBeforeEnd ||
|
||||
(position == eAfterEnd && !GetNextSibling()) ||
|
||||
(position == eAfterBegin && !GetFirstChild()))) {
|
||||
// Needed when insertAdjacentHTML is used in combination with contenteditable
|
||||
mozAutoDocUpdate updateBatch(doc, UPDATE_CONTENT_MODEL, PR_TRUE);
|
||||
|
||||
PRInt32 oldChildCount = destination->GetChildCount();
|
||||
PRInt32 contextNs = destination->GetNameSpaceID();
|
||||
nsIAtom* contextLocal = destination->Tag();
|
||||
@ -2961,15 +2961,15 @@ PRBool
|
||||
nsGenericHTMLFormElement::IsElementDisabledForEvents(PRUint32 aMessage,
|
||||
nsIFrame* aFrame)
|
||||
{
|
||||
PRBool disabled = IsDisabled();
|
||||
if (!disabled && aFrame) {
|
||||
const nsStyleUserInterface* uiStyle = aFrame->GetStyleUserInterface();
|
||||
disabled = uiStyle->mUserInput == NS_STYLE_USER_INPUT_NONE ||
|
||||
uiStyle->mUserInput == NS_STYLE_USER_INPUT_DISABLED;
|
||||
|
||||
}
|
||||
return disabled && aMessage != NS_MOUSE_MOVE;
|
||||
}
|
||||
PRBool disabled = IsDisabled();
|
||||
if (!disabled && aFrame) {
|
||||
const nsStyleUserInterface* uiStyle = aFrame->GetStyleUserInterface();
|
||||
disabled = uiStyle->mUserInput == NS_STYLE_USER_INPUT_NONE ||
|
||||
uiStyle->mUserInput == NS_STYLE_USER_INPUT_DISABLED;
|
||||
|
||||
}
|
||||
return disabled && aMessage != NS_MOUSE_MOVE;
|
||||
}
|
||||
|
||||
void
|
||||
nsGenericHTMLFormElement::UpdateFormOwner(bool aBindToTree,
|
||||
|
@ -197,24 +197,24 @@ nsHTMLAudioElement::MozWriteAudio(const jsval &aData, JSContext *aCx, PRUint32 *
|
||||
|
||||
JSObject *darray = JSVAL_TO_OBJECT(aData);
|
||||
js::AutoValueRooter tsrc_tvr(aCx);
|
||||
js::TypedArray *tsrc = NULL;
|
||||
JSObject *tsrc = NULL;
|
||||
|
||||
// Allow either Float32Array or plain JS Array
|
||||
if (darray->getClass() == &js::TypedArray::fastClasses[js::TypedArray::TYPE_FLOAT32])
|
||||
{
|
||||
tsrc = js::TypedArray::fromJSObject(darray);
|
||||
tsrc = js::TypedArray::getTypedArray(darray);
|
||||
} else if (JS_IsArrayObject(aCx, darray)) {
|
||||
JSObject *nobj = js_CreateTypedArrayWithArray(aCx, js::TypedArray::TYPE_FLOAT32, darray);
|
||||
if (!nobj) {
|
||||
return NS_ERROR_DOM_TYPE_MISMATCH_ERR;
|
||||
}
|
||||
*tsrc_tvr.jsval_addr() = OBJECT_TO_JSVAL(nobj);
|
||||
tsrc = js::TypedArray::fromJSObject(nobj);
|
||||
tsrc = js::TypedArray::getTypedArray(nobj);
|
||||
} else {
|
||||
return NS_ERROR_DOM_TYPE_MISMATCH_ERR;
|
||||
}
|
||||
|
||||
PRUint32 dataLength = tsrc->length;
|
||||
PRUint32 dataLength = JS_GetTypedArrayLength(tsrc);
|
||||
|
||||
// Make sure that we are going to write the correct amount of data based
|
||||
// on number of channels.
|
||||
@ -225,7 +225,7 @@ nsHTMLAudioElement::MozWriteAudio(const jsval &aData, JSContext *aCx, PRUint32 *
|
||||
// Don't write more than can be written without blocking.
|
||||
PRUint32 writeLen = NS_MIN(mAudioStream->Available(), dataLength);
|
||||
|
||||
nsresult rv = mAudioStream->Write(tsrc->data, writeLen, PR_TRUE);
|
||||
nsresult rv = mAudioStream->Write(JS_GetTypedArrayData(tsrc), writeLen, PR_TRUE);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
|
@ -2754,7 +2754,13 @@ NS_IMETHODIMP
|
||||
nsHTMLInputElement::GetSelectionStart(PRInt32* aSelectionStart)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aSelectionStart);
|
||||
|
||||
|
||||
nsTextEditorState *state = GetEditorState();
|
||||
if (state && state->IsSelectionCached()) {
|
||||
*aSelectionStart = state->GetSelectionProperties().mStart;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32 selEnd;
|
||||
return GetSelectionRange(aSelectionStart, &selEnd);
|
||||
}
|
||||
@ -2762,6 +2768,12 @@ nsHTMLInputElement::GetSelectionStart(PRInt32* aSelectionStart)
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInputElement::SetSelectionStart(PRInt32 aSelectionStart)
|
||||
{
|
||||
nsTextEditorState *state = GetEditorState();
|
||||
if (state && state->IsSelectionCached()) {
|
||||
state->GetSelectionProperties().mStart = aSelectionStart;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsAutoString direction;
|
||||
nsresult rv = GetSelectionDirection(direction);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
@ -2779,7 +2791,13 @@ NS_IMETHODIMP
|
||||
nsHTMLInputElement::GetSelectionEnd(PRInt32* aSelectionEnd)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aSelectionEnd);
|
||||
|
||||
|
||||
nsTextEditorState *state = GetEditorState();
|
||||
if (state && state->IsSelectionCached()) {
|
||||
*aSelectionEnd = state->GetSelectionProperties().mEnd;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32 selStart;
|
||||
return GetSelectionRange(&selStart, aSelectionEnd);
|
||||
}
|
||||
@ -2788,6 +2806,12 @@ nsHTMLInputElement::GetSelectionEnd(PRInt32* aSelectionEnd)
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInputElement::SetSelectionEnd(PRInt32 aSelectionEnd)
|
||||
{
|
||||
nsTextEditorState *state = GetEditorState();
|
||||
if (state && state->IsSelectionCached()) {
|
||||
state->GetSelectionProperties().mEnd = aSelectionEnd;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsAutoString direction;
|
||||
nsresult rv = GetSelectionDirection(direction);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
@ -2838,9 +2862,29 @@ nsHTMLInputElement::GetSelectionRange(PRInt32* aSelectionStart,
|
||||
return rv;
|
||||
}
|
||||
|
||||
static void
|
||||
DirectionToName(nsITextControlFrame::SelectionDirection dir, nsAString& aDirection)
|
||||
{
|
||||
if (dir == nsITextControlFrame::eNone) {
|
||||
aDirection.AssignLiteral("none");
|
||||
} else if (dir == nsITextControlFrame::eForward) {
|
||||
aDirection.AssignLiteral("forward");
|
||||
} else if (dir == nsITextControlFrame::eBackward) {
|
||||
aDirection.AssignLiteral("backward");
|
||||
} else {
|
||||
NS_NOTREACHED("Invalid SelectionDirection value");
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInputElement::GetSelectionDirection(nsAString& aDirection)
|
||||
{
|
||||
nsTextEditorState *state = GetEditorState();
|
||||
if (state && state->IsSelectionCached()) {
|
||||
DirectionToName(state->GetSelectionProperties().mDirection, aDirection);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE);
|
||||
|
||||
@ -2850,15 +2894,7 @@ nsHTMLInputElement::GetSelectionDirection(nsAString& aDirection)
|
||||
nsITextControlFrame::SelectionDirection dir;
|
||||
rv = textControlFrame->GetSelectionRange(nsnull, nsnull, &dir);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (dir == nsITextControlFrame::eNone) {
|
||||
aDirection.AssignLiteral("none");
|
||||
} else if (dir == nsITextControlFrame::eForward) {
|
||||
aDirection.AssignLiteral("forward");
|
||||
} else if (dir == nsITextControlFrame::eBackward) {
|
||||
aDirection.AssignLiteral("backward");
|
||||
} else {
|
||||
NS_NOTREACHED("Invalid SelectionDirection value");
|
||||
}
|
||||
DirectionToName(dir, aDirection);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2868,6 +2904,18 @@ nsHTMLInputElement::GetSelectionDirection(nsAString& aDirection)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInputElement::SetSelectionDirection(const nsAString& aDirection) {
|
||||
nsTextEditorState *state = GetEditorState();
|
||||
if (state && state->IsSelectionCached()) {
|
||||
nsITextControlFrame::SelectionDirection dir = nsITextControlFrame::eNone;
|
||||
if (aDirection.EqualsLiteral("forward")) {
|
||||
dir = nsITextControlFrame::eForward;
|
||||
} else if (aDirection.EqualsLiteral("backward")) {
|
||||
dir = nsITextControlFrame::eBackward;
|
||||
}
|
||||
state->GetSelectionProperties().mDirection = dir;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32 start, end;
|
||||
nsresult rv = GetSelectionRange(&start, &end);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
@ -4137,6 +4185,22 @@ nsHTMLInputElement::OnValueChanged(PRBool aNotify)
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(PRBool)
|
||||
nsHTMLInputElement::HasCachedSelection()
|
||||
{
|
||||
PRBool isCached = PR_FALSE;
|
||||
nsTextEditorState *state = GetEditorState();
|
||||
if (state) {
|
||||
isCached = state->IsSelectionCached() &&
|
||||
state->HasNeverInitializedBefore() &&
|
||||
!state->GetSelectionProperties().IsDefault();
|
||||
if (isCached) {
|
||||
state->WillInitEagerly();
|
||||
}
|
||||
}
|
||||
return isCached;
|
||||
}
|
||||
|
||||
void
|
||||
nsHTMLInputElement::FieldSetDisabledChanged(PRBool aNotify)
|
||||
{
|
||||
|
@ -214,6 +214,7 @@ public:
|
||||
NS_IMETHOD_(void) SetPlaceholderClass(PRBool aVisible, PRBool aNotify);
|
||||
NS_IMETHOD_(void) InitializeKeyboardEventListeners();
|
||||
NS_IMETHOD_(void) OnValueChanged(PRBool aNotify);
|
||||
NS_IMETHOD_(PRBool) HasCachedSelection();
|
||||
|
||||
void GetDisplayFileName(nsAString& aFileName) const;
|
||||
const nsCOMArray<nsIDOMFile>& GetFiles() const;
|
||||
|
@ -160,6 +160,7 @@ public:
|
||||
NS_IMETHOD_(void) SetPlaceholderClass(PRBool aVisible, PRBool aNotify);
|
||||
NS_IMETHOD_(void) InitializeKeyboardEventListeners();
|
||||
NS_IMETHOD_(void) OnValueChanged(PRBool aNotify);
|
||||
NS_IMETHOD_(PRBool) HasCachedSelection();
|
||||
|
||||
// nsIContent
|
||||
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
@ -821,7 +822,12 @@ NS_IMETHODIMP
|
||||
nsHTMLTextAreaElement::GetSelectionStart(PRInt32 *aSelectionStart)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aSelectionStart);
|
||||
|
||||
|
||||
if (mState->IsSelectionCached()) {
|
||||
*aSelectionStart = mState->GetSelectionProperties().mStart;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32 selEnd;
|
||||
return GetSelectionRange(aSelectionStart, &selEnd);
|
||||
}
|
||||
@ -829,6 +835,11 @@ nsHTMLTextAreaElement::GetSelectionStart(PRInt32 *aSelectionStart)
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTextAreaElement::SetSelectionStart(PRInt32 aSelectionStart)
|
||||
{
|
||||
if (mState->IsSelectionCached()) {
|
||||
mState->GetSelectionProperties().mStart = aSelectionStart;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsAutoString direction;
|
||||
nsresult rv = GetSelectionDirection(direction);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
@ -846,7 +857,12 @@ NS_IMETHODIMP
|
||||
nsHTMLTextAreaElement::GetSelectionEnd(PRInt32 *aSelectionEnd)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aSelectionEnd);
|
||||
|
||||
|
||||
if (mState->IsSelectionCached()) {
|
||||
*aSelectionEnd = mState->GetSelectionProperties().mEnd;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32 selStart;
|
||||
return GetSelectionRange(&selStart, aSelectionEnd);
|
||||
}
|
||||
@ -854,6 +870,11 @@ nsHTMLTextAreaElement::GetSelectionEnd(PRInt32 *aSelectionEnd)
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTextAreaElement::SetSelectionEnd(PRInt32 aSelectionEnd)
|
||||
{
|
||||
if (mState->IsSelectionCached()) {
|
||||
mState->GetSelectionProperties().mEnd = aSelectionEnd;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsAutoString direction;
|
||||
nsresult rv = GetSelectionDirection(direction);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
@ -883,9 +904,28 @@ nsHTMLTextAreaElement::GetSelectionRange(PRInt32* aSelectionStart,
|
||||
return rv;
|
||||
}
|
||||
|
||||
static void
|
||||
DirectionToName(nsITextControlFrame::SelectionDirection dir, nsAString& aDirection)
|
||||
{
|
||||
if (dir == nsITextControlFrame::eNone) {
|
||||
aDirection.AssignLiteral("none");
|
||||
} else if (dir == nsITextControlFrame::eForward) {
|
||||
aDirection.AssignLiteral("forward");
|
||||
} else if (dir == nsITextControlFrame::eBackward) {
|
||||
aDirection.AssignLiteral("backward");
|
||||
} else {
|
||||
NS_NOTREACHED("Invalid SelectionDirection value");
|
||||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLTextAreaElement::GetSelectionDirection(nsAString& aDirection)
|
||||
{
|
||||
if (mState->IsSelectionCached()) {
|
||||
DirectionToName(mState->GetSelectionProperties().mDirection, aDirection);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_TRUE);
|
||||
|
||||
@ -895,15 +935,7 @@ nsHTMLTextAreaElement::GetSelectionDirection(nsAString& aDirection)
|
||||
nsITextControlFrame::SelectionDirection dir;
|
||||
rv = textControlFrame->GetSelectionRange(nsnull, nsnull, &dir);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (dir == nsITextControlFrame::eNone) {
|
||||
aDirection.AssignLiteral("none");
|
||||
} else if (dir == nsITextControlFrame::eForward) {
|
||||
aDirection.AssignLiteral("forward");
|
||||
} else if (dir == nsITextControlFrame::eBackward) {
|
||||
aDirection.AssignLiteral("backward");
|
||||
} else {
|
||||
NS_NOTREACHED("Invalid SelectionDirection value");
|
||||
}
|
||||
DirectionToName(dir, aDirection);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -913,6 +945,17 @@ nsHTMLTextAreaElement::GetSelectionDirection(nsAString& aDirection)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTextAreaElement::SetSelectionDirection(const nsAString& aDirection) {
|
||||
if (mState->IsSelectionCached()) {
|
||||
nsITextControlFrame::SelectionDirection dir = nsITextControlFrame::eNone;
|
||||
if (aDirection.EqualsLiteral("forward")) {
|
||||
dir = nsITextControlFrame::eForward;
|
||||
} else if (aDirection.EqualsLiteral("backward")) {
|
||||
dir = nsITextControlFrame::eBackward;
|
||||
}
|
||||
mState->GetSelectionProperties().mDirection = dir;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32 start, end;
|
||||
nsresult rv = GetSelectionRange(&start, &end);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
@ -1489,6 +1532,12 @@ nsHTMLTextAreaElement::OnValueChanged(PRBool aNotify)
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(PRBool)
|
||||
nsHTMLTextAreaElement::HasCachedSelection()
|
||||
{
|
||||
return mState->IsSelectionCached();
|
||||
}
|
||||
|
||||
void
|
||||
nsHTMLTextAreaElement::FieldSetDisabledChanged(PRBool aNotify)
|
||||
{
|
||||
|
@ -74,18 +74,10 @@ static NS_DEFINE_CID(kTextEditorCID, NS_TEXTEDITOR_CID);
|
||||
static nsINativeKeyBindings *sNativeInputBindings = nsnull;
|
||||
static nsINativeKeyBindings *sNativeTextAreaBindings = nsnull;
|
||||
|
||||
struct SelectionState {
|
||||
PRInt32 mStart;
|
||||
PRInt32 mEnd;
|
||||
};
|
||||
|
||||
class RestoreSelectionState : public nsRunnable {
|
||||
public:
|
||||
RestoreSelectionState(nsTextEditorState *aState, nsTextControlFrame *aFrame,
|
||||
PRInt32 aStart, PRInt32 aEnd)
|
||||
RestoreSelectionState(nsTextEditorState *aState, nsTextControlFrame *aFrame)
|
||||
: mFrame(aFrame),
|
||||
mStart(aStart),
|
||||
mEnd(aEnd),
|
||||
mTextEditorState(aState)
|
||||
{
|
||||
}
|
||||
@ -95,8 +87,15 @@ public:
|
||||
// SetSelectionRange leads to Selection::AddRange which flushes Layout -
|
||||
// need to block script to avoid nested PrepareEditor calls (bug 642800).
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
mFrame->SetSelectionRange(mStart, mEnd);
|
||||
mTextEditorState->HideSelectionIfBlurred();
|
||||
nsTextEditorState::SelectionProperties& properties =
|
||||
mTextEditorState->GetSelectionProperties();
|
||||
mFrame->SetSelectionRange(properties.mStart,
|
||||
properties.mEnd,
|
||||
properties.mDirection);
|
||||
if (!mTextEditorState->mSelectionRestoreEagerInit) {
|
||||
mTextEditorState->HideSelectionIfBlurred();
|
||||
}
|
||||
mTextEditorState->mSelectionRestoreEagerInit = PR_FALSE;
|
||||
}
|
||||
mTextEditorState->FinishedRestoringSelection();
|
||||
return NS_OK;
|
||||
@ -109,8 +108,6 @@ public:
|
||||
|
||||
private:
|
||||
nsTextControlFrame* mFrame;
|
||||
PRInt32 mStart;
|
||||
PRInt32 mEnd;
|
||||
nsTextEditorState* mTextEditorState;
|
||||
};
|
||||
|
||||
@ -933,9 +930,12 @@ nsTextEditorState::nsTextEditorState(nsITextControlElement* aOwningElement)
|
||||
mRestoringSelection(nsnull),
|
||||
mBoundFrame(nsnull),
|
||||
mTextListener(nsnull),
|
||||
mEverInited(PR_FALSE),
|
||||
mEditorInitialized(PR_FALSE),
|
||||
mInitializing(PR_FALSE),
|
||||
mValueTransferInProgress(PR_FALSE)
|
||||
mValueTransferInProgress(PR_FALSE),
|
||||
mSelectionCached(PR_TRUE),
|
||||
mSelectionRestoreEagerInit(PR_FALSE)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsTextEditorState);
|
||||
}
|
||||
@ -1349,6 +1349,7 @@ nsTextEditorState::PrepareEditor(const nsAString *aValue)
|
||||
|
||||
if (!mEditorInitialized) {
|
||||
newEditor->PostCreate();
|
||||
mEverInited = PR_TRUE;
|
||||
mEditorInitialized = PR_TRUE;
|
||||
}
|
||||
|
||||
@ -1356,16 +1357,18 @@ nsTextEditorState::PrepareEditor(const nsAString *aValue)
|
||||
newEditor->AddEditorObserver(mTextListener);
|
||||
|
||||
// Restore our selection after being bound to a new frame
|
||||
if (mSelState) {
|
||||
if (mSelectionCached) {
|
||||
if (mRestoringSelection) // paranoia
|
||||
mRestoringSelection->Revoke();
|
||||
mRestoringSelection = new RestoreSelectionState(this, mBoundFrame, mSelState->mStart, mSelState->mEnd);
|
||||
mRestoringSelection = new RestoreSelectionState(this, mBoundFrame);
|
||||
if (mRestoringSelection) {
|
||||
nsContentUtils::AddScriptRunner(mRestoringSelection);
|
||||
mSelState = nsnull;
|
||||
}
|
||||
}
|
||||
|
||||
// The selection cache is no longer going to be valid
|
||||
mSelectionCached = PR_FALSE;
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -1408,11 +1411,10 @@ nsTextEditorState::UnbindFromFrame(nsTextControlFrame* aFrame)
|
||||
// GetSelectionRange before calling DestroyEditor, and only if
|
||||
// mEditorInitialized indicates that we actually have an editor available.
|
||||
if (mEditorInitialized) {
|
||||
mSelState = new SelectionState();
|
||||
nsresult rv = mBoundFrame->GetSelectionRange(&mSelState->mStart, &mSelState->mEnd);
|
||||
if (NS_FAILED(rv)) {
|
||||
mSelState = nsnull;
|
||||
}
|
||||
mBoundFrame->GetSelectionRange(&mSelectionProperties.mStart,
|
||||
&mSelectionProperties.mEnd,
|
||||
&mSelectionProperties.mDirection);
|
||||
mSelectionCached = PR_TRUE;
|
||||
}
|
||||
|
||||
// Destroy our editor
|
||||
|
@ -41,6 +41,7 @@
|
||||
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsITextControlElement.h"
|
||||
#include "nsITextControlFrame.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
|
||||
class nsTextInputListener;
|
||||
@ -51,7 +52,6 @@ class nsISelectionController;
|
||||
class nsFrameSelection;
|
||||
class nsIEditor;
|
||||
class nsITextControlElement;
|
||||
struct SelectionState;
|
||||
|
||||
/**
|
||||
* nsTextEditorState is a class which is responsible for managing the state of
|
||||
@ -116,6 +116,11 @@ struct SelectionState;
|
||||
* invalidating this cache when the anonymous contect containing the value is
|
||||
* changed.
|
||||
*
|
||||
* * The editor's cached selection properties. These vales are stored in the
|
||||
* mSelectionProperties member, and include the selection's start, end and
|
||||
* direction. They are only used when there is no frame available for the
|
||||
* text field.
|
||||
*
|
||||
*
|
||||
* As a general rule, nsTextEditorState objects own the value of the text control, and any
|
||||
* attempt to retrieve or set the value must be made through those objects. Internally,
|
||||
@ -214,6 +219,24 @@ public:
|
||||
|
||||
void HideSelectionIfBlurred();
|
||||
|
||||
struct SelectionProperties {
|
||||
SelectionProperties() : mStart(0), mEnd(0),
|
||||
mDirection(nsITextControlFrame::eForward) {}
|
||||
bool IsDefault() const {
|
||||
return mStart == 0 && mEnd == 0 &&
|
||||
mDirection == nsITextControlFrame::eForward;
|
||||
}
|
||||
PRInt32 mStart, mEnd;
|
||||
nsITextControlFrame::SelectionDirection mDirection;
|
||||
};
|
||||
|
||||
PRBool IsSelectionCached() const { return mSelectionCached; }
|
||||
SelectionProperties& GetSelectionProperties() {
|
||||
return mSelectionProperties;
|
||||
}
|
||||
void WillInitEagerly() { mSelectionRestoreEagerInit = PR_TRUE; }
|
||||
PRBool HasNeverInitializedBefore() const { return !mEverInited; }
|
||||
|
||||
private:
|
||||
friend class RestoreSelectionState;
|
||||
|
||||
@ -259,7 +282,6 @@ private:
|
||||
|
||||
nsITextControlElement* const mTextCtrlElement;
|
||||
nsRefPtr<nsTextInputSelectionImpl> mSelCon;
|
||||
nsAutoPtr<SelectionState> mSelState;
|
||||
RestoreSelectionState* mRestoringSelection;
|
||||
nsCOMPtr<nsIEditor> mEditor;
|
||||
nsCOMPtr<nsIContent> mRootNode;
|
||||
@ -269,9 +291,13 @@ private:
|
||||
nsAutoPtr<nsCString> mValue;
|
||||
nsRefPtr<nsAnonDivObserver> mMutationObserver;
|
||||
mutable nsString mCachedValue; // Caches non-hard-wrapped value on a multiline control.
|
||||
PRPackedBool mEverInited; // Have we ever been initialized?
|
||||
PRPackedBool mEditorInitialized;
|
||||
PRPackedBool mInitializing; // Whether we're in the process of initialization
|
||||
PRPackedBool mValueTransferInProgress; // Whether a value is being transferred to the frame
|
||||
PRPackedBool mSelectionCached; // Whether mSelectionProperties is valid
|
||||
mutable PRPackedBool mSelectionRestoreEagerInit; // Whether we're eager initing because of selection restore
|
||||
SelectionProperties mSelectionProperties;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -46,9 +46,23 @@ function test(ctor) {
|
||||
|
||||
ok("selectionDirection" in elem, "elem should have the selectionDirection property");
|
||||
|
||||
is(elem.selectionStart, 0, "Default value");
|
||||
is(elem.selectionEnd, 0, "Default value");
|
||||
is(elem.selectionDirection, "forward", "Default value");
|
||||
|
||||
var content = document.getElementById("content");
|
||||
content.appendChild(elem);
|
||||
|
||||
function flush() { document.body.clientWidth; }
|
||||
function hide() {
|
||||
content.style.display = "none";
|
||||
flush();
|
||||
}
|
||||
function show() {
|
||||
content.style.display = "";
|
||||
flush();
|
||||
}
|
||||
|
||||
elem.value = "foobar";
|
||||
|
||||
is(elem.selectionStart, 0, "Default value");
|
||||
@ -60,6 +74,16 @@ function test(ctor) {
|
||||
is(elem.selectionEnd, 3, "Correct value");
|
||||
is(elem.selectionDirection, "forward", "If not set, should default to forward");
|
||||
|
||||
hide();
|
||||
is(elem.selectionStart, 1, "Value unchanged");
|
||||
is(elem.selectionEnd, 3, "Value unchanged");
|
||||
is(elem.selectionDirection, "forward", "Value unchanged");
|
||||
|
||||
show();
|
||||
is(elem.selectionStart, 1, "Value unchanged");
|
||||
is(elem.selectionEnd, 3, "Value unchanged");
|
||||
is(elem.selectionDirection, "forward", "Value unchanged");
|
||||
|
||||
// extend to right
|
||||
elem.focus();
|
||||
synthesizeKey("VK_RIGHT", {shiftKey: true});
|
||||
@ -68,6 +92,16 @@ function test(ctor) {
|
||||
is(elem.selectionEnd, 4, "Correct value");
|
||||
is(elem.selectionDirection, "forward", "Still forward");
|
||||
|
||||
hide();
|
||||
is(elem.selectionStart, 1, "Value unchanged");
|
||||
is(elem.selectionEnd, 4, "Value unchanged");
|
||||
is(elem.selectionDirection, "forward", "Value unchanged");
|
||||
|
||||
show();
|
||||
is(elem.selectionStart, 1, "Value unchanged");
|
||||
is(elem.selectionEnd, 4, "Value unchanged");
|
||||
is(elem.selectionDirection, "forward", "Value unchanged");
|
||||
|
||||
// change the direction
|
||||
elem.selectionDirection = "backward";
|
||||
|
||||
@ -75,6 +109,16 @@ function test(ctor) {
|
||||
is(elem.selectionEnd, 4, "Value unchanged");
|
||||
is(elem.selectionDirection, "backward", "Correct value");
|
||||
|
||||
hide();
|
||||
is(elem.selectionStart, 1, "Value unchanged");
|
||||
is(elem.selectionEnd, 4, "Value unchanged");
|
||||
is(elem.selectionDirection, "backward", "Value unchanged");
|
||||
|
||||
show();
|
||||
is(elem.selectionStart, 1, "Value unchanged");
|
||||
is(elem.selectionEnd, 4, "Value unchanged");
|
||||
is(elem.selectionDirection, "backward", "Value unchanged");
|
||||
|
||||
// extend to right again
|
||||
synthesizeKey("VK_RIGHT", {shiftKey: true});
|
||||
|
||||
@ -82,42 +126,112 @@ function test(ctor) {
|
||||
is(elem.selectionEnd, 4, "Value unchanged");
|
||||
is(elem.selectionDirection, "backward", "Still backward");
|
||||
|
||||
hide();
|
||||
is(elem.selectionStart, 2, "Value unchanged");
|
||||
is(elem.selectionEnd, 4, "Value unchanged");
|
||||
is(elem.selectionDirection, "backward", "Value unchanged");
|
||||
|
||||
show();
|
||||
is(elem.selectionStart, 2, "Value unchanged");
|
||||
is(elem.selectionEnd, 4, "Value unchanged");
|
||||
is(elem.selectionDirection, "backward", "Value unchanged");
|
||||
|
||||
elem.selectionEnd = 5;
|
||||
|
||||
is(elem.selectionStart, 2, "Value unchanged");
|
||||
is(elem.selectionEnd, 5, "Correct value");
|
||||
is(elem.selectionDirection, "backward", "Still backward");
|
||||
|
||||
hide();
|
||||
is(elem.selectionStart, 2, "Value unchanged");
|
||||
is(elem.selectionEnd, 5, "Value unchanged");
|
||||
is(elem.selectionDirection, "backward", "Value unchanged");
|
||||
|
||||
show();
|
||||
is(elem.selectionStart, 2, "Value unchanged");
|
||||
is(elem.selectionEnd, 5, "Value unchanged");
|
||||
is(elem.selectionDirection, "backward", "Value unchanged");
|
||||
|
||||
elem.selectionDirection = "none";
|
||||
|
||||
is(elem.selectionStart, 2, "Value unchanged");
|
||||
is(elem.selectionEnd, 5, "Value unchanged");
|
||||
is(elem.selectionDirection, "forward", "none not supported");
|
||||
|
||||
hide();
|
||||
is(elem.selectionStart, 2, "Value unchanged");
|
||||
is(elem.selectionEnd, 5, "Value unchanged");
|
||||
is(elem.selectionDirection, "forward", "Value unchanged");
|
||||
|
||||
show();
|
||||
is(elem.selectionStart, 2, "Value unchanged");
|
||||
is(elem.selectionEnd, 5, "Value unchanged");
|
||||
is(elem.selectionDirection, "forward", "Value unchanged");
|
||||
|
||||
elem.selectionDirection = "backward";
|
||||
|
||||
is(elem.selectionStart, 2, "Value unchanged");
|
||||
is(elem.selectionEnd, 5, "Value unchanged");
|
||||
is(elem.selectionDirection, "backward", "Correct Value");
|
||||
|
||||
hide();
|
||||
is(elem.selectionStart, 2, "Value unchanged");
|
||||
is(elem.selectionEnd, 5, "Value unchanged");
|
||||
is(elem.selectionDirection, "backward", "Value unchanged");
|
||||
|
||||
show();
|
||||
is(elem.selectionStart, 2, "Value unchanged");
|
||||
is(elem.selectionEnd, 5, "Value unchanged");
|
||||
is(elem.selectionDirection, "backward", "Value unchanged");
|
||||
|
||||
elem.selectionDirection = "invalid";
|
||||
|
||||
is(elem.selectionStart, 2, "Value unchanged");
|
||||
is(elem.selectionEnd, 5, "Value unchanged");
|
||||
is(elem.selectionDirection, "forward", "Treated as none");
|
||||
|
||||
hide();
|
||||
is(elem.selectionStart, 2, "Value unchanged");
|
||||
is(elem.selectionEnd, 5, "Value unchanged");
|
||||
is(elem.selectionDirection, "forward", "Value unchanged");
|
||||
|
||||
show();
|
||||
is(elem.selectionStart, 2, "Value unchanged");
|
||||
is(elem.selectionEnd, 5, "Value unchanged");
|
||||
is(elem.selectionDirection, "forward", "Value unchanged");
|
||||
|
||||
elem.selectionDirection = "backward";
|
||||
|
||||
is(elem.selectionStart, 2, "Value unchanged");
|
||||
is(elem.selectionEnd, 5, "Value unchanged");
|
||||
is(elem.selectionDirection, "backward", "Correct Value");
|
||||
|
||||
hide();
|
||||
is(elem.selectionStart, 2, "Value unchanged");
|
||||
is(elem.selectionEnd, 5, "Value unchanged");
|
||||
is(elem.selectionDirection, "backward", "Value unchanged");
|
||||
|
||||
show();
|
||||
is(elem.selectionStart, 2, "Value unchanged");
|
||||
is(elem.selectionEnd, 5, "Value unchanged");
|
||||
is(elem.selectionDirection, "backward", "Value unchanged");
|
||||
|
||||
elem.setSelectionRange(1, 4);
|
||||
|
||||
is(elem.selectionStart, 1, "Correct value");
|
||||
is(elem.selectionEnd, 4, "Correct value");
|
||||
is(elem.selectionDirection, "forward", "Correct value");
|
||||
|
||||
hide();
|
||||
is(elem.selectionStart, 1, "Value unchanged");
|
||||
is(elem.selectionEnd, 4, "Value unchanged");
|
||||
is(elem.selectionDirection, "forward", "Value unchanged");
|
||||
|
||||
show();
|
||||
is(elem.selectionStart, 1, "Value unchanged");
|
||||
is(elem.selectionEnd, 4, "Value unchanged");
|
||||
is(elem.selectionDirection, "forward", "Value unchanged");
|
||||
|
||||
elem.setSelectionRange(1, 1);
|
||||
synthesizeKey("VK_RIGHT", {shiftKey: true});
|
||||
synthesizeKey("VK_RIGHT", {shiftKey: true});
|
||||
@ -127,6 +241,16 @@ function test(ctor) {
|
||||
is(elem.selectionEnd, 4, "Correct value");
|
||||
is(elem.selectionDirection, "forward", "Correct value");
|
||||
|
||||
hide();
|
||||
is(elem.selectionStart, 1, "Value unchanged");
|
||||
is(elem.selectionEnd, 4, "Value unchanged");
|
||||
is(elem.selectionDirection, "forward", "Value unchanged");
|
||||
|
||||
show();
|
||||
is(elem.selectionStart, 1, "Value unchanged");
|
||||
is(elem.selectionEnd, 4, "Value unchanged");
|
||||
is(elem.selectionDirection, "forward", "Value unchanged");
|
||||
|
||||
elem.setSelectionRange(5, 5);
|
||||
synthesizeKey("VK_LEFT", {shiftKey: true});
|
||||
synthesizeKey("VK_LEFT", {shiftKey: true});
|
||||
@ -135,6 +259,16 @@ function test(ctor) {
|
||||
is(elem.selectionStart, 2, "Correct value");
|
||||
is(elem.selectionEnd, 5, "Correct value");
|
||||
is(elem.selectionDirection, "backward", "Correct value");
|
||||
|
||||
hide();
|
||||
is(elem.selectionStart, 2, "Value unchanged");
|
||||
is(elem.selectionEnd, 5, "Value unchanged");
|
||||
is(elem.selectionDirection, "backward", "Value unchanged");
|
||||
|
||||
show();
|
||||
is(elem.selectionStart, 2, "Value unchanged");
|
||||
is(elem.selectionEnd, 5, "Value unchanged");
|
||||
is(elem.selectionDirection, "backward", "Value unchanged");
|
||||
}
|
||||
|
||||
function name(elem) {
|
||||
|
@ -194,14 +194,17 @@ nsresult nsOggReader::ReadMetadata(nsVideoInfo* aInfo)
|
||||
int serial = ogg_page_serialno(&page);
|
||||
nsOggCodecState* codecState = 0;
|
||||
|
||||
if (ogg_page_bos(&page)) {
|
||||
NS_ASSERTION(!readAllBOS, "We shouldn't encounter another BOS page");
|
||||
if (!ogg_page_bos(&page)) {
|
||||
// We've encountered a non Beginning Of Stream page. No more BOS pages
|
||||
// can follow in this Ogg segment, so there will be no other bitstreams
|
||||
// in the Ogg (unless it's invalid).
|
||||
readAllBOS = PR_TRUE;
|
||||
} else if (!mCodecStates.Get(serial, nsnull)) {
|
||||
// We've not encountered a stream with this serial number before. Create
|
||||
// an nsOggCodecState to demux it, and map that to the nsOggCodecState
|
||||
// in mCodecStates.
|
||||
codecState = nsOggCodecState::Create(&page);
|
||||
|
||||
#ifdef DEBUG
|
||||
PRBool r =
|
||||
#endif
|
||||
mCodecStates.Put(serial, codecState);
|
||||
DebugOnly<PRBool> r = mCodecStates.Put(serial, codecState);
|
||||
NS_ASSERTION(r, "Failed to insert into mCodecStates");
|
||||
bitstreams.AppendElement(codecState);
|
||||
mKnownStreams.AppendElement(serial);
|
||||
@ -227,11 +230,6 @@ nsresult nsOggReader::ReadMetadata(nsVideoInfo* aInfo)
|
||||
{
|
||||
mSkeletonState = static_cast<nsSkeletonState*>(codecState);
|
||||
}
|
||||
} else {
|
||||
// We've encountered the a non Beginning Of Stream page. No more
|
||||
// BOS pages can follow in this Ogg segment, so there will be no other
|
||||
// bitstreams in the Ogg (unless it's invalid).
|
||||
readAllBOS = PR_TRUE;
|
||||
}
|
||||
|
||||
mCodecStates.Get(serial, &codecState);
|
||||
|
@ -207,6 +207,7 @@ _TEST_FILES += \
|
||||
bug604067.webm \
|
||||
chain.ogv \
|
||||
dirac.ogg \
|
||||
multiple-bos.ogg \
|
||||
split.webm \
|
||||
seek.ogv \
|
||||
seek.webm \
|
||||
|
@ -94,10 +94,10 @@ var gPlayTests = [
|
||||
{ name:"chain.ogv", type:"video/ogg", duration:Number.NaN },
|
||||
{ name:"bug523816.ogv", type:"video/ogg", duration:0.533 },
|
||||
{ name:"bug495129.ogv", type:"video/ogg", duration:2.41 },
|
||||
|
||||
{ name:"bug498380.ogv", type:"video/ogg", duration:0.533 },
|
||||
{ name:"bug495794.ogg", type:"audio/ogg", duration:0.3 },
|
||||
{ name:"bug557094.ogv", type:"video/ogg", duration:0.24 },
|
||||
{ name:"multiple-bos.ogg", type:"video/ogg", duration:0.431 },
|
||||
{ name:"audio-overhang.ogg", type:"audio/ogg", duration:2.3 },
|
||||
{ name:"video-overhang.ogg", type:"audio/ogg", duration:3.966 },
|
||||
|
||||
|
BIN
content/media/test/multiple-bos.ogg
Normal file
@ -2726,9 +2726,6 @@ nsXULDocument::LoadOverlayInternal(nsIURI* aURI, PRBool aIsDynamic,
|
||||
// The .xul file must be parsed from disk.
|
||||
|
||||
PRBool useXULCache = nsXULPrototypeCache::GetInstance()->IsEnabled();
|
||||
if (aIsDynamic)
|
||||
mIsWritingFastLoad = useXULCache;
|
||||
|
||||
if (useXULCache && mCurrentPrototype) {
|
||||
PRBool loaded;
|
||||
rv = mCurrentPrototype->AwaitLoadDone(this, &loaded);
|
||||
|
@ -77,6 +77,12 @@ export:: sqlite-version.h
|
||||
endif
|
||||
endif
|
||||
|
||||
# XXX Force -O2 optimisation on Mac because using the default -O3 causes
|
||||
# crashes. See bug 676499.
|
||||
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
||||
MODULE_OPTIMIZE_FLAGS = -O2
|
||||
endif
|
||||
|
||||
EXPORTS = \
|
||||
sqlite3.h \
|
||||
$(NULL)
|
||||
|
@ -66,6 +66,7 @@
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsRect.h"
|
||||
#include "prprf.h"
|
||||
#include "prenv.h"
|
||||
#include "nsIMarkupDocumentViewer.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
@ -780,9 +781,9 @@ nsDocShell::nsDocShell():
|
||||
#ifdef DEBUG
|
||||
// We're counting the number of |nsDocShells| to help find leaks
|
||||
++gNumberOfDocShells;
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
printf("++DOCSHELL %p == %ld\n", (void*) this, gNumberOfDocShells);
|
||||
if (!PR_GetEnv("MOZ_QUIET")) {
|
||||
printf("++DOCSHELL %p == %ld\n", (void*) this, gNumberOfDocShells);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -808,9 +809,9 @@ nsDocShell::~nsDocShell()
|
||||
#ifdef DEBUG
|
||||
// We're counting the number of |nsDocShells| to help find leaks
|
||||
--gNumberOfDocShells;
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
printf("--DOCSHELL %p == %ld\n", (void*) this, gNumberOfDocShells);
|
||||
if (!PR_GetEnv("MOZ_QUIET")) {
|
||||
printf("--DOCSHELL %p == %ld\n", (void*) this, gNumberOfDocShells);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
7
dom/base/crashtests/675621-1.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script>
|
||||
document.addEventListener("DOMSubtreeModified", function() {}, false);
|
||||
|
||||
document.body.insertAdjacentHTML("afterbegin", "<p>foo");
|
||||
</script>
|
@ -28,3 +28,4 @@ load 609560-1.xhtml
|
||||
load 612018-1.html
|
||||
load 637116.html
|
||||
load 666869.html
|
||||
load 675621-1.html
|
||||
|
@ -235,6 +235,7 @@
|
||||
#define FORCE_PR_LOG 1
|
||||
#endif
|
||||
#include "prlog.h"
|
||||
#include "prenv.h"
|
||||
|
||||
#include "mozilla/dom/indexedDB/IDBFactory.h"
|
||||
#include "mozilla/dom/indexedDB/IndexedDatabaseManager.h"
|
||||
@ -932,9 +933,11 @@ nsGlobalWindow::nsGlobalWindow(nsGlobalWindow *aOuterWindow)
|
||||
mSerial = ++gSerialCounter;
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("++DOMWINDOW == %d (%p) [serial = %d] [outer = %p]\n", gRefCnt,
|
||||
static_cast<void*>(static_cast<nsIScriptGlobalObject*>(this)),
|
||||
gSerialCounter, static_cast<void*>(aOuterWindow));
|
||||
if (!PR_GetEnv("MOZ_QUIET")) {
|
||||
printf("++DOMWINDOW == %d (%p) [serial = %d] [outer = %p]\n", gRefCnt,
|
||||
static_cast<void*>(static_cast<nsIScriptGlobalObject*>(this)),
|
||||
gSerialCounter, static_cast<void*>(aOuterWindow));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
@ -976,14 +979,16 @@ nsGlobalWindow::~nsGlobalWindow()
|
||||
NS_IF_RELEASE(gEntropyCollector);
|
||||
}
|
||||
#ifdef DEBUG
|
||||
nsCAutoString url;
|
||||
if (mLastOpenedURI) {
|
||||
mLastOpenedURI->GetSpec(url);
|
||||
}
|
||||
if (!PR_GetEnv("MOZ_QUIET")) {
|
||||
nsCAutoString url;
|
||||
if (mLastOpenedURI) {
|
||||
mLastOpenedURI->GetSpec(url);
|
||||
}
|
||||
|
||||
printf("--DOMWINDOW == %d (%p) [serial = %d] [outer = %p] [url = %s]\n",
|
||||
gRefCnt, static_cast<void*>(static_cast<nsIScriptGlobalObject*>(this)),
|
||||
mSerial, static_cast<void*>(mOuterWindow.get()), url.get());
|
||||
printf("--DOMWINDOW == %d (%p) [serial = %d] [outer = %p] [url = %s]\n",
|
||||
gRefCnt, static_cast<void*>(static_cast<nsIScriptGlobalObject*>(this)),
|
||||
mSerial, static_cast<void*>(mOuterWindow.get()), url.get());
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
|
@ -68,14 +68,13 @@ struct TypedArray;
|
||||
#undef NO_ERROR
|
||||
%}
|
||||
|
||||
[ptr] native WebGLArrayPtr (js::TypedArray);
|
||||
[ptr] native WebGLJSObjectPtr (JSObject);
|
||||
|
||||
//
|
||||
// OpenGL object wrappers
|
||||
//
|
||||
|
||||
[scriptable, uuid(3b43762a-8305-11de-98ab-000c29206271)]
|
||||
[scriptable, uuid(0df9f4ed-f5ff-4e51-a6ff-2bd9785a7639)]
|
||||
interface nsIWebGLTexture : nsISupports
|
||||
{
|
||||
[noscript] attribute WebGLuint name;
|
||||
@ -588,12 +587,12 @@ interface nsIDOMWebGLRenderingContext : nsISupports
|
||||
void bufferData([optional] in long dummy);
|
||||
[noscript] void bufferData_size(in WebGLenum target, in WebGLsizei size, in WebGLenum usage);
|
||||
[noscript] void bufferData_buf(in WebGLenum target, in WebGLJSObjectPtr data, in WebGLenum usage);
|
||||
[noscript] void bufferData_array(in WebGLenum target, in WebGLArrayPtr data, in WebGLenum usage);
|
||||
[noscript] void bufferData_array(in WebGLenum target, in WebGLJSObjectPtr data, in WebGLenum usage);
|
||||
[noscript] void bufferData_null();
|
||||
|
||||
void bufferSubData([optional] in long dummy);
|
||||
[noscript] void bufferSubData_buf(in WebGLenum target, in long offset, in WebGLJSObjectPtr data);
|
||||
[noscript] void bufferSubData_array(in WebGLenum target, in long offset, in WebGLArrayPtr data);
|
||||
[noscript] void bufferSubData_array(in WebGLenum target, in long offset, in WebGLJSObjectPtr data);
|
||||
[noscript] void bufferSubData_null();
|
||||
|
||||
WebGLenum checkFramebufferStatus(in WebGLenum target);
|
||||
@ -714,7 +713,7 @@ interface nsIDOMWebGLRenderingContext : nsISupports
|
||||
|
||||
void readPixels([optional] in long dummy);
|
||||
[noscript] void readPixels_array(in WebGLint x, in WebGLint y, in WebGLsizei width, in WebGLsizei height,
|
||||
in WebGLenum format, in WebGLenum type, in WebGLArrayPtr pixels);
|
||||
in WebGLenum format, in WebGLenum type, in WebGLJSObjectPtr pixels);
|
||||
[noscript] void readPixels_buf(in WebGLint x, in WebGLint y, in WebGLsizei width, in WebGLsizei height,
|
||||
in WebGLenum format, in WebGLenum type, in WebGLJSObjectPtr pixels);
|
||||
|
||||
@ -740,10 +739,10 @@ interface nsIDOMWebGLRenderingContext : nsISupports
|
||||
in WebGLint border, in WebGLenum format, in WebGLenum type, in WebGLJSObjectPtr pixels);
|
||||
[noscript] void texImage2D_array(in WebGLenum target, in WebGLint level, in WebGLenum internalformat,
|
||||
in WebGLsizei width, in WebGLsizei height,
|
||||
in WebGLint border, in WebGLenum format, in WebGLenum type, in WebGLArrayPtr pixels);
|
||||
in WebGLint border, in WebGLenum format, in WebGLenum type, in WebGLJSObjectPtr pixels);
|
||||
[noscript] void texImage2D_imageData(in WebGLenum target, in WebGLint level, in WebGLenum internalformat,
|
||||
in WebGLsizei width, in WebGLsizei height,
|
||||
in WebGLint border, in WebGLenum format, in WebGLenum type, in WebGLArrayPtr pixels);
|
||||
in WebGLint border, in WebGLenum format, in WebGLenum type, in WebGLJSObjectPtr pixels);
|
||||
|
||||
// HTMLImageElement, HTMLCanvasElement, HTMLVideoElement
|
||||
[noscript] void texImage2D_dom(in WebGLenum target, in WebGLint level, in WebGLenum internalformat,
|
||||
@ -755,10 +754,10 @@ interface nsIDOMWebGLRenderingContext : nsISupports
|
||||
in WebGLenum format, in WebGLenum type, in WebGLJSObjectPtr pixels);
|
||||
[noscript] void texSubImage2D_array(in WebGLenum target, in WebGLint level,
|
||||
in WebGLint xoffset, in WebGLint yoffset, in WebGLsizei width, in WebGLsizei height,
|
||||
in WebGLenum format, in WebGLenum type, in WebGLArrayPtr pixels);
|
||||
in WebGLenum format, in WebGLenum type, in WebGLJSObjectPtr pixels);
|
||||
[noscript] void texSubImage2D_imageData(in WebGLenum target, in WebGLint level,
|
||||
in WebGLint xoffset, in WebGLint yoffset, in WebGLsizei width, in WebGLsizei height,
|
||||
in WebGLenum format, in WebGLenum type, in WebGLArrayPtr pixels);
|
||||
in WebGLenum format, in WebGLenum type, in WebGLJSObjectPtr pixels);
|
||||
// HTMLImageElement, HTMLCanvasElement, HTMLVideoElement
|
||||
[noscript] void texSubImage2D_dom(in WebGLenum target, in WebGLint level,
|
||||
in WebGLint xoffset, in WebGLint yoffset, in WebGLenum format, in WebGLenum type,
|
||||
@ -788,23 +787,23 @@ interface nsIDOMWebGLRenderingContext : nsISupports
|
||||
void uniform4fv([optional] in long dummy);
|
||||
void uniform4iv([optional] in long dummy);
|
||||
|
||||
[noscript] void uniform1fv_array (in nsIWebGLUniformLocation location, in WebGLArrayPtr v);
|
||||
[noscript] void uniform1iv_array (in nsIWebGLUniformLocation location, in WebGLArrayPtr v);
|
||||
[noscript] void uniform2fv_array (in nsIWebGLUniformLocation location, in WebGLArrayPtr v);
|
||||
[noscript] void uniform2iv_array (in nsIWebGLUniformLocation location, in WebGLArrayPtr v);
|
||||
[noscript] void uniform3fv_array (in nsIWebGLUniformLocation location, in WebGLArrayPtr v);
|
||||
[noscript] void uniform3iv_array (in nsIWebGLUniformLocation location, in WebGLArrayPtr v);
|
||||
[noscript] void uniform4fv_array (in nsIWebGLUniformLocation location, in WebGLArrayPtr v);
|
||||
[noscript] void uniform4iv_array (in nsIWebGLUniformLocation location, in WebGLArrayPtr v);
|
||||
[noscript] void uniform1fv_array (in nsIWebGLUniformLocation location, in WebGLJSObjectPtr v);
|
||||
[noscript] void uniform1iv_array (in nsIWebGLUniformLocation location, in WebGLJSObjectPtr v);
|
||||
[noscript] void uniform2fv_array (in nsIWebGLUniformLocation location, in WebGLJSObjectPtr v);
|
||||
[noscript] void uniform2iv_array (in nsIWebGLUniformLocation location, in WebGLJSObjectPtr v);
|
||||
[noscript] void uniform3fv_array (in nsIWebGLUniformLocation location, in WebGLJSObjectPtr v);
|
||||
[noscript] void uniform3iv_array (in nsIWebGLUniformLocation location, in WebGLJSObjectPtr v);
|
||||
[noscript] void uniform4fv_array (in nsIWebGLUniformLocation location, in WebGLJSObjectPtr v);
|
||||
[noscript] void uniform4iv_array (in nsIWebGLUniformLocation location, in WebGLJSObjectPtr v);
|
||||
|
||||
// Modified. These are modified by replacing 'count' and 'value' with a WebGLArrayPtr
|
||||
// Modified. These are modified by replacing 'count' and 'value' with a WebGLJSObjectPtr
|
||||
void uniformMatrix2fv([optional] in long dummy);
|
||||
void uniformMatrix3fv([optional] in long dummy);
|
||||
void uniformMatrix4fv([optional] in long dummy);
|
||||
|
||||
[noscript] void uniformMatrix2fv_array (in nsIWebGLUniformLocation location, in WebGLboolean transpose, in WebGLArrayPtr value);
|
||||
[noscript] void uniformMatrix3fv_array (in nsIWebGLUniformLocation location, in WebGLboolean transpose, in WebGLArrayPtr value);
|
||||
[noscript] void uniformMatrix4fv_array (in nsIWebGLUniformLocation location, in WebGLboolean transpose, in WebGLArrayPtr value);
|
||||
[noscript] void uniformMatrix2fv_array (in nsIWebGLUniformLocation location, in WebGLboolean transpose, in WebGLJSObjectPtr value);
|
||||
[noscript] void uniformMatrix3fv_array (in nsIWebGLUniformLocation location, in WebGLboolean transpose, in WebGLJSObjectPtr value);
|
||||
[noscript] void uniformMatrix4fv_array (in nsIWebGLUniformLocation location, in WebGLboolean transpose, in WebGLJSObjectPtr value);
|
||||
|
||||
// Added API using top entry from the passed nsIWebGLMatrixStack
|
||||
//ZZ void glUniformMatrix(in WebGLint location, in WebGLboolean transpose, in nsIWebGLMatrixStack value);
|
||||
@ -812,7 +811,7 @@ interface nsIDOMWebGLRenderingContext : nsISupports
|
||||
void useProgram(in nsIWebGLProgram program);
|
||||
void validateProgram(in nsIWebGLProgram program);
|
||||
|
||||
// Modified: All the glVertexAttrib*v forms below are modified by replacing 'values' with a WebGLArrayPtr
|
||||
// Modified: All the glVertexAttrib*v forms below are modified by replacing 'values' with a WebGLJSObjectPtr
|
||||
void vertexAttrib1f(in WebGLuint indx, in WebGLfloat x);
|
||||
void vertexAttrib2f(in WebGLuint indx, in WebGLfloat x, in WebGLfloat y);
|
||||
void vertexAttrib3f(in WebGLuint indx, in WebGLfloat x, in WebGLfloat y, in WebGLfloat z);
|
||||
@ -823,10 +822,10 @@ interface nsIDOMWebGLRenderingContext : nsISupports
|
||||
void vertexAttrib3fv([optional] in long dummy);
|
||||
void vertexAttrib4fv([optional] in long dummy);
|
||||
|
||||
[noscript] void vertexAttrib1fv_array(in WebGLuint indx, in WebGLArrayPtr values);
|
||||
[noscript] void vertexAttrib2fv_array(in WebGLuint indx, in WebGLArrayPtr values);
|
||||
[noscript] void vertexAttrib3fv_array(in WebGLuint indx, in WebGLArrayPtr values);
|
||||
[noscript] void vertexAttrib4fv_array(in WebGLuint indx, in WebGLArrayPtr values);
|
||||
[noscript] void vertexAttrib1fv_array(in WebGLuint indx, in WebGLJSObjectPtr values);
|
||||
[noscript] void vertexAttrib2fv_array(in WebGLuint indx, in WebGLJSObjectPtr values);
|
||||
[noscript] void vertexAttrib3fv_array(in WebGLuint indx, in WebGLJSObjectPtr values);
|
||||
[noscript] void vertexAttrib4fv_array(in WebGLuint indx, in WebGLJSObjectPtr values);
|
||||
|
||||
// size is number of elements per attrib; offset, stride are in bytes
|
||||
void vertexAttribPointer(in WebGLuint idx, in WebGLint size, in WebGLenum type, in WebGLboolean normalized, in WebGLsizei stride, in WebGLsizeiptr offset);
|
||||
|
@ -209,7 +209,7 @@ NS_IMETHODIMP nsDeviceMotion::AddWindowListener(nsIDOMWindow *aWindow)
|
||||
|
||||
NS_IMETHODIMP nsDeviceMotion::RemoveWindowListener(nsIDOMWindow *aWindow)
|
||||
{
|
||||
if (mWindowListeners.IndexOf(aWindow) != NoIndex)
|
||||
if (mWindowListeners.IndexOf(aWindow) == NoIndex)
|
||||
return NS_OK;
|
||||
|
||||
mWindowListeners.RemoveElement(aWindow);
|
||||
|
@ -3119,11 +3119,11 @@ WorkerPrivate::AssertIsOnWorkerThread() const
|
||||
}
|
||||
#endif
|
||||
|
||||
BEGIN_WORKERS_NAMESPACE
|
||||
|
||||
// Force instantiation.
|
||||
template class WorkerPrivateParent<WorkerPrivate>;
|
||||
|
||||
BEGIN_WORKERS_NAMESPACE
|
||||
|
||||
WorkerPrivate*
|
||||
GetWorkerPrivateFromContext(JSContext* aCx)
|
||||
{
|
||||
|
@ -1454,6 +1454,16 @@ _cairo_surface_acquire_source_image (cairo_surface_t *surface,
|
||||
if (unlikely (status))
|
||||
return _cairo_surface_set_error (surface, status);
|
||||
|
||||
if (PIXMAN_FORMAT_BPP((*image_out)->pixman_format) == 0) {
|
||||
volatile char* acquire_source_image_ptr[10];
|
||||
volatile char* crasher;
|
||||
int i;
|
||||
for (i = 0; i < 10; i++) {
|
||||
acquire_source_image_ptr[i] = (char*)surface->backend->acquire_source_image;
|
||||
}
|
||||
crasher = NULL;
|
||||
*crasher = acquire_source_image_ptr[5];
|
||||
}
|
||||
_cairo_debug_check_image_surface_is_defined (&(*image_out)->base);
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|