зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-c to fx-team. a=merge
This commit is contained in:
Коммит
6626c53c1a
|
@ -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="470826d13ae130a5c3d572d1029e595105485fb0"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="83de447d9ae9a59459d7a445f9348a254c661850"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
|
|
@ -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="470826d13ae130a5c3d572d1029e595105485fb0"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="83de447d9ae9a59459d7a445f9348a254c661850"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
|
|
|
@ -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="470826d13ae130a5c3d572d1029e595105485fb0"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="83de447d9ae9a59459d7a445f9348a254c661850"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="9eec93462df6d01fe33a737bb4a185e9ad6cee15"/>
|
||||
|
|
|
@ -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="470826d13ae130a5c3d572d1029e595105485fb0"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="83de447d9ae9a59459d7a445f9348a254c661850"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
|
|
@ -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="470826d13ae130a5c3d572d1029e595105485fb0"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="83de447d9ae9a59459d7a445f9348a254c661850"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="cd88d860656c31c7da7bb310d6a160d0011b0961"/>
|
||||
|
|
|
@ -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="470826d13ae130a5c3d572d1029e595105485fb0"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="83de447d9ae9a59459d7a445f9348a254c661850"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
|
|
@ -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="470826d13ae130a5c3d572d1029e595105485fb0"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="83de447d9ae9a59459d7a445f9348a254c661850"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="9eec93462df6d01fe33a737bb4a185e9ad6cee15"/>
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
"remote": "",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "842fd7448790cfaeaf0bf22164e599c74e9be0e9",
|
||||
"revision": "1e5360b21cca807b2ea63ea8fb878b451131c9bd",
|
||||
"repo_path": "/integration/gaia-central"
|
||||
}
|
||||
|
|
|
@ -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="470826d13ae130a5c3d572d1029e595105485fb0"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="83de447d9ae9a59459d7a445f9348a254c661850"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
|
|
@ -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="470826d13ae130a5c3d572d1029e595105485fb0"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="83de447d9ae9a59459d7a445f9348a254c661850"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
|
|
@ -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="470826d13ae130a5c3d572d1029e595105485fb0"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="83de447d9ae9a59459d7a445f9348a254c661850"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="562d357b72279a9e35d4af5aeecc8e1ffa2f44f1"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="9eec93462df6d01fe33a737bb4a185e9ad6cee15"/>
|
||||
|
|
|
@ -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="470826d13ae130a5c3d572d1029e595105485fb0"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="83de447d9ae9a59459d7a445f9348a254c661850"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="5883a99b6528ced9dafaed8d3ca2405fb285537e"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
|
|
@ -91,6 +91,10 @@ ImportLoader::Updater::GetReferrerChain(nsINode* aNode,
|
|||
bool
|
||||
ImportLoader::Updater::ShouldUpdate(nsTArray<nsINode*>& aNewPath)
|
||||
{
|
||||
if (mLoader->Manager()->GetNearestPredecessor(mLoader->GetMainReferrer()) !=
|
||||
mLoader->mBlockingPredecessor) {
|
||||
return true;
|
||||
}
|
||||
// Let's walk down on the main referrer chains of both the current main and
|
||||
// the new link, and find the last pair of links that are from the same
|
||||
// document. This is the junction point between the two referrer chain. Their
|
||||
|
@ -742,6 +746,19 @@ nsRefPtr<ImportLoader> ImportManager::GetNearestPredecessor(nsINode* aNode)
|
|||
nsIDocument* doc = aNode->OwnerDoc();
|
||||
int32_t idx = doc->IndexOfSubImportLink(aNode);
|
||||
MOZ_ASSERT(idx != -1, "aNode must be a sub import link of its owner document");
|
||||
|
||||
for (; idx > 0; idx--) {
|
||||
HTMLLinkElement* link =
|
||||
static_cast<HTMLLinkElement*>(doc->GetSubImportLink(idx - 1));
|
||||
nsCOMPtr<nsIURI> uri = link->GetHrefURI();
|
||||
nsRefPtr<ImportLoader> ret;
|
||||
mImports.Get(uri, getter_AddRefs(ret));
|
||||
// Only main referrer links are interesting.
|
||||
if (ret->GetMainReferrer() == link) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (idx == 0) {
|
||||
if (doc->IsMasterDocument()) {
|
||||
// If there is no previous one, and it was the master document, then
|
||||
|
@ -755,13 +772,8 @@ nsRefPtr<ImportLoader> ImportManager::GetNearestPredecessor(nsINode* aNode)
|
|||
nsCOMPtr<nsINode> mainReferrer = owner->GetMainReferrer();
|
||||
return GetNearestPredecessor(mainReferrer);
|
||||
}
|
||||
MOZ_ASSERT(idx > 0);
|
||||
HTMLLinkElement* link =
|
||||
static_cast<HTMLLinkElement*>(doc->GetSubImportLink(idx - 1));
|
||||
nsCOMPtr<nsIURI> uri = link->GetHrefURI();
|
||||
nsRefPtr<ImportLoader> ret;
|
||||
mImports.Get(uri, getter_AddRefs(ret));
|
||||
return ret;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -3520,6 +3520,10 @@ nsDocument::SetDocumentCharacterSet(const nsACString& aCharSetID)
|
|||
// but before we figure out what to do about non-Encoding Standard
|
||||
// encodings in the charset menu and in mailnews, assertions are futile.
|
||||
if (!mCharacterSet.Equals(aCharSetID)) {
|
||||
if (mMasterDocument && !aCharSetID.EqualsLiteral("UTF-8")) {
|
||||
// Imports are always UTF-8
|
||||
return;
|
||||
}
|
||||
mCharacterSet = aCharSetID;
|
||||
|
||||
int32_t n = mCharSetObservers.Length();
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<link rel="import" href="file_cycle_1_B.html" onload="loaded()" onerror="failed()"></link>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
order.push("A");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<link rel="import" href="file_cycle_1_C.html" onload="loaded()" onerror="failed()"></link>
|
||||
<link rel="import" href="file_cycle_1_A.html" onload="loaded()" onerror="failed()"></link>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
order.push("B");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<link rel="import" href="file_cycle_1_B.html" onload="loaded()" onerror="failed()"></link>
|
||||
<link rel="import" href="file_cycle_1_A.html" onload="loaded()" onerror="failed()"></link>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
order.push("C");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<link rel="import" href="file_cycle_2_B.html" onload="loaded()" onerror="failed()"></link>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
order.push("A");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<link rel="import" href="file_cycle_2_A.html" onload="loaded()" onerror="failed()"></link>
|
||||
<link rel="import" href="file_cycle_2_C.html" onload="loaded()" onerror="failed()"></link>
|
||||
<link rel="import" href="file_cycle_2_D.html" onload="loaded()" onerror="failed()"></link>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
order.push("B");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
order.push("C");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
order.push("D");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<link rel="import" href="file_cycle_3_C.html" onload="loaded()" onerror="failed()"></link>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
order.push("A");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<link rel="import" href="file_cycle_3_C.html" onload="loaded()" onerror="failed()"></link>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
order.push("B");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<link rel="import" href="file_cycle_3_A.html" onload="loaded()" onerror="failed()"></link>
|
||||
<link rel="import" href="file_cycle_3_B.html" onload="loaded()" onerror="failed()"></link>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
order.push("C");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<link rel="import" href="file_cycle_4_B.html" onload="loaded()" onerror="failed()"></link>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
order.push("A");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<link rel="import" href="file_cycle_4_C.html" onload="loaded()" onerror="failed()"></link>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
order.push("B");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<link rel="import" href="file_cycle_4_D.html" onload="loaded()" onerror="failed()"></link>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
order.push("C");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<link rel="import" href="file_cycle_4_B.html" onload="loaded()" onerror="failed()"></link>
|
||||
<link rel="import" href="file_cycle_4_E.html" onload="loaded()" onerror="failed()"></link>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
order.push("D");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<link rel="import" href="file_cycle_4_C.html" onload="loaded()" onerror="failed()"></link>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
order.push("E");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<link rel="import" href="file_cycle_5_B.html" onload="loaded()" onerror="failed()"></link>
|
||||
<link rel="import" href="file_cycle_5_D.html" onload="loaded()" onerror="failed()"></link>
|
||||
<link rel="import" href="file_cycle_5_C.html" onload="loaded()" onerror="failed()"></link>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
order.push("A");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<link rel="import" href="file_cycle_5_A.html" onload="loaded()" onerror="failed()"></link>
|
||||
<link rel="import" href="file_cycle_5_C.html" onload="loaded()" onerror="failed()"></link>
|
||||
<link rel="import" href="file_cycle_5_D.html" onload="loaded()" onerror="failed()"></link>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
order.push("B");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<link rel="import" href="file_cycle_5_A.html" onload="loaded()" onerror="failed()"></link>
|
||||
<link rel="import" href="file_cycle_5_B.html" onload="loaded()" onerror="failed()"></link>
|
||||
<link rel="import" href="file_cycle_5_D.html" onload="loaded()" onerror="failed()"></link>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
order.push("C");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<link rel="import" href="file_cycle_5_A.html" onload="loaded()" onerror="failed()"></link>
|
||||
<link rel="import" href="file_cycle_5_B.html" onload="loaded()" onerror="failed()"></link>
|
||||
<link rel="import" href="file_cycle_5_C.html" onload="loaded()" onerror="failed()"></link>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
order.push("D");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<head>
|
||||
<meta charset="EUC-KR">
|
||||
</head>
|
||||
<body>Ignore my encoding</body>
|
|
@ -16,5 +16,35 @@ support-files =
|
|||
file_importC10.html
|
||||
file_importD.html
|
||||
file_importE.html
|
||||
file_cycle_1_A.html
|
||||
file_cycle_1_B.html
|
||||
file_cycle_1_C.html
|
||||
file_cycle_2_A.html
|
||||
file_cycle_2_B.html
|
||||
file_cycle_2_C.html
|
||||
file_cycle_2_D.html
|
||||
file_cycle_3_A.html
|
||||
file_cycle_3_B.html
|
||||
file_cycle_3_C.html
|
||||
file_cycle_4_A.html
|
||||
file_cycle_4_B.html
|
||||
file_cycle_4_C.html
|
||||
file_cycle_4_D.html
|
||||
file_cycle_4_E.html
|
||||
file_cycle_5_A.html
|
||||
file_cycle_5_B.html
|
||||
file_cycle_5_C.html
|
||||
file_cycle_5_D.html
|
||||
file_encoding.html
|
||||
|
||||
|
||||
[test_cycle_1.html]
|
||||
skip-if = toolkit == 'gonk' # nested imports fail on b2g emulator
|
||||
[test_cycle_2.html]
|
||||
skip-if = toolkit == 'gonk' # nested imports fail on b2g emulator
|
||||
[test_cycle_3.html]
|
||||
skip-if = toolkit == 'gonk' # nested imports fail on b2g emulator
|
||||
[test_cycle_4.html]
|
||||
skip-if = toolkit == 'gonk' # nested imports fail on b2g emulator
|
||||
[test_cycle_5.html]
|
||||
skip-if = toolkit == 'gonk' # nested imports fail on b2g emulator
|
||||
[test_encoding.html]
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1061469
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 1061469</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1061469">Mozilla Bug 1061469</a>
|
||||
<script type="text/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
var counter = 0;
|
||||
var fcounter = 0;
|
||||
var order = [];
|
||||
function loaded() {
|
||||
counter++;
|
||||
}
|
||||
function failed() {
|
||||
fcounter++;
|
||||
}
|
||||
</script>
|
||||
<link rel="import" href="file_cycle_1_A.html" onload="loaded()" onerror="failed()"></link>
|
||||
<script type="text/javascript">
|
||||
is(counter, 6, "Imports are loaded");
|
||||
is(fcounter, 0, "No error in imports");
|
||||
var expected = ["C","B","A"];
|
||||
for (i in expected)
|
||||
is(order[i], expected[i], "import " + i + " should be " + expected[i]);
|
||||
SimpleTest.finish();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1061469
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 1061469</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1061469">Mozilla Bug 1061469</a>
|
||||
<script type="text/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
var counter = 0;
|
||||
var fcounter = 0;
|
||||
var order = [];
|
||||
function loaded() {
|
||||
counter++;
|
||||
}
|
||||
function failed() {
|
||||
fcounter++;
|
||||
}
|
||||
</script>
|
||||
<link rel="import" href="file_cycle_2_A.html" onload="loaded()" onerror="failed()"></link>
|
||||
<script type="text/javascript">
|
||||
is(counter, 5, "Imports are loaded");
|
||||
is(fcounter, 0, "No error in imports");
|
||||
var expected = ["C","D","B","A"];
|
||||
for (i in expected)
|
||||
is(order[i], expected[i], "import " + i + " should be " + expected[i]);
|
||||
SimpleTest.finish();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1061469
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 1061469</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1061469">Mozilla Bug 1061469</a>
|
||||
<script type="text/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
var counter = 0;
|
||||
var fcounter = 0;
|
||||
var order = [];
|
||||
function loaded() {
|
||||
counter++;
|
||||
}
|
||||
function failed() {
|
||||
fcounter++;
|
||||
}
|
||||
</script>
|
||||
<link rel="import" href="file_cycle_3_A.html" onload="loaded()" onerror="failed()"></link>
|
||||
<link rel="import" href="file_cycle_3_B.html" onload="loaded()" onerror="failed()"></link>
|
||||
<script type="text/javascript">
|
||||
is(counter, 6, "Imports are loaded");
|
||||
is(fcounter, 0, "No error in imports");
|
||||
var expected = ["B","C","A"];
|
||||
for (i in expected)
|
||||
is(order[i], expected[i], "import " + i + " should be " + expected[i]);
|
||||
SimpleTest.finish();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1061469
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 1061469</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1061469">Mozilla Bug 1061469</a>
|
||||
<script type="text/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
var counter = 0;
|
||||
var fcounter = 0;
|
||||
var order = [];
|
||||
function loaded() {
|
||||
counter++;
|
||||
}
|
||||
function failed() {
|
||||
fcounter++;
|
||||
}
|
||||
</script>
|
||||
<link rel="import" href="file_cycle_4_A.html" onload="loaded()" onerror="failed()"></link>
|
||||
<link rel="import" href="file_cycle_4_D.html" onload="loaded()" onerror="failed()"></link>
|
||||
<script type="text/javascript">
|
||||
is(counter, 8, "Imports are loaded");
|
||||
is(fcounter, 0, "No error in imports");
|
||||
var expected = ["E","D","C","B","A"];
|
||||
for (i in expected)
|
||||
is(order[i], expected[i], "import " + i + " should be " + expected[i]);
|
||||
SimpleTest.finish();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1061469
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 1061469</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1061469">Mozilla Bug 1061469</a>
|
||||
<script type="text/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
var counter = 0;
|
||||
var fcounter = 0;
|
||||
var order = [];
|
||||
function loaded() {
|
||||
counter++;
|
||||
}
|
||||
function failed() {
|
||||
fcounter++;
|
||||
}
|
||||
</script>
|
||||
<link rel="import" href="file_cycle_5_A.html" onload="loaded()" onerror="failed()"></link>
|
||||
<link rel="import" href="file_cycle_5_C.html" onload="loaded()" onerror="failed()"></link>
|
||||
<script type="text/javascript">
|
||||
is(counter, 14, "Imports are loaded");
|
||||
is(fcounter, 0, "No error in imports");
|
||||
var expected = ["D","C","B","A"];
|
||||
for (i in expected)
|
||||
is(order[i], expected[i], "import " + i + " should be " + expected[i]);
|
||||
SimpleTest.finish();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1061469
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 1061469</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1061469">Mozilla Bug 1061469</a>
|
||||
<script type="text/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
var success = false;
|
||||
function loaded() {
|
||||
success = true;
|
||||
}
|
||||
function failed() {
|
||||
ok(false, "Import loading failed");
|
||||
}
|
||||
</script>
|
||||
<link rel="import" href="file_encoding.html" id="import" onload="loaded()" onerror="failed()"></link>
|
||||
<script type="text/javascript">
|
||||
is(document.getElementById("import").import.characterSet, "UTF-8", "characterSet should be UTF-8 for imports");
|
||||
SimpleTest.finish();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -21,6 +21,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=868943
|
|||
/** Test for Bug 868943 **/
|
||||
|
||||
function testVideoPlayPause() {
|
||||
info("#1 testVideoPlayPause");
|
||||
|
||||
var lockState_cpu = true;
|
||||
var lockState_screen = true;
|
||||
var count_cpu = 0;
|
||||
|
@ -33,30 +35,32 @@ function testVideoPlayPause() {
|
|||
content.appendChild(video);
|
||||
|
||||
var startDate;
|
||||
video.addEventListener('playing', function() {
|
||||
startDate = new Date();
|
||||
|
||||
// The next step is to unlock the resource.
|
||||
lockState_cpu = false;
|
||||
lockState_screen = false;
|
||||
video.pause();
|
||||
});
|
||||
|
||||
function testVideoPlayPauseListener(topic, state) {
|
||||
info("#1 topic=" + topic + ", state=" + state);
|
||||
|
||||
var locked = state == "locked-foreground" ||
|
||||
state == "locked-background";
|
||||
|
||||
if (topic == "cpu") {
|
||||
is(locked, lockState_cpu, "Video element locked the cpu - paused");
|
||||
is(locked, lockState_cpu, "#1 Video element locked the cpu");
|
||||
count_cpu++;
|
||||
} else if (topic == "screen") {
|
||||
is(locked, lockState_screen, "Video element locked the screen - paused");
|
||||
is(locked, lockState_screen, "#1 Video element locked the screen");
|
||||
count_screen++;
|
||||
}
|
||||
|
||||
if (count_cpu == 1 && count_screen == 1) {
|
||||
info("#1 Both cpu and screen are locked");
|
||||
// The next step is to unlock the resource.
|
||||
lockState_cpu = false;
|
||||
lockState_screen = false;
|
||||
video.pause();
|
||||
startDate = new Date();
|
||||
}
|
||||
|
||||
if (count_cpu == 2 && count_screen == 2) {
|
||||
var diffDate = (new Date() - startDate);
|
||||
ok(diffDate > 200, "There was at least 200 milliseconds between the stop and the wakelock release");
|
||||
ok(diffDate > 200, "#1 There was at least 200 milliseconds between the stop and the wakelock release");
|
||||
|
||||
content.removeChild(video);
|
||||
navigator.mozPower.removeWakeLockListener(testVideoPlayPauseListener);
|
||||
|
@ -69,6 +73,8 @@ function testVideoPlayPause() {
|
|||
}
|
||||
|
||||
function testVideoPlay() {
|
||||
info("#2 testVideoPlay");
|
||||
|
||||
var lockState_cpu = true;
|
||||
var lockState_screen = true;
|
||||
var count_cpu = 0;
|
||||
|
@ -86,24 +92,27 @@ function testVideoPlay() {
|
|||
});
|
||||
|
||||
function testVideoPlayListener(topic, state) {
|
||||
info("#2 topic=" + topic + ", state=" + state);
|
||||
|
||||
var locked = state == "locked-foreground" ||
|
||||
state == "locked-background";
|
||||
|
||||
if (topic == "cpu") {
|
||||
is(locked, lockState_cpu, "Video element locked the cpu - paused");
|
||||
is(locked, lockState_cpu, "#2 Video element locked the cpu");
|
||||
count_cpu++;
|
||||
} else if (topic == "screen") {
|
||||
is(locked, lockState_screen, "Video element locked the screen - paused");
|
||||
is(locked, lockState_screen, "#2 Video element locked the screen");
|
||||
count_screen++;
|
||||
}
|
||||
|
||||
if (count_cpu == 1 && count_screen == 1) {
|
||||
info("#2 Both cpu and screen are locked");
|
||||
// The next step is to unlock the resource.
|
||||
lockState_cpu = false;
|
||||
lockState_screen = false;
|
||||
} else if (count_cpu == 2 && count_screen == 2) {
|
||||
var diffDate = (new Date() - startDate);
|
||||
ok(diffDate > 200, "There was at least milliseconds between the stop and the wakelock release");
|
||||
ok(diffDate > 200, "#2 There was at least milliseconds between the stop and the wakelock release");
|
||||
|
||||
content.removeChild(video);
|
||||
navigator.mozPower.removeWakeLockListener(testVideoPlayListener);
|
||||
|
|
|
@ -698,6 +698,11 @@ DOMInterfaces = {
|
|||
'notflattened': True
|
||||
},
|
||||
|
||||
'MozCdmaIccInfo': {
|
||||
'headerFile': 'mozilla/dom/IccInfo.h',
|
||||
'nativeType': 'mozilla::dom::CdmaIccInfo',
|
||||
},
|
||||
|
||||
'MozCellBroadcast': {
|
||||
'nativeType': 'mozilla::dom::CellBroadcast',
|
||||
},
|
||||
|
@ -711,10 +716,19 @@ DOMInterfaces = {
|
|||
'nativeType': 'mozilla::dom::CellBroadcastMessage',
|
||||
},
|
||||
|
||||
'MozGsmIccInfo': {
|
||||
'headerFile': 'mozilla/dom/IccInfo.h',
|
||||
'nativeType': 'mozilla::dom::GsmIccInfo',
|
||||
},
|
||||
|
||||
'MozIcc': {
|
||||
'nativeType': 'mozilla::dom::Icc',
|
||||
},
|
||||
|
||||
'MozIccInfo': {
|
||||
'nativeType': 'mozilla::dom::IccInfo',
|
||||
},
|
||||
|
||||
'MozIccManager': {
|
||||
'nativeType': 'mozilla::dom::IccManager',
|
||||
},
|
||||
|
@ -1794,7 +1808,6 @@ addExternalIface('MozControllers', nativeType='nsIControllers')
|
|||
addExternalIface('MozFrameLoader', nativeType='nsIFrameLoader', notflattened=True)
|
||||
addExternalIface('MozFrameRequestCallback', nativeType='nsIFrameRequestCallback',
|
||||
notflattened=True)
|
||||
addExternalIface('MozIccInfo', headerFile='nsIDOMIccInfo.h')
|
||||
addExternalIface('MozMmsMessage')
|
||||
addExternalIface('MozObserver', nativeType='nsIObserver', notflattened=True)
|
||||
addExternalIface('MozRDFCompositeDataSource', nativeType='nsIRDFCompositeDataSource',
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include "mozilla/StaticPtr.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIAudioManager.h"
|
||||
#include "nsIDOMIccInfo.h"
|
||||
#include "nsIIccInfo.h"
|
||||
#include "nsIIccProvider.h"
|
||||
#include "nsIMobileConnectionInfo.h"
|
||||
#include "nsIMobileConnectionService.h"
|
||||
|
@ -673,11 +673,11 @@ BluetoothHfpManager::HandleIccInfoChanged(uint32_t aClientId)
|
|||
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
|
||||
NS_ENSURE_TRUE_VOID(icc);
|
||||
|
||||
nsCOMPtr<nsIDOMMozIccInfo> iccInfo;
|
||||
nsCOMPtr<nsIIccInfo> iccInfo;
|
||||
icc->GetIccInfo(aClientId, getter_AddRefs(iccInfo));
|
||||
NS_ENSURE_TRUE_VOID(iccInfo);
|
||||
|
||||
nsCOMPtr<nsIDOMMozGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo);
|
||||
nsCOMPtr<nsIGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo);
|
||||
NS_ENSURE_TRUE_VOID(gsmIccInfo);
|
||||
gsmIccInfo->GetMsisdn(mMsisdn);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "mozilla/dom/SettingChangeNotificationBinding.h"
|
||||
|
||||
#ifdef MOZ_B2G_RIL
|
||||
#include "nsIDOMIccInfo.h"
|
||||
#include "nsIIccInfo.h"
|
||||
#include "nsIIccProvider.h"
|
||||
#include "nsIMobileConnectionInfo.h"
|
||||
#include "nsIMobileConnectionService.h"
|
||||
|
@ -674,11 +674,11 @@ BluetoothHfpManager::HandleIccInfoChanged(uint32_t aClientId)
|
|||
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
|
||||
NS_ENSURE_TRUE_VOID(icc);
|
||||
|
||||
nsCOMPtr<nsIDOMMozIccInfo> iccInfo;
|
||||
nsCOMPtr<nsIIccInfo> iccInfo;
|
||||
icc->GetIccInfo(aClientId, getter_AddRefs(iccInfo));
|
||||
NS_ENSURE_TRUE_VOID(iccInfo);
|
||||
|
||||
nsCOMPtr<nsIDOMMozGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo);
|
||||
nsCOMPtr<nsIGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo);
|
||||
NS_ENSURE_TRUE_VOID(gsmIccInfo);
|
||||
gsmIccInfo->GetMsisdn(mMsisdn);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include "mozilla/StaticPtr.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIAudioManager.h"
|
||||
#include "nsIDOMIccInfo.h"
|
||||
#include "nsIIccInfo.h"
|
||||
#include "nsIIccProvider.h"
|
||||
#include "nsIMobileConnectionInfo.h"
|
||||
#include "nsIMobileConnectionService.h"
|
||||
|
@ -678,11 +678,11 @@ BluetoothHfpManager::HandleIccInfoChanged(uint32_t aClientId)
|
|||
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
|
||||
NS_ENSURE_TRUE_VOID(icc);
|
||||
|
||||
nsCOMPtr<nsIDOMMozIccInfo> iccInfo;
|
||||
nsCOMPtr<nsIIccInfo> iccInfo;
|
||||
icc->GetIccInfo(aClientId, getter_AddRefs(iccInfo));
|
||||
NS_ENSURE_TRUE_VOID(iccInfo);
|
||||
|
||||
nsCOMPtr<nsIDOMMozGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo);
|
||||
nsCOMPtr<nsIGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo);
|
||||
NS_ENSURE_TRUE_VOID(gsmIccInfo);
|
||||
gsmIccInfo->GetMsisdn(mMsisdn);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "mozilla/dom/SettingChangeNotificationBinding.h"
|
||||
|
||||
#ifdef MOZ_B2G_RIL
|
||||
#include "nsIDOMIccInfo.h"
|
||||
#include "nsIIccInfo.h"
|
||||
#include "nsIIccProvider.h"
|
||||
#include "nsIMobileConnectionInfo.h"
|
||||
#include "nsIMobileConnectionService.h"
|
||||
|
@ -674,11 +674,11 @@ BluetoothHfpManager::HandleIccInfoChanged(uint32_t aClientId)
|
|||
do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
|
||||
NS_ENSURE_TRUE_VOID(icc);
|
||||
|
||||
nsCOMPtr<nsIDOMMozIccInfo> iccInfo;
|
||||
nsCOMPtr<nsIIccInfo> iccInfo;
|
||||
icc->GetIccInfo(aClientId, getter_AddRefs(iccInfo));
|
||||
NS_ENSURE_TRUE_VOID(iccInfo);
|
||||
|
||||
nsCOMPtr<nsIDOMMozGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo);
|
||||
nsCOMPtr<nsIGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo);
|
||||
NS_ENSURE_TRUE_VOID(gsmIccInfo);
|
||||
gsmIccInfo->GetMsisdn(mMsisdn);
|
||||
}
|
||||
|
|
|
@ -144,6 +144,8 @@ function BrowserElementParent(frameLoader, hasRemoteFrame, isPendingFrame) {
|
|||
|
||||
defineMethod('addNextPaintListener', this._addNextPaintListener);
|
||||
defineMethod('removeNextPaintListener', this._removeNextPaintListener);
|
||||
defineNoReturnMethod('setActive', this._setActive);
|
||||
defineMethod('getActive', 'this._getActive');
|
||||
|
||||
let principal = this._frameElement.ownerDocument.nodePrincipal;
|
||||
let perm = Services.perms
|
||||
|
@ -587,6 +589,14 @@ BrowserElementParent.prototype = {
|
|||
this._frameLoader.visible = visible;
|
||||
},
|
||||
|
||||
_setActive: function(active) {
|
||||
this._frameLoader.visible = active;
|
||||
},
|
||||
|
||||
_getActive: function() {
|
||||
return this._frameLoader.visible;
|
||||
},
|
||||
|
||||
_sendMouseEvent: function(type, x, y, button, clickCount, modifiers) {
|
||||
this._sendAsyncMsg("send-mouse-event", {
|
||||
"type": type,
|
||||
|
|
|
@ -3092,11 +3092,18 @@ struct MOZ_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcess
|
|||
virtual void SetText(const char16_t* text, int32_t length, nsBidiDirection direction)
|
||||
{
|
||||
mFontgrp->UpdateUserFonts(); // ensure user font generation is current
|
||||
// adjust flags for current direction run
|
||||
uint32_t flags = mTextRunFlags;
|
||||
if (direction & 1) {
|
||||
flags |= gfxTextRunFactory::TEXT_IS_RTL;
|
||||
} else {
|
||||
flags &= ~gfxTextRunFactory::TEXT_IS_RTL;
|
||||
}
|
||||
mTextRun = mFontgrp->MakeTextRun(text,
|
||||
length,
|
||||
mThebes,
|
||||
mAppUnitsPerDevPixel,
|
||||
direction==NSBIDI_RTL ? gfxTextRunFactory::TEXT_IS_RTL : 0);
|
||||
flags);
|
||||
}
|
||||
|
||||
virtual nscoord GetWidth()
|
||||
|
@ -3122,10 +3129,14 @@ struct MOZ_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcess
|
|||
virtual void DrawText(nscoord xOffset, nscoord width)
|
||||
{
|
||||
gfxPoint point = mPt;
|
||||
point.x += xOffset;
|
||||
bool rtl = mTextRun->IsRightToLeft();
|
||||
bool verticalRun = mTextRun->IsVertical();
|
||||
|
||||
gfxFloat& inlineCoord = verticalRun ? point.y : point.x;
|
||||
inlineCoord += xOffset;
|
||||
|
||||
// offset is given in terms of left side of string
|
||||
if (mTextRun->IsRightToLeft()) {
|
||||
if (rtl) {
|
||||
// Bug 581092 - don't use rounded pixel width to advance to
|
||||
// right-hand end of run, because this will cause different
|
||||
// glyph positioning for LTR vs RTL drawing of the same
|
||||
|
@ -3139,7 +3150,7 @@ struct MOZ_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcess
|
|||
gfxFont::LOOSE_INK_EXTENTS,
|
||||
mThebes,
|
||||
nullptr);
|
||||
point.x += textRunMetrics.mAdvanceWidth;
|
||||
inlineCoord += textRunMetrics.mAdvanceWidth;
|
||||
// old code was:
|
||||
// point.x += width * mAppUnitsPerDevPixel;
|
||||
// TODO: restore this if/when we move to fractional coords
|
||||
|
@ -3158,6 +3169,15 @@ struct MOZ_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcess
|
|||
mCtx->EnsureTarget();
|
||||
for (uint32_t c = 0; c < numRuns; c++) {
|
||||
gfxFont *font = runs[c].mFont;
|
||||
|
||||
bool verticalFont =
|
||||
runs[c].mOrientation == gfxTextRunFactory::TEXT_ORIENT_VERTICAL_UPRIGHT;
|
||||
|
||||
const float& baselineOriginInline =
|
||||
verticalFont ? baselineOrigin.y : baselineOrigin.x;
|
||||
const float& baselineOriginBlock =
|
||||
verticalFont ? baselineOrigin.x : baselineOrigin.y;
|
||||
|
||||
uint32_t endRun = 0;
|
||||
if (c + 1 < numRuns) {
|
||||
endRun = runs[c + 1].mCharacterOffset;
|
||||
|
@ -3175,23 +3195,53 @@ struct MOZ_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcess
|
|||
return;
|
||||
}
|
||||
|
||||
AutoRestoreTransform sidewaysRestore;
|
||||
if (runs[c].mOrientation ==
|
||||
gfxTextRunFactory::TEXT_ORIENT_VERTICAL_SIDEWAYS_RIGHT) {
|
||||
sidewaysRestore.Init(mCtx->mTarget);
|
||||
// TODO: The baseline adjustment here is kinda ad-hoc; eventually
|
||||
// perhaps we should check for horizontal and vertical baseline data
|
||||
// in the font, and adjust accordingly.
|
||||
// (The same will be true for HTML text layout.)
|
||||
const gfxFont::Metrics& metrics = mTextRun->GetFontGroup()->
|
||||
GetFirstValidFont()->GetMetrics(gfxFont::eHorizontal);
|
||||
mCtx->mTarget->SetTransform(mCtx->mTarget->GetTransform().Copy().
|
||||
PreTranslate(baselineOrigin). // translate origin for rotation
|
||||
PreRotate(gfx::Float(M_PI / 2.0)). // turn 90deg clockwise
|
||||
PreTranslate(-baselineOrigin). // undo the translation
|
||||
PreTranslate(Point(0, metrics.emAscent - metrics.emDescent) / 2));
|
||||
// and offset the (alphabetic) baseline of the
|
||||
// horizontally-shaped text from the (centered)
|
||||
// default baseline used for vertical
|
||||
}
|
||||
|
||||
RefPtr<GlyphRenderingOptions> renderingOptions = font->GetGlyphRenderingOptions();
|
||||
|
||||
GlyphBuffer buffer;
|
||||
|
||||
std::vector<Glyph> glyphBuf;
|
||||
|
||||
// TODO:
|
||||
// This more-or-less duplicates the code found in gfxTextRun::Draw
|
||||
// and the gfxFont methods that uses (Draw, DrawGlyphs, DrawOneGlyph);
|
||||
// it would be nice to refactor and share that code.
|
||||
for (uint32_t i = runs[c].mCharacterOffset; i < endRun; i++) {
|
||||
Glyph newGlyph;
|
||||
|
||||
float& inlinePos =
|
||||
verticalFont ? newGlyph.mPosition.y : newGlyph.mPosition.x;
|
||||
float& blockPos =
|
||||
verticalFont ? newGlyph.mPosition.x : newGlyph.mPosition.y;
|
||||
|
||||
if (glyphs[i].IsSimpleGlyph()) {
|
||||
newGlyph.mIndex = glyphs[i].GetSimpleGlyph();
|
||||
if (mTextRun->IsRightToLeft()) {
|
||||
newGlyph.mPosition.x = baselineOrigin.x - advanceSum -
|
||||
if (rtl) {
|
||||
inlinePos = baselineOriginInline - advanceSum -
|
||||
glyphs[i].GetSimpleAdvance() * devUnitsPerAppUnit;
|
||||
} else {
|
||||
newGlyph.mPosition.x = baselineOrigin.x + advanceSum;
|
||||
inlinePos = baselineOriginInline + advanceSum;
|
||||
}
|
||||
newGlyph.mPosition.y = baselineOrigin.y;
|
||||
blockPos = baselineOriginBlock;
|
||||
advanceSum += glyphs[i].GetSimpleAdvance() * devUnitsPerAppUnit;
|
||||
glyphBuf.push_back(newGlyph);
|
||||
continue;
|
||||
|
@ -3201,34 +3251,34 @@ struct MOZ_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcess
|
|||
continue;
|
||||
}
|
||||
|
||||
gfxTextRun::DetailedGlyph *detailedGlyphs =
|
||||
mTextRun->GetDetailedGlyphs(i);
|
||||
const gfxTextRun::DetailedGlyph *d = mTextRun->GetDetailedGlyphs(i);
|
||||
|
||||
if (glyphs[i].IsMissing()) {
|
||||
newGlyph.mIndex = 0;
|
||||
if (mTextRun->IsRightToLeft()) {
|
||||
newGlyph.mPosition.x = baselineOrigin.x - advanceSum -
|
||||
detailedGlyphs[0].mAdvance * devUnitsPerAppUnit;
|
||||
if (rtl) {
|
||||
inlinePos = baselineOriginInline - advanceSum -
|
||||
d->mAdvance * devUnitsPerAppUnit;
|
||||
} else {
|
||||
newGlyph.mPosition.x = baselineOrigin.x + advanceSum;
|
||||
inlinePos = baselineOriginInline + advanceSum;
|
||||
}
|
||||
newGlyph.mPosition.y = baselineOrigin.y;
|
||||
advanceSum += detailedGlyphs[0].mAdvance * devUnitsPerAppUnit;
|
||||
blockPos = baselineOriginBlock;
|
||||
advanceSum += d->mAdvance * devUnitsPerAppUnit;
|
||||
glyphBuf.push_back(newGlyph);
|
||||
continue;
|
||||
}
|
||||
|
||||
for (uint32_t c = 0; c < glyphs[i].GetGlyphCount(); c++) {
|
||||
newGlyph.mIndex = detailedGlyphs[c].mGlyphID;
|
||||
if (mTextRun->IsRightToLeft()) {
|
||||
newGlyph.mPosition.x = baselineOrigin.x + detailedGlyphs[c].mXOffset * devUnitsPerAppUnit -
|
||||
advanceSum - detailedGlyphs[c].mAdvance * devUnitsPerAppUnit;
|
||||
for (uint32_t c = 0; c < glyphs[i].GetGlyphCount(); c++, d++) {
|
||||
newGlyph.mIndex = d->mGlyphID;
|
||||
if (rtl) {
|
||||
inlinePos = baselineOriginInline - advanceSum -
|
||||
d->mAdvance * devUnitsPerAppUnit;
|
||||
} else {
|
||||
newGlyph.mPosition.x = baselineOrigin.x + detailedGlyphs[c].mXOffset * devUnitsPerAppUnit + advanceSum;
|
||||
inlinePos = baselineOriginInline + advanceSum;
|
||||
}
|
||||
newGlyph.mPosition.y = baselineOrigin.y + detailedGlyphs[c].mYOffset * devUnitsPerAppUnit;
|
||||
inlinePos += d->mXOffset * devUnitsPerAppUnit;
|
||||
blockPos = baselineOriginBlock + d->mYOffset * devUnitsPerAppUnit;
|
||||
glyphBuf.push_back(newGlyph);
|
||||
advanceSum += detailedGlyphs[c].mAdvance * devUnitsPerAppUnit;
|
||||
advanceSum += d->mAdvance * devUnitsPerAppUnit;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3303,6 +3353,9 @@ struct MOZ_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcess
|
|||
// union of bounding boxes of all runs, needed for shadows
|
||||
gfxRect mBoundingBox;
|
||||
|
||||
// flags to use when creating textrun, based on CSS style
|
||||
uint32_t mTextRunFlags;
|
||||
|
||||
// true iff the bounding box should be measured
|
||||
bool mDoMeasureBoundingBox;
|
||||
};
|
||||
|
@ -3342,9 +3395,10 @@ CanvasRenderingContext2D::DrawOrMeasureText(const nsAString& aRawText,
|
|||
// for now, default to ltr if not in doc
|
||||
bool isRTL = false;
|
||||
|
||||
nsRefPtr<nsStyleContext> canvasStyle;
|
||||
if (mCanvasElement && mCanvasElement->IsInDoc()) {
|
||||
// try to find the closest context
|
||||
nsRefPtr<nsStyleContext> canvasStyle =
|
||||
canvasStyle =
|
||||
nsComputedDOMStyle::GetStyleContextForElement(mCanvasElement,
|
||||
nullptr,
|
||||
presShell);
|
||||
|
@ -3379,6 +3433,14 @@ CanvasRenderingContext2D::DrawOrMeasureText(const nsAString& aRawText,
|
|||
|
||||
CanvasBidiProcessor processor;
|
||||
|
||||
// If we don't have a style context, we can't set up vertical-text flags
|
||||
// (for now, at least; perhaps we need new Canvas API to control this).
|
||||
processor.mTextRunFlags = canvasStyle ?
|
||||
nsLayoutUtils::GetTextRunFlagsForStyle(canvasStyle,
|
||||
canvasStyle->StyleFont(),
|
||||
canvasStyle->StyleText(),
|
||||
0) : 0;
|
||||
|
||||
GetAppUnitsValues(&processor.mAppUnitsPerDevPixel, nullptr);
|
||||
processor.mPt = gfxPoint(aX, aY);
|
||||
processor.mThebes =
|
||||
|
@ -3445,7 +3507,9 @@ CanvasRenderingContext2D::DrawOrMeasureText(const nsAString& aRawText,
|
|||
// offset pt.y based on text baseline
|
||||
processor.mFontgrp->UpdateUserFonts(); // ensure user font generation is current
|
||||
const gfxFont::Metrics& fontMetrics =
|
||||
processor.mFontgrp->GetFirstValidFont()->GetMetrics(gfxFont::eHorizontal); // XXX vertical?
|
||||
processor.mFontgrp->GetFirstValidFont()->GetMetrics(
|
||||
processor.mTextRun->IsVertical() ? gfxFont::eVertical :
|
||||
gfxFont::eHorizontal);
|
||||
|
||||
gfxFloat anchorY;
|
||||
|
||||
|
|
|
@ -2,29 +2,43 @@
|
|||
* 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 "Icc.h"
|
||||
#include "mozilla/dom/Icc.h"
|
||||
|
||||
#include "mozilla/dom/DOMRequest.h"
|
||||
#include "mozilla/dom/IccInfo.h"
|
||||
#include "mozilla/dom/MozIccBinding.h"
|
||||
#include "mozilla/dom/MozStkCommandEvent.h"
|
||||
#include "mozilla/dom/DOMRequest.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "nsIDOMIccInfo.h"
|
||||
#include "nsIIccInfo.h"
|
||||
#include "nsIIccProvider.h"
|
||||
#include "nsJSON.h"
|
||||
#include "nsRadioInterfaceLayer.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
Icc::Icc(nsPIDOMWindow* aWindow, long aClientId, const nsAString& aIccId)
|
||||
NS_IMPL_CYCLE_COLLECTION_INHERITED(Icc, DOMEventTargetHelper, mIccInfo)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(Icc)
|
||||
NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(Icc, DOMEventTargetHelper)
|
||||
NS_IMPL_RELEASE_INHERITED(Icc, DOMEventTargetHelper)
|
||||
|
||||
Icc::Icc(nsPIDOMWindow* aWindow, long aClientId, nsIIccInfo* aIccInfo)
|
||||
: mLive(true)
|
||||
, mClientId(aClientId)
|
||||
, mIccId(aIccId)
|
||||
{
|
||||
SetIsDOMBinding();
|
||||
BindToOwner(aWindow);
|
||||
|
||||
mProvider = do_GetService(NS_RILCONTENTHELPER_CONTRACTID);
|
||||
|
||||
if (aIccInfo) {
|
||||
aIccInfo->GetIccid(mIccId);
|
||||
UpdateIccInfo(aIccInfo);
|
||||
}
|
||||
|
||||
// Not being able to acquire the provider isn't fatal since we check
|
||||
// for it explicitly below.
|
||||
if (!mProvider) {
|
||||
|
@ -35,6 +49,7 @@ Icc::Icc(nsPIDOMWindow* aWindow, long aClientId, const nsAString& aIccId)
|
|||
void
|
||||
Icc::Shutdown()
|
||||
{
|
||||
mIccInfo.SetNull();
|
||||
mProvider = nullptr;
|
||||
mLive = false;
|
||||
}
|
||||
|
@ -74,6 +89,38 @@ Icc::NotifyStkEvent(const nsAString& aName, const nsAString& aMessage)
|
|||
return DispatchTrustedEvent(event);
|
||||
}
|
||||
|
||||
void
|
||||
Icc::UpdateIccInfo(nsIIccInfo* aIccInfo)
|
||||
{
|
||||
if (!aIccInfo) {
|
||||
mIccInfo.SetNull();
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIGsmIccInfo> gsmIccInfo(do_QueryInterface(aIccInfo));
|
||||
if (gsmIccInfo) {
|
||||
if (mIccInfo.IsNull() || !mIccInfo.Value().IsMozGsmIccInfo()) {
|
||||
mIccInfo.SetValue().SetAsMozGsmIccInfo() = new GsmIccInfo(GetOwner());
|
||||
}
|
||||
mIccInfo.Value().GetAsMozGsmIccInfo().get()->Update(gsmIccInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsICdmaIccInfo> cdmaIccInfo(do_QueryInterface(aIccInfo));
|
||||
if (cdmaIccInfo) {
|
||||
if (mIccInfo.IsNull() || !mIccInfo.Value().IsMozCdmaIccInfo()) {
|
||||
mIccInfo.SetValue().SetAsMozCdmaIccInfo() = new CdmaIccInfo(GetOwner());
|
||||
}
|
||||
mIccInfo.Value().GetAsMozCdmaIccInfo().get()->Update(cdmaIccInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
if (mIccInfo.IsNull() || !mIccInfo.Value().IsMozIccInfo()) {
|
||||
mIccInfo.SetValue().SetAsMozIccInfo() = new IccInfo(GetOwner());
|
||||
}
|
||||
mIccInfo.Value().GetAsMozIccInfo().get()->Update(aIccInfo);
|
||||
}
|
||||
|
||||
// WrapperCache
|
||||
|
||||
JSObject*
|
||||
|
@ -84,20 +131,10 @@ Icc::WrapObject(JSContext* aCx)
|
|||
|
||||
// MozIcc WebIDL
|
||||
|
||||
already_AddRefed<nsIDOMMozIccInfo>
|
||||
Icc::GetIccInfo() const
|
||||
void
|
||||
Icc::GetIccInfo(Nullable<OwningMozIccInfoOrMozGsmIccInfoOrMozCdmaIccInfo>& aIccInfo) const
|
||||
{
|
||||
if (!mProvider) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMMozIccInfo> iccInfo;
|
||||
nsresult rv = mProvider->GetIccInfo(mClientId, getter_AddRefs(iccInfo));
|
||||
if (NS_FAILED(rv)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return iccInfo.forget();
|
||||
aIccInfo = mIccInfo;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -5,8 +5,11 @@
|
|||
#ifndef mozilla_dom_Icc_h
|
||||
#define mozilla_dom_Icc_h
|
||||
|
||||
#include "mozilla/dom/UnionTypes.h"
|
||||
#include "mozilla/DOMEventTargetHelper.h"
|
||||
#include "nsIIccProvider.h"
|
||||
|
||||
class nsIIccInfo;
|
||||
class nsIIccProvider;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
@ -16,9 +19,11 @@ class DOMRequest;
|
|||
class Icc MOZ_FINAL : public DOMEventTargetHelper
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(Icc, DOMEventTargetHelper)
|
||||
NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper)
|
||||
|
||||
Icc(nsPIDOMWindow* aWindow, long aClientId, const nsAString& aIccId);
|
||||
Icc(nsPIDOMWindow* aWindow, long aClientId, nsIIccInfo* aIccInfo);
|
||||
|
||||
void
|
||||
Shutdown();
|
||||
|
@ -35,6 +40,9 @@ public:
|
|||
return mIccId;
|
||||
}
|
||||
|
||||
void
|
||||
UpdateIccInfo(nsIIccInfo* aIccInfo);
|
||||
|
||||
nsPIDOMWindow*
|
||||
GetParentObject() const
|
||||
{
|
||||
|
@ -46,8 +54,8 @@ public:
|
|||
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
|
||||
|
||||
// MozIcc WebIDL
|
||||
already_AddRefed<nsIDOMMozIccInfo>
|
||||
GetIccInfo() const;
|
||||
void
|
||||
GetIccInfo(Nullable<OwningMozIccInfoOrMozGsmIccInfoOrMozCdmaIccInfo>& aIccInfo) const;
|
||||
|
||||
void
|
||||
GetCardState(nsString& aCardState) const;
|
||||
|
@ -116,6 +124,7 @@ private:
|
|||
// mProvider is a xpcom service and will be released at shutdown, so it
|
||||
// doesn't need to be cycle collected.
|
||||
nsCOMPtr<nsIIccProvider> mProvider;
|
||||
Nullable<OwningMozIccInfoOrMozGsmIccInfoOrMozCdmaIccInfo> mIccInfo;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -0,0 +1,230 @@
|
|||
/* 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 "mozilla/dom/IccInfo.h"
|
||||
|
||||
#include "nsPIDOMWindow.h"
|
||||
|
||||
#define CONVERT_STRING_TO_NULLABLE_ENUM(_string, _enumType, _enum) \
|
||||
{ \
|
||||
uint32_t i = 0; \
|
||||
for (const EnumEntry* entry = _enumType##Values::strings; \
|
||||
entry->value; \
|
||||
++entry, ++i) { \
|
||||
if (_string.EqualsASCII(entry->value)) { \
|
||||
_enum.SetValue(static_cast<_enumType>(i)); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
// IccInfo
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(IccInfo, mWindow, mIccInfo)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(IccInfo)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(IccInfo)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(IccInfo)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
IccInfo::IccInfo(nsPIDOMWindow* aWindow)
|
||||
: mWindow(aWindow)
|
||||
{
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
|
||||
void
|
||||
IccInfo::Update(nsIIccInfo* aInfo)
|
||||
{
|
||||
mIccInfo = aInfo;
|
||||
}
|
||||
|
||||
JSObject*
|
||||
IccInfo::WrapObject(JSContext* aCx)
|
||||
{
|
||||
return MozIccInfoBinding::Wrap(aCx, this);
|
||||
}
|
||||
|
||||
Nullable<IccType>
|
||||
IccInfo::GetIccType() const
|
||||
{
|
||||
if (!mIccInfo) {
|
||||
return Nullable<IccType>();
|
||||
}
|
||||
|
||||
nsAutoString type;
|
||||
Nullable<IccType> iccType;
|
||||
|
||||
mIccInfo->GetIccType(type);
|
||||
CONVERT_STRING_TO_NULLABLE_ENUM(type, IccType, iccType);
|
||||
|
||||
return iccType;
|
||||
}
|
||||
|
||||
void
|
||||
IccInfo::GetIccid(nsAString& aIccId) const
|
||||
{
|
||||
if (!mIccInfo) {
|
||||
aIccId.SetIsVoid(true);
|
||||
return;
|
||||
}
|
||||
|
||||
mIccInfo->GetIccid(aIccId);
|
||||
}
|
||||
|
||||
void
|
||||
IccInfo::GetMcc(nsAString& aMcc) const
|
||||
{
|
||||
if (!mIccInfo) {
|
||||
aMcc.SetIsVoid(true);
|
||||
return;
|
||||
}
|
||||
|
||||
mIccInfo->GetMcc(aMcc);
|
||||
}
|
||||
|
||||
void
|
||||
IccInfo::GetMnc(nsAString& aMnc) const
|
||||
{
|
||||
if (!mIccInfo) {
|
||||
aMnc.SetIsVoid(true);
|
||||
return;
|
||||
}
|
||||
|
||||
mIccInfo->GetMnc(aMnc);
|
||||
}
|
||||
|
||||
void
|
||||
IccInfo::GetSpn(nsAString& aSpn) const
|
||||
{
|
||||
if (!mIccInfo) {
|
||||
aSpn.SetIsVoid(true);
|
||||
return;
|
||||
}
|
||||
|
||||
mIccInfo->GetSpn(aSpn);
|
||||
}
|
||||
|
||||
bool
|
||||
IccInfo::IsDisplayNetworkNameRequired() const
|
||||
{
|
||||
if (!mIccInfo) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isDisplayNetworkNameRequired;
|
||||
mIccInfo->GetIsDisplayNetworkNameRequired(&isDisplayNetworkNameRequired);
|
||||
|
||||
return isDisplayNetworkNameRequired;
|
||||
}
|
||||
|
||||
bool
|
||||
IccInfo::IsDisplaySpnRequired() const
|
||||
{
|
||||
if (!mIccInfo) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isDisplaySpnRequired;
|
||||
mIccInfo->GetIsDisplaySpnRequired(&isDisplaySpnRequired);
|
||||
|
||||
return isDisplaySpnRequired;
|
||||
}
|
||||
|
||||
// GsmIccInfo
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_INHERITED(GsmIccInfo, IccInfo, mGsmIccInfo)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(GsmIccInfo)
|
||||
NS_INTERFACE_MAP_END_INHERITING(IccInfo)
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(GsmIccInfo, IccInfo)
|
||||
NS_IMPL_RELEASE_INHERITED(GsmIccInfo, IccInfo)
|
||||
|
||||
GsmIccInfo::GsmIccInfo(nsPIDOMWindow* aWindow)
|
||||
: IccInfo(aWindow)
|
||||
{
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
|
||||
void
|
||||
GsmIccInfo::Update(nsIGsmIccInfo* aInfo)
|
||||
{
|
||||
IccInfo::Update(aInfo);
|
||||
mGsmIccInfo = aInfo;
|
||||
}
|
||||
|
||||
JSObject*
|
||||
GsmIccInfo::WrapObject(JSContext* aCx)
|
||||
{
|
||||
return MozGsmIccInfoBinding::Wrap(aCx, this);
|
||||
}
|
||||
|
||||
void
|
||||
GsmIccInfo::GetMsisdn(nsAString& aMsisdn) const
|
||||
{
|
||||
if (!mGsmIccInfo) {
|
||||
aMsisdn.SetIsVoid(true);
|
||||
return;
|
||||
}
|
||||
|
||||
mGsmIccInfo->GetMsisdn(aMsisdn);
|
||||
}
|
||||
|
||||
// CdmaIccInfo
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_INHERITED(CdmaIccInfo, IccInfo, mCdmaIccInfo)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(CdmaIccInfo)
|
||||
NS_INTERFACE_MAP_END_INHERITING(IccInfo)
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(CdmaIccInfo, IccInfo)
|
||||
NS_IMPL_RELEASE_INHERITED(CdmaIccInfo, IccInfo)
|
||||
|
||||
CdmaIccInfo::CdmaIccInfo(nsPIDOMWindow* aWindow)
|
||||
: IccInfo(aWindow)
|
||||
{
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
|
||||
void
|
||||
CdmaIccInfo::Update(nsICdmaIccInfo* aInfo)
|
||||
{
|
||||
IccInfo::Update(aInfo);
|
||||
mCdmaIccInfo = aInfo;
|
||||
}
|
||||
|
||||
JSObject*
|
||||
CdmaIccInfo::WrapObject(JSContext* aCx)
|
||||
{
|
||||
return MozCdmaIccInfoBinding::Wrap(aCx, this);
|
||||
}
|
||||
|
||||
void
|
||||
CdmaIccInfo::GetMdn(nsAString& aMdn) const
|
||||
{
|
||||
if (!mCdmaIccInfo) {
|
||||
aMdn.SetIsVoid(true);
|
||||
return;
|
||||
}
|
||||
|
||||
mCdmaIccInfo->GetMdn(aMdn);
|
||||
}
|
||||
|
||||
int32_t
|
||||
CdmaIccInfo::PrlVersion() const
|
||||
{
|
||||
if (!mCdmaIccInfo) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t prlVersion;
|
||||
mCdmaIccInfo->GetPrlVersion(&prlVersion);
|
||||
|
||||
return prlVersion;
|
||||
}
|
|
@ -0,0 +1,128 @@
|
|||
/* 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 mozilla_dom_IccInfo_h
|
||||
#define mozilla_dom_IccInfo_h
|
||||
|
||||
#include "MozIccInfoBinding.h"
|
||||
#include "nsIIccInfo.h"
|
||||
#include "nsWrapperCache.h"
|
||||
|
||||
class nsPIDOMWindow;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class IccInfo : public nsISupports
|
||||
, public nsWrapperCache
|
||||
{
|
||||
public:
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(IccInfo)
|
||||
|
||||
explicit IccInfo(nsPIDOMWindow* aWindow);
|
||||
|
||||
void
|
||||
Update(nsIIccInfo* aInfo);
|
||||
|
||||
nsPIDOMWindow*
|
||||
GetParentObject() const
|
||||
{
|
||||
return mWindow;
|
||||
}
|
||||
|
||||
// WrapperCache
|
||||
virtual JSObject*
|
||||
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
|
||||
|
||||
// WebIDL interface
|
||||
Nullable<IccType>
|
||||
GetIccType() const;
|
||||
|
||||
void
|
||||
GetIccid(nsAString& aIccId) const;
|
||||
|
||||
void
|
||||
GetMcc(nsAString& aMcc) const;
|
||||
|
||||
void
|
||||
GetMnc(nsAString& aMnc) const;
|
||||
|
||||
void
|
||||
GetSpn(nsAString& aSpn) const;
|
||||
|
||||
bool
|
||||
IsDisplayNetworkNameRequired() const;
|
||||
|
||||
bool
|
||||
IsDisplaySpnRequired() const;
|
||||
|
||||
protected:
|
||||
~IccInfo() {}
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsPIDOMWindow> mWindow;
|
||||
nsCOMPtr<nsIIccInfo> mIccInfo;
|
||||
};
|
||||
|
||||
class GsmIccInfo MOZ_FINAL : public IccInfo
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(GsmIccInfo, IccInfo)
|
||||
|
||||
explicit GsmIccInfo(nsPIDOMWindow* aWindow);
|
||||
|
||||
void
|
||||
Update(nsIGsmIccInfo* aInfo);
|
||||
|
||||
// WrapperCache
|
||||
virtual JSObject*
|
||||
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
|
||||
|
||||
// MozCdmaIccInfo WebIDL
|
||||
void
|
||||
GetMsisdn(nsAString& aMsisdn) const;
|
||||
|
||||
private:
|
||||
~GsmIccInfo() {}
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIGsmIccInfo> mGsmIccInfo;
|
||||
};
|
||||
|
||||
class CdmaIccInfo MOZ_FINAL : public IccInfo
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(CdmaIccInfo, IccInfo)
|
||||
|
||||
explicit CdmaIccInfo(nsPIDOMWindow* aWindow);
|
||||
|
||||
void
|
||||
Update(nsICdmaIccInfo* aInfo);
|
||||
|
||||
// WrapperCache
|
||||
virtual JSObject*
|
||||
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
|
||||
|
||||
// MozCdmaIccInfo WebIDL
|
||||
void
|
||||
GetMdn(nsAString& aMdn) const;
|
||||
|
||||
int32_t
|
||||
PrlVersion() const;
|
||||
|
||||
private:
|
||||
~CdmaIccInfo() {}
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsICdmaIccInfo> mCdmaIccInfo;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_dom_IccInfo_h
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
#include "Icc.h"
|
||||
#include "IccManager.h"
|
||||
#include "nsIDOMClassInfo.h"
|
||||
#include "nsIDOMIccInfo.h"
|
||||
#include "nsIIccInfo.h"
|
||||
#include "nsRadioInterfaceLayer.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
@ -27,13 +27,13 @@ IccListener::IccListener(IccManager* aIccManager, uint32_t aClientId)
|
|||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMMozIccInfo> iccInfo;
|
||||
nsCOMPtr<nsIIccInfo> iccInfo;
|
||||
mProvider->GetIccInfo(mClientId, getter_AddRefs(iccInfo));
|
||||
if (iccInfo) {
|
||||
nsString iccId;
|
||||
iccInfo->GetIccid(iccId);
|
||||
if (!iccId.IsEmpty()) {
|
||||
mIcc = new Icc(mIccManager->GetOwner(), mClientId, iccId);
|
||||
mIcc = new Icc(mIccManager->GetOwner(), mClientId, iccInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ IccListener::NotifyCardStateChanged()
|
|||
NS_IMETHODIMP
|
||||
IccListener::NotifyIccInfoChanged()
|
||||
{
|
||||
nsCOMPtr<nsIDOMMozIccInfo> iccInfo;
|
||||
nsCOMPtr<nsIIccInfo> iccInfo;
|
||||
mProvider->GetIccInfo(mClientId, getter_AddRefs(iccInfo));
|
||||
|
||||
// Create/delete icc object based on current iccInfo.
|
||||
|
@ -111,12 +111,13 @@ IccListener::NotifyIccInfoChanged()
|
|||
nsString iccId;
|
||||
iccInfo->GetIccid(iccId);
|
||||
if (!iccId.IsEmpty()) {
|
||||
mIcc = new Icc(mIccManager->GetOwner(), mClientId, iccId);
|
||||
mIcc = new Icc(mIccManager->GetOwner(), mClientId, iccInfo);
|
||||
mIccManager->NotifyIccAdd(iccId);
|
||||
mIcc->NotifyEvent(NS_LITERAL_STRING("iccinfochange"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mIcc->UpdateIccInfo(iccInfo);
|
||||
mIcc->NotifyEvent(NS_LITERAL_STRING("iccinfochange"));
|
||||
if (!iccInfo) {
|
||||
nsString iccId = mIcc->GetIccId();
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "IccListener.h"
|
||||
#include "mozilla/dom/IccChangeEvent.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "nsIDOMIccInfo.h"
|
||||
#include "nsIIccInfo.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'nsIDOMIccInfo.idl',
|
||||
'nsIIccInfo.idl',
|
||||
'nsIIccProvider.idl',
|
||||
]
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[scriptable, uuid(dd9f229c-e5a6-453a-8388-950af0ff9918)]
|
||||
interface nsIDOMMozIccInfo : nsISupports
|
||||
[scriptable, uuid(3ba11a90-34e0-11e4-8c21-0800200c9a66)]
|
||||
interface nsIIccInfo : nsISupports
|
||||
{
|
||||
/**
|
||||
* Integrated Circuit Card Type.
|
||||
|
@ -45,8 +45,8 @@ interface nsIDOMMozIccInfo : nsISupports
|
|||
readonly attribute boolean isDisplaySpnRequired;
|
||||
};
|
||||
|
||||
[scriptable, uuid(3c237e39-7af3-4748-baf4-4a3b6c3e0e66)]
|
||||
interface nsIDOMMozGsmIccInfo : nsIDOMMozIccInfo
|
||||
[scriptable, uuid(6c9c78b0-34e0-11e4-8c21-0800200c9a66)]
|
||||
interface nsIGsmIccInfo : nsIIccInfo
|
||||
{
|
||||
/**
|
||||
* Mobile Station ISDN Number (MSISDN) of the subscriber, aka
|
||||
|
@ -55,8 +55,8 @@ interface nsIDOMMozGsmIccInfo : nsIDOMMozIccInfo
|
|||
readonly attribute DOMString msisdn;
|
||||
};
|
||||
|
||||
[scriptable, uuid(7e937d09-4d1d-43c5-96d8-c91396022809)]
|
||||
interface nsIDOMMozCdmaIccInfo : nsIDOMMozIccInfo
|
||||
[scriptable, uuid(7452f570-34e0-11e4-8c21-0800200c9a66)]
|
||||
interface nsICdmaIccInfo : nsIIccInfo
|
||||
{
|
||||
/**
|
||||
* Mobile Directory Number (MDN) of the subscriber, aka his phone number.
|
|
@ -5,8 +5,8 @@
|
|||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIDOMDOMRequest;
|
||||
interface nsIDOMMozIccInfo;
|
||||
interface nsIDOMWindow;
|
||||
interface nsIIccInfo;
|
||||
|
||||
[scriptable, uuid(7c0ada3d-d8d4-493e-9243-fa3df39855e4)]
|
||||
interface nsIIccListener : nsISupports
|
||||
|
@ -20,7 +20,7 @@ interface nsIIccListener : nsISupports
|
|||
/**
|
||||
* XPCOM component (in the content process) that provides the ICC information.
|
||||
*/
|
||||
[scriptable, uuid(7c67ab92-52a3-4e11-995c-c0ad2f66c4cb)]
|
||||
[scriptable, uuid(1afa72d0-3d70-11e4-916c-0800200c9a66)]
|
||||
interface nsIIccProvider : nsISupports
|
||||
{
|
||||
/**
|
||||
|
@ -34,7 +34,7 @@ interface nsIIccProvider : nsISupports
|
|||
/**
|
||||
* UICC Information
|
||||
*/
|
||||
nsIDOMMozIccInfo getIccInfo(in unsigned long clientId);
|
||||
nsIIccInfo getIccInfo(in unsigned long clientId);
|
||||
|
||||
/**
|
||||
* Card State
|
||||
|
|
|
@ -8,11 +8,13 @@ DIRS += ['interfaces']
|
|||
|
||||
EXPORTS.mozilla.dom += [
|
||||
'Icc.h',
|
||||
'IccInfo.h',
|
||||
'IccManager.h',
|
||||
]
|
||||
|
||||
UNIFIED_SOURCES += [
|
||||
'Icc.cpp',
|
||||
"IccInfo.cpp",
|
||||
'IccListener.cpp',
|
||||
'IccManager.cpp',
|
||||
]
|
||||
|
|
|
@ -35,7 +35,7 @@ taskHelper.push(function basicTest() {
|
|||
// See it here {B2G_HOME}/external/qemu/telephony/sim_card.c#L299.
|
||||
is(iccInfo.iccid, 89014103211118510720);
|
||||
|
||||
if (iccInfo instanceof Ci.nsIDOMMozGsmIccInfo) {
|
||||
if (iccInfo instanceof MozGsmIccInfo) {
|
||||
log("Test Gsm IccInfo");
|
||||
is(iccInfo.iccType, "sim");
|
||||
is(iccInfo.spn, "Android");
|
||||
|
|
|
@ -339,10 +339,10 @@ MmsConnection.prototype = {
|
|||
* Get phone number from iccInfo.
|
||||
*
|
||||
* If the icc card is gsm card, the phone number is in msisdn.
|
||||
* @see nsIDOMMozGsmIccInfo
|
||||
* @see nsIGsmIccInfo
|
||||
*
|
||||
* Otherwise, the phone number is in mdn.
|
||||
* @see nsIDOMMozCdmaIccInfo
|
||||
* @see nsICdmaIccInfo
|
||||
*/
|
||||
getPhoneNumber: function() {
|
||||
let number;
|
||||
|
@ -351,10 +351,10 @@ MmsConnection.prototype = {
|
|||
let iccInfo = null;
|
||||
let baseIccInfo = this.radioInterface.rilContext.iccInfo;
|
||||
if (baseIccInfo.iccType === 'ruim' || baseIccInfo.iccType === 'csim') {
|
||||
iccInfo = baseIccInfo.QueryInterface(Ci.nsIDOMMozCdmaIccInfo);
|
||||
iccInfo = baseIccInfo.QueryInterface(Ci.nsICdmaIccInfo);
|
||||
number = iccInfo.mdn;
|
||||
} else {
|
||||
iccInfo = baseIccInfo.QueryInterface(Ci.nsIDOMMozGsmIccInfo);
|
||||
iccInfo = baseIccInfo.QueryInterface(Ci.nsIGsmIccInfo);
|
||||
number = iccInfo.msisdn;
|
||||
}
|
||||
} catch (e) {
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include "prtime.h"
|
||||
|
||||
#ifdef MOZ_B2G_RIL
|
||||
#include "nsIDOMIccInfo.h"
|
||||
#include "nsIIccInfo.h"
|
||||
#include "nsIMobileConnectionInfo.h"
|
||||
#include "nsIMobileConnectionService.h"
|
||||
#include "nsIMobileCellInfo.h"
|
||||
|
@ -459,10 +459,10 @@ GonkGPSGeolocationProvider::RequestSetID(uint32_t flags)
|
|||
}
|
||||
|
||||
if (flags & AGPS_RIL_REQUEST_SETID_MSISDN) {
|
||||
nsCOMPtr<nsIDOMMozIccInfo> iccInfo;
|
||||
nsCOMPtr<nsIIccInfo> iccInfo;
|
||||
rilCtx->GetIccInfo(getter_AddRefs(iccInfo));
|
||||
if (iccInfo) {
|
||||
nsCOMPtr<nsIDOMMozGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo);
|
||||
nsCOMPtr<nsIGsmIccInfo> gsmIccInfo = do_QueryInterface(iccInfo);
|
||||
if (gsmIccInfo) {
|
||||
type = AGPS_SETID_TYPE_MSISDN;
|
||||
gsmIccInfo->GetMsisdn(id);
|
||||
|
@ -494,7 +494,7 @@ GonkGPSGeolocationProvider::SetReferenceLocation()
|
|||
location.type = AGPS_REF_LOCATION_TYPE_UMTS_CELLID;
|
||||
|
||||
if (rilCtx) {
|
||||
nsCOMPtr<nsIDOMMozIccInfo> iccInfo;
|
||||
nsCOMPtr<nsIIccInfo> iccInfo;
|
||||
rilCtx->GetIccInfo(getter_AddRefs(iccInfo));
|
||||
if (iccInfo) {
|
||||
nsresult result;
|
||||
|
|
|
@ -41,12 +41,6 @@ function debug(s) {
|
|||
|
||||
const RILCONTENTHELPER_CID =
|
||||
Components.ID("{472816e1-1fd6-4405-996c-806f9ea68174}");
|
||||
const ICCINFO_CID =
|
||||
Components.ID("{39d64d90-26a6-11e4-8c21-0800200c9a66}");
|
||||
const GSMICCINFO_CID =
|
||||
Components.ID("{e0fa785b-ad3f-46ed-bc56-fcb0d6fe4fa8}");
|
||||
const CDMAICCINFO_CID =
|
||||
Components.ID("{3d1f844f-9ec5-48fb-8907-aed2e5421709}");
|
||||
const ICCCARDLOCKERROR_CID =
|
||||
Components.ID("{08a71987-408c-44ff-93fd-177c0a85c3dd}");
|
||||
|
||||
|
@ -108,16 +102,9 @@ MobileIccCardLockRetryCount.prototype = {
|
|||
|
||||
function IccInfo() {}
|
||||
IccInfo.prototype = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIDOMMozIccInfo]),
|
||||
classID: ICCINFO_CID,
|
||||
classInfo: XPCOMUtils.generateCI({
|
||||
classID: ICCINFO_CID,
|
||||
classDescription: "MozIccInfo",
|
||||
flags: Ci.nsIClassInfo.DOM_OBJECT,
|
||||
interfaces: [Ci.nsIDOMMozIccInfo]
|
||||
}),
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIIccInfo]),
|
||||
|
||||
// nsIDOMMozIccInfo
|
||||
// nsIIccInfo
|
||||
|
||||
iccType: null,
|
||||
iccid: null,
|
||||
|
@ -130,34 +117,20 @@ IccInfo.prototype = {
|
|||
|
||||
function GsmIccInfo() {}
|
||||
GsmIccInfo.prototype = {
|
||||
__proto__: IccInfo.prototype,
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIDOMMozGsmIccInfo]),
|
||||
classID: GSMICCINFO_CID,
|
||||
classInfo: XPCOMUtils.generateCI({
|
||||
classID: GSMICCINFO_CID,
|
||||
classDescription: "MozGsmIccInfo",
|
||||
flags: Ci.nsIClassInfo.DOM_OBJECT,
|
||||
interfaces: [Ci.nsIDOMMozGsmIccInfo]
|
||||
}),
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIGsmIccInfo,
|
||||
Ci.nsIIccInfo]),
|
||||
|
||||
// nsIDOMMozGsmIccInfo
|
||||
// nsIGsmIccInfo
|
||||
|
||||
msisdn: null
|
||||
};
|
||||
|
||||
function CdmaIccInfo() {}
|
||||
CdmaIccInfo.prototype = {
|
||||
__proto__: IccInfo.prototype,
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIDOMMozCdmaIccInfo]),
|
||||
classID: CDMAICCINFO_CID,
|
||||
classInfo: XPCOMUtils.generateCI({
|
||||
classID: CDMAICCINFO_CID,
|
||||
classDescription: "MozCdmaIccInfo",
|
||||
flags: Ci.nsIClassInfo.DOM_OBJECT,
|
||||
interfaces: [Ci.nsIDOMMozCdmaIccInfo]
|
||||
}),
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsICdmaIccInfo,
|
||||
Ci.nsIIccInfo]),
|
||||
|
||||
// nsIDOMMozCdmaIccInfo
|
||||
// nsICdmaIccInfo
|
||||
|
||||
mdn: null,
|
||||
prlVersion: 0
|
||||
|
|
|
@ -53,12 +53,6 @@ const RADIOINTERFACE_CID =
|
|||
Components.ID("{6a7c91f0-a2b3-4193-8562-8969296c0b54}");
|
||||
const RILNETWORKINTERFACE_CID =
|
||||
Components.ID("{3bdd52a9-3965-4130-b569-0ac5afed045e}");
|
||||
const ICCINFO_CID =
|
||||
Components.ID("{52eec7f0-26a4-11e4-8c21-0800200c9a66}");
|
||||
const GSMICCINFO_CID =
|
||||
Components.ID("{d90c4261-a99d-47bc-8b05-b057bb7e8f8a}");
|
||||
const CDMAICCINFO_CID =
|
||||
Components.ID("{39ba3c08-aacc-46d0-8c04-9b619c387061}");
|
||||
const NEIGHBORINGCELLINFO_CID =
|
||||
Components.ID("{f9dfe26a-851e-4a8b-a769-cbb1baae7ded}");
|
||||
const GSMCELLINFO_CID =
|
||||
|
@ -941,16 +935,9 @@ try {
|
|||
|
||||
function IccInfo() {}
|
||||
IccInfo.prototype = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIDOMMozIccInfo]),
|
||||
classID: ICCINFO_CID,
|
||||
classInfo: XPCOMUtils.generateCI({
|
||||
classID: ICCINFO_CID,
|
||||
classDescription: "MozIccInfo",
|
||||
flags: Ci.nsIClassInfo.DOM_OBJECT,
|
||||
interfaces: [Ci.nsIDOMMozIccInfo]
|
||||
}),
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIIccInfo]),
|
||||
|
||||
// nsIDOMMozIccInfo
|
||||
// nsIIccInfo
|
||||
|
||||
iccType: null,
|
||||
iccid: null,
|
||||
|
@ -964,16 +951,10 @@ IccInfo.prototype = {
|
|||
function GsmIccInfo() {}
|
||||
GsmIccInfo.prototype = {
|
||||
__proto__: IccInfo.prototype,
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIDOMMozGsmIccInfo]),
|
||||
classID: GSMICCINFO_CID,
|
||||
classInfo: XPCOMUtils.generateCI({
|
||||
classID: GSMICCINFO_CID,
|
||||
classDescription: "MozGsmIccInfo",
|
||||
flags: Ci.nsIClassInfo.DOM_OBJECT,
|
||||
interfaces: [Ci.nsIDOMMozGsmIccInfo]
|
||||
}),
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIGsmIccInfo,
|
||||
Ci.nsIIccInfo]),
|
||||
|
||||
// nsIDOMMozGsmIccInfo
|
||||
// nsIGsmIccInfo
|
||||
|
||||
msisdn: null
|
||||
};
|
||||
|
@ -981,16 +962,10 @@ GsmIccInfo.prototype = {
|
|||
function CdmaIccInfo() {}
|
||||
CdmaIccInfo.prototype = {
|
||||
__proto__: IccInfo.prototype,
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIDOMMozCdmaIccInfo]),
|
||||
classID: CDMAICCINFO_CID,
|
||||
classInfo: XPCOMUtils.generateCI({
|
||||
classID: CDMAICCINFO_CID,
|
||||
classDescription: "MozCdmaIccInfo",
|
||||
flags: Ci.nsIClassInfo.DOM_OBJECT,
|
||||
interfaces: [Ci.nsIDOMMozCdmaIccInfo]
|
||||
}),
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsICdmaIccInfo,
|
||||
Ci.nsIIccInfo]),
|
||||
|
||||
// nsIDOMMozCdmaIccInfo
|
||||
// nsICdmaIccInfo
|
||||
|
||||
mdn: null,
|
||||
prlVersion: 0
|
||||
|
@ -2141,10 +2116,10 @@ RadioInterface.prototype = {
|
|||
* Get phone number from iccInfo.
|
||||
*
|
||||
* If the icc card is gsm card, the phone number is in msisdn.
|
||||
* @see nsIDOMMozGsmIccInfo
|
||||
* @see nsIGsmIccInfo
|
||||
*
|
||||
* Otherwise, the phone number is in mdn.
|
||||
* @see nsIDOMMozCdmaIccInfo
|
||||
* @see nsICdmaIccInfo
|
||||
*/
|
||||
getPhoneNumber: function() {
|
||||
let iccInfo = this.rilContext.iccInfo;
|
||||
|
@ -2154,7 +2129,7 @@ RadioInterface.prototype = {
|
|||
}
|
||||
|
||||
// After moving SMS code out of RadioInterfaceLayer, we could use
|
||||
// |iccInfo instanceof Ci.nsIDOMMozGsmIccInfo| here.
|
||||
// |iccInfo instanceof Ci.nsIGsmIccInfo| here.
|
||||
// TODO: Bug 873351 - B2G SMS: move SMS code out of RadioInterfaceLayer to
|
||||
// SmsService
|
||||
let number = (iccInfo instanceof GsmIccInfo) ? iccInfo.msisdn : iccInfo.mdn;
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
#include "nsISupports.idl"
|
||||
#include "nsINetworkManager.idl"
|
||||
|
||||
interface nsIDOMMozIccInfo;
|
||||
interface nsICellInfoListCallback;
|
||||
interface nsIIccInfo;
|
||||
interface nsIMobileConnectionInfo;
|
||||
interface nsIMobileMessageCallback;
|
||||
interface nsINeighboringCellIdsCallback;
|
||||
interface nsICellInfoListCallback;
|
||||
|
||||
[scriptable, uuid(6e0f45b8-410e-11e3-8c8e-b715b2cd0128)]
|
||||
interface nsIRilNetworkInterface : nsINetworkInterface
|
||||
|
@ -23,14 +23,14 @@ interface nsIRilNetworkInterface : nsINetworkInterface
|
|||
readonly attribute long mmsPort; // -1 if not set.
|
||||
};
|
||||
|
||||
[scriptable, uuid(0226a2c1-a3b9-416a-92cb-c89e4dad4be0)]
|
||||
[scriptable, uuid(08a69c70-34b1-11e4-8c21-0800200c9a66)]
|
||||
interface nsIRilContext : nsISupports
|
||||
{
|
||||
readonly attribute DOMString cardState;
|
||||
|
||||
readonly attribute DOMString imsi;
|
||||
|
||||
readonly attribute nsIDOMMozIccInfo iccInfo;
|
||||
readonly attribute nsIIccInfo iccInfo;
|
||||
};
|
||||
|
||||
[scriptable, function, uuid(3bc96351-53b0-47a1-a888-c74c64b60f25)]
|
||||
|
|
|
@ -2725,6 +2725,13 @@ RilObject.prototype = {
|
|||
queryCallBarringStatus: function(options) {
|
||||
options.facility = CALL_BARRING_PROGRAM_TO_FACILITY[options.program];
|
||||
options.password = ""; // For query no need to provide it.
|
||||
|
||||
// For some operators, querying specific serviceClass doesn't work. We use
|
||||
// serviceClass 0 instead, and then process the response to extract the
|
||||
// answer for queryServiceClass.
|
||||
options.queryServiceClass = options.serviceClass;
|
||||
options.serviceClass = 0;
|
||||
|
||||
this.queryICCFacilityLock(options);
|
||||
},
|
||||
|
||||
|
@ -5930,20 +5937,23 @@ RilObject.prototype[REQUEST_QUERY_FACILITY_LOCK] = function REQUEST_QUERY_FACILI
|
|||
return;
|
||||
}
|
||||
|
||||
let services;
|
||||
if (length) {
|
||||
// Buf.readInt32List()[0] for Call Barring is a bit vector of services.
|
||||
services = this.context.Buf.readInt32List()[0];
|
||||
} else {
|
||||
if (!length) {
|
||||
options.success = false;
|
||||
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
|
||||
this.sendChromeMessage(options);
|
||||
return;
|
||||
}
|
||||
|
||||
options.enabled = services === 0 ? false : true;
|
||||
// Buf.readInt32List()[0] for Call Barring is a bit vector of services.
|
||||
let services = this.context.Buf.readInt32List()[0];
|
||||
|
||||
if (options.success && (options.rilMessageType === "sendMMI")) {
|
||||
if (options.queryServiceClass) {
|
||||
options.enabled = (services & options.queryServiceClass) ? true : false;
|
||||
} else {
|
||||
options.enabled = services ? true : false;
|
||||
}
|
||||
|
||||
if (options.rilMessageType === "sendMMI") {
|
||||
if (!options.enabled) {
|
||||
options.statusMessage = MMI_SM_KS_SERVICE_DISABLED;
|
||||
} else {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
[DEFAULT]
|
||||
skip-if = e10s
|
||||
support-files =
|
||||
497633.html
|
||||
file_MozEnteredDomFullscreen.html
|
||||
|
@ -35,7 +34,7 @@ support-files =
|
|||
resource_timing.js
|
||||
|
||||
[test_497898.html]
|
||||
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') || toolkit == 'android' #Bug 931116, b2g desktop specific, initial triage
|
||||
skip-if = ((buildapp == 'mulet' || buildapp == 'b2g') && toolkit != 'gonk') || toolkit == 'android' #Bug 931116, b2g desktop specific, initial triage
|
||||
[test_bug504220.html]
|
||||
[test_bug628069_1.html]
|
||||
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
|
||||
|
@ -46,7 +45,7 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop spec
|
|||
[test_bug861217.html]
|
||||
[test_clientRects.html]
|
||||
[test_clipboard_events.html]
|
||||
skip-if = buildapp == 'b2g' # b2g(clipboard undefined) b2g-debug(clipboard undefined) b2g-desktop(clipboard undefined)
|
||||
skip-if = e10s || buildapp == 'b2g' # b2g(clipboard undefined) b2g-debug(clipboard undefined) b2g-desktop(clipboard undefined)
|
||||
[test_consoleAPI.html]
|
||||
[test_DOMMatrix.html]
|
||||
[test_domWindowUtils.html]
|
||||
|
@ -56,12 +55,12 @@ skip-if = buildapp == 'b2g' # b2g(clipboard undefined) b2g-debug(clipboard undef
|
|||
skip-if = buildapp == 'mulet'
|
||||
[test_focus_legend_noparent.html]
|
||||
[test_focusrings.xul]
|
||||
skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT
|
||||
skip-if = e10s || buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT
|
||||
[test_for_of.html]
|
||||
[test_frameElementWrapping.html]
|
||||
[test_framedhistoryframes.html]
|
||||
[test_idleapi_permissions.html]
|
||||
skip-if = buildapp == 'b2g' || buildapp == 'mulet'
|
||||
skip-if = e10s || buildapp == 'b2g' || buildapp == 'mulet'
|
||||
[test_interfaces.html]
|
||||
skip-if = ((buildapp == 'mulet' || buildapp == 'b2g') && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
|
||||
# [test_network_events.html]
|
||||
|
@ -75,13 +74,13 @@ skip-if = buildapp == 'mulet'
|
|||
skip-if = buildapp == 'mulet'
|
||||
[test_picture_pref.html]
|
||||
[test_resource_timing.html]
|
||||
skip-if = buildapp == 'b2g' || buildapp == 'mulet' # b2g(No clipboard) b2g-debug(No clipboard) b2g-desktop(No clipboard)
|
||||
skip-if = buildapp == 'b2g' || buildapp == 'mulet'
|
||||
[test_resource_timing_cross_origin.html]
|
||||
skip-if = buildapp == 'b2g' || buildapp == 'mulet'
|
||||
[test_performance_now.html]
|
||||
[test_srcset_pref.html]
|
||||
[test_showModalDialog.html]
|
||||
skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' #Don't run modal tests on Android # b2g(showmodaldialog) b2g-debug(showmodaldialog) b2g-desktop(showmodaldialog)
|
||||
skip-if = e10s || buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' #Don't run modal tests on Android # b2g(showmodaldialog) b2g-debug(showmodaldialog) b2g-desktop(showmodaldialog)
|
||||
[test_stylesheetPI.html]
|
||||
[test_vibrator.html]
|
||||
skip-if = buildapp == 'mulet' || toolkit == 'android' #CRASH_SUTAGENT
|
||||
|
|
|
@ -700,16 +700,22 @@ var interfaceNamesInGlobalScope =
|
|||
"MozCSSKeyframeRule",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
"MozCSSKeyframesRule",
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "MozCdmaIccInfo", b2g: true, pref: "dom.icc.enabled"},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "MozEmergencyCbModeEvent", b2g: true, pref: "dom.mobileconnection.enabled"},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "MozIcc", b2g: true, pref: "dom.icc.enabled"},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "MozIccInfo", b2g: true, pref: "dom.icc.enabled"},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "MozIccManager", b2g: true, pref: "dom.icc.enabled"},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "MozInputContext", b2g: true},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "MozInputMethodManager", b2g: true},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "MozGsmIccInfo", b2g: true, pref: "dom.icc.enabled"},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "MozMessageDeletedEvent", b2g: true, pref: "dom.sms.enabled"},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
|
|
|
@ -20,12 +20,15 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=822480
|
|||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
// Resource timing is prefed off by default, so we had to use this workaround
|
||||
SpecialPowers.setBoolPref("dom.enable_resource_timing", true);
|
||||
var subwindow = window.open("resource_timing_main_test.html");
|
||||
SpecialPowers.pushPrefEnv({"set": [["dom.enable_resource_timing", true]]}, start);
|
||||
var subwindow = null;
|
||||
|
||||
function start() {
|
||||
subwindow = window.open("resource_timing_main_test.html");
|
||||
}
|
||||
|
||||
function finishTests() {
|
||||
subwindow.close();
|
||||
SpecialPowers.setBoolPref("dom.enable_resource_timing", false);
|
||||
SimpleTest.finish();
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
* 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/. */
|
||||
|
||||
interface MozIccInfo;
|
||||
|
||||
[Pref="dom.icc.enabled"]
|
||||
interface MozIcc : EventTarget
|
||||
{
|
||||
|
@ -16,7 +14,7 @@ interface MozIcc : EventTarget
|
|||
* Also, the attribute is set to null and this MozIcc object becomes invalid.
|
||||
* Calling asynchronous functions raises exception then.
|
||||
*/
|
||||
readonly attribute MozIccInfo? iccInfo;
|
||||
readonly attribute (MozIccInfo or MozGsmIccInfo or MozCdmaIccInfo)? iccInfo;
|
||||
|
||||
/**
|
||||
* The 'iccinfochange' event is notified whenever the icc info object
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
/* 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/. */
|
||||
|
||||
enum IccType {"sim", "usim", "csim", "ruim"};
|
||||
|
||||
[Pref="dom.icc.enabled"]
|
||||
interface MozIccInfo {
|
||||
/**
|
||||
* Integrated Circuit Card Type.
|
||||
*/
|
||||
readonly attribute IccType? iccType;
|
||||
|
||||
/**
|
||||
* Integrated Circuit Card Identifier.
|
||||
*/
|
||||
readonly attribute DOMString? iccid;
|
||||
|
||||
/**
|
||||
* Mobile Country Code (MCC) of the subscriber's home network.
|
||||
*/
|
||||
readonly attribute DOMString? mcc;
|
||||
|
||||
/**
|
||||
* Mobile Network Code (MNC) of the subscriber's home network.
|
||||
*/
|
||||
readonly attribute DOMString? mnc;
|
||||
|
||||
/**
|
||||
* Service Provider Name (SPN) of the subscriber's home network.
|
||||
*/
|
||||
readonly attribute DOMString? spn;
|
||||
|
||||
/**
|
||||
* Network name must be a part of displayed carrier name.
|
||||
*/
|
||||
readonly attribute boolean isDisplayNetworkNameRequired;
|
||||
|
||||
/**
|
||||
* Service provider name must be a part of displayed carrier name.
|
||||
*/
|
||||
readonly attribute boolean isDisplaySpnRequired;
|
||||
};
|
||||
|
||||
[Pref="dom.icc.enabled"]
|
||||
interface MozGsmIccInfo : MozIccInfo {
|
||||
/**
|
||||
* Mobile Station ISDN Number (MSISDN) of the subscriber, aka
|
||||
* his phone number.
|
||||
*/
|
||||
readonly attribute DOMString? msisdn;
|
||||
};
|
||||
|
||||
[Pref="dom.icc.enabled"]
|
||||
interface MozCdmaIccInfo : MozIccInfo {
|
||||
/**
|
||||
* Mobile Directory Number (MDN) of the subscriber, aka his phone number.
|
||||
*/
|
||||
readonly attribute DOMString? mdn;
|
||||
|
||||
/**
|
||||
* Preferred Roaming List (PRL) version of the subscriber.
|
||||
*/
|
||||
readonly attribute long prlVersion;
|
||||
};
|
|
@ -616,6 +616,7 @@ if CONFIG['MOZ_B2G_RIL']:
|
|||
WEBIDL_FILES += [
|
||||
'IccCardLockError.webidl',
|
||||
'MozIcc.webidl',
|
||||
'MozIccInfo.webidl',
|
||||
'MozIccManager.webidl',
|
||||
]
|
||||
|
||||
|
|
|
@ -14,6 +14,10 @@ namespace gfx {
|
|||
class AutoRestoreTransform
|
||||
{
|
||||
public:
|
||||
AutoRestoreTransform()
|
||||
{
|
||||
}
|
||||
|
||||
explicit AutoRestoreTransform(DrawTarget *aTarget)
|
||||
: mDrawTarget(aTarget),
|
||||
mOldTransform(aTarget->GetTransform())
|
||||
|
|
|
@ -10,6 +10,10 @@
|
|||
#include <sstream>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef MOZ_LOGGING
|
||||
#include <prlog.h>
|
||||
#endif
|
||||
|
||||
#if defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_ANDROID)
|
||||
#include "nsDebug.h"
|
||||
#endif
|
||||
|
@ -29,9 +33,7 @@
|
|||
extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA(const char* lpOutputString);
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG) || defined(PR_LOGGING)
|
||||
#include <prlog.h>
|
||||
|
||||
#if defined(PR_LOGGING)
|
||||
extern GFX2D_API PRLogModuleInfo *GetGFX2DLog();
|
||||
#endif
|
||||
|
||||
|
@ -42,7 +44,7 @@ const int LOG_DEBUG = 1;
|
|||
const int LOG_WARNING = 2;
|
||||
const int LOG_CRITICAL = 3;
|
||||
|
||||
#if defined(DEBUG) || defined(PR_LOGGING)
|
||||
#if defined(PR_LOGGING)
|
||||
|
||||
inline PRLogModuleLevel PRLogLevelForLevel(int aLevel) {
|
||||
switch (aLevel) {
|
||||
|
|
|
@ -124,7 +124,7 @@ namespace gl
|
|||
#endif
|
||||
|
||||
// A macro functioning as a compile-time assert to validate constant conditions
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1600
|
||||
#if (defined(_MSC_VER) && _MSC_VER >= 1600) || (defined(__GNUC__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 3))
|
||||
#define META_ASSERT_MSG(condition, msg) static_assert(condition, msg)
|
||||
#else
|
||||
#define META_ASSERT_CONCAT(a, b) a ## b
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include <map>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
#include <iterator>
|
||||
|
||||
#include "common/debug.h"
|
||||
#include "common/mathutil.h"
|
||||
|
|
|
@ -54,7 +54,6 @@ DISABLE_STL_WRAPPING = True
|
|||
|
||||
LOCAL_INCLUDES += [ '../../include', '../../src' ]
|
||||
USE_LIBS += [ 'libGLESv2' ]
|
||||
EXTRA_DSO_LDOPTS += [ '../libGLESv2/libGLESv2.lib' ]
|
||||
|
||||
SharedLibrary('libEGL')
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
'libGLESv2/Buffer.h',
|
||||
'libGLESv2/Caps.cpp',
|
||||
'libGLESv2/Caps.h',
|
||||
'libGLESv2/Constants.h',
|
||||
'libGLESv2/Context.cpp',
|
||||
'libGLESv2/Context.h',
|
||||
'libGLESv2/Error.cpp',
|
||||
|
@ -87,7 +88,6 @@
|
|||
'libGLESv2/VertexAttribute.h',
|
||||
'libGLESv2/angletypes.cpp',
|
||||
'libGLESv2/angletypes.h',
|
||||
'libGLESv2/constants.h',
|
||||
'libGLESv2/formatutils.cpp',
|
||||
'libGLESv2/formatutils.h',
|
||||
'libGLESv2/libGLESv2.cpp',
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "libEGL/Surface.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <iterator>
|
||||
|
||||
namespace gl
|
||||
{
|
||||
|
@ -341,7 +342,7 @@ void Context::deleteFenceSync(GLsync fenceSync)
|
|||
// wait commands finish. However, since the name becomes invalid, we cannot query the fence,
|
||||
// and since our API is currently designed for being called from a single thread, we can delete
|
||||
// the fence immediately.
|
||||
mResourceManager->deleteFenceSync(reinterpret_cast<GLuint>(fenceSync));
|
||||
mResourceManager->deleteFenceSync(reinterpret_cast<uintptr_t>(fenceSync));
|
||||
}
|
||||
|
||||
void Context::deleteVertexArray(GLuint vertexArray)
|
||||
|
@ -447,7 +448,7 @@ Renderbuffer *Context::getRenderbuffer(GLuint handle)
|
|||
|
||||
FenceSync *Context::getFenceSync(GLsync handle) const
|
||||
{
|
||||
return mResourceManager->getFenceSync(reinterpret_cast<GLuint>(handle));
|
||||
return mResourceManager->getFenceSync(reinterpret_cast<uintptr_t>(handle));
|
||||
}
|
||||
|
||||
VertexArray *Context::getVertexArray(GLuint handle) const
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#include "common/angleutils.h"
|
||||
#include "common/RefCountObject.h"
|
||||
#include "constants.h"
|
||||
#include "Constants.h"
|
||||
|
||||
namespace rx
|
||||
{
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include "common/debug.h"
|
||||
#include "common/RefCountObject.h"
|
||||
#include "libGLESv2/angletypes.h"
|
||||
#include "libGLESv2/constants.h"
|
||||
#include "libGLESv2/Constants.h"
|
||||
#include "libGLESv2/renderer/TextureImpl.h"
|
||||
#include "libGLESv2/Caps.h"
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#define LIBGLESV2_VERTEXARRAY_H_
|
||||
|
||||
#include "common/RefCountObject.h"
|
||||
#include "libGLESv2/constants.h"
|
||||
#include "libGLESv2/Constants.h"
|
||||
#include "libGLESv2/VertexAttribute.h"
|
||||
|
||||
#include <vector>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#ifndef LIBGLESV2_ANGLETYPES_H_
|
||||
#define LIBGLESV2_ANGLETYPES_H_
|
||||
|
||||
#include "libGLESv2/constants.h"
|
||||
#include "libGLESv2/Constants.h"
|
||||
#include "common/RefCountObject.h"
|
||||
|
||||
namespace gl
|
||||
|
|
|
@ -117,7 +117,6 @@ UNIFIED_SOURCES += [
|
|||
'renderer/d3d/d3d9/VertexBuffer9.cpp',
|
||||
'renderer/d3d/d3d9/VertexDeclarationCache.cpp',
|
||||
'renderer/d3d/DynamicHLSL.cpp',
|
||||
'renderer/d3d/HLSLCompiler.cpp',
|
||||
'renderer/d3d/ImageD3D.cpp',
|
||||
'renderer/d3d/IndexBuffer.cpp',
|
||||
'renderer/d3d/IndexDataManager.cpp',
|
||||
|
@ -148,6 +147,7 @@ UNIFIED_SOURCES += [
|
|||
SOURCES += [
|
||||
'../compiler/translator/glslang_lex.cpp',
|
||||
'../compiler/translator/glslang_tab.cpp',
|
||||
'renderer/d3d/HLSLCompiler.cpp',
|
||||
'renderer/loadimageSSE2.cpp',
|
||||
]
|
||||
SOURCES['renderer/loadimageSSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
|
||||
|
@ -213,7 +213,7 @@ LOCAL_INCLUDES += [ '../../include', '../../src' ]
|
|||
|
||||
|
||||
if CONFIG['MOZ_HAS_WINSDK_WITH_D3D']:
|
||||
EXTRA_DSO_LDOPTS += [ 'd3d9.lib', 'dxguid.lib' ]
|
||||
OS_LIBS += [ 'd3d9', 'dxguid' ]
|
||||
else:
|
||||
EXTRA_DSO_LDOPTS += [
|
||||
'\'%s/lib/%s/d3d9.lib\'' % (CONFIG['MOZ_DIRECTX_SDK_PATH'], CONFIG['MOZ_D3D_CPU_SUFFIX']),
|
||||
|
@ -225,5 +225,5 @@ SharedLibrary('libGLESv2')
|
|||
RCFILE = SRCDIR + '/libGLESv2.rc'
|
||||
DEFFILE = SRCDIR + '/libGLESv2.def'
|
||||
|
||||
DEFINES['ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES'] = '{ TEXT("d3dcompiler_47.dll"), TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") }'
|
||||
SOURCES['renderer/d3d/HLSLCompiler.cpp'].flags += ['-DANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES=\'{ TEXT("d3dcompiler_47.dll"), TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") }\'']
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
// copyimage.cpp: Defines image copying functions
|
||||
|
||||
#include "libGLESv2/renderer/copyImage.h"
|
||||
#include "libGLESv2/renderer/copyimage.h"
|
||||
|
||||
namespace rx
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@ inline void WriteColor(const uint8_t *source, uint8_t *dest)
|
|||
template <typename sourceType, typename destType, typename colorDataType>
|
||||
inline void CopyPixel(const uint8_t *source, uint8_t *dest)
|
||||
{
|
||||
colorType temp;
|
||||
colorDataType temp;
|
||||
ReadColor<sourceType, colorDataType>(source, &temp);
|
||||
WriteColor<destType, colorDataType>(&temp, dest);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#define LIBGLESV2_RENDERER_DYNAMIC_HLSL_H_
|
||||
|
||||
#include "common/angleutils.h"
|
||||
#include "libGLESv2/constants.h"
|
||||
#include "libGLESv2/Constants.h"
|
||||
|
||||
#include "angle_gl.h"
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ bool TextureD3D::subImage(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei w
|
|||
if (unpack.pixelBuffer.id() != 0)
|
||||
{
|
||||
gl::Buffer *pixelBuffer = unpack.pixelBuffer.get();
|
||||
unsigned int offset = reinterpret_cast<unsigned int>(pixels);
|
||||
uintptr_t offset = reinterpret_cast<uintptr_t>(pixels);
|
||||
// TODO: setImage/subImage is the only place outside of renderer that asks for a buffers raw data.
|
||||
// This functionality should be moved into renderer and the getData method of BufferImpl removed.
|
||||
const void *bufferData = pixelBuffer->getImplementation()->getData();
|
||||
|
@ -183,7 +183,7 @@ bool TextureD3D::fastUnpackPixels(const gl::PixelUnpackState &unpack, const void
|
|||
// to create a render target.
|
||||
ASSERT(mRenderer->supportsFastCopyBufferToTexture(sizedInternalFormat));
|
||||
|
||||
unsigned int offset = reinterpret_cast<unsigned int>(pixels);
|
||||
uintptr_t offset = reinterpret_cast<uintptr_t>(pixels);
|
||||
|
||||
return mRenderer->fastCopyBufferToTexture(unpack, offset, destRenderTarget, sizedInternalFormat, type, destArea);
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
#include "libGLESv2/renderer/TextureImpl.h"
|
||||
#include "libGLESv2/angletypes.h"
|
||||
#include "libGLESv2/constants.h"
|
||||
#include "libGLESv2/Constants.h"
|
||||
|
||||
namespace gl
|
||||
{
|
||||
|
|
|
@ -1646,7 +1646,7 @@ bool ValidateDrawElements(Context *context, GLenum mode, GLsizei count, GLenum t
|
|||
// TODO: also disable index checking on back-ends that are robust to out-of-range accesses.
|
||||
if (elementArrayBuffer)
|
||||
{
|
||||
unsigned int offset = reinterpret_cast<unsigned int>(indices);
|
||||
uintptr_t offset = reinterpret_cast<uintptr_t>(indices);
|
||||
if (!elementArrayBuffer->getIndexRangeCache()->findRange(type, offset, count, indexRangeOut, NULL))
|
||||
{
|
||||
const void *dataPointer = elementArrayBuffer->getImplementation()->getData();
|
||||
|
|
|
@ -587,7 +587,7 @@ const unsigned long long noEventId = 0;
|
|||
class TraceID {
|
||||
public:
|
||||
explicit TraceID(const void* id, unsigned char* flags) :
|
||||
m_data(static_cast<unsigned long long>(reinterpret_cast<unsigned long>(id)))
|
||||
m_data(static_cast<unsigned long long>(reinterpret_cast<uintptr_t>(id)))
|
||||
{
|
||||
*flags |= TRACE_EVENT_FLAG_MANGLE_ID;
|
||||
}
|
||||
|
@ -788,37 +788,6 @@ private:
|
|||
Data m_data;
|
||||
};
|
||||
|
||||
// TraceEventSamplingStateScope records the current sampling state
|
||||
// and sets a new sampling state. When the scope exists, it restores
|
||||
// the sampling state having recorded.
|
||||
template<size_t BucketNumber>
|
||||
class SamplingStateScope {
|
||||
public:
|
||||
SamplingStateScope(const char* categoryAndName)
|
||||
{
|
||||
m_previousState = SamplingStateScope<BucketNumber>::current();
|
||||
SamplingStateScope<BucketNumber>::set(categoryAndName);
|
||||
}
|
||||
|
||||
~SamplingStateScope()
|
||||
{
|
||||
SamplingStateScope<BucketNumber>::set(m_previousState);
|
||||
}
|
||||
|
||||
// FIXME: Make load/store to traceSamplingState[] thread-safe and atomic.
|
||||
static inline const char* current()
|
||||
{
|
||||
return reinterpret_cast<const char*>(*gl::traceSamplingState[BucketNumber]);
|
||||
}
|
||||
static inline void set(const char* categoryAndName)
|
||||
{
|
||||
*gl::traceSamplingState[BucketNumber] = reinterpret_cast<long>(const_cast<char*>(categoryAndName));
|
||||
}
|
||||
|
||||
private:
|
||||
const char* m_previousState;
|
||||
};
|
||||
|
||||
} // namespace TraceEvent
|
||||
|
||||
} // namespace gl
|
||||
|
|
|
@ -728,6 +728,12 @@ RotatedContentBuffer::BorrowDrawTargetForPainting(PaintState& aPaintState,
|
|||
|
||||
if (aPaintState.mMode == SurfaceMode::SURFACE_COMPONENT_ALPHA) {
|
||||
MOZ_ASSERT(mDTBuffer && mDTBufferOnWhite);
|
||||
if (!mDTBuffer || !mDTBufferOnWhite) {
|
||||
// This can happen in release builds if allocating one of the two buffers
|
||||
// failed. This is pretty bad and the reason for the failure is already
|
||||
// reported through gfxCriticalError.
|
||||
return nullptr;
|
||||
}
|
||||
nsIntRegionRectIterator iter(*drawPtr);
|
||||
const nsIntRect *iterRect;
|
||||
while ((iterRect = iter.Next())) {
|
||||
|
|
|
@ -625,7 +625,7 @@ APZCTreeManager::ProcessTouchInput(MultiTouchInput& aInput,
|
|||
// ignore that second touch point completely. The touch-start for it is
|
||||
// dropped completely; subsequent touch events until the touch-end for it
|
||||
// will have this touch point filtered out.
|
||||
if (mApzcForInputBlock && mApzcForInputBlock->IsOverscrolled()) {
|
||||
if (mApzcForInputBlock && BuildOverscrollHandoffChain(mApzcForInputBlock)->HasOverscrolledApzc()) {
|
||||
if (mRetainedTouchIdentifier == -1) {
|
||||
mRetainedTouchIdentifier = mApzcForInputBlock->GetLastTouchIdentifier();
|
||||
}
|
||||
|
|
|
@ -69,6 +69,18 @@ OverscrollHandoffChain::ForEachApzc(APZCMethod aMethod) const
|
|||
}
|
||||
}
|
||||
|
||||
bool
|
||||
OverscrollHandoffChain::AnyApzc(APZCPredicate aPredicate) const
|
||||
{
|
||||
MOZ_ASSERT(Length() > 0);
|
||||
for (uint32_t i = 0; i < Length(); ++i) {
|
||||
if ((mChain[i]->*aPredicate)()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
OverscrollHandoffChain::FlushRepaints() const
|
||||
{
|
||||
|
@ -129,5 +141,12 @@ OverscrollHandoffChain::CanBePanned(const AsyncPanZoomController* aApzc) const
|
|||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
OverscrollHandoffChain::HasOverscrolledApzc() const
|
||||
{
|
||||
return AnyApzc(&AsyncPanZoomController::IsOverscrolled);
|
||||
}
|
||||
|
||||
|
||||
} // namespace layers
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -105,11 +105,16 @@ public:
|
|||
// Determine whether the given APZC, or any APZC further in the chain,
|
||||
// has room to be panned.
|
||||
bool CanBePanned(const AsyncPanZoomController* aApzc) const;
|
||||
|
||||
// Determine whether any APZC along this handoff chain is overscrolled.
|
||||
bool HasOverscrolledApzc() const;
|
||||
private:
|
||||
std::vector<nsRefPtr<AsyncPanZoomController>> mChain;
|
||||
|
||||
typedef void (AsyncPanZoomController::*APZCMethod)();
|
||||
typedef bool (AsyncPanZoomController::*APZCPredicate)() const;
|
||||
void ForEachApzc(APZCMethod aMethod) const;
|
||||
bool AnyApzc(APZCPredicate aPredicate) const;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -553,7 +553,10 @@ CompositorD3D11::ClearRect(const gfx::Rect& aRect)
|
|||
mPSConstants.layerColor[2] = 0;
|
||||
mPSConstants.layerColor[3] = 0;
|
||||
|
||||
UpdateConstantBuffers();
|
||||
if (!UpdateConstantBuffers()) {
|
||||
NS_WARNING("Failed to update shader constant buffers");
|
||||
return;
|
||||
}
|
||||
|
||||
mContext->Draw(4, 0);
|
||||
|
||||
|
@ -739,7 +742,10 @@ CompositorD3D11::DrawQuad(const gfx::Rect& aRect,
|
|||
NS_WARNING("Unknown shader type");
|
||||
return;
|
||||
}
|
||||
UpdateConstantBuffers();
|
||||
if (!UpdateConstantBuffers()) {
|
||||
NS_WARNING("Failed to update shader constant buffers");
|
||||
return;
|
||||
}
|
||||
|
||||
mContext->Draw(4, 0);
|
||||
if (restoreBlendMode) {
|
||||
|
@ -966,14 +972,52 @@ CompositorD3D11::CreateShaders()
|
|||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
static
|
||||
bool ShouldRecoverFromMapFailure(HRESULT hr, ID3D11Device* device)
|
||||
{
|
||||
// XXX - it would be nice to use gfxCriticalError, but it needs to
|
||||
// be made to work off the main thread first.
|
||||
if (SUCCEEDED(hr)) {
|
||||
return true;
|
||||
}
|
||||
if (hr == DXGI_ERROR_DEVICE_REMOVED) {
|
||||
switch (device->GetDeviceRemovedReason()) {
|
||||
case DXGI_ERROR_DEVICE_HUNG:
|
||||
case DXGI_ERROR_DEVICE_REMOVED:
|
||||
case DXGI_ERROR_DEVICE_RESET:
|
||||
case DXGI_ERROR_DRIVER_INTERNAL_ERROR:
|
||||
return true;
|
||||
case DXGI_ERROR_INVALID_CALL:
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
CompositorD3D11::UpdateConstantBuffers()
|
||||
{
|
||||
HRESULT hr;
|
||||
D3D11_MAPPED_SUBRESOURCE resource;
|
||||
mContext->Map(mAttachments->mVSConstantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &resource);
|
||||
|
||||
hr = mContext->Map(mAttachments->mVSConstantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &resource);
|
||||
if (FAILED(hr)) {
|
||||
if (ShouldRecoverFromMapFailure(hr, GetDevice())) {
|
||||
return false;
|
||||
}
|
||||
MOZ_CRASH();
|
||||
}
|
||||
*(VertexShaderConstants*)resource.pData = mVSConstants;
|
||||
mContext->Unmap(mAttachments->mVSConstantBuffer, 0);
|
||||
mContext->Map(mAttachments->mPSConstantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &resource);
|
||||
|
||||
hr = mContext->Map(mAttachments->mPSConstantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &resource);
|
||||
if (FAILED(hr)) {
|
||||
if (ShouldRecoverFromMapFailure(hr, GetDevice())) {
|
||||
return false;
|
||||
}
|
||||
MOZ_CRASH();
|
||||
}
|
||||
*(PixelShaderConstants*)resource.pData = mPSConstants;
|
||||
mContext->Unmap(mAttachments->mPSConstantBuffer, 0);
|
||||
|
||||
|
@ -983,6 +1027,7 @@ CompositorD3D11::UpdateConstantBuffers()
|
|||
|
||||
buffer = mAttachments->mPSConstantBuffer;
|
||||
mContext->PSSetConstantBuffers(0, 1, &buffer);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -148,7 +148,7 @@ private:
|
|||
void VerifyBufferSize();
|
||||
void UpdateRenderTarget();
|
||||
bool CreateShaders();
|
||||
void UpdateConstantBuffers();
|
||||
bool UpdateConstantBuffers();
|
||||
void SetSamplerForFilter(gfx::Filter aFilter);
|
||||
void SetPSForEffect(Effect *aEffect, MaskType aMaskType, gfx::SurfaceFormat aFormat);
|
||||
void PaintToTarget();
|
||||
|
|
|
@ -1612,6 +1612,55 @@ protected:
|
|||
}
|
||||
};
|
||||
|
||||
// A version of ApzcPan() that routes the pan through the tree manager,
|
||||
// so that the tree manager has the appropriate state for testing.
|
||||
static void
|
||||
ApzctmPan(APZCTreeManager* aTreeManager,
|
||||
int& aTime,
|
||||
int aTouchStartY,
|
||||
int aTouchEndY,
|
||||
bool aKeepFingerDown = false)
|
||||
{
|
||||
// TODO: Reuse some code between this and ApzcPan().
|
||||
|
||||
// Reduce the touch start tolerance to a tiny value.
|
||||
// We can't do what ApzcPan() does to overcome the tolerance (send the
|
||||
// touch-start at (aTouchStartY + some_large_value)) because the tree manager
|
||||
// does hit testing based on the touch-start coordinates, and a different
|
||||
// APZC than the one we intend might be hit.
|
||||
SCOPED_GFX_PREF(APZTouchStartTolerance, float, 1.0f / 1000.0f);
|
||||
const int OVERCOME_TOUCH_TOLERANCE = 1;
|
||||
|
||||
const int TIME_BETWEEN_TOUCH_EVENT = 100;
|
||||
|
||||
// Make sure the move is large enough to not be handled as a tap
|
||||
MultiTouchInput mti = MultiTouchInput(MultiTouchInput::MULTITOUCH_START, aTime, TimeStamp(), 0);
|
||||
mti.mTouches.AppendElement(SingleTouchData(0, ScreenIntPoint(10, aTouchStartY), ScreenSize(0, 0), 0, 0));
|
||||
aTreeManager->ReceiveInputEvent(mti, nullptr);
|
||||
|
||||
aTime += TIME_BETWEEN_TOUCH_EVENT;
|
||||
|
||||
mti = MultiTouchInput(MultiTouchInput::MULTITOUCH_MOVE, aTime, TimeStamp(), 0);
|
||||
mti.mTouches.AppendElement(SingleTouchData(0, ScreenIntPoint(10, aTouchStartY + OVERCOME_TOUCH_TOLERANCE), ScreenSize(0, 0), 0, 0));
|
||||
aTreeManager->ReceiveInputEvent(mti, nullptr);
|
||||
|
||||
aTime += TIME_BETWEEN_TOUCH_EVENT;
|
||||
|
||||
mti = MultiTouchInput(MultiTouchInput::MULTITOUCH_MOVE, aTime, TimeStamp(), 0);
|
||||
mti.mTouches.AppendElement(SingleTouchData(0, ScreenIntPoint(10, aTouchEndY), ScreenSize(0, 0), 0, 0));
|
||||
aTreeManager->ReceiveInputEvent(mti, nullptr);
|
||||
|
||||
aTime += TIME_BETWEEN_TOUCH_EVENT;
|
||||
|
||||
if (!aKeepFingerDown) {
|
||||
mti = MultiTouchInput(MultiTouchInput::MULTITOUCH_END, aTime, TimeStamp(), 0);
|
||||
mti.mTouches.AppendElement(SingleTouchData(0, ScreenIntPoint(10, aTouchEndY), ScreenSize(0, 0), 0, 0));
|
||||
aTreeManager->ReceiveInputEvent(mti, nullptr);
|
||||
}
|
||||
|
||||
aTime += TIME_BETWEEN_TOUCH_EVENT;
|
||||
}
|
||||
|
||||
class APZHitTestingTester : public APZCTreeManagerTester {
|
||||
protected:
|
||||
Matrix4x4 transformToApzc;
|
||||
|
@ -2189,6 +2238,43 @@ TEST_F(APZOverscrollHandoffTester, LayerStructureChangesWhileEventsArePending) {
|
|||
EXPECT_EQ(-10, middleApzc->GetFrameMetrics().GetScrollOffset().y);
|
||||
}
|
||||
|
||||
// Test that putting a second finger down on an APZC while a down-chain APZC
|
||||
// is overscrolled doesn't result in being stuck in overscroll.
|
||||
TEST_F(APZOverscrollHandoffTester, StuckInOverscroll_Bug1073250) {
|
||||
// Enable overscrolling.
|
||||
SCOPED_GFX_PREF(APZOverscrollEnabled, bool, true);
|
||||
|
||||
CreateOverscrollHandoffLayerTree1();
|
||||
|
||||
TestAsyncPanZoomController* child = ApzcOf(layers[1]);
|
||||
|
||||
// Pan, causing the parent APZC to overscroll.
|
||||
int time = 0;
|
||||
ApzctmPan(manager, time, 10, 40, true /* keep finger down */);
|
||||
EXPECT_FALSE(child->IsOverscrolled());
|
||||
EXPECT_TRUE(rootApzc->IsOverscrolled());
|
||||
|
||||
// Put a second finger down.
|
||||
MultiTouchInput secondFingerDown(MultiTouchInput::MULTITOUCH_START, 0, TimeStamp(), 0);
|
||||
// Use the same touch identifier for the first touch (0) as ApzctmPan(). (A bit hacky.)
|
||||
secondFingerDown.mTouches.AppendElement(SingleTouchData(0, ScreenIntPoint(10, 40), ScreenSize(0, 0), 0, 0));
|
||||
secondFingerDown.mTouches.AppendElement(SingleTouchData(1, ScreenIntPoint(30, 20), ScreenSize(0, 0), 0, 0));
|
||||
manager->ReceiveInputEvent(secondFingerDown, nullptr);
|
||||
|
||||
// Release the fingers.
|
||||
MultiTouchInput fingersUp = secondFingerDown;
|
||||
fingersUp.mType = MultiTouchInput::MULTITOUCH_END;
|
||||
manager->ReceiveInputEvent(fingersUp, nullptr);
|
||||
|
||||
// Allow any animations to run their course.
|
||||
child->AdvanceAnimationsUntilEnd(testStartTime);
|
||||
rootApzc->AdvanceAnimationsUntilEnd(testStartTime);
|
||||
|
||||
// Make sure nothing is overscrolled.
|
||||
EXPECT_FALSE(child->IsOverscrolled());
|
||||
EXPECT_FALSE(rootApzc->IsOverscrolled());
|
||||
}
|
||||
|
||||
// Here we test that if two flings are happening simultaneously, overscroll
|
||||
// is handed off correctly for each.
|
||||
TEST_F(APZOverscrollHandoffTester, SimultaneousFlings) {
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче