Merge mozilla-central to fx-team

This commit is contained in:
Carsten "Tomcat" Book 2014-10-24 16:12:00 +02:00
commit 0ec014c025
247 changed files with 5807 additions and 2811 deletions

View File

@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
Bug 609976 needs a CLOBBER on Windows again.
Bug 1087560 needs a CLOBBER to stop it from looking in the wrong place for tests

View File

@ -155,9 +155,10 @@ let AdbController = {
// If USB Mass Storage, USB tethering, or a debug session is active,
// then we don't want to disable adb in an automatic fashion (i.e.
// when the screen locks or due to timeout).
let sysUsbConfig = libcutils.property_get("sys.usb.config");
let rndisActive = (sysUsbConfig.split(",").indexOf("rndis") >= 0);
let usbFuncActive = rndisActive || this.umsActive || isDebugging;
let sysUsbConfig = libcutils.property_get("sys.usb.config").split(",");
let usbFuncActive = this.umsActive || isDebugging;
usbFuncActive |= (sysUsbConfig.indexOf("rndis") >= 0);
usbFuncActive |= (sysUsbConfig.indexOf("mtp") >= 0);
let enableAdb = this.remoteDebuggerEnabled &&
(!(this.lockEnabled && this.locked) || usbFuncActive);
@ -216,7 +217,6 @@ let AdbController = {
}
}
}
};
SettingsListener.observe("lockscreen.locked", false,

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="d893a9b971a0f3ee48e5a57dca516837d92cf52b"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="29ed78a26d62b58f663437a45f273d57b9781d79"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
@ -133,7 +133,7 @@
<project name="platform/hardware/akm" path="hardware/akm" revision="6d3be412647b0eab0adff8a2768736cf4eb68039"/>
<project groups="invensense" name="platform/hardware/invensense" path="hardware/invensense" revision="e6d9ab28b4f4e7684f6c07874ee819c9ea0002a2"/>
<project name="platform/hardware/ril" path="hardware/ril" revision="865ce3b4a2ba0b3a31421ca671f4d6c5595f8690"/>
<project name="kernel/common" path="kernel" revision="310657b79caae2c89e6375a4185fe35fde089c39"/>
<project name="kernel/common" path="kernel" revision="291a7d55be6b0117786bf4d25366186c301185c2"/>
<project name="platform/system/core" path="system/core" revision="53d584d4a4b4316e4de9ee5f210d662f89b44e7e"/>
<project name="u-boot" path="u-boot" revision="982c1fd67b89d5573317c1796cf5b0143de44e8a"/>
<project name="vendor/sprd/gps" path="vendor/sprd/gps" revision="6974f8e771d4d8e910357a6739ab124768891e8f"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d893a9b971a0f3ee48e5a57dca516837d92cf52b"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="29ed78a26d62b58f663437a45f273d57b9781d79"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="d893a9b971a0f3ee48e5a57dca516837d92cf52b"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="29ed78a26d62b58f663437a45f273d57b9781d79"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="be8b952fde51d8c83748b41ce232f02b2218451d"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="d893a9b971a0f3ee48e5a57dca516837d92cf52b"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="29ed78a26d62b58f663437a45f273d57b9781d79"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d893a9b971a0f3ee48e5a57dca516837d92cf52b"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="29ed78a26d62b58f663437a45f273d57b9781d79"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="3a2947df41a480de1457a6dcdbf46ad0af70d8e0">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="d893a9b971a0f3ee48e5a57dca516837d92cf52b"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="29ed78a26d62b58f663437a45f273d57b9781d79"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
@ -132,7 +132,7 @@
<!-- Flame specific things -->
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="1bb28abbc215f45220620af5cd60a8ac1be93722"/>
<project name="device/qcom/common" path="device/qcom/common" revision="54c32c2ddef066fbdf611d29e4b7c47e0363599e"/>
<project name="device-flame" path="device/t2m/flame" remote="b2g" revision="05aa7b98d3f891b334031dc710d48d0d6b82ec1d"/>
<project name="device-flame" path="device/t2m/flame" remote="b2g" revision="dbd93c93782c9aa2306b909acdfb6ded15d49022"/>
<project name="codeaurora_kernel_msm" path="kernel" remote="b2g" revision="3c4f041e3e3dc676f2111caf20a186ec0467dbdb"/>
<project name="kernel_lk" path="bootable/bootloader/lk" remote="b2g" revision="fda40423ffa573dc6cafd3780515010cb2a086be"/>
<project name="platform/external/bluetooth/bluedroid" path="external/bluetooth/bluedroid" revision="30b96dfca99cb384bf520a16b81f3aba56f09907"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="d893a9b971a0f3ee48e5a57dca516837d92cf52b"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="29ed78a26d62b58f663437a45f273d57b9781d79"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="be8b952fde51d8c83748b41ce232f02b2218451d"/>

View File

@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
"revision": "e7679f24177bc939b159dd075085352229a4b709",
"revision": "b508914e27b34f26949fddbe8963fde897ae2268",
"repo_path": "/integration/gaia-central"
}

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d893a9b971a0f3ee48e5a57dca516837d92cf52b"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="29ed78a26d62b58f663437a45f273d57b9781d79"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -15,7 +15,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d893a9b971a0f3ee48e5a57dca516837d92cf52b"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="29ed78a26d62b58f663437a45f273d57b9781d79"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="d893a9b971a0f3ee48e5a57dca516837d92cf52b"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="29ed78a26d62b58f663437a45f273d57b9781d79"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="be8b952fde51d8c83748b41ce232f02b2218451d"/>

View File

@ -6,8 +6,8 @@
"filename": "setup.sh"
},
{
"size": 168202,
"digest": "5520f53fc10fcb569f235aff5c78ea5b69c878a8439b95aa758de2b83fc9f09bd4758c5fd701d84c58776386e210f3f30e5c9da6fdd8358d7dd371c764179339",
"size": 168320,
"digest": "c0f4a2da0b07ca6fc69290fbc5ed68f56c6b1ba4d593b220fd49b14ac4885e6ec949e695fd9a7ac464e0e86b652e99f6bd4af849fec072264b29a8f9686d2fc4",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
},

View File

@ -6,8 +6,8 @@
"filename": "setup.sh"
},
{
"size": 168202,
"digest": "5520f53fc10fcb569f235aff5c78ea5b69c878a8439b95aa758de2b83fc9f09bd4758c5fd701d84c58776386e210f3f30e5c9da6fdd8358d7dd371c764179339",
"size": 168320,
"digest": "c0f4a2da0b07ca6fc69290fbc5ed68f56c6b1ba4d593b220fd49b14ac4885e6ec949e695fd9a7ac464e0e86b652e99f6bd4af849fec072264b29a8f9686d2fc4",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
},

View File

@ -15,8 +15,8 @@
"filename": "clang.tar.bz2"
},
{
"size": 168202,
"digest": "5520f53fc10fcb569f235aff5c78ea5b69c878a8439b95aa758de2b83fc9f09bd4758c5fd701d84c58776386e210f3f30e5c9da6fdd8358d7dd371c764179339",
"size": 168320,
"digest": "c0f4a2da0b07ca6fc69290fbc5ed68f56c6b1ba4d593b220fd49b14ac4885e6ec949e695fd9a7ac464e0e86b652e99f6bd4af849fec072264b29a8f9686d2fc4",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
},

View File

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d893a9b971a0f3ee48e5a57dca516837d92cf52b"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="29ed78a26d62b58f663437a45f273d57b9781d79"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="314f305d3163cc094e6fe7701d95a98fc180b639"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -12,8 +12,8 @@
"filename": "gcc.tar.xz"
},
{
"size": 168202,
"digest": "5520f53fc10fcb569f235aff5c78ea5b69c878a8439b95aa758de2b83fc9f09bd4758c5fd701d84c58776386e210f3f30e5c9da6fdd8358d7dd371c764179339",
"size": 168320,
"digest": "c0f4a2da0b07ca6fc69290fbc5ed68f56c6b1ba4d593b220fd49b14ac4885e6ec949e695fd9a7ac464e0e86b652e99f6bd4af849fec072264b29a8f9686d2fc4",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
}

View File

@ -12,8 +12,8 @@
"filename": "gcc.tar.xz"
},
{
"size": 168202,
"digest": "5520f53fc10fcb569f235aff5c78ea5b69c878a8439b95aa758de2b83fc9f09bd4758c5fd701d84c58776386e210f3f30e5c9da6fdd8358d7dd371c764179339",
"size": 168320,
"digest": "c0f4a2da0b07ca6fc69290fbc5ed68f56c6b1ba4d593b220fd49b14ac4885e6ec949e695fd9a7ac464e0e86b652e99f6bd4af849fec072264b29a8f9686d2fc4",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
}

View File

@ -15,8 +15,8 @@
"filename": "clang.tar.bz2"
},
{
"size": 168202,
"digest": "5520f53fc10fcb569f235aff5c78ea5b69c878a8439b95aa758de2b83fc9f09bd4758c5fd701d84c58776386e210f3f30e5c9da6fdd8358d7dd371c764179339",
"size": 168320,
"digest": "c0f4a2da0b07ca6fc69290fbc5ed68f56c6b1ba4d593b220fd49b14ac4885e6ec949e695fd9a7ac464e0e86b652e99f6bd4af849fec072264b29a8f9686d2fc4",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
}

View File

@ -12,8 +12,8 @@
"filename": "setup.sh"
},
{
"size": 168202,
"digest": "5520f53fc10fcb569f235aff5c78ea5b69c878a8439b95aa758de2b83fc9f09bd4758c5fd701d84c58776386e210f3f30e5c9da6fdd8358d7dd371c764179339",
"size": 168320,
"digest": "c0f4a2da0b07ca6fc69290fbc5ed68f56c6b1ba4d593b220fd49b14ac4885e6ec949e695fd9a7ac464e0e86b652e99f6bd4af849fec072264b29a8f9686d2fc4",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
}

View File

@ -57,7 +57,7 @@ function test() {
// Create an ArrayBuffer of 80 bytes to test TypedArrays. 80 bytes is
// enough to get 10 items in all different TypedArrays.
jsterm.execute("let buf = ArrayBuffer(80);");
jsterm.execute("let buf = new ArrayBuffer(80);");
// Array
yield testNotSorted("Array(0,1,2,3,4,5,6,7,8,9,10)");
@ -66,7 +66,7 @@ function test() {
// Typed arrays.
for (let type of typedArrayTypes) {
yield testNotSorted(type + "(buf)");
yield testNotSorted("new " + type + "(buf)");
}
}

View File

@ -1477,9 +1477,6 @@ Tab.prototype = {
// stop about:blank from loading
browser.stop();
let fl = browser.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader;
fl.renderMode = Ci.nsIFrameLoader.RENDER_MODE_ASYNC_SCROLL;
return browser;
},

View File

@ -146,7 +146,6 @@ CERT_StartCertificateRequestAttributes
CERT_SubjectPublicKeyInfoTemplate DATA
CERT_TimeChoiceTemplate DATA
CERT_VerifyCertificate
CERT_VerifyCertName
CERT_VerifySignedDataWithPublicKeyInfo
DER_AsciiToTime_Util
DER_DecodeTimeChoice_Util

View File

@ -23,7 +23,6 @@
#include "nsAttrAndChildArray.h"
#include "mozFlushType.h"
#include "nsDOMAttributeMap.h"
#include "nsIDOMXPathNSResolver.h"
#include "nsPresContext.h"
#include "mozilla/CORSMode.h"
#include "mozilla/Attributes.h"

View File

@ -17,7 +17,6 @@
#include "nsAttrAndChildArray.h" // member
#include "nsCycleCollectionParticipant.h" // NS_DECL_CYCLE_*
#include "nsIContent.h" // base class
#include "nsIDOMXPathNSResolver.h" // base class
#include "nsINodeList.h" // base class
#include "nsIWeakReference.h" // base class
#include "nsNodeUtils.h" // class member nsNodeUtils::CloneNodeImpl
@ -83,29 +82,6 @@ private:
nsINode* mNode;
};
/**
* A tearoff class for FragmentOrElement to implement additional interfaces
*/
class nsNode3Tearoff : public nsIDOMXPathNSResolver
{
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(nsNode3Tearoff)
NS_DECL_NSIDOMXPATHNSRESOLVER
explicit nsNode3Tearoff(nsINode *aNode) : mNode(aNode)
{
}
protected:
virtual ~nsNode3Tearoff() {}
private:
nsCOMPtr<nsINode> mNode;
};
/**
* A class that implements nsIWeakReference
*/

View File

