MozReview-Commit-ID: D5tvjU423oT
This commit is contained in:
Kartikaya Gupta 2016-12-16 10:23:35 -05:00
Родитель 2e2b55bde9 a244c7fb4a
Коммит 44e6529919
621 изменённых файлов: 22735 добавлений и 21785 удалений

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

@ -73,7 +73,34 @@ AccessibleNode::GetStates(nsTArray<nsString>& aStates)
return;
}
mStates->Add(NS_LITERAL_STRING("defunct"));
aStates.AppendElement(NS_LITERAL_STRING("defunct"));
}
bool
AccessibleNode::Is(const Sequence<nsString>& aFlavors)
{
if (!mIntl) {
for (const auto& flavor : aFlavors) {
if (!flavor.EqualsLiteral("unknown") && !flavor.EqualsLiteral("defunct")) {
return false;
}
}
return true;
}
nsAutoString role;
GetOrCreateAccService()->GetStringRole(mIntl->Role(), role);
if (!mStates) {
mStates = GetOrCreateAccService()->GetStringStates(mIntl->State());
}
for (const auto& flavor : aFlavors) {
if (!flavor.Equals(role) && !mStates->Contains(flavor)) {
return false;
}
}
return true;
}
nsINode*

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

@ -8,9 +8,7 @@
#define A11Y_AOM_ACCESSIBLENODE_H
#include "nsWrapperCache.h"
#include "mozilla/RefPtr.h"
#include "nsTArray.h"
#include "nsString.h"
#include "mozilla/dom/BindingDeclarations.h"
class nsINode;
@ -41,6 +39,8 @@ public:
void GetStates(nsTArray<nsString>& aStates);
nsINode* GetDOMNode();
bool Is(const Sequence<nsString>& aFlavors);
a11y::Accessible* Internal() const { return mIntl; }
protected:

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

@ -5,11 +5,11 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
EXPORTS.mozilla.dom += [
'AccessibleNode.h'
'AccessibleNode.h',
]
UNIFIED_SOURCES += [
'AccessibleNode.cpp'
'AccessibleNode.cpp',
]
LOCAL_INCLUDES += [

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

@ -533,19 +533,19 @@ DocManager::CreateDocOrRootAccessible(nsIDocument* aDocument)
DocAccessibleChild* ipcDoc = new DocAccessibleChild(docAcc);
docAcc->SetIPCDoc(ipcDoc);
#if defined(XP_WIN)
IAccessibleHolder holder(CreateHolderFromAccessible(docAcc));
#endif
static_cast<TabChild*>(tabChild.get())->
SendPDocAccessibleConstructor(ipcDoc, nullptr, 0,
#if defined(XP_WIN)
AccessibleWrap::GetChildIDFor(docAcc)
AccessibleWrap::GetChildIDFor(docAcc),
holder
#else
0
0, 0
#endif
);
#if defined(XP_WIN)
IAccessibleHolder holder(CreateHolderFromAccessible(docAcc));
ipcDoc->SendCOMProxy(holder);
#endif
}
}
}

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

@ -854,19 +854,20 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
ipcDoc = new DocAccessibleChild(childDoc);
childDoc->SetIPCDoc(ipcDoc);
#if defined(XP_WIN)
MOZ_ASSERT(parentIPCDoc);
parentIPCDoc->ConstructChildDocInParentProcess(ipcDoc, id,
AccessibleWrap::GetChildIDFor(childDoc));
#else
nsCOMPtr<nsITabChild> tabChild =
do_GetInterface(mDocument->DocumentNode()->GetDocShell());
if (tabChild) {
MOZ_ASSERT(parentIPCDoc);
static_cast<TabChild*>(tabChild.get())->
SendPDocAccessibleConstructor(ipcDoc, parentIPCDoc, id,
#if defined(XP_WIN)
AccessibleWrap::GetChildIDFor(childDoc)
#else
0
#endif
);
SendPDocAccessibleConstructor(ipcDoc, parentIPCDoc, id, 0, 0);
}
#endif
}
}

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

@ -89,7 +89,7 @@ DocAccessibleChildBase::ShowEvent(AccShowEvent* aShowEvent)
nsTArray<AccessibleData> shownTree;
ShowEventData data(parentID, idxInParent, shownTree);
SerializeTree(aShowEvent->GetAccessible(), data.NewTree());
SendShowEvent(data, aShowEvent->IsFromUserInput());
MaybeSendShowEvent(data, aShowEvent->IsFromUserInput());
}
} // namespace a11y

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

@ -9,6 +9,7 @@
#include "mozilla/a11y/DocAccessible.h"
#include "mozilla/a11y/PDocAccessibleChild.h"
#include "mozilla/Unused.h"
#include "nsISupportsImpl.h"
namespace mozilla {
@ -38,10 +39,9 @@ public:
MOZ_COUNT_DTOR(DocAccessibleChildBase);
}
void Shutdown()
virtual void Shutdown()
{
mDoc->SetIPCDoc(nullptr);
mDoc = nullptr;
DetachDocument();
SendShutdown();
}
@ -61,6 +61,17 @@ protected:
static uint32_t InterfacesFor(Accessible* aAcc);
static void SerializeTree(Accessible* aRoot, nsTArray<AccessibleData>& aTree);
virtual void MaybeSendShowEvent(ShowEventData& aData, bool aFromUser)
{ Unused << SendShowEvent(aData, aFromUser); }
void DetachDocument()
{
if (mDoc) {
mDoc->SetIPCDoc(nullptr);
mDoc = nullptr;
}
}
DocAccessible* mDoc;
};

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

@ -467,25 +467,31 @@ DocAccessibleParent::GetXPCAccessible(ProxyAccessible* aProxy)
#if defined(XP_WIN)
/**
* @param aCOMProxy COM Proxy to the document in the content process.
* @param aParentCOMProxy COM Proxy to the OuterDocAccessible that is
* the parent of the document. The content process will use this
* proxy when traversing up across the content/chrome boundary.
*/
mozilla::ipc::IPCResult
DocAccessibleParent::RecvCOMProxy(const IAccessibleHolder& aCOMProxy,
IAccessibleHolder* aParentCOMProxy)
void
DocAccessibleParent::SetCOMProxy(const RefPtr<IAccessible>& aCOMProxy)
{
RefPtr<IAccessible> ptr(aCOMProxy.Get());
SetCOMInterface(ptr);
SetCOMInterface(aCOMProxy);
// Make sure that we're not racing with a tab shutdown
auto tab = static_cast<dom::TabParent*>(Manager());
MOZ_ASSERT(tab);
if (tab->IsDestroyed()) {
return;
}
Accessible* outerDoc = OuterDocOfRemoteBrowser();
MOZ_ASSERT(outerDoc);
IAccessible* rawNative = nullptr;
if (outerDoc) {
outerDoc->GetNativeInterface((void**) &rawNative);
MOZ_ASSERT(rawNative);
}
aParentCOMProxy->Set(IAccessibleHolder::COMPtrType(rawNative));
return IPC_OK();
IAccessibleHolder::COMPtrType ptr(rawNative);
IAccessibleHolder holder(Move(ptr));
Unused << SendParentCOMProxy(holder);
}
mozilla::ipc::IPCResult

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

@ -111,7 +111,7 @@ public:
*/
void RemoveChildDoc(DocAccessibleParent* aChildDoc)
{
aChildDoc->Parent()->SetChildDoc(nullptr);
aChildDoc->Parent()->ClearChildDoc(aChildDoc);
mChildDocs.RemoveElement(aChildDoc);
aChildDoc->mParentDoc = nullptr;
MOZ_ASSERT(aChildDoc->mChildDocs.Length() == 0);
@ -143,8 +143,7 @@ public:
{ return mChildDocs[aIdx]; }
#if defined(XP_WIN)
virtual mozilla::ipc::IPCResult RecvCOMProxy(const IAccessibleHolder& aCOMProxy,
IAccessibleHolder* aParentCOMProxy) override;
void SetCOMProxy(const RefPtr<IAccessible>& aCOMProxy);
virtual mozilla::ipc::IPCResult RecvGetWindowedPluginIAccessible(
const WindowsHandle& aHwnd, IAccessibleHolder* aPluginCOMProxy) override;

49
accessible/ipc/IPCTypes.h Normal file
Просмотреть файл

@ -0,0 +1,49 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_a11y_IPCTypes_h
#define mozilla_a11y_IPCTypes_h
/**
* Since IPDL does not support preprocessing, this header file allows us to
* define types used by PDocAccessible differently depending on platform.
*/
#if defined(XP_WIN) && defined(ACCESSIBILITY)
// So that we don't include a bunch of other Windows junk.
#if !defined(COM_NO_WINDOWS_H)
#define COM_NO_WINDOWS_H
#endif // !defined(COM_NO_WINDOWS_H)
// COM headers pull in MSXML which conflicts with our own XMLDocument class.
// This define excludes those conflicting definitions.
#if !defined(__XMLDocument_FWD_DEFINED__)
#define __XMLDocument_FWD_DEFINED__
#endif // !defined(__XMLDocument_FWD_DEFINED__)
#include "mozilla/a11y/COMPtrTypes.h"
// This define in rpcndr.h messes up our code, so we must undefine it after
// COMPtrTypes.h has been included.
#if defined(small)
#undef small
#endif // defined(small)
#else
namespace mozilla {
namespace a11y {
typedef uint32_t IAccessibleHolder;
} // namespace a11y
} // namespace mozilla
#endif // defined(XP_WIN) && defined(ACCESSIBILITY)
#endif // mozilla_a11y_IPCTypes_h

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

@ -52,15 +52,31 @@ ProxyAccessibleBase<Derived>::Shutdown()
template <class Derived>
void
ProxyAccessibleBase<Derived>::SetChildDoc(DocAccessibleParent* aParent)
ProxyAccessibleBase<Derived>::SetChildDoc(DocAccessibleParent* aChildDoc)
{
if (aParent) {
MOZ_ASSERT(mChildren.IsEmpty());
mChildren.AppendElement(aParent);
mOuterDoc = true;
// DocAccessibleParent::AddChildDoc tolerates replacing one document with
// another. We must reflect that here.
MOZ_ASSERT(aChildDoc);
MOZ_ASSERT(mChildren.Length() <= 1);
if (mChildren.IsEmpty()) {
mChildren.AppendElement(aChildDoc);
} else {
MOZ_ASSERT(mChildren.Length() == 1);
mChildren.Clear();
mChildren.ReplaceElementAt(0, aChildDoc);
}
mOuterDoc = true;
}
template <class Derived>
void
ProxyAccessibleBase<Derived>::ClearChildDoc(DocAccessibleParent* aChildDoc)
{
MOZ_ASSERT(aChildDoc);
// This is possible if we're replacing one document with another: Doc 1
// has not had a chance to remove itself, but was already replaced by Doc 2
// in SetChildDoc(). This could result in two subsequent calls to
// ClearChildDoc() even though mChildren.Length() == 1.
MOZ_ASSERT(mChildren.Length() <= 1);
if (mChildren.RemoveElement(aChildDoc)) {
mOuterDoc = false;
}
}

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

@ -78,7 +78,8 @@ public:
void Shutdown();
void SetChildDoc(DocAccessibleParent*);
void SetChildDoc(DocAccessibleParent* aChildDoc);
void ClearChildDoc(DocAccessibleParent* aChildDoc);
/**
* Remove The given child.

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

@ -29,6 +29,10 @@ else:
'/accessible/other',
]
EXPORTS.mozilla.a11y += [
'IPCTypes.h',
]
if CONFIG['GNU_CXX']:
CXXFLAGS += ['-Wno-error=shadow']

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

@ -9,6 +9,7 @@
#include "Accessible-inl.h"
#include "mozilla/a11y/PlatformChild.h"
#include "mozilla/ClearOnShutdown.h"
#include "RootAccessible.h"
namespace mozilla {
namespace a11y {
@ -17,6 +18,7 @@ static StaticAutoPtr<PlatformChild> sPlatformChild;
DocAccessibleChild::DocAccessibleChild(DocAccessible* aDoc)
: DocAccessibleChildBase(aDoc)
, mIsRemoteConstructed(false)
{
MOZ_COUNT_CTOR_INHERITED(DocAccessibleChild, DocAccessibleChildBase);
if (!sPlatformChild) {
@ -31,11 +33,203 @@ DocAccessibleChild::~DocAccessibleChild()
}
void
DocAccessibleChild::SendCOMProxy(const IAccessibleHolder& aProxy)
DocAccessibleChild::Shutdown()
{
IAccessibleHolder parentProxy;
PDocAccessibleChild::SendCOMProxy(aProxy, &parentProxy);
mParentProxy.reset(parentProxy.Release());
if (IsConstructedInParentProcess()) {
DocAccessibleChildBase::Shutdown();
return;
}
PushDeferredEvent(MakeUnique<SerializedShutdown>(this));
DetachDocument();
}
ipc::IPCResult
DocAccessibleChild::RecvParentCOMProxy(const IAccessibleHolder& aParentCOMProxy)
{
MOZ_ASSERT(!mParentProxy && !aParentCOMProxy.IsNull());
mParentProxy.reset(const_cast<IAccessibleHolder&>(aParentCOMProxy).Release());
SetConstructedInParentProcess();
for (uint32_t i = 0, l = mDeferredEvents.Length(); i < l; ++i) {
mDeferredEvents[i]->Dispatch();
}
mDeferredEvents.Clear();
return IPC_OK();
}
void
DocAccessibleChild::PushDeferredEvent(UniquePtr<DeferredEvent> aEvent)
{
DocAccessibleChild* topLevelIPCDoc = nullptr;
if (mDoc && mDoc->IsRoot()) {
topLevelIPCDoc = this;
} else {
auto tabChild = static_cast<dom::TabChild*>(Manager());
if (!tabChild) {
return;
}
nsTArray<PDocAccessibleChild*> ipcDocAccs;
tabChild->ManagedPDocAccessibleChild(ipcDocAccs);
// Look for the top-level DocAccessibleChild - there will only be one
// per TabChild.
for (uint32_t i = 0, l = ipcDocAccs.Length(); i < l; ++i) {
auto ipcDocAcc = static_cast<DocAccessibleChild*>(ipcDocAccs[i]);
if (ipcDocAcc->mDoc && ipcDocAcc->mDoc->IsRoot()) {
topLevelIPCDoc = ipcDocAcc;
break;
}
}
}
if (topLevelIPCDoc) {
topLevelIPCDoc->mDeferredEvents.AppendElement(Move(aEvent));
}
}
bool
DocAccessibleChild::SendEvent(const uint64_t& aID, const uint32_t& aType)
{
if (IsConstructedInParentProcess()) {
return PDocAccessibleChild::SendEvent(aID, aType);
}
PushDeferredEvent(MakeUnique<SerializedEvent>(this, aID, aType));
return false;
}
void
DocAccessibleChild::MaybeSendShowEvent(ShowEventData& aData, bool aFromUser)
{
if (IsConstructedInParentProcess()) {
Unused << SendShowEvent(aData, aFromUser);
return;
}
PushDeferredEvent(MakeUnique<SerializedShow>(this, aData, aFromUser));
}
bool
DocAccessibleChild::SendHideEvent(const uint64_t& aRootID,
const bool& aFromUser)
{
if (IsConstructedInParentProcess()) {
return PDocAccessibleChild::SendHideEvent(aRootID, aFromUser);
}
PushDeferredEvent(MakeUnique<SerializedHide>(this, aRootID, aFromUser));
return true;
}
bool
DocAccessibleChild::SendStateChangeEvent(const uint64_t& aID,
const uint64_t& aState,
const bool& aEnabled)
{
if (IsConstructedInParentProcess()) {
return PDocAccessibleChild::SendStateChangeEvent(aID, aState, aEnabled);
}
PushDeferredEvent(MakeUnique<SerializedStateChange>(this, aID, aState,
aEnabled));
return true;
}
bool
DocAccessibleChild::SendCaretMoveEvent(const uint64_t& aID,
const int32_t& aOffset)
{
if (IsConstructedInParentProcess()) {
return PDocAccessibleChild::SendCaretMoveEvent(aID, aOffset);
}
PushDeferredEvent(MakeUnique<SerializedCaretMove>(this, aID, aOffset));
return true;
}
bool
DocAccessibleChild::SendTextChangeEvent(const uint64_t& aID,
const nsString& aStr,
const int32_t& aStart,
const uint32_t& aLen,
const bool& aIsInsert,
const bool& aFromUser)
{
if (IsConstructedInParentProcess()) {
return PDocAccessibleChild::SendTextChangeEvent(aID, aStr, aStart,
aLen, aIsInsert, aFromUser);
}
PushDeferredEvent(MakeUnique<SerializedTextChange>(this, aID, aStr, aStart,
aLen, aIsInsert, aFromUser));
return true;
}
bool
DocAccessibleChild::SendSelectionEvent(const uint64_t& aID,
const uint64_t& aWidgetID,
const uint32_t& aType)
{
if (IsConstructedInParentProcess()) {
return PDocAccessibleChild::SendSelectionEvent(aID, aWidgetID, aType);
}
PushDeferredEvent(MakeUnique<SerializedSelection>(this, aID,
aWidgetID,
aType));
return true;
}
bool
DocAccessibleChild::SendRoleChangedEvent(const uint32_t& aRole)
{
if (IsConstructedInParentProcess()) {
return PDocAccessibleChild::SendRoleChangedEvent(aRole);
}
PushDeferredEvent(MakeUnique<SerializedRoleChanged>(this, aRole));
return true;
}
bool
DocAccessibleChild::ConstructChildDocInParentProcess(
DocAccessibleChild* aNewChildDoc,
uint64_t aUniqueID, uint32_t aMsaaID)
{
if (IsConstructedInParentProcess()) {
// We may send the constructor immediately
auto tabChild = static_cast<dom::TabChild*>(Manager());
MOZ_ASSERT(tabChild);
bool result = tabChild->SendPDocAccessibleConstructor(aNewChildDoc, this,
aUniqueID, aMsaaID,
IAccessibleHolder());
if (result) {
aNewChildDoc->SetConstructedInParentProcess();
}
return result;
}
PushDeferredEvent(MakeUnique<SerializedChildDocConstructor>(aNewChildDoc, this,
aUniqueID, aMsaaID));
return true;
}
bool
DocAccessibleChild::SendBindChildDoc(DocAccessibleChild* aChildDoc,
const uint64_t& aNewParentID)
{
if (IsConstructedInParentProcess()) {
return DocAccessibleChildBase::SendBindChildDoc(aChildDoc, aNewParentID);
}
PushDeferredEvent(MakeUnique<SerializedBindChildDoc>(this, aChildDoc,
aNewParentID));
return true;
}
} // namespace a11y

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

@ -9,6 +9,7 @@
#include "mozilla/a11y/COMPtrTypes.h"
#include "mozilla/a11y/DocAccessibleChildBase.h"
#include "mozilla/dom/TabChild.h"
#include "mozilla/mscom/Ptr.h"
namespace mozilla {
@ -24,11 +25,291 @@ public:
explicit DocAccessibleChild(DocAccessible* aDoc);
~DocAccessibleChild();
void SendCOMProxy(const IAccessibleHolder& aProxy);
virtual void Shutdown() override;
virtual ipc::IPCResult
RecvParentCOMProxy(const IAccessibleHolder& aParentCOMProxy) override;
IAccessible* GetParentIAccessible() const { return mParentProxy.get(); }
bool SendEvent(const uint64_t& aID, const uint32_t& type);
bool SendHideEvent(const uint64_t& aRootID, const bool& aFromUser);
bool SendStateChangeEvent(const uint64_t& aID, const uint64_t& aState,
const bool& aEnabled);
bool SendCaretMoveEvent(const uint64_t& aID, const int32_t& aOffset);
bool SendTextChangeEvent(const uint64_t& aID, const nsString& aStr,
const int32_t& aStart, const uint32_t& aLen,
const bool& aIsInsert, const bool& aFromUser);
bool SendSelectionEvent(const uint64_t& aID, const uint64_t& aWidgetID,
const uint32_t& aType);
bool SendRoleChangedEvent(const uint32_t& aRole);
bool ConstructChildDocInParentProcess(DocAccessibleChild* aNewChildDoc,
uint64_t aUniqueID, uint32_t aMsaaID);
bool SendBindChildDoc(DocAccessibleChild* aChildDoc,
const uint64_t& aNewParentID);
protected:
virtual void MaybeSendShowEvent(ShowEventData& aData, bool aFromUser) override;
private:
void RemoveDeferredConstructor();
bool IsConstructedInParentProcess() const { return mIsRemoteConstructed; }
void SetConstructedInParentProcess() { mIsRemoteConstructed = true; }
/**
* DocAccessibleChild should not fire events until it has asynchronously
* received the COM proxy for its parent. OTOH, content a11y may still be
* attempting to fire events during this window of time. If this object does
* not yet have its parent proxy, instead of immediately sending the events to
* our parent, we enqueue them to mDeferredEvents. As soon as
* RecvParentCOMProxy is called, we play back mDeferredEvents.
*/
struct DeferredEvent
{
void Dispatch()
{
Dispatch(mTarget);
}
virtual ~DeferredEvent() {}
protected:
explicit DeferredEvent(DocAccessibleChild* aTarget)
: mTarget(aTarget)
{}
virtual void Dispatch(DocAccessibleChild* aIPCDoc) = 0;
private:
DocAccessibleChild* mTarget;
};
void PushDeferredEvent(UniquePtr<DeferredEvent> aEvent);
struct SerializedShow final : public DeferredEvent
{
SerializedShow(DocAccessibleChild* aTarget,
ShowEventData& aEventData, bool aFromUser)
: DeferredEvent(aTarget)
, mEventData(aEventData.ID(), aEventData.Idx(), nsTArray<AccessibleData>())
, mFromUser(aFromUser)
{
// Since IPDL doesn't generate a move constructor for ShowEventData,
// we move NewTree manually (ugh). We still construct with an empty
// NewTree above so that the compiler catches any changes made to the
// ShowEventData structure in IPDL.
mEventData.NewTree() = Move(aEventData.NewTree());
}
void Dispatch(DocAccessibleChild* aIPCDoc) override
{
Unused << aIPCDoc->SendShowEvent(mEventData, mFromUser);
}
ShowEventData mEventData;
bool mFromUser;
};
struct SerializedHide final : public DeferredEvent
{
SerializedHide(DocAccessibleChild* aTarget, uint64_t aRootID, bool aFromUser)
: DeferredEvent(aTarget)
, mRootID(aRootID)
, mFromUser(aFromUser)
{}
void Dispatch(DocAccessibleChild* aIPCDoc) override
{
Unused << aIPCDoc->SendHideEvent(mRootID, mFromUser);
}
uint64_t mRootID;
bool mFromUser;
};
struct SerializedStateChange final : public DeferredEvent
{
SerializedStateChange(DocAccessibleChild* aTarget, uint64_t aID,
uint64_t aState, bool aEnabled)
: DeferredEvent(aTarget)
, mID(aID)
, mState(aState)
, mEnabled(aEnabled)
{}
void Dispatch(DocAccessibleChild* aIPCDoc) override
{
Unused << aIPCDoc->SendStateChangeEvent(mID, mState, mEnabled);
}
uint64_t mID;
uint64_t mState;
bool mEnabled;
};
struct SerializedCaretMove final : public DeferredEvent
{
SerializedCaretMove(DocAccessibleChild* aTarget, uint64_t aID,
int32_t aOffset)
: DeferredEvent(aTarget)
, mID(aID)
, mOffset(aOffset)
{}
void Dispatch(DocAccessibleChild* aIPCDoc) override
{
Unused << aIPCDoc->SendCaretMoveEvent(mID, mOffset);
}
uint64_t mID;
int32_t mOffset;
};
struct SerializedTextChange final : public DeferredEvent
{
SerializedTextChange(DocAccessibleChild* aTarget, uint64_t aID,
const nsString& aStr, int32_t aStart, uint32_t aLen,
bool aIsInsert, bool aFromUser)
: DeferredEvent(aTarget)
, mID(aID)
, mStr(aStr)
, mStart(aStart)
, mLen(aLen)
, mIsInsert(aIsInsert)
, mFromUser(aFromUser)
{}
void Dispatch(DocAccessibleChild* aIPCDoc) override
{
Unused << aIPCDoc->SendTextChangeEvent(mID, mStr, mStart, mLen, mIsInsert,
mFromUser);
}
uint64_t mID;
nsString mStr;
int32_t mStart;
uint32_t mLen;
bool mIsInsert;
bool mFromUser;
};
struct SerializedSelection final : public DeferredEvent
{
SerializedSelection(DocAccessibleChild* aTarget, uint64_t aID,
uint64_t aWidgetID, uint32_t aType)
: DeferredEvent(aTarget)
, mID(aID)
, mWidgetID(aWidgetID)
, mType(aType)
{}
void Dispatch(DocAccessibleChild* aIPCDoc) override
{
Unused << aIPCDoc->SendSelectionEvent(mID, mWidgetID, mType);
}
uint64_t mID;
uint64_t mWidgetID;
uint32_t mType;
};
struct SerializedRoleChanged final : public DeferredEvent
{
explicit SerializedRoleChanged(DocAccessibleChild* aTarget, uint32_t aRole)
: DeferredEvent(aTarget)
, mRole(aRole)
{}
void Dispatch(DocAccessibleChild* aIPCDoc) override
{
Unused << aIPCDoc->SendRoleChangedEvent(mRole);
}
uint32_t mRole;
};
struct SerializedEvent final : public DeferredEvent
{
SerializedEvent(DocAccessibleChild* aTarget, uint64_t aID, uint32_t aType)
: DeferredEvent(aTarget)
, mID(aID)
, mType(aType)
{}
void Dispatch(DocAccessibleChild* aIPCDoc) override
{
Unused << aIPCDoc->SendEvent(mID, mType);
}
uint64_t mID;
uint32_t mType;
};
struct SerializedChildDocConstructor final : public DeferredEvent
{
SerializedChildDocConstructor(DocAccessibleChild* aIPCDoc,
DocAccessibleChild* aParentIPCDoc,
uint64_t aUniqueID, uint32_t aMsaaID)
: DeferredEvent(aParentIPCDoc)
, mIPCDoc(aIPCDoc)
, mUniqueID(aUniqueID)
, mMsaaID(aMsaaID)
{}
void Dispatch(DocAccessibleChild* aParentIPCDoc) override
{
auto tabChild = static_cast<dom::TabChild*>(aParentIPCDoc->Manager());
MOZ_ASSERT(tabChild);
Unused << tabChild->SendPDocAccessibleConstructor(mIPCDoc, aParentIPCDoc,
mUniqueID, mMsaaID,
IAccessibleHolder());
mIPCDoc->SetConstructedInParentProcess();
}
DocAccessibleChild* mIPCDoc;
uint64_t mUniqueID;
uint32_t mMsaaID;
};
friend struct SerializedChildDocConstructor;
struct SerializedBindChildDoc final : public DeferredEvent
{
SerializedBindChildDoc(DocAccessibleChild* aParentDoc,
DocAccessibleChild* aChildDoc, uint64_t aNewParentID)
: DeferredEvent(aParentDoc)
, mChildDoc(aChildDoc)
, mNewParentID(aNewParentID)
{}
void Dispatch(DocAccessibleChild* aParentIPCDoc) override
{
Unused << aParentIPCDoc->SendBindChildDoc(mChildDoc, mNewParentID);
}
DocAccessibleChild* mChildDoc;
uint64_t mNewParentID;
};
struct SerializedShutdown final : public DeferredEvent
{
explicit SerializedShutdown(DocAccessibleChild* aTarget)
: DeferredEvent(aTarget)
{
}
void Dispatch(DocAccessibleChild* aIPCDoc) override
{
aIPCDoc->Shutdown();
}
};
bool mIsRemoteConstructed;
mscom::ProxyUniquePtr<IAccessible> mParentProxy;
nsTArray<UniquePtr<DeferredEvent>> mDeferredEvents;
};
} // namespace a11y

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

@ -65,12 +65,9 @@ parent:
sync GetWindowedPluginIAccessible(WindowsHandle aHwnd)
returns (IAccessibleHolder aPluginCOMProxy);
// For now we'll add the command to send the proxy here. This might move to
// PDocAccessible constructor in PBrowser.
sync COMProxy(IAccessibleHolder aDocCOMProxy)
returns(IAccessibleHolder aParentCOMProxy);
child:
async ParentCOMProxy(IAccessibleHolder aParentCOMProxy);
async __delete__();
};

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

@ -77,6 +77,9 @@
}
}
ok(anode.is('document', 'focusable'),
'correct role and state on an accessible node');
finish();
}
</script>

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

@ -216,6 +216,8 @@ pref("browser.shell.defaultBrowserCheckCount", 0);
// The behavior of option 3 is detailed at: http://wiki.mozilla.org/Session_Restore
pref("browser.startup.page", 1);
pref("browser.startup.homepage", "chrome://branding/locale/browserconfig.properties");
// Whether we should skip the homepage when opening the first-run page
pref("browser.startup.firstrunSkipsHomepage", false);
pref("browser.slowStartup.notificationDisabled", false);
pref("browser.slowStartup.timeThreshold", 40000);

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

