Update On Thu Aug 4 20:37:53 CEST 2022

This commit is contained in:
github-action[bot] 2022-08-04 20:37:54 +02:00
parent e29cfd3005
commit 08fc92abc4
1603 changed files with 33067 additions and 15263 deletions

86
Cargo.lock generated
View file

@ -1549,6 +1549,18 @@ dependencies = [
"serde",
]
[[package]]
name = "extend"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c5216e387a76eebaaf11f6d871ec8a4aae0b25f05456ee21f228e024b1b3610"
dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "fallible-iterator"
version = "0.2.0"
@ -2164,6 +2176,11 @@ dependencies = [
"tokio-threadpool",
"unic-langid",
"unic-langid-ffi",
"uniffi-example-arithmetic",
"uniffi-example-geometry",
"uniffi-example-rondpoint",
"uniffi-example-sprites",
"uniffi-example-todolist",
"url",
"viaduct",
"webext_storage_bridge",
@ -5602,6 +5619,75 @@ dependencies = [
"log",
"paste",
"static_assertions",
"uniffi_bindgen",
]
[[package]]
name = "uniffi-bindgen-gecko-js"
version = "0.1.0"
dependencies = [
"anyhow",
"askama",
"camino",
"clap",
"extend",
"heck",
"serde",
"toml 0.5.9",
"uniffi_bindgen",
]
[[package]]
name = "uniffi-example-arithmetic"
version = "0.18.0"
source = "git+https://github.com/mozilla/uniffi-rs.git?rev=bb2039f077a29dba0879372a67e764e6ace8e33f#bb2039f077a29dba0879372a67e764e6ace8e33f"
dependencies = [
"thiserror",
"uniffi",
"uniffi_build",
"uniffi_macros",
]
[[package]]
name = "uniffi-example-geometry"
version = "0.18.0"
source = "git+https://github.com/mozilla/uniffi-rs.git?rev=bb2039f077a29dba0879372a67e764e6ace8e33f#bb2039f077a29dba0879372a67e764e6ace8e33f"
dependencies = [
"uniffi",
"uniffi_build",
"uniffi_macros",
]
[[package]]
name = "uniffi-example-rondpoint"
version = "0.18.0"
source = "git+https://github.com/mozilla/uniffi-rs.git?rev=bb2039f077a29dba0879372a67e764e6ace8e33f#bb2039f077a29dba0879372a67e764e6ace8e33f"
dependencies = [
"uniffi",
"uniffi_build",
"uniffi_macros",
]
[[package]]
name = "uniffi-example-sprites"
version = "0.18.0"
source = "git+https://github.com/mozilla/uniffi-rs.git?rev=bb2039f077a29dba0879372a67e764e6ace8e33f#bb2039f077a29dba0879372a67e764e6ace8e33f"
dependencies = [
"uniffi",
"uniffi_build",
"uniffi_macros",
]
[[package]]
name = "uniffi-example-todolist"
version = "0.18.0"
source = "git+https://github.com/mozilla/uniffi-rs.git?rev=bb2039f077a29dba0879372a67e764e6ace8e33f#bb2039f077a29dba0879372a67e764e6ace8e33f"
dependencies = [
"lazy_static",
"thiserror",
"uniffi",
"uniffi_build",
"uniffi_macros",
]
[[package]]

View file

@ -11,6 +11,7 @@ members = [
"security/manager/ssl/ipcclientcerts",
"security/manager/ssl/osclientcerts",
"testing/geckodriver",
"toolkit/components/uniffi-bindgen-gecko-js",
"toolkit/crashreporter/rust_minidump_writer_linux",
"toolkit/crashreporter/mozwer-rust",
"toolkit/library/gtest/rust",
@ -164,3 +165,16 @@ path = "third_party/rust/mio-0.6.23"
# https://github.com/mozilla/neqo/pull/1350
[patch."https://github.com/mozilla/neqo"]
neqo-common = { path = "third_party/rust/neqo-common" }
# These are used to test UniFFI functionality. We haven't figured out how we
# want to publish these yet, so they are only accessible via git. This works
# okay, but it means that their dependencies on UniFFI crates will normally
# also be the git versions. Patch them to use the published versions to avoid
# duplicate crates.
[patch."https://github.com/mozilla/uniffi-rs.git"]
uniffi = "0.19"
uniffi_bindgen = "0.19"
uniffi_build = "0.19"
uniffi_macros = "0.19"
weedle2 = "3.0.0"

View file

@ -30,6 +30,7 @@
#include "mozilla/ArrayUtils.h"
#include "mozilla/Sprintf.h"
#include "mozilla/StaticPrefs_accessibility.h"
#include "nsComponentManagerUtils.h"
using namespace mozilla;
@ -806,7 +807,7 @@ AtkStateSet* refStateSetCB(AtkObject* aAtkObj) {
return state_set;
}
static void UpdateAtkRelation(RelationType aType, LocalAccessible* aAcc,
static void UpdateAtkRelation(RelationType aType, Accessible* aAcc,
AtkRelationType aAtkType,
AtkRelationSet* aAtkSet) {
if (aAtkType == ATK_RELATION_NULL) return;
@ -817,14 +818,14 @@ static void UpdateAtkRelation(RelationType aType, LocalAccessible* aAcc,
Relation rel(aAcc->RelationByType(aType));
nsTArray<AtkObject*> targets;
LocalAccessible* tempAcc = nullptr;
Accessible* tempAcc = nullptr;
while ((tempAcc = rel.Next())) {
targets.AppendElement(AccessibleWrap::GetAtkObject(tempAcc));
targets.AppendElement(GetWrapperFor(tempAcc));
}
if (aType == RelationType::EMBEDS && aAcc->IsRoot()) {
if (RemoteAccessible* proxyDoc =
aAcc->AsRoot()->GetPrimaryRemoteTopLevelContentDoc()) {
aAcc->AsLocal()->AsRoot()->GetPrimaryRemoteTopLevelContentDoc()) {
targets.AppendElement(GetWrapperFor(proxyDoc));
}
}
@ -841,13 +842,15 @@ AtkRelationSet* refRelationSetCB(AtkObject* aAtkObj) {
AtkRelationSet* relation_set =
ATK_OBJECT_CLASS(parent_class)->ref_relation_set(aAtkObj);
const AtkRelationType typeMap[] = {
Accessible* acc = GetInternalObj(aAtkObj);
if (!StaticPrefs::accessibility_cache_enabled_AtStartup() &&
acc->IsRemote()) {
RemoteAccessible* proxy = acc->AsRemote();
const AtkRelationType typeMap[] = {
#define RELATIONTYPE(gecko, s, atk, m, i) atk,
#include "RelationTypeMap.h"
#undef RELATIONTYPE
};
if (RemoteAccessible* proxy = GetProxy(aAtkObj)) {
};
nsTArray<RelationType> types;
nsTArray<nsTArray<RemoteAccessible*>> targetSets;
proxy->Relations(&types, &targetSets);
@ -874,13 +877,11 @@ AtkRelationSet* refRelationSetCB(AtkObject* aAtkObj) {
atk_relation_set_add(relation_set, atkRelation);
g_object_unref(atkRelation);
}
return relation_set;
}
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
if (!accWrap) return relation_set;
#define RELATIONTYPE(geckoType, geckoTypeName, atkType, msaaType, ia2Type) \
UpdateAtkRelation(RelationType::geckoType, accWrap, atkType, relation_set);
UpdateAtkRelation(RelationType::geckoType, acc, atkType, relation_set);
#include "RelationTypeMap.h"

View file

@ -8,8 +8,10 @@
#include "DocAccessible-inl.h"
#include "XULTreeAccessible.h"
#include "mozilla/a11y/DocAccessibleParent.h"
#include "mozilla/dom/DocumentOrShadowRoot.h"
#include "mozilla/dom/HTMLLabelElement.h"
#include "mozilla/StaticPrefs_accessibility.h"
using namespace mozilla;
using namespace mozilla::a11y;
@ -342,3 +344,24 @@ LocalAccessible* XULTreeItemIterator::Next() {
return nullptr;
}
////////////////////////////////////////////////////////////////////////////////
// RemoteAccIterator
////////////////////////////////////////////////////////////////////////////////
RemoteAccIterator::RemoteAccIterator(nsTArray<uint64_t>&& aIds,
DocAccessibleParent* aDoc)
: mOwnedIds(std::move(aIds)), mIds(mOwnedIds), mDoc(aDoc), mIndex(0) {
MOZ_ASSERT(!StaticPrefs::accessibility_cache_enabled_AtStartup());
}
Accessible* RemoteAccIterator::Next() {
while (mIndex < mIds.Length()) {
uint64_t id = mIds[mIndex++];
Accessible* acc = mDoc->GetAccessible(id);
if (acc) {
return acc;
}
}
return nullptr;
}

View file

@ -9,6 +9,7 @@
#include "DocAccessible.h"
#include "Filters.h"
#include "nsTArray.h"
#include <memory>
@ -16,6 +17,7 @@ class nsITreeView;
namespace mozilla {
namespace a11y {
class DocAccessibleParent;
/**
* AccIterable is a basic interface for iterators over accessibles.
@ -298,6 +300,38 @@ class XULTreeItemIterator : public AccIterable {
int32_t mCurrRowIdx;
};
/**
* Used to iterate through a sequence of RemoteAccessibles supplied as an array
* of ids. Such id arrays are included in the RemoteAccessible cache.
*/
class RemoteAccIterator : public AccIterable {
public:
/**
* Construct with a reference to an array owned somewhere else; e.g. a
* RemoteAccessible cache.
*/
RemoteAccIterator(const nsTArray<uint64_t>& aIds, DocAccessibleParent* aDoc)
: mIds(aIds), mDoc(aDoc), mIndex(0) {}
/**
* Construct with an array moved from somewhere else. In this case, this
* RemoteAccIterator takes ownership of the array. This should be used, for
* example, when using sync IPC to retrieve relations.
*/
RemoteAccIterator(nsTArray<uint64_t>&& aIds, DocAccessibleParent* aDoc);
virtual ~RemoteAccIterator() = default;
virtual Accessible* Next() override;
private:
// Used when ownership of the array is transferred to this instance.
nsTArray<uint64_t> mOwnedIds;
const nsTArray<uint64_t>& mIds;
DocAccessibleParent* mDoc;
uint32_t mIndex;
};
} // namespace a11y
} // namespace mozilla

View file

@ -46,31 +46,6 @@ class TablePartRule : public PivotRule {
}
};
// Iterates through headers explicitly associated with a remote table cell via
// the headers DOM attribute. These are cached as Accessible ids.
class RemoteExplicitHeadersIterator : public AccIterable {
public:
RemoteExplicitHeadersIterator(const nsTArray<uint64_t>& aHeaders,
Accessible* aDoc)
: mHeaders(aHeaders), mDoc(aDoc), mIndex(0) {}
virtual Accessible* Next() override {
while (mIndex < mHeaders.Length()) {
uint64_t id = mHeaders[mIndex++];
Accessible* acc = nsAccUtils::GetAccessibleByID(mDoc, id);
if (acc) {
return acc;
}
}
return nullptr;
}
private:
const nsTArray<uint64_t>& mHeaders;
Accessible* mDoc;
uint32_t mIndex;
};
// The Accessible* keys should only be used for lookup. They should not be
// dereferenced.
using CachedTablesMap = nsTHashMap<Accessible*, CachedTableAccessible>;
@ -382,8 +357,7 @@ UniquePtr<AccIterable> CachedTableCellAccessible::GetExplicitHeadersIterator() {
if (auto headers =
remoteAcc->mCachedFields->GetAttribute<nsTArray<uint64_t>>(
nsGkAtoms::headers)) {
return MakeUnique<RemoteExplicitHeadersIterator>(*headers,
remoteAcc->Document());
return MakeUnique<RemoteAccIterator>(*headers, remoteAcc->Document());
}
}
} else if (LocalAccessible* localAcc = mAcc->AsLocal()) {

View file

@ -87,7 +87,7 @@ bool EventQueue::PushNameOrDescriptionChange(LocalAccessible* aTarget) {
}
Relation rel = parent->RelationByType(RelationType::LABEL_FOR);
while (LocalAccessible* relTarget = rel.Next()) {
while (LocalAccessible* relTarget = rel.LocalNext()) {
RefPtr<AccEvent> nameChangeEvent =
new AccEvent(nsIAccessibleEvent::EVENT_NAME_CHANGE, relTarget);
pushed |= PushEvent(nameChangeEvent);
@ -96,7 +96,7 @@ bool EventQueue::PushNameOrDescriptionChange(LocalAccessible* aTarget) {
if (doDesc) {
Relation rel = parent->RelationByType(RelationType::DESCRIPTION_FOR);
while (LocalAccessible* relTarget = rel.Next()) {
while (LocalAccessible* relTarget = rel.LocalNext()) {
RefPtr<AccEvent> descChangeEvent = new AccEvent(
nsIAccessibleEvent::EVENT_DESCRIPTION_CHANGE, relTarget);
pushed |= PushEvent(descChangeEvent);

View file

@ -74,7 +74,7 @@ class Relation {
/**
* compute and return the next related accessible.
*/
inline LocalAccessible* Next() {
inline Accessible* Next() {
Accessible* target = nullptr;
while (mFirstIter && !(target = mFirstIter->Next())) {
@ -83,7 +83,12 @@ class Relation {
if (!mFirstIter) mLastIter = nullptr;
return target ? target->AsLocal() : nullptr;
return target;
}
inline LocalAccessible* LocalNext() {
Accessible* next = Next();
return next ? next->AsLocal() : nullptr;
}
private:

View file

@ -23,6 +23,8 @@ class AccAttributes;
class AccGroupInfo;
class HyperTextAccessibleBase;
class LocalAccessible;
class Relation;
enum class RelationType;
class RemoteAccessible;
class TableAccessibleBase;
class TableCellAccessibleBase;
@ -327,6 +329,11 @@ class Accessible {
virtual Maybe<int32_t> GetIntARIAAttr(nsAtom* aAttrName) const = 0;
/**
* Get the relation of the given type.
*/
virtual Relation RelationByType(RelationType aType) const = 0;
// Methods that interact with content.
virtual void TakeFocus() const = 0;

View file

@ -1480,7 +1480,7 @@ uint64_t LocalAccessible::State() {
// If focus is in a child of the tab panel surely the tab is selected!
Relation rel = RelationByType(RelationType::LABEL_FOR);
LocalAccessible* relTarget = nullptr;
while ((relTarget = rel.Next())) {
while ((relTarget = rel.LocalNext())) {
if (relTarget->Role() == roles::PROPERTYPAGE &&
FocusMgr()->IsFocusWithin(relTarget)) {
state |= states::SELECTED;
@ -1766,7 +1766,7 @@ role LocalAccessible::ARIATransformRole(role aRole) const {
// Listbox is owned by a combobox
Relation rel = RelationByType(RelationType::NODE_CHILD_OF);
LocalAccessible* targetAcc = nullptr;
while ((targetAcc = rel.Next())) {
while ((targetAcc = rel.LocalNext())) {
if (targetAcc->IsCombobox()) return roles::COMBOBOX_LIST;
}
}
@ -2470,14 +2470,14 @@ void LocalAccessible::BindToParent(LocalAccessible* aParent,
// a name/description provider is added to doc.
Relation rel = RelationByType(RelationType::LABELLED_BY);
LocalAccessible* relTarget = nullptr;
while ((relTarget = rel.Next())) {
while ((relTarget = rel.LocalNext())) {
if (!relTarget->HasNameDependent()) {
relTarget->ModifySubtreeContextFlags(eHasNameDependent, true);
}
}
rel = RelationByType(RelationType::DESCRIBED_BY);
while ((relTarget = rel.Next())) {
while ((relTarget = rel.LocalNext())) {
if (!relTarget->HasDescriptionDependent()) {
relTarget->ModifySubtreeContextFlags(eHasDescriptionDependent, true);
}
@ -3591,7 +3591,7 @@ already_AddRefed<AccAttributes> LocalAccessible::BundleFieldsForCache(
rel.AppendIter(new IDRefsIterator(mDoc, mContent, relAtom));
}
while (LocalAccessible* acc = rel.Next()) {
while (LocalAccessible* acc = rel.LocalNext()) {
ids.AppendElement(acc->IsDoc() ? 0 : acc->ID());
}
if (ids.Length()) {

View file

@ -260,10 +260,7 @@ class LocalAccessible : public nsISupports, public Accessible {
*/
virtual LocalAccessible* FocusedChild();
/**
* Get the relation of the given type.
*/
virtual Relation RelationByType(RelationType aType) const;
virtual Relation RelationByType(RelationType aType) const override;
//////////////////////////////////////////////////////////////////////////////
// Initializing methods

View file

@ -24,6 +24,7 @@
#include "nsAccUtils.h"
#include "nsTextEquivUtils.h"
#include "Pivot.h"
#include "Relation.h"
#include "RelationType.h"
#include "xpcAccessibleDocument.h"
@ -627,12 +628,11 @@ LayoutDeviceIntRect RemoteAccessibleBase<Derived>::Bounds() const {
}
template <class Derived>
nsTArray<RemoteAccessible*> RemoteAccessibleBase<Derived>::RelationByType(
Relation RemoteAccessibleBase<Derived>::RelationByType(
RelationType aType) const {
nsTArray<RemoteAccessible*> accs;
Relation rel;
if (!mCachedFields) {
return accs;
return rel;
}
for (auto data : kRelationTypeAtoms) {
@ -643,11 +643,7 @@ nsTArray<RemoteAccessible*> RemoteAccessibleBase<Derived>::RelationByType(
if (auto maybeIds =
mCachedFields->GetAttribute<nsTArray<uint64_t>>(data.mAtom)) {
for (uint64_t id : *maybeIds) {
if (RemoteAccessible* acc = mDoc->GetAccessible(id)) {
accs.AppendElement(acc);
}
}
rel.AppendIter(new RemoteAccIterator(*maybeIds, Document()));
}
// Each relation type has only one relevant cached attribute,
// so break after we've handled the attr for this type,
@ -658,16 +654,11 @@ nsTArray<RemoteAccessible*> RemoteAccessibleBase<Derived>::RelationByType(
if (auto accRelMapEntry = mDoc->mReverseRelations.Lookup(ID())) {
if (auto reverseIdsEntry =
accRelMapEntry.Data().Lookup(static_cast<uint64_t>(aType))) {
nsTArray<uint64_t>& reverseIds = reverseIdsEntry.Data();
for (uint64_t id : reverseIds) {
if (RemoteAccessible* acc = mDoc->GetAccessible(id)) {
accs.AppendElement(acc);
}
}
rel.AppendIter(new RemoteAccIterator(reverseIdsEntry.Data(), Document()));
}
}
return accs;
return rel;
}
template <class Derived>

View file

@ -183,7 +183,7 @@ class RemoteAccessibleBase : public Accessible, public HyperTextAccessibleBase {
virtual nsRect BoundsInAppUnits() const override;
virtual nsTArray<RemoteAccessible*> RelationByType(RelationType aType) const;
virtual Relation RelationByType(RelationType aType) const override;
virtual uint64_t State() override;

View file

@ -48,11 +48,7 @@ void Description(nsString& aDesc) const override;
*/
virtual already_AddRefed<AccAttributes> Attributes() override;
/**
* Return set of targets of given relation type.
*/
virtual nsTArray<RemoteAccessible*> RelationByType(
RelationType aType) const override;
virtual Relation RelationByType(RelationType aType) const override;
bool IsSearchbox() const;

View file

@ -146,7 +146,7 @@ mozilla::ipc::IPCResult DocAccessibleChild::RecvRelationByType(
auto type = static_cast<RelationType>(aType);
Relation rel = acc->RelationByType(type);
while (LocalAccessible* target = rel.Next()) {
while (LocalAccessible* target = rel.LocalNext()) {
aTargets->AppendElement(reinterpret_cast<uint64_t>(target->UniqueID()));
}
@ -157,7 +157,7 @@ static void AddRelation(LocalAccessible* aAcc, RelationType aType,
nsTArray<RelationTargets>* aTargets) {
Relation rel = aAcc->RelationByType(aType);
nsTArray<uint64_t> targets;
while (LocalAccessible* target = rel.Next()) {
while (LocalAccessible* target = rel.LocalNext()) {
targets.AppendElement(reinterpret_cast<uint64_t>(target->UniqueID()));
}

View file

@ -13,6 +13,7 @@
#include "mozilla/dom/BrowserParent.h"
#include "mozilla/Unused.h"
#include "mozilla/a11y/Platform.h"
#include "Relation.h"
#include "RelationType.h"
#include "mozilla/a11y/Role.h"
#include "mozilla/StaticPrefs_accessibility.h"
@ -76,8 +77,7 @@ already_AddRefed<AccAttributes> RemoteAccessible::Attributes() {
return attrs.forget();
}
nsTArray<RemoteAccessible*> RemoteAccessible::RelationByType(
RelationType aType) const {
Relation RemoteAccessible::RelationByType(RelationType aType) const {
if (StaticPrefs::accessibility_cache_enabled_AtStartup()) {
return RemoteAccessibleBase<RemoteAccessible>::RelationByType(aType);
}
@ -85,16 +85,7 @@ nsTArray<RemoteAccessible*> RemoteAccessible::RelationByType(
nsTArray<uint64_t> targetIDs;
Unused << mDoc->SendRelationByType(mID, static_cast<uint32_t>(aType),
&targetIDs);
size_t targetCount = targetIDs.Length();
nsTArray<RemoteAccessible*> targets(targetCount);
for (size_t i = 0; i < targetCount; i++) {
if (RemoteAccessible* proxy = mDoc->GetAccessible(targetIDs[i])) {
targets.AppendElement(proxy);
}
}
return targets;
return Relation(new RemoteAccIterator(std::move(targetIDs), Document()));
}
void RemoteAccessible::Relations(

View file

@ -16,6 +16,7 @@
#include "mozilla/dom/BrowserParent.h"
#include "mozilla/Unused.h"
#include "mozilla/a11y/Platform.h"
#include "Relation.h"
#include "RelationType.h"
#include "mozilla/a11y/Role.h"
#include "mozilla/StaticPrefs_accessibility.h"
@ -108,20 +109,28 @@ static already_AddRefed<Interface> QueryInterface(
return acc2.forget();
}
static RemoteAccessible* GetProxyFor(DocAccessibleParent* aDoc,
IUnknown* aCOMProxy) {
static Maybe<uint64_t> GetIdFor(DocAccessibleParent* aDoc,
IUnknown* aCOMProxy) {
RefPtr<IGeckoCustom> custom;
if (FAILED(aCOMProxy->QueryInterface(IID_IGeckoCustom,
(void**)getter_AddRefs(custom)))) {
return nullptr;
return Nothing();
}
uint64_t id;
if (FAILED(custom->get_ID(&id))) {
return nullptr;
return Nothing();
}
return aDoc->GetAccessible(id);
return Some(id);
}
static RemoteAccessible* GetProxyFor(DocAccessibleParent* aDoc,
IUnknown* aCOMProxy) {
if (auto id = GetIdFor(aDoc, aCOMProxy)) {
return aDoc->GetAccessible(*id);
}
return nullptr;
}
ENameValueFlag RemoteAccessible::Name(nsString& aName) const {
@ -390,15 +399,14 @@ already_AddRefed<AccAttributes> RemoteAccessible::Attributes() {
return attrsObj.forget();
}
nsTArray<RemoteAccessible*> RemoteAccessible::RelationByType(
RelationType aType) const {
Relation RemoteAccessible::RelationByType(RelationType aType) const {
if (StaticPrefs::accessibility_cache_enabled_AtStartup()) {
return RemoteAccessibleBase<RemoteAccessible>::RelationByType(aType);
}
RefPtr<IAccessible2_2> acc = QueryInterface<IAccessible2_2>(this);
if (!acc) {
return nsTArray<RemoteAccessible*>();
return Relation();
}
_bstr_t relationType;
@ -410,7 +418,7 @@ nsTArray<RemoteAccessible*> RemoteAccessible::RelationByType(
}
if (!relationType) {
return nsTArray<RemoteAccessible*>();
return Relation();
}
IUnknown** targets;
@ -418,18 +426,20 @@ nsTArray<RemoteAccessible*> RemoteAccessible::RelationByType(
HRESULT hr =
acc->get_relationTargetsOfType(relationType, 0, &targets, &nTargets);
if (FAILED(hr)) {
return nsTArray<RemoteAccessible*>();
return Relation();
}
nsTArray<RemoteAccessible*> proxies;
nsTArray<uint64_t> ids;
for (long idx = 0; idx < nTargets; idx++) {
IUnknown* target = targets[idx];
proxies.AppendElement(GetProxyFor(Document(), target));
if (auto id = GetIdFor(Document(), target)) {
ids.AppendElement(*id);
}
target->Release();
}
CoTaskMemFree(targets);
return proxies;
return Relation(new RemoteAccIterator(std::move(ids), Document()));
}
double RemoteAccessible::CurValue() const {

View file

@ -991,22 +991,16 @@ struct RoleDescrComparator {
}
- (NSArray<mozAccessible*>*)getRelationsByType:(RelationType)relationType {
if (LocalAccessible* acc = mGeckoAccessible->AsLocal()) {
NSMutableArray<mozAccessible*>* relations =
[[[NSMutableArray alloc] init] autorelease];
Relation rel = acc->RelationByType(relationType);
while (LocalAccessible* relAcc = rel.Next()) {
if (mozAccessible* relNative = GetNativeFromGeckoAccessible(relAcc)) {
[relations addObject:relNative];
}
NSMutableArray<mozAccessible*>* relations =
[[[NSMutableArray alloc] init] autorelease];
Relation rel = mGeckoAccessible->RelationByType(relationType);
while (Accessible* relAcc = rel.Next()) {
if (mozAccessible* relNative = GetNativeFromGeckoAccessible(relAcc)) {
[relations addObject:relNative];
}
return relations;
}
RemoteAccessible* proxy = mGeckoAccessible->AsRemote();
nsTArray<RemoteAccessible*> rel = proxy->RelationByType(relationType);
return utils::ConvertToNSArray(rel);
return relations;
}
- (void)handleAccessibleTextChangeEvent:(NSString*)change

View file

@ -1,7 +0,0 @@
"use strict";
module.exports = {
"extends": [
"plugin:mozilla/mochitest-test"
],
};

View file

@ -74,12 +74,9 @@ ia2Accessible::get_nRelations(long* aNRelations) {
if (!aNRelations) return E_INVALIDARG;
*aNRelations = 0;
if (!Acc()) {
return CO_E_OBJNOTCONNECTED;
}
AccessibleWrap* acc = LocalAcc();
Accessible* acc = Acc();
if (!acc) {
return E_NOTIMPL; // XXX Not supported for RemoteAccessible yet.
return CO_E_OBJNOTCONNECTED;
}
for (uint32_t idx = 0; idx < ArrayLength(sRelationTypePairs); idx++) {
@ -97,12 +94,9 @@ ia2Accessible::get_relation(long aRelationIndex,
if (!aRelation || aRelationIndex < 0) return E_INVALIDARG;
*aRelation = nullptr;
if (!Acc()) {
return CO_E_OBJNOTCONNECTED;
}
AccessibleWrap* acc = LocalAcc();
Accessible* acc = Acc();
if (!acc) {
return E_NOTIMPL; // XXX Not supported for RemoteAccessible yet.
return CO_E_OBJNOTCONNECTED;
}
long relIdx = 0;
@ -135,12 +129,9 @@ ia2Accessible::get_relations(long aMaxRelations,
if (!aRelation || !aNRelations || aMaxRelations <= 0) return E_INVALIDARG;
*aNRelations = 0;
if (!Acc()) {
return CO_E_OBJNOTCONNECTED;
}
AccessibleWrap* acc = LocalAcc();
Accessible* acc = Acc();
if (!acc) {
return E_NOTIMPL; // XXX Not supported for RemoteAccessible yet.
return CO_E_OBJNOTCONNECTED;
}
for (uint32_t idx = 0;
@ -512,17 +503,14 @@ ia2Accessible::get_relationTargetsOfType(BSTR aType, long aMaxTargets,
}
if (!relationType) return E_INVALIDARG;
if (!Acc()) {
Accessible* acc = Acc();
if (!acc) {
return CO_E_OBJNOTCONNECTED;
}
AccessibleWrap* acc = LocalAcc();
if (!acc) {
return E_NOTIMPL; // XXX Not supported for RemoteAccessible yet.
}
nsTArray<LocalAccessible*> targets;
nsTArray<Accessible*> targets;
Relation rel = acc->RelationByType(*relationType);
LocalAccessible* target = nullptr;
Accessible* target = nullptr;
while (
(target = rel.Next()) &&
(aMaxTargets == 0 || static_cast<long>(targets.Length()) < aMaxTargets)) {
@ -535,8 +523,7 @@ ia2Accessible::get_relationTargetsOfType(BSTR aType, long aMaxTargets,
if (!*aTargets) return E_OUTOFMEMORY;
for (int32_t i = 0; i < *aNTargets; i++) {
RefPtr<IAccessible2> target;
targets[i]->GetNativeInterface(getter_AddRefs(target));
RefPtr<IAccessible2> target = MsaaAccessible::GetFrom(targets[i]);
target.forget(&(*aTargets)[i]);
}

View file

@ -16,8 +16,10 @@ using namespace mozilla::a11y;
ia2AccessibleRelation::ia2AccessibleRelation(RelationType aType, Relation* aRel)
: mType(aType) {
LocalAccessible* target = nullptr;
while ((target = aRel->Next())) mTargets.AppendElement(target);
Accessible* target = nullptr;
while ((target = aRel->Next())) {
mTargets.AppendElement(MsaaAccessible::GetFrom(target));
}
}
// IUnknown
@ -69,8 +71,7 @@ ia2AccessibleRelation::get_target(long aTargetIndex, IUnknown** aTarget) {
!aTarget)
return E_INVALIDARG;
RefPtr<IAccessible> target;
mTargets[aTargetIndex]->GetNativeInterface(getter_AddRefs(target));
RefPtr<IAccessible> target = mTargets[aTargetIndex];
target.forget(aTarget);
return S_OK;

View file

@ -8,7 +8,7 @@
#ifndef _NS_ACCESSIBLE_RELATION_WRAP_H
#define _NS_ACCESSIBLE_RELATION_WRAP_H
#include "LocalAccessible.h"
#include "MsaaAccessible.h"
#include "IUnknownImpl.h"
#include <utility>
@ -23,10 +23,6 @@ class ia2AccessibleRelation final : public IAccessibleRelation {
public:
ia2AccessibleRelation(RelationType aType, Relation* aRel);
ia2AccessibleRelation(RelationType aType,
nsTArray<RefPtr<LocalAccessible>>&& aTargets)
: mType(aType), mTargets(std::move(aTargets)) {}
// IUnknown
DECL_IUNKNOWN
@ -57,7 +53,7 @@ class ia2AccessibleRelation final : public IAccessibleRelation {
ia2AccessibleRelation& operator=(const ia2AccessibleRelation&);
RelationType mType;
nsTArray<RefPtr<LocalAccessible>> mTargets;
nsTArray<RefPtr<MsaaAccessible>> mTargets;
};
/**

View file

@ -1607,10 +1607,7 @@ MsaaAccessible::accNavigate(
pvarEndUpAt->vt = VT_EMPTY;
if (xpRelation) {
if (mAcc->IsRemote()) {
return E_NOTIMPL; // XXX Not supported for RemoteAccessible yet.
}
Relation rel = mAcc->AsLocal()->RelationByType(*xpRelation);
Relation rel = mAcc->RelationByType(*xpRelation);
navAccessible = rel.Next();
}

View file

@ -84,7 +84,7 @@ ServiceProvider::QueryService(REFGUID aGuidService, REFIID aIID,
}
Relation rel = localAcc->RelationByType(RelationType::CONTAINING_TAB_PANE);
AccessibleWrap* tabDoc = static_cast<AccessibleWrap*>(rel.Next());
AccessibleWrap* tabDoc = static_cast<AccessibleWrap*>(rel.LocalNext());
if (!tabDoc) return E_NOINTERFACE;
RefPtr<IAccessible> result;

View file

@ -17,22 +17,12 @@ using namespace mozilla::a11y;
nsAccessibleRelation::nsAccessibleRelation(uint32_t aType, Relation* aRel)
: mType(aType) {
mTargets = do_CreateInstance(NS_ARRAY_CONTRACTID);
LocalAccessible* targetAcc = nullptr;
Accessible* targetAcc = nullptr;
while ((targetAcc = aRel->Next())) {
mTargets->AppendElement(static_cast<nsIAccessible*>(ToXPC(targetAcc)));
}
}
nsAccessibleRelation::nsAccessibleRelation(
uint32_t aType, const nsTArray<RemoteAccessible*>* aTargets)
: mType(aType) {
mTargets = do_CreateInstance(NS_ARRAY_CONTRACTID);
for (uint32_t idx = 0; idx < aTargets->Length(); ++idx) {
mTargets->AppendElement(
static_cast<nsIAccessible*>(ToXPC(aTargets->ElementAt(idx))));
}
}
nsAccessibleRelation::~nsAccessibleRelation() {}
// nsISupports

View file

@ -26,9 +26,6 @@ class nsAccessibleRelation final : public nsIAccessibleRelation {
public:
nsAccessibleRelation(uint32_t aType, Relation* aRel);
nsAccessibleRelation(uint32_t aType,
const nsTArray<RemoteAccessible*>* aTargets);
NS_DECL_ISUPPORTS
NS_DECL_NSIACCESSIBLERELATION

View file

@ -491,17 +491,9 @@ xpcAccessible::GetRelationByType(uint32_t aType,
if (!IntlGeneric()) return NS_ERROR_FAILURE;
if (IntlGeneric()->IsLocal()) {
Relation rel = Intl()->RelationByType(static_cast<RelationType>(aType));
NS_ADDREF(*aRelation = new nsAccessibleRelation(aType, &rel));
return NS_OK;
}
RemoteAccessible* proxy = IntlGeneric()->AsRemote();
nsTArray<RemoteAccessible*> targets =
proxy->RelationByType(static_cast<RelationType>(aType));
NS_ADDREF(*aRelation = new nsAccessibleRelation(aType, &targets));
Relation rel =
IntlGeneric()->RelationByType(static_cast<RelationType>(aType));
NS_ADDREF(*aRelation = new nsAccessibleRelation(aType, &rel));
return NS_OK;
}

View file

@ -220,7 +220,8 @@ role XULGroupboxAccessible::NativeRole() const { return roles::GROUPING; }
ENameValueFlag XULGroupboxAccessible::NativeName(nsString& aName) const {
// XXX: we use the first related accessible only.
LocalAccessible* label = RelationByType(RelationType::LABELLED_BY).Next();
LocalAccessible* label =
RelationByType(RelationType::LABELLED_BY).LocalNext();
if (label) return label->Name(aName);
return eNameOK;

View file

@ -75,6 +75,7 @@ if CONFIG["CC_TYPE"] == "clang-cl":
if CONFIG["OS_ARCH"] == "WINNT":
RCINCLUDE = "splash.rc"
DIRS += [
"pbproxy",
"winlauncher",
]
USE_LIBS += [

View file

@ -0,0 +1,2 @@
# To make sure this process doesn't show a taskbar icon
MOZ_WINCONSOLE = 0

View file

@ -0,0 +1,15 @@
======================
Private Browsing Proxy
======================
On Windows, Firefox ships with a small binary that always launches
``firefox.exe`` in Private Browsing mode (``private_browsing.exe``). Its sole
purpose for existing is to allow Private Browsing shortcuts to have their own
Visual Elements. This is most notably seen when pinning a Private Browsing
shortcut to the Start Menu -- Visual Elements are used for the icon there
rather than the shortcut's icon.
In addition to always passing ``-private-window``, ``private_browsing.exe``
will forward any other command line arguments given to it to ``firefox.exe``.
It will also forward shortcut information from the Windows ``STARTUPINFOW``
structure to ensure that Firefox knows how it was started.

View file

@ -0,0 +1,29 @@
SPHINX_TREES["private-browsing-proxy"] = "docs"
SOURCES += ["pbproxy.cpp"]
# For nsNativeAppSupportWin.h icon definitions
LOCAL_INCLUDES += ["/toolkit/xre"]
if CONFIG["OS_TARGET"] == "WINNT" and CONFIG["CC_TYPE"] in ("gcc", "clang"):
# This allows us to use wmain as the entry point on mingw
LDFLAGS += [
"-municode",
]
RCINCLUDE = "pbproxy.rc"
DEFINES["UNICODE"] = 1
DEFINES["MOZ_APP_NAME"] = 'L"{}"'.format(CONFIG["MOZ_APP_NAME"])
Program("private_browsing")
OS_LIBS += ["shlwapi", "user32"]
DEFINES["PBMODE_ICO"] = '"{}/{}/pbmode.ico"'.format(
TOPSRCDIR,
CONFIG["MOZ_BRANDING_DIRECTORY"],
)
DisableStlWrapping()
with Files("**"):
BUG_COMPONENT = ("Firefox", "Shell Integration")

View file

@ -0,0 +1,94 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <windows.h>
#include <processthreadsapi.h>
#include <winbase.h>
#include <winuser.h>
#include <shlwapi.h>
#include <string>
// Max command line length, per CreateProcessW docs
#define MAX_CMD_LENGTH 32767
#define EXTRA_ERR_MSG_LENGTH 39
#define ERR_GET_OUR_PATH L"844fa30e-0860-11ed-898b-373276936058"
#define ERR_GET_APP_DIR L"811237de-0904-11ed-8745-c7c269742323"
#define ERR_GET_APP_EXE L"8964fd30-0860-11ed-8374-576505ba4488"
#define ERR_LAUNCHING_APP L"89d2ca2c-0860-11ed-883c-bf345b8391bc"
void raiseError(DWORD err, std::wstring uuid) {
LPWSTR winerr;
if (err && ::FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
nullptr, err, 0, (LPWSTR)&winerr, 0, nullptr)) {
std::wstring errmsg(winerr);
errmsg += L"\n\n" + uuid;
::MessageBoxW(nullptr, errmsg.c_str(), MOZ_APP_NAME " private_browsing.exe",
MB_OK | MB_ICONERROR | MB_SETFOREGROUND);
} else {
::MessageBoxW(nullptr, uuid.c_str(), MOZ_APP_NAME " private_browsing.exe",
MB_OK | MB_ICONERROR | MB_SETFOREGROUND);
}
}
/*
* A very simple wrapper that always launches Firefox in Private Browsing
* mode. Any arguments given to this program will be forwarded to Firefox,
* as well the information provided by GetStartupInfoW() (the latter is mainly
* done to ensure that Firefox's `launch_method` Telemetry works, which
* depends on shortcut information).
*
* Any errors that happen during this process will pop up a MessageBox
* with a Windows error (if present) and a unique UUID for debugability --
* but these are very unlikely to be seen in practice.
*/
int WINAPI wWinMain(HINSTANCE, HINSTANCE, LPWSTR aCmdLine, int) {
wchar_t app[MAX_PATH];
DWORD ret = GetModuleFileNameW(nullptr, app, MAX_PATH);
if (!ret ||
(ret == MAX_PATH && ::GetLastError() == ERROR_INSUFFICIENT_BUFFER)) {
ret = ::GetLastError();
raiseError(ret, ERR_GET_OUR_PATH);
return ret;
}
if (!PathRemoveFileSpecW(app)) {
raiseError(0, ERR_GET_APP_DIR);
return 1;
}
if (!PathAppendW(app, MOZ_APP_NAME L".exe")) {
raiseError(0, ERR_GET_APP_EXE);
return 1;
}
std::wstring cmdLine(L"\"");
cmdLine += app;
cmdLine += L"\" -private-window";
if (wcslen(aCmdLine) > 0) {
cmdLine += L" ";
cmdLine += aCmdLine;
}
DWORD creationFlags = CREATE_UNICODE_ENVIRONMENT;
// Mainly used to pass along shortcut information to ensure
// launch_method Telemetry will be accurate.
STARTUPINFOW startupInfo = {0};
startupInfo.cb = sizeof(STARTUPINFOW);
GetStartupInfoW(&startupInfo);
PROCESS_INFORMATION pi;
bool rv =
::CreateProcessW(app, cmdLine.data(), nullptr, nullptr, FALSE,
creationFlags, nullptr, nullptr, &startupInfo, &pi);
if (!rv) {
ret = ::GetLastError();
raiseError(ret, ERR_LAUNCHING_APP);
return ret;
}
::CloseHandle(pi.hProcess);
::CloseHandle(pi.hThread);
return 0;
}

View file

@ -1,19 +1,9 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
#include <windows.h>
#include "nsNativeAppSupportWin.h"
module.exports = {
extends: ["plugin:mozilla/browser-test"],
rules: {
"no-unused-vars": [
"error",
{
args: "none",
vars: "all",
},
],
},
};
IDI_APPICON ICON PBMODE_ICO

View file

@ -2288,13 +2288,8 @@ pref("devtools.toolbox.splitconsoleHeight", 100);
pref("devtools.toolbox.tabsOrder", "");
// The fission pref for enabling the "Multiprocess Browser Toolbox", which will
// make it possible to debug anything in Firefox (See Bug 1570639 for more
// information).
#if defined(NIGHTLY_BUILD)
// make it possible to debug anything in Firefox (See Bug 1570639 for more information).
pref("devtools.browsertoolbox.fission", true);
#else
pref("devtools.browsertoolbox.fission", false);
#endif
// When the Multiprocess Browser Toolbox is enabled, you can configure the scope of it:
// - "everything" will enable debugging absolutely everything in the browser
@ -2712,4 +2707,4 @@ pref("browser.places.snapshots.expiration.userManaged.days", 420);
// If the user has seen the Firefox View feature tour this value reflects the tour
// message id, the id of the last screen they saw, and whether they completed the tour
pref("browser.browser.firefoxView.featureTour", "default, default, true");
pref("browser.firefox-view.feature-tour", "{\"message\":\"\",\"screen\":\"\",\"complete\":true}");

View file

@ -9858,13 +9858,13 @@ var FirefoxViewHandler = {
return document.getElementById("firefox-view-button");
},
init() {
if (!AppConstants.NIGHTLY_BUILD) {
return;
}
const { FirefoxViewNotificationManager } = ChromeUtils.importESModule(
"resource:///modules/firefox-view-notification-manager.sys.mjs"
);
if (
AppConstants.NIGHTLY_BUILD &&
!Services.prefs.getBoolPref("browser.tabs.firefox-view")
) {
if (!Services.prefs.getBoolPref("browser.tabs.firefox-view")) {
document.getElementById("menu_openFirefoxView").hidden = true;
} else {
let shouldShow = FirefoxViewNotificationManager.shouldNotificationDotBeShowing();

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test", "plugin:mozilla/mochitest-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -215,6 +215,15 @@ const gSelects = {
</select></body></html>
`,
DEFAULT_DARKMODE_DARK: `
<meta name=color-scheme content=dark>
<select id='one'>
<option>{"color": "MenuText", "backgroundColor": "rgba(0, 0, 0, 0)"}</option>
<option>{"color": "MenuText", "backgroundColor": "rgba(0, 0, 0, 0)"}</option>
<option selected="true">{"end": "true"}</option>
</select>
`,
SPLIT_FG_BG_OPTION_DARKMODE: `
<html><head><style>
select { background-color: #fff; }
@ -382,11 +391,7 @@ async function testSelectColors(selectID, itemCount, options) {
}
if (!options.skipSelectColorTest.color) {
is(
rgbaToString(
InspectorUtils.colorToRGBA(
getComputedStyle(selectPopup).getPropertyValue("--panel-color")
)
),
getComputedStyle(arrowSB).color,
options.selectColor,
selectID + " popup has expected foreground color"
);
@ -789,6 +794,13 @@ add_task(async function test_scrollbar_props() {
if (AppConstants.isPlatformAndVersionAtLeast("win", "10")) {
add_task(async function test_darkmode() {
let lightSelectColor = rgbaToString(
InspectorUtils.colorToRGBA("MenuText", document)
);
let lightSelectBgColor = rgbaToString(
InspectorUtils.colorToRGBA("Menu", document)
);
// Force dark mode:
let darkModeQuery = matchMedia("(prefers-color-scheme: dark)");
let darkModeChange = BrowserTestUtils.waitForEvent(darkModeQuery, "change");
@ -796,20 +808,28 @@ if (AppConstants.isPlatformAndVersionAtLeast("win", "10")) {
await darkModeChange;
// Determine colours from the main context menu:
let cs = getComputedStyle(document.documentElement);
let selectColor = rgbaToString(
InspectorUtils.colorToRGBA(cs.getPropertyValue("--menu-color"))
let darkSelectColor = rgbaToString(
InspectorUtils.colorToRGBA("MenuText", document)
);
let selectBgColor = rgbaToString(
InspectorUtils.colorToRGBA(cs.getPropertyValue("--menu-background-color"))
let darkSelectBgColor = rgbaToString(
InspectorUtils.colorToRGBA("Menu", document)
);
// Check that by default, we use the dark mode styles:
isnot(lightSelectColor, darkSelectColor);
isnot(lightSelectBgColor, darkSelectBgColor);
let { tab } = await openSelectPopup(gSelects.DEFAULT_DARKMODE);
await testSelectColors("DEFAULT_DARKMODE", 3, {
selectColor,
selectBgColor,
selectColor: lightSelectColor,
selectBgColor: lightSelectBgColor,
});
await hideSelectPopup("escape");
await testSelectColors("DEFAULT_DARKMODE_DARK", 3, {
selectColor: darkSelectColor,
selectBgColor: darkSelectBgColor,
});
await hideSelectPopup("escape");

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test", "plugin:mozilla/mochitest-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test", "plugin:mozilla/mochitest-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -112,6 +112,18 @@ add_task(async function() {
) && // in the toolbar
inRange(r.x1, 11, 13), // very close to the left of the screen
},
{
name: "Initial favicon appearing after first paint",
condition: r => {
let faviconRect = win.gBrowser.tabs[0].iconImage.getBoundingClientRect();
return (
r.w == faviconRect.width &&
r.h == faviconRect.height &&
r.x1 == faviconRect.x &&
r.y1 == faviconRect.y
);
},
},
{
// Note that the length and x values here are a bit weird because on
// some fonts, we appear to detect the two words separately.

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,8 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
rules: {
"no-shadow": "off",
},
};

View file

@ -33,6 +33,7 @@ add_task(async function testDestroyAudibleIframe() {
});
function createIframeAndLoadURL(tab, url) {
// eslint-disable-next-line no-shadow
return SpecialPowers.spawn(tab.linkedBrowser, [url], async url => {
const iframe = content.document.createElement("iframe");
content.document.body.appendChild(iframe);

View file

@ -2,13 +2,13 @@ const PAGE = GetTestWebBasedURL("file_mediaPlayback.html");
const FRAME = GetTestWebBasedURL("file_mediaPlaybackFrame.html");
function wait_for_event(browser, event) {
return BrowserTestUtils.waitForEvent(browser, event, false, event => {
return BrowserTestUtils.waitForEvent(browser, event, false, e => {
is(
event.originalTarget,
e.originalTarget,
browser,
"Event must be dispatched to correct browser."
);
ok(!event.cancelable, "The event should not be cancelable");
ok(!e.cancelable, "The event should not be cancelable");
return true;
});
}

View file

@ -2,9 +2,9 @@ const PAGE = GetTestWebBasedURL("file_mediaPlayback2.html");
const FRAME = GetTestWebBasedURL("file_mediaPlaybackFrame2.html");
function wait_for_event(browser, event) {
return BrowserTestUtils.waitForEvent(browser, event, false, event => {
return BrowserTestUtils.waitForEvent(browser, event, false, e => {
is(
event.originalTarget,
e.originalTarget,
browser,
"Event must be dispatched to correct browser."
);

View file

@ -187,6 +187,7 @@ function initMediaPlaybackDocument(
return SpecialPowers.spawn(
tab.linkedBrowser,
[fileName, preload, createVideo, muted, volume],
// eslint-disable-next-line no-shadow
async (fileName, preload, createVideo, muted, volume) => {
if (createVideo) {
content.media = content.document.createElement("video");
@ -214,6 +215,7 @@ function playMedia(tab, { resolveOnTimeupdate } = {}) {
return SpecialPowers.spawn(
tab.linkedBrowser,
[resolveOnTimeupdate],
// eslint-disable-next-line no-shadow
async resolveOnTimeupdate => {
await content.media.play();
if (resolveOnTimeupdate) {
@ -230,6 +232,7 @@ function pauseMedia(tab) {
}
function assignNewSourceForAudio(tab, fileName) {
// eslint-disable-next-line no-shadow
return SpecialPowers.spawn(tab.linkedBrowser, [fileName], async fileName => {
content.media.src = "";
content.media.removeAttribute("src");
@ -241,6 +244,7 @@ function updateMedia(tab, { muted, volume } = {}) {
return SpecialPowers.spawn(
tab.linkedBrowser,
[muted, volume],
// eslint-disable-next-line no-shadow
(muted, volume) => {
if (muted != undefined) {
content.media.muted = muted;

View file

@ -108,6 +108,7 @@ add_task(async function testNoSoundIndicatorWhenSimplyCreateAudioContext() {
* Following are helper functions
*/
function initWebAudioDocument(tab, { duration } = {}) {
// eslint-disable-next-line no-shadow
return SpecialPowers.spawn(tab.linkedBrowser, [duration], async duration => {
content.ac = new content.AudioContext();
const ac = content.ac;

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -1,8 +1,6 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
env: {
webextensions: true,
},

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

View file

@ -50,5 +50,6 @@ add_task(async function test_bug_1669801() {
);
menupopup.hidePopup();
await popupHiddenPromise;
await closeStream();
});
});

View file

@ -1,5 +0,0 @@
"use strict";
module.exports = {
extends: ["plugin:mozilla/browser-test"],
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

View file

@ -0,0 +1,12 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. -->
<Application xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<VisualElements
ShowNameOnSquare150x150Logo='on'
Square150x150Logo='browser\VisualElements\PrivateBrowsing_150.png'
Square70x70Logo='browser\VisualElements\PrivateBrowsing_70.png'
ForegroundText='light'
BackgroundColor='#14171a'/>
</Application>

View file

@ -18,8 +18,11 @@ def FirefoxBranding():
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
FINAL_TARGET_FILES['..'] += [
'firefox.VisualElementsManifest.xml',
'private_browsing.VisualElementsManifest.xml',
]
FINAL_TARGET_FILES.VisualElements += [
'PrivateBrowsing_150.png',
'PrivateBrowsing_70.png',
'VisualElements_150.png',
'VisualElements_70.png',
]

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View file

@ -0,0 +1,12 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. -->
<Application xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<VisualElements
ShowNameOnSquare150x150Logo='on'
Square150x150Logo='browser\VisualElements\PrivateBrowsing_150.png'
Square70x70Logo='browser\VisualElements\PrivateBrowsing_70.png'
ForegroundText='light'
BackgroundColor='#14171a'/>
</Application>

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View file

@ -0,0 +1,12 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this file,
- You can obtain one at http://mozilla.org/MPL/2.0/. -->
<Application xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<VisualElements
ShowNameOnSquare150x150Logo='on'
Square150x150Logo='browser\VisualElements\PrivateBrowsing_150.png'
Square70x70Logo='browser\VisualElements\PrivateBrowsing_70.png'
ForegroundText='light'
BackgroundColor='#14171a'/>
</Application>

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

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