@ -50,7 +50,6 @@ class nsIDOMDocumentType;
class nsIDOMElement;
class nsIDOMNodeFilter;
class nsIDOMNodeList;
class nsIDOMXPathNSResolver;
class nsIHTMLCollection;
class nsILayoutHistoryState;
class nsILoadContext;
@ -125,6 +124,7 @@ class TreeWalker;
class UndoManager;
class XPathEvaluator;
class XPathExpression;
class XPathNSResolver;
class XPathResult;
template<typename> class OwningNonNull;
template<typename> class Sequence;
@ -135,8 +135,8 @@ typedef CallbackObjectHolder<NodeFilter, nsIDOMNodeFilter> NodeFilterHolder;
} // namespace mozilla
#define NS_IDOCUMENT_IID \
{ 0x42a263db, 0x6ac6, 0x40ff, \
{ 0x89, 0xe2, 0x25, 0x12, 0xe4, 0xbc, 0x2d, 0x2d } }
{ 0xbab5b447, 0x7e23, 0x4cdd, \
{ 0xac, 0xe5, 0xaa, 0x04, 0x26, 0x87, 0x2b, 0x97 } }
// Enum for requesting a particular type of document when creating a doc
enum DocumentFlavor {
@ -2318,13 +2318,12 @@ public:
void LoadBindingDocument(const nsAString& aURI, mozilla::ErrorResult& rv);
mozilla::dom::XPathExpression*
CreateExpression(const nsAString& aExpression,
nsIDOMXPathNSResolver* aResolver,
mozilla::dom::XPathNSResolver* aResolver,
mozilla::ErrorResult& rv);
already_AddRefed<nsIDOMXPathNSResolver>
CreateNSResolver(nsINode* aNodeResolver, mozilla::ErrorResult& rv);
nsINode* CreateNSResolver(nsINode& aNodeResolver);
already_AddRefed<mozilla::dom::XPathResult>
Evaluate(JSContext* aCx, const nsAString& aExpression, nsINode* aContextNode,
nsIDOMXPathNSResolver* aResolver, uint16_t aType,
mozilla::dom::XPathNSResolver* aResolver, uint16_t aType,
JS::Handle<JSObject*> aResult, mozilla::ErrorResult& rv);
// Touch event handlers already on nsINode
already_AddRefed<mozilla::dom::Touch>

View File

@ -16,7 +16,7 @@ interface nsIDOMElement;
interface nsITabParent;
interface nsILoadContext;
[scriptable, builtinclass, uuid(55a772b8-855a-4c5f-b4a1-284b6b3bec28)]
[scriptable, builtinclass, uuid(7600aa92-88dc-491c-896d-0564159b6a66)]
interface nsIFrameLoader : nsISupports
{
/**
@ -116,24 +116,6 @@ interface nsIFrameLoader : nsISupports
*/
void requestNotifyAfterRemotePaint();
/**
* The default rendering mode is synchronous scrolling. In this
* mode, it's an error to try to set a target viewport.
*/
const unsigned long RENDER_MODE_DEFAULT = 0x00000000;
/**
* When asynchronous scrolling is enabled, a target viewport can be
* set to transform content pixels wrt its CSS viewport.
*
* NB: when async scrolling is enabled, it's the *user's*
* responsibility to update the target scroll offset. In effect,
* the platform hands over control of scroll offset to the user.
*/
const unsigned long RENDER_MODE_ASYNC_SCROLL = 0x00000001;
attribute unsigned long renderMode;
/**
* The default event mode automatically forwards the events
* handled in EventStateManager::HandleCrossProcessEvent to

View File

@ -106,8 +106,6 @@ NS_INTERFACE_TABLE_HEAD(Attr)
NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(Attr)
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsISupportsWeakReference,
new nsNodeSupportsWeakRefTearoff(this))
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMXPathNSResolver,
new nsNode3Tearoff(this))
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTING_ADDREF(Attr)

View File

@ -448,23 +448,6 @@ nsChildContentList::IndexOf(nsIContent* aContent)
//----------------------------------------------------------------------
NS_IMPL_CYCLE_COLLECTION(nsNode3Tearoff, mNode)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsNode3Tearoff)
NS_INTERFACE_MAP_ENTRY(nsIDOMXPathNSResolver)
NS_INTERFACE_MAP_END_AGGREGATED(mNode)
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsNode3Tearoff)
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsNode3Tearoff)
NS_IMETHODIMP
nsNode3Tearoff::LookupNamespaceURI(const nsAString& aNamespacePrefix,
nsAString& aNamespaceURI)
{
mNode->LookupNamespaceURI(aNamespacePrefix, aNamespaceURI);
return NS_OK;
}
nsIHTMLCollection*
FragmentOrElement::Children()
{
@ -1962,8 +1945,6 @@ NS_INTERFACE_MAP_BEGIN(FragmentOrElement)
NS_INTERFACE_MAP_ENTRY(mozilla::dom::EventTarget)
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsISupportsWeakReference,
new nsNodeSupportsWeakRefTearoff(this))
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMXPathNSResolver,
new nsNode3Tearoff(this))
// DOM bindings depend on the identity pointer being the
// same as nsINode (which nsIContent inherits).
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIContent)

View File

@ -99,7 +99,6 @@
#include "nsBidiUtils.h"
#include "nsIDOMXPathNSResolver.h"
#include "nsIParserService.h"
#include "nsContentCreatorFunctions.h"
@ -210,6 +209,7 @@
#include "nsISecurityConsoleMessage.h"
#include "nsCharSeparatedTokenizer.h"
#include "mozilla/dom/XPathEvaluator.h"
#include "mozilla/dom/XPathNSResolverBinding.h"
#include "mozilla/dom/XPathResult.h"
#include "nsIDocumentEncoder.h"
#include "nsIDocumentActivity.h"
@ -1778,8 +1778,6 @@ NS_INTERFACE_TABLE_HEAD(nsDocument)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMXPathEvaluator)
NS_INTERFACE_TABLE_END
NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(nsDocument)
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMXPathNSResolver,
new nsNode3Tearoff(this))
NS_INTERFACE_MAP_END
@ -12314,22 +12312,21 @@ nsIDocument::Constructor(const GlobalObject& aGlobal,
XPathExpression*
nsIDocument::CreateExpression(const nsAString& aExpression,
nsIDOMXPathNSResolver* aResolver,
XPathNSResolver* aResolver,
ErrorResult& rv)
{
return XPathEvaluator()->CreateExpression(aExpression, aResolver, rv);
}
already_AddRefed<nsIDOMXPathNSResolver>
nsIDocument::CreateNSResolver(nsINode* aNodeResolver,
ErrorResult& rv)
nsINode*
nsIDocument::CreateNSResolver(nsINode& aNodeResolver)
{
return XPathEvaluator()->CreateNSResolver(aNodeResolver, rv);
return XPathEvaluator()->CreateNSResolver(aNodeResolver);
}
already_AddRefed<XPathResult>
nsIDocument::Evaluate(JSContext* aCx, const nsAString& aExpression,
nsINode* aContextNode, nsIDOMXPathNSResolver* aResolver,
nsINode* aContextNode, XPathNSResolver* aResolver,
uint16_t aType, JS::Handle<JSObject*> aResult,
ErrorResult& rv)
{
@ -12337,16 +12334,9 @@ nsIDocument::Evaluate(JSContext* aCx, const nsAString& aExpression,
aType, aResult, rv);
}
NS_IMETHODIMP
nsDocument::CreateNSResolver(nsIDOMNode* aNodeResolver,
nsIDOMXPathNSResolver** aResult)
{
return XPathEvaluator()->CreateNSResolver(aNodeResolver, aResult);
}
NS_IMETHODIMP
nsDocument::Evaluate(const nsAString& aExpression, nsIDOMNode* aContextNode,
nsIDOMXPathNSResolver* aResolver, uint16_t aType,
nsIDOMNode* aResolver, uint16_t aType,
nsISupports* aInResult, nsISupports** aResult)
{
return XPathEvaluator()->Evaluate(aExpression, aContextNode, aResolver, aType,

View File

@ -50,7 +50,6 @@
#include "nsAttrAndChildArray.h"
#include "nsDOMAttributeMap.h"
#include "nsIContentViewer.h"
#include "nsIDOMXPathNSResolver.h"
#include "nsIInterfaceRequestor.h"
#include "nsILoadContext.h"
#include "nsIProgressEventSink.h"

View File

@ -171,7 +171,6 @@ nsFrameLoader::nsFrameLoader(Element* aOwner, bool aNetworkCreated)
, mCurrentRemoteFrame(nullptr)
, mRemoteBrowser(nullptr)
, mChildID(0)
, mRenderMode(RENDER_MODE_DEFAULT)
, mEventMode(EVENT_MODE_NORMAL_DISPATCH)
, mPendingFrameSent(false)
{
@ -1952,24 +1951,6 @@ nsFrameLoader::UpdateBaseWindowPositionAndSize(nsSubDocumentFrame *aIFrame)
return NS_OK;
}
NS_IMETHODIMP
nsFrameLoader::GetRenderMode(uint32_t* aRenderMode)
{
*aRenderMode = mRenderMode;
return NS_OK;
}
NS_IMETHODIMP
nsFrameLoader::SetRenderMode(uint32_t aRenderMode)
{
if (aRenderMode == mRenderMode) {
return NS_OK;
}
mRenderMode = aRenderMode;
return NS_OK;
}
NS_IMETHODIMP
nsFrameLoader::GetEventMode(uint32_t* aEventMode)
{

View File

@ -69,11 +69,6 @@ protected:
~nsFrameLoader();
public:
bool AsyncScrollEnabled() const
{
return !!(mRenderMode & RENDER_MODE_ASYNC_SCROLL);
}
static nsFrameLoader* Create(mozilla::dom::Element* aOwner,
bool aNetworkCreated);
@ -367,11 +362,6 @@ private:
TabParent* mRemoteBrowser;
uint64_t mChildID;
// See nsIFrameLoader.idl. Short story, if !(mRenderMode &
// RENDER_MODE_ASYNC_SCROLL), all the fields below are ignored in
// favor of what content tells.
uint32_t mRenderMode;
// See nsIFrameLoader.idl. EVENT_MODE_NORMAL_DISPATCH automatically
// forwards some input events to out-of-process content.
uint32_t mEventMode;

View File

@ -130,8 +130,6 @@ NS_INTERFACE_MAP_BEGIN(nsGenericDOMDataNode)
NS_INTERFACE_MAP_ENTRY(mozilla::dom::EventTarget)
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsISupportsWeakReference,
new nsNodeSupportsWeakRefTearoff(this))
NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMXPathNSResolver,
new nsNode3Tearoff(this))
// DOM bindings depend on the identity pointer being the
// same as nsINode (which nsIContent inherits).
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIContent)

View File

@ -22,7 +22,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=429785
const serv = Components.classes["@mozilla.org/consoleservice;1"]
.getService(Components.interfaces.nsIConsoleService);
var listener = {
QueryInteface : function(iid) {
QueryInterface : function(iid) {
if (!iid.equals(Components.interfaces.nsISupports) &&
!iid.equals(Components.interfaces.nsIConsoleListener)) {
throw Components.results.NS_NOINTERFACE;

View File

@ -31,7 +31,7 @@ function checkData(xhr, data, mapped, cb) {
ok(ct.indexOf("mem-mapped") == -1, "Data is not memory-mapped");
}
ok(xhr.response, "Data is non-null");
var str = String.fromCharCode.apply(null, Uint8Array(xhr.response));
var str = String.fromCharCode.apply(null, new Uint8Array(xhr.response));
ok(str == data, "Data is correct");
cb();
}

View File

@ -18,7 +18,7 @@ function is(a, b, msg) {
function checkData(response, data_head, cb) {
ok(response, "Data is non-null");
var str = String.fromCharCode.apply(null, Uint8Array(response));
var str = String.fromCharCode.apply(null, new Uint8Array(response));
ok(str.length == data_head.length + gPaddingSize, "Data size is correct");
ok(str.slice(0, data_head.length) == data_head, "Data head is correct");
ok(str.slice(data_head.length) == gPadding, "Data padding is correct");

View File

@ -228,7 +228,7 @@ GetAppPaths(nsCString &aAppPath, nsCString &aAppBinaryPath)
}
void
GMPChild::OnChannelConnected(int32_t aPid)
GMPChild::StartMacSandbox()
{
nsAutoCString pluginDirectoryPath, pluginFilePath;
if (!GetPluginPaths(mPluginPath, pluginDirectoryPath, pluginFilePath)) {
@ -253,13 +253,6 @@ GMPChild::OnChannelConnected(int32_t aPid)
NS_WARNING(err.get());
MOZ_CRASH("sandbox_init() failed");
}
if (!LoadPluginLibrary(mPluginPath)) {
err.AppendPrintf("Failed to load GMP plugin \"%s\"",
mPluginPath.c_str());
NS_WARNING(err.get());
MOZ_CRASH("Failed to load GMP plugin");
}
}
#endif // XP_MACOSX && MOZ_GMP_SANDBOX
@ -332,6 +325,8 @@ GMPChild::RecvStartPlugin()
#if defined(MOZ_SANDBOX) && defined(XP_WIN)
mozilla::SandboxTarget::Instance()->StartSandbox();
#elif defined(XP_MACOSX) && defined(MOZ_GMP_SANDBOX)
StartMacSandbox();
#endif
return LoadPluginLibrary(mPluginPath);

View File

@ -25,10 +25,6 @@ public:
GMPChild();
virtual ~GMPChild();
#if defined(XP_MACOSX) && defined(MOZ_GMP_SANDBOX)
void OnChannelConnected(int32_t aPid);
#endif
bool Init(const std::string& aPluginPath,
base::ProcessHandle aParentProcessHandle,
MessageLoop* aIOLoop,
@ -51,6 +47,10 @@ public:
private:
#if defined(XP_MACOSX) && defined(MOZ_GMP_SANDBOX)
void StartMacSandbox();
#endif
virtual bool RecvSetNodeId(const nsCString& aNodeId) MOZ_OVERRIDE;
virtual bool RecvStartPlugin() MOZ_OVERRIDE;

View File

@ -11,7 +11,6 @@
#include "MockMediaDecoderOwner.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/TimeRanges.h"
#include "mtransport/runnable_utils.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -19,6 +18,8 @@ using namespace mozilla::dom;
class TestBinding
{
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(TestBinding);
nsRefPtr<MP4Decoder> decoder;
nsRefPtr<MockMediaResource> resource;
nsRefPtr<MP4Reader> reader;
@ -35,14 +36,17 @@ public:
decoder->SetResource(resource);
reader->Init(nullptr);
}
void Init() {
nsCOMPtr<nsIThread> thread;
nsresult rv = NS_NewThread(getter_AddRefs(thread),
WrapRunnable(this, &TestBinding::ReadMetadata));
NS_NewRunnableMethod(this, &TestBinding::ReadMetadata));
EXPECT_EQ(NS_OK, rv);
thread->Shutdown();
}
private:
virtual ~TestBinding()
{
decoder = nullptr;
@ -51,7 +55,6 @@ public:
SharedThreadPool::SpinUntilShutdown();
}
private:
void ReadMetadata()
{
MediaInfo info;
@ -62,13 +65,14 @@ private:
TEST(MP4Reader, BufferedRange)
{
TestBinding b;
nsRefPtr<TestBinding> b = new TestBinding();
b->Init();
// Video 3-4 sec, audio 2.986666-4.010666 sec
b.resource->MockAddBufferedRange(248400, 327455);
b->resource->MockAddBufferedRange(248400, 327455);
nsRefPtr<TimeRanges> ranges = new TimeRanges();
EXPECT_EQ(NS_OK, b.reader->GetBuffered(ranges, 0));
EXPECT_EQ(NS_OK, b->reader->GetBuffered(ranges, 0));
EXPECT_EQ(1U, ranges->Length());
double start = 0;
EXPECT_EQ(NS_OK, ranges->Start(0, &start));
@ -80,15 +84,16 @@ TEST(MP4Reader, BufferedRange)
TEST(MP4Reader, BufferedRangeMissingLastByte)
{
TestBinding b;
nsRefPtr<TestBinding> b = new TestBinding();
b->Init();
// Dropping the last byte of the video
b.resource->MockClearBufferedRanges();
b.resource->MockAddBufferedRange(248400, 324912);
b.resource->MockAddBufferedRange(324913, 327455);
b->resource->MockClearBufferedRanges();
b->resource->MockAddBufferedRange(248400, 324912);
b->resource->MockAddBufferedRange(324913, 327455);
nsRefPtr<TimeRanges> ranges = new TimeRanges();
EXPECT_EQ(NS_OK, b.reader->GetBuffered(ranges, 0));
EXPECT_EQ(NS_OK, b->reader->GetBuffered(ranges, 0));
EXPECT_EQ(1U, ranges->Length());
double start = 0;
EXPECT_EQ(NS_OK, ranges->Start(0, &start));
@ -100,15 +105,16 @@ TEST(MP4Reader, BufferedRangeMissingLastByte)
TEST(MP4Reader, BufferedRangeSyncFrame)
{
TestBinding b;
nsRefPtr<TestBinding> b = new TestBinding();
b->Init();
// Check that missing the first byte at 2 seconds skips right through to 3
// seconds because of a missing sync frame
b.resource->MockClearBufferedRanges();
b.resource->MockAddBufferedRange(146336, 327455);
b->resource->MockClearBufferedRanges();
b->resource->MockAddBufferedRange(146336, 327455);
nsRefPtr<TimeRanges> ranges = new TimeRanges();
EXPECT_EQ(NS_OK, b.reader->GetBuffered(ranges, 0));
EXPECT_EQ(NS_OK, b->reader->GetBuffered(ranges, 0));
EXPECT_EQ(1U, ranges->Length());
double start = 0;
EXPECT_EQ(NS_OK, ranges->Start(0, &start));
@ -120,7 +126,8 @@ TEST(MP4Reader, BufferedRangeSyncFrame)
TEST(MP4Reader, CompositionOrder)
{
TestBinding b("mediasource_test.mp4");
nsRefPtr<TestBinding> b = new TestBinding("mediasource_test.mp4");
b->Init();
// The first 5 video samples of this file are:
// Video timescale=2500
@ -145,27 +152,27 @@ TEST(MP4Reader, CompositionOrder)
// 10 12616 580 9226 1015 Yes
// 11 13220 581 10241 1014 Yes
b.resource->MockClearBufferedRanges();
b->resource->MockClearBufferedRanges();
// First two frames in decoding + first audio frame
b.resource->MockAddBufferedRange(48, 5503); // Video 1
b.resource->MockAddBufferedRange(5503, 5648); // Video 2
b.resource->MockAddBufferedRange(6228, 6803); // Video 3
b->resource->MockAddBufferedRange(48, 5503); // Video 1
b->resource->MockAddBufferedRange(5503, 5648); // Video 2
b->resource->MockAddBufferedRange(6228, 6803); // Video 3
// Audio - 5 frames; 0 - 139206 us
b.resource->MockAddBufferedRange(5648, 6228);
b.resource->MockAddBufferedRange(6803, 7383);
b.resource->MockAddBufferedRange(7618, 8199);
b.resource->MockAddBufferedRange(8199, 8779);
b.resource->MockAddBufferedRange(8962, 9563);
b.resource->MockAddBufferedRange(9734, 10314);
b.resource->MockAddBufferedRange(10314, 10895);
b.resource->MockAddBufferedRange(11207, 11787);
b.resource->MockAddBufferedRange(12035, 12616);
b.resource->MockAddBufferedRange(12616, 13196);
b.resource->MockAddBufferedRange(13220, 13901);
b->resource->MockAddBufferedRange(5648, 6228);
b->resource->MockAddBufferedRange(6803, 7383);
b->resource->MockAddBufferedRange(7618, 8199);
b->resource->MockAddBufferedRange(8199, 8779);
b->resource->MockAddBufferedRange(8962, 9563);
b->resource->MockAddBufferedRange(9734, 10314);
b->resource->MockAddBufferedRange(10314, 10895);
b->resource->MockAddBufferedRange(11207, 11787);
b->resource->MockAddBufferedRange(12035, 12616);
b->resource->MockAddBufferedRange(12616, 13196);
b->resource->MockAddBufferedRange(13220, 13901);
nsRefPtr<TimeRanges> ranges = new TimeRanges();
EXPECT_EQ(NS_OK, b.reader->GetBuffered(ranges, 0));
EXPECT_EQ(NS_OK, b->reader->GetBuffered(ranges, 0));
EXPECT_EQ(2U, ranges->Length());
double start = 0;
@ -185,7 +192,8 @@ TEST(MP4Reader, CompositionOrder)
TEST(MP4Reader, Normalised)
{
TestBinding b("mediasource_test.mp4");
nsRefPtr<TestBinding> b = new TestBinding("mediasource_test.mp4");
b->Init();
// The first 5 video samples of this file are:
// Video timescale=2500
@ -210,11 +218,11 @@ TEST(MP4Reader, Normalised)
// 10 12616 580 9226 1015 Yes
// 11 13220 581 10241 1014 Yes
b.resource->MockClearBufferedRanges();
b.resource->MockAddBufferedRange(48, 13901);
b->resource->MockClearBufferedRanges();
b->resource->MockAddBufferedRange(48, 13901);
nsRefPtr<TimeRanges> ranges = new TimeRanges();
EXPECT_EQ(NS_OK, b.reader->GetBuffered(ranges, 0));
EXPECT_EQ(NS_OK, b->reader->GetBuffered(ranges, 0));
EXPECT_EQ(1U, ranges->Length());
double start = 0;

View File

@ -27,7 +27,7 @@ function bail(message)
function ArrayBufferToString(arr)
{
var str = '';
var view = Uint8Array(arr);
var view = new Uint8Array(arr);
for (var i = 0; i < view.length; i++) {
str += String.fromCharCode(view[i]);
}
@ -36,8 +36,8 @@ function ArrayBufferToString(arr)
function StringToArrayBuffer(str)
{
var arr = ArrayBuffer(str.length);
var view = Uint8Array(arr);
var arr = new ArrayBuffer(str.length);
var view = new Uint8Array(arr);
for (var i = 0; i < str.length; i++) {
view[i] = str.charCodeAt(i);
}

View File

@ -9,7 +9,6 @@
#include "nsIDOMNode.h"
#include "nsIDOMElement.h"
#include "nsIDOMEvent.h"
#include "nsIDOMXPathNSResolver.h"
#include "nsIDocument.h"
#include "nsIContent.h"
#include "nsComponentManagerUtils.h"
@ -428,13 +427,7 @@ nsXULTemplateQueryProcessorXML::CreateExpression(const nsAString& aExpr,
nsINode* aNode,
ErrorResult& aRv)
{
nsCOMPtr<nsIDOMXPathNSResolver> nsResolver =
aNode->OwnerDoc()->CreateNSResolver(aNode, aRv);
if (aRv.Failed()) {
return nullptr;
}
return mEvaluator->CreateExpression(aExpr, nsResolver, aRv);
return mEvaluator->CreateExpression(aExpr, aNode, aRv);
}
NS_IMETHODIMP

View File

@ -107,6 +107,7 @@ function _setAppProperties(aObj, aApp) {
aObj.redirects = aApp.redirects;
aObj.widgetPages = aApp.widgetPages || [];
aObj.kind = aApp.kind;
aObj.enabled = aApp.enabled !== undefined ? aApp.enabled : true;
}
this.AppsUtils = {

View File

@ -424,6 +424,10 @@ WebappsApplication.prototype = {
return new this._window.DOMError(this._proxy.downloadError);
},
get enabled() {
return this._proxy.enabled;
},
download: function() {
cpmm.sendAsyncMessage("Webapps:Download",
{ manifestURL: this.manifestURL });
@ -613,7 +617,7 @@ WebappsApplication.prototype = {
case "Webapps:Launch:Return:KO":
this.removeMessageListeners(["Webapps:Launch:Return:OK",
"Webapps:Launch:Return:KO"]);
Services.DOMRequest.fireError(req, "APP_INSTALL_PENDING");
Services.DOMRequest.fireError(req, msg.error);
break;
case "Webapps:Launch:Return:OK":
this.removeMessageListeners(["Webapps:Launch:Return:OK",
@ -722,12 +726,14 @@ WebappsApplicationMgmt.prototype = {
"Webapps:Install:Return:OK",
"Webapps:GetNotInstalled:Return:OK",
"Webapps:Import:Return",
"Webapps:ExtractManifest:Return"]);
"Webapps:ExtractManifest:Return",
"Webapps:SetEnabled:Return"]);
cpmm.sendAsyncMessage("Webapps:RegisterForMessages",
{
messages: ["Webapps:Install:Return:OK",
"Webapps:Uninstall:Return:OK",
"Webapps:Uninstall:Broadcast:Return:OK"]
"Webapps:Uninstall:Broadcast:Return:OK",
"Webapps:SetEnabled:Return"]
}
);
},
@ -736,7 +742,8 @@ WebappsApplicationMgmt.prototype = {
cpmm.sendAsyncMessage("Webapps:UnregisterForMessages",
["Webapps:Install:Return:OK",
"Webapps:Uninstall:Return:OK",
"Webapps:Uninstall:Broadcast:Return:OK"]);
"Webapps:Uninstall:Broadcast:Return:OK",
"Webapps:SetEnabled:Return"]);
},
applyDownload: function(aApp) {
@ -804,6 +811,12 @@ WebappsApplicationMgmt.prototype = {
});
},
setEnabled: function(aApp, aValue) {
cpmm.sendAsyncMessage("Webapps:SetEnabled",
{ manifestURL: aApp.manifestURL,
enabled: aValue });
},
get oninstall() {
return this.__DOM_IMPL__.getEventHandler("oninstall");
},
@ -812,6 +825,10 @@ WebappsApplicationMgmt.prototype = {
return this.__DOM_IMPL__.getEventHandler("onuninstall");
},
get onenabledstatechange() {
return this.__DOM_IMPL__.getEventHandler("onenabledstatechange");
},
set oninstall(aCallback) {
this.__DOM_IMPL__.setEventHandler("oninstall", aCallback);
},
@ -820,9 +837,14 @@ WebappsApplicationMgmt.prototype = {
this.__DOM_IMPL__.setEventHandler("onuninstall", aCallback);
},
set onenabledstatechange(aCallback) {
this.__DOM_IMPL__.setEventHandler("onenabledstatechange", aCallback);
},
receiveMessage: function(aMessage) {
let msg = aMessage.data;
let req;
if (["Webapps:Import:Return",
"Webapps:ExtractManifest:Return"]
.indexOf(aMessage.name) != -1) {
@ -831,11 +853,13 @@ WebappsApplicationMgmt.prototype = {
req = this.getRequest(msg.requestID);
}
// We want Webapps:Install:Return:OK and Webapps:Uninstall:Broadcast:Return:OK
// We want Webapps:Install:Return:OK, Webapps:Uninstall:Broadcast:Return:OK
// and Webapps:SetEnabled:Return
// to be broadcasted to all instances of mozApps.mgmt.
if (!((msg.oid == this._id && req) ||
aMessage.name == "Webapps:Install:Return:OK" ||
aMessage.name == "Webapps:Uninstall:Broadcast:Return:OK")) {
aMessage.name == "Webapps:Uninstall:Broadcast:Return:OK" ||
aMessage.name == "Webapps:SetEnabled:Return")) {
return;
}
@ -879,6 +903,14 @@ WebappsApplicationMgmt.prototype = {
req.reject(new this._window.DOMError(msg.error || ""));
}
break;
case "Webapps:SetEnabled:Return":
{
let app = createContentApplicationObject(this._window, msg);
let event =
new this._window.MozApplicationEvent("enabledstatechange", { application : app });
this.__DOM_IMPL__.dispatchEvent(event);
}
break;
}
if (aMessage.name !== "Webapps:Uninstall:Broadcast:Return:OK") {
this.removeRequest(msg.requestID);

View File

@ -173,20 +173,30 @@ this.DOMApplicationRegistry = {
dirKey: DIRECTORY_NAME,
init: function() {
this.messages = ["Webapps:Install", "Webapps:Uninstall",
"Webapps:GetSelf", "Webapps:CheckInstalled",
"Webapps:GetInstalled", "Webapps:GetNotInstalled",
this.messages = ["Webapps:Install",
"Webapps:Uninstall",
"Webapps:GetSelf",
"Webapps:CheckInstalled",
"Webapps:GetInstalled",
"Webapps:GetNotInstalled",
"Webapps:Launch",
"Webapps:InstallPackage",
"Webapps:GetList", "Webapps:RegisterForMessages",
"Webapps:GetList",
"Webapps:RegisterForMessages",
"Webapps:UnregisterForMessages",
"Webapps:CancelDownload", "Webapps:CheckForUpdate",
"Webapps:Download", "Webapps:ApplyDownload",
"Webapps:Install:Return:Ack", "Webapps:AddReceipt",
"Webapps:RemoveReceipt", "Webapps:ReplaceReceipt",
"Webapps:CancelDownload",
"Webapps:CheckForUpdate",
"Webapps:Download",
"Webapps:ApplyDownload",
"Webapps:Install:Return:Ack",
"Webapps:AddReceipt",
"Webapps:RemoveReceipt",
"Webapps:ReplaceReceipt",
"Webapps:RegisterBEP",
"Webapps:Export", "Webapps:Import",
"Webapps:Export",
"Webapps:Import",
"Webapps:ExtractManifest",
"Webapps:SetEnabled",
"child-process-shutdown"];
this.frameMessages = ["Webapps:ClearBrowserData"];
@ -283,6 +293,10 @@ this.DOMApplicationRegistry = {
continue;
}
if (app.enabled === undefined) {
app.enabled = true;
}
// At startup we can't be downloading, and the $TMP directory
// will be empty so we can't just apply a staged update.
app.downloading = false;
@ -1181,13 +1195,14 @@ this.DOMApplicationRegistry = {
Services.prefs.setBoolPref("dom.mozApps.used", true);
// We need to check permissions for calls coming from mozApps.mgmt.
// These are: getNotInstalled(), applyDownload(), uninstall(), import() and
// extractManifest().
// These are: getNotInstalled(), applyDownload(), uninstall(), import(),
// extractManifest(), setEnabled().
if (["Webapps:GetNotInstalled",
"Webapps:ApplyDownload",
"Webapps:Uninstall",
"Webapps:Import",
"Webapps:ExtractManifest"].indexOf(aMessage.name) != -1) {
"Webapps:ExtractManifest",
"Webapps:SetEnabled"].indexOf(aMessage.name) != -1) {
if (!aMessage.target.assertPermission("webapps-manage")) {
debug("mozApps message " + aMessage.name +
" from a content process with no 'webapps-manage' privileges.");
@ -1322,6 +1337,9 @@ this.DOMApplicationRegistry = {
case "Webapps:ExtractManifest":
this.doExtractManifest(msg, mm);
break;
case "Webapps:SetEnabled":
this.setEnabled(msg);
break;
}
});
},
@ -1534,6 +1552,7 @@ this.DOMApplicationRegistry = {
aMm.sendAsyncMessage("Webapps:Launch:Return:OK", aData);
},
function onfailure(reason) {
aData.error = reason;
aMm.sendAsyncMessage("Webapps:Launch:Return:KO", aData);
}
);
@ -4299,6 +4318,25 @@ this.DOMApplicationRegistry = {
});
},
setEnabled: function(aData) {
debug("setEnabled " + aData.manifestURL + " : " + aData.enabled);
let id = this._appIdForManifestURL(aData.manifestURL);
if (!id || !this.webapps[id]) {
return;
}
debug("Enabling " + id);
let app = this.webapps[id];
app.enabled = aData.enabled;
this._saveApps().then(() => {
DOMApplicationRegistry.broadcastMessage("Webapps:UpdateState", {
app: app,
id: app.id
});
this.broadcastMessage("Webapps:SetEnabled:Return", app);
});
},
getManifestFor: function(aManifestURL) {
let id = this._appIdForManifestURL(aManifestURL);
let app = this.webapps[id];

View File

@ -47,7 +47,7 @@
}
var data = xhr.response;
ok(data, "Data is non-null");
var str = String.fromCharCode.apply(null, Uint8Array(data));
var str = String.fromCharCode.apply(null, new Uint8Array(data));
is(str.length, data_head.length + gPaddingSize, "Data size is correct");
is(str.slice(0, data_head.length), data_head, "Data head is correct");
ok(str.slice(data_head.length) == gPadding, "Data padding is correct");

View File

@ -22,6 +22,7 @@ support-files =
marketplace/*
pkg_install_iframe.html
[test_app_enabled.html]
[test_app_update.html]
[test_bug_795164.html]
[test_import_export.html]

View File

@ -0,0 +1,129 @@
<!DOCTYPE html>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id={1XXXXXX}
-->
<head>
<title>Test for Bug {1072090}</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id={1072090}">Mozilla Bug {1072090}</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script class="testbody" type="application/javascript;version=1.7">
var gManifestURL = "http://test/tests/dom/apps/tests/file_app.sjs?apptype=hosted&getmanifest=true";
var gGenerator = runTest();
function go() {
SpecialPowers.pushPermissions(
[{ "type": "webapps-manage", "allow": 1, "context": document }],
function() { gGenerator.next() });
}
function continueTest() {
try {
gGenerator.next();
} catch (e if e instanceof StopIteration) {
finish();
}
}
function finish() {
SimpleTest.finish();
}
function cbError(aEvent) {
ok(false, "Error callback invoked " +
aEvent.target.error.name + " " + aEvent.target.error.message);
finish();
}
SimpleTest.waitForExplicitFinish();
/**
* Flip the `enabled` state of an app back and forth.
*/
function runTest() {
SpecialPowers.setAllAppsLaunchable(true);
SpecialPowers.autoConfirmAppInstall(continueTest);
yield undefined;
SpecialPowers.autoConfirmAppUninstall(continueTest);
yield undefined;
request = navigator.mozApps.mgmt.getAll();
request.onerror = cbError;
request.onsuccess = continueTest;
yield undefined;
var initialAppsCount = request.result.length;
info("Starting with " + initialAppsCount + " apps installed.");
var request = navigator.mozApps.install(gManifestURL, { });
request.onerror = cbError;
request.onsuccess = continueTest;
yield undefined;
var app = request.result;
ok(app, "App is non-null");
is(app.manifestURL, gManifestURL, "App manifest url is correct.");
is(app.enabled, true, "App is enabled by default after install.");
// Switch the app to disabled.
navigator.mozApps.mgmt.onenabledstatechange = function(event) {
ok(true, "onenabledstatechange received");
is(event.application.enabled, false, "Application is disabled");
is(app.enabled, false, "Application is disabled");
continueTest();
}
navigator.mozApps.mgmt.setEnabled(app, false);
yield undefined;
// Re-enable the app.
navigator.mozApps.mgmt.onenabledstatechange = function(event) {
ok(true, "onenabledstatechange received");
is(event.application.enabled, true, "Application is enabled");
is(app.enabled, true, "Application is enabled");
continueTest();
}
navigator.mozApps.mgmt.setEnabled(app, true);
yield undefined;
navigator.mozApps.mgmt.onuninstall = function(event) {
var app = event.application;
is(app.manifestURL, gManifestURL, "App uninstall event ok.");
is(app.manifest.name, "Really Rapid Release (hosted)",
"App uninstall manifest ok.");
continueTest();
}
request = navigator.mozApps.mgmt.uninstall(app);
request.onerror = cbError;
request.onsuccess = continueTest;
yield undefined;
yield undefined;
is(request.result, gManifestURL, "App uninstalled.");
navigator.mozApps.mgmt.onuninstall = null;
request = navigator.mozApps.mgmt.getAll();
request.onerror = cbError;
request.onsuccess = continueTest;
yield undefined;
is(request.result.length, initialAppsCount, "All apps are uninstalled.");
}
addLoadEvent(go);
</script>
</pre>
</body>
</html>

View File

@ -77,7 +77,7 @@ function cbError(aEvent) {
SimpleTest.waitForExplicitFinish();
/**
* Install 2 apps from the same origin and uninstall them.
* Test exporting and importing hosted and packaged apps.
*/
function runTest() {
SpecialPowers.setAllAppsLaunchable(true);

View File

@ -91,7 +91,6 @@
#include "nsITreeView.h"
#include "nsIXULTemplateBuilder.h"
#endif
#include "nsIDOMXPathNSResolver.h"
#include "nsIEventListenerService.h"
#include "nsIMessageManager.h"
@ -247,9 +246,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
NS_DEFINE_CLASSINFO_DATA(CSSSupportsRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(XPathNSResolver, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(MozSmsMessage, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
@ -694,10 +690,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSSupportsRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(XPathNSResolver, nsIDOMXPathNSResolver)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXPathNSResolver)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(MozSmsMessage, nsIDOMMozSmsMessage)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozSmsMessage)
DOM_CLASSINFO_MAP_END

View File

@ -32,9 +32,6 @@ DOMCI_CLASS(XULTreeBuilder)
DOMCI_CLASS(CSSMozDocumentRule)
DOMCI_CLASS(CSSSupportsRule)
// DOM Level 3 XPath objects
DOMCI_CLASS(XPathNSResolver)
DOMCI_CLASS(MozSmsMessage)
DOMCI_CLASS(MozMmsMessage)
DOMCI_CLASS(MozMobileMessageThread)

View File

@ -1863,5 +1863,4 @@ addExternalIface('StackFrame', nativeType='nsIStackFrame',
headerFile='nsIException.h', notflattened=True)
addExternalIface('URI', nativeType='nsIURI', headerFile='nsIURI.h',
notflattened=True)
addExternalIface('XPathNSResolver')
addExternalIface('XULCommandDispatcher')

View File

@ -2,10 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/gfx/2D.h"
#include "mozilla/ipc/DocumentRendererParent.h"
#include "gfx2DGlue.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/gfx/PathHelpers.h"
#include "mozilla/RefPtr.h"
#include "gfxPattern.h"
#include "nsICanvasRenderingContextInternal.h"
using namespace mozilla;
@ -31,23 +33,18 @@ void DocumentRendererParent::DrawToCanvas(const nsIntSize& aSize,
if (!mCanvas || !mCanvasContext)
return;
DrawTarget* drawTarget = mCanvasContext->GetDrawTarget();
Rect rect(0, 0, aSize.width, aSize.height);
MaybeSnapToDevicePixels(rect, *drawTarget, true);
RefPtr<DataSourceSurface> dataSurface =
Factory::CreateWrappingDataSourceSurface(reinterpret_cast<uint8_t*>(const_cast<nsCString&>(aData).BeginWriting()),
aSize.width * 4,
IntSize(aSize.width, aSize.height),
SurfaceFormat::B8G8R8A8);
nsRefPtr<gfxPattern> pat = new gfxPattern(dataSurface, Matrix());
SurfacePattern pattern(dataSurface, ExtendMode::CLAMP);
drawTarget->FillRect(rect, pattern);
gfxRect rect(gfxPoint(0, 0), gfxSize(aSize.width, aSize.height));
mCanvasContext->NewPath();
mCanvasContext->PixelSnappedRectangleAndSetPattern(rect, pat);
mCanvasContext->Fill();
// get rid of the pattern surface ref, because aData is very
// likely to go away shortly
mCanvasContext->SetColor(gfxRGBA(1,1,1,1));
gfxRect damageRect = mCanvasContext->UserToDevice(rect);
gfxRect damageRect = mCanvasContext->UserToDevice(ThebesRect(rect));
mCanvas->Redraw(damageRect);
}

View File

@ -909,6 +909,11 @@ WebGLContext::SetDimensions(int32_t sWidth, int32_t sHeight)
mViewportWidth = mWidth;
mViewportHeight = mHeight;
// Update mOptions.
mOptions.depth = gl->Caps().depth;
mOptions.stencil = gl->Caps().stencil;
mOptions.antialias = gl->Caps().antialias;
// Make sure that we clear this out, otherwise
// we'll end up displaying random memory
gl->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, 0);
@ -925,9 +930,9 @@ WebGLContext::SetDimensions(int32_t sWidth, int32_t sHeight)
MOZ_ASSERT(gl->Caps().color);
MOZ_ASSERT(gl->Caps().alpha == mOptions.alpha);
MOZ_ASSERT(gl->Caps().depth == mOptions.depth || !gl->Caps().depth);
MOZ_ASSERT(gl->Caps().stencil == mOptions.stencil || !gl->Caps().stencil);
MOZ_ASSERT(gl->Caps().antialias == mOptions.antialias || !gl->Caps().antialias);
MOZ_ASSERT(gl->Caps().depth == mOptions.depth);
MOZ_ASSERT(gl->Caps().stencil == mOptions.stencil);
MOZ_ASSERT(gl->Caps().antialias == mOptions.antialias);
MOZ_ASSERT(gl->Caps().preserve == mOptions.preserveDrawingBuffer);
if (gl->WorkAroundDriverBugs() && gl->IsANGLE()) {

View File

@ -4,31 +4,30 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "WebGLContext.h"
#include "WebGLBuffer.h"
#include "WebGLVertexAttribData.h"
#include "WebGLShader.h"
#include "WebGLProgram.h"
#include "WebGLUniformLocation.h"
#include "WebGLFramebuffer.h"
#include "WebGLRenderbuffer.h"
#include "WebGLTexture.h"
#include "WebGLVertexArray.h"
#include "GLContext.h"
#include "CanvasUtils.h"
#include "WebGLContextUtils.h"
#include <algorithm>
#include "angle/ShaderLang.h"
#include "CanvasUtils.h"
#include "GLContext.h"
#include "jsfriendapi.h"
#include "mozilla/CheckedInt.h"
#include "mozilla/Preferences.h"
#include "mozilla/Services.h"
#include "jsfriendapi.h"
#include "angle/ShaderLang.h"
#include <algorithm>
#include "mozilla/Services.h"
#include "nsIObserverService.h"
#include "WebGLBuffer.h"
#include "WebGLContextUtils.h"
#include "WebGLFramebuffer.h"
#include "WebGLProgram.h"
#include "WebGLRenderbuffer.h"
#include "WebGLShader.h"
#include "WebGLTexture.h"
#include "WebGLUniformLocation.h"
#include "WebGLVertexArray.h"
#include "WebGLVertexAttribData.h"
#if defined(MOZ_WIDGET_COCOA)
#include "nsCocoaFeatures.h"
#endif
using namespace mozilla;
@ -1668,7 +1667,10 @@ WebGLContext::InitAndValidateGL()
#ifdef XP_MACOSX
if (gl->WorkAroundDriverBugs() &&
gl->Vendor() == gl::GLVendor::ATI) {
gl->Vendor() == gl::GLVendor::ATI &&
nsCocoaFeatures::OSXVersionMajor() == 10 &&
nsCocoaFeatures::OSXVersionMinor() < 9)
{
// The Mac ATI driver, in all known OSX version up to and including 10.8,
// renders points sprites upside-down. Apple bug 11778921
gl->fPointParameterf(LOCAL_GL_POINT_SPRITE_COORD_ORIGIN, LOCAL_GL_LOWER_LEFT);

View File

@ -61,7 +61,7 @@ let gTestCases = [
// Create with array buffer view data.
{
text: "Kunming is in Yunnan province of China.",
get data() { return Uint8Array(str2array(this.text)); },
get data() { return new Uint8Array(str2array(this.text)); },
shouldPass: true,
mode: "replace"
},

View File

@ -348,7 +348,7 @@ let FormAssistant = {
// Implements nsIEditorObserver get notification when the text content of
// current input field has changed.
EditAction: function fa_editAction() {
if (this._editing) {
if (this._editing || !this.isHandlingFocus) {
return;
}
this.sendInputState(this.focusedElement);

View File

@ -23,5 +23,6 @@ support-files =
[test_bug1066515.html]
[test_delete_focused_element.html]
[test_sendkey_cancel.html]
[test_sync_edit.html]
[test_two_inputs.html]
[test_two_selects.html]

View File

@ -0,0 +1,65 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1079455
-->
<head>
<title>Sync edit of an input</title>
<script type="application/javascript;version=1.7" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript;version=1.7" src="inputmethod_common.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1079455">Mozilla Bug 1079455</a>
<p id="display"></p>
<pre id="test">
<script class="testbody" type="application/javascript;version=1.7">
inputmethod_setup(function() {
runTest();
});
let appFrameScript = function appFrameScript() {
let input = content.document.body.firstElementChild;
input.focus();
input.value = 'First1';
input.blur();
content.setTimeout(function() {
sendAsyncMessage('test:next', {});
});
};
function runTest() {
let im = navigator.mozInputMethod;
let i = 0;
im.oninputcontextchange = function() {
ok(false, 'Should not receive any inputcontextchange events.');
};
// Set current page as an input method.
SpecialPowers.wrap(im).setActive(true);
let iframe = document.createElement('iframe');
iframe.src = 'data:text/html,<html><body><input value="First"></body></html>';
iframe.setAttribute('mozbrowser', true);
document.body.appendChild(iframe);
let mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
mm.addMessageListener('test:next', function() {
ok(true, '\\o/');
inputmethod_cleanup();
});
iframe.addEventListener('mozbrowserloadend', function() {
mm.loadFrameScript('data:,(' + encodeURIComponent(appFrameScript.toString()) + ')();', false);
});
}
</script>
</pre>
</body>
</html>

View File

@ -6,7 +6,6 @@
XPIDL_SOURCES += [
'nsIDOMXPathEvaluator.idl',
'nsIDOMXPathNSResolver.idl',
'nsIDOMXPathResult.idl',
]

View File

@ -9,16 +9,14 @@
#include "domstubs.idl"
interface nsIDOMXPathNSResolver;
interface XPathException;
[uuid(89a0fe71-c1d9-46bd-b76b-47f51fd935ff)]
[uuid(92584002-d0e2-4b88-9af9-fa6ff59ee002)]
interface nsIDOMXPathEvaluator : nsISupports
{
nsIDOMXPathNSResolver createNSResolver(in nsIDOMNode nodeResolver);
nsISupports evaluate(in DOMString expression,
in nsIDOMNode contextNode,
in nsIDOMXPathNSResolver resolver,
in nsIDOMNode resolver,
in unsigned short type,
in nsISupports result)
raises(XPathException,

View File

@ -1,16 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* Corresponds to http://www.w3.org/TR/2002/WD-DOM-Level-3-XPath-20020208
*/
#include "domstubs.idl"
[scriptable, function, uuid(75506f83-b504-11d5-a7f2-ca108ab8b6fc)]
interface nsIDOMXPathNSResolver : nsISupports
{
DOMString lookupNamespaceURI(in DOMString prefix);
};

View File

@ -17,6 +17,16 @@ ASSERT_NETWORK_SELECTION_MODE_EQUALITY(Manual, NETWORK_SELECTION_MODE_MANUAL);
#undef ASSERT_NETWORK_SELECTION_MODE_EQUALITY
#define ASSERT_MOBILE_RADIO_STATE_EQUALITY(webidlState, xpidlState) \
static_assert(static_cast<int32_t>(MobileRadioState::webidlState) == nsIMobileConnection::xpidlState, \
"MobileRadioState::" #webidlState " should equal to nsIMobileConnection::" #xpidlState)
ASSERT_MOBILE_RADIO_STATE_EQUALITY(Enabling, MOBILE_RADIO_STATE_ENABLING);
ASSERT_MOBILE_RADIO_STATE_EQUALITY(Enabled, MOBILE_RADIO_STATE_ENABLED);
ASSERT_MOBILE_RADIO_STATE_EQUALITY(Disabling, MOBILE_RADIO_STATE_DISABLING);
ASSERT_MOBILE_RADIO_STATE_EQUALITY(Disabled, MOBILE_RADIO_STATE_DISABLED);
#undef ASSERT_MOBILE_RADIO_STATE_EQUALITY
} // namespace dom
} // namespace mozilla

View File

@ -368,9 +368,12 @@ MobileConnection::GetRadioState() const
return retVal;
}
nsAutoString state;
mMobileConnection->GetRadioState(state);
CONVERT_STRING_TO_NULLABLE_ENUM(state, MobileRadioState, retVal);
int32_t state = nsIMobileConnection::MOBILE_RADIO_STATE_UNKNOWN;
if (NS_SUCCEEDED(mMobileConnection->GetRadioState(&state)) &&
state != nsIMobileConnection::MOBILE_RADIO_STATE_UNKNOWN) {
MOZ_ASSERT(state < static_cast<int32_t>(MobileRadioState::EndGuard_));
retVal.SetValue(static_cast<MobileRadioState>(state));
}
return retVal;
}

View File

@ -379,7 +379,7 @@ MobileConnectionProvider.prototype = {
data: null,
iccId: null,
networkSelectionMode: Ci.nsIMobileConnection.NETWORK_SELECTION_MODE_UNKNOWN,
radioState: null,
radioState: Ci.nsIMobileConnection.MOBILE_RADIO_STATE_UNKNOWN,
lastKnownNetwork: null,
lastKnownHomeNetwork: null,
supportedNetworkTypes: null,
@ -743,7 +743,7 @@ MobileConnectionProvider.prototype = {
},
setPreferredNetworkType: function(aType, aCallback) {
if (this.radioState !== RIL.GECKO_RADIOSTATE_ENABLED) {
if (this.radioState !== Ci.nsIMobileConnection.MOBILE_RADIO_STATE_ENABLED) {
this._dispatchNotifyError(aCallback, RIL.GECKO_ERROR_RADIO_NOT_AVAILABLE);
return;
}
@ -762,7 +762,7 @@ MobileConnectionProvider.prototype = {
},
getPreferredNetworkType: function(aCallback) {
if (this.radioState !== RIL.GECKO_RADIOSTATE_ENABLED) {
if (this.radioState !== Ci.nsIMobileConnection.MOBILE_RADIO_STATE_ENABLED) {
this._dispatchNotifyError(aCallback, RIL.GECKO_ERROR_RADIO_NOT_AVAILABLE);
return;
}
@ -984,7 +984,7 @@ MobileConnectionProvider.prototype = {
return;
}
if (this.radioState !== RIL.GECKO_RADIOSTATE_ENABLED) {
if (this.radioState !== Ci.nsIMobileConnection.MOBILE_RADIO_STATE_ENABLED) {
this._dispatchNotifyError(aCallback, RIL.GECKO_ERROR_RADIO_NOT_AVAILABLE);
return;
}
@ -1003,7 +1003,7 @@ MobileConnectionProvider.prototype = {
},
getCallingLineIdRestriction: function(aCallback) {
if (this.radioState !== RIL.GECKO_RADIOSTATE_ENABLED) {
if (this.radioState !== Ci.nsIMobileConnection.MOBILE_RADIO_STATE_ENABLED) {
this._dispatchNotifyError(aCallback, RIL.GECKO_ERROR_RADIO_NOT_AVAILABLE);
return;
}

View File

@ -9,7 +9,7 @@
"@mozilla.org/mobileconnection/gonkmobileconnectionservice;1"
%}
[scriptable, uuid(2d574f0e-4a02-11e4-b1b3-cbc14b7608ce)]
[scriptable, uuid(7322619d-9abd-4410-99ce-207da80f9879)]
interface nsIGonkMobileConnectionService : nsIMobileConnectionService
{
void notifyNetworkInfoChanged(in unsigned long clientId, in jsval networkInfo);
@ -27,7 +27,7 @@ interface nsIGonkMobileConnectionService : nsIMobileConnectionService
void notifyOtaStatusChanged(in unsigned long clientId, in DOMString status);
void notifyRadioStateChanged(in unsigned long clientId,
in DOMString radioState);
in long radioState);
void notifyUssdReceived(in unsigned long clientId,
in DOMString message,

View File

@ -236,7 +236,7 @@ already_AddRefed<nsIMobileConnectionService>
NS_CreateMobileConnectionService();
%}
[scriptable, uuid(cfc7d15b-d2c2-4f28-ad9f-b250030c3073)]
[scriptable, uuid(99818dc7-e770-4249-87e2-2de0a928ed08)]
interface nsIMobileConnection : nsISupports
{
/*
@ -304,6 +304,15 @@ interface nsIMobileConnection : nsISupports
const long NETWORK_SELECTION_MODE_AUTOMATIC = 0;
const long NETWORK_SELECTION_MODE_MANUAL = 1;
/**
* Mobile Radio State.
*/
const long MOBILE_RADIO_STATE_UNKNOWN = -1;
const long MOBILE_RADIO_STATE_ENABLING = 0;
const long MOBILE_RADIO_STATE_ENABLED = 1;
const long MOBILE_RADIO_STATE_DISABLING = 2;
const long MOBILE_RADIO_STATE_DISABLED = 3;
readonly attribute unsigned long serviceId;
/**
@ -347,10 +356,10 @@ interface nsIMobileConnection : nsISupports
readonly attribute long networkSelectionMode;
/**
* Current radio state. Possible values are 'enabling', 'enabled',
* 'disabling', 'disabled', null (unknown).
* Current radio state. One of the nsIMobileConnection.MOBILE_RADIO_STATE_*
* values.
*/
readonly attribute DOMString radioState;
readonly attribute long radioState;
/**
* The network types supported by this radio.

View File

@ -106,9 +106,9 @@ MobileConnectionChild::GetIccId(nsAString& aIccId)
}
NS_IMETHODIMP
MobileConnectionChild::GetRadioState(nsAString& aRadioState)
MobileConnectionChild::GetRadioState(int32_t* aRadioState)
{
aRadioState = mRadioState;
*aRadioState = mRadioState;
return NS_OK;
}
@ -488,9 +488,9 @@ MobileConnectionChild::RecvNotifyIccChanged(const nsString& aIccId)
}
bool
MobileConnectionChild::RecvNotifyRadioStateChanged(const nsString& aRadioState)
MobileConnectionChild::RecvNotifyRadioStateChanged(const int32_t& aRadioState)
{
mRadioState.Assign(aRadioState);
mRadioState = aRadioState;
for (int32_t i = 0; i < mListeners.Count(); i++) {
mListeners[i]->NotifyRadioStateChanged();

View File

@ -92,7 +92,7 @@ protected:
RecvNotifyIccChanged(const nsString& aIccId) MOZ_OVERRIDE;
virtual bool
RecvNotifyRadioStateChanged(const nsString& aRadioState) MOZ_OVERRIDE;
RecvNotifyRadioStateChanged(const int32_t& aRadioState) MOZ_OVERRIDE;
virtual bool
RecvNotifyClirModeChanged(const uint32_t& aMode) MOZ_OVERRIDE;
@ -113,7 +113,7 @@ private:
nsRefPtr<MobileConnectionInfo> mVoice;
nsRefPtr<MobileConnectionInfo> mData;
nsString mIccId;
nsString mRadioState;
int32_t mRadioState;
nsString mLastNetwork;
nsString mLastHomeNetwork;
int32_t mNetworkSelectionMode;

View File

@ -130,7 +130,7 @@ MobileConnectionParent::RecvInit(nsMobileConnectionInfo* aVoice,
nsString* aLastKnownHomeNetwork,
nsString* aIccId,
int32_t* aNetworkSelectionMode,
nsString* aRadioState,
int32_t* aRadioState,
nsTArray<nsString>* aSupportedNetworkTypes)
{
NS_ENSURE_TRUE(mMobileConnection, false);
@ -141,7 +141,7 @@ MobileConnectionParent::RecvInit(nsMobileConnectionInfo* aVoice,
NS_ENSURE_SUCCESS(mMobileConnection->GetLastKnownHomeNetwork(*aLastKnownHomeNetwork), false);
NS_ENSURE_SUCCESS(mMobileConnection->GetIccId(*aIccId), false);
NS_ENSURE_SUCCESS(mMobileConnection->GetNetworkSelectionMode(aNetworkSelectionMode), false);
NS_ENSURE_SUCCESS(mMobileConnection->GetRadioState(*aRadioState), false);
NS_ENSURE_SUCCESS(mMobileConnection->GetRadioState(aRadioState), false);
char16_t** types = nullptr;
uint32_t length = 0;
@ -262,8 +262,8 @@ MobileConnectionParent::NotifyRadioStateChanged()
NS_ENSURE_TRUE(mLive, NS_ERROR_FAILURE);
nsresult rv;
nsAutoString radioState;
rv = mMobileConnection->GetRadioState(radioState);
int32_t radioState;
rv = mMobileConnection->GetRadioState(&radioState);
NS_ENSURE_SUCCESS(rv, rv);
return SendNotifyRadioStateChanged(radioState) ? NS_OK : NS_ERROR_FAILURE;

View File

@ -52,7 +52,7 @@ protected:
RecvInit(nsMobileConnectionInfo* aVoice, nsMobileConnectionInfo* aData,
nsString* aLastKnownNetwork, nsString* aLastKnownHomeNetwork,
nsString* aIccId, int32_t* aNetworkSelectionMode,
nsString* aRadioState, nsTArray<nsString>* aSupportedNetworkTypes) MOZ_OVERRIDE;
int32_t* aRadioState, nsTArray<nsString>* aSupportedNetworkTypes) MOZ_OVERRIDE;
private:
nsCOMPtr<nsIMobileConnection> mMobileConnection;

View File

@ -28,7 +28,7 @@ child:
NotifyEmergencyCbModeChanged(bool aActive, uint32_t aTimeoutMs);
NotifyOtaStatusChanged(nsString aStatus);
NotifyIccChanged(nsString aIccId);
NotifyRadioStateChanged(nsString aRadioState);
NotifyRadioStateChanged(int32_t aRadioState);
NotifyClirModeChanged(uint32_t aMode);
NotifyLastNetworkChanged(nsString aNetwork);
NotifyLastHomeNetworkChanged(nsString aNetwork);
@ -52,7 +52,7 @@ parent:
returns (nsMobileConnectionInfo aVoice, nsMobileConnectionInfo aData,
nsString aLastKnownNetwork, nsString aLastKnownHomeNetwork,
nsString aIccId, int32_t aNetworkSelectionMode,
nsString aRadioState, nsString[] aSupportedNetworkTypes);
int32_t aRadioState, nsString[] aSupportedNetworkTypes);
};
/**

View File

@ -504,13 +504,15 @@ XPCOMUtils.defineLazyGetter(this, "gRadioEnabledController", function() {
},
_isValidStateForSetRadioEnabled: function(radioState) {
return radioState == RIL.GECKO_RADIOSTATE_ENABLED ||
radioState == RIL.GECKO_RADIOSTATE_DISABLED;
return radioState == Ci.nsIMobileConnection.MOBILE_RADIO_STATE_ENABLED ||
radioState == Ci.nsIMobileConnection.MOBILE_RADIO_STATE_DISABLED;
},
_isDummyForSetRadioEnabled: function(radioState, data) {
return (radioState == RIL.GECKO_RADIOSTATE_ENABLED && data.enabled) ||
(radioState == RIL.GECKO_RADIOSTATE_DISABLED && !data.enabled);
return (radioState == Ci.nsIMobileConnection.MOBILE_RADIO_STATE_ENABLED &&
data.enabled) ||
(radioState == Ci.nsIMobileConnection.MOBILE_RADIO_STATE_DISABLED &&
!data.enabled);
},
_handleMessage: function(message) {
@ -573,15 +575,15 @@ XPCOMUtils.defineLazyGetter(this, "gRadioEnabledController", function() {
let radioInterface = _ril.getRadioInterface(clientId);
this.notifyRadioStateChanged(clientId,
enabled ? RIL.GECKO_RADIOSTATE_ENABLING
: RIL.GECKO_RADIOSTATE_DISABLING);
enabled ? Ci.nsIMobileConnection.MOBILE_RADIO_STATE_ENABLING
: Ci.nsIMobileConnection.MOBILE_RADIO_STATE_DISABLING);
radioInterface.workerMessenger.send("setRadioEnabled", message.data,
(function(response) {
if (response.errorMsg) {
// Request fails. Rollback to the original radioState.
this.notifyRadioStateChanged(clientId,
enabled ? RIL.GECKO_RADIOSTATE_DISABLED
: RIL.GECKO_RADIOSTATE_ENABLED);
enabled ? Ci.nsIMobileConnection.MOBILE_RADIO_STATE_DISABLED
: Ci.nsIMobileConnection.MOBILE_RADIO_STATE_ENABLED);
}
message.callback(response);
return false;
@ -1197,7 +1199,7 @@ DataConnectionHandler.prototype = {
// This check avoids data call connection if the radio is not ready
// yet after toggling off airplane mode.
let radioState = connection && connection.radioState;
if (radioState != RIL.GECKO_RADIOSTATE_ENABLED) {
if (radioState != Ci.nsIMobileConnection.MOBILE_RADIO_STATE_ENABLED) {
if (DEBUG) {
this.debug("RIL is not ready for data connection: radio's not ready");
}
@ -3525,8 +3527,8 @@ RadioInterface.prototype = {
if (DEBUG) this.debug("Error! Address is invalid when sending SMS: " +
options.number);
errorCode = Ci.nsIMobileMessageCallback.INVALID_ADDRESS_ERROR;
} else if (radioState == null ||
radioState == RIL.GECKO_RADIOSTATE_DISABLED) {
} else if (radioState == Ci.nsIMobileConnection.MOBILE_RADIO_STATE_UNKNOWN ||
radioState == Ci.nsIMobileConnection.MOBILE_RADIO_STATE_DISABLED) {
if (DEBUG) this.debug("Error! Radio is disabled when sending SMS.");
errorCode = Ci.nsIMobileMessageCallback.RADIO_DISABLED_ERROR;
} else if (this.rilContext.cardState != Ci.nsIIccProvider.CARD_STATE_READY) {

View File

@ -2490,12 +2490,12 @@ this.CALL_FAIL_IMSI_UNKNOWN_IN_VLR = 242;
this.CALL_FAIL_IMEI_NOT_ACCEPTED = 243;
this.CALL_FAIL_ERROR_UNSPECIFIED = 0xffff;
// Other Gecko-specific constants
this.GECKO_RADIOSTATE_UNKNOWN = null;
this.GECKO_RADIOSTATE_ENABLING = "enabling";
this.GECKO_RADIOSTATE_ENABLED = "enabled";
this.GECKO_RADIOSTATE_DISABLING = "disabling";
this.GECKO_RADIOSTATE_DISABLED = "disabled";
// See nsIMobileConnection::MOBILE_RADIO_STATE_*
this.GECKO_RADIOSTATE_UNKNOWN = -1;
this.GECKO_RADIOSTATE_ENABLING = 0;
this.GECKO_RADIOSTATE_ENABLED = 1;
this.GECKO_RADIOSTATE_DISABLING = 2;
this.GECKO_RADIOSTATE_DISABLED = 3;
// Only used in ril_worker.js
this.GECKO_CARDSTATE_UNINITIALIZED = 4294967294; // UINT32_MAX - 1

View File

@ -1301,8 +1301,6 @@ var interfaceNamesInGlobalScope =
"XPathEvaluator",
// IMPORTANT: Do not change this list without review from a DOM peer!
"XPathExpression",
// IMPORTANT: Do not change this list without review from a DOM peer!
"XPathNSResolver",
// IMPORTANT: Do not change this list without review from a DOM peer!
"XPathResult",
// IMPORTANT: Do not change this list without review from a DOM peer!

View File

@ -44,11 +44,13 @@ var mgmtProps = {
uninstall: "function",
oninstall: "object",
onuninstall: "object",
onenabledstatechange: "object",
ownerGlobal: "object",
removeEventListener: "function",
setEventHandler: "function",
extractManifest: "function",
import: "function"
import: "function",
setEnabled: "function"
};
isDeeply([p for (p in navigator.mozApps.mgmt)].sort(),

View File

@ -32,6 +32,7 @@ interface DOMApplication : EventTarget {
readonly attribute DOMString installOrigin;
readonly attribute DOMTimeStamp installTime;
readonly attribute boolean removable;
readonly attribute boolean enabled;
[Cached, Pure]
readonly attribute sequence<DOMString> receipts;
@ -96,6 +97,9 @@ interface DOMApplicationsManager : EventTarget {
Promise<DOMApplication> import(Blob blob);
Promise<any> extractManifest(Blob blob);
void setEnabled(DOMApplication app, boolean state);
attribute EventHandler oninstall;
attribute EventHandler onuninstall;
attribute EventHandler onenabledstatechange;
};

View File

@ -4,16 +4,14 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
interface XPathNSResolver;
[Constructor]
interface XPathEvaluator {
// Based on nsIDOMXPathEvaluator
[NewObject, Throws]
XPathExpression createExpression(DOMString expression,
XPathNSResolver? resolver);
[NewObject, Throws]
XPathNSResolver createNSResolver(Node? nodeResolver);
[Pure]
Node createNSResolver(Node nodeResolver);
[Throws]
XPathResult evaluate(DOMString expression, Node? contextNode,
XPathNSResolver? resolver, unsigned short type,

View File

@ -0,0 +1,10 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
callback interface XPathNSResolver
{
DOMString? lookupNamespaceURI(DOMString? prefix);
};

View File

@ -537,6 +537,7 @@ WEBIDL_FILES = [
'XMLStylesheetProcessingInstruction.webidl',
'XPathEvaluator.webidl',
'XPathExpression.webidl',
'XPathNSResolver.webidl',
'XPathResult.webidl',
'XSLTProcessor.webidl',
'XULCommandEvent.webidl',

View File

@ -8,7 +8,6 @@
#include "nsCOMPtr.h"
#include "nsIAtom.h"
#include "mozilla/dom/XPathExpression.h"
#include "nsXPathNSResolver.h"
#include "XPathResult.h"
#include "nsContentCID.h"
#include "txExpr.h"
@ -23,6 +22,7 @@
#include "txIXPathContext.h"
#include "mozilla/dom/XPathEvaluatorBinding.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/XPathNSResolverBinding.h"
extern nsresult
TX_ResolveFunctionCallXPCOM(const nsCString &aContractID, int32_t aNamespaceID,
@ -36,9 +36,18 @@ namespace dom {
class XPathEvaluatorParseContext : public txIParseContext
{
public:
XPathEvaluatorParseContext(nsIDOMXPathNSResolver* aResolver,
XPathEvaluatorParseContext(XPathNSResolver* aResolver,
bool aIsCaseSensitive)
: mResolver(aResolver),
mResolverNode(nullptr),
mLastError(NS_OK),
mIsCaseSensitive(aIsCaseSensitive)
{
}
XPathEvaluatorParseContext(nsINode* aResolver,
bool aIsCaseSensitive)
: mResolver(nullptr),
mResolverNode(aResolver),
mLastError(NS_OK),
mIsCaseSensitive(aIsCaseSensitive)
{
@ -56,7 +65,8 @@ public:
void SetErrorOffset(uint32_t aOffset);
private:
nsIDOMXPathNSResolver* mResolver;
XPathNSResolver* mResolver;
nsINode* mResolverNode;
nsresult mLastError;
bool mIsCaseSensitive;
};
@ -72,32 +82,18 @@ XPathEvaluator::~XPathEvaluator()
{
}
NS_IMETHODIMP
XPathEvaluator::CreateNSResolver(nsIDOMNode *aNodeResolver,
nsIDOMXPathNSResolver **aResult)
{
NS_ENSURE_ARG(aNodeResolver);
if (!nsContentUtils::CanCallerAccess(aNodeResolver))
return NS_ERROR_DOM_SECURITY_ERR;
*aResult = new nsXPathNSResolver(aNodeResolver);
NS_ENSURE_TRUE(*aResult, NS_ERROR_OUT_OF_MEMORY);
NS_ADDREF(*aResult);
return NS_OK;
}
NS_IMETHODIMP
XPathEvaluator::Evaluate(const nsAString & aExpression,
nsIDOMNode *aContextNode,
nsIDOMXPathNSResolver *aResolver,
nsIDOMNode *aResolver,
uint16_t aType,
nsISupports *aInResult,
nsISupports **aResult)
{
nsCOMPtr<nsINode> resolver = do_QueryInterface(aResolver);
ErrorResult rv;
nsAutoPtr<XPathExpression> expression(CreateExpression(aExpression,
aResolver, rv));
resolver, rv));
if (rv.Failed()) {
return rv.ErrorCode();
}
@ -120,21 +116,36 @@ XPathEvaluator::Evaluate(const nsAString & aExpression,
return NS_OK;
}
XPathExpression*
XPathEvaluator::CreateExpression(const nsAString& aExpression,
XPathNSResolver* aResolver, ErrorResult& aRv)
{
nsCOMPtr<nsIDocument> doc = do_QueryReferent(mDocument);
XPathEvaluatorParseContext pContext(aResolver, !(doc && doc->IsHTML()));
return CreateExpression(aExpression, &pContext, doc, aRv);
}
XPathExpression*
XPathEvaluator::CreateExpression(const nsAString& aExpression,
nsINode* aResolver, ErrorResult& aRv)
{
nsCOMPtr<nsIDocument> doc = do_QueryReferent(mDocument);
XPathEvaluatorParseContext pContext(aResolver, !(doc && doc->IsHTML()));
return CreateExpression(aExpression, &pContext, doc, aRv);
}
XPathExpression*
XPathEvaluator::CreateExpression(const nsAString & aExpression,
nsIDOMXPathNSResolver *aResolver,
txIParseContext* aContext,
nsIDocument* aDocument,
ErrorResult& aRv)
{
if (!mRecycler) {
mRecycler = new txResultRecycler;
}
nsCOMPtr<nsIDocument> doc = do_QueryReferent(mDocument);
XPathEvaluatorParseContext pContext(aResolver, !(doc && doc->IsHTML()));
nsAutoPtr<Expr> expression;
aRv = txExprParser::createExpr(PromiseFlatString(aExpression), &pContext,
aRv = txExprParser::createExpr(PromiseFlatString(aExpression), aContext,
getter_Transfers(expression));
if (aRv.Failed()) {
if (aRv.ErrorCode() != NS_ERROR_DOM_NAMESPACE_ERR) {
@ -144,7 +155,7 @@ XPathEvaluator::CreateExpression(const nsAString & aExpression,
return nullptr;
}
return new XPathExpression(Move(expression), mRecycler, doc);
return new XPathExpression(Move(expression), mRecycler, aDocument);
}
JSObject*
@ -162,34 +173,24 @@ XPathEvaluator::Constructor(const GlobalObject& aGlobal,
return newObj.forget();
}
already_AddRefed<nsIDOMXPathNSResolver>
XPathEvaluator::CreateNSResolver(nsINode* aNodeResolver,
ErrorResult& rv)
{
nsCOMPtr<nsIDOMNode> nodeResolver = do_QueryInterface(aNodeResolver);
nsCOMPtr<nsIDOMXPathNSResolver> res;
rv = CreateNSResolver(nodeResolver, getter_AddRefs(res));
return res.forget();
}
already_AddRefed<XPathResult>
XPathEvaluator::Evaluate(JSContext* aCx, const nsAString& aExpression,
nsINode* aContextNode,
nsIDOMXPathNSResolver* aResolver, uint16_t aType,
XPathNSResolver* aResolver, uint16_t aType,
JS::Handle<JSObject*> aResult, ErrorResult& rv)
{
nsCOMPtr<nsIDOMNode> contextNode = do_QueryInterface(aContextNode);
nsCOMPtr<nsISupports> res;
rv = Evaluate(aExpression, contextNode, aResolver, aType,
aResult ? UnwrapDOMObjectToISupports(aResult) : nullptr,
getter_AddRefs(res));
return res.forget().downcast<nsIXPathResult>().downcast<XPathResult>();
nsAutoPtr<XPathExpression> expression(CreateExpression(aExpression,
aResolver, rv));
if (rv.Failed()) {
return nullptr;
}
return expression->Evaluate(aCx, *aContextNode, aType, aResult, rv);
}
/*
* Implementation of txIParseContext private to XPathEvaluator, based on a
* nsIDOMXPathNSResolver
* XPathNSResolver
*/
nsresult XPathEvaluatorParseContext::resolveNamespacePrefix
@ -197,7 +198,7 @@ nsresult XPathEvaluatorParseContext::resolveNamespacePrefix
{
aID = kNameSpaceID_Unknown;
if (!mResolver) {
if (!mResolver && !mResolverNode) {
return NS_ERROR_DOM_NAMESPACE_ERR;
}
@ -207,8 +208,19 @@ nsresult XPathEvaluatorParseContext::resolveNamespacePrefix
}
nsVoidableString ns;
nsresult rv = mResolver->LookupNamespaceURI(prefix, ns);
NS_ENSURE_SUCCESS(rv, rv);
if (mResolver) {
ErrorResult rv;
mResolver->LookupNamespaceURI(prefix, ns, rv);
if (rv.Failed()) {
return rv.ErrorCode();
}
} else {
if (aPrefix == nsGkAtoms::xml) {
ns.AssignLiteral("http://www.w3.org/XML/1998/namespace");
} else {
mResolverNode->LookupNamespaceURI(prefix, ns);
}
}
if (DOMStringIsNull(ns)) {
return NS_ERROR_DOM_NAMESPACE_ERR;

View File

@ -15,6 +15,7 @@
#include "nsIDocument.h"
class nsINode;
class txIParseContext;
class txResultRecycler;
namespace mozilla {
@ -22,6 +23,7 @@ namespace dom {
class GlobalObject;
class XPathExpression;
class XPathNSResolver;
class XPathResult;
/**
@ -50,16 +52,28 @@ public:
Constructor(const GlobalObject& aGlobal, ErrorResult& rv);
XPathExpression*
CreateExpression(const nsAString& aExpression,
nsIDOMXPathNSResolver* aResolver,
XPathNSResolver* aResolver,
ErrorResult& rv);
already_AddRefed<nsIDOMXPathNSResolver>
CreateNSResolver(nsINode* aNodeResolver, ErrorResult& rv);
XPathExpression*
CreateExpression(const nsAString& aExpression,
nsINode* aResolver,
ErrorResult& aRv);
nsINode* CreateNSResolver(nsINode& aNodeResolver)
{
return &aNodeResolver;
}
already_AddRefed<XPathResult>
Evaluate(JSContext* aCx, const nsAString& aExpression,
nsINode* aContextNode, nsIDOMXPathNSResolver* aResolver,
nsINode* aContextNode, XPathNSResolver* aResolver,
uint16_t aType, JS::Handle<JSObject*> aResult,
ErrorResult& rv);
private:
XPathExpression*
CreateExpression(const nsAString& aExpression,
txIParseContext* aContext,
nsIDocument* aDocument,
ErrorResult& aRv);
nsWeakPtr mDocument;
nsRefPtr<txResultRecycler> mRecycler;
};

View File

@ -11,7 +11,6 @@ EXPORTS.mozilla.dom += [
]
UNIFIED_SOURCES += [
'nsXPathNSResolver.cpp',
'txBooleanExpr.cpp',
'txBooleanResult.cpp',
'txCoreFunctionCall.cpp',

View File

@ -1,44 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsXPathNSResolver.h"
#include "nsDOMClassInfoID.h"
#include "nsDOMString.h"
NS_IMPL_CYCLE_COLLECTION(nsXPathNSResolver, mNode)
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsXPathNSResolver)
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsXPathNSResolver)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsXPathNSResolver)
NS_INTERFACE_MAP_ENTRY(nsIDOMXPathNSResolver)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMXPathNSResolver)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(XPathNSResolver)
NS_INTERFACE_MAP_END
nsXPathNSResolver::nsXPathNSResolver(nsIDOMNode* aNode)
: mNode(aNode)
{
NS_ASSERTION(mNode, "Need a node to resolve namespaces.");
}
NS_IMETHODIMP
nsXPathNSResolver::LookupNamespaceURI(const nsAString & aPrefix,
nsAString & aResult)
{
if (aPrefix.EqualsLiteral("xml")) {
aResult.AssignLiteral("http://www.w3.org/XML/1998/namespace");
return NS_OK;
}
if (!mNode) {
SetDOMStringToNull(aResult);
return NS_OK;
}
return mNode->LookupNamespaceURI(aPrefix, aResult);
}

View File

@ -1,36 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsXPathNSResolver_h__
#define nsXPathNSResolver_h__
#include "nsIDOMXPathNSResolver.h"
#include "nsIDOMNode.h"
#include "nsCOMPtr.h"
#include "nsCycleCollectionParticipant.h"
#include "mozilla/Attributes.h"
/**
* A class for evaluating an XPath expression string
*/
class nsXPathNSResolver MOZ_FINAL : public nsIDOMXPathNSResolver
{
~nsXPathNSResolver() {}
public:
explicit nsXPathNSResolver(nsIDOMNode* aNode);
// nsISupports interface
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(nsXPathNSResolver)
// nsIDOMXPathNSResolver interface
NS_DECL_NSIDOMXPATHNSRESOLVER
private:
nsCOMPtr<nsIDOMNode> mNode;
};
#endif

View File

@ -146,6 +146,16 @@ GFX2D_API void AppendRoundedRectToPath(PathBuilder* aPathBuilder,
const Size(& aCornerRadii)[4],
bool aDrawClockwise = true);
inline TemporaryRef<Path> MakePathForRoundedRect(const DrawTarget& aDrawTarget,
const Rect& aRect,
const Size(& aCornerRadii)[4],
bool aDrawClockwise = true)
{
RefPtr<PathBuilder> builder = aDrawTarget.CreatePathBuilder();
AppendRoundedRectToPath(builder, aRect, aCornerRadii, aDrawClockwise);
return builder->Finish();
}
/**
* Appends a path represending an ellipse to the path being built by
* aPathBuilder.
@ -157,6 +167,15 @@ GFX2D_API void AppendEllipseToPath(PathBuilder* aPathBuilder,
const Point& aCenter,
const Size& aDimensions);
inline TemporaryRef<Path> MakePathForEllipse(const DrawTarget& aDrawTarget,
const Point& aCenter,
const Size& aDimensions)
{
RefPtr<PathBuilder> builder = aDrawTarget.CreatePathBuilder();
AppendEllipseToPath(builder, aCenter, aDimensions);
return builder->Finish();
}
/**
* If aDrawTarget's transform only contains a translation, and if this line is
* a horizontal or vertical line, this function will snap the line's vertices

View File

@ -97,7 +97,6 @@ private:
class CompositorVsyncObserver MOZ_FINAL : public VsyncObserver
{
NS_INLINE_DECL_THREADSAFE_REFCOUNTING_WITH_MAIN_THREAD_DESTRUCTION(CompositorVsyncObserver)
friend class CompositorParent;
public:

View File

@ -24,7 +24,8 @@
// size the cluster buffer array in FindSafeLength
#define MAX_GFX_TEXT_BUF_SIZE 8000
static int32_t FindSafeLength(const char16_t *aString, uint32_t aLength,
/*static*/ int32_t
nsRenderingContext::FindSafeLength(const char16_t *aString, uint32_t aLength,
uint32_t aMaxChunkLength)
{
if (aLength <= aMaxChunkLength)
@ -47,13 +48,6 @@ static int32_t FindSafeLength(const char16_t *aString, uint32_t aLength,
return len;
}
static int32_t FindSafeLength(const char *aString, uint32_t aLength,
uint32_t aMaxChunkLength)
{
// Since it's ASCII, we don't need to worry about clusters or RTL
return std::min(aLength, aMaxChunkLength);
}
//////////////////////////////////////////////////////////////////////
//// nsRenderingContext
@ -90,21 +84,9 @@ nsRenderingContext::SetFont(nsFontMetrics *aFontMetrics)
int32_t
nsRenderingContext::GetMaxChunkLength()
{
if (!mFontMetrics)
return 1;
return std::min(mFontMetrics->GetMaxStringLength(), MAX_GFX_TEXT_BUF_SIZE);
}
nscoord
nsRenderingContext::GetWidth(char aC)
{
if (aC == ' ' && mFontMetrics) {
return mFontMetrics->SpaceWidth();
}
return GetWidth(&aC, 1);
}
nscoord
nsRenderingContext::GetWidth(char16_t aC)
{
@ -117,26 +99,6 @@ nsRenderingContext::GetWidth(const nsString& aString)
return GetWidth(aString.get(), aString.Length());
}
nscoord
nsRenderingContext::GetWidth(const char* aString)
{
return GetWidth(aString, strlen(aString));
}
nscoord
nsRenderingContext::GetWidth(const char* aString, uint32_t aLength)
{
uint32_t maxChunkLength = GetMaxChunkLength();
nscoord width = 0;
while (aLength > 0) {
int32_t len = FindSafeLength(aString, aLength, maxChunkLength);
width += mFontMetrics->GetWidth(aString, len, this);
aLength -= len;
aString += len;
}
return width;
}
nscoord
nsRenderingContext::GetWidth(const char16_t *aString, uint32_t aLength)
{
@ -175,59 +137,3 @@ nsRenderingContext::GetBoundingMetrics(const char16_t* aString,
}
return totalMetrics;
}
void
nsRenderingContext::DrawString(const char *aString, uint32_t aLength,
nscoord aX, nscoord aY)
{
uint32_t maxChunkLength = GetMaxChunkLength();
while (aLength > 0) {
int32_t len = FindSafeLength(aString, aLength, maxChunkLength);
mFontMetrics->DrawString(aString, len, aX, aY, this);
aLength -= len;
if (aLength > 0) {
nscoord width = mFontMetrics->GetWidth(aString, len, this);
aX += width;
aString += len;
}
}
}
void
nsRenderingContext::DrawString(const nsString& aString, nscoord aX, nscoord aY)
{
DrawString(aString.get(), aString.Length(), aX, aY);
}
void
nsRenderingContext::DrawString(const char16_t *aString, uint32_t aLength,
nscoord aX, nscoord aY)
{
uint32_t maxChunkLength = GetMaxChunkLength();
if (aLength <= maxChunkLength) {
mFontMetrics->DrawString(aString, aLength, aX, aY, this, this);
return;
}
bool isRTL = mFontMetrics->GetTextRunRTL();
// If we're drawing right to left, we must start at the end.
if (isRTL) {
aX += GetWidth(aString, aLength);
}
while (aLength > 0) {
int32_t len = FindSafeLength(aString, aLength, maxChunkLength);
nscoord width = mFontMetrics->GetWidth(aString, len, this);
if (isRTL) {
aX -= width;
}
mFontMetrics->DrawString(aString, len, aX, aY, this, this);
if (!isRTL) {
aX += width;
}
aLength -= len;
aString += len;
}
}

View File

@ -47,30 +47,22 @@ public:
void SetTextRunRTL(bool aIsRTL);
nscoord GetWidth(char aC);
nscoord GetWidth(char16_t aC);
nscoord GetWidth(const nsString& aString);
nscoord GetWidth(const char* aString);
nscoord GetWidth(const char* aString, uint32_t aLength);
nscoord GetWidth(const char16_t *aString, uint32_t aLength);
nsBoundingMetrics GetBoundingMetrics(const char16_t *aString,
uint32_t aLength);
void DrawString(const nsString& aString, nscoord aX, nscoord aY);
void DrawString(const char *aString, uint32_t aLength,
nscoord aX, nscoord aY);
void DrawString(const char16_t *aString, uint32_t aLength,
nscoord aX, nscoord aY);
int32_t GetMaxChunkLength();
static int32_t FindSafeLength(const char16_t *aString, uint32_t aLength,
uint32_t aMaxChunkLength);
private:
// Private destructor, to discourage deletion outside of Release():
~nsRenderingContext()
{
}
int32_t GetMaxChunkLength();
nsRefPtr<gfxContext> mThebes;
nsRefPtr<nsFontMetrics> mFontMetrics;
};

View File

@ -549,28 +549,6 @@ gfxContext::UserToDevicePixelSnapped(gfxPoint& pt, bool ignoreScale) const
return true;
}
void
gfxContext::PixelSnappedRectangleAndSetPattern(const gfxRect& rect,
gfxPattern *pattern)
{
gfxRect r(rect);
// Bob attempts to pixel-snap the rectangle, and returns true if
// the snapping succeeds. If it does, we need to set up an
// identity matrix, because the rectangle given back is in device
// coordinates.
//
// We then have to call a translate to dr.pos afterwards, to make
// sure the image lines up in the right place with our pixel
// snapped rectangle.
//
// If snapping wasn't successful, we just translate to where the
// pattern would normally start (in app coordinates) and do the
// same thing.
Rectangle(r, true);
SetPattern(pattern);
}
void
gfxContext::SetAntialiasMode(AntialiasMode mode)
{

View File

@ -308,15 +308,6 @@ public:
*/
bool UserToDevicePixelSnapped(gfxPoint& pt, bool ignoreScale = false) const;
/**
* Attempts to pixel snap the rectangle, add it to the current
* path, and to set pattern as the current painting source. This
* should be used for drawing filled pixel-snapped rectangles (like
* images), because the CTM at the time of the SetPattern call needs
* to have a snapped translation, or you get smeared images.
*/
void PixelSnappedRectangleAndSetPattern(const gfxRect& rect, gfxPattern *pattern);
/**
** Painting sources
**/

View File

@ -4,18 +4,16 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "gfxQuartzNativeDrawing.h"
#include "gfxQuartzSurface.h"
#include "gfxPlatform.h"
#include "cairo-quartz.h"
#include "gfx2DGlue.h"
#include "mozilla/gfx/Helpers.h"
using namespace mozilla::gfx;
using namespace mozilla;
gfxQuartzNativeDrawing::gfxQuartzNativeDrawing(gfxContext* ctx,
const gfxRect& nativeRect)
: mContext(ctx)
, mNativeRect(ToRect(nativeRect))
gfxQuartzNativeDrawing::gfxQuartzNativeDrawing(DrawTarget& aDrawTarget,
const Rect& nativeRect)
: mDrawTarget(&aDrawTarget)
, mNativeRect(nativeRect)
, mCGContext(nullptr)
{
}
@ -25,32 +23,32 @@ gfxQuartzNativeDrawing::BeginNativeDrawing()
{
NS_ASSERTION(!mCGContext, "BeginNativeDrawing called when drawing already in progress");
DrawTarget *dt = mContext->GetDrawTarget();
DrawTarget *dt = mDrawTarget;
if (dt->GetBackendType() != BackendType::COREGRAPHICS ||
dt->IsDualDrawTarget() ||
dt->IsTiledDrawTarget()) {
// We need a DrawTarget that we can get a CGContextRef from:
Matrix transform = dt->GetTransform();
mNativeRect = transform.TransformBounds(mNativeRect);
mNativeRect.RoundOut();
// Quartz theme drawing often adjusts drawing rects, so make
// sure our surface is big enough for that.
mNativeRect.Inflate(5);
if (mNativeRect.IsEmpty()) {
return nullptr;
}
mDrawTarget = Factory::CreateDrawTarget(BackendType::COREGRAPHICS,
IntSize(mNativeRect.width, mNativeRect.height),
SurfaceFormat::B8G8R8A8);
mTempDrawTarget =
Factory::CreateDrawTarget(BackendType::COREGRAPHICS,
IntSize(mNativeRect.width, mNativeRect.height),
SurfaceFormat::B8G8R8A8);
transform.PostTranslate(-mNativeRect.x, -mNativeRect.y);
mTempDrawTarget->SetTransform(transform);
mDrawTarget->SetTransform(transform);
dt = mDrawTarget;
dt = mTempDrawTarget;
}
mCGContext = mBorrowedContext.Init(dt);
MOZ_ASSERT(mCGContext);
return mCGContext;
@ -62,18 +60,12 @@ gfxQuartzNativeDrawing::EndNativeDrawing()
NS_ASSERTION(mCGContext, "EndNativeDrawing called without BeginNativeDrawing");
mBorrowedContext.Finish();
if (mDrawTarget) {
DrawTarget *dest = mContext->GetDrawTarget();
RefPtr<SourceSurface> source = mDrawTarget->Snapshot();
if (mTempDrawTarget) {
RefPtr<SourceSurface> source = mTempDrawTarget->Snapshot();
Matrix oldTransform = dest->GetTransform();
dest->SetTransform(Matrix());
dest->DrawSurface(source,
mNativeRect,
gfx::Rect(0, 0, mNativeRect.width, mNativeRect.height));
dest->SetTransform(oldTransform);
AutoRestoreTransform autoRestore(mDrawTarget);
mDrawTarget->SetTransform(Matrix());
mDrawTarget->DrawSurface(source, mNativeRect,
Rect(0, 0, mNativeRect.width, mNativeRect.height));
}
}

View File

@ -8,12 +8,13 @@
#include "mozilla/Attributes.h"
#include "gfxContext.h"
#include "gfxQuartzSurface.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/gfx/BorrowedContext.h"
#include "nsAutoPtr.h"
#include "mozilla/RefPtr.h"
class gfxQuartzNativeDrawing {
typedef mozilla::gfx::DrawTarget DrawTarget;
typedef mozilla::gfx::Rect Rect;
public:
/* Create native Quartz drawing for a rectangle bounded by
@ -33,16 +34,16 @@ public:
* aNativeRect is the size of the surface (in Quartz/Cocoa points) that
* will be created _if_ the gfxQuartzNativeDrawing decides to create a new
* surface and CGContext for its drawing operations, which it then
* composites into the target gfxContext.
* composites into the target DrawTarget.
*
* (Note that aNativeRect will be ignored if the gfxQuartzNativeDrawing
* uses the target gfxContext directly.)
* uses the target DrawTarget directly.)
*
* The optional aBackingScale parameter is a scaling factor that will be
* applied when creating and rendering into such a temporary surface.
*/
gfxQuartzNativeDrawing(gfxContext *ctx,
const gfxRect& aNativeRect);
gfxQuartzNativeDrawing(DrawTarget& aDrawTarget,
const Rect& aNativeRect);
/* Returns a CGContextRef which may be used for native drawing. This
* CGContextRef is valid until EndNativeDrawing is called; if it is used
@ -58,8 +59,8 @@ private:
const gfxQuartzNativeDrawing& operator=(const gfxQuartzNativeDrawing&) MOZ_DELETE;
// Final destination context
nsRefPtr<gfxContext> mContext;
mozilla::RefPtr<mozilla::gfx::DrawTarget> mDrawTarget;
mozilla::RefPtr<DrawTarget> mDrawTarget;
mozilla::RefPtr<DrawTarget> mTempDrawTarget;
mozilla::gfx::BorrowedCGContext mBorrowedContext;
mozilla::gfx::Rect mNativeRect;

View File

@ -1347,6 +1347,7 @@ ParentImpl::CloneToplevel(const InfallibleTArray<ProtocolFdMapping>& aFds,
{
AssertIsInMainProcess();
AssertIsOnMainThread();
MOZ_ASSERT(aCtx->GetContentParent());
const ProtocolId protocolId = GetProtocolId();
@ -1363,7 +1364,7 @@ ParentImpl::CloneToplevel(const InfallibleTArray<ProtocolFdMapping>& aFds,
}
PBackgroundParent* clonedActor =
Alloc(mContent, transport, base::GetProcId(aPeerProcess));
Alloc(aCtx->GetContentParent(), transport, base::GetProcId(aPeerProcess));
MOZ_ASSERT(clonedActor);
clonedActor->CloneManagees(this, aCtx);

View File

@ -134,7 +134,9 @@ check-style::
check-jit-test::
$(JITTEST_ASAN_ENV) $(wildcard $(RUN_TEST_PROGRAM)) $(PYTHON) -u $(srcdir)/jit-test/jit_test.py \
--no-slow --no-progress --tinderbox --tbpl $(JITTEST_VALGRIND_FLAG) \
--no-slow --no-progress --tinderbox --tbpl \
$(JITTEST_VALGRIND_FLAG) \
$(JITTEST_EXTRA_ARGS) \
$(DIST)/bin/$(JS_SHELL_NAME)$(BIN_SUFFIX)
check:: check-style

View File

@ -116,6 +116,9 @@ elif [[ "$VARIANT" = "generational" ]]; then
# Generational is currently being used for compacting GC
export JS_GC_ZEAL=14
# Ignore timeouts from tests that are known to take too long with this zeal mode
export JITTEST_EXTRA_ARGS=--ignore-timeouts=$ABSDIR/cgc-jittest-timeouts.txt
# rootanalysis builds are currently only done on Linux, which should have
# setarch, but just in case we enable them on another platform:
if type setarch >/dev/null 2>&1; then
@ -125,5 +128,7 @@ fi
$COMMAND_PREFIX $MAKE check || exit 1
$COMMAND_PREFIX $MAKE check-jit-test || exit 1
$COMMAND_PREFIX $MAKE check-jstests || exit 1
if [[ "$VARIANT" != "generational" ]]; then
$COMMAND_PREFIX $MAKE check-jstests || exit 1
fi
$COMMAND_PREFIX $OBJDIR/dist/bin/jsapi-tests || exit 1

View File

@ -0,0 +1,15 @@
auto-regress/bug653395.js
auto-regress/bug675251.js
basic/bug632964-regexp.js
basic/testBug614653.js
basic/testBug686274.js
basic/testTypedArrayInit.js
gc/bug-1014972.js
gc/bug-906236.js
gc/bug-906241.js
parallel/alloc-many-objs.js
parallel/alloc-too-many-objs.js
self-test/assertDeepEq.js
v8-v5/check-splay.js
baseline/bug847446.js
baseline/bug852175.js

View File

@ -161,7 +161,7 @@ class Symbol;
namespace js {
class NativeObject;
class AccessorShape;
class ArrayObject;
class ArgumentsObject;
class ArrayBufferObjectMaybeShared;
@ -173,6 +173,7 @@ class BaseShape;
class DebugScopeObject;
class GlobalObject;
class LazyScript;
class NativeObject;
class NestedScopeObject;
class Nursery;
class PropertyName;
@ -226,6 +227,7 @@ template <> struct MapTypeToTraceKind<PropertyName> { static const JSGCTrace
template <> struct MapTypeToTraceKind<SavedFrame> { static const JSGCTraceKind kind = JSTRACE_OBJECT; };
template <> struct MapTypeToTraceKind<ScopeObject> { static const JSGCTraceKind kind = JSTRACE_OBJECT; };
template <> struct MapTypeToTraceKind<Shape> { static const JSGCTraceKind kind = JSTRACE_SHAPE; };
template <> struct MapTypeToTraceKind<AccessorShape> { static const JSGCTraceKind kind = JSTRACE_SHAPE; };
template <> struct MapTypeToTraceKind<SharedArrayBufferObject>{ static const JSGCTraceKind kind = JSTRACE_OBJECT; };
template <> struct MapTypeToTraceKind<SharedTypedArrayObject>{ static const JSGCTraceKind kind = JSTRACE_OBJECT; };
template <> struct MapTypeToTraceKind<UnownedBaseShape> { static const JSGCTraceKind kind = JSTRACE_BASE_SHAPE; };

View File

@ -512,6 +512,7 @@ class GCRuntime
void assertBackgroundSweepingFinished();
bool shouldCompact();
#ifdef JSGC_COMPACTING
void sweepTypesAfterCompacting(Zone *zone);
void sweepZoneAfterCompacting(Zone *zone);
void compactPhase();
ArenaHeader *relocateArenas();

Some files were not shown because too many files have changed in this diff Show More