@ -834,7 +834,6 @@ var BookmarksEventHandler = {
if (node.localName == "menupopup")
node.hidePopup();
else if (node.localName != "menu" &&
node.localName != "splitmenu" &&
node.localName != "hbox" &&
node.localName != "vbox" )
break;

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

@ -434,13 +434,7 @@ toolbar:not(#TabsToolbar) > #personal-bookmarks {
background-position: bottom left;
}
.menuitem-tooltip {
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#menuitem-tooltip");
}
.menuitem-iconic-tooltip,
.menuitem-tooltip[type="checkbox"],
.menuitem-tooltip[type="radio"] {
.menuitem-iconic-tooltip {
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#menuitem-iconic-tooltip");
}

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

@ -1,32 +0,0 @@
<?xml version="1.0"?>
# 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/.
<?xul-overlay href="chrome://browser/content/macBrowserOverlay.xul"?>
<overlay id="downloadManagerOverlay"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<window id="downloadManager">
#include browserMountPoints.inc
<script type="application/javascript"><![CDATA[
window.addEventListener("load", function(event) {
// Bug 405696: Map Edit -> Find command to the download manager's command
var findMenuItem = document.getElementById("menu_find");
findMenuItem.setAttribute("command", "cmd_findDownload");
findMenuItem.setAttribute("key", "key_findDownload");
// Bug 429614: Map Edit -> Select All command to download manager's command
let selectAllMenuItem = document.getElementById("menu_selectAll");
selectAllMenuItem.setAttribute("command", "cmd_selectAllDownloads");
selectAllMenuItem.setAttribute("key", "key_selectAllDownloads");
}, false);
]]></script>
</window>
</overlay>

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

@ -24,7 +24,8 @@
<xul:hbox flex="1" class="browserSidebarContainer">
<xul:vbox flex="1" class="browserContainer">
<xul:stack flex="1" class="browserStack" anonid="browserStack">
<xul:browser anonid="initialBrowser" type="content-primary" message="true" messagemanagergroup="browsers"
<xul:browser anonid="initialBrowser" type="content" message="true" messagemanagergroup="browsers"
primary="true"
xbl:inherits="tooltip=contenttooltip,contextmenu=contentcontextmenu,autocompletepopup,selectmenulist,datetimepicker"/>
</xul:stack>
</xul:vbox>
@ -1092,9 +1093,9 @@
var oldBrowser = this.mCurrentBrowser;
if (!gMultiProcessBrowser) {
oldBrowser.setAttribute("type", "content-targetable");
oldBrowser.removeAttribute("primary");
oldBrowser.docShellIsActive = false;
newBrowser.setAttribute("type", "content-primary");
newBrowser.setAttribute("primary", "true");
newBrowser.docShellIsActive =
(window.windowState != window.STATE_MINIMIZED);
}
@ -1940,7 +1941,7 @@
let b = document.createElementNS(NS_XUL, "browser");
b.permanentKey = aParams.permanentKey || {};
b.setAttribute("type", "content-targetable");
b.setAttribute("type", "content");
b.setAttribute("message", "true");
b.setAttribute("messagemanagergroup", "browsers");
b.setAttribute("contextmenu", this.getAttribute("contentcontextmenu"));
@ -2526,13 +2527,6 @@
var browser = this.getBrowserForTab(aTab);
// Start closing the FrameLoaderOwners which are inactive, so that
// they are cleaned up as well.
let frameLoader = browser.frameLoader;
if (frameLoader && frameLoader.groupedSessionHistory) {
frameLoader.groupedSessionHistory.closeInactiveFrameLoaderOwners();
}
if (!aTab._pendingPermitUnload && !aAdoptedByTab && !aSkipPermitUnload) {
// We need to block while calling permitUnload() because it
// processes the event queue and may lead to another removeTab()
@ -2622,7 +2616,7 @@
}
// We are no longer the primary content area.
browser.setAttribute("type", "content-targetable");
browser.removeAttribute("primary");
// Remove this tab as the owner of any other tabs, since it's going away.
for (let tab of this.tabs) {
@ -3757,7 +3751,7 @@
this.destroy();
let toBrowser = this.requestedTab.linkedBrowser;
toBrowser.setAttribute("type", "content-primary");
toBrowser.setAttribute("primary", "true");
this.tabbrowser._adjustFocusAfterTabSwitch(this.requestedTab);
@ -3766,7 +3760,7 @@
// before we were able to finalize, in which case, fromBrowser
// doesn't exist.
if (fromBrowser) {
fromBrowser.setAttribute("type", "content-targetable");
fromBrowser.removeAttribute("primary");
}
let event = new CustomEvent("TabSwitchDone", {

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

@ -2528,131 +2528,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
</handlers>
</binding>
<binding id="splitmenu">
<content>
<xul:hbox anonid="menuitem" flex="1"
class="splitmenu-menuitem"
xbl:inherits="iconic,label,disabled,onclick=oncommand,_moz-menuactive=active"/>
<xul:menu anonid="menu" class="splitmenu-menu"
xbl:inherits="disabled,_moz-menuactive=active"
oncommand="event.stopPropagation();">
<children includes="menupopup"/>
</xul:menu>
</content>
<implementation implements="nsIDOMEventListener">
<constructor><![CDATA[
this._parentMenupopup.addEventListener("DOMMenuItemActive", this, false);
this._parentMenupopup.addEventListener("popuphidden", this, false);
]]></constructor>
<destructor><![CDATA[
this._parentMenupopup.removeEventListener("DOMMenuItemActive", this, false);
this._parentMenupopup.removeEventListener("popuphidden", this, false);
]]></destructor>
<field name="menuitem" readonly="true">
document.getAnonymousElementByAttribute(this, "anonid", "menuitem");
</field>
<field name="menu" readonly="true">
document.getAnonymousElementByAttribute(this, "anonid", "menu");
</field>
<field name="_menuDelay">600</field>
<field name="_parentMenupopup"><![CDATA[
this._getParentMenupopup(this);
]]></field>
<method name="_getParentMenupopup">
<parameter name="aNode"/>
<body><![CDATA[
let node = aNode.parentNode;
while (node) {
if (node.localName == "menupopup")
break;
node = node.parentNode;
}
return node;
]]></body>
</method>
<method name="handleEvent">
<parameter name="event"/>
<body><![CDATA[
switch (event.type) {
case "DOMMenuItemActive":
if (this.getAttribute("active") == "true" &&
event.target != this &&
this._getParentMenupopup(event.target) == this._parentMenupopup)
this.removeAttribute("active");
break;
case "popuphidden":
if (event.target == this._parentMenupopup)
this.removeAttribute("active");
break;
}
]]></body>
</method>
</implementation>
<handlers>
<handler event="mouseover"><![CDATA[
if (this.getAttribute("active") != "true") {
this.setAttribute("active", "true");
let menuItemActiveEvent = document.createEvent("Events");
menuItemActiveEvent.initEvent("DOMMenuItemActive", true, false);
this.dispatchEvent(menuItemActiveEvent);
if (this.getAttribute("disabled") != "true") {
let self = this;
setTimeout(function() {
if (self.getAttribute("active") == "true")
self.menu.open = true;
}, this._menuDelay);
}
}
]]></handler>
<handler event="popupshowing"><![CDATA[
if (event.target == this.firstChild &&
this._parentMenupopup._currentPopup)
this._parentMenupopup._currentPopup.hidePopup();
]]></handler>
<handler event="click" phase="capturing"><![CDATA[
if (this.getAttribute("disabled") == "true") {
// Prevent the command from being carried out
event.stopPropagation();
return;
}
let node = event.originalTarget;
while (true) {
if (node == this.menuitem)
break;
if (node == this)
return;
node = node.parentNode;
}
this._parentMenupopup.hidePopup();
]]></handler>
</handlers>
</binding>
<binding id="menuitem-tooltip" extends="chrome://global/content/bindings/menu.xml#menuitem">
<implementation>
<constructor><![CDATA[
this.setAttribute("tooltiptext", this.getAttribute("acceltext"));
// TODO: Simplify this to this.setAttribute("acceltext", "") once bug
// 592424 is fixed
document.getAnonymousElementByAttribute(this, "anonid", "accel").firstChild.setAttribute("value", "");
]]></constructor>
</implementation>
</binding>
<!-- This binding is only retained for add-ons compatibility -->
<binding id="menuitem-iconic-tooltip" extends="chrome://global/content/bindings/menu.xml#menuitem-iconic">
<implementation>
<constructor><![CDATA[

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

@ -4,7 +4,6 @@
browser.jar:
% content browser %content/browser/ contentaccessible=yes
#ifdef XP_MACOSX
% overlay chrome://mozapps/content/downloads/downloads.xul chrome://browser/content/downloadManagerOverlay.xul
% overlay chrome://mozapps/content/update/updates.xul chrome://browser/content/softwareUpdateOverlay.xul
#endif
#ifdef XP_WIN
@ -174,7 +173,6 @@ browser.jar:
* content/browser/hiddenWindow.xul (content/hiddenWindow.xul)
#ifdef XP_MACOSX
* content/browser/macBrowserOverlay.xul (content/macBrowserOverlay.xul)
* content/browser/downloadManagerOverlay.xul (content/downloadManagerOverlay.xul)
* content/browser/softwareUpdateOverlay.xul (content/softwareUpdateOverlay.xul)
#endif
* content/browser/viewSourceOverlay.xul (content/viewSourceOverlay.xul)

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

@ -551,8 +551,11 @@ nsBrowserContentHandler.prototype = {
if (startPage == "about:blank")
startPage = "";
// Only show the startPage if we're not restoring an update session.
if (overridePage && startPage && !willRestoreSession)
let skipStartPage = override == OVERRIDE_NEW_PROFILE &&
prefb.getBoolPref("browser.startup.firstrunSkipsHomepage");
// Only show the startPage if we're not restoring an update session and are
// not set to skip the start page on this profile
if (overridePage && startPage && !willRestoreSession && !skipStartPage)
return overridePage + "|" + startPage;
return overridePage || startPage || "about:blank";

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

@ -36,6 +36,9 @@
}, {
name: 'push',
type: 'desktop-notification'
}, {
name: 'persistent-storage',
type: 'persistent-storage'
}, ];
const UNSUPPORTED_PERMISSIONS = [

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

@ -5,6 +5,9 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "OfflineAppCacheHelper",
"resource:///modules/offlineAppCache.jsm");
this.EXPORTED_SYMBOLS = [
"SiteDataManager"
];
@ -62,12 +65,17 @@ this.SiteDataManager = {
this._updateQuota();
this._updateAppCache();
this._updateDiskCache();
Promise.all([this._updateQuotaPromise, this._updateDiskCachePromise])
.then(() => {
Services.obs.notifyObservers(null, "sitedatamanager:sites-updated", null);
});
},
_updateQuota() {
this._quotaUsageRequests = [];
let promises = [];
for (let [key, site] of this._sites) { // eslint-disable-line no-unused-vars
for (let site of this._sites.values()) {
promises.push(new Promise(resolve => {
let callback = {
onUsageResult: function(request) {
@ -96,7 +104,7 @@ this.SiteDataManager = {
_updateAppCache() {
let groups = this._appCache.getGroups();
for (let [key, site] of this._sites) { // eslint-disable-line no-unused-vars
for (let site of this._sites.values()) {
for (let group of groups) {
let uri = Services.io.newURI(group, null, null);
if (site.perm.matchesURI(uri, true)) {
@ -113,7 +121,7 @@ this.SiteDataManager = {
let sites = this._sites;
let visitor = {
onCacheEntryInfo: function(uri, idEnhance, dataSize) {
for (let [key, site] of sites) { // eslint-disable-line no-unused-vars
for (let site of sites.values()) {
if (site.perm.matchesURI(uri, true)) {
site.diskCacheList.push({
dataSize,
@ -138,7 +146,7 @@ this.SiteDataManager = {
return Promise.all([this._updateQuotaPromise, this._updateDiskCachePromise])
.then(() => {
let usage = 0;
for (let [key, site] of this._sites) { // eslint-disable-line no-unused-vars
for (let site of this._sites.values()) {
let cache = null;
for (cache of site.appCacheList) {
usage += cache.usage;
@ -151,4 +159,23 @@ this.SiteDataManager = {
return usage;
});
},
_removePermission(site) {
Services.perms.removePermission(site.perm);
},
_removeQuotaUsage(site) {
this._qms.clearStoragesForPrincipal(site.perm.principal, null, true);
},
removeAll() {
for (let site of this._sites.values()) {
this._removePermission(site);
this._removeQuotaUsage(site);
}
Services.cache2.clear();
Services.cookies.removeAll();
OfflineAppCacheHelper.clear();
this.updateSites();
}
};

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

@ -56,8 +56,10 @@ var gAdvancedPane = {
this.updateActualAppCacheSize();
if (Services.prefs.getBoolPref("browser.storageManager.enabled")) {
Services.obs.addObserver(this, "sitedatamanager:sites-updated", false);
SiteDataManager.updateSites();
this.updateTotalSiteDataSize();
setEventListener("clearSiteDataButton", "command",
gAdvancedPane.clearSiteData);
}
setEventListener("layers.acceleration.disabled", "change",
@ -479,6 +481,23 @@ var gAdvancedPane = {
this.updateOfflineApps();
},
clearSiteData: function() {
let flags =
Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_0 +
Services.prompt.BUTTON_TITLE_CANCEL * Services.prompt.BUTTON_POS_1 +
Services.prompt.BUTTON_POS_0_DEFAULT;
let prefStrBundle = document.getElementById("bundlePreferences");
let title = prefStrBundle.getString("clearSiteDataPromptTitle");
let text = prefStrBundle.getString("clearSiteDataPromptText");
let btn0Label = prefStrBundle.getString("clearSiteDataNow");
let result = Services.prompt.confirmEx(
window, title, text, flags, btn0Label, null, null, null, {});
if (result == 0) {
SiteDataManager.removeAll();
}
},
readOfflineNotify: function()
{
var pref = document.getElementById("browser.offline-apps.notify");
@ -774,6 +793,10 @@ var gAdvancedPane = {
case "nsPref:changed":
this.updateReadPrefs();
break;
case "sitedatamanager:sites-updated":
this.updateTotalSiteDataSize();
break;
}
}
},

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

@ -335,6 +335,8 @@
<hbox align="center">
<label id="totalSiteDataSize" flex="1"></label>
<button id="clearSiteDataButton" icon="clear"
label="&clearSiteData.label;" accesskey="&clearSiteData.accesskey;"/>
</hbox>
</groupbox>
</tabpanel>

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

@ -2,7 +2,9 @@
support-files =
head.js
privacypane_tests_perwindow.js
site_data_test.html
[browser_advanced_siteData.js]
[browser_advanced_update.js]
[browser_basic_rebuild_fonts_test.js]
[browser_bug410900.js]

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

@ -0,0 +1,154 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
Services.scriptloader.loadSubScript("resource://testing-common/sinon-1.16.1.js");
const TEST_HOST = "example.com";
const TEST_ORIGIN = "http://" + TEST_HOST;
const TEST_BASE_URL = TEST_ORIGIN + "/browser/browser/components/preferences/in-content/tests/";
const { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
const { SiteDataManager } = Cu.import("resource:///modules/SiteDataManager.jsm", {});
const { OfflineAppCacheHelper } = Cu.import("resource:///modules/offlineAppCache.jsm", {});
const mockOfflineAppCacheHelper = {
clear: null,
originalClear: null,
register: function() {
this.originalClear = OfflineAppCacheHelper.clear;
this.clear = sinon.spy();
OfflineAppCacheHelper.clear = this.clear;
},
unregister: function() {
OfflineAppCacheHelper.clear = this.originalClear;
}
};
function addPersistentStoragePerm(origin) {
let uri = NetUtil.newURI(origin);
let principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
Services.perms.addFromPrincipal(principal, "persistent-storage", Ci.nsIPermissionManager.ALLOW_ACTION);
}
function getPersistentStoragePermStatus(origin) {
let uri = NetUtil.newURI(origin);
let principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
return Services.perms.testExactPermissionFromPrincipal(principal, "persistent-storage");
}
function getQuotaUsage(origin) {
return new Promise(resolve => {
let uri = NetUtil.newURI(origin);
let principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
Services.qms.getUsageForPrincipal(principal, request => resolve(request.usage));
});
}
function getCacheUsage() {
return new Promise(resolve => {
let obs = {
onNetworkCacheDiskConsumption: function(usage) {
resolve(usage);
},
QueryInterface: XPCOMUtils.generateQI([
Components.interfaces.nsICacheStorageConsumptionObserver,
Components.interfaces.nsISupportsWeakReference
]),
};
Services.cache2.asyncGetDiskConsumption(obs);
});
}
function promiseSitesUpdated() {
return TestUtils.topicObserved("sitedatamanager:sites-updated", () => true);
}
function promiseCookiesCleared() {
return TestUtils.topicObserved("cookie-changed", (subj, data) => {
return data === "cleared";
});
}
registerCleanupFunction(function() {
delete window.sinon;
delete window.setImmediate;
delete window.clearImmediate;
mockOfflineAppCacheHelper.unregister();
});
add_task(function* () {
yield SpecialPowers.pushPrefEnv({set: [["browser.storageManager.enabled", true]]});
addPersistentStoragePerm(TEST_ORIGIN);
yield BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_BASE_URL + "site_data_test.html");
yield waitForEvent(gBrowser.selectedBrowser.contentWindow, "test-indexedDB-done");
gBrowser.removeCurrentTab();
yield openPreferencesViaOpenPreferencesAPI("advanced", "networkTab", { leaveOpen: true });
// Test the initial states
let cacheUsage = yield getCacheUsage();
let quotaUsage = yield getQuotaUsage(TEST_ORIGIN);
let totalUsage = yield SiteDataManager.getTotalUsage();
Assert.greater(cacheUsage, 0, "The cache usage should not be 0");
Assert.greater(quotaUsage, 0, "The quota usage should not be 0");
Assert.greater(totalUsage, 0, "The total usage should not be 0");
// Test cancelling "Clear All Data"
// Click "Clear All Data" button and then cancel
let doc = gBrowser.selectedBrowser.contentDocument;
let cancelPromise = promiseAlertDialogOpen("cancel");
let clearBtn = doc.getElementById("clearSiteDataButton");
clearBtn.doCommand();
yield cancelPromise;
// Test the items are not removed
let status = getPersistentStoragePermStatus(TEST_ORIGIN);
is(status, Ci.nsIPermissionManager.ALLOW_ACTION, "Should not remove permission");
cacheUsage = yield getCacheUsage();
quotaUsage = yield getQuotaUsage(TEST_ORIGIN);
totalUsage = yield SiteDataManager.getTotalUsage();
Assert.greater(cacheUsage, 0, "The cache usage should not be 0");
Assert.greater(quotaUsage, 0, "The quota usage should not be 0");
Assert.greater(totalUsage, 0, "The total usage should not be 0");
// Test cancelling "Clear All Data" ends
// Test accepting "Clear All Data"
// Click "Clear All Data" button and then accept
let acceptPromise = promiseAlertDialogOpen("accept");
let updatePromise = promiseSitesUpdated();
let cookiesClearedPromise = promiseCookiesCleared();
mockOfflineAppCacheHelper.register();
clearBtn.doCommand();
yield acceptPromise;
yield updatePromise;
mockOfflineAppCacheHelper.unregister();
// Test all the items are removed
yield cookiesClearedPromise;
ok(mockOfflineAppCacheHelper.clear.calledOnce, "Should clear app cache");
status = getPersistentStoragePermStatus(TEST_ORIGIN);
is(status, Ci.nsIPermissionManager.UNKNOWN_ACTION, "Should remove permission");
cacheUsage = yield getCacheUsage();
quotaUsage = yield getQuotaUsage(TEST_ORIGIN);
totalUsage = yield SiteDataManager.getTotalUsage();
is(cacheUsage, 0, "The cahce usage should be removed");
is(quotaUsage, 0, "The quota usage should be removed");
is(totalUsage, 0, "The total usage should be removed");
// Test accepting "Clear All Data" ends
gBrowser.removeCurrentTab();
});

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

@ -163,3 +163,21 @@ function waitForCondition(aConditionFn, aMaxTries = 50, aCheckInterval = 100) {
tryAgain();
});
}
function promiseAlertDialogOpen(buttonAction) {
return new Promise(resolve => {
Services.ww.registerNotification(function onOpen(subj, topic, data) {
if (topic == "domwindowopened" && subj instanceof Ci.nsIDOMWindow) {
subj.addEventListener("load", function onLoad() {
subj.removeEventListener("load", onLoad);
if (subj.document.documentURI == "chrome://global/content/commonDialog.xul") {
Services.ww.unregisterNotification(onOpen);
let doc = subj.document.documentElement;
doc.getButton(buttonAction).click();
resolve();
}
});
}
});
});
}

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

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Cache-Control" content="public" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
<title>Site Data Test</title>
</head>
<body>
<h1>Site Data Test</h1>
<script type="text/javascript">
let request = indexedDB.open("TestDatabase", 1);
request.onupgradeneeded = function(e) {
let db = e.target.result;
db.createObjectStore("TestStore", { keyPath: "id" });
};
request.onsuccess = function(e) {
let db = e.target.result;
let tx = db.transaction("TestStore", "readwrite");
let store = tx.objectStore("TestStore");
store.put({ id: "test_id", description: "Site Data Test"});
window.dispatchEvent(new Event("test-indexedDB-done"));
}
</script>
</body>
</html>

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

@ -52,6 +52,7 @@ function SyncedTabsDeckComponent({
SyncedTabs: SyncedTabs,
clipboardHelper: Cc["@mozilla.org/widget/clipboardhelper;1"]
.getService(Ci.nsIClipboardHelper),
getChromeWindow: this._getChromeWindow,
});
}

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

@ -29,11 +29,13 @@ this.EXPORTED_SYMBOLS = [
* to state changes so it can rerender.
*/
function TabListComponent({window, store, View, SyncedTabs, clipboardHelper}) {
function TabListComponent({window, store, View, SyncedTabs, clipboardHelper,
getChromeWindow}) {
this._window = window;
this._store = store;
this._View = View;
this._clipboardHelper = clipboardHelper;
this._getChromeWindow = getChromeWindow;
// used to trigger Sync from context menu
this._SyncedTabs = SyncedTabs;
}
@ -116,7 +118,7 @@ TabListComponent.prototype = {
BrowserUITelemetry.countSyncedTabEvent("open", "sidebar");
},
onOpenTabs(urls, where, params) {
onOpenTabs(urls, where) {
if (!PlacesUIUtils.confirmOpenInTabs(urls.length, this._window)) {
return;
}
@ -124,9 +126,8 @@ TabListComponent.prototype = {
this._window.openDialog(this._window.getBrowserURL(), "_blank",
"chrome,dialog=no,all", urls.join("|"));
} else {
for (let url of urls) {
this._window.openUILinkIn(url, where, params);
}
let loadInBackground = where == "tabshifted" ? true : false;
this._getChromeWindow(this._window).gBrowser.loadTabs(urls, loadInBackground, false);
}
BrowserUITelemetry.countSyncedTabEvent("openmultiple", "sidebar");
},

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

@ -289,7 +289,7 @@ TabListView.prototype = {
if (where != "current") {
const tabs = itemNode.querySelector(".item-tabs-list").childNodes;
const urls = [...tabs].map(tab => tab.dataset.url);
this.props.onOpenTabs(urls, where, {});
this.props.onOpenTabs(urls, where);
}
}

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

@ -68,6 +68,13 @@ add_task(function* testInitUninit() {
add_task(function* testActions() {
let store = new SyncedTabsListStore();
let chromeWindowMock = {
gBrowser: {
loadTabs() {},
},
};
let getChromeWindowMock = sinon.stub();
getChromeWindowMock.returns(chromeWindowMock);
let clipboardHelperMock = {
copyString() {},
};
@ -84,7 +91,8 @@ add_task(function* testActions() {
};
let component = new TabListComponent({
window: windowMock, store, View: null, SyncedTabs,
clipboardHelper: clipboardHelperMock});
clipboardHelper: clipboardHelperMock,
getChromeWindow: getChromeWindowMock });
sinon.stub(store, "getData");
component.onFilter("query");
@ -127,12 +135,13 @@ add_task(function* testActions() {
component.onOpenTab("uri", "where", "params");
Assert.ok(windowMock.openUILinkIn.calledWith("uri", "where", "params"));
component.onOpenTabs(["uri1", "uri2"], "where", "params");
Assert.ok(windowMock.openUILinkIn.calledWith("uri1", "where", "params"));
Assert.ok(windowMock.openUILinkIn.calledWith("uri2", "where", "params"));
sinon.spy(windowMock, "openDialog");
component.onOpenTabs(["uri1", "uri2"], "window", "params");
Assert.deepEqual(windowMock.openDialog.args[0][3], ["uri1", "uri2"].join("|"));
sinon.spy(chromeWindowMock.gBrowser, "loadTabs");
let tabsToOpen = ["uri1", "uri2"];
component.onOpenTabs(tabsToOpen, "where");
Assert.ok(getChromeWindowMock.calledWith(windowMock));
Assert.ok(chromeWindowMock.gBrowser.loadTabs.calledWith(tabsToOpen, false, false));
component.onOpenTabs(tabsToOpen, "tabshifted");
Assert.ok(chromeWindowMock.gBrowser.loadTabs.calledWith(tabsToOpen, true, false));
sinon.spy(clipboardHelperMock, "copyString");
component.onCopyTabLocation("uri");

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

@ -220,6 +220,10 @@ if (typeof Mozilla == 'undefined') {
});
};
Mozilla.UITour.showNewTab = function() {
_sendEvent('showNewTab');
};
Mozilla.UITour.getConfiguration = function(configName, callback) {
_sendEvent('getConfiguration', {
callbackID: _waitForCallback(callback),

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

@ -527,6 +527,11 @@ this.UITour = {
break;
}
case "showNewTab": {
this.showNewTab(window, browser);
break;
}
case "getConfiguration": {
if (typeof data.configuration != "string") {
log.warn("getConfiguration: No configuration option specified");
@ -1744,6 +1749,10 @@ this.UITour = {
}
},
showNewTab: function(aWindow, aBrowser) {
aWindow.openLinkIn("about:newtab", "current", {targetBrowser: aBrowser});
},
hideAnnotationsForPanel: function(aEvent, aTargetPositionCallback) {
let win = aEvent.target.ownerGlobal;
let annotationElements = new Map([

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

@ -16,6 +16,9 @@ skip-if = true # Bug 1113038 - Intermittent "Popup was opened"
[browser_trackingProtection.js]
skip-if = os == "linux" # Intermittent NS_ERROR_NOT_AVAILABLE [nsIUrlClassifierDBService.beginUpdate]
tag = trackingprotection
support-files =
!/browser/base/content/test/general/benignPage.html
!/browser/base/content/test/general/trackingPage.html
[browser_trackingProtection_tour.js]
tag = trackingprotection
[browser_showMenu_controlCenter.js]
@ -41,5 +44,6 @@ skip-if = true # Disabled due to frequent failures, bugs 1026310 and 1032137
skip-if = true # Disabled pending removal of pocket UI Tour
[browser_UITour_registerPageID.js]
[browser_UITour_resetProfile.js]
[browser_UITour_showNewTab.js]
[browser_UITour_sync.js]
[browser_UITour_toggleReaderMode.js]

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

@ -0,0 +1,17 @@
"use strict";
var gTestTab;
var gContentAPI;
var gContentWindow;
add_task(setup_UITourTest);
// Test that we can switch to about:newtab
add_UITour_task(function* test_aboutNewTab() {
let newTabLoaded = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, "about:newtab");
info("Showing about:newtab");
yield gContentAPI.showNewTab();
info("Waiting for about:newtab to load");
yield newTabLoaded;
is(gBrowser.selectedBrowser.currentURI.spec, "about:newtab", "Loaded about:newtab");
});

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

@ -8,3 +8,5 @@ ac_add_options --enable-artifact-builds
ac_add_options --enable-artifact-build-symbols
unset CC
unset CXX
unset RUSTC
unset CARGO

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

@ -11,5 +11,4 @@ ac_add_options --enable-verify-mar
mk_add_options MOZ_PGO=1
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"

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

@ -19,6 +19,5 @@ export MOZ_PACKAGE_JSSHELL=1
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -8,5 +8,7 @@ ac_add_options --enable-artifact-builds
ac_add_options --enable-artifact-build-symbols
unset CC
unset CXX
unset RUSTC
unset CARGO
ac_add_options --enable-debug

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

@ -10,6 +10,5 @@ STRIP_FLAGS="--strip-debug"
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -18,5 +18,4 @@ mk_add_options MOZ_PGO=1
# defines.sh during the beta cycle
export BUILDING_RELEASE=1
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"

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

@ -8,3 +8,5 @@ ac_add_options --enable-artifact-builds
ac_add_options --enable-artifact-build-symbols
unset CC
unset CXX
unset RUSTC
unset CARGO

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

@ -11,5 +11,4 @@ ac_add_options --enable-verify-mar
mk_add_options MOZ_PGO=1
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"

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

@ -17,6 +17,5 @@ export MOZ_PACKAGE_JSSHELL=1
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -8,6 +8,8 @@ ac_add_options --enable-artifact-builds
ac_add_options --enable-artifact-build-symbols
unset CC
unset CXX
unset RUSTC
unset CARGO
ac_add_options --enable-debug

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

@ -29,6 +29,11 @@ CFLAGS="$CFLAGS -Wno-attributes"
CPPFLAGS="$CPPFLAGS -Wno-attributes"
CXXFLAGS="$CXXFLAGS -Wno-attributes"
# Override rust toolchain paths. In this build they're in $TOOLTOOL_DIR
# instead of $topsrcdir as referenced by mozconfig.common.
RUSTC=$TOOLTOOL_DIR/rustc/bin/rustc
CARGO=$TOOLTOOL_DIR/rustc/bin/cargo
export PKG_CONFIG_LIBDIR=/usr/lib64/pkgconfig:/usr/share/pkgconfig
. $topsrcdir/build/unix/mozconfig.gtk

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

@ -10,6 +10,5 @@ STRIP_FLAGS="--strip-debug"
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -18,5 +18,4 @@ mk_add_options MOZ_PGO=1
# defines.sh during the beta cycle
export BUILDING_RELEASE=1
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"

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

@ -10,6 +10,5 @@ fi
ac_add_options --enable-official-branding
ac_add_options --enable-verify-mar
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -16,6 +16,5 @@ fi
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -16,6 +16,5 @@ ac_add_options --enable-verify-mar
# defines.sh during the beta cycle
export BUILDING_RELEASE=1
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -11,3 +11,5 @@ ac_add_options --enable-artifact-builds
ac_add_options --enable-artifact-build-symbols
unset CC
unset CXX
unset RUSTC
unset CARGO

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

@ -10,6 +10,5 @@ fi
ac_add_options --enable-official-branding
ac_add_options --enable-verify-mar
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -19,6 +19,5 @@ export MOZ_PACKAGE_JSSHELL=1
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -8,5 +8,7 @@ ac_add_options --enable-artifact-builds
ac_add_options --enable-artifact-build-symbols
unset CC
unset CXX
unset RUSTC
unset CARGO
ac_add_options --enable-debug

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

@ -16,6 +16,5 @@ fi
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -10,7 +10,6 @@ ac_add_options --enable-dmd
ac_add_options --enable-clang-plugin
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -16,6 +16,5 @@ ac_add_options --enable-verify-mar
# defines.sh during the beta cycle
export BUILDING_RELEASE=1
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -13,6 +13,4 @@ mk_add_options MOZ_PGO=1
ac_add_options --enable-official-branding
ac_add_options --enable-verify-mar
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"

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

@ -12,8 +12,6 @@ ac_add_options --enable-optimize
. $topsrcdir/build/win32/mozconfig.vs-latest
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"
. "$topsrcdir/build/mozconfig.clang-cl"

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

@ -13,8 +13,6 @@ ac_add_options --enable-debug
. $topsrcdir/build/win32/mozconfig.vs-latest
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"
. "$topsrcdir/build/mozconfig.clang-cl"

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

@ -21,7 +21,5 @@ export MOZ_PACKAGE_JSSHELL=1
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -12,8 +12,6 @@ ac_add_options --enable-clang-plugin
. $topsrcdir/build/win32/mozconfig.vs-latest
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"
. "$topsrcdir/build/mozconfig.clang-cl"

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

@ -6,7 +6,5 @@ ac_add_options --enable-verify-mar
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -19,6 +19,4 @@ ac_add_options --enable-verify-mar
# defines.sh during the beta cycle
export BUILDING_RELEASE=1
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"

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

@ -14,6 +14,4 @@ mk_add_options MOZ_PGO=1
ac_add_options --enable-official-branding
ac_add_options --enable-verify-mar
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"

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

@ -14,8 +14,6 @@ ac_add_options --enable-optimize
. $topsrcdir/build/win64/mozconfig.vs-latest
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"
. "$topsrcdir/build/mozconfig.clang-cl"

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

@ -15,8 +15,6 @@ ac_add_options --enable-debug
. $topsrcdir/build/win64/mozconfig.vs-latest
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"
. "$topsrcdir/build/mozconfig.clang-cl"

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

@ -23,7 +23,5 @@ ac_add_options --with-branding=browser/branding/nightly
. $topsrcdir/build/win64/mozconfig.vs-latest
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -7,7 +7,5 @@ ac_add_options --enable-verify-mar
ac_add_options --with-branding=browser/branding/nightly
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.cache"

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

@ -20,6 +20,4 @@ ac_add_options --enable-verify-mar
# defines.sh during the beta cycle
export BUILDING_RELEASE=1
. "$topsrcdir/build/mozconfig.rust"
. "$topsrcdir/build/mozconfig.common.override"

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

@ -16,6 +16,14 @@
"unpack": true
},
{
"version": "rustc 1.14.0-beta.2 (e627a2e6e 2016-11-16) repack",
"size": 96275316,
"digest": "26c11e34df81f5d7ffafc3492df9c6821f644a2e2eda5cfbbcdb1ac23e4ee196007b417c862c60a97bbf66e4be9c801400990938cd3aefec19b1cf9eaf1a9b54",
"algorithm": "sha512",
"filename": "rustc.tar.xz",
"unpack": true
},
{
"size": 12072532,
"digest": "3915f8ec396c56a8a92e6f9695b70f09ce9d1582359d1258e37e3fd43a143bc974410e4cfc27f500e095f34a8956206e0ebf799b7287f0f38def0d5e34ed71c9",
"algorithm": "sha512",

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

@ -16,6 +16,14 @@
"unpack": true
},
{
"version": "rustc 1.14.0-beta.2 (e627a2e6e 2016-11-16) repack",
"size": 96275316,
"digest": "26c11e34df81f5d7ffafc3492df9c6821f644a2e2eda5cfbbcdb1ac23e4ee196007b417c862c60a97bbf66e4be9c801400990938cd3aefec19b1cf9eaf1a9b54",
"algorithm": "sha512",
"filename": "rustc.tar.xz",
"unpack": true
},
{
"version": "sccache rev b21198a7183a2fe226ff49348b1c0b51bae9f4f8",
"algorithm": "sha512",
"visibility": "public",

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

@ -16,6 +16,14 @@
"unpack": true
},
{
"version": "rustc 1.14.0-beta.2 (e627a2e6e 2016-11-16) repack",
"size": 96275316,
"digest": "26c11e34df81f5d7ffafc3492df9c6821f644a2e2eda5cfbbcdb1ac23e4ee196007b417c862c60a97bbf66e4be9c801400990938cd3aefec19b1cf9eaf1a9b54",
"algorithm": "sha512",
"filename": "rustc.tar.xz",
"unpack": true
},
{
"version": "sccache rev b21198a7183a2fe226ff49348b1c0b51bae9f4f8",
"algorithm": "sha512",
"filename": "sccache2.tar.xz",

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

@ -16,6 +16,14 @@
"unpack": true
},
{
"version": "rustc 1.14.0-beta.2 (e627a2e6e 2016-11-16) repack",
"size": 96275316,
"digest": "26c11e34df81f5d7ffafc3492df9c6821f644a2e2eda5cfbbcdb1ac23e4ee196007b417c862c60a97bbf66e4be9c801400990938cd3aefec19b1cf9eaf1a9b54",
"algorithm": "sha512",
"filename": "rustc.tar.xz",
"unpack": true
},
{
"size": 12072532,
"digest": "3915f8ec396c56a8a92e6f9695b70f09ce9d1582359d1258e37e3fd43a143bc974410e4cfc27f500e095f34a8956206e0ebf799b7287f0f38def0d5e34ed71c9",
"algorithm": "sha512",

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

@ -17,8 +17,8 @@
},
{
"version": "rustc 1.14.0-beta.2 (e627a2e6e 2016-11-16) repack",
"size": 96275316,
"digest": "26c11e34df81f5d7ffafc3492df9c6821f644a2e2eda5cfbbcdb1ac23e4ee196007b417c862c60a97bbf66e4be9c801400990938cd3aefec19b1cf9eaf1a9b54",
"size": 94830820,
"digest": "6f2a1cf325d957f0328d2d853fc07944a857e872f6e44df15f6ebb45c032c0ebbf52f56c872bc72927ebcdd830002d759dd92e8fc90048b52c07058955c69c4c",
"algorithm": "sha512",
"filename": "rustc.tar.xz",
"unpack": true

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

@ -8,6 +8,14 @@
"unpack": true
},
{
"version": "rustc 1.13.0 (2c6933acc 2016-11-07) repack",
"size": 104593379,
"digest": "9cbc4a6d4d647dd79629e97c0e7b177443d30e669ccd761ab520728d8c2b7e1cc4ab38ec444c1957649338c4088861db3bfe4f840ec3fedcc01f9f1a74da200a",
"algorithm": "sha512",
"filename": "rustc.tar.bz2",
"unpack": true
},
{
"version": "sccache rev b21198a7183a2fe226ff49348b1c0b51bae9f4f8",
"algorithm": "sha512",
"visibility": "public",

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

@ -1,3 +1,3 @@
This is the pdf.js project output, https://github.com/mozilla/pdf.js
Current extension version is: 1.6.372
Current extension version is: 1.6.401

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

@ -355,4 +355,3 @@ var PdfjsChromeUtils = {
}
};

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

@ -23,8 +23,8 @@
}
}(this, function (exports) {
'use strict';
var pdfjsVersion = '1.6.372';
var pdfjsBuild = 'aaec4908';
var pdfjsVersion = '1.6.401';
var pdfjsBuild = 'b629be05';
var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null;
var pdfjsLibs = {};
(function pdfjsWrapper() {
@ -5102,11 +5102,11 @@
paintFormXObjectBegin: function CanvasGraphics_paintFormXObjectBegin(matrix, bbox) {
this.save();
this.baseTransformStack.push(this.baseTransform);
if (isArray(matrix) && 6 === matrix.length) {
if (isArray(matrix) && matrix.length === 6) {
this.transform.apply(this, matrix);
}
this.baseTransform = this.ctx.mozCurrentTransform;
if (isArray(bbox) && 4 === bbox.length) {
if (isArray(bbox) && bbox.length === 4) {
var width = bbox[2] - bbox[0];
var height = bbox[3] - bbox[1];
this.ctx.rect(bbox[0], bbox[1], width, height);
@ -5234,7 +5234,7 @@
},
beginAnnotation: function CanvasGraphics_beginAnnotation(rect, transform, matrix) {
this.save();
if (isArray(rect) && 4 === rect.length) {
if (isArray(rect) && rect.length === 4) {
var width = rect[2] - rect[0];
var height = rect[3] - rect[1];
this.ctx.rect(rect[0], rect[1], width, height);

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

@ -23,8 +23,8 @@
}
}(this, function (exports) {
'use strict';
var pdfjsVersion = '1.6.372';
var pdfjsBuild = 'aaec4908';
var pdfjsVersion = '1.6.401';
var pdfjsBuild = 'b629be05';
var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null;
var pdfjsLibs = {};
(function pdfjsWrapper() {
@ -9160,6 +9160,7 @@
t['controlHT'] = 0x0009;
t['controlLF'] = 0x000A;
t['controlNAK'] = 0x0015;
t['controlNULL'] = 0x0000;
t['controlRS'] = 0x001E;
t['controlSI'] = 0x000F;
t['controlSO'] = 0x000E;
@ -11911,6 +11912,122 @@
t['zuhiragana'] = 0x305A;
t['zukatakana'] = 0x30BA;
t['.notdef'] = 0x0000;
t['angbracketleftbig'] = 0x2329;
t['angbracketleftBig'] = 0x2329;
t['angbracketleftbigg'] = 0x2329;
t['angbracketleftBigg'] = 0x2329;
t['angbracketrightBig'] = 0x232A;
t['angbracketrightbig'] = 0x232A;
t['angbracketrightBigg'] = 0x232A;
t['angbracketrightbigg'] = 0x232A;
t['arrowhookleft'] = 0x21AA;
t['arrowhookright'] = 0x21A9;
t['arrowlefttophalf'] = 0x21BC;
t['arrowleftbothalf'] = 0x21BD;
t['arrownortheast'] = 0x2197;
t['arrownorthwest'] = 0x2196;
t['arrowrighttophalf'] = 0x21C0;
t['arrowrightbothalf'] = 0x21C1;
t['arrowsoutheast'] = 0x2198;
t['arrowsouthwest'] = 0x2199;
t['backslashbig'] = 0x2216;
t['backslashBig'] = 0x2216;
t['backslashBigg'] = 0x2216;
t['backslashbigg'] = 0x2216;
t['bardbl'] = 0x2016;
t['bracehtipdownleft'] = 0xFE37;
t['bracehtipdownright'] = 0xFE37;
t['bracehtipupleft'] = 0xFE38;
t['bracehtipupright'] = 0xFE38;
t['braceleftBig'] = 0x007B;
t['braceleftbig'] = 0x007B;
t['braceleftbigg'] = 0x007B;
t['braceleftBigg'] = 0x007B;
t['bracerightBig'] = 0x007D;
t['bracerightbig'] = 0x007D;
t['bracerightbigg'] = 0x007D;
t['bracerightBigg'] = 0x007D;
t['bracketleftbig'] = 0x005B;
t['bracketleftBig'] = 0x005B;
t['bracketleftbigg'] = 0x005B;
t['bracketleftBigg'] = 0x005B;
t['bracketrightBig'] = 0x005D;
t['bracketrightbig'] = 0x005D;
t['bracketrightbigg'] = 0x005D;
t['bracketrightBigg'] = 0x005D;
t['ceilingleftbig'] = 0x2308;
t['ceilingleftBig'] = 0x2308;
t['ceilingleftBigg'] = 0x2308;
t['ceilingleftbigg'] = 0x2308;
t['ceilingrightbig'] = 0x2309;
t['ceilingrightBig'] = 0x2309;
t['ceilingrightbigg'] = 0x2309;
t['ceilingrightBigg'] = 0x2309;
t['circledotdisplay'] = 0x2299;
t['circledottext'] = 0x2299;
t['circlemultiplydisplay'] = 0x2297;
t['circlemultiplytext'] = 0x2297;
t['circleplusdisplay'] = 0x2295;
t['circleplustext'] = 0x2295;
t['contintegraldisplay'] = 0x222E;
t['contintegraltext'] = 0x222E;
t['coproductdisplay'] = 0x2210;
t['coproducttext'] = 0x2210;
t['floorleftBig'] = 0x230A;
t['floorleftbig'] = 0x230A;
t['floorleftbigg'] = 0x230A;
t['floorleftBigg'] = 0x230A;
t['floorrightbig'] = 0x230B;
t['floorrightBig'] = 0x230B;
t['floorrightBigg'] = 0x230B;
t['floorrightbigg'] = 0x230B;
t['hatwide'] = 0x0302;
t['hatwider'] = 0x0302;
t['hatwidest'] = 0x0302;
t['intercal'] = 0x1D40;
t['integraldisplay'] = 0x222B;
t['integraltext'] = 0x222B;
t['intersectiondisplay'] = 0x22C2;
t['intersectiontext'] = 0x22C2;
t['logicalanddisplay'] = 0x2227;
t['logicalandtext'] = 0x2227;
t['logicalordisplay'] = 0x2228;
t['logicalortext'] = 0x2228;
t['parenleftBig'] = 0x0028;
t['parenleftbig'] = 0x0028;
t['parenleftBigg'] = 0x0028;
t['parenleftbigg'] = 0x0028;
t['parenrightBig'] = 0x0029;
t['parenrightbig'] = 0x0029;
t['parenrightBigg'] = 0x0029;
t['parenrightbigg'] = 0x0029;
t['prime'] = 0x2032;
t['productdisplay'] = 0x220F;
t['producttext'] = 0x220F;
t['radicalbig'] = 0x221A;
t['radicalBig'] = 0x221A;
t['radicalBigg'] = 0x221A;
t['radicalbigg'] = 0x221A;
t['radicalbt'] = 0x221A;
t['radicaltp'] = 0x221A;
t['radicalvertex'] = 0x221A;
t['slashbig'] = 0x002F;
t['slashBig'] = 0x002F;
t['slashBigg'] = 0x002F;
t['slashbigg'] = 0x002F;
t['summationdisplay'] = 0x2211;
t['summationtext'] = 0x2211;
t['tildewide'] = 0x02DC;
t['tildewider'] = 0x02DC;
t['tildewidest'] = 0x02DC;
t['uniondisplay'] = 0x22C3;
t['unionmultidisplay'] = 0x228E;
t['unionmultitext'] = 0x228E;
t['unionsqdisplay'] = 0x2294;
t['unionsqtext'] = 0x2294;
t['uniontext'] = 0x22C3;
t['vextenddouble'] = 0x2225;
t['vextendsingle'] = 0x2223;
});
var getDingbatsGlyphsUnicode = getLookupTableFactory(function (t) {
t['space'] = 0x0020;
@ -32363,18 +32480,18 @@
}();
var CipherTransform = function CipherTransformClosure() {
function CipherTransform(stringCipherConstructor, streamCipherConstructor) {
this.stringCipherConstructor = stringCipherConstructor;
this.streamCipherConstructor = streamCipherConstructor;
this.StringCipherConstructor = stringCipherConstructor;
this.StreamCipherConstructor = streamCipherConstructor;
}
CipherTransform.prototype = {
createStream: function CipherTransform_createStream(stream, length) {
var cipher = new this.streamCipherConstructor();
var cipher = new this.StreamCipherConstructor();
return new DecryptStream(stream, length, function cipherTransformDecryptStream(data, finalize) {
return cipher.decryptBlock(data, finalize);
});
},
decryptString: function CipherTransform_decryptString(s) {
var cipher = new this.stringCipherConstructor();
var cipher = new this.StringCipherConstructor();
var data = stringToBytes(s);
data = cipher.decryptBlock(data, true);
return bytesToString(data);
@ -32659,17 +32776,17 @@
return new NullCipher();
};
}
if ('V2' === cfm.name) {
if (cfm.name === 'V2') {
return function cipherTransformFactoryBuildCipherConstructorV2() {
return new ARCFourCipher(buildObjectKey(num, gen, key, false));
};
}
if ('AESV2' === cfm.name) {
if (cfm.name === 'AESV2') {
return function cipherTransformFactoryBuildCipherConstructorAESV2() {
return new AES128Cipher(buildObjectKey(num, gen, key, true));
};
}
if ('AESV3' === cfm.name) {
if (cfm.name === 'AESV3') {
return function cipherTransformFactoryBuildCipherConstructorAESV3() {
return new AES256Cipher(key);
};
@ -33791,8 +33908,11 @@
var filter = dict.get('Filter', 'F'), filterName;
if (isName(filter)) {
filterName = filter.name;
} else if (isArray(filter) && isName(filter[0])) {
filterName = filter[0].name;
} else if (isArray(filter)) {
var filterZero = this.xref.fetchIfRef(filter[0]);
if (isName(filterZero)) {
filterName = filterZero.name;
}
}
var startPos = stream.pos, length, i, ii;
if (filterName === 'DCTDecode' || filterName === 'DCT') {
@ -33916,7 +34036,7 @@
var params = dict.get('DecodeParms', 'DP');
if (isName(filter)) {
if (isArray(params)) {
params = params[0];
params = this.xref.fetchIfRef(params[0]);
}
return this.makeFilter(stream, filter.name, length, params);
}
@ -33925,13 +34045,13 @@
var filterArray = filter;
var paramsArray = params;
for (var i = 0, ii = filterArray.length; i < ii; ++i) {
filter = filterArray[i];
filter = this.xref.fetchIfRef(filterArray[i]);
if (!isName(filter)) {
error('Bad filter name: ' + filter);
}
params = null;
if (isArray(paramsArray) && i in paramsArray) {
params = paramsArray[i];
params = this.xref.fetchIfRef(paramsArray[i]);
}
stream = this.makeFilter(stream, filter.name, maybeLength, params);
maybeLength = null;
@ -33945,9 +34065,6 @@
return new NullStream(stream);
}
try {
if (params && this.xref) {
params = this.xref.fetchIfRef(params);
}
var xrefStreamStats = this.xref.stats.streamTypes;
if (name === 'FlateDecode' || name === 'Fl') {
xrefStreamStats[StreamType.FLATE] = true;
@ -36984,13 +37101,15 @@
originalCharCode |= 0;
var glyphId = charCodeToGlyphId[originalCharCode];
var fontCharCode = originalCharCode;
var hasUnicodeValue = false;
if (!isIdentityUnicode && toUnicode.has(originalCharCode)) {
hasUnicodeValue = true;
var unicode = toUnicode.get(fontCharCode);
if (unicode.length === 1) {
fontCharCode = unicode.charCodeAt(0);
}
}
if ((usedFontCharCodes[fontCharCode] !== undefined || isProblematicUnicodeLocation(fontCharCode) || isSymbolic && isIdentityUnicode) && nextAvailableFontCharCode <= PRIVATE_USE_OFFSET_END) {
if ((usedFontCharCodes[fontCharCode] !== undefined || isProblematicUnicodeLocation(fontCharCode) || isSymbolic && !hasUnicodeValue) && nextAvailableFontCharCode <= PRIVATE_USE_OFFSET_END) {
do {
fontCharCode = nextAvailableFontCharCode++;
if (SKIP_PRIVATE_USE_RANGE_F000_TO_F01F && fontCharCode === 0xF000) {
@ -38683,6 +38802,7 @@
function type1FontGlyphMapping(properties, builtInEncoding, glyphNames) {
var charCodeToGlyphId = Object.create(null);
var glyphId, charCode, baseEncoding;
var isSymbolicFont = !!(properties.flags & FontFlags.Symbolic);
if (properties.baseEncodingName) {
baseEncoding = getEncoding(properties.baseEncodingName);
for (charCode = 0; charCode < baseEncoding.length; charCode++) {
@ -38693,7 +38813,7 @@
charCodeToGlyphId[charCode] = 0;
}
}
} else if (!!(properties.flags & FontFlags.Symbolic)) {
} else if (isSymbolicFont) {
for (charCode in builtInEncoding) {
charCodeToGlyphId[charCode] = builtInEncoding[charCode];
}
@ -47670,11 +47790,12 @@
getPageProp: function Page_getPageProp(key) {
return this.pageDict.get(key);
},
getInheritedPageProp: function Page_getInheritedPageProp(key) {
getInheritedPageProp: function Page_getInheritedPageProp(key, getArray) {
var dict = this.pageDict, valueArray = null, loopCount = 0;
var MAX_LOOP_COUNT = 100;
getArray = getArray || false;
while (dict) {
var value = dict.get(key);
var value = getArray ? dict.getArray(key) : dict.get(key);
if (value) {
if (!valueArray) {
valueArray = [];
@ -47702,11 +47823,18 @@
return shadow(this, 'resources', this.getInheritedPageProp('Resources'));
},
get mediaBox() {
var obj = this.getInheritedPageProp('MediaBox');
if (!isArray(obj) || obj.length !== 4) {
obj = LETTER_SIZE_MEDIABOX;
var mediaBox = this.getInheritedPageProp('MediaBox', true);
if (!isArray(mediaBox) || mediaBox.length !== 4) {
return shadow(this, 'mediaBox', LETTER_SIZE_MEDIABOX);
}
return shadow(this, 'mediaBox', obj);
return shadow(this, 'mediaBox', mediaBox);
},
get cropBox() {
var cropBox = this.getInheritedPageProp('CropBox', true);
if (!isArray(cropBox) || cropBox.length !== 4) {
return shadow(this, 'cropBox', this.mediaBox);
}
return shadow(this, 'cropBox', cropBox);
},
get userUnit() {
var obj = this.getPageProp('UserUnit');
@ -47716,16 +47844,12 @@
return shadow(this, 'userUnit', obj);
},
get view() {
var mediaBox = this.mediaBox;
var cropBox = this.getInheritedPageProp('CropBox');
if (!isArray(cropBox) || cropBox.length !== 4) {
var mediaBox = this.mediaBox, cropBox = this.cropBox;
if (mediaBox === cropBox) {
return shadow(this, 'view', mediaBox);
}
cropBox = Util.intersect(cropBox, mediaBox);
if (!cropBox) {
return shadow(this, 'view', mediaBox);
}
return shadow(this, 'view', cropBox);
var intersection = Util.intersect(cropBox, mediaBox);
return shadow(this, 'view', intersection || mediaBox);
},
get rotate() {
var rotate = this.getInheritedPageProp('Rotate') || 0;

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

@ -547,66 +547,6 @@ var pdfjsWebLibs;
factory(root.pdfjsWebDownloadManager = {}, root.pdfjsWebPDFJS);
}(this, function (exports, pdfjsLib) {
}));
(function (root, factory) {
factory(root.pdfjsWebHandTool = {}, root.pdfjsWebGrabToPan, root.pdfjsWebPreferences);
}(this, function (exports, grabToPan, preferences) {
var GrabToPan = grabToPan.GrabToPan;
var Preferences = preferences.Preferences;
var HandTool = function HandToolClosure() {
function HandTool(options) {
this.container = options.container;
this.eventBus = options.eventBus;
this.wasActive = false;
this.handTool = new GrabToPan({
element: this.container,
onActiveChanged: function (isActive) {
this.eventBus.dispatch('handtoolchanged', { isActive: isActive });
}.bind(this)
});
this.eventBus.on('togglehandtool', this.toggle.bind(this));
this.eventBus.on('localized', function (e) {
Preferences.get('enableHandToolOnLoad').then(function resolved(value) {
if (value) {
this.handTool.activate();
}
}.bind(this), function rejected(reason) {
});
}.bind(this));
this.eventBus.on('presentationmodechanged', function (e) {
if (e.switchInProgress) {
return;
}
if (e.active) {
this.enterPresentationMode();
} else {
this.exitPresentationMode();
}
}.bind(this));
}
HandTool.prototype = {
get isActive() {
return !!this.handTool.active;
},
toggle: function HandTool_toggle() {
this.handTool.toggle();
},
enterPresentationMode: function HandTool_enterPresentationMode() {
if (this.isActive) {
this.wasActive = true;
this.handTool.deactivate();
}
},
exitPresentationMode: function HandTool_exitPresentationMode() {
if (this.wasActive) {
this.wasActive = false;
this.handTool.activate();
}
}
};
return HandTool;
}();
exports.HandTool = HandTool;
}));
(function (root, factory) {
factory(root.pdfjsWebPDFAttachmentViewer = {}, root.pdfjsWebPDFJS);
}(this, function (exports, pdfjsLib) {
@ -1552,6 +1492,68 @@ var pdfjsWebLibs;
exports.attachDOMEventsToEventBus = attachDOMEventsToEventBus;
exports.getGlobalEventBus = getGlobalEventBus;
}));
(function (root, factory) {
factory(root.pdfjsWebHandTool = {}, root.pdfjsWebGrabToPan, root.pdfjsWebPreferences, root.pdfjsWebUIUtils);
}(this, function (exports, grabToPan, preferences, uiUtils) {
var GrabToPan = grabToPan.GrabToPan;
var Preferences = preferences.Preferences;
var localized = uiUtils.localized;
var HandTool = function HandToolClosure() {
function HandTool(options) {
this.container = options.container;
this.eventBus = options.eventBus;
this.wasActive = false;
this.handTool = new GrabToPan({
element: this.container,
onActiveChanged: function (isActive) {
this.eventBus.dispatch('handtoolchanged', { isActive: isActive });
}.bind(this)
});
this.eventBus.on('togglehandtool', this.toggle.bind(this));
Promise.all([
localized,
Preferences.get('enableHandToolOnLoad')
]).then(function resolved(values) {
if (values[1] === true) {
this.handTool.activate();
}
}.bind(this)).catch(function rejected(reason) {
});
this.eventBus.on('presentationmodechanged', function (e) {
if (e.switchInProgress) {
return;
}
if (e.active) {
this.enterPresentationMode();
} else {
this.exitPresentationMode();
}
}.bind(this));
}
HandTool.prototype = {
get isActive() {
return !!this.handTool.active;
},
toggle: function HandTool_toggle() {
this.handTool.toggle();
},
enterPresentationMode: function HandTool_enterPresentationMode() {
if (this.isActive) {
this.wasActive = true;
this.handTool.deactivate();
}
},
exitPresentationMode: function HandTool_exitPresentationMode() {
if (this.wasActive) {
this.wasActive = false;
this.handTool.activate();
}
}
};
return HandTool;
}();
exports.HandTool = HandTool;
}));
(function (root, factory) {
factory(root.pdfjsWebPasswordPrompt = {}, root.pdfjsWebUIUtils, root.pdfjsWebOverlayManager, root.pdfjsWebPDFJS);
}(this, function (exports, uiUtils, overlayManager, pdfjsLib) {
@ -2837,7 +2839,7 @@ var pdfjsWebLibs;
toggleHandToolButton.title = mozL10n.get('hand_tool_enable.title', null, 'Enable hand tool');
toggleHandToolButton.firstElementChild.textContent = mozL10n.get('hand_tool_enable_label', null, 'Enable hand tool');
}
}.bind(this));
});
},
open: function SecondaryToolbar_open() {
if (this.opened) {
@ -5520,133 +5522,59 @@ var pdfjsWebLibs;
eventBus: null,
pageRotation: 0,
isInitialViewSet: false,
preferenceSidebarViewOnLoad: SidebarView.NONE,
preferencePdfBugEnabled: false,
preferenceShowPreviousViewOnLoad: true,
preferenceDefaultZoomValue: '',
preferenceDisablePageLabels: false,
viewerPrefs: {
sidebarViewOnLoad: SidebarView.NONE,
pdfBugEnabled: false,
showPreviousViewOnLoad: true,
defaultZoomValue: '',
disablePageLabels: false,
renderer: 'canvas',
enhanceTextSelection: false,
renderInteractiveForms: false
},
isViewerEmbedded: window.parent !== window,
url: '',
baseUrl: '',
externalServices: DefaultExernalServices,
initialize: function pdfViewInitialize(appConfig) {
configure(pdfjsLib.PDFJS);
this.appConfig = appConfig;
var eventBus = appConfig.eventBus || getGlobalEventBus();
this.eventBus = eventBus;
this.bindEvents();
var pdfRenderingQueue = new PDFRenderingQueue();
pdfRenderingQueue.onIdle = this.cleanup.bind(this);
this.pdfRenderingQueue = pdfRenderingQueue;
var pdfLinkService = new PDFLinkService({ eventBus: eventBus });
this.pdfLinkService = pdfLinkService;
var downloadManager = this.externalServices.createDownloadManager();
this.downloadManager = downloadManager;
var container = appConfig.mainContainer;
var viewer = appConfig.viewerContainer;
this.pdfViewer = new PDFViewer({
container: container,
viewer: viewer,
eventBus: eventBus,
renderingQueue: pdfRenderingQueue,
linkService: pdfLinkService,
downloadManager: downloadManager,
enhanceTextSelection: false,
renderInteractiveForms: false
});
pdfRenderingQueue.setViewer(this.pdfViewer);
pdfLinkService.setViewer(this.pdfViewer);
var thumbnailContainer = appConfig.sidebar.thumbnailView;
this.pdfThumbnailViewer = new PDFThumbnailViewer({
container: thumbnailContainer,
renderingQueue: pdfRenderingQueue,
linkService: pdfLinkService
});
pdfRenderingQueue.setThumbnailViewer(this.pdfThumbnailViewer);
Preferences.initialize();
this.preferences = Preferences;
this.pdfHistory = new PDFHistory({
linkService: pdfLinkService,
eventBus: this.eventBus
});
pdfLinkService.setHistory(this.pdfHistory);
this.findController = new PDFFindController({ pdfViewer: this.pdfViewer });
this.findController.onUpdateResultsCount = function (matchCount) {
if (this.supportsIntegratedFind) {
return;
}
this.findBar.updateResultsCount(matchCount);
}.bind(this);
this.findController.onUpdateState = function (state, previous, matchCount) {
if (this.supportsIntegratedFind) {
this.externalServices.updateFindControlState({
result: state,
findPrevious: previous
});
} else {
this.findBar.updateUIState(state, previous, matchCount);
}
}.bind(this);
this.pdfViewer.setFindController(this.findController);
var findBarConfig = Object.create(appConfig.findBar);
findBarConfig.findController = this.findController;
findBarConfig.eventBus = this.eventBus;
this.findBar = new PDFFindBar(findBarConfig);
this.overlayManager = OverlayManager;
this.handTool = new HandTool({
container: container,
eventBus: this.eventBus
});
this.pdfDocumentProperties = new PDFDocumentProperties(appConfig.documentProperties);
this.toolbar = new Toolbar(appConfig.toolbar, container, eventBus);
this.secondaryToolbar = new SecondaryToolbar(appConfig.secondaryToolbar, container, eventBus);
if (this.supportsFullscreen) {
this.pdfPresentationMode = new PDFPresentationMode({
container: container,
viewer: viewer,
pdfViewer: this.pdfViewer,
eventBus: this.eventBus,
contextMenuItems: appConfig.fullscreen
});
}
this.passwordPrompt = new PasswordPrompt(appConfig.passwordOverlay);
this.pdfOutlineViewer = new PDFOutlineViewer({
container: appConfig.sidebar.outlineView,
eventBus: this.eventBus,
linkService: pdfLinkService
});
this.pdfAttachmentViewer = new PDFAttachmentViewer({
container: appConfig.sidebar.attachmentsView,
eventBus: this.eventBus,
downloadManager: downloadManager
});
var sidebarConfig = Object.create(appConfig.sidebar);
sidebarConfig.pdfViewer = this.pdfViewer;
sidebarConfig.pdfThumbnailViewer = this.pdfThumbnailViewer;
sidebarConfig.pdfOutlineViewer = this.pdfOutlineViewer;
sidebarConfig.eventBus = this.eventBus;
this.pdfSidebar = new PDFSidebar(sidebarConfig);
this.pdfSidebar.onToggled = this.forceRendering.bind(this);
var self = this;
var PDFJS = pdfjsLib.PDFJS;
var initializedPromise = Promise.all([
Preferences.initialize();
this.preferences = Preferences;
configure(PDFJS);
this.appConfig = appConfig;
return this._readPreferences().then(function () {
return self._initializeViewerComponents();
}).then(function () {
self.bindEvents();
self.bindWindowEvents();
if (self.isViewerEmbedded && !PDFJS.isExternalLinkTargetSet()) {
PDFJS.externalLinkTarget = PDFJS.LinkTarget.TOP;
}
self.initialized = true;
});
},
_readPreferences: function () {
var self = this;
var PDFJS = pdfjsLib.PDFJS;
return Promise.all([
Preferences.get('enableWebGL').then(function resolved(value) {
PDFJS.disableWebGL = !value;
}),
Preferences.get('sidebarViewOnLoad').then(function resolved(value) {
self.preferenceSidebarViewOnLoad = value;
self.viewerPrefs['sidebarViewOnLoad'] = value;
}),
Preferences.get('pdfBugEnabled').then(function resolved(value) {
self.preferencePdfBugEnabled = value;
self.viewerPrefs['pdfBugEnabled'] = value;
}),
Preferences.get('showPreviousViewOnLoad').then(function resolved(value) {
self.preferenceShowPreviousViewOnLoad = value;
self.viewerPrefs['showPreviousViewOnLoad'] = value;
}),
Preferences.get('defaultZoomValue').then(function resolved(value) {
self.preferenceDefaultZoomValue = value;
self.viewerPrefs['defaultZoomValue'] = value;
}),
Preferences.get('enhanceTextSelection').then(function resolved(value) {
self.pdfViewer.enhanceTextSelection = value;
self.viewerPrefs['enhanceTextSelection'] = value;
}),
Preferences.get('disableTextLayer').then(function resolved(value) {
if (PDFJS.disableTextLayer === true) {
@ -5685,21 +5613,115 @@ var pdfjsWebLibs;
PDFJS.externalLinkTarget = value;
}),
Preferences.get('renderer').then(function resolved(value) {
self.pdfViewer.renderer = value;
self.viewerPrefs['renderer'] = value;
}),
Preferences.get('renderInteractiveForms').then(function resolved(value) {
self.pdfViewer.renderInteractiveForms = value;
self.viewerPrefs['renderInteractiveForms'] = value;
}),
Preferences.get('disablePageLabels').then(function resolved(value) {
self.preferenceDisablePageLabels = value;
self.viewerPrefs['disablePageLabels'] = value;
})
]).catch(function (reason) {
});
return initializedPromise.then(function () {
if (self.isViewerEmbedded && !PDFJS.isExternalLinkTargetSet()) {
PDFJS.externalLinkTarget = PDFJS.LinkTarget.TOP;
},
_initializeViewerComponents: function () {
var self = this;
var appConfig = this.appConfig;
return new Promise(function (resolve, reject) {
var eventBus = appConfig.eventBus || getGlobalEventBus();
self.eventBus = eventBus;
var pdfRenderingQueue = new PDFRenderingQueue();
pdfRenderingQueue.onIdle = self.cleanup.bind(self);
self.pdfRenderingQueue = pdfRenderingQueue;
var pdfLinkService = new PDFLinkService({ eventBus: eventBus });
self.pdfLinkService = pdfLinkService;
var downloadManager = self.externalServices.createDownloadManager();
self.downloadManager = downloadManager;
var container = appConfig.mainContainer;
var viewer = appConfig.viewerContainer;
self.pdfViewer = new PDFViewer({
container: container,
viewer: viewer,
eventBus: eventBus,
renderingQueue: pdfRenderingQueue,
linkService: pdfLinkService,
downloadManager: downloadManager,
renderer: self.viewerPrefs['renderer'],
enhanceTextSelection: self.viewerPrefs['enhanceTextSelection'],
renderInteractiveForms: self.viewerPrefs['renderInteractiveForms']
});
pdfRenderingQueue.setViewer(self.pdfViewer);
pdfLinkService.setViewer(self.pdfViewer);
var thumbnailContainer = appConfig.sidebar.thumbnailView;
self.pdfThumbnailViewer = new PDFThumbnailViewer({
container: thumbnailContainer,
renderingQueue: pdfRenderingQueue,
linkService: pdfLinkService
});
pdfRenderingQueue.setThumbnailViewer(self.pdfThumbnailViewer);
self.pdfHistory = new PDFHistory({
linkService: pdfLinkService,
eventBus: eventBus
});
pdfLinkService.setHistory(self.pdfHistory);
self.findController = new PDFFindController({ pdfViewer: self.pdfViewer });
self.findController.onUpdateResultsCount = function (matchCount) {
if (self.supportsIntegratedFind) {
return;
}
self.findBar.updateResultsCount(matchCount);
};
self.findController.onUpdateState = function (state, previous, matchCount) {
if (self.supportsIntegratedFind) {
self.externalServices.updateFindControlState({
result: state,
findPrevious: previous
});
} else {
self.findBar.updateUIState(state, previous, matchCount);
}
};
self.pdfViewer.setFindController(self.findController);
var findBarConfig = Object.create(appConfig.findBar);
findBarConfig.findController = self.findController;
findBarConfig.eventBus = eventBus;
self.findBar = new PDFFindBar(findBarConfig);
self.overlayManager = OverlayManager;
self.handTool = new HandTool({
container: container,
eventBus: eventBus
});
self.pdfDocumentProperties = new PDFDocumentProperties(appConfig.documentProperties);
self.toolbar = new Toolbar(appConfig.toolbar, container, eventBus);
self.secondaryToolbar = new SecondaryToolbar(appConfig.secondaryToolbar, container, eventBus);
if (self.supportsFullscreen) {
self.pdfPresentationMode = new PDFPresentationMode({
container: container,
viewer: viewer,
pdfViewer: self.pdfViewer,
eventBus: eventBus,
contextMenuItems: appConfig.fullscreen
});
}
self.initialized = true;
self.passwordPrompt = new PasswordPrompt(appConfig.passwordOverlay);
self.pdfOutlineViewer = new PDFOutlineViewer({
container: appConfig.sidebar.outlineView,
eventBus: eventBus,
linkService: pdfLinkService
});
self.pdfAttachmentViewer = new PDFAttachmentViewer({
container: appConfig.sidebar.attachmentsView,
eventBus: eventBus,
downloadManager: downloadManager
});
var sidebarConfig = Object.create(appConfig.sidebar);
sidebarConfig.pdfViewer = self.pdfViewer;
sidebarConfig.pdfThumbnailViewer = self.pdfThumbnailViewer;
sidebarConfig.pdfOutlineViewer = self.pdfOutlineViewer;
sidebarConfig.eventBus = eventBus;
self.pdfSidebar = new PDFSidebar(sidebarConfig);
self.pdfSidebar.onToggled = self.forceRendering.bind(self);
resolve(undefined);
});
},
run: function pdfViewRun(config) {
@ -6002,7 +6024,7 @@ var pdfjsWebLibs;
});
self.loadingBar.setWidth(self.appConfig.viewerContainer);
if (!pdfjsLib.PDFJS.disableHistory && !self.isViewerEmbedded) {
if (!self.preferenceShowPreviousViewOnLoad) {
if (!self.viewerPrefs['showPreviousViewOnLoad']) {
self.pdfHistory.clearHistoryState();
}
self.pdfHistory.initialize(self.documentFingerprint);
@ -6019,15 +6041,15 @@ var pdfjsWebLibs;
};
store.initializedPromise.then(function resolved() {
var storedHash = null, sidebarView = null;
if (self.preferenceShowPreviousViewOnLoad && store.get('exists', false)) {
if (self.viewerPrefs['showPreviousViewOnLoad'] && store.get('exists', false)) {
var pageNum = store.get('page', '1');
var zoom = self.preferenceDefaultZoomValue || store.get('zoom', DEFAULT_SCALE_VALUE);
var zoom = self.viewerPrefs['defaultZoomValue'] || store.get('zoom', DEFAULT_SCALE_VALUE);
var left = store.get('scrollLeft', '0');
var top = store.get('scrollTop', '0');
storedHash = 'page=' + pageNum + '&zoom=' + zoom + ',' + left + ',' + top;
sidebarView = store.get('sidebarView', SidebarView.NONE);
} else if (self.preferenceDefaultZoomValue) {
storedHash = 'page=1&zoom=' + self.preferenceDefaultZoomValue;
} else if (self.viewerPrefs['defaultZoomValue']) {
storedHash = 'page=1&zoom=' + self.viewerPrefs['defaultZoomValue'];
}
self.setInitialView(storedHash, {
scale: scale,
@ -6055,7 +6077,7 @@ var pdfjsWebLibs;
});
});
pdfDocument.getPageLabels().then(function (labels) {
if (!labels || self.preferenceDisablePageLabels) {
if (!labels || self.viewerPrefs['disablePageLabels']) {
return;
}
var i = 0, numLabels = labels.length;
@ -6177,7 +6199,7 @@ var pdfjsWebLibs;
var scale = options && options.scale;
var sidebarView = options && options.sidebarView;
this.isInitialViewSet = true;
this.pdfSidebar.setInitialView(this.preferenceSidebarViewOnLoad || sidebarView | 0);
this.pdfSidebar.setInitialView(this.viewerPrefs['sidebarViewOnLoad'] || sidebarView | 0);
if (this.initialDestination) {
this.pdfLinkService.navigateTo(this.initialDestination);
this.initialDestination = null;
@ -6297,6 +6319,24 @@ var pdfjsWebLibs;
eventBus.on('documentproperties', webViewerDocumentProperties);
eventBus.on('find', webViewerFind);
eventBus.on('findfromurlhash', webViewerFindFromUrlHash);
},
bindWindowEvents: function pdfViewBindWindowEvents() {
var eventBus = this.eventBus;
window.addEventListener('wheel', webViewerWheel);
window.addEventListener('click', webViewerClick);
window.addEventListener('keydown', webViewerKeyDown);
window.addEventListener('resize', function windowResize() {
eventBus.dispatch('resize');
});
window.addEventListener('hashchange', function windowHashChange() {
eventBus.dispatch('hashchange', { hash: document.location.hash.substring(1) });
});
window.addEventListener('beforeprint', function windowBeforePrint() {
eventBus.dispatch('beforeprint');
});
window.addEventListener('afterprint', function windowAfterPrint() {
eventBus.dispatch('afterprint');
});
}
};
var validateFileURL;
@ -6324,7 +6364,7 @@ var pdfjsWebLibs;
appConfig.toolbar.openFile.setAttribute('hidden', 'true');
appConfig.secondaryToolbar.openFileButton.setAttribute('hidden', 'true');
var PDFJS = pdfjsLib.PDFJS;
if (PDFViewerApplication.preferencePdfBugEnabled) {
if (PDFViewerApplication.viewerPrefs['pdfBugEnabled']) {
var hash = document.location.hash.substring(1);
var hashParams = parseQueryString(hash);
if ('disableworker' in hashParams) {
@ -6446,9 +6486,6 @@ var pdfjsWebLibs;
}
}
function webViewerPageMode(e) {
if (!PDFViewerApplication.initialized) {
return;
}
var mode = e.mode, view;
switch (mode) {
case 'thumbs':
@ -6471,9 +6508,6 @@ var pdfjsWebLibs;
PDFViewerApplication.pdfSidebar.switchView(view, true);
}
function webViewerNamedAction(e) {
if (!PDFViewerApplication.initialized) {
return;
}
var action = e.action;
switch (action) {
case 'GoToPage':
@ -6492,9 +6526,6 @@ var pdfjsWebLibs;
PDFViewerApplication.pdfViewer.presentationModeState = switchInProgress ? PresentationModeState.CHANGING : active ? PresentationModeState.FULLSCREEN : PresentationModeState.NORMAL;
}
function webViewerSidebarViewChanged(e) {
if (!PDFViewerApplication.initialized) {
return;
}
PDFViewerApplication.pdfRenderingQueue.isThumbnailViewEnabled = PDFViewerApplication.pdfSidebar.isThumbnailViewVisible;
var store = PDFViewerApplication.store;
if (!store || !PDFViewerApplication.isInitialViewSet) {
@ -6506,9 +6537,6 @@ var pdfjsWebLibs;
});
}
function webViewerUpdateViewarea(e) {
if (!PDFViewerApplication.initialized) {
return;
}
var location = e.location, store = PDFViewerApplication.store;
if (store) {
store.initializedPromise.then(function () {
@ -6530,27 +6558,15 @@ var pdfjsWebLibs;
var loading = currentPage.renderingState !== RenderingStates.FINISHED;
PDFViewerApplication.toolbar.updateLoadingIndicatorState(loading);
}
window.addEventListener('resize', function webViewerResize(evt) {
if (!PDFViewerApplication.eventBus) {
return;
}
PDFViewerApplication.eventBus.dispatch('resize');
});
function webViewerResize() {
if (PDFViewerApplication.initialized) {
var currentScaleValue = PDFViewerApplication.pdfViewer.currentScaleValue;
if (currentScaleValue === 'auto' || currentScaleValue === 'page-fit' || currentScaleValue === 'page-width') {
PDFViewerApplication.pdfViewer.currentScaleValue = currentScaleValue;
} else if (!currentScaleValue) {
PDFViewerApplication.pdfViewer.currentScaleValue = DEFAULT_SCALE_VALUE;
}
PDFViewerApplication.pdfViewer.update();
var currentScaleValue = PDFViewerApplication.pdfViewer.currentScaleValue;
if (currentScaleValue === 'auto' || currentScaleValue === 'page-fit' || currentScaleValue === 'page-width') {
PDFViewerApplication.pdfViewer.currentScaleValue = currentScaleValue;
} else if (!currentScaleValue) {
PDFViewerApplication.pdfViewer.currentScaleValue = DEFAULT_SCALE_VALUE;
}
PDFViewerApplication.pdfViewer.update();
}
window.addEventListener('hashchange', function webViewerHashchange(evt) {
var hash = document.location.hash.substring(1);
PDFViewerApplication.eventBus.dispatch('hashchange', { hash: hash });
});
function webViewerHashchange(e) {
if (PDFViewerApplication.pdfHistory.isHashChangeUnlocked) {
var hash = e.hash;
@ -6565,10 +6581,6 @@ var pdfjsWebLibs;
}
}
var webViewerFileInputChange;
function webViewerLocalized() {
document.getElementsByTagName('html')[0].dir = mozL10n.getDirection();
PDFViewerApplication.eventBus.dispatch('localized');
}
function webViewerPresentationMode() {
PDFViewerApplication.requestPresentationMode();
}
@ -6643,9 +6655,6 @@ var pdfjsWebLibs;
}
function webViewerScaleChanging(e) {
PDFViewerApplication.toolbar.setPageScale(e.presetValue, e.scale);
if (!PDFViewerApplication.initialized) {
return;
}
PDFViewerApplication.pdfViewer.update();
}
function webViewerPageChanging(e) {
@ -6663,9 +6672,9 @@ var pdfjsWebLibs;
}
}
var zoomDisabled = false, zoomDisabledTimeout;
function handleMouseWheel(evt) {
function webViewerWheel(evt) {
var pdfViewer = PDFViewerApplication.pdfViewer;
if (!pdfViewer || pdfViewer.isInPresentationMode) {
if (pdfViewer.isInPresentationMode) {
return;
}
if (evt.ctrlKey || evt.metaKey) {
@ -6703,8 +6712,7 @@ var pdfjsWebLibs;
}, 1000);
}
}
window.addEventListener('wheel', handleMouseWheel);
window.addEventListener('click', function click(evt) {
function webViewerClick(evt) {
if (!PDFViewerApplication.secondaryToolbar.isOpen) {
return;
}
@ -6712,8 +6720,8 @@ var pdfjsWebLibs;
if (PDFViewerApplication.pdfViewer.containsElement(evt.target) || appConfig.toolbar.container.contains(evt.target) && evt.target !== appConfig.secondaryToolbar.toggleButton) {
PDFViewerApplication.secondaryToolbar.close();
}
}, true);
window.addEventListener('keydown', function keydown(evt) {
}
function webViewerKeyDown(evt) {
if (OverlayManager.active) {
return;
}
@ -6925,14 +6933,10 @@ var pdfjsWebLibs;
if (handled) {
evt.preventDefault();
}
}
localized.then(function webViewerLocalized() {
document.getElementsByTagName('html')[0].dir = mozL10n.getDirection();
});
window.addEventListener('beforeprint', function beforePrint(evt) {
PDFViewerApplication.eventBus.dispatch('beforeprint');
});
window.addEventListener('afterprint', function afterPrint(evt) {
PDFViewerApplication.eventBus.dispatch('afterprint');
});
localized.then(webViewerLocalized);
var PDFPrintServiceFactory = {
instance: {
supportsPrinting: false,
@ -7137,7 +7141,7 @@ var pdfjsWebLibs;
highlightAll: !!evt.detail.highlightAll,
findPrevious: !!evt.detail.findPrevious
});
}.bind(this);
};
for (var i = 0, len = events.length; i < len; i++) {
window.addEventListener(events[i], handleEvent);
}

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

@ -58,7 +58,9 @@
<!ENTITY offlineStorage2.label "Offline Web Content and User Data">
<!-- Site Data section manages sites using Storage API and is under Network -->
<!ENTITY siteData.label "Site Data">
<!ENTITY siteData.label "Site Data">
<!ENTITY clearSiteData.label "Clear All Data">
<!ENTITY clearSiteData.accesskey "l">
<!-- LOCALIZATION NOTE:
The entities limitCacheSizeBefore.label and limitCacheSizeAfter.label appear on a single

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

@ -170,6 +170,9 @@ actualAppCacheSize=Your application cache is currently using %1$S %2$S of disk s
# %1$S = size
# %2$S = unit (MB, KB, etc.)
totalSiteDataSize=Your stored site data is currently using %1$S %2$S of disk space
clearSiteDataPromptTitle=Clear all cookies and site data
clearSiteDataPromptText=Selecting Clear Now will clear all cookies and site data stored by Firefox. This may sign you out of websites and remove offline web content.
clearSiteDataNow=Clear Now
syncUnlink.title=Do you want to unlink your device?
syncUnlink.label=This device will no longer be associated with your Sync account. All of your personal data, both on this device and in your Sync account, will remain intact.

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

@ -40,7 +40,23 @@
/* Insecure field warning */
#PopupAutoComplete > richlistbox > richlistitem[originaltype="insecureWarning"] {
background-color: #F6F6F6; /* Bug 1319176 */
background-color: var(--arrowpanel-dimmed);
border-bottom: 1px solid var(--panel-separator-color);
padding-bottom: 4px;
padding-top: 4px;
}
#PopupAutoComplete > richlistbox > richlistitem[originaltype="insecureWarning"][selected] {
background-color: var(--arrowpanel-dimmed-further);
}
#PopupAutoComplete > richlistbox > richlistitem[originaltype="insecureWarning"] > .ac-title {
color: GrayText;
font-size: 1em;
}
#PopupAutoComplete > richlistbox > richlistitem[originaltype="insecureWarning"][selected] > .ac-title {
color: inherit;
}
#PopupAutoComplete > richlistbox > richlistitem[originaltype="insecureWarning"] > .ac-site-icon {

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

@ -4,7 +4,7 @@
# 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/.
option('--enable-rust', help='Include Rust language sources')
option('--disable-rust', help='Don\'t include Rust language sources')
@depends('--enable-rust')
def rust_compiler_names(value):

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

@ -972,4 +972,3 @@ def is_windows(target):
return target.kernel == 'WINNT'
include('windows.configure', when=is_windows)
include('rust.configure')

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

@ -24,3 +24,4 @@ MOZ_REQUIRE_SIGNING=${MOZ_REQUIRE_SIGNING-0}
ac_add_options --enable-js-shell
. "$topsrcdir/build/mozconfig.automation"
. "$topsrcdir/build/mozconfig.rust"

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

@ -1,10 +1,5 @@
# Options to enable rust in automation builds.
# Tell configure to use the tooltool rustc.
# Assume this is compiled with --enable-rpath so we don't
# have to set LD_LIBRARY_PATH.
RUSTC="$topsrcdir/rustc/bin/rustc"
CARGO="$topsrcdir/rustc/bin/cargo"
# Enable rust in the build.
ac_add_options --enable-rust

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

@ -20,7 +20,6 @@ const {scrollIntoViewIfNeeded} = require("devtools/client/shared/scroll");
const {UndoStack} = require("devtools/client/shared/undo");
const {HTMLTooltip} = require("devtools/client/shared/widgets/tooltip/HTMLTooltip");
const {PrefObserver} = require("devtools/client/shared/prefs");
const HTMLEditor = require("devtools/client/inspector/markup/views/html-editor");
const MarkupElementContainer = require("devtools/client/inspector/markup/views/element-container");
const MarkupReadOnlyContainer = require("devtools/client/inspector/markup/views/read-only-container");
const MarkupTextContainer = require("devtools/client/inspector/markup/views/text-container");
@ -71,7 +70,6 @@ function MarkupView(inspector, frame, controllerWindow) {
this.win = this._frame.contentWindow;
this.doc = this._frame.contentDocument;
this._elt = this.doc.querySelector("#root");
this.htmlEditor = new HTMLEditor(this.doc);
try {
this.maxChildren = Services.prefs.getIntPref("devtools.markup.pagesize");
@ -569,7 +567,9 @@ MarkupView.prototype = {
_onNewSelection: function () {
let selection = this.inspector.selection;
this.htmlEditor.hide();
if (this.htmlEditor) {
this.htmlEditor.hide();
}
if (this._hoveredNode && this._hoveredNode !== selection.nodeFront) {
this.getContainer(this._hoveredNode).hovered = false;
this._hoveredNode = null;
@ -1044,7 +1044,9 @@ MarkupView.prototype = {
// Since the htmlEditor is absolutely positioned, a mutation may change
// the location in which it should be shown.
this.htmlEditor.refresh();
if (this.htmlEditor) {
this.htmlEditor.refresh();
}
});
},
@ -1414,6 +1416,11 @@ MarkupView.prototype = {
if (!container) {
return;
}
// Load load and create HTML Editor as it is rarely used and fetch complex deps
if (!this.htmlEditor) {
let HTMLEditor = require("devtools/client/inspector/markup/views/html-editor");
this.htmlEditor = new HTMLEditor(this.doc);
}
this.htmlEditor.show(container.tagLine, oldValue);
this.htmlEditor.once("popuphidden", (e, commit, value) => {
// Need to focus the <html> element instead of the frame / window
@ -1424,6 +1431,8 @@ MarkupView.prototype = {
this.updateNodeOuterHTML(node, value, oldValue);
}
});
this.emit("begin-editing");
});
},
@ -1724,8 +1733,10 @@ MarkupView.prototype = {
this._hoveredNode = null;
this.htmlEditor.destroy();
this.htmlEditor = null;
if (this.htmlEditor) {
this.htmlEditor.destroy();
this.htmlEditor = null;
}
this.undo.destroy();
this.undo = null;

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

@ -47,9 +47,9 @@ add_task(function* () {
function* testEscapeCancels(inspector, testActor) {
yield selectNode(SELECTOR, inspector);
let onEditorShown = once(inspector.markup.htmlEditor, "popupshown");
let onHtmlEditorCreated = once(inspector.markup, "begin-editing");
EventUtils.sendKey("F2", inspector.markup._frame.contentWindow);
yield onEditorShown;
yield onHtmlEditorCreated;
ok(inspector.markup.htmlEditor._visible, "HTML Editor is visible");
is((yield testActor.getProperty(SELECTOR, "outerHTML")), OLD_HTML,

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

@ -211,10 +211,12 @@ MarkupContainer.prototype = {
}
if (this.showExpander) {
this.elt.classList.add("expandable");
this.expander.style.visibility = "visible";
// Update accessibility expanded state.
this.tagLine.setAttribute("aria-expanded", this.expanded);
} else {
this.elt.classList.remove("expandable");
this.expander.style.visibility = "hidden";
// No need for accessible expanded state indicator when expander is not
// shown.

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

@ -31,7 +31,7 @@ function FilterButtons({
return div({ id: "requests-menu-filter-buttons" }, buttons);
}
FilterButtons.PropTypes = {
FilterButtons.propTypes = {
state: PropTypes.object.isRequired,
triggerFilterType: PropTypes.func.iRequired,
};

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

@ -24,12 +24,13 @@ const {
getFormDataSections,
getUrlBaseName,
getUrlQuery,
getUrlHost,
parseQueryString,
} = require("./request-utils");
const { createFactory } = require("devtools/client/shared/vendor/react");
const ReactDOM = require("devtools/client/shared/vendor/react-dom");
const Provider = createFactory(require("devtools/client/shared/vendor/react-redux").Provider);
const PreviewPanel = createFactory(require("./shared/components/preview-panel"));
const SecurityPanel = createFactory(require("./shared/components/security-panel"));
const TimingsPanel = createFactory(require("./shared/components/timings-panel"));
// 100 KB in bytes
@ -93,6 +94,20 @@ DetailsView.prototype = {
initialize: function (store) {
dumpn("Initializing the DetailsView");
this._previewPanelNode = $("#react-preview-tabpanel-hook");
ReactDOM.render(Provider(
{ store },
PreviewPanel()
), this._previewPanelNode);
this._securityPanelNode = $("#react-security-tabpanel-hook");
ReactDOM.render(Provider(
{ store },
SecurityPanel()
), this._securityPanelNode);
this._timingsPanelNode = $("#react-timings-tabpanel-hook");
ReactDOM.render(Provider(
@ -145,6 +160,8 @@ DetailsView.prototype = {
*/
destroy: function () {
dumpn("Destroying the DetailsView");
ReactDOM.unmountComponentAtNode(this._previewPanelNode);
ReactDOM.unmountComponentAtNode(this._securityPanelNode);
ReactDOM.unmountComponentAtNode(this._timingsPanelNode);
this.sidebar.destroy();
$("tabpanels", this.widget).removeEventListener("select",
@ -255,14 +272,6 @@ DetailsView.prototype = {
case 3:
yield view._setResponseBody(src.url, src.responseContent);
break;
// "Security"
case 5:
yield view._setSecurityInfo(src.securityInfo, src.url);
break;
// "Preview"
case 6:
yield view._setHtmlPreview(src.responseContent);
break;
}
viewState.updating[tab] = false;
}).then(() => {
@ -693,136 +702,6 @@ DetailsView.prototype = {
window.emit(EVENTS.RESPONSE_BODY_DISPLAYED);
}),
/**
* Sets the preview for HTML responses shown in this view.
*
* @param object response
* The message received from the server.
* @return object
* A promise that is resolved when the html preview is rendered.
*/
_setHtmlPreview: Task.async(function* (response) {
if (!response) {
return promise.resolve();
}
let { text } = response.content;
let responseBody = yield gNetwork.getString(text);
// Always disable JS when previewing HTML responses.
let iframe = $("#response-preview");
iframe.contentDocument.docShell.allowJavascript = false;
iframe.contentDocument.documentElement.innerHTML = responseBody;
window.emit(EVENTS.RESPONSE_HTML_PREVIEW_DISPLAYED);
return undefined;
}),
/**
* Sets the security information shown in this view.
*
* @param object securityInfo
* The data received from server
* @param string url
* The URL of this request
* @return object
* A promise that is resolved when the security info is rendered.
*/
_setSecurityInfo: Task.async(function* (securityInfo, url) {
if (!securityInfo) {
// We don't have security info. This could mean one of two things:
// 1) This connection is not secure and this tab is not visible and thus
// we shouldn't be here.
// 2) We have already received securityState and the tab is visible BUT
// the rest of the information is still on its way. Once it arrives
// this method is called again.
return;
}
/**
* A helper that sets value and tooltiptext attributes of an element to
* specified value.
*
* @param string selector
* A selector for the element.
* @param string value
* The value to set. If this evaluates to false a placeholder string
* <Not Available> is used instead.
*/
function setValue(selector, value) {
let label = $(selector);
if (!value) {
label.setAttribute("value", L10N.getStr(
"netmonitor.security.notAvailable"));
label.setAttribute("tooltiptext", label.getAttribute("value"));
} else {
label.setAttribute("value", value);
label.setAttribute("tooltiptext", value);
}
}
let errorbox = $("#security-error");
let infobox = $("#security-information");
if (securityInfo.state === "secure" || securityInfo.state === "weak") {
infobox.hidden = false;
errorbox.hidden = true;
// Warning icons
let cipher = $("#security-warning-cipher");
if (securityInfo.state === "weak") {
cipher.hidden = securityInfo.weaknessReasons.indexOf("cipher") === -1;
} else {
cipher.hidden = true;
}
let enabledLabel = L10N.getStr("netmonitor.security.enabled");
let disabledLabel = L10N.getStr("netmonitor.security.disabled");
// Connection parameters
setValue("#security-protocol-version-value",
securityInfo.protocolVersion);
setValue("#security-ciphersuite-value", securityInfo.cipherSuite);
// Host header
let domain = getUrlHost(url);
let hostHeader = L10N.getFormatStr("netmonitor.security.hostHeader",
domain);
setValue("#security-info-host-header", hostHeader);
// Parameters related to the domain
setValue("#security-http-strict-transport-security-value",
securityInfo.hsts ? enabledLabel : disabledLabel);
setValue("#security-public-key-pinning-value",
securityInfo.hpkp ? enabledLabel : disabledLabel);
// Certificate parameters
let cert = securityInfo.cert;
setValue("#security-cert-subject-cn", cert.subject.commonName);
setValue("#security-cert-subject-o", cert.subject.organization);
setValue("#security-cert-subject-ou", cert.subject.organizationalUnit);
setValue("#security-cert-issuer-cn", cert.issuer.commonName);
setValue("#security-cert-issuer-o", cert.issuer.organization);
setValue("#security-cert-issuer-ou", cert.issuer.organizationalUnit);
setValue("#security-cert-validity-begins", cert.validity.start);
setValue("#security-cert-validity-expires", cert.validity.end);
setValue("#security-cert-sha1-fingerprint", cert.fingerprint.sha1);
setValue("#security-cert-sha256-fingerprint", cert.fingerprint.sha256);
} else {
infobox.hidden = true;
errorbox.hidden = false;
// Strip any HTML from the message.
let plain = new DOMParser().parseFromString(securityInfo.errorMessage,
"text/html");
setValue("#security-error-message", plain.body.textContent);
}
}),
_dataSrc: null,
_headers: null,
_cookies: null,

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