This commit is contained in:
Ryan VanderMeulen 2015-01-20 22:16:53 -05:00
Родитель 0538f5c3ee dc6b716941
Коммит b56153f256
271 изменённых файлов: 5783 добавлений и 4795 удалений

Просмотреть файл

@ -331,6 +331,64 @@ IDRefsIterator::Next()
}
////////////////////////////////////////////////////////////////////////////////
// ARIAOwnedByIterator
////////////////////////////////////////////////////////////////////////////////
ARIAOwnedByIterator::ARIAOwnedByIterator(const Accessible* aDependent) :
RelatedAccIterator(aDependent->Document(), aDependent->GetContent(),
nsGkAtoms::aria_owns), mDependent(aDependent)
{
}
Accessible*
ARIAOwnedByIterator::Next()
{
Accessible* owner = RelatedAccIterator::Next();
Accessible* cur = owner;
while (cur) {
if (cur == mDependent)
return Next(); // owner cannot be a child of dependent.
if (cur->IsDoc())
break; // don't cross document boundaries
cur = cur->Parent();
}
return owner;
}
////////////////////////////////////////////////////////////////////////////////
// ARIAOwnsIterator
////////////////////////////////////////////////////////////////////////////////
ARIAOwnsIterator::ARIAOwnsIterator(const Accessible* aOwner) :
mIter(aOwner->Document(), aOwner->GetContent(), nsGkAtoms::aria_owns),
mOwner(aOwner)
{
}
Accessible*
ARIAOwnsIterator::Next()
{
Accessible* child = mIter.Next();
const Accessible* cur = mOwner;
while (cur) {
if (cur == child)
return Next(); // cannot own its own parent
if (cur->IsDoc())
break; // don't cross document boundaries
cur = cur->Parent();
}
return child;
}
////////////////////////////////////////////////////////////////////////////////
// SingleAccIterator
////////////////////////////////////////////////////////////////////////////////

Просмотреть файл

@ -247,6 +247,48 @@ private:
nsAString::index_type mCurrIdx;
};
/**
* Iterates over related accessible referred by aria-owns.
*/
class ARIAOwnedByIterator MOZ_FINAL : public RelatedAccIterator
{
public:
explicit ARIAOwnedByIterator(const Accessible* aDependent);
virtual ~ARIAOwnedByIterator() { }
virtual Accessible* Next() MOZ_OVERRIDE;
private:
ARIAOwnedByIterator() = delete;
ARIAOwnedByIterator(const ARIAOwnedByIterator&) = delete;
ARIAOwnedByIterator& operator = (const ARIAOwnedByIterator&) = delete;
const Accessible* mDependent;
};
/**
* Iterates over related accessible referred by aria-owns.
*/
class ARIAOwnsIterator MOZ_FINAL : public AccIterable
{
public:
explicit ARIAOwnsIterator(const Accessible* aOwner);
virtual ~ARIAOwnsIterator() { }
virtual Accessible* Next() MOZ_OVERRIDE;
private:
ARIAOwnsIterator() = delete;
ARIAOwnsIterator(const ARIAOwnsIterator&) = delete;
ARIAOwnsIterator& operator = (const ARIAOwnsIterator&) = delete;
IDRefsIterator mIter;
const Accessible* mOwner;
};
/**
* Iterator that points to a single accessible returning it on the first call
* to Next().

Просмотреть файл

@ -324,9 +324,7 @@ FocusManager::ProcessFocusEvent(AccEvent* aEvent)
if (!tryOwnsParent)
break;
RelatedAccIterator iter(child->Document(), child->GetContent(),
nsGkAtoms::aria_owns);
parent = iter.Next();
parent = ARIAOwnedByIterator(child).Next();
tryOwnsParent = false;
}

Просмотреть файл

@ -1281,7 +1281,7 @@ Accessible::Value(nsString& aValue)
Accessible* option = CurrentItem();
if (!option) {
Accessible* listbox = nullptr;
IDRefsIterator iter(mDoc, mContent, nsGkAtoms::aria_owns);
ARIAOwnsIterator iter(this);
while ((listbox = iter.Next()) && !listbox->IsListControl());
if (!listbox) {
@ -1559,8 +1559,7 @@ Accessible::RelationByType(RelationType aType)
}
case RelationType::NODE_CHILD_OF: {
Relation rel(new RelatedAccIterator(Document(), mContent,
nsGkAtoms::aria_owns));
Relation rel(new ARIAOwnedByIterator(this));
// This is an ARIA tree or treegrid that doesn't use owns, so we need to
// get the parent the hard way.
@ -1590,7 +1589,7 @@ Accessible::RelationByType(RelationType aType)
}
case RelationType::NODE_PARENT_OF: {
Relation rel(new IDRefsIterator(mDoc, mContent, nsGkAtoms::aria_owns));
Relation rel(new ARIAOwnsIterator(this));
// ARIA tree or treegrid can do the hierarchy by @aria-level, ARIA trees
// also can be organized by groups.

Просмотреть файл

@ -74,6 +74,15 @@
testRelation("treeitem1", RELATION_NODE_CHILD_OF, "tree");
testRelation("treeitem2", RELATION_NODE_CHILD_OF, "tree");
// aria-owns, bad relations
testRelation("ariaowns_container", RELATION_NODE_CHILD_OF, null);
testRelation("ariaowns_self", RELATION_NODE_CHILD_OF, null);
testRelation("ariaowns_uncle", RELATION_NODE_CHILD_OF, "ariaowns_self");
testRelation("ariaowns_container", RELATION_NODE_PARENT_OF, null);
testRelation("ariaowns_self", RELATION_NODE_PARENT_OF, "ariaowns_uncle");
testRelation("ariaowns_uncle", RELATION_NODE_PARENT_OF, null);
// 'node child of' relation for outlineitem role
testRelation("treeitem3", RELATION_NODE_CHILD_OF, "tree");
testRelation("treeitem4", RELATION_NODE_CHILD_OF, "tree");
@ -310,6 +319,12 @@
</div>
</div>
<div id="ariaowns_container">
<div id="ariaowns_self"
aria-owns="aria_ownscontainer ariaowns_self ariaowns_uncle"></div>
</div>
<div id="ariaowns_uncle"></div>
<div aria-owns="simplegrid-ownrow" role="grid" id="simplegrid">
<div role="row" id="simplegrid-row1" aria-level="1">
<div role="gridcell">cell 1,1</div>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e0c735ec89df011ea7dd435087a9045ecff9ff9e">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="579e01ad4d6e4177a8f636305ac877835d99f134"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5e98dc164b17fd6decb48a9eaddef0e55b82e249"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="320dad6b787c296ba701bca8377f71ab5fd72ee8"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e7c3ee43c96a0079d7e4f3fe471149293225917b"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="fe91ec3af5396edab45b15e546e21613785724b5"/>
<!-- Stock Android things -->
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>
@ -129,7 +129,7 @@
<!-- Stock Android things -->
<project name="platform/external/icu4c" path="external/icu4c" revision="2bb01561780583cc37bc667f0ea79f48a122d8a2"/>
<!-- dolphin specific things -->
<project name="device/sprd" path="device/sprd" revision="56f0085d1105fd6519d5d3773f91d48b2ad66d5c"/>
<project name="device/sprd" path="device/sprd" revision="8491e6338aa1e12699a2064895b02fb015f91b89"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="4e58336019b5cbcfd134caf55b142236cf986618"/>
<project name="platform/frameworks/av" path="frameworks/av" revision="4387fe988e5a1001f29ce05fcfda03ed2d32137b"/>
<project name="platform/hardware/akm" path="hardware/akm" revision="6d3be412647b0eab0adff8a2768736cf4eb68039"/>

Просмотреть файл

@ -19,13 +19,13 @@
<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="579e01ad4d6e4177a8f636305ac877835d99f134"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="5e98dc164b17fd6decb48a9eaddef0e55b82e249"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="320dad6b787c296ba701bca8377f71ab5fd72ee8"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d5d3f93914558b6f168447b805cd799c8233e300"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="6fa7a4936414ceb4055fd27f7a30e76790f834fb"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e7c3ee43c96a0079d7e4f3fe471149293225917b"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="fe91ec3af5396edab45b15e546e21613785724b5"/>
<!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
<project name="platform_bionic" path="bionic" remote="b2g" revision="e2b3733ba3fa5e3f404e983d2e4142b1f6b1b846"/>

Просмотреть файл

@ -17,10 +17,10 @@
</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="579e01ad4d6e4177a8f636305ac877835d99f134"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5e98dc164b17fd6decb48a9eaddef0e55b82e249"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="320dad6b787c296ba701bca8377f71ab5fd72ee8"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e7c3ee43c96a0079d7e4f3fe471149293225917b"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="fe91ec3af5396edab45b15e546e21613785724b5"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things -->

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e0c735ec89df011ea7dd435087a9045ecff9ff9e">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="579e01ad4d6e4177a8f636305ac877835d99f134"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5e98dc164b17fd6decb48a9eaddef0e55b82e249"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="320dad6b787c296ba701bca8377f71ab5fd72ee8"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e7c3ee43c96a0079d7e4f3fe471149293225917b"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="fe91ec3af5396edab45b15e546e21613785724b5"/>
<!-- Stock Android things -->
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="f92a936f2aa97526d4593386754bdbf02db07a12"/>
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="6e47ff2790f5656b5b074407829ceecf3e6188c4"/>

Просмотреть файл

@ -19,13 +19,13 @@
<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="579e01ad4d6e4177a8f636305ac877835d99f134"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="5e98dc164b17fd6decb48a9eaddef0e55b82e249"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="320dad6b787c296ba701bca8377f71ab5fd72ee8"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d5d3f93914558b6f168447b805cd799c8233e300"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="6fa7a4936414ceb4055fd27f7a30e76790f834fb"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e7c3ee43c96a0079d7e4f3fe471149293225917b"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="fe91ec3af5396edab45b15e546e21613785724b5"/>
<!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
<project name="platform_bionic" path="bionic" remote="b2g" revision="e2b3733ba3fa5e3f404e983d2e4142b1f6b1b846"/>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e0c735ec89df011ea7dd435087a9045ecff9ff9e">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="579e01ad4d6e4177a8f636305ac877835d99f134"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5e98dc164b17fd6decb48a9eaddef0e55b82e249"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="320dad6b787c296ba701bca8377f71ab5fd72ee8"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e7c3ee43c96a0079d7e4f3fe471149293225917b"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="fe91ec3af5396edab45b15e546e21613785724b5"/>
<!-- Stock Android things -->
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>

Просмотреть файл

@ -17,10 +17,10 @@
</project>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="579e01ad4d6e4177a8f636305ac877835d99f134"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5e98dc164b17fd6decb48a9eaddef0e55b82e249"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="320dad6b787c296ba701bca8377f71ab5fd72ee8"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e7c3ee43c96a0079d7e4f3fe471149293225917b"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="fe91ec3af5396edab45b15e546e21613785724b5"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things -->

Просмотреть файл

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "579e01ad4d6e4177a8f636305ac877835d99f134",
"git_revision": "5e98dc164b17fd6decb48a9eaddef0e55b82e249",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "91945bbce2f909915fe3edf033215baa4c80e3cd",
"revision": "d60b9f55a77aa72606acb397b3770adc1bcf5110",
"repo_path": "integration/gaia-central"
}

Просмотреть файл

@ -17,11 +17,11 @@
<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="579e01ad4d6e4177a8f636305ac877835d99f134"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="5e98dc164b17fd6decb48a9eaddef0e55b82e249"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="320dad6b787c296ba701bca8377f71ab5fd72ee8"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e7c3ee43c96a0079d7e4f3fe471149293225917b"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="fe91ec3af5396edab45b15e546e21613785724b5"/>
<!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
<project name="platform_bionic" path="bionic" remote="b2g" revision="1a2a32eda22ef2cd18f57f423a5e7b22a105a6f8"/>

Просмотреть файл

@ -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="579e01ad4d6e4177a8f636305ac877835d99f134"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="5e98dc164b17fd6decb48a9eaddef0e55b82e249"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="320dad6b787c296ba701bca8377f71ab5fd72ee8"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

Просмотреть файл

@ -17,10 +17,10 @@
</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="579e01ad4d6e4177a8f636305ac877835d99f134"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="5e98dc164b17fd6decb48a9eaddef0e55b82e249"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="320dad6b787c296ba701bca8377f71ab5fd72ee8"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e7c3ee43c96a0079d7e4f3fe471149293225917b"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="fe91ec3af5396edab45b15e546e21613785724b5"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things -->

Просмотреть файл

@ -17,12 +17,12 @@
<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="579e01ad4d6e4177a8f636305ac877835d99f134"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="5e98dc164b17fd6decb48a9eaddef0e55b82e249"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="320dad6b787c296ba701bca8377f71ab5fd72ee8"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="e7c3ee43c96a0079d7e4f3fe471149293225917b"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="fe91ec3af5396edab45b15e546e21613785724b5"/>
<project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
<!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>

Просмотреть файл

@ -59,8 +59,11 @@ MOZ_B2G=1
if test "$OS_TARGET" = "Android"; then
MOZ_NUWA_PROCESS=1
MOZ_B2G_LOADER=1
# Warnings-as-errors cannot be enabled on Lollipop until bug 1119980 is fixed.
if test "$PLATFORM_SDK_VERSION" -lt 21; then
MOZ_ENABLE_WARNINGS_AS_ERRORS=1
fi
fi
MOZ_JSDOWNLOADS=1

Просмотреть файл

@ -1,5 +1,5 @@
<?xml version="1.0"?>
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1419896968000">
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1421170069000">
<emItems>
<emItem blockID="i58" id="webmaster@buzzzzvideos.info">
<versionRange minVersion="0" maxVersion="*">
@ -865,6 +865,12 @@
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i816" id="noOpus@outlook.com">
<versionRange minVersion="0" maxVersion="*" severity="3">
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i528" id="008abed2-b43a-46c9-9a5b-a771c87b82da@1ad61d53-2bdc-4484-a26b-b888ecae1906.com">
<versionRange minVersion="0" maxVersion="*" severity="1">
@ -1011,12 +1017,6 @@
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i497" id="{872b5b88-9db5-4310-bdd0-ac189557e5f5}">
<versionRange minVersion="0" maxVersion="*" severity="1">
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i76" id="crossriderapp3924@crossrider.com">
<versionRange minVersion="0" maxVersion="*">
@ -1111,6 +1111,12 @@
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i812" id="{1e4ea5fc-09e5-4f45-a43b-c048304899fc}">
<versionRange minVersion="0" maxVersion="*" severity="3">
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i710" id="{e0352044-1439-48ba-99b6-b05ed1a4d2de}">
<versionRange minVersion="0" maxVersion="*" severity="3">
@ -1160,7 +1166,7 @@
<prefs>
</prefs>
</emItem>
<emItem blockID="i354" id="{c0c2693d-2ee8-47b4-9df7-b67a0ee31988}">
<emItem blockID="i497" id="{872b5b88-9db5-4310-bdd0-ac189557e5f5}">
<versionRange minVersion="0" maxVersion="*" severity="1">
</versionRange>
<prefs>
@ -1348,6 +1354,12 @@
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i820" id="{aab02ab1-33cf-4dfa-8a9f-f4e60e976d27}">
<versionRange minVersion="0" maxVersion="*" severity="3">
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i692" id="/^(j003-lqgrmgpcekslhg|SupraSavings|j003-dkqonnnthqjnkq|j003-kaggrpmirxjpzh)@jetpack$/">
<versionRange minVersion="0" maxVersion="*" severity="1">
@ -1486,6 +1498,12 @@
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i354" id="{c0c2693d-2ee8-47b4-9df7-b67a0ee31988}">
<versionRange minVersion="0" maxVersion="*" severity="1">
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i726" id="{d87d56b2-1379-49f4-b081-af2850c79d8e}">
<versionRange minVersion="0" maxVersion="*" severity="3">
@ -1823,12 +1841,10 @@
<prefs>
</prefs>
</emItem>
<emItem blockID="i760" id="toolbar11093@freshy.com">
<versionRange minVersion="0" maxVersion="*" severity="1">
<emItem blockID="i818" id="contentarget@maildrop.cc">
<versionRange minVersion="0" maxVersion="*" severity="3">
</versionRange>
<prefs>
<pref>browser.startup.homepage</pref>
<pref>browser.search.defaultenginename</pref>
</prefs>
</emItem>
<emItem blockID="i142" id="{a3a5c777-f583-4fef-9380-ab4add1bc2a8}">
@ -2062,6 +2078,12 @@
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i814" id="liiros@facebook.com">
<versionRange minVersion="0" maxVersion="*" severity="3">
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i67" id="youtube2@youtube2.com">
<versionRange minVersion="0" maxVersion="*">
@ -2167,6 +2189,14 @@
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i760" id="toolbar11093@freshy.com">
<versionRange minVersion="0" maxVersion="*" severity="1">
</versionRange>
<prefs>
<pref>browser.startup.homepage</pref>
<pref>browser.search.defaultenginename</pref>
</prefs>
</emItem>
<emItem blockID="i324" id="/^((34qEOefiyYtRJT@IM5Munavn\.com)|(Mro5Fm1Qgrmq7B@ByrE69VQfZvZdeg\.com)|(KtoY3KGxrCe5ie@yITPUzbBtsHWeCdPmGe\.com)|(9NgIdLK5Dq4ZMwmRo6zk@FNt2GCCLGyUuOD\.com)|(NNux7bWWW@RBWyXdnl6VGls3WAwi\.com)|(E3wI2n@PEHTuuNVu\.com)|(2d3VuWrG6JHBXbQdbr@3BmSnQL\.com))$/">
<versionRange minVersion="0" maxVersion="*" severity="3">

Просмотреть файл

@ -144,19 +144,11 @@ pref("app.update.cert.maxErrors", 5);
// Non-release builds (Nightly, Aurora, etc.) have been switched over to aus4.mozilla.org.
// This condition protects us against accidentally using it for release builds.
#ifndef RELEASE_BUILD
pref("app.update.certs.1.issuerName", "CN=DigiCert Secure Server CA,O=DigiCert Inc,C=US");
pref("app.update.certs.1.commonName", "aus4.mozilla.org");
pref("app.update.certs.2.issuerName", "CN=Thawte SSL CA,O=\"Thawte, Inc.\",C=US");
pref("app.update.certs.2.commonName", "aus4.mozilla.org");
#else
pref("app.update.certs.1.issuerName", "CN=Thawte SSL CA,O=\"Thawte, Inc.\",C=US");
pref("app.update.certs.1.commonName", "aus3.mozilla.org");
pref("app.update.certs.2.issuerName", "CN=DigiCert Secure Server CA,O=DigiCert Inc,C=US");
pref("app.update.certs.2.commonName", "aus3.mozilla.org");
#endif
#endif
// Whether or not app updates are enabled
@ -194,11 +186,7 @@ pref("app.update.badge", false);
pref("app.update.staging.enabled", true);
// Update service URL:
#ifndef RELEASE_BUILD
pref("app.update.url", "https://aus4.mozilla.org/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
#else
pref("app.update.url", "https://aus3.mozilla.org/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
#endif
// app.update.url.manual is in branding section
// app.update.url.details is in branding section

Просмотреть файл

@ -57,6 +57,8 @@ function SearchSuggestionUIController(inputElement, tableParent, onClick=null,
this._stickyInputValue = "";
this._hideSuggestions();
this._ignoreInputEvent = false;
}
SearchSuggestionUIController.prototype = {
@ -143,6 +145,10 @@ SearchSuggestionUIController.prototype = {
},
_onInput: function () {
if (this._ignoreInputEvent) {
this._ignoreInputEvent = false;
return;
}
if (this.input.value) {
this._getSuggestions();
}
@ -231,6 +237,20 @@ SearchSuggestionUIController.prototype = {
let idx = this._indexOfTableRowOrDescendent(event.target);
let suggestion = this.suggestionAtIndex(idx);
this._stickyInputValue = suggestion;
// Commit composition string forcibly, because setting input value does not
// work if input has composition string (see bug 1115616 and bug 632744).
try {
let imeEditor = this.input.editor.QueryInterface(Components.interfaces.nsIEditorIMESupport);
if (imeEditor.composing) {
// Ignore input event for compisition end to avoid getting suggestion
// again.
this._ignoreInputEvent = true;
imeEditor.forceCompositionEnd();
this._ignoreInputEvent = false;
}
} catch(e) { }
this.input.value = suggestion;
this.input.setAttribute("selection-index", idx);
this.input.setAttribute("selection-kind", "mouse");

Просмотреть файл

@ -187,6 +187,46 @@ add_task(function* formHistory() {
yield msg("reset");
});
add_task(function* composition() {
yield setUp();
let state = yield msg("startComposition", { data: "" });
checkState(state, "", [], -1);
state = yield msg("updateComposition", { data: "x" });
checkState(state, "", [], -1);
state = yield msg("changeComposition", { data: "x", waitForSuggestions: true });
checkState(state, "x", ["xfoo", "xbar"], -1);
// Mouse over the first suggestion.
state = yield msg("mousemove", 0);
checkState(state, "x", ["xfoo", "xbar"], 0);
// Mouse over the second suggestion.
state = yield msg("mousemove", 1);
checkState(state, "x", ["xfoo", "xbar"], 1);
// Click the second suggestion. This should make it sticky. To make sure it
// sticks, trigger suggestions again and cycle through them by pressing Down
// until nothing is selected again.
state = yield msg("mousedown", 1);
checkState(state, "xbar", [], -1);
state = yield msg("key", { key: "VK_DOWN", waitForSuggestions: true });
checkState(state, "xbar", ["xbarfoo", "xbarbar"], -1);
state = yield msg("key", "VK_DOWN");
checkState(state, "xbarfoo", ["xbarfoo", "xbarbar"], 0);
state = yield msg("key", "VK_DOWN");
checkState(state, "xbarbar", ["xbarfoo", "xbarbar"], 1);
state = yield msg("key", "VK_DOWN");
checkState(state, "xbar", ["xbarfoo", "xbarbar"], -1);
yield msg("reset");
});
let gDidInitialSetUp = false;

Просмотреть файл

@ -27,6 +27,33 @@ let messageHandlers = {
wait(ack);
},
startComposition: function (arg) {
let data = typeof(arg) == "string" ? arg : arg.data;
content.synthesizeComposition({ type: "compositionstart", data: data });
ack();
},
updateComposition: function (arg) {
let data = typeof(arg) == "string" ? arg : arg.data;
content.synthesizeComposition({ type: "compositionupdate", data: data });
ack();
},
changeComposition: function (arg) {
let data = typeof(arg) == "string" ? arg : arg.data;
content.synthesizeCompositionChange({
composition: {
string: data,
clauses: [
{ length: data.length, attr: content.COMPOSITION_ATTR_RAWINPUT }
]
},
caret: { start: data.length, length: 0 }
});
let wait = arg.waitForSuggestions ? waitForSuggestions : cb => cb();
wait(ack);
},
focus: function () {
gController.input.focus();
ack();

Просмотреть файл

@ -479,11 +479,7 @@ pref("app.update.silent", true);
pref("app.update.staging.enabled", true);
// Update service URL:
#ifndef RELEASE_BUILD
pref("app.update.url", "https://aus4.mozilla.org/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
#else
pref("app.update.url", "https://aus3.mozilla.org/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
#endif
// Show the Update Checking/Ready UI when the user was idle for x seconds
pref("app.update.idletime", 60);

Просмотреть файл

@ -172,7 +172,7 @@ AC_PROG_CXX
AC_CHECK_PROGS(RANLIB, "${target_alias}-ranlib" "${target}-ranlib", :)
AC_CHECK_PROGS(AR, "${target_alias}-ar" "${target}-ar", :)
MOZ_PATH_PROGS(AS, "${target_alias}-as" "${target}-as", :)
AC_CHECK_PROGS(AS, "${target_alias}-as" "${target}-as", :)
AC_CHECK_PROGS(LD, "${target_alias}-ld" "${target}-ld", :)
AC_CHECK_PROGS(STRIP, "${target_alias}-strip" "${target}-strip", :)
AC_CHECK_PROGS(WINDRES, "${target_alias}-windres" "${target}-windres", :)

Просмотреть файл

@ -533,7 +533,7 @@ See https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
dnl Ensure that mt.exe is 'Microsoft (R) Manifest Tool',
dnl not something else like "magnetic tape manipulation utility".
MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
MSMT_TOOL=`${MT-mt} 2>&1|grep 'Microsoft (R) Manifest Tool'`
if test -z "$MSMT_TOOL"; then
AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
fi

Просмотреть файл

@ -1803,6 +1803,12 @@ Element::IsLabelable() const
return false;
}
bool
Element::IsInteractiveHTMLContent() const
{
return false;
}
css::StyleRule*
Element::GetInlineStyleRule()
{

Просмотреть файл

@ -284,6 +284,11 @@ public:
*/
virtual bool IsLabelable() const;
/**
* Returns if the element is interactive content as per HTML specification.
*/
virtual bool IsInteractiveHTMLContent() const;
/**
* Is the attribute named stored in the mapped attributes?
*

Просмотреть файл

@ -235,6 +235,36 @@ MultipartFileImpl::GetMozFullPathInternal(nsAString& aFilename,
blobImpl->GetMozFullPathInternal(aFilename, aRv);
}
nsresult
MultipartFileImpl::SetMutable(bool aMutable)
{
nsresult rv;
// This looks a little sketchy since FileImpl objects are supposed to be
// threadsafe. However, we try to enforce that all FileImpl objects must be
// set to immutable *before* being passed to another thread, so this should
// be safe.
if (!aMutable && !mImmutable && !mBlobImpls.IsEmpty()) {
for (uint32_t index = 0, count = mBlobImpls.Length();
index < count;
index++) {
rv = mBlobImpls[index]->SetMutable(aMutable);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
}
}
rv = FileImplBase::SetMutable(aMutable);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
MOZ_ASSERT_IF(!aMutable, mImmutable);
return NS_OK;
}
void
MultipartFileImpl::InitializeChromeFile(File& aBlob,
const ChromeFilePropertyBag& aBag,

Просмотреть файл

@ -101,6 +101,9 @@ public:
virtual void GetMozFullPathInternal(nsAString& aFullPath,
ErrorResult& aRv) MOZ_OVERRIDE;
virtual nsresult
SetMutable(bool aMutable) MOZ_OVERRIDE;
void SetName(const nsAString& aName)
{
mName = aName;

Просмотреть файл

@ -5252,6 +5252,7 @@ nsIDocument::InsertAnonymousContent(Element& aElement, ErrorResult& aRv)
return nullptr;
}
nsAutoScriptBlocker scriptBlocker;
nsCOMPtr<Element> container = shell->GetCanvasFrame()
->GetCustomContentContainer();
if (!container) {
@ -5276,6 +5277,8 @@ nsIDocument::InsertAnonymousContent(Element& aElement, ErrorResult& aRv)
new AnonymousContent(clonedElement->AsElement());
mAnonymousContents.AppendElement(anonymousContent);
shell->GetCanvasFrame()->ShowCustomContentContainer();
return anonymousContent.forget();
}
@ -5289,6 +5292,7 @@ nsIDocument::RemoveAnonymousContent(AnonymousContent& aContent,
return;
}
nsAutoScriptBlocker scriptBlocker;
nsCOMPtr<Element> container = shell->GetCanvasFrame()
->GetCustomContentContainer();
if (!container) {
@ -5314,6 +5318,9 @@ nsIDocument::RemoveAnonymousContent(AnonymousContent& aContent,
break;
}
}
if (mAnonymousContents.IsEmpty()) {
shell->GetCanvasFrame()->HideCustomContentContainer();
}
}
//

Просмотреть файл

@ -1477,7 +1477,7 @@ void
nsXMLHttpRequest::DispatchProgressEvent(DOMEventTargetHelper* aTarget,
const nsAString& aType,
bool aLengthComputable,
uint64_t aLoaded, uint64_t aTotal)
int64_t aLoaded, int64_t aTotal)
{
NS_ASSERTION(aTarget, "null target");
NS_ASSERTION(!aType.IsEmpty(), "missing event type");
@ -1497,7 +1497,7 @@ nsXMLHttpRequest::DispatchProgressEvent(DOMEventTargetHelper* aTarget,
init.mCancelable = false;
init.mLengthComputable = aLengthComputable;
init.mLoaded = aLoaded;
init.mTotal = (aTotal == UINT64_MAX) ? 0 : aTotal;
init.mTotal = (aTotal == -1) ? 0 : aTotal;
nsRefPtr<ProgressEvent> event =
ProgressEvent::Constructor(aTarget, aType, init);
@ -2781,10 +2781,15 @@ nsXMLHttpRequest::Send(nsIVariant* aVariant, const Nullable<RequestBody>& aBody)
nsAutoCString defaultContentType;
nsCOMPtr<nsIInputStream> postDataStream;
uint64_t size_u64;
rv = GetRequestBody(aVariant, aBody, getter_AddRefs(postDataStream),
&mUploadTotal, defaultContentType, charset);
&size_u64, defaultContentType, charset);
NS_ENSURE_SUCCESS(rv, rv);
// make sure it fits within js MAX_SAFE_INTEGER
mUploadTotal =
net::InScriptableRange(size_u64) ? static_cast<int64_t>(size_u64) : -1;
if (postDataStream) {
// If no content type header was set by the client, we set it to
// application/xml.
@ -3588,18 +3593,18 @@ nsXMLHttpRequest::MaybeDispatchProgressEvents(bool aFinalProgress)
}
NS_IMETHODIMP
nsXMLHttpRequest::OnProgress(nsIRequest *aRequest, nsISupports *aContext, uint64_t aProgress, uint64_t aProgressMax)
nsXMLHttpRequest::OnProgress(nsIRequest *aRequest, nsISupports *aContext, int64_t aProgress, int64_t aProgressMax)
{
// We're uploading if our state is XML_HTTP_REQUEST_OPENED or
// XML_HTTP_REQUEST_SENT
bool upload = !!((XML_HTTP_REQUEST_OPENED | XML_HTTP_REQUEST_SENT) & mState);
// When uploading, OnProgress reports also headers in aProgress and aProgressMax.
// So, try to remove the headers, if possible.
bool lengthComputable = (aProgressMax != UINT64_MAX);
bool lengthComputable = (aProgressMax != -1);
if (upload) {
uint64_t loaded = aProgress;
int64_t loaded = aProgress;
if (lengthComputable) {
uint64_t headerSize = aProgressMax - mUploadTotal;
int64_t headerSize = aProgressMax - mUploadTotal;
loaded -= headerSize;
}
mUploadLengthComputable = lengthComputable;

Просмотреть файл

@ -549,7 +549,7 @@ public:
void DispatchProgressEvent(mozilla::DOMEventTargetHelper* aTarget,
const nsAString& aType,
bool aLengthComputable,
uint64_t aLoaded, uint64_t aTotal);
int64_t aLoaded, int64_t aTotal);
// Dispatch the "progress" event on the XHR or XHR.upload object if we've
// received data since the last "progress" event. Also dispatches
@ -724,8 +724,8 @@ protected:
uint32_t mState;
nsRefPtr<nsXMLHttpRequestUpload> mUpload;
uint64_t mUploadTransferred;
uint64_t mUploadTotal;
int64_t mUploadTransferred;
int64_t mUploadTotal;
bool mUploadLengthComputable;
bool mUploadComplete;
bool mProgressSinceLastProgressEvent;
@ -744,7 +744,7 @@ protected:
bool mWarnAboutMultipartHtml;
bool mWarnAboutSyncHtml;
bool mLoadLengthComputable;
uint64_t mLoadTotal; // 0 if not known.
int64_t mLoadTotal; // 0 if not known.
// Amount of script-exposed (i.e. after undoing gzip compresion) data
// received.
uint64_t mDataAvailable;
@ -755,7 +755,7 @@ protected:
// mDataReceived except between the OnProgress that changes mLoadTransferred
// and the corresponding OnDataAvailable (which changes mDataReceived).
// Ordering of OnProgress and OnDataAvailable is undefined.
uint64_t mLoadTransferred;
int64_t mLoadTransferred;
nsCOMPtr<nsITimer> mProgressNotifier;
void HandleProgressTimerCallback();

Просмотреть файл

@ -322,21 +322,13 @@ DOMInterfaces = {
'headerFile': 'DeviceStorage.h',
},
'Document': [
{
'Document': {
'nativeType': 'nsIDocument',
'binaryNames': {
'documentURI': 'documentURIFromJS',
'URL': 'documentURIFromJS'
}
},
# Note: we still need the worker descriptor here because
# XMLHttpRequest.send() uses it.
{
'nativeType': 'JSObject',
'workers': True,
'skipGen': True
}],
'DOMException': {
'binaryNames': {
@ -431,15 +423,9 @@ DOMInterfaces = {
'wrapperCache': False,
},
'FormData': [
{
'FormData': {
'nativeType': 'nsFormData'
},
{
'workers': True,
'skipGen': True,
'nativeType': 'JSObject'
}],
'Geolocation': {
'headerFile': 'nsGeolocation.h'
@ -622,13 +608,11 @@ DOMInterfaces = {
'InstallPhaseEvent': {
'headerFile': 'ServiceWorkerEvents.h',
'nativeType': 'mozilla::dom::workers::InstallPhaseEvent',
'workers': True
},
'InstallEvent': {
'headerFile': 'ServiceWorkerEvents.h',
'nativeType': 'mozilla::dom::workers::InstallEvent',
'workers': True
},
'KeyEvent': {
@ -649,23 +633,10 @@ DOMInterfaces = {
'headerFile': 'nsIMediaList.h',
},
'MediaSource': [{
},
{
'nativeType': 'JSObject',
'workers': True,
'skipGen': True
}],
'MediaStream': [{
'MediaStream': {
'headerFile': 'DOMMediaStream.h',
'nativeType': 'mozilla::DOMMediaStream'
},
{
'nativeType': 'JSObject',
'workers': True,
'skipGen': True
}],
'MediaStreamAudioDestinationNode': {
'binaryNames': { 'stream': 'DOMStream' }

Просмотреть файл

@ -6832,7 +6832,29 @@ class CGMethodCall(CGThing):
argConversionStartsAt=argConversionStartsAt,
isConstructor=isConstructor)
signatures = method.signatures()
def filteredSignatures(signatures, descriptor):
def typeExposedInWorkers(type):
return (not type.isGeckoInterface() or
type.inner.isExternal() or
type.inner.isExposedInAnyWorker())
if descriptor.workers:
# Filter out the signatures that should not be exposed in a
# worker. The IDL parser enforces the return value being
# exposed correctly, but we have to check the argument types.
assert all(typeExposedInWorkers(sig[0]) for sig in signatures)
signatures = filter(
lambda sig: all(typeExposedInWorkers(arg.type)
for arg in sig[1]),
signatures)
if len(signatures) == 0:
raise TypeError("%s.%s has a worker binding with no "
"signatures that take arguments exposed in "
"workers." %
(descriptor.interface.identifier.name,
method.identifier.name))
return signatures
signatures = filteredSignatures(method.signatures(), descriptor)
if len(signatures) == 1:
# Special case: we can just do a per-signature method call
# here for our one signature and not worry about switching
@ -6859,14 +6881,17 @@ class CGMethodCall(CGThing):
argCountCases = []
for argCountIdx, argCount in enumerate(allowedArgCounts):
possibleSignatures = method.signaturesForArgCount(argCount)
possibleSignatures = filteredSignatures(
method.signaturesForArgCount(argCount),
descriptor)
# Try to optimize away cases when the next argCount in the list
# will have the same code as us; if it does, we can fall through to
# that case.
if argCountIdx+1 < len(allowedArgCounts):
nextPossibleSignatures = \
method.signaturesForArgCount(allowedArgCounts[argCountIdx+1])
nextPossibleSignatures = filteredSignatures(
method.signaturesForArgCount(allowedArgCounts[argCountIdx+1]),
descriptor)
else:
nextPossibleSignatures = None
if possibleSignatures == nextPossibleSignatures:

Просмотреть файл

@ -5,6 +5,9 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "BluetoothInterface.h"
#if ANDROID_VERSION >= 17
#include <cutils/properties.h>
#endif
#ifdef MOZ_B2G_BT_BLUEDROID
#include "BluetoothHALInterface.h"
#endif
@ -91,19 +94,59 @@ BluetoothNotificationHandler::~BluetoothNotificationHandler()
BluetoothInterface*
BluetoothInterface::GetInstance()
{
#if ANDROID_VERSION >= 17
/* We pick a default backend from the available ones. The branches
* are ordered by preference.
*/
#ifdef MOZ_B2G_BT_DAEMON
static const char sDefaultBackend[] = "bluetoothd";
#else
#ifdef MOZ_B2G_BT_BLUEDROID
static const char sDefaultBackend[] = "bluedroid";
#else
static const char const * sDefaultBackend = nullptr;
#endif
#endif
/* Here's where we decide which implementation to use. Currently
* there is only Bluedroid and the Bluetooth daemon, but others are
* possible. Having multiple interfaces built-in and selecting the
* correct one at runtime could also be an option.
* correct one at runtime is also an option.
*/
char value[PROPERTY_VALUE_MAX];
int len;
len = property_get("ro.moz.bluetooth.backend", value, sDefaultBackend);
if (len < 0) {
BT_WARNING("No Bluetooth backend available.");
return nullptr;
}
const nsDependentCString backend(value, len);
#ifdef MOZ_B2G_BT_BLUEDROID
return BluetoothHALInterface::GetInstance();
#else
#ifdef MOZ_B2G_BT_DAEMON
return BluetoothDaemonInterface::GetInstance();
#else
return nullptr;
if (backend.LowerCaseEqualsLiteral("bluedroid")) {
return BluetoothHALInterface::GetInstance();
} else
#endif
#ifdef MOZ_B2G_BT_DAEMON
if (backend.LowerCaseEqualsLiteral("bluetoothd")) {
return BluetoothDaemonInterface::GetInstance();
} else
#endif
{
BT_WARNING("Bluetooth backend '%s' is unknown or not available.",
backend.get());
}
return nullptr;
#else
/* Anything that's not Android 4.2 or later uses BlueZ instead. The
* code should actually never reach this point.
*/
BT_WARNING("No Bluetooth backend available for your system.");
return nullptr;
#endif
}

Просмотреть файл

@ -16,7 +16,6 @@
#include "mozilla/TextComposition.h"
#include "mozilla/TextEvents.h"
#include "mozilla/dom/HTMLFormElement.h"
#include "mozilla/dom/TabParent.h"
#include "HTMLInputElement.h"
#include "IMEContentObserver.h"
@ -389,27 +388,6 @@ IMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
}
IMEState newState = GetNewIMEState(aPresContext, aContent);
// In e10s, remote content may have IME focus. The main process (i.e. this process)
// would attempt to set state to DISABLED if, for example, the user clicks
// some other remote content. The content process would later re-ENABLE IME, meaning
// that all state-changes were unnecessary.
// Here we filter the common case where the main process knows that the remote
// process controls IME focus. The DISABLED->re-ENABLED progression can
// still happen since remote content may be concurrently communicating its claim
// on focus to the main process... but this cannot cause bugs like missed keypresses.
// (It just means a lot of needless IPC.)
if ((newState.mEnabled == IMEState::DISABLED) && TabParent::GetIMETabParent()) {
PR_LOG(sISMLog, PR_LOG_DEBUG,
("ISM: IMEStateManager::OnChangeFocusInternal(), "
"Parent process cancels to set DISABLED state because the content process "
"has IME focus and has already sets IME state"));
MOZ_ASSERT(XRE_IsParentProcess(),
"TabParent::GetIMETabParent() should never return non-null value "
"in the content process");
return NS_OK;
}
if (!focusActuallyChanging) {
// actual focus isn't changing, but if IME enabled state is changing,
// we should do it.

Просмотреть файл

@ -151,23 +151,35 @@ Request::Constructor(const GlobalObject& aGlobal,
request->SetCredentialsMode(credentials);
}
// Request constructor step 14.
if (aInit.mMethod.WasPassed()) {
nsCString method = aInit.mMethod.Value();
ToLowerCase(method);
nsAutoCString method(aInit.mMethod.Value());
nsAutoCString upperCaseMethod = method;
ToUpperCase(upperCaseMethod);
if (!method.EqualsASCII("options") &&
!method.EqualsASCII("get") &&
!method.EqualsASCII("head") &&
!method.EqualsASCII("post") &&
!method.EqualsASCII("put") &&
!method.EqualsASCII("delete")) {
// Step 14.1. Disallow forbidden methods, and anything that is not a HTTP
// token, since HTTP states that Method may be any of the defined values or
// a token (extension method).
if (upperCaseMethod.EqualsLiteral("CONNECT") ||
upperCaseMethod.EqualsLiteral("TRACE") ||
upperCaseMethod.EqualsLiteral("TRACK") ||
!NS_IsValidHTTPToken(method)) {
NS_ConvertUTF8toUTF16 label(method);
aRv.ThrowTypeError(MSG_INVALID_REQUEST_METHOD, &label);
return nullptr;
}
ToUpperCase(method);
request->SetMethod(method);
// Step 14.2
if (upperCaseMethod.EqualsLiteral("DELETE") ||
upperCaseMethod.EqualsLiteral("GET") ||
upperCaseMethod.EqualsLiteral("HEAD") ||
upperCaseMethod.EqualsLiteral("POST") ||
upperCaseMethod.EqualsLiteral("PUT") ||
upperCaseMethod.EqualsLiteral("OPTIONS")) {
request->SetMethod(upperCaseMethod);
} else {
request->SetMethod(method);
}
}
nsRefPtr<InternalHeaders> requestHeaders = request->Headers();

Просмотреть файл

@ -42,6 +42,12 @@ public:
virtual int32_t TabIndexDefault() MOZ_OVERRIDE;
virtual bool Draggable() const MOZ_OVERRIDE;
// Element
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE
{
return true;
}
// nsIDOMHTMLAnchorElement
NS_DECL_NSIDOMHTMLANCHORELEMENT

Просмотреть файл

@ -40,6 +40,12 @@ HTMLAudioElement::~HTMLAudioElement()
{
}
bool
HTMLAudioElement::IsInteractiveHTMLContent() const
{
return HasAttr(kNameSpaceID_None, nsGkAtoms::controls);
}
already_AddRefed<HTMLAudioElement>
HTMLAudioElement::Audio(const GlobalObject& aGlobal,
const Optional<nsAString>& aSrc,

Просмотреть файл

@ -23,6 +23,9 @@ public:
explicit HTMLAudioElement(already_AddRefed<NodeInfo>& aNodeInfo);
// Element
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE;
// nsIDOMHTMLMediaElement
using HTMLMediaElement::GetPaused;

Просмотреть файл

@ -36,6 +36,12 @@ public:
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLButtonElement, button)
// Element
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE
{
return true;
}
// nsIDOMHTMLButtonElement
NS_DECL_NSIDOMHTMLBUTTONELEMENT

Просмотреть файл

@ -26,6 +26,12 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// Element
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE
{
return true;
}
// nsIDOMHTMLIFrameElement
NS_DECL_NSIDOMHTMLIFRAMEELEMENT

Просмотреть файл

@ -148,6 +148,12 @@ NS_IMPL_STRING_ATTR(HTMLImageElement, Srcset, srcset)
NS_IMPL_STRING_ATTR(HTMLImageElement, UseMap, usemap)
NS_IMPL_INT_ATTR(HTMLImageElement, Vspace, vspace)
bool
HTMLImageElement::IsInteractiveHTMLContent() const
{
return HasAttr(kNameSpaceID_None, nsGkAtoms::usemap);
}
bool
HTMLImageElement::IsSrcsetEnabled()
{

Просмотреть файл

@ -46,6 +46,9 @@ public:
virtual bool Draggable() const MOZ_OVERRIDE;
// Element
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE;
// nsIDOMHTMLImageElement
NS_DECL_NSIDOMHTMLIMAGEELEMENT

Просмотреть файл

@ -3211,6 +3211,12 @@ HTMLInputElement::Focus(ErrorResult& aError)
return;
}
bool
HTMLInputElement::IsInteractiveHTMLContent() const
{
return mType != NS_FORM_INPUT_HIDDEN;
}
NS_IMETHODIMP
HTMLInputElement::Select()
{

Просмотреть файл

@ -119,6 +119,9 @@ public:
virtual void Blur(ErrorResult& aError) MOZ_OVERRIDE;
virtual void Focus(ErrorResult& aError) MOZ_OVERRIDE;
// Element
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE;
// nsIDOMHTMLInputElement
NS_DECL_NSIDOMHTMLINPUTELEMENT

Просмотреть файл

@ -83,19 +83,14 @@ HTMLLabelElement::Focus(ErrorResult& aError)
}
static bool
EventTargetIn(WidgetEvent* aEvent, nsIContent* aChild, nsIContent* aStop)
InInteractiveHTMLContent(nsIContent* aContent, nsIContent* aStop)
{
nsCOMPtr<nsIContent> c = do_QueryInterface(aEvent->target);
nsIContent *content = c;
while (content) {
if (content == aChild) {
nsIContent* content = aContent;
while (content && content != aStop) {
if (content->IsElement() &&
content->AsElement()->IsInteractiveHTMLContent()) {
return true;
}
if (content == aStop) {
break;
}
content = content->GetParent();
}
return false;
@ -115,10 +110,15 @@ HTMLLabelElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
return NS_OK;
}
nsCOMPtr<nsIContent> target = do_QueryInterface(aVisitor.mEvent->target);
if (InInteractiveHTMLContent(target, this)) {
return NS_OK;
}
// Strong ref because event dispatch is going to happen.
nsRefPtr<Element> content = GetLabeledElement();
if (content && !EventTargetIn(aVisitor.mEvent, content, this)) {
if (content) {
mHandlingEvent = true;
switch (aVisitor.mEvent->message) {
case NS_MOUSE_BUTTON_DOWN:

Просмотреть файл

@ -32,6 +32,12 @@ public:
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
// Element
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE
{
return true;
}
// nsIDOMHTMLLabelElement
NS_DECL_NSIDOMHTMLLABELELEMENT

Просмотреть файл

@ -434,6 +434,7 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(HTMLMediaElement)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLMediaElement, nsGenericHTMLElement)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMediaSource)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSrcStream)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPlaybackStream)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSrcAttrStream)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSourcePointer)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLoadBlockedDoc)
@ -2887,6 +2888,25 @@ void HTMLMediaElement::SetupSrcMediaStreamPlayback(DOMMediaStream* aStream)
mSrcStream = aStream;
nsIDOMWindow* window = OwnerDoc()->GetInnerWindow();
if (!window) {
return;
}
// Now that we have access to |mSrcStream| we can pipe it to our shadow
// version |mPlaybackStream|. If two media elements are playing the
// same realtime DOMMediaStream, this allows them to pause playback
// independently of each other.
mPlaybackStream = DOMMediaStream::CreateTrackUnionStream(window);
mPlaybackStreamInputPort = mPlaybackStream->GetStream()->AsProcessedStream()->
AllocateInputPort(mSrcStream->GetStream(), MediaInputPort::FLAG_BLOCK_OUTPUT);
nsRefPtr<nsIPrincipal> principal = GetCurrentPrincipal();
mPlaybackStream->CombineWithPrincipal(principal);
// Let |mSrcStream| decide when the stream has finished.
GetSrcMediaStream()->AsProcessedStream()->SetAutofinish(true);
nsRefPtr<MediaStream> stream = mSrcStream->GetStream();
if (stream) {
stream->SetAudioChannelType(mAudioChannel);
@ -2933,6 +2953,8 @@ void HTMLMediaElement::EndSrcMediaStreamPlayback()
}
mSrcStream->DisconnectTrackListListeners(AudioTracks(), VideoTracks());
mPlaybackStreamInputPort->Destroy();
// Kill its reference to this element
mSrcStreamListener->Forget();
mSrcStreamListener = nullptr;
@ -2953,6 +2975,8 @@ void HTMLMediaElement::EndSrcMediaStreamPlayback()
stream->ChangeExplicitBlockerCount(-1);
}
mSrcStream = nullptr;
mPlaybackStreamInputPort = nullptr;
mPlaybackStream = nullptr;
}
void HTMLMediaElement::ProcessMediaFragmentURI()

Просмотреть файл

@ -338,8 +338,8 @@ public:
MediaStream* GetSrcMediaStream() const
{
NS_ASSERTION(mSrcStream, "Don't call this when not playing a stream");
return mSrcStream->GetStream();
NS_ASSERTION(mPlaybackStream, "Don't call this when not playing a stream");
return mPlaybackStream->GetStream();
}
// WebIDL
@ -997,6 +997,14 @@ protected:
// At most one of mDecoder and mSrcStream can be non-null.
nsRefPtr<DOMMediaStream> mSrcStream;
// Holds a reference to a MediaInputPort connecting mSrcStream to mPlaybackStream.
nsRefPtr<MediaInputPort> mPlaybackStreamInputPort;
// Holds a reference to a stream with mSrcStream as input but intended for
// playback. Used so we don't block playback of other video elements
// playing the same mSrcStream.
nsRefPtr<DOMMediaStream> mPlaybackStream;
// Holds references to the DOM wrappers for the MediaStreams that we're
// writing to.
struct OutputMediaStream {

Просмотреть файл

@ -45,6 +45,12 @@ HTMLObjectElement::~HTMLObjectElement()
DestroyImageLoadingContent();
}
bool
HTMLObjectElement::IsInteractiveHTMLContent() const
{
return HasAttr(kNameSpaceID_None, nsGkAtoms::usemap);
}
bool
HTMLObjectElement::IsDoneAddingChildren()
{

Просмотреть файл

@ -30,6 +30,9 @@ public:
virtual int32_t TabIndexDefault() MOZ_OVERRIDE;
// Element
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE;
// nsIDOMHTMLObjectElement
NS_DECL_NSIDOMHTMLOBJECTELEMENT

Просмотреть файл

@ -147,6 +147,12 @@ public:
virtual int32_t TabIndexDefault() MOZ_OVERRIDE;
// Element
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE
{
return true;
}
// nsIDOMHTMLSelectElement
NS_DECL_NSIDOMHTMLSELECTELEMENT

Просмотреть файл

@ -53,6 +53,12 @@ public:
virtual int32_t TabIndexDefault() MOZ_OVERRIDE;
// Element
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE
{
return true;
}
// nsIDOMHTMLTextAreaElement
NS_DECL_NSIDOMHTMLTEXTAREAELEMENT

Просмотреть файл

@ -126,6 +126,12 @@ nsresult HTMLVideoElement::SetAcceptHeader(nsIHttpChannel* aChannel)
false);
}
bool
HTMLVideoElement::IsInteractiveHTMLContent() const
{
return HasAttr(kNameSpaceID_None, nsGkAtoms::controls);
}
uint32_t HTMLVideoElement::MozParsedFrames() const
{
MOZ_ASSERT(NS_IsMainThread(), "Should be on main thread.");

Просмотреть файл

@ -49,6 +49,9 @@ public:
virtual nsresult SetAcceptHeader(nsIHttpChannel* aChannel) MOZ_OVERRIDE;
// Element
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE;
// WebIDL
uint32_t Width() const

Просмотреть файл

@ -1791,6 +1791,15 @@ nsGenericHTMLElement::IsLabelable() const
Tag() == nsGkAtoms::meter;
}
bool
nsGenericHTMLElement::IsInteractiveHTMLContent() const
{
return Tag() == nsGkAtoms::details ||
Tag() == nsGkAtoms::embed ||
Tag() == nsGkAtoms::keygen ||
HasAttr(kNameSpaceID_None, nsGkAtoms::tabindex);
}
already_AddRefed<UndoManager>
nsGenericHTMLElement::GetUndoManager()
{

Просмотреть файл

@ -904,6 +904,7 @@ public:
}
virtual bool IsLabelable() const MOZ_OVERRIDE;
virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE;
static bool TouchEventsEnabled(JSContext* /* unused */, JSObject* /* unused */);

Просмотреть файл

@ -64,6 +64,7 @@ skip-if = (toolkit == 'android' && processor == 'x86') #x86 only
skip-if = buildapp == 'mulet'
[test_input_untrusted_key_events.html]
[test_input_url.html]
[test_interactive_content_in_label.html]
[test_label_control_attribute.html]
[test_label_input_controls.html]
[test_max_attribute.html]
@ -81,6 +82,7 @@ skip-if = e10s
[test_output_element.html]
[test_pattern_attribute.html]
[test_progress_element.html]
[test_radio_in_label.html]
[test_radio_radionodelist.html]
[test_required_attribute.html]
skip-if = e10s

Просмотреть файл

@ -0,0 +1,99 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=229925
-->
<head>
<title>Test for Bug 229925</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=229925">Mozilla Bug 229925</a>
<p id="display"></p>
<form action="#">
<label>
<span id="text">label</span>
<input type="button" id="target" value="target">
<a id="yes1" href="#">a</a>
<audio id="yes2" controls></audio>
<button id="yes3">button</button>
<details id="yes4">details</details>
<embed id="yes5">embed</embed>
<iframe id="yes6" src="data:text/plain," style="width: 16px; height: 16px;"></iframe>
<img id="yes7" src="data:image/png," usemap="#map">
<input id="yes8" type="text" size="4">
<keygen id="yes9">
<label id="yes10">label</label>
<object id="yes11" usemap="#map">object</object>
<select id="yes12"><option>select</option></select>
<textarea id="yes13" cols="1" rows="1"></textarea>
<video id="yes14" controls></video>
<span id="yes15" tabindex="1">tabindex</span>
<audio id="no1"></audio>
<img id="no2" src="data:image/png,">
<input id="no3" type="hidden">
<object id="no4">object</object>
<video id="no5"></video>
</label>
</form>
<script class="testbody" type="text/javascript">
/** Test for Bug 229925 **/
var target = document.getElementById("target");
var yes_nodes = [
document.getElementById("yes1"),
document.getElementById("yes2"),
document.getElementById("yes3"),
document.getElementById("yes4"),
document.getElementById("yes5"),
document.getElementById("yes6"),
document.getElementById("yes7"),
document.getElementById("yes8"),
document.getElementById("yes9"),
document.getElementById("yes10"),
document.getElementById("yes11"),
document.getElementById("yes12"),
document.getElementById("yes13"),
document.getElementById("yes14"),
document.getElementById("yes15"),
];
var no_nodes = [
document.getElementById("text"),
document.getElementById("no1"),
document.getElementById("no2"),
document.getElementById("no3"),
document.getElementById("no4"),
document.getElementById("no5"),
];
var target_clicked = false;
target.addEventListener("click", function() {
target_clicked = true;
});
var node;
for (node of yes_nodes) {
target_clicked = false;
node.click();
is(target_clicked, false, "mouse click on interactive content " + node.nodeName + " shouldn't dispatch event to label target");
}
for (node of no_nodes) {
target_clicked = false;
node.click();
is(target_clicked, true, "mouse click on non interactive content " + node.nodeName + " should dispatch event to label target");
}
</script>
</pre>
</body>
</html>

Просмотреть файл

@ -0,0 +1,51 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=229925
-->
<head>
<title>Test for Bug 229925</title>
<script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=229925">Mozilla Bug 229925</a>
<p id="display"></p>
<form>
<label>
<span id="s1">LABEL</span>
<input type="radio" name="rdo" value="1" id="r1" onmousedown="document.body.appendChild(document.createTextNode('down'));">
<input type="radio" name="rdo" value="2" id="r2" checked="checked">
</label>
</form>
<script class="testbody" type="text/javascript">
/** Test for Bug 229925 **/
var r1 = document.getElementById("r1");
var r2 = document.getElementById("r2");
var s1 = document.getElementById("s1");
r1.click();
ok(r1.checked,
"The first radio input element should be checked by clicking the element");
r2.click();
ok(r2.checked,
"The second radio input element should be checked by clicking the element");
s1.click();
ok(r1.checked,
"The first radio input element should be checked by clicking other element");
r1.focus();
synthesizeKey("VK_LEFT", {});
ok(r2.checked,
"The second radio input element should be checked by key");
synthesizeKey("VK_LEFT", {});
ok(r1.checked,
"The first radio input element should be checked by key");
</script>
</pre>
</body>
</html>

Просмотреть файл

@ -124,8 +124,12 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
[test_blob_worker_xhr_post.html]
skip-if = ((buildapp == 'b2g' && toolkit != 'gonk') || (e10s && toolkit == 'windows')) # Bug 931116
[test_blob_worker_xhr_post_multifile.html]
skip-if = ((buildapp == 'b2g' && toolkit != 'gonk') || (e10s && toolkit == 'windows')) # Bug 931116
[test_blob_worker_xhr_read.html]
skip-if = ((buildapp == 'b2g' && toolkit != 'gonk') || (e10s && toolkit == 'windows')) # Bug 931116
[test_blob_worker_xhr_read_slice.html]
skip-if = ((buildapp == 'b2g' && toolkit != 'gonk') || (e10s && toolkit == 'windows')) # Bug 931116
[test_blocked_order.html]
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
[test_bug937006.html]

Просмотреть файл

@ -0,0 +1,113 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<head>
<title>Indexed Database Property Test</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="text/javascript;version=1.7">
/**
* Create a composite/multi-file Blob on the worker, then post it as an XHR
* payload and ensure that we don't hang/generate an assertion/etc. but
* instead generate the expected 404. This test is basically the same as
* test_blob_worker_xhr_post.html except for the composite Blob.
*/
function testSteps()
{
const BLOB_DATA = ["fun ", "times ", "all ", "around!"];
const BLOB_TYPE = "text/plain";
const BLOB_SIZE = BLOB_DATA.join("").length;
info("Setting up");
let request = indexedDB.open(window.location.pathname, 1);
request.onerror = errorHandler;
request.onupgradeneeded = grabEventAndContinueHandler;
request.onsuccess = unexpectedSuccessHandler;
let event = yield undefined;
let db = event.target.result;
db.onerror = errorHandler;
ok(db, "Created database");
info("Creating objectStore");
let objectStore = db.createObjectStore("foo", { autoIncrement: true });
request.onupgradeneeded = unexpectedSuccessHandler;
request.onsuccess = grabEventAndContinueHandler;
event = yield undefined;
ok(true, "Opened database");
let blob = new Blob(BLOB_DATA, { type: BLOB_TYPE });
info("Adding blob to database");
objectStore = db.transaction("foo", "readwrite").objectStore("foo");
objectStore.add(blob).onsuccess = grabEventAndContinueHandler;
event = yield undefined;
let blobKey = event.target.result;
ok(blobKey, "Got a key for the blob");
info("Getting blob from the database");
objectStore = db.transaction("foo").objectStore("foo");
objectStore.get(blobKey).onsuccess = grabEventAndContinueHandler;
event = yield undefined;
blob = event.target.result;
ok(blob instanceof Blob, "Got a blob");
is(blob.size, BLOB_SIZE, "Correct size");
is(blob.type, BLOB_TYPE, "Correct type");
function workerScript() {
onmessage = function(event) {
var blob = event.data;
var compositeBlob = new Blob(["preceding string. ", blob],
{ type: "text/plain" });
var xhr = new XMLHttpRequest();
// We just want to make sure the error case doesn't fire; it's fine for
// us to just want a 404.
xhr.open('POST', 'http://mochi.test:8888/does-not-exist', true);
xhr.onload = function() {
postMessage({ status: xhr.status });
};
xhr.onerror = function() {
postMessage({ status: 'error' });
}
xhr.send(compositeBlob);
}
}
let workerScriptUrl =
URL.createObjectURL(new Blob(["(", workerScript.toSource(), ")()"]));
let xhrWorker = new Worker(workerScriptUrl);
xhrWorker.postMessage(blob);
xhrWorker.onmessage = grabEventAndContinueHandler;
event = yield undefined;
is(event.data.status, 404, "XHR generated the expected 404");
xhrWorker.terminate();
URL.revokeObjectURL(workerScriptUrl);
finishTest();
yield undefined;
}
</script>
<script type="text/javascript;version=1.7" src="helpers.js"></script>
</head>
<body onload="runTest();"></body>
</html>

Просмотреть файл

@ -0,0 +1,116 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<head>
<title>Indexed Database Blob Read From Worker</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="text/javascript;version=1.7">
/**
* Create an IndexedDB-backed Blob, send it to the worker, try and read the
* *SLICED* contents of the Blob from the worker using an XHR. This is
* (as of the time of writing this) basically the same as
* test_blob_worker_xhr_read.html but with slicing added.
*/
function testSteps()
{
const BLOB_DATA = ["Green"];
const BLOB_TYPE = "text/plain";
const BLOB_SIZE = BLOB_DATA.join("").length;
info("Setting up");
let request = indexedDB.open(window.location.pathname, 1);
request.onerror = errorHandler;
request.onupgradeneeded = grabEventAndContinueHandler;
request.onsuccess = unexpectedSuccessHandler;
let event = yield undefined;
let db = event.target.result;
db.onerror = errorHandler;
ok(db, "Created database");
info("Creating objectStore");
let objectStore = db.createObjectStore("foo", { autoIncrement: true });
request.onupgradeneeded = unexpectedSuccessHandler;
request.onsuccess = grabEventAndContinueHandler;
event = yield undefined;
ok(true, "Opened database");
let blob = new Blob(BLOB_DATA, { type: BLOB_TYPE });
info("Adding blob to database");
objectStore = db.transaction("foo", "readwrite").objectStore("foo");
objectStore.add(blob).onsuccess = grabEventAndContinueHandler;
event = yield undefined;
let blobKey = event.target.result;
ok(blobKey, "Got a key for the blob");
info("Getting blob from the database");
objectStore = db.transaction("foo").objectStore("foo");
objectStore.get(blobKey).onsuccess = grabEventAndContinueHandler;
event = yield undefined;
blob = event.target.result;
ok(blob instanceof Blob, "Got a blob");
is(blob.size, BLOB_SIZE, "Correct size");
is(blob.type, BLOB_TYPE, "Correct type");
info("Sending blob to a worker");
function workerScript() {
onmessage = function(event) {
var blob = event.data;
var slicedBlob = blob.slice(0, 3, "text/plain");
var blobUrl = URL.createObjectURL(slicedBlob);
var xhr = new XMLHttpRequest();
xhr.open('GET', blobUrl, true);
xhr.responseType = 'text';
xhr.onload = function() {
postMessage({ data: xhr.response });
URL.revokeObjectURL(blobUrl);
};
xhr.onerror = function() {
postMessage({ data: null });
URL.revokeObjectURL(blobUrl);
}
xhr.send();
}
}
let workerScriptUrl =
URL.createObjectURL(new Blob(["(", workerScript.toSource(), ")()"]));
let xhrWorker = new Worker(workerScriptUrl);
xhrWorker.postMessage(blob);
xhrWorker.onmessage = grabEventAndContinueHandler;
event = yield undefined;
is(event.data.data, "Gre", "XHR returned expected sliced payload.");
xhrWorker.terminate();
URL.revokeObjectURL(workerScriptUrl);
finishTest();
yield undefined;
}
</script>
<script type="text/javascript;version=1.7" src="helpers.js"></script>
</head>
<body onload="runTest();"></body>
</html>

Просмотреть файл

@ -1923,7 +1923,11 @@ public:
virtual int64_t
GetFileId() MOZ_OVERRIDE;
virtual int64_t GetLastModified(ErrorResult& aRv) MOZ_OVERRIDE;
virtual int64_t
GetLastModified(ErrorResult& aRv) MOZ_OVERRIDE;
virtual nsresult
SetMutable(bool aMutable) MOZ_OVERRIDE;
virtual BlobChild*
GetBlobChild() MOZ_OVERRIDE;
@ -2005,6 +2009,17 @@ public:
return mStart;
}
void
EnsureActorWasCreated()
{
MOZ_ASSERT_IF(!ActorEventTargetIsOnCurrentThread(),
mActorWasCreated);
if (!mActorWasCreated) {
EnsureActorWasCreatedInternal();
}
}
NS_DECL_ISUPPORTS_INHERITED
virtual BlobChild*
@ -2013,6 +2028,9 @@ public:
private:
~RemoteBlobSliceImpl()
{ }
void
EnsureActorWasCreatedInternal();
};
/*******************************************************************************
@ -2390,6 +2408,26 @@ RemoteBlobImpl::GetLastModified(ErrorResult& aRv)
return mLastModificationDate;
}
nsresult
BlobChild::
RemoteBlobImpl::SetMutable(bool aMutable)
{
if (!aMutable && IsSlice()) {
// Make sure that slices are backed by a real actor now while we are still
// on the correct thread.
AsSlice()->EnsureActorWasCreated();
}
nsresult rv = FileImplBase::SetMutable(aMutable);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
MOZ_ASSERT_IF(!aMutable, mImmutable);
return NS_OK;
}
BlobChild*
BlobChild::
RemoteBlobImpl::GetBlobChild()
@ -2572,21 +2610,12 @@ RemoteBlobSliceImpl::RemoteBlobSliceImpl(RemoteBlobImpl* aParent,
mStart = aParent->IsSlice() ? aParent->AsSlice()->mStart + aStart : aStart;
}
NS_IMPL_ISUPPORTS_INHERITED0(BlobChild::RemoteBlobSliceImpl,
BlobChild::RemoteBlobImpl)
BlobChild*
void
BlobChild::
RemoteBlobSliceImpl::GetBlobChild()
RemoteBlobSliceImpl::EnsureActorWasCreatedInternal()
{
MOZ_ASSERT_IF(!ActorEventTargetIsOnCurrentThread(),
mActorWasCreated);
if (mActorWasCreated) {
return RemoteBlobImpl::GetBlobChild();
}
MOZ_ASSERT(ActorEventTargetIsOnCurrentThread());
MOZ_ASSERT(!mActorWasCreated);
mActorWasCreated = true;
@ -2611,8 +2640,18 @@ RemoteBlobSliceImpl::GetBlobChild()
mActor =
SendSliceConstructor(baseActor->GetBackgroundManager(), this, params);
}
}
return mActor;
NS_IMPL_ISUPPORTS_INHERITED0(BlobChild::RemoteBlobSliceImpl,
BlobChild::RemoteBlobImpl)
BlobChild*
BlobChild::
RemoteBlobSliceImpl::GetBlobChild()
{
EnsureActorWasCreated();
return RemoteBlobImpl::GetBlobChild();
}
/*******************************************************************************

Просмотреть файл

@ -282,13 +282,13 @@ parent:
int32_t IMEOpen,
intptr_t NativeIMEContext);
prio(urgent) sync SetInputContext(int32_t IMEEnabled,
int32_t IMEOpen,
nsString type,
nsString inputmode,
nsString actionHint,
int32_t cause,
int32_t focusChange);
prio(urgent) async SetInputContext(int32_t IMEEnabled,
int32_t IMEOpen,
nsString type,
nsString inputmode,
nsString actionHint,
int32_t cause,
int32_t focusChange);
sync IsParentWindowMainWidgetVisible() returns (bool visible);

Просмотреть файл

@ -2028,25 +2028,14 @@ TabParent::RecvSetInputContext(const int32_t& aIMEEnabled,
const int32_t& aCause,
const int32_t& aFocusChange)
{
nsCOMPtr<nsIWidget> widget = GetWidget();
if (!widget || !AllowContentIME()) {
return true;
}
InputContext oldContext = widget->GetInputContext();
// Ignore if current widget IME setting is not DISABLED and didn't come
// from remote content. Chrome content may have taken over.
if (oldContext.mIMEState.mEnabled != IMEState::DISABLED &&
oldContext.IsOriginMainProcess()) {
return true;
}
// mIMETabParent (which is actually static) tracks which if any TabParent has IMEFocus
// When the input mode is set to anything but IMEState::DISABLED,
// mIMETabParent should be set to this
mIMETabParent =
aIMEEnabled != static_cast<int32_t>(IMEState::DISABLED) ? this : nullptr;
nsCOMPtr<nsIWidget> widget = GetWidget();
if (!widget || !AllowContentIME())
return true;
InputContext context;
context.mIMEState.mEnabled = static_cast<IMEState::Enabled>(aIMEEnabled);
@ -2054,8 +2043,6 @@ TabParent::RecvSetInputContext(const int32_t& aIMEEnabled,
context.mHTMLInputType.Assign(aType);
context.mHTMLInputInputmode.Assign(aInputmode);
context.mActionHint.Assign(aActionHint);
context.mOrigin = InputContext::ORIGIN_CONTENT;
InputContextAction action(
static_cast<InputContextAction::Cause>(aCause),
static_cast<InputContextAction::FocusChange>(aFocusChange));

Просмотреть файл

@ -163,12 +163,19 @@ GonkAudioDecoderManager::Output(int64_t aStreamOffset,
return NS_OK;
}
case android::INFO_FORMAT_CHANGED:
case android::INFO_OUTPUT_BUFFERS_CHANGED:
{
// If the format changed, update our cached info.
GADM_LOG("Decoder format changed");
return Output(aStreamOffset, aOutData);
}
case android::INFO_OUTPUT_BUFFERS_CHANGED:
{
GADM_LOG("Info Output Buffers Changed");
if (mDecoder->UpdateOutputBuffers()) {
return Output(aStreamOffset, aOutData);
}
return NS_ERROR_FAILURE;
}
case -EAGAIN:
{
return NS_ERROR_NOT_AVAILABLE;

Просмотреть файл

@ -509,6 +509,7 @@ skip-if = (toolkit == 'android' && processor == 'x86') #x86 only bug 914439
[test_streams_element_capture_playback.html]
[test_streams_element_capture_reset.html]
[test_streams_gc.html]
[test_streams_individual_pause.html]
[test_streams_srcObject.html]
[test_streams_tracks.html]
[test_texttrack.html]

Просмотреть файл

@ -0,0 +1,74 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for bug 1073406. Pausing a video element should not pause another playing the same stream.</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script type="text/javascript" src="manifest.js"></script>
</head>
<body>
<video id="video1" autoplay></video>
<video id="video2" autoplay></video>
<script class="testbody" type="text/javascript">
SimpleTest.waitForExplicitFinish();
var getVideoImagePixelData = function(v) {
var canvas = document.createElement("canvas");
var ctx = canvas.getContext("2d");
ctx.drawImage(v, 0, 0);
var imgData = ctx.getImageData(canvas.width/2, canvas.height/2, 1, 1).data;
return "r" + imgData[0] +
"g" + imgData[1] +
"b" + imgData[2] +
"a" + imgData[3];
}
navigator.mozGetUserMedia({video: true, fake: true}, function(stream) {
var stream = stream;
var video1 = document.getElementById('video1');
var video2 = document.getElementById('video2');
var src = URL.createObjectURL(stream);
video1.src = src;
video2.src = src;
video1.onplaying = () => video1.pause();
var v1PausedImageData;
var v2PausedImageData;
video1.onpause = function() {
v1PausedImageData = getVideoImagePixelData(video1);
v2PausedImageData = getVideoImagePixelData(video2);
v2TimesToTest = 3;
video2.ontimeupdate = function() {
if (getVideoImagePixelData(video2) === v2PausedImageData) {
// Wait until video2 has progressed it's video.
// If it doesn't, we'll time out and fail.
info("video2 has not progressed. Waiting.");
return;
}
if (--v2TimesToTest > 0) {
// Wait for a while to be sure video1 would have gotten a frame
// if it is playing.
info("video2 progressed OK");
return;
}
video2.ontimeupdate = null;
ok(true, "video2 is playing");
isnot(video1.currentTime, video2.currentTime,
"v1 and v2 should not be at the same currentTime");
is(v1PausedImageData, getVideoImagePixelData(video1),
"video1 video frame should not have updated since video1 paused");
SimpleTest.finish();
};
};
}, function(error) {
ok(false, "getUserMedia should not fail, got " + error.name);
SimpleTest.finish();
});
</script>
</body>
</html>

Просмотреть файл

@ -572,8 +572,8 @@ nsPluginStreamListenerPeer::OnStartRequest(nsIRequest *request,
NS_IMETHODIMP nsPluginStreamListenerPeer::OnProgress(nsIRequest *request,
nsISupports* aContext,
uint64_t aProgress,
uint64_t aProgressMax)
int64_t aProgress,
int64_t aProgressMax)
{
nsresult rv = NS_OK;
return rv;

Просмотреть файл

@ -17,6 +17,7 @@
function runTests() {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var utils = SpecialPowers.DOMWindowUtils;
var scale = utils.screenPixelsPerCSSPixel;
var plugin1 = document.getElementById("plugin1"); // What we're testing.
var plugin2 = document.getElementById("plugin2"); // Dummy.
@ -55,8 +56,8 @@
is(initialStateUnknown, true, "Initial state should be unknown, assumed false.");
// Give the plugin focus (the window is already focused).
utils.sendNativeMouseEvent(plugin1X, plugin1Y, NSLeftMouseDown, 0, plugin1);
utils.sendNativeMouseEvent(plugin1X, plugin1Y, NSLeftMouseUp, 0, plugin1);
utils.sendNativeMouseEvent(plugin1X * scale, plugin1Y * scale, NSLeftMouseDown, 0, plugin1);
utils.sendNativeMouseEvent(plugin1X * scale, plugin1Y * scale, NSLeftMouseUp, 0, plugin1);
expectedEventCount++;
is(plugin1.getFocusState(), true, "(1) Plugin should have focus.");
@ -78,8 +79,8 @@
is(plugin1.getFocusEventCount(), expectedEventCount, "Focus event count should be " + expectedEventCount);
// Take focus from the plugin.
utils.sendNativeMouseEvent(plugin2X, plugin2Y, NSLeftMouseDown, 0, plugin2);
utils.sendNativeMouseEvent(plugin2X, plugin2Y, NSLeftMouseUp, 0, plugin2);
utils.sendNativeMouseEvent(plugin2X * scale, plugin2Y * scale, NSLeftMouseDown, 0, plugin2);
utils.sendNativeMouseEvent(plugin2X * scale, plugin2Y * scale, NSLeftMouseUp, 0, plugin2);
expectedEventCount++;
is(plugin1.getFocusState(), false, "(4) Plugin should not have focus.");
@ -89,8 +90,8 @@
// changes that took place while the window was inactive.
// Give the plugin focus (the window is already focused).
utils.sendNativeMouseEvent(plugin1X, plugin1Y, NSLeftMouseDown, 0, plugin1);
utils.sendNativeMouseEvent(plugin1X, plugin1Y, NSLeftMouseUp, 0, plugin1);
utils.sendNativeMouseEvent(plugin1X * scale, plugin1Y * scale, NSLeftMouseDown, 0, plugin1);
utils.sendNativeMouseEvent(plugin1X * scale, plugin1Y * scale, NSLeftMouseUp, 0, plugin1);
expectedEventCount++;
// Blur the window.

Просмотреть файл

@ -132,6 +132,8 @@ const CommandFunc NetworkUtils::sWifiEnableChain[] = {
NetworkUtils::startSoftAP,
NetworkUtils::setInterfaceUp,
NetworkUtils::tetherInterface,
NetworkUtils::addInterfaceToLocalNetwork,
NetworkUtils::addRouteToLocalNetwork,
NetworkUtils::setIpForwardingEnabled,
NetworkUtils::tetheringStatus,
NetworkUtils::startTethering,
@ -146,6 +148,7 @@ const CommandFunc NetworkUtils::sWifiDisableChain[] = {
NetworkUtils::stopAccessPointDriver,
NetworkUtils::wifiFirmwareReload,
NetworkUtils::untetherInterface,
NetworkUtils::removeInterfaceFromLocalNetwork,
NetworkUtils::preTetherInterfaceList,
NetworkUtils::postTetherInterfaceList,
NetworkUtils::disableNat,
@ -173,6 +176,8 @@ const CommandFunc NetworkUtils::sWifiRetryChain[] = {
NetworkUtils::startSoftAP,
NetworkUtils::setInterfaceUp,
NetworkUtils::tetherInterface,
NetworkUtils::addInterfaceToLocalNetwork,
NetworkUtils::addRouteToLocalNetwork,
NetworkUtils::setIpForwardingEnabled,
NetworkUtils::tetheringStatus,
NetworkUtils::startTethering,
@ -191,6 +196,8 @@ const CommandFunc NetworkUtils::sUSBEnableChain[] = {
NetworkUtils::enableNat,
NetworkUtils::setIpForwardingEnabled,
NetworkUtils::tetherInterface,
NetworkUtils::addInterfaceToLocalNetwork,
NetworkUtils::addRouteToLocalNetwork,
NetworkUtils::tetheringStatus,
NetworkUtils::startTethering,
NetworkUtils::setDnsForwarders,
@ -199,6 +206,7 @@ const CommandFunc NetworkUtils::sUSBEnableChain[] = {
const CommandFunc NetworkUtils::sUSBDisableChain[] = {
NetworkUtils::untetherInterface,
NetworkUtils::removeInterfaceFromLocalNetwork,
NetworkUtils::preTetherInterfaceList,
NetworkUtils::postTetherInterfaceList,
NetworkUtils::disableNat,
@ -734,6 +742,48 @@ void NetworkUtils::tetherInterface(CommandChain* aChain,
doCommand(command, aChain, aCallback);
}
void NetworkUtils::addInterfaceToLocalNetwork(CommandChain* aChain,
CommandCallback aCallback,
NetworkResultOptions& aResult)
{
// Skip the command for sdk version < 20.
if (SDK_VERSION < 20) {
aResult.mResultCode = 0;
aResult.mResultReason = NS_ConvertUTF8toUTF16("");
aCallback(aChain, false, aResult);
return;
}
char command[MAX_COMMAND_SIZE];
snprintf(command, MAX_COMMAND_SIZE - 1, "network interface add local %s",
GET_CHAR(mInternalIfname));
doCommand(command, aChain, aCallback);
}
void NetworkUtils::addRouteToLocalNetwork(CommandChain* aChain,
CommandCallback aCallback,
NetworkResultOptions& aResult)
{
// Skip the command for sdk version < 20.
if (SDK_VERSION < 20) {
aResult.mResultCode = 0;
aResult.mResultReason = NS_ConvertUTF8toUTF16("");
aCallback(aChain, false, aResult);
return;
}
char command[MAX_COMMAND_SIZE];
uint32_t prefix = atoi(GET_CHAR(mPrefix));
uint32_t ip = inet_addr(GET_CHAR(mIp));
char* networkAddr = getNetworkAddr(ip, prefix);
snprintf(command, MAX_COMMAND_SIZE - 1, "network route add local %s %s/%s",
GET_CHAR(mInternalIfname), networkAddr, GET_CHAR(mPrefix));
doCommand(command, aChain, aCallback);
}
void NetworkUtils::preTetherInterfaceList(CommandChain* aChain,
CommandCallback aCallback,
NetworkResultOptions& aResult)
@ -847,12 +897,38 @@ void NetworkUtils::untetherInterface(CommandChain* aChain,
doCommand(command, aChain, aCallback);
}
void NetworkUtils::removeInterfaceFromLocalNetwork(CommandChain* aChain,
CommandCallback aCallback,
NetworkResultOptions& aResult)
{
// Skip the command for sdk version < 20.
if (SDK_VERSION < 20) {
aResult.mResultCode = 0;
aResult.mResultReason = NS_ConvertUTF8toUTF16("");
aCallback(aChain, false, aResult);
return;
}
char command[MAX_COMMAND_SIZE];
snprintf(command, MAX_COMMAND_SIZE - 1, "network interface remove local %s",
GET_CHAR(mIfname));
doCommand(command, aChain, aCallback);
}
void NetworkUtils::setDnsForwarders(CommandChain* aChain,
CommandCallback aCallback,
NetworkResultOptions& aResult)
{
char command[MAX_COMMAND_SIZE];
snprintf(command, MAX_COMMAND_SIZE - 1, "tether dns set %s %s", GET_CHAR(mDns1), GET_CHAR(mDns2));
if (SDK_VERSION >= 20) {
snprintf(command, MAX_COMMAND_SIZE - 1, "tether dns set %d %s %s",
GET_FIELD(mNetId), GET_CHAR(mDns1), GET_CHAR(mDns2));
} else {
snprintf(command, MAX_COMMAND_SIZE - 1, "tether dns set %s %s",
GET_CHAR(mDns1), GET_CHAR(mDns2));
}
doCommand(command, aChain, aCallback);
}
@ -2123,6 +2199,15 @@ CommandResult NetworkUtils::setWifiTethering(NetworkParams& aOptions)
}
dumpParams(aOptions, "WIFI");
if (SDK_VERSION >= 20) {
NetIdManager::NetIdInfo netIdInfo;
if (!mNetIdManager.lookup(aOptions.mExternalIfname, &netIdInfo)) {
ERROR("No such interface: %s", GET_CHAR(mExternalIfname));
return -1;
}
aOptions.mNetId = netIdInfo.mNetId;
}
if (enable) {
NU_DBG("Starting Wifi Tethering on %s <-> %s",
GET_CHAR(mInternalIfname), GET_CHAR(mExternalIfname));
@ -2155,6 +2240,15 @@ CommandResult NetworkUtils::setUSBTethering(NetworkParams& aOptions)
}
dumpParams(aOptions, "USB");
if (SDK_VERSION >= 20) {
NetIdManager::NetIdInfo netIdInfo;
if (!mNetIdManager.lookup(aOptions.mExternalIfname, &netIdInfo)) {
ERROR("No such interface: %s", GET_CHAR(mExternalIfname));
return -1;
}
aOptions.mNetId = netIdInfo.mNetId;
}
if (enable) {
NU_DBG("Starting USB Tethering on %s <-> %s",
GET_CHAR(mInternalIfname), GET_CHAR(mExternalIfname));

Просмотреть файл

@ -356,6 +356,8 @@ private:
static void setAlarm(PARAMS);
static void setInterfaceUp(PARAMS);
static void tetherInterface(PARAMS);
static void addInterfaceToLocalNetwork(PARAMS);
static void addRouteToLocalNetwork(PARAMS);
static void preTetherInterfaceList(PARAMS);
static void postTetherInterfaceList(PARAMS);
static void setIpForwardingEnabled(PARAMS);
@ -363,6 +365,7 @@ private:
static void stopTethering(PARAMS);
static void startTethering(PARAMS);
static void untetherInterface(PARAMS);
static void removeInterfaceFromLocalNetwork(PARAMS);
static void setDnsForwarders(PARAMS);
static void enableNat(PARAMS);
static void disableNat(PARAMS);

Просмотреть файл

@ -57,7 +57,7 @@ interface DataStore : EventTarget {
};
partial interface DataStore {
[ChromeOnly, Throws]
[ChromeOnly, Throws, Exposed=Window]
void setDataStoreImpl(DataStoreImpl store);
};
@ -82,7 +82,7 @@ interface DataStoreCursor {
};
partial interface DataStoreCursor {
[ChromeOnly]
[ChromeOnly, Exposed=Window]
void setDataStoreCursorImpl(DataStoreCursorImpl cursor);
};

Просмотреть файл

@ -715,12 +715,6 @@ WorkerDataStore::Sync(JSContext* aCx,
return workerCursor.forget();
}
void
WorkerDataStore::SetDataStoreImpl(DataStoreImpl& aStore, ErrorResult& aRv)
{
NS_NOTREACHED("We don't use this for the WorkerDataStore!");
}
void
WorkerDataStore::SetBackingDataStore(
const nsMainThreadPtrHandle<DataStore>& aBackingStore)

Просмотреть файл

@ -85,9 +85,6 @@ public:
IMPL_EVENT_HANDLER(change)
// We don't use this for the WorkerDataStore.
void SetDataStoreImpl(DataStoreImpl& aStore, ErrorResult& aRv);
void SetBackingDataStore(
const nsMainThreadPtrHandle<DataStore>& aBackingStore);

Просмотреть файл

@ -187,12 +187,6 @@ WorkerDataStoreCursor::Close(JSContext* aCx, ErrorResult& aRv)
runnable->Dispatch(aCx);
}
void
WorkerDataStoreCursor::SetDataStoreCursorImpl(DataStoreCursorImpl& aCursor)
{
NS_NOTREACHED("We don't use this for the WorkerDataStoreCursor!");
}
void
WorkerDataStoreCursor::SetBackingDataStoreCursor(
const nsMainThreadPtrHandle<DataStoreCursor>& aBackingCursor)

Просмотреть файл

@ -45,9 +45,6 @@ public:
void Close(JSContext *aCx, ErrorResult& aRv);
// We don't use this for the WorkerDataStore.
void SetDataStoreCursorImpl(DataStoreCursorImpl& aCursor);
void SetBackingDataStoreCursor(
const nsMainThreadPtrHandle<DataStoreCursor>& aBackingCursor);

Просмотреть файл

@ -38,7 +38,7 @@ public:
virtual JSObject* WrapObjectInternal(JSContext* aCx) MOZ_OVERRIDE
{
return mozilla::dom::InstallPhaseEventBinding_workers::Wrap(aCx, this);
return mozilla::dom::InstallPhaseEventBinding::Wrap(aCx, this);
}
static already_AddRefed<InstallPhaseEvent>
@ -90,7 +90,7 @@ public:
virtual JSObject* WrapObjectInternal(JSContext* aCx) MOZ_OVERRIDE
{
return mozilla::dom::InstallEventBinding_workers::Wrap(aCx, this);
return mozilla::dom::InstallEventBinding::Wrap(aCx, this);
}
static already_AddRefed<InstallEvent>

Просмотреть файл

@ -81,6 +81,10 @@ public:
mURL(aURL)
{
MOZ_ASSERT(aBlobImpl);
DebugOnly<bool> isMutable;
MOZ_ASSERT(NS_SUCCEEDED(aBlobImpl->GetMutable(&isMutable)));
MOZ_ASSERT(!isMutable);
}
bool
@ -114,6 +118,10 @@ public:
}
}
DebugOnly<bool> isMutable;
MOZ_ASSERT(NS_SUCCEEDED(mBlobImpl->GetMutable(&isMutable)));
MOZ_ASSERT(!isMutable);
nsCOMPtr<nsIPrincipal> principal;
nsIDocument* doc = nullptr;
@ -870,19 +878,6 @@ URL::SetHash(const nsAString& aHash, ErrorResult& aRv)
}
}
// static
void
URL::CreateObjectURL(const GlobalObject& aGlobal, JSObject* aBlob,
const mozilla::dom::objectURLOptions& aOptions,
nsString& aResult, mozilla::ErrorResult& aRv)
{
SetDOMStringToNull(aResult);
NS_NAMED_LITERAL_STRING(argStr, "Argument 1 of URL.createObjectURL");
NS_NAMED_LITERAL_STRING(blobStr, "MediaStream");
aRv.ThrowTypeError(MSG_DOES_NOT_IMPLEMENT_INTERFACE, &argStr, &blobStr);
}
// static
void
URL::CreateObjectURL(const GlobalObject& aGlobal, File& aBlob,
@ -892,8 +887,16 @@ URL::CreateObjectURL(const GlobalObject& aGlobal, File& aBlob,
JSContext* cx = aGlobal.Context();
WorkerPrivate* workerPrivate = GetWorkerPrivateFromContext(cx);
nsRefPtr<FileImpl> blobImpl = aBlob.Impl();
MOZ_ASSERT(blobImpl);
aRv = blobImpl->SetMutable(false);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
nsRefPtr<CreateURLRunnable> runnable =
new CreateURLRunnable(workerPrivate, aBlob.Impl(), aOptions, aResult);
new CreateURLRunnable(workerPrivate, blobImpl, aOptions, aResult);
if (!runnable->Dispatch(cx)) {
JS_ReportPendingException(cx);

Просмотреть файл

@ -57,11 +57,6 @@ public:
Constructor(const GlobalObject& aGlobal, const nsAString& aUrl,
const nsAString& aBase, ErrorResult& aRv);
static void
CreateObjectURL(const GlobalObject& aGlobal,
JSObject* aArg, const objectURLOptions& aOptions,
nsString& aResult, ErrorResult& aRv);
static void
CreateObjectURL(const GlobalObject& aGlobal,
File& aArg, const objectURLOptions& aOptions,

Просмотреть файл

@ -61,6 +61,7 @@
#include "mozilla/ipc/BackgroundUtils.h"
#include "mozilla/ipc/PBackgroundSharedTypes.h"
#include "mozilla/Preferences.h"
#include "MultipartFileImpl.h"
#include "nsAlgorithm.h"
#include "nsContentUtils.h"
#include "nsError.h"
@ -307,6 +308,84 @@ LogErrorToConsole(const nsAString& aMessage,
fflush(stderr);
}
// Recursive!
already_AddRefed<FileImpl>
EnsureBlobForBackgroundManager(FileImpl* aBlobImpl,
PBackgroundChild* aManager = nullptr)
{
MOZ_ASSERT(aBlobImpl);
if (!aManager) {
aManager = BackgroundChild::GetForCurrentThread();
MOZ_ASSERT(aManager);
}
nsRefPtr<FileImpl> blobImpl = aBlobImpl;
const nsTArray<nsRefPtr<FileImpl>>* subBlobImpls =
aBlobImpl->GetSubBlobImpls();
if (!subBlobImpls) {
if (nsCOMPtr<nsIRemoteBlob> remoteBlob = do_QueryObject(blobImpl)) {
// Always make sure we have a blob from an actor we can use on this
// thread.
BlobChild* blobChild = BlobChild::GetOrCreate(aManager, blobImpl);
MOZ_ASSERT(blobChild);
blobImpl = blobChild->GetBlobImpl();
MOZ_ASSERT(blobImpl);
DebugOnly<bool> isMutable;
MOZ_ASSERT(NS_SUCCEEDED(blobImpl->GetMutable(&isMutable)));
MOZ_ASSERT(!isMutable);
} else {
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(blobImpl->SetMutable(false)));
}
return blobImpl.forget();
}
const uint32_t subBlobCount = subBlobImpls->Length();
MOZ_ASSERT(subBlobCount);
nsTArray<nsRefPtr<FileImpl>> newSubBlobImpls;
newSubBlobImpls.SetLength(subBlobCount);
bool newBlobImplNeeded = false;
for (uint32_t index = 0; index < subBlobCount; index++) {
const nsRefPtr<FileImpl>& subBlobImpl = subBlobImpls->ElementAt(index);
MOZ_ASSERT(subBlobImpl);
nsRefPtr<FileImpl>& newSubBlobImpl = newSubBlobImpls[index];
newSubBlobImpl = EnsureBlobForBackgroundManager(subBlobImpl, aManager);
MOZ_ASSERT(newSubBlobImpl);
if (subBlobImpl != newSubBlobImpl) {
newBlobImplNeeded = true;
}
}
if (newBlobImplNeeded) {
nsString contentType;
blobImpl->GetType(contentType);
if (blobImpl->IsFile()) {
nsString name;
blobImpl->GetName(name);
blobImpl = new MultipartFileImpl(newSubBlobImpls, name, contentType);
} else {
blobImpl = new MultipartFileImpl(newSubBlobImpls, contentType);
}
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(blobImpl->SetMutable(false)));
}
return blobImpl.forget();
}
void
ReadBlobOrFile(JSContext* aCx,
JSStructuredCloneReader* aReader,
@ -327,22 +406,8 @@ ReadBlobOrFile(JSContext* aCx,
blobImpl = rawBlobImpl;
}
DebugOnly<bool> isMutable;
MOZ_ASSERT(NS_SUCCEEDED(blobImpl->GetMutable(&isMutable)));
MOZ_ASSERT(!isMutable);
if (nsCOMPtr<nsIRemoteBlob> remoteBlob = do_QueryObject(blobImpl)) {
PBackgroundChild* backgroundManager =
BackgroundChild::GetForCurrentThread();
MOZ_ASSERT(backgroundManager);
// Always make sure we have a blob from an actor we can use on this thread.
BlobChild* blobChild = BlobChild::GetOrCreate(backgroundManager, blobImpl);
MOZ_ASSERT(blobChild);
blobImpl = blobChild->GetBlobImpl();
MOZ_ASSERT(blobImpl);
}
blobImpl = EnsureBlobForBackgroundManager(blobImpl);
MOZ_ASSERT(blobImpl);
nsCOMPtr<nsISupports> parent;
if (aIsMainThread) {
@ -376,24 +441,10 @@ WriteBlobOrFile(JSContext* aCx,
MOZ_ASSERT(aWriter);
MOZ_ASSERT(aBlobOrFileImpl);
nsRefPtr<FileImpl> newBlobOrFileImpl;
if (nsCOMPtr<nsIRemoteBlob> remoteBlob = do_QueryObject(aBlobOrFileImpl)) {
PBackgroundChild* backgroundManager =
BackgroundChild::GetForCurrentThread();
MOZ_ASSERT(backgroundManager);
nsRefPtr<FileImpl> blobImpl = EnsureBlobForBackgroundManager(aBlobOrFileImpl);
MOZ_ASSERT(blobImpl);
// Always make sure we have a blob from an actor we can use on this thread.
BlobChild* blobChild =
BlobChild::GetOrCreate(backgroundManager, aBlobOrFileImpl);
MOZ_ASSERT(blobChild);
newBlobOrFileImpl = blobChild->GetBlobImpl();
MOZ_ASSERT(newBlobOrFileImpl);
aBlobOrFileImpl = newBlobOrFileImpl;
}
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(aBlobOrFileImpl->SetMutable(false)));
aBlobOrFileImpl = blobImpl;
if (NS_WARN_IF(!JS_WriteUint32Pair(aWriter, DOMWORKER_SCTAG_BLOB, 0)) ||
NS_WARN_IF(!JS_WriteBytes(aWriter,

Просмотреть файл

@ -2178,6 +2178,14 @@ XMLHttpRequest::Send(File& aBody, ErrorResult& aRv)
return;
}
nsRefPtr<FileImpl> blobImpl = aBody.Impl();
MOZ_ASSERT(blobImpl);
aRv = blobImpl->SetMutable(false);
if (NS_WARN_IF(aRv.Failed())) {
return;
}
const JSStructuredCloneCallbacks* callbacks =
mWorkerPrivate->IsChromeWorker() ?
ChromeWorkerStructuredCloneCallbacks(false) :

Просмотреть файл

@ -78,17 +78,33 @@ function testBug1109574() {
}
function testMethod() {
var allowed = ["delete", "get", "head", "options", "post", "put"];
// These get normalized.
var allowed = ["delete", "get", "head", "options", "post", "put" ];
for (var i = 0; i < allowed.length; ++i) {
try {
var r = new Request("", { method: allowed[i] });
ok(true, "Method " + allowed[i] + " should be allowed");
is(r.method, allowed[i].toUpperCase(),
"Standard HTTP method " + allowed[i] + " should be normalized");
} catch(e) {
ok(false, "Method " + allowed[i] + " should be allowed");
}
}
var forbidden = ["aardvark", "connect", "trace", "track"];
var allowed = [ "pAtCh", "foo" ];
for (var i = 0; i < allowed.length; ++i) {
try {
var r = new Request("", { method: allowed[i] });
ok(true, "Method " + allowed[i] + " should be allowed");
is(r.method, allowed[i],
"Non-standard but valid HTTP method " + allowed[i] +
" should not be normalized");
} catch(e) {
ok(false, "Method " + allowed[i] + " should be allowed");
}
}
var forbidden = ["connect", "trace", "track", "<invalid token??"];
for (var i = 0; i < forbidden.length; ++i) {
try {
var r = new Request("", { method: forbidden[i] });

Просмотреть файл

@ -910,10 +910,10 @@ nsWebBrowserPersist::OnDataAvailable(
//*****************************************************************************
/* void onProgress (in nsIRequest request, in nsISupports ctxt,
in unsigned long long aProgress, in unsigned long long aProgressMax); */
in long long aProgress, in long long aProgressMax); */
NS_IMETHODIMP nsWebBrowserPersist::OnProgress(
nsIRequest *request, nsISupports *ctxt, uint64_t aProgress,
uint64_t aProgressMax)
nsIRequest *request, nsISupports *ctxt, int64_t aProgress,
int64_t aProgressMax)
{
if (!mProgressListener)
{
@ -925,16 +925,16 @@ NS_IMETHODIMP nsWebBrowserPersist::OnProgress(
OutputData *data = mOutputMap.Get(keyPtr);
if (data)
{
data->mSelfProgress = int64_t(aProgress);
data->mSelfProgressMax = int64_t(aProgressMax);
data->mSelfProgress = aProgress;
data->mSelfProgressMax = aProgressMax;
}
else
{
UploadData *upData = mUploadList.Get(keyPtr);
if (upData)
{
upData->mSelfProgress = int64_t(aProgress);
upData->mSelfProgressMax = int64_t(aProgressMax);
upData->mSelfProgress = aProgress;
upData->mSelfProgressMax = aProgressMax;
}
}

Просмотреть файл

@ -45,19 +45,19 @@ SurfaceContainsPoint(SourceSurface* aSurface, const IntPoint& aPoint)
}
void
ConvertBGRXToBGRA(uint8_t* aData, const IntSize &aSize, int32_t aStride)
ConvertBGRXToBGRA(uint8_t* aData, const IntSize &aSize, const int32_t aStride)
{
uint32_t* pixel = reinterpret_cast<uint32_t*>(aData);
int height = aSize.height, width = aSize.width * 4;
for (int row = 0; row < aSize.height; ++row) {
for (int column = 0; column < aSize.width; ++column) {
for (int row = 0; row < height; ++row) {
for (int column = 0; column < width; column += 4) {
#ifdef IS_BIG_ENDIAN
pixel[column] |= 0x000000FF;
aData[column] = 0xFF;
#else
pixel[column] |= 0xFF000000;
aData[column + 3] = 0xFF;
#endif
}
pixel += (aStride/4);
aData += aStride;
}
}

Просмотреть файл

@ -12,7 +12,7 @@ namespace mozilla {
namespace gfx {
void
ConvertBGRXToBGRA(uint8_t* aData, const IntSize &aSize, int32_t aStride);
ConvertBGRXToBGRA(uint8_t* aData, const IntSize &aSize, const int32_t aStride);
/**
* Copy the pixel data from aSrc and pack it into aDst. aSrcSize, aSrcStride

Просмотреть файл

@ -1108,7 +1108,19 @@ DrawTargetCG::StrokeRect(const Rect &aRect,
DrawGradient(mColorSpace, cg, aPattern, extents);
} else {
SetStrokeFromPattern(cg, mColorSpace, aPattern);
CGContextStrokeRect(cg, RectToCGRect(aRect));
// We'd like to use CGContextStrokeRect(cg, RectToCGRect(aRect));
// Unfortunately, newer versions of OS X no longer start at the top-left
// corner and stroke clockwise as older OS X versions and all the other
// Moz2D backends do. (Newer versions start at the top right-hand corner
// and stroke counter-clockwise.) For consistency we draw the rect by hand.
CGRect rect = RectToCGRect(aRect);
CGContextBeginPath(cg);
CGContextMoveToPoint(cg, CGRectGetMinX(rect), CGRectGetMinY(rect));
CGContextAddLineToPoint(cg, CGRectGetMaxX(rect), CGRectGetMinY(rect));
CGContextAddLineToPoint(cg, CGRectGetMaxX(rect), CGRectGetMaxY(rect));
CGContextAddLineToPoint(cg, CGRectGetMinX(rect), CGRectGetMaxY(rect));
CGContextClosePath(cg);
CGContextStrokePath(cg);
}
fixer.Fix(mCg);

Просмотреть файл

@ -153,6 +153,8 @@ class CircularRowBuffer {
std::vector<unsigned char*> row_addresses_;
};
} // namespace
// Convolves horizontally along a single row. The row data is given in
// |src_data| and continues for the [begin, end) of the filter.
template<bool has_alpha>
@ -267,7 +269,60 @@ void ConvolveVertically(const ConvolutionFilter1D::Fixed* filter_values,
}
}
} // namespace
void ConvolveVertically(const ConvolutionFilter1D::Fixed* filter_values,
int filter_length,
unsigned char* const* source_data_rows,
int width, unsigned char* out_row,
bool has_alpha, bool use_sse2) {
int processed = 0;
#if defined(USE_SSE2)
// If the binary was not built with SSE2 support, we had to fallback to C version.
int simd_width = width & ~3;
if (use_sse2 && simd_width) {
ConvolveVertically_SSE2(filter_values, filter_length,
source_data_rows, 0, simd_width,
out_row, has_alpha);
processed = simd_width;
}
#endif
if (width > processed) {
if (has_alpha) {
ConvolveVertically<true>(filter_values, filter_length, source_data_rows,
processed, width, out_row);
} else {
ConvolveVertically<false>(filter_values, filter_length, source_data_rows,
processed, width, out_row);
}
}
}
void ConvolveHorizontally(const unsigned char* src_data,
const ConvolutionFilter1D& filter,
unsigned char* out_row,
bool has_alpha, bool use_sse2) {
int width = filter.num_values();
int processed = 0;
#if defined(USE_SSE2)
int simd_width = width & ~3;
if (use_sse2 && simd_width) {
// SIMD implementation works with 4 pixels at a time.
// Therefore we process as much as we can using SSE and then use
// C implementation for leftovers
ConvolveHorizontally_SSE2(src_data, 0, simd_width, filter, out_row);
processed = simd_width;
}
#endif
if (width > processed) {
if (has_alpha) {
ConvolveHorizontally<true>(src_data, processed, width, filter, out_row);
} else {
ConvolveHorizontally<false>(src_data, processed, width, filter, out_row);
}
}
}
// ConvolutionFilter1D ---------------------------------------------------------
@ -462,24 +517,9 @@ void BGRAConvolve2D(const unsigned char* source_data,
unsigned char* const* first_row_for_filter =
&rows_to_convolve[filter_offset - first_row_in_circular_buffer];
int processed = 0;
#if defined(USE_SSE2)
int simd_width = pixel_width & ~3;
if (use_sse2 && simd_width) {
ConvolveVertically_SSE2(filter_values, filter_length, first_row_for_filter,
0, simd_width, cur_output_row, source_has_alpha);
processed = simd_width;
}
#endif
if (source_has_alpha) {
ConvolveVertically<true>(filter_values, filter_length,
first_row_for_filter,
processed, pixel_width, cur_output_row);
} else {
ConvolveVertically<false>(filter_values, filter_length,
first_row_for_filter,
processed, pixel_width, cur_output_row);
}
ConvolveVertically(filter_values, filter_length,
first_row_for_filter, pixel_width,
cur_output_row, source_has_alpha, use_sse2);
}
}

Просмотреть файл

@ -186,6 +186,17 @@ void BGRAConvolve2D(const unsigned char* source_data,
int output_byte_row_stride,
unsigned char* output);
void ConvolveHorizontally(const unsigned char* src_data,
const ConvolutionFilter1D& filter,
unsigned char* out_row,
bool has_alpha, bool use_sse2);
void ConvolveVertically(const ConvolutionFilter1D::Fixed* filter_values,
int filter_length,
unsigned char* const* source_data_rows,
int pixel_width, unsigned char* out_row,
bool has_alpha, bool use_sse2);
} // namespace skia
#endif // SKIA_EXT_CONVOLVER_H_

Просмотреть файл

@ -44,171 +44,7 @@
namespace skia {
namespace {
// Returns the ceiling/floor as an integer.
inline int CeilInt(float val) {
return static_cast<int>(ceil(val));
}
inline int FloorInt(float val) {
return static_cast<int>(floor(val));
}
// Filter function computation -------------------------------------------------
// Evaluates the box filter, which goes from -0.5 to +0.5.
float EvalBox(float x) {
return (x >= -0.5f && x < 0.5f) ? 1.0f : 0.0f;
}
// Evaluates the Lanczos filter of the given filter size window for the given
// position.
//
// |filter_size| is the width of the filter (the "window"), outside of which
// the value of the function is 0. Inside of the window, the value is the
// normalized sinc function:
// lanczos(x) = sinc(x) * sinc(x / filter_size);
// where
// sinc(x) = sin(pi*x) / (pi*x);
float EvalLanczos(int filter_size, float x) {
if (x <= -filter_size || x >= filter_size)
return 0.0f; // Outside of the window.
if (x > -std::numeric_limits<float>::epsilon() &&
x < std::numeric_limits<float>::epsilon())
return 1.0f; // Special case the discontinuity at the origin.
float xpi = x * static_cast<float>(M_PI);
return (sin(xpi) / xpi) * // sinc(x)
sin(xpi / filter_size) / (xpi / filter_size); // sinc(x/filter_size)
}
// Evaluates the Hamming filter of the given filter size window for the given
// position.
//
// The filter covers [-filter_size, +filter_size]. Outside of this window
// the value of the function is 0. Inside of the window, the value is sinus
// cardinal multiplied by a recentered Hamming function. The traditional
// Hamming formula for a window of size N and n ranging in [0, N-1] is:
// hamming(n) = 0.54 - 0.46 * cos(2 * pi * n / (N-1)))
// In our case we want the function centered for x == 0 and at its minimum
// on both ends of the window (x == +/- filter_size), hence the adjusted
// formula:
// hamming(x) = (0.54 -
// 0.46 * cos(2 * pi * (x - filter_size)/ (2 * filter_size)))
// = 0.54 - 0.46 * cos(pi * x / filter_size - pi)
// = 0.54 + 0.46 * cos(pi * x / filter_size)
float EvalHamming(int filter_size, float x) {
if (x <= -filter_size || x >= filter_size)
return 0.0f; // Outside of the window.
if (x > -std::numeric_limits<float>::epsilon() &&
x < std::numeric_limits<float>::epsilon())
return 1.0f; // Special case the sinc discontinuity at the origin.
const float xpi = x * static_cast<float>(M_PI);
return ((sin(xpi) / xpi) * // sinc(x)
(0.54f + 0.46f * cos(xpi / filter_size))); // hamming(x)
}
// ResizeFilter ----------------------------------------------------------------
// Encapsulates computation and storage of the filters required for one complete
// resize operation.
class ResizeFilter {
public:
ResizeFilter(ImageOperations::ResizeMethod method,
int src_full_width, int src_full_height,
int dest_width, int dest_height,
const SkIRect& dest_subset);
// Returns the filled filter values.
const ConvolutionFilter1D& x_filter() { return x_filter_; }
const ConvolutionFilter1D& y_filter() { return y_filter_; }
private:
// Returns the number of pixels that the filer spans, in filter space (the
// destination image).
float GetFilterSupport(float scale) {
switch (method_) {
case ImageOperations::RESIZE_BOX:
// The box filter just scales with the image scaling.
return 0.5f; // Only want one side of the filter = /2.
case ImageOperations::RESIZE_HAMMING1:
// The Hamming filter takes as much space in the source image in
// each direction as the size of the window = 1 for Hamming1.
return 1.0f;
case ImageOperations::RESIZE_LANCZOS2:
// The Lanczos filter takes as much space in the source image in
// each direction as the size of the window = 2 for Lanczos2.
return 2.0f;
case ImageOperations::RESIZE_LANCZOS3:
// The Lanczos filter takes as much space in the source image in
// each direction as the size of the window = 3 for Lanczos3.
return 3.0f;
default:
return 1.0f;
}
}
// Computes one set of filters either horizontally or vertically. The caller
// will specify the "min" and "max" rather than the bottom/top and
// right/bottom so that the same code can be re-used in each dimension.
//
// |src_depend_lo| and |src_depend_size| gives the range for the source
// depend rectangle (horizontally or vertically at the caller's discretion
// -- see above for what this means).
//
// Likewise, the range of destination values to compute and the scale factor
// for the transform is also specified.
void ComputeFilters(int src_size,
int dest_subset_lo, int dest_subset_size,
float scale, ConvolutionFilter1D* output);
// Computes the filter value given the coordinate in filter space.
inline float ComputeFilter(float pos) {
switch (method_) {
case ImageOperations::RESIZE_BOX:
return EvalBox(pos);
case ImageOperations::RESIZE_HAMMING1:
return EvalHamming(1, pos);
case ImageOperations::RESIZE_LANCZOS2:
return EvalLanczos(2, pos);
case ImageOperations::RESIZE_LANCZOS3:
return EvalLanczos(3, pos);
default:
return 0;
}
}
ImageOperations::ResizeMethod method_;
// Subset of scaled destination bitmap to compute.
SkIRect out_bounds_;
ConvolutionFilter1D x_filter_;
ConvolutionFilter1D y_filter_;
DISALLOW_COPY_AND_ASSIGN(ResizeFilter);
};
ResizeFilter::ResizeFilter(ImageOperations::ResizeMethod method,
int src_full_width, int src_full_height,
int dest_width, int dest_height,
const SkIRect& dest_subset)
: method_(method),
out_bounds_(dest_subset) {
// method_ will only ever refer to an "algorithm method".
SkASSERT((ImageOperations::RESIZE_FIRST_ALGORITHM_METHOD <= method) &&
(method <= ImageOperations::RESIZE_LAST_ALGORITHM_METHOD));
float scale_x = static_cast<float>(dest_width) /
static_cast<float>(src_full_width);
float scale_y = static_cast<float>(dest_height) /
static_cast<float>(src_full_height);
ComputeFilters(src_full_width, dest_subset.fLeft, dest_subset.width(),
scale_x, &x_filter_);
ComputeFilters(src_full_height, dest_subset.fTop, dest_subset.height(),
scale_y, &y_filter_);
}
namespace resize {
// TODO(egouriou): Take advantage of periods in the convolution.
// Practical resizing filters are periodic outside of the border area.
@ -221,9 +57,16 @@ ResizeFilter::ResizeFilter(ImageOperations::ResizeMethod method,
// Small periods reduce computational load and improve cache usage if
// the coefficients can be shared. For periods of 1 we can consider
// loading the factors only once outside the borders.
void ResizeFilter::ComputeFilters(int src_size,
int dest_subset_lo, int dest_subset_size,
float scale, ConvolutionFilter1D* output) {
void ComputeFilters(ImageOperations::ResizeMethod method,
int src_size, int dst_size,
int dest_subset_lo, int dest_subset_size,
ConvolutionFilter1D* output) {
// method_ will only ever refer to an "algorithm method".
SkASSERT((ImageOperations::RESIZE_FIRST_ALGORITHM_METHOD <= method) &&
(method <= ImageOperations::RESIZE_LAST_ALGORITHM_METHOD));
float scale = static_cast<float>(dst_size) / static_cast<float>(src_size);
int dest_subset_hi = dest_subset_lo + dest_subset_size; // [lo, hi)
// When we're doing a magnification, the scale will be larger than one. This
@ -233,7 +76,7 @@ void ResizeFilter::ComputeFilters(int src_size,
// some computations.
float clamped_scale = std::min(1.0f, scale);
float src_support = GetFilterSupport(clamped_scale) / clamped_scale;
float src_support = GetFilterSupport(method, clamped_scale) / clamped_scale;
// Speed up the divisions below by turning them into multiplies.
float inv_scale = 1.0f / scale;
@ -281,7 +124,7 @@ void ResizeFilter::ComputeFilters(int src_size,
float dest_filter_dist = src_filter_dist * clamped_scale;
// Compute the filter value at that location.
float filter_value = ComputeFilter(dest_filter_dist);
float filter_value = ComputeFilter(method, dest_filter_dist);
filter_values->push_back(filter_value);
filter_sum += filter_value;
@ -312,6 +155,8 @@ void ResizeFilter::ComputeFilters(int src_size,
output->PaddingForSIMD(8);
}
}
ImageOperations::ResizeMethod ResizeMethodToAlgorithmMethod(
ImageOperations::ResizeMethod method) {
// Convert any "Quality Method" into an "Algorithm Method"
@ -341,8 +186,6 @@ ImageOperations::ResizeMethod ResizeMethodToAlgorithmMethod(
}
}
} // namespace
// Resize ----------------------------------------------------------------------
// static
@ -496,8 +339,11 @@ SkBitmap ImageOperations::ResizeBasic(const SkBitmap& source,
if (!source.readyToDraw())
return SkBitmap();
ResizeFilter filter(method, source.width(), source.height(),
dest_width, dest_height, dest_subset);
ConvolutionFilter1D x_filter;
ConvolutionFilter1D y_filter;
resize::ComputeFilters(method, source.width(), dest_width, dest_subset.fLeft, dest_subset.width(), &x_filter);
resize::ComputeFilters(method, source.height(), dest_height, dest_subset.fTop, dest_subset.height(), &y_filter);
// Get a source bitmap encompassing this touched area. We construct the
// offsets and row strides such that it looks like a new bitmap, while
@ -522,7 +368,7 @@ SkBitmap ImageOperations::ResizeBasic(const SkBitmap& source,
return SkBitmap();
BGRAConvolve2D(source_subset, static_cast<int>(source.rowBytes()),
!source.isOpaque(), filter.x_filter(), filter.y_filter(),
!source.isOpaque(), x_filter, y_filter,
static_cast<int>(result.rowBytes()),
static_cast<unsigned char*>(result.getPixels()));

Просмотреть файл

@ -31,6 +31,8 @@
#include "skia/SkTypes.h"
#include "Types.h"
#include "convolver.h"
#include "skia/SkRect.h"
class SkBitmap;
struct SkIRect;
@ -152,6 +154,132 @@ class ImageOperations {
const SkIRect& dest_subset);
};
// Returns the ceiling/floor as an integer.
inline int CeilInt(float val) {
return static_cast<int>(ceil(val));
}
inline int FloorInt(float val) {
return static_cast<int>(floor(val));
}
// Filter function computation -------------------------------------------------
// Evaluates the box filter, which goes from -0.5 to +0.5.
inline float EvalBox(float x) {
return (x >= -0.5f && x < 0.5f) ? 1.0f : 0.0f;
}
// Evaluates the Lanczos filter of the given filter size window for the given
// position.
//
// |filter_size| is the width of the filter (the "window"), outside of which
// the value of the function is 0. Inside of the window, the value is the
// normalized sinc function:
// lanczos(x) = sinc(x) * sinc(x / filter_size);
// where
// sinc(x) = sin(pi*x) / (pi*x);
inline float EvalLanczos(int filter_size, float x) {
if (x <= -filter_size || x >= filter_size)
return 0.0f; // Outside of the window.
if (x > -std::numeric_limits<float>::epsilon() &&
x < std::numeric_limits<float>::epsilon())
return 1.0f; // Special case the discontinuity at the origin.
float xpi = x * static_cast<float>(M_PI);
return (sin(xpi) / xpi) * // sinc(x)
sin(xpi / filter_size) / (xpi / filter_size); // sinc(x/filter_size)
}
// Evaluates the Hamming filter of the given filter size window for the given
// position.
//
// The filter covers [-filter_size, +filter_size]. Outside of this window
// the value of the function is 0. Inside of the window, the value is sinus
// cardinal multiplied by a recentered Hamming function. The traditional
// Hamming formula for a window of size N and n ranging in [0, N-1] is:
// hamming(n) = 0.54 - 0.46 * cos(2 * pi * n / (N-1)))
// In our case we want the function centered for x == 0 and at its minimum
// on both ends of the window (x == +/- filter_size), hence the adjusted
// formula:
// hamming(x) = (0.54 -
// 0.46 * cos(2 * pi * (x - filter_size)/ (2 * filter_size)))
// = 0.54 - 0.46 * cos(pi * x / filter_size - pi)
// = 0.54 + 0.46 * cos(pi * x / filter_size)
inline float EvalHamming(int filter_size, float x) {
if (x <= -filter_size || x >= filter_size)
return 0.0f; // Outside of the window.
if (x > -std::numeric_limits<float>::epsilon() &&
x < std::numeric_limits<float>::epsilon())
return 1.0f; // Special case the sinc discontinuity at the origin.
const float xpi = x * static_cast<float>(M_PI);
return ((sin(xpi) / xpi) * // sinc(x)
(0.54f + 0.46f * cos(xpi / filter_size))); // hamming(x)
}
// ResizeFilter ----------------------------------------------------------------
// Encapsulates computation and storage of the filters required for one complete
// resize operation.
namespace resize {
// Returns the number of pixels that the filer spans, in filter space (the
// destination image).
inline float GetFilterSupport(ImageOperations::ResizeMethod method,
float scale) {
switch (method) {
case ImageOperations::RESIZE_BOX:
// The box filter just scales with the image scaling.
return 0.5f; // Only want one side of the filter = /2.
case ImageOperations::RESIZE_HAMMING1:
// The Hamming filter takes as much space in the source image in
// each direction as the size of the window = 1 for Hamming1.
return 1.0f;
case ImageOperations::RESIZE_LANCZOS2:
// The Lanczos filter takes as much space in the source image in
// each direction as the size of the window = 2 for Lanczos2.
return 2.0f;
case ImageOperations::RESIZE_LANCZOS3:
// The Lanczos filter takes as much space in the source image in
// each direction as the size of the window = 3 for Lanczos3.
return 3.0f;
default:
return 1.0f;
}
}
// Computes one set of filters either horizontally or vertically. The caller
// will specify the "min" and "max" rather than the bottom/top and
// right/bottom so that the same code can be re-used in each dimension.
//
// |src_depend_lo| and |src_depend_size| gives the range for the source
// depend rectangle (horizontally or vertically at the caller's discretion
// -- see above for what this means).
//
// Likewise, the range of destination values to compute and the scale factor
// for the transform is also specified.
void ComputeFilters(ImageOperations::ResizeMethod method,
int src_size, int dst_size,
int dest_subset_lo, int dest_subset_size,
ConvolutionFilter1D* output);
// Computes the filter value given the coordinate in filter space.
inline float ComputeFilter(ImageOperations::ResizeMethod method, float pos) {
switch (method) {
case ImageOperations::RESIZE_BOX:
return EvalBox(pos);
case ImageOperations::RESIZE_HAMMING1:
return EvalHamming(1, pos);
case ImageOperations::RESIZE_LANCZOS2:
return EvalLanczos(2, pos);
case ImageOperations::RESIZE_LANCZOS3:
return EvalLanczos(3, pos);
default:
return 0;
}
}
}
} // namespace skia
#endif // SKIA_EXT_IMAGE_OPERATIONS_H_

Просмотреть файл

@ -292,6 +292,10 @@ static EventRegions
GetEventRegions(const LayerMetricsWrapper& aLayer)
{
if (gfxPrefs::LayoutEventRegionsEnabled()) {
if (aLayer.IsScrollInfoLayer()) {
return EventRegions(nsIntRegion(ParentLayerIntRect::ToUntyped(
RoundedToInt(aLayer.Metrics().mCompositionBounds))));
}
return aLayer.GetEventRegions();
}
return EventRegions(aLayer.GetVisibleRegion());
@ -329,9 +333,6 @@ APZCTreeManager::PrepareNodeForLayer(const LayerMetricsWrapper& aLayer,
if (!aMetrics.IsScrollable()) {
needsApzc = false;
}
if (gfxPrefs::LayoutEventRegionsEnabled() && aLayer.IsScrollInfoLayer()) {
needsApzc = false;
}
const CompositorParent::LayerTreeState* state = CompositorParent::GetIndirectShadowTree(aLayersId);
if (!(state && state->mController.get())) {

Просмотреть файл

@ -43,7 +43,7 @@ class TextureClientX11 : public TextureClient
virtual gfx::DrawTarget* BorrowDrawTarget() MOZ_OVERRIDE;
virtual gfx::SurfaceFormat GetFormat() const { return mFormat; }
virtual gfx::SurfaceFormat GetFormat() const MOZ_OVERRIDE { return mFormat; }
virtual bool HasInternalBuffer() const MOZ_OVERRIDE { return false; }

Просмотреть файл

@ -33,7 +33,7 @@ public:
virtual void DeallocateDeviceData() MOZ_OVERRIDE { }
virtual void SetCompositor(Compositor* aCompositor);
virtual void SetCompositor(Compositor* aCompositor) MOZ_OVERRIDE;
static gfx::SurfaceFormat ContentTypeToSurfaceFormat(gfxContentType aType);

Просмотреть файл

@ -41,7 +41,7 @@ public:
}
#ifdef MOZ_LAYERS_HAVE_LOG
virtual const char* Name() { return "X11TextureHost"; }
virtual const char* Name() MOZ_OVERRIDE { return "X11TextureHost"; }
#endif
protected:

Просмотреть файл

@ -96,6 +96,7 @@ CompositorChild::Create(Transport* aTransport, ProcessId aOtherProcess)
sCompositor->SendGetTileSize(&width, &height);
gfxPlatform::GetPlatform()->SetTileSize(width, height);
// We release this ref in ActorDestroy().
return sCompositor;
}
@ -180,13 +181,14 @@ CompositorChild::ActorDestroy(ActorDestroyReason aWhy)
NS_RUNTIMEABORT("ActorDestroy by IPC channel failure at CompositorChild");
}
#endif
if (sCompositor) {
sCompositor->Release();
sCompositor = nullptr;
}
// We don't want to release the ref to sCompositor here, during
// cleanup, because that will cause it to be deleted while it's
// still being used. So defer the deletion to after it's not in
// use.
sCompositor = nullptr;
MessageLoop::current()->PostTask(
FROM_HERE,
NewRunnableMethod(this, &CompositorChild::Release));

Просмотреть файл

@ -33,11 +33,11 @@ public:
NS_DECL_ISUPPORTS_INHERITED
NS_IMETHOD GetClientBounds(nsIntRect &aRect) {
NS_IMETHOD GetClientBounds(nsIntRect &aRect) MOZ_OVERRIDE {
aRect = nsIntRect(0, 0, gCompWidth, gCompHeight);
return NS_OK;
}
NS_IMETHOD GetBounds(nsIntRect &aRect) { return GetClientBounds(aRect); }
NS_IMETHOD GetBounds(nsIntRect &aRect) MOZ_OVERRIDE { return GetClientBounds(aRect); }
void* GetNativeData(uint32_t aDataType) MOZ_OVERRIDE {
if (aDataType == NS_NATIVE_OPENGL_CONTEXT) {
@ -55,30 +55,30 @@ public:
nsNativeWidget aNativeParent,
const nsIntRect &aRect,
nsDeviceContext *aContext,
nsWidgetInitData *aInitData = nullptr) { return NS_OK; }
NS_IMETHOD Show(bool aState) { return NS_OK; }
virtual bool IsVisible() const { return true; }
nsWidgetInitData *aInitData = nullptr) MOZ_OVERRIDE { return NS_OK; }
NS_IMETHOD Show(bool aState) MOZ_OVERRIDE { return NS_OK; }
virtual bool IsVisible() const MOZ_OVERRIDE { return true; }
NS_IMETHOD ConstrainPosition(bool aAllowSlop,
int32_t *aX, int32_t *aY) { return NS_OK; }
NS_IMETHOD Move(double aX, double aY) { return NS_OK; }
NS_IMETHOD Resize(double aWidth, double aHeight, bool aRepaint) { return NS_OK; }
int32_t *aX, int32_t *aY) MOZ_OVERRIDE { return NS_OK; }
NS_IMETHOD Move(double aX, double aY) MOZ_OVERRIDE { return NS_OK; }
NS_IMETHOD Resize(double aWidth, double aHeight, bool aRepaint) MOZ_OVERRIDE { return NS_OK; }
NS_IMETHOD Resize(double aX, double aY,
double aWidth, double aHeight, bool aRepaint) { return NS_OK; }
double aWidth, double aHeight, bool aRepaint) MOZ_OVERRIDE { return NS_OK; }
NS_IMETHOD Enable(bool aState) { return NS_OK; }
virtual bool IsEnabled() const { return true; }
NS_IMETHOD SetFocus(bool aRaise) { return NS_OK; }
virtual nsresult ConfigureChildren(const nsTArray<Configuration>& aConfigurations) { return NS_OK; }
NS_IMETHOD Invalidate(const nsIntRect &aRect) { return NS_OK; }
NS_IMETHOD SetTitle(const nsAString& title) { return NS_OK; }
virtual nsIntPoint WidgetToScreenOffset() { return nsIntPoint(0, 0); }
NS_IMETHOD Enable(bool aState) MOZ_OVERRIDE { return NS_OK; }
virtual bool IsEnabled() const MOZ_OVERRIDE { return true; }
NS_IMETHOD SetFocus(bool aRaise) MOZ_OVERRIDE { return NS_OK; }
virtual nsresult ConfigureChildren(const nsTArray<Configuration>& aConfigurations) MOZ_OVERRIDE { return NS_OK; }
NS_IMETHOD Invalidate(const nsIntRect &aRect) MOZ_OVERRIDE { return NS_OK; }
NS_IMETHOD SetTitle(const nsAString& title) MOZ_OVERRIDE { return NS_OK; }
virtual nsIntPoint WidgetToScreenOffset() MOZ_OVERRIDE { return nsIntPoint(0, 0); }
NS_IMETHOD DispatchEvent(mozilla::WidgetGUIEvent* aEvent,
nsEventStatus& aStatus) { return NS_OK; }
NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener, bool aDoCapture) { return NS_OK; }
nsEventStatus& aStatus) MOZ_OVERRIDE { return NS_OK; }
NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener, bool aDoCapture) MOZ_OVERRIDE { return NS_OK; }
NS_IMETHOD_(void) SetInputContext(const InputContext& aContext,
const InputContextAction& aAction) {}
NS_IMETHOD_(InputContext) GetInputContext() { abort(); }
NS_IMETHOD ReparentNativeWidget(nsIWidget* aNewParent) { return NS_OK; }
const InputContextAction& aAction) MOZ_OVERRIDE {}
NS_IMETHOD_(InputContext) GetInputContext() MOZ_OVERRIDE { abort(); }
NS_IMETHOD ReparentNativeWidget(nsIWidget* aNewParent) MOZ_OVERRIDE { return NS_OK; }
private:
~MockWidget() {}
};

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше