mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge MC -> JM.
--HG-- rename : dom/src/threads/Makefile.in => dom/workers/Makefile.in rename : dom/src/threads/test/Makefile.in => dom/workers/test/Makefile.in rename : dom/src/threads/test/WorkerTest.jsm => dom/workers/test/WorkerTest.jsm rename : dom/src/threads/test/atob_worker.js => dom/workers/test/atob_worker.js rename : dom/src/threads/test/chromeWorker_subworker.js => dom/workers/test/chromeWorker_subworker.js rename : dom/src/threads/test/chromeWorker_worker.js => dom/workers/test/chromeWorker_worker.js rename : dom/src/threads/test/closeOnGC_worker.js => dom/workers/test/closeOnGC_worker.js rename : dom/src/threads/test/importScripts_worker.js => dom/workers/test/importScripts_worker.js rename : dom/src/threads/test/importScripts_worker_imported1.js => dom/workers/test/importScripts_worker_imported1.js rename : dom/src/threads/test/importScripts_worker_imported2.js => dom/workers/test/importScripts_worker_imported2.js rename : dom/src/threads/test/json_worker.js => dom/workers/test/json_worker.js rename : dom/src/threads/test/recursion_worker.js => dom/workers/test/recursion_worker.js rename : dom/src/threads/test/relativeLoad_sub_worker.js => dom/workers/test/relativeLoad_sub_worker.js rename : dom/src/threads/test/relativeLoad_worker.js => dom/workers/test/relativeLoad_worker.js rename : dom/src/threads/test/simpleThread_worker.js => dom/workers/test/simpleThread_worker.js rename : dom/src/threads/test/terminate_worker.js => dom/workers/test/terminate_worker.js rename : dom/src/threads/test/test_404.html => dom/workers/test/test_404.html rename : dom/src/threads/test/test_chromeWorker.html => dom/workers/test/test_chromeWorker.html rename : dom/src/threads/test/test_chromeWorker.xul => dom/workers/test/test_chromeWorker.xul rename : dom/src/threads/test/test_chromeWorkerJSM.xul => dom/workers/test/test_chromeWorkerJSM.xul rename : dom/src/threads/test/test_close.html => dom/workers/test/test_close.html rename : dom/src/threads/test/test_closeOnGC.html => dom/workers/test/test_closeOnGC.html rename : dom/src/threads/test/test_errorPropagation.html => dom/workers/test/test_errorPropagation.html rename : dom/src/threads/test/test_fibonacci.html => dom/workers/test/test_fibonacci.html rename : dom/src/threads/test/test_importScripts.html => dom/workers/test/test_importScripts.html rename : dom/src/threads/test/test_json.html => dom/workers/test/test_json.html rename : dom/src/threads/test/test_longThread.html => dom/workers/test/test_longThread.html rename : dom/src/threads/test/test_navigator.html => dom/workers/test/test_navigator.html rename : dom/src/threads/test/test_recursion.html => dom/workers/test/test_recursion.html rename : dom/src/threads/test/test_relativeLoad.html => dom/workers/test/test_relativeLoad.html rename : dom/src/threads/test/test_simpleThread.html => dom/workers/test/test_simpleThread.html rename : dom/src/threads/test/test_suspend.html => dom/workers/test/test_suspend.html rename : dom/src/threads/test/test_terminate.html => dom/workers/test/test_terminate.html rename : dom/src/threads/test/test_threadErrors.html => dom/workers/test/test_threadErrors.html rename : dom/src/threads/test/test_threadTimeouts.html => dom/workers/test/test_threadTimeouts.html rename : dom/src/threads/test/test_throwingOnerror.html => dom/workers/test/test_throwingOnerror.html rename : dom/src/threads/test/test_xhr.html => dom/workers/test/test_xhr.html rename : dom/src/threads/test/test_xhrAbort.html => dom/workers/test/test_xhrAbort.html rename : dom/src/threads/test/threadTimeouts_worker.js => dom/workers/test/threadTimeouts_worker.js rename : dom/src/threads/test/xhr_worker.js => dom/workers/test/xhr_worker.js
This commit is contained in:
commit
6c3284f1e8
@ -54,7 +54,7 @@ interface nsIDOMCSSPrimitiveValue;
|
||||
* If the DOM node for this access node is "accessible",
|
||||
* then a QueryInterface to nsIAccessible will succeed.
|
||||
*/
|
||||
[scriptable, uuid(ef16ff42-0256-4b48-ae87-b18a95b7f7d6)]
|
||||
[scriptable, uuid(bbbd5a68-bad2-48c1-ab09-beb6c34f03d9)]
|
||||
interface nsIAccessNode : nsISupports
|
||||
{
|
||||
/**
|
||||
@ -99,12 +99,6 @@ interface nsIAccessNode : nsISupports
|
||||
*/
|
||||
void scrollToPoint(in unsigned long aCoordinateType, in long aX, in long aY);
|
||||
|
||||
/**
|
||||
* The OS window handle for the window this node
|
||||
* is being displayed in.
|
||||
*/
|
||||
[noscript] readonly attribute voidPtr ownerWindow;
|
||||
|
||||
/**
|
||||
* A unique ID calculated for this DOM node, for the
|
||||
* purposes of caching and referencing this object.
|
||||
|
@ -117,7 +117,6 @@ static gint sListener_idx = 1;
|
||||
|
||||
static GHashTable* sKey_listener_list = NULL;
|
||||
static guint sKey_snooper_id = 0;
|
||||
static GQuark sQuark_gecko_acc_obj = g_quark_from_static_string("GeckoAccObj");
|
||||
static bool sToplevel_event_hook_added = false;
|
||||
static gulong sToplevel_show_hook = 0;
|
||||
static gulong sToplevel_hide_hook = 0;
|
||||
@ -570,6 +569,11 @@ toplevel_event_watcher(GSignalInvocationHint* ihint,
|
||||
const GValue* param_values,
|
||||
gpointer data)
|
||||
{
|
||||
static GQuark sQuark_gecko_acc_obj = 0;
|
||||
|
||||
if (!sQuark_gecko_acc_obj)
|
||||
sQuark_gecko_acc_obj = g_quark_from_static_string("GeckoAccObj");
|
||||
|
||||
if (nsAccessibilityService::IsShutdown())
|
||||
return TRUE;
|
||||
|
||||
|
@ -282,6 +282,10 @@ NotificationController::WillRefresh(mozilla::TimeStamp aTime)
|
||||
return;
|
||||
}
|
||||
|
||||
// Process invalidation list of the document after all accessible tree
|
||||
// modification are done.
|
||||
mDocument->ProcessInvalidationList();
|
||||
|
||||
// If a generic notification occurs after this point then we may be allowed to
|
||||
// process it synchronously.
|
||||
mObservingState = eRefreshObserving;
|
||||
|
@ -206,6 +206,19 @@ private:
|
||||
printf("document type: [failed]"); \
|
||||
}
|
||||
|
||||
#define NS_LOG_ACCDOC_DOCSHELLTREE(aDocument) \
|
||||
if (aDocument->IsActive()) { \
|
||||
nsCOMPtr<nsISupports> container = aDocument->GetContainer(); \
|
||||
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(container)); \
|
||||
nsCOMPtr<nsIDocShellTreeItem> parentTreeItem; \
|
||||
treeItem->GetParent(getter_AddRefs(parentTreeItem)); \
|
||||
nsCOMPtr<nsIDocShellTreeItem> rootTreeItem; \
|
||||
treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem)); \
|
||||
printf("docshell hierarchy, parent: %p, root: %p, is tab document: %s;", \
|
||||
parentTreeItem, rootTreeItem, \
|
||||
(nsCoreUtils::IsTabDocument(aDocument) ? "yes" : "no")); \
|
||||
}
|
||||
|
||||
#define NS_LOG_ACCDOC_SHELLSTATE(aDocument) \
|
||||
nsCAutoString docShellBusy; \
|
||||
nsCOMPtr<nsISupports> container = aDocument->GetContainer(); \
|
||||
@ -352,6 +365,8 @@ private:
|
||||
printf("; "); \
|
||||
NS_LOG_ACCDOC_TYPE(aDocument) \
|
||||
printf("\n "); \
|
||||
NS_LOG_ACCDOC_DOCSHELLTREE(aDocument) \
|
||||
printf("\n "); \
|
||||
NS_LOG_ACCDOC_DOCSTATES(aDocument) \
|
||||
printf("\n "); \
|
||||
NS_LOG_ACCDOC_DOCPRESSHELL(aDocument) \
|
||||
|
@ -161,19 +161,6 @@ nsAccessNode::GetUniqueID(void **aUniqueID)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// nsIAccessNode
|
||||
NS_IMETHODIMP
|
||||
nsAccessNode::GetOwnerWindow(void **aWindow)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aWindow);
|
||||
*aWindow = nsnull;
|
||||
|
||||
if (IsDefunct())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
return GetDocAccessible()->GetWindowHandle(aWindow);
|
||||
}
|
||||
|
||||
nsApplicationAccessible*
|
||||
nsAccessNode::GetApplicationAccessible()
|
||||
{
|
||||
|
@ -3110,16 +3110,7 @@ nsAccessible::EnsureChildren()
|
||||
// State is embedded children until text leaf accessible is appended.
|
||||
SetChildrenFlag(eEmbeddedChildren); // Prevent reentry
|
||||
|
||||
// Notify the document about caching status.
|
||||
nsDocAccessible* document = GetDocAccessible();
|
||||
if (document)
|
||||
document->NotifyOfCachingStart(this);
|
||||
|
||||
CacheChildren();
|
||||
|
||||
if (document)
|
||||
document->NotifyOfCachingEnd(this);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -483,14 +483,6 @@ nsApplicationAccessible::ScrollToPoint(PRUint32 aCoordinateType,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsApplicationAccessible::GetOwnerWindow(void **aOwnerWindow)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aOwnerWindow);
|
||||
*aOwnerWindow = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsApplicationAccessible::GetComputedStyleValue(const nsAString &aPseudoElt,
|
||||
const nsAString &aPropertyName,
|
||||
|
@ -76,7 +76,6 @@ public:
|
||||
NS_SCRIPTABLE NS_IMETHOD GetInnerHTML(nsAString& aInnerHTML);
|
||||
NS_SCRIPTABLE NS_IMETHOD ScrollTo(PRUint32 aScrollType);
|
||||
NS_SCRIPTABLE NS_IMETHOD ScrollToPoint(PRUint32 aCoordinateType, PRInt32 aX, PRInt32 aY);
|
||||
NS_IMETHOD GetOwnerWindow(void **aOwnerWindow);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetComputedStyleValue(const nsAString& aPseudoElt,
|
||||
const nsAString& aPropertyName,
|
||||
nsAString& aValue NS_OUTPARAM);
|
||||
|
@ -480,6 +480,26 @@ nsCoreUtils::IsContentDocument(nsIDocument *aDocument)
|
||||
return (contentType == nsIDocShellTreeItem::typeContent);
|
||||
}
|
||||
|
||||
bool
|
||||
nsCoreUtils::IsTabDocument(nsIDocument* aDocumentNode)
|
||||
{
|
||||
nsCOMPtr<nsISupports> container = aDocumentNode->GetContainer();
|
||||
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(container));
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
|
||||
treeItem->GetParent(getter_AddRefs(parentTreeItem));
|
||||
|
||||
// Tab document running in own process doesn't have parent.
|
||||
if (XRE_GetProcessType() == GeckoProcessType_Content)
|
||||
return !parentTreeItem;
|
||||
|
||||
// Parent of docshell for tab document running in chrome process is root.
|
||||
nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
|
||||
treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem));
|
||||
|
||||
return parentTreeItem == rootTreeItem;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsCoreUtils::IsErrorPage(nsIDocument *aDocument)
|
||||
{
|
||||
|
@ -233,6 +233,11 @@ public:
|
||||
*/
|
||||
static PRBool IsContentDocument(nsIDocument *aDocument);
|
||||
|
||||
/**
|
||||
* Return true if the given document node is for tab document accessible.
|
||||
*/
|
||||
static bool IsTabDocument(nsIDocument* aDocumentNode);
|
||||
|
||||
/**
|
||||
* Return true if the given document is an error page.
|
||||
*/
|
||||
|
@ -104,8 +104,7 @@ nsDocAccessible::
|
||||
nsDocAccessible(nsIDocument *aDocument, nsIContent *aRootContent,
|
||||
nsIWeakReference *aShell) :
|
||||
nsHyperTextAccessibleWrap(aRootContent, aShell),
|
||||
mDocument(aDocument), mScrollPositionChangedTicks(0), mIsLoaded(PR_FALSE),
|
||||
mCacheRoot(nsnull), mIsPostCacheProcessing(PR_FALSE)
|
||||
mDocument(aDocument), mScrollPositionChangedTicks(0), mIsLoaded(PR_FALSE)
|
||||
{
|
||||
mFlags |= eDocAccessible;
|
||||
|
||||
@ -1425,43 +1424,30 @@ nsDocAccessible::RecreateAccessible(nsIContent* aContent)
|
||||
}
|
||||
|
||||
void
|
||||
nsDocAccessible::NotifyOfCachingStart(nsAccessible* aAccessible)
|
||||
nsDocAccessible::ProcessInvalidationList()
|
||||
{
|
||||
if (!mCacheRoot)
|
||||
mCacheRoot = aAccessible;
|
||||
}
|
||||
|
||||
void
|
||||
nsDocAccessible::NotifyOfCachingEnd(nsAccessible* aAccessible)
|
||||
{
|
||||
if (mCacheRoot == aAccessible && !mIsPostCacheProcessing) {
|
||||
// Allow invalidation list insertions while container children are recached.
|
||||
mIsPostCacheProcessing = PR_TRUE;
|
||||
|
||||
// Invalidate children of container accessible for each element in
|
||||
// invalidation list.
|
||||
for (PRUint32 idx = 0; idx < mInvalidationList.Length(); idx++) {
|
||||
nsIContent* content = mInvalidationList[idx];
|
||||
nsAccessible* accessible = GetAccessible(content);
|
||||
if (!accessible) {
|
||||
nsAccessible* container = GetContainerAccessible(content);
|
||||
NS_ASSERTION(container,
|
||||
"Got a referenced element that is not in document!");
|
||||
if (container) {
|
||||
container->UpdateChildren();
|
||||
accessible = GetAccessible(content);
|
||||
}
|
||||
// Invalidate children of container accessible for each element in
|
||||
// invalidation list. Allow invalidation list insertions while container
|
||||
// children are recached.
|
||||
for (PRUint32 idx = 0; idx < mInvalidationList.Length(); idx++) {
|
||||
nsIContent* content = mInvalidationList[idx];
|
||||
nsAccessible* accessible = GetAccessible(content);
|
||||
if (!accessible) {
|
||||
nsAccessible* container = GetContainerAccessible(content);
|
||||
NS_ASSERTION(container,
|
||||
"Got a referenced element that is not in document!");
|
||||
if (container) {
|
||||
container->UpdateChildren();
|
||||
accessible = GetAccessible(content);
|
||||
}
|
||||
|
||||
// Make sure the subtree is created.
|
||||
if (accessible)
|
||||
CacheChildrenInSubtree(accessible);
|
||||
}
|
||||
mInvalidationList.Clear();
|
||||
|
||||
mCacheRoot = nsnull;
|
||||
mIsPostCacheProcessing = PR_FALSE;
|
||||
// Make sure the subtree is created.
|
||||
if (accessible)
|
||||
CacheChildrenInSubtree(accessible);
|
||||
}
|
||||
|
||||
mInvalidationList.Clear();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -325,17 +325,6 @@ public:
|
||||
*/
|
||||
void RecreateAccessible(nsIContent* aContent);
|
||||
|
||||
/**
|
||||
* Used to notify the document that the accessible caching is started or
|
||||
* finished.
|
||||
*
|
||||
* While children are cached we may encounter the case there's no accessible
|
||||
* for referred content by related accessible. Keep the caching root and
|
||||
* these related nodes to invalidate their containers after root caching.
|
||||
*/
|
||||
void NotifyOfCachingStart(nsAccessible* aAccessible);
|
||||
void NotifyOfCachingEnd(nsAccessible* aAccessible);
|
||||
|
||||
protected:
|
||||
|
||||
// nsAccessible
|
||||
@ -439,6 +428,15 @@ protected:
|
||||
void ProcessContentInserted(nsAccessible* aContainer,
|
||||
const nsTArray<nsCOMPtr<nsIContent> >* aInsertedContent);
|
||||
|
||||
/**
|
||||
* Used to notify the document to make it process the invalidation list.
|
||||
*
|
||||
* While children are cached we may encounter the case there's no accessible
|
||||
* for referred content by related accessible. Store these related nodes to
|
||||
* invalidate their containers later.
|
||||
*/
|
||||
void ProcessInvalidationList();
|
||||
|
||||
/**
|
||||
* Update the accessible tree for content insertion or removal.
|
||||
*/
|
||||
@ -532,15 +530,12 @@ protected:
|
||||
friend class RelatedAccIterator;
|
||||
|
||||
/**
|
||||
* Used for our caching algorithm. We store the root of the tree that needs
|
||||
* caching, the list of nodes that should be invalidated, and whether we are
|
||||
* processing the invalidation list.
|
||||
* Used for our caching algorithm. We store the list of nodes that should be
|
||||
* invalidated.
|
||||
*
|
||||
* @see NotifyOfCachingStart/NotifyOfCachingEnd
|
||||
* @see ProcessInvalidationList
|
||||
*/
|
||||
nsAccessible* mCacheRoot;
|
||||
nsTArray<nsIContent*> mInvalidationList;
|
||||
PRBool mIsPostCacheProcessing;
|
||||
|
||||
/**
|
||||
* Used to process notification from core and accessible events.
|
||||
|
@ -107,6 +107,8 @@ EXPORTS = \
|
||||
# we don't want the shared lib, but we want to force the creation of a static lib.
|
||||
FORCE_STATIC_LIB = 1
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
include $(topsrcdir)/ipc/chromium/chromium-config.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
LOCAL_INCLUDES += \
|
||||
@ -114,5 +116,6 @@ LOCAL_INCLUDES += \
|
||||
-I$(srcdir)/../base \
|
||||
-I$(srcdir)/../html \
|
||||
-I$(srcdir)/../xul \
|
||||
-I$(srcdir)/../../../content/base/src \
|
||||
-I$(srcdir)/../../../content/events/src \
|
||||
$(NULL)
|
||||
|
||||
|
@ -204,7 +204,7 @@ __try {
|
||||
// accessibles.
|
||||
if (!doc->ParentDocument() ||
|
||||
nsWinUtils::IsWindowEmulationStarted() &&
|
||||
nsWinUtils::IsTabDocument(doc->GetDocumentNode())) {
|
||||
nsCoreUtils::IsTabDocument(doc->GetDocumentNode())) {
|
||||
HWND hwnd = static_cast<HWND>(doc->GetNativeWindow());
|
||||
if (hwnd && SUCCEEDED(AccessibleObjectFromWindow(hwnd, OBJID_WINDOW,
|
||||
IID_IAccessible,
|
||||
|
@ -36,6 +36,8 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "mozilla/dom/TabChild.h"
|
||||
|
||||
#include "nsDocAccessibleWrap.h"
|
||||
#include "ISimpleDOMDocument_i.c"
|
||||
#include "nsIAccessibilityService.h"
|
||||
@ -242,7 +244,7 @@ nsDocAccessibleWrap::Shutdown()
|
||||
// Do window emulation specific shutdown if emulation was started.
|
||||
if (nsWinUtils::IsWindowEmulationStarted()) {
|
||||
// Destroy window created for root document.
|
||||
if (nsWinUtils::IsTabDocument(mDocument)) {
|
||||
if (nsCoreUtils::IsTabDocument(mDocument)) {
|
||||
sHWNDCache.Remove(mHWND);
|
||||
::DestroyWindow(static_cast<HWND>(mHWND));
|
||||
}
|
||||
@ -272,9 +274,19 @@ nsDocAccessibleWrap::NotifyOfInitialUpdate()
|
||||
|
||||
if (nsWinUtils::IsWindowEmulationStarted()) {
|
||||
// Create window for tab document.
|
||||
if (nsWinUtils::IsTabDocument(mDocument)) {
|
||||
if (nsCoreUtils::IsTabDocument(mDocument)) {
|
||||
mozilla::dom::TabChild* tabChild =
|
||||
mozilla::dom::GetTabChildFrom(mDocument->GetShell());
|
||||
|
||||
nsRootAccessible* rootDocument = RootAccessible();
|
||||
|
||||
mozilla::WindowsHandle nativeData = nsnull;
|
||||
if (tabChild)
|
||||
tabChild->SendGetWidgetNativeData(&nativeData);
|
||||
else
|
||||
nativeData = reinterpret_cast<mozilla::WindowsHandle>(
|
||||
rootDocument->GetNativeWindow());
|
||||
|
||||
PRBool isActive = PR_TRUE;
|
||||
PRInt32 x = CW_USEDEFAULT, y = CW_USEDEFAULT, width = 0, height = 0;
|
||||
if (nsWinUtils::IsWindowEmulationFor(kDolphinModuleHandle)) {
|
||||
@ -289,7 +301,7 @@ nsDocAccessibleWrap::NotifyOfInitialUpdate()
|
||||
docShell->GetIsActive(&isActive);
|
||||
}
|
||||
|
||||
HWND parentWnd = static_cast<HWND>(rootDocument->GetNativeWindow());
|
||||
HWND parentWnd = reinterpret_cast<HWND>(nativeData);
|
||||
mHWND = nsWinUtils::CreateNativeWindow(kClassNameTabContent, parentWnd,
|
||||
x, y, width, height, isActive);
|
||||
|
||||
|
@ -64,7 +64,7 @@ void
|
||||
nsRootAccessibleWrap::DocumentActivated(nsDocAccessible* aDocument)
|
||||
{
|
||||
if (nsWinUtils::IsWindowEmulationFor(kDolphinModuleHandle) &&
|
||||
nsWinUtils::IsTabDocument(aDocument->GetDocumentNode())) {
|
||||
nsCoreUtils::IsTabDocument(aDocument->GetDocumentNode())) {
|
||||
PRUint32 count = mChildDocuments.Length();
|
||||
for (PRUint32 idx = 0; idx < count; idx++) {
|
||||
nsDocAccessible* childDoc = mChildDocuments[idx];
|
||||
|
@ -176,23 +176,13 @@ nsWinUtils::HideNativeWindow(HWND aWnd)
|
||||
bool
|
||||
nsWinUtils::IsWindowEmulationFor(LPCWSTR kModuleHandle)
|
||||
{
|
||||
#ifdef MOZ_E10S_COMPAT
|
||||
// Window emulation is always enabled in multiprocess Firefox.
|
||||
return kModuleHandle ? ::GetModuleHandleW(kModuleHandle) : true;
|
||||
#else
|
||||
return kModuleHandle ? ::GetModuleHandleW(kModuleHandle) :
|
||||
::GetModuleHandleW(kJAWSModuleHandle) ||
|
||||
::GetModuleHandleW(kWEModuleHandle) ||
|
||||
::GetModuleHandleW(kDolphinModuleHandle);
|
||||
}
|
||||
|
||||
bool
|
||||
nsWinUtils::IsTabDocument(nsIDocument* aDocumentNode)
|
||||
{
|
||||
nsCOMPtr<nsISupports> container = aDocumentNode->GetContainer();
|
||||
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(container));
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
|
||||
treeItem->GetParent(getter_AddRefs(parentTreeItem));
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
|
||||
treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem));
|
||||
|
||||
return parentTreeItem == rootTreeItem;
|
||||
#endif
|
||||
}
|
||||
|
@ -104,11 +104,6 @@ public:
|
||||
* Return true if window emulation is enabled.
|
||||
*/
|
||||
static bool IsWindowEmulationFor(LPCWSTR kModuleHandle);
|
||||
|
||||
/**
|
||||
* Return true if the given document node is for tab document accessible.
|
||||
*/
|
||||
static bool IsTabDocument(nsIDocument* aDocumentNode);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -465,7 +465,7 @@ nsXULMenuitemAccessible::KeyboardShortcut() const
|
||||
|
||||
PRUint32 modifierMask = 0;
|
||||
if (modifiersStr.Find("shift") != -1)
|
||||
modifierMask != KeyBinding::kShift;
|
||||
modifierMask |= KeyBinding::kShift;
|
||||
if (modifiersStr.Find("alt") != -1)
|
||||
modifierMask |= KeyBinding::kAlt;
|
||||
if (modifiersStr.Find("meta") != -1)
|
||||
|
@ -13,11 +13,66 @@
|
||||
|
||||
<script type="application/javascript"
|
||||
src="../common.js" />
|
||||
<script type="application/javascript"
|
||||
src="../events.js" />
|
||||
<script type="application/javascript"
|
||||
src="../attributes.js" />
|
||||
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
function openMenu(aID)
|
||||
{
|
||||
this.menuNode = getNode(aID);
|
||||
|
||||
this.eventSeq = [
|
||||
new invokerChecker(EVENT_FOCUS, this.menuNode)
|
||||
];
|
||||
|
||||
this.invoke = function openMenu_invoke()
|
||||
{
|
||||
this.menuNode.open = true;
|
||||
}
|
||||
|
||||
this.finalCheck = function openMenu_finalCheck()
|
||||
{
|
||||
testGroupAttrs("menu_item1.1", 1, 1);
|
||||
testGroupAttrs("menu_item1.2", 1, 3);
|
||||
testGroupAttrs("menu_item1.4", 2, 3);
|
||||
testGroupAttrs("menu_item2", 3, 3);
|
||||
}
|
||||
|
||||
this.getID = function openMenu_getID()
|
||||
{
|
||||
return "open menu " + prettyName(aID);
|
||||
}
|
||||
}
|
||||
|
||||
function openSubMenu(aID)
|
||||
{
|
||||
this.menuNode = getNode(aID);
|
||||
|
||||
this.eventSeq = [
|
||||
new invokerChecker(EVENT_FOCUS, this.menuNode)
|
||||
];
|
||||
|
||||
this.invoke = function openSubMenu_invoke()
|
||||
{
|
||||
this.menuNode.open = true;
|
||||
}
|
||||
|
||||
this.finalCheck = function openSubMenu_finalCheck()
|
||||
{
|
||||
testGroupAttrs("menu_item2.1", 1, 2, 1);
|
||||
testGroupAttrs("menu_item2.2", 2, 2, 1);
|
||||
}
|
||||
|
||||
this.getID = function openSubMenu_getID()
|
||||
{
|
||||
return "open submenu " + prettyName(aID);
|
||||
}
|
||||
}
|
||||
|
||||
var gQueue = null;
|
||||
function doTest()
|
||||
{
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@ -25,30 +80,6 @@
|
||||
testGroupAttrs("item1", 1, 2);
|
||||
testGroupAttrs("item2", 2, 2);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// xul:menu (bug 443881)
|
||||
var menu1 = document.getElementById("menu_item1");
|
||||
menu1.open = true;
|
||||
|
||||
menu1.addEventListener("popupshown", function() {
|
||||
var menu2 = document.getElementById("menu_item2");
|
||||
menu2.open = true;
|
||||
|
||||
menu2.addEventListener("popupshown", function() {
|
||||
testGroupAttrs("menu_item1.1", 1, 1);
|
||||
testGroupAttrs("menu_item1.2", 1, 3);
|
||||
testGroupAttrs("menu_item1.4", 2, 3);
|
||||
testGroupAttrs("menu_item2", 3, 3);
|
||||
testGroupAttrs("menu_item2.1", 1, 2, 1);
|
||||
testGroupAttrs("menu_item2.2", 2, 2, 1);
|
||||
|
||||
menu1.open = false;
|
||||
menu2.open = false;
|
||||
|
||||
SimpleTest.finish();
|
||||
}, false);
|
||||
}, false);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// xul:tab
|
||||
testGroupAttrs("tab1", 1, 2);
|
||||
@ -65,6 +96,13 @@
|
||||
testGroupAttrs("aria-menuitemcheckbox", 2, 3);
|
||||
testGroupAttrs("aria-menuitemradio", 3, 3);
|
||||
testGroupAttrs("aria-menuitem2", 1, 1);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// xul:menu (bug 443881)
|
||||
gQueue = new eventQueue();
|
||||
gQueue.push(new openMenu("menu_item1"));
|
||||
gQueue.push(new openSubMenu("menu_item2"));
|
||||
gQueue.invoke(); // SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
@ -72,6 +110,7 @@
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<hbox flex="1" style="overflow: auto;">
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=417317"
|
||||
@ -96,6 +135,7 @@
|
||||
</pre>
|
||||
</body>
|
||||
|
||||
<vbox flex="1">
|
||||
<listbox>
|
||||
<listitem label="item1" id="item1"/>
|
||||
<listitem label="item2" id="item2"/>
|
||||
@ -148,5 +188,8 @@
|
||||
<description role="menuitem" id="aria-menuitem2"
|
||||
value="conventional menuitem"/>
|
||||
</vbox>
|
||||
|
||||
</vbox>
|
||||
</hbox>
|
||||
</window>
|
||||
|
||||
|
@ -63,6 +63,7 @@ _TEST_FILES =\
|
||||
test_groupbox.xul \
|
||||
test_iframe.html \
|
||||
test_img.html \
|
||||
test_invalidationlist.html \
|
||||
test_list.html \
|
||||
test_media.html \
|
||||
test_select.html \
|
||||
|
59
accessible/tests/mochitest/tree/test_invalidationlist.html
Normal file
59
accessible/tests/mochitest/tree/test_invalidationlist.html
Normal file
@ -0,0 +1,59 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test document hierarchy</title>
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/MochiKit/packed.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../role.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
function doTest()
|
||||
{
|
||||
var tree =
|
||||
{ SECTION: [
|
||||
{ SECTION: [ // div
|
||||
{ LABEL: [ ] } // link
|
||||
] },
|
||||
{ SECTION: [ // div table-cell referred by label
|
||||
{ TEXT_LEAF: [ ] }, // 'Z'
|
||||
{ TEXT_LEAF: [ ] } // ' '
|
||||
] }
|
||||
] };
|
||||
testAccessibleTree("container", tree);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=673757"
|
||||
title="Do not process invalidation list while tree is created">
|
||||
Mozilla Bug 673757
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
|
||||
<div id="container">
|
||||
<div><label for="x"></label></div>
|
||||
<div style="display: table-cell;" id="x">Z<span> </span><span></span></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -45,6 +45,7 @@ include $(topsrcdir)/config/config.mk
|
||||
PARALLEL_DIRS = \
|
||||
base \
|
||||
components \
|
||||
devtools \
|
||||
fuel \
|
||||
locales \
|
||||
themes \
|
||||
|
@ -1,6 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1306529826000">
|
||||
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1311096050000">
|
||||
<emItems>
|
||||
<emItem blockID="i41" id="{99079a25-328f-4bd4-be04-00955acaa0a7}">
|
||||
<versionRange minVersion="0.1" maxVersion="4.3.0.00" severity="1">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i8" id="{B13721C7-F507-4982-B2E5-502A71474FED}">
|
||||
<versionRange minVersion=" " severity="1">
|
||||
</versionRange>
|
||||
@ -25,6 +29,10 @@
|
||||
<versionRange minVersion="1.0" maxVersion="1.0">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i39" id="{c2d64ff7-0ab8-4263-89c9-ea3b0f8f050c}">
|
||||
<versionRange minVersion="0.1" maxVersion="4.3.0.00" severity="1">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i10" id="{8CE11043-9A15-4207-A565-0C94C42D590D}">
|
||||
</emItem>
|
||||
<emItem blockID="i1" id="mozilla_cc@internetdownloadmanager.com">
|
||||
@ -52,6 +60,10 @@
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i40" id="{28387537-e3f9-4ed7-860c-11e69af4a8a0}">
|
||||
<versionRange minVersion="0.1" maxVersion="4.3.0.00" severity="1">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i23" id="firefox@bandoo.com">
|
||||
<versionRange minVersion="5.0" maxVersion="5.0" severity="1">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
|
@ -843,6 +843,7 @@ var BookmarksEventHandler = {
|
||||
var PlacesMenuDNDHandler = {
|
||||
_springLoadDelay: 350, // milliseconds
|
||||
_loadTimer: null,
|
||||
_closerTimer: null,
|
||||
|
||||
/**
|
||||
* Called when the user enters the <menu> element during a drag.
|
||||
@ -854,13 +855,18 @@ var PlacesMenuDNDHandler = {
|
||||
if (!this._isStaticContainer(event.target))
|
||||
return;
|
||||
|
||||
this._loadTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
this._loadTimer.initWithCallback(function() {
|
||||
PlacesMenuDNDHandler._loadTimer = null;
|
||||
event.target.lastChild.setAttribute("autoopened", "true");
|
||||
event.target.lastChild.showPopup(event.target.lastChild);
|
||||
}, this._springLoadDelay, Ci.nsITimer.TYPE_ONE_SHOT);
|
||||
event.preventDefault();
|
||||
let ip = new InsertionPoint(PlacesUtils.bookmarksMenuFolderId,
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
Ci.nsITreeView.DROP_ON);
|
||||
if (ip && PlacesControllerDragHelper.canDrop(ip, event.dataTransfer)) {
|
||||
this._loadTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
this._loadTimer.initWithCallback(function() {
|
||||
PlacesMenuDNDHandler._loadTimer = null;
|
||||
event.target.lastChild.setAttribute("autoopened", "true");
|
||||
event.target.lastChild.showPopup(event.target.lastChild);
|
||||
}, this._springLoadDelay, Ci.nsITimer.TYPE_ONE_SHOT);
|
||||
event.preventDefault();
|
||||
}
|
||||
event.stopPropagation();
|
||||
},
|
||||
|
||||
@ -878,8 +884,9 @@ var PlacesMenuDNDHandler = {
|
||||
this._loadTimer.cancel();
|
||||
this._loadTimer = null;
|
||||
}
|
||||
let closeTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
closeTimer.initWithCallback(function() {
|
||||
this._closeTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
this._closeTimer.initWithCallback(function() {
|
||||
this._closeTimer = null;
|
||||
let node = PlacesControllerDragHelper.currentDropTarget;
|
||||
let inHierarchy = false;
|
||||
while (node && !inHierarchy) {
|
||||
|
@ -13,6 +13,7 @@ tabbrowser {
|
||||
-moz-binding: url("chrome://browser/content/tabbrowser.xml#tabbrowser-tabs");
|
||||
}
|
||||
|
||||
#tabbrowser-tabs[drag=detach][closebuttons=hidden] > .tabbrowser-arrowscrollbox > .tabs-newtab-button,
|
||||
#tabbrowser-tabs:not([overflow="true"]) + #new-tab-button,
|
||||
#tabbrowser-tabs[overflow="true"] > .tabbrowser-arrowscrollbox > .tabs-newtab-button,
|
||||
#TabsToolbar[currentset]:not([currentset*="tabbrowser-tabs,new-tab-button"]) > #tabbrowser-tabs > .tabbrowser-arrowscrollbox > .tabs-newtab-button,
|
||||
@ -62,6 +63,39 @@ tabbrowser {
|
||||
display: block; /* position:fixed already does this (bug 579776), but let's be explicit */
|
||||
}
|
||||
|
||||
.tabbrowser-tabs[drag] > .tabbrowser-tab {
|
||||
pointer-events: none; /* suppress tooltips */
|
||||
}
|
||||
|
||||
.tabbrowser-tabs[drag] > .tabbrowser-tab[selected] {
|
||||
z-index: 2; /* ensure selected tab stays on top despite -moz-transform */
|
||||
}
|
||||
|
||||
.tabbrowser-tabs[drag] > .tabbrowser-tab[dragged] {
|
||||
-moz-transition: 0s; /* suppress opening animation when reattaching tab */
|
||||
}
|
||||
|
||||
/* visibility: collapse might collapse the tab bar, so we use this instead */
|
||||
.tabbrowser-tabs[drag=detach] > .tabbrowser-tab[dragged]:not(:only-child) {
|
||||
min-width: 0 !important;
|
||||
max-width: 0 !important;
|
||||
border: 0 !important;
|
||||
opacity: 0;
|
||||
overflow: hidden;
|
||||
-moz-transition: max-width 150ms ease-out;
|
||||
}
|
||||
.tabbrowser-tabs[drag=detach] > .tabbrowser-tab[dragged]:only-child {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.tabbrowser-tabs[drag=move] > .tabbrowser-tab[fadein]:not([dragged]) {
|
||||
-moz-transition: -moz-transform 200ms ease-out;
|
||||
}
|
||||
|
||||
.tabbrowser-tabs[drag=finish] > .tabbrowser-tab[dragged][fadein] {
|
||||
-moz-transition: -moz-transform 100ms ease-out;
|
||||
}
|
||||
|
||||
#alltabs-popup {
|
||||
-moz-binding: url("chrome://browser/content/tabbrowser.xml#tabbrowser-alltabs-popup");
|
||||
}
|
||||
|
@ -399,6 +399,24 @@
|
||||
</panel>
|
||||
|
||||
<tooltip id="tabbrowser-tab-tooltip" onpopupshowing="gBrowser.createTooltip(event);"/>
|
||||
|
||||
<tooltip id="back-button-tooltip">
|
||||
<label value="&backButton.tooltip;"/>
|
||||
#ifdef XP_MACOSX
|
||||
<label value="&backForwardButtonMenuMac.tooltip;"/>
|
||||
#else
|
||||
<label value="&backForwardButtonMenu.tooltip;"/>
|
||||
#endif
|
||||
</tooltip>
|
||||
|
||||
<tooltip id="forward-button-tooltip">
|
||||
<label value="&forwardButton.tooltip;"/>
|
||||
#ifdef XP_MACOSX
|
||||
<label value="&backForwardButtonMenuMac.tooltip;"/>
|
||||
#else
|
||||
<label value="&backForwardButtonMenu.tooltip;"/>
|
||||
#endif
|
||||
</tooltip>
|
||||
</popupset>
|
||||
|
||||
#ifdef CAN_DRAW_IN_TITLEBAR
|
||||
@ -468,12 +486,12 @@
|
||||
label="&backCmd.label;"
|
||||
command="Browser:BackOrBackDuplicate"
|
||||
onclick="checkForMiddleClick(this, event);"
|
||||
tooltiptext="&backButton.tooltip;"/>
|
||||
tooltip="back-button-tooltip"/>
|
||||
<toolbarbutton id="forward-button" class="toolbarbutton-1"
|
||||
label="&forwardCmd.label;"
|
||||
command="Browser:ForwardOrForwardDuplicate"
|
||||
onclick="checkForMiddleClick(this, event);"
|
||||
tooltiptext="&forwardButton.tooltip;"/>
|
||||
tooltip="forward-button-tooltip"/>
|
||||
</toolbaritem>
|
||||
|
||||
<toolbaritem id="urlbar-container" align="center" flex="400" persist="width" combined="true"
|
||||
|
@ -528,6 +528,7 @@ Highlighter.prototype = {
|
||||
*/
|
||||
var InspectorUI = {
|
||||
browser: null,
|
||||
tools: {},
|
||||
showTextNodesWithWhitespace: false,
|
||||
inspecting: false,
|
||||
treeLoaded: false,
|
||||
@ -859,6 +860,13 @@ var InspectorUI = {
|
||||
delete this.domplateUtils;
|
||||
}
|
||||
|
||||
this.saveToolState(this.winID);
|
||||
this.toolsDo(function IUI_toolsHide(aTool) {
|
||||
if (aTool.panel) {
|
||||
aTool.panel.hidePopup();
|
||||
}
|
||||
});
|
||||
|
||||
this.inspectCmd.setAttribute("checked", false);
|
||||
this.browser = this.win = null; // null out references to browser and window
|
||||
this.winID = null;
|
||||
@ -880,8 +888,10 @@ var InspectorUI = {
|
||||
*/
|
||||
startInspecting: function IUI_startInspecting()
|
||||
{
|
||||
document.getElementById("inspector-inspect-toolbutton").checked = true;
|
||||
this.attachPageListeners();
|
||||
this.inspecting = true;
|
||||
this.highlighter.veilTransparentBox.removeAttribute("locked");
|
||||
},
|
||||
|
||||
/**
|
||||
@ -894,6 +904,7 @@ var InspectorUI = {
|
||||
return;
|
||||
}
|
||||
|
||||
document.getElementById("inspector-inspect-toolbutton").checked = false;
|
||||
this.detachPageListeners();
|
||||
this.inspecting = false;
|
||||
if (this.highlighter.node) {
|
||||
@ -901,6 +912,7 @@ var InspectorUI = {
|
||||
} else {
|
||||
this.select(null, true, true);
|
||||
}
|
||||
this.highlighter.veilTransparentBox.setAttribute("locked", true);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -924,6 +936,11 @@ var InspectorUI = {
|
||||
}
|
||||
this.ioBox.select(this.selection, true, true, aScroll);
|
||||
}
|
||||
this.toolsDo(function IUI_toolsOnSelect(aTool) {
|
||||
if (aTool.panel.state == "open") {
|
||||
aTool.onSelect.apply(aTool.context, [aNode]);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
@ -972,6 +989,7 @@ var InspectorUI = {
|
||||
}, INSPECTOR_NOTIFICATIONS.CLOSED, false);
|
||||
} else {
|
||||
this.openInspectorUI();
|
||||
this.restoreToolState(winID);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1220,7 +1238,113 @@ var InspectorUI = {
|
||||
}
|
||||
this._log("END TRACE");
|
||||
},
|
||||
}
|
||||
|
||||
/**
|
||||
* Register an external tool with the inspector.
|
||||
*
|
||||
* aRegObj = {
|
||||
* id: "toolname",
|
||||
* context: myTool,
|
||||
* label: "Button label",
|
||||
* icon: "chrome://somepath.png",
|
||||
* tooltiptext: "Button tooltip",
|
||||
* accesskey: "S",
|
||||
* onSelect: object.method,
|
||||
* onShow: object.method,
|
||||
* onHide: object.method,
|
||||
* panel: myTool.panel
|
||||
* }
|
||||
*
|
||||
* @param aRegObj
|
||||
*/
|
||||
registerTool: function IUI_RegisterTool(aRegObj) {
|
||||
if (this.tools[aRegObj.id]) {
|
||||
return;
|
||||
} else {
|
||||
let id = aRegObj.id;
|
||||
let buttonId = "inspector-" + id + "-toolbutton";
|
||||
aRegObj.buttonId = buttonId;
|
||||
|
||||
aRegObj.panel.addEventListener("popuphiding",
|
||||
function IUI_toolPanelHiding() {
|
||||
btn.setAttribute("checked", "false");
|
||||
}, false);
|
||||
aRegObj.panel.addEventListener("popupshowing",
|
||||
function IUI_toolPanelShowing() {
|
||||
btn.setAttribute("checked", "true");
|
||||
}, false);
|
||||
|
||||
this.tools[id] = aRegObj;
|
||||
}
|
||||
|
||||
let toolbar = document.getElementById("inspector-toolbar");
|
||||
let btn = document.createElement("toolbarbutton");
|
||||
btn.setAttribute("id", aRegObj.buttonId);
|
||||
btn.setAttribute("label", aRegObj.label);
|
||||
btn.setAttribute("tooltiptext", aRegObj.tooltiptext);
|
||||
btn.setAttribute("accesskey", aRegObj.accesskey);
|
||||
btn.setAttribute("class", "toolbarbutton-text");
|
||||
btn.setAttribute("image", aRegObj.icon || "");
|
||||
toolbar.appendChild(btn);
|
||||
|
||||
btn.addEventListener("click",
|
||||
function IUI_ToolButtonClick(aEvent) {
|
||||
if (btn.getAttribute("checked") == "true") {
|
||||
aRegObj.onHide.apply(aRegObj.context);
|
||||
} else {
|
||||
aRegObj.onShow.apply(aRegObj.context, [InspectorUI.selection]);
|
||||
aRegObj.onSelect.apply(aRegObj.context, [InspectorUI.selection]);
|
||||
}
|
||||
}, false);
|
||||
},
|
||||
|
||||
/**
|
||||
* Save a list of open tools to the inspector store.
|
||||
*
|
||||
* @param aWinID The ID of the window used to save the associated tools
|
||||
*/
|
||||
saveToolState: function IUI_saveToolState(aWinID)
|
||||
{
|
||||
let openTools = {};
|
||||
this.toolsDo(function IUI_toolsSetId(aTool) {
|
||||
if (aTool.panel.state == "open") {
|
||||
openTools[aTool.id] = true;
|
||||
}
|
||||
});
|
||||
InspectorStore.setValue(aWinID, "openTools", openTools);
|
||||
},
|
||||
|
||||
/**
|
||||
* Restore tools previously save using saveToolState().
|
||||
*
|
||||
* @param aWinID The ID of the window to which the associated tools are to be
|
||||
* restored.
|
||||
*/
|
||||
restoreToolState: function IUI_restoreToolState(aWinID)
|
||||
{
|
||||
let openTools = InspectorStore.getValue(aWinID, "openTools");
|
||||
InspectorUI.selection = InspectorUI.selection;
|
||||
if (openTools) {
|
||||
this.toolsDo(function IUI_toolsOnShow(aTool) {
|
||||
if (aTool.id in openTools) {
|
||||
aTool.onShow.apply(aTool.context, [InspectorUI.selection]);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Loop through all registered tools and pass each into the provided function
|
||||
*
|
||||
* @param aFunction The function to which each tool is to be passed
|
||||
*/
|
||||
toolsDo: function IUI_toolsDo(aFunction)
|
||||
{
|
||||
for each (let tool in this.tools) {
|
||||
aFunction(tool);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* The Inspector store is used for storing data specific to each tab window.
|
||||
@ -1355,4 +1479,3 @@ var InspectorStore = {
|
||||
XPCOMUtils.defineLazyGetter(InspectorUI, "inspectCmd", function () {
|
||||
return document.getElementById("Tools:Inspect");
|
||||
});
|
||||
|
||||
|
@ -330,6 +330,7 @@
|
||||
</popupset>
|
||||
|
||||
<textbox id="scratchpad-textbox"
|
||||
class="monospace"
|
||||
multiline="true"
|
||||
flex="1"
|
||||
context="scratchpad-text-popup"
|
||||
|
@ -58,16 +58,21 @@ let gSyncQuota = {
|
||||
},
|
||||
|
||||
loadData: function loadData() {
|
||||
window.setTimeout(function() {
|
||||
let usage = Weave.Service.getCollectionUsage();
|
||||
this._usage_req = Weave.Service.getStorageInfo(Weave.INFO_COLLECTION_USAGE,
|
||||
function (error, usage) {
|
||||
delete gSyncQuota._usage_req;
|
||||
// displayUsageData handles null values, so no need to check 'error'.
|
||||
gUsageTreeView.displayUsageData(usage);
|
||||
}, 0);
|
||||
});
|
||||
|
||||
let usageLabel = document.getElementById("usageLabel");
|
||||
let bundle = this.bundle;
|
||||
window.setTimeout(function() {
|
||||
let quota = Weave.Service.getQuota();
|
||||
if (!quota) {
|
||||
|
||||
this._quota_req = Weave.Service.getStorageInfo(Weave.INFO_QUOTA,
|
||||
function (error, quota) {
|
||||
delete gSyncQuota._quota_req;
|
||||
|
||||
if (error) {
|
||||
usageLabel.value = bundle.getString("quota.usageError.label");
|
||||
return;
|
||||
}
|
||||
@ -82,7 +87,17 @@ let gSyncQuota = {
|
||||
let total = gSyncQuota.convertKB(quota[1]);
|
||||
usageLabel.value = bundle.getFormattedString(
|
||||
"quota.usagePercentage.label", [percent].concat(used).concat(total));
|
||||
}, 0);
|
||||
});
|
||||
},
|
||||
|
||||
onCancel: function onCancel() {
|
||||
if (this._usage_req) {
|
||||
this._usage_req.abort();
|
||||
}
|
||||
if (this._quota_req) {
|
||||
this._quota_req.abort();
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
onAccept: function onAccept() {
|
||||
@ -95,7 +110,7 @@ let gSyncQuota = {
|
||||
let Service = Weave.Service;
|
||||
Weave.Utils.nextTick(function() { Service.sync(); });
|
||||
}
|
||||
return true;
|
||||
return this.onCancel();
|
||||
},
|
||||
|
||||
convertKB: function convertKB(value) {
|
||||
|
@ -56,7 +56,7 @@
|
||||
onload="gSyncQuota.init()"
|
||||
buttons="accept,cancel"
|
||||
title=""a.dialogTitle.label;"
|
||||
ondialogcancel="return true;"
|
||||
ondialogcancel="return gSyncQuota.onCancel();"
|
||||
ondialogaccept="return gSyncQuota.onAccept();">
|
||||
|
||||
<script type="application/javascript"
|
||||
|
@ -38,6 +38,16 @@ tabpanels {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.tab-drag-preview {
|
||||
background: -moz-element(#content) left top;
|
||||
background-clip: content-box;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.tab-drag-panel[target] > .tab-drag-preview {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tab-drop-indicator {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -35,6 +35,8 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
"use strict";
|
||||
|
||||
const Cu = Components.utils;
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
@ -164,8 +166,8 @@ function tabEventListener(event) {
|
||||
function observer(subject, topic, data) {
|
||||
switch (topic) {
|
||||
case "domwindowopened":
|
||||
subject.addEventListener("load", function() {
|
||||
subject.removeEventListener("load", arguments.callee, false);
|
||||
subject.addEventListener("load", function onLoad() {
|
||||
subject.removeEventListener("load", onLoad, false);
|
||||
|
||||
// Now that the window has loaded, only register on browser windows
|
||||
let doc = subject.document.documentElement;
|
||||
|
@ -45,6 +45,8 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
"use strict";
|
||||
|
||||
// **********
|
||||
// Title: utils.js
|
||||
|
||||
@ -369,10 +371,11 @@ Range.prototype = {
|
||||
// little graph. It goes from near 0 at x=0 to near 1 at x=1
|
||||
// smoothly and beautifully.
|
||||
// http://www.wolframalpha.com/input/?i=.5+%2B+.5+*+tanh%28%284+*+x%29+-+2%29
|
||||
function tanh(x) {
|
||||
let tanh = function tanh(x) {
|
||||
var e = Math.exp(x);
|
||||
return (e - 1/e) / (e + 1/e);
|
||||
}
|
||||
};
|
||||
|
||||
return .5 - .5 * tanh(2 - 4 * proportion);
|
||||
}
|
||||
|
||||
@ -523,12 +526,15 @@ let Utils = {
|
||||
// Pass as many arguments as you want, it'll print them all.
|
||||
trace: function Utils_trace() {
|
||||
var text = this.expandArgumentsForLog(arguments);
|
||||
// cut off the first two lines of the stack trace, because they're just this function.
|
||||
let stack = Error().stack.replace(/^.*?\n.*?\n/, "");
|
||||
|
||||
// cut off the first line of the stack trace, because that's just this function.
|
||||
let stack = Error().stack.split("\n").slice(1);
|
||||
|
||||
// if the caller was assert, cut out the line for the assert function as well.
|
||||
if (this.trace.caller.name == 'Utils_assert')
|
||||
stack = stack.replace(/^.*?\n/, "");
|
||||
this.log('trace: ' + text + '\n' + stack);
|
||||
if (stack[0].indexOf("Utils_assert(") == 0)
|
||||
stack.splice(0, 1);
|
||||
|
||||
this.log('trace: ' + text + '\n' + stack.join("\n"));
|
||||
},
|
||||
|
||||
// ----------
|
||||
@ -557,10 +563,10 @@ let Utils = {
|
||||
else
|
||||
text = "tabview assert: " + label;
|
||||
|
||||
// cut off the first two lines of the stack trace, because they're just this function.
|
||||
text += Error().stack.replace(/^.*?\n.*?\n/, "");
|
||||
// cut off the first line of the stack trace, because that's just this function.
|
||||
let stack = Error().stack.split("\n").slice(1);
|
||||
|
||||
throw text;
|
||||
throw text + "\n" + stack.join("\n");
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -585,8 +585,7 @@ function ensureSearchShown(activatedByKeypress) {
|
||||
|
||||
// NOTE: when this function is called by keydown handler, next keypress
|
||||
// event or composition events of IME will be fired on the focused editor.
|
||||
|
||||
function dispatchTabViewSearchEnabledEvent() {
|
||||
let dispatchTabViewSearchEnabledEvent = function dispatchTabViewSearchEnabledEvent() {
|
||||
let newEvent = document.createEvent("Events");
|
||||
newEvent.initEvent("tabviewsearchenabled", false, false);
|
||||
dispatchEvent(newEvent);
|
||||
@ -595,7 +594,7 @@ function ensureSearchShown(activatedByKeypress) {
|
||||
if (activatedByKeypress) {
|
||||
// set the focus so key strokes are entered into the textbox.
|
||||
$searchbox[0].focus();
|
||||
dispatchTabViewSearchEnabledEvent();
|
||||
dispatchTabViewSearchEnabledEvent();
|
||||
} else {
|
||||
// marshal the focusing, otherwise it ends up with searchbox[0].focus gets
|
||||
// called before the search button gets the focus after being pressed.
|
||||
|
@ -482,6 +482,7 @@ TabItem.prototype = Utils.extend(new Item(), new Subscribable(), {
|
||||
// closing tab doesn't belong to a group and no empty group, create a new
|
||||
// one for the new tab.
|
||||
if (!groupClose && gBrowser.tabs.length == 1) {
|
||||
let group;
|
||||
if (this.tab._tabViewTabItem.parent) {
|
||||
group = this.tab._tabViewTabItem.parent;
|
||||
} else {
|
||||
|
@ -1,3 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
|
@ -105,8 +105,8 @@ let ThumbnailStorage = {
|
||||
};
|
||||
if (browser.contentDocument.readyState != "complete" ||
|
||||
browser.webProgress.isLoadingDocument) {
|
||||
browser.addEventListener("load", function() {
|
||||
browser.removeEventListener("load", arguments.callee, true);
|
||||
browser.addEventListener("load", function onLoad() {
|
||||
browser.removeEventListener("load", onLoad, true);
|
||||
checkAndAddToList(browser);
|
||||
}, true);
|
||||
} else {
|
||||
|
@ -861,8 +861,8 @@ let UI = {
|
||||
if (this.restoredClosedTab) {
|
||||
// when the tab view UI is being displayed, update the thumb for the
|
||||
// restored closed tab after the page load
|
||||
tab.linkedBrowser.addEventListener("load", function (event) {
|
||||
tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
tab.linkedBrowser.addEventListener("load", function onLoad(event) {
|
||||
tab.linkedBrowser.removeEventListener("load", onLoad, true);
|
||||
TabItems._update(tab);
|
||||
}, true);
|
||||
}
|
||||
@ -1003,6 +1003,9 @@ let UI = {
|
||||
[
|
||||
#ifdef XP_UNIX
|
||||
"redo",
|
||||
#endif
|
||||
#ifdef XP_MACOSX
|
||||
"fullScreen",
|
||||
#endif
|
||||
"closeWindow", "tabview", "undoCloseTab", "undoCloseWindow",
|
||||
"privatebrowsing"
|
||||
|
@ -260,6 +260,9 @@ _BROWSER_FILES = \
|
||||
browser_addon_bar_shortcut.js \
|
||||
browser_addon_bar_aomlistener.js \
|
||||
test_bug628179.html \
|
||||
browser_wyciwyg_urlbarCopying.js \
|
||||
test_wyciwyg_copying.html \
|
||||
authenticate.sjs \
|
||||
browser_minimize.js \
|
||||
$(NULL)
|
||||
|
||||
|
205
browser/base/content/test/authenticate.sjs
Normal file
205
browser/base/content/test/authenticate.sjs
Normal file
@ -0,0 +1,205 @@
|
||||
function handleRequest(request, response)
|
||||
{
|
||||
try {
|
||||
reallyHandleRequest(request, response);
|
||||
} catch (e) {
|
||||
response.setStatusLine("1.0", 200, "AlmostOK");
|
||||
response.write("Error handling request: " + e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function reallyHandleRequest(request, response) {
|
||||
var match;
|
||||
var requestAuth = true, requestProxyAuth = true;
|
||||
|
||||
// Allow the caller to drive how authentication is processed via the query.
|
||||
// Eg, http://localhost:8888/authenticate.sjs?user=foo&realm=bar
|
||||
var query = request.queryString;
|
||||
|
||||
var expected_user = "", expected_pass = "", realm = "mochitest";
|
||||
var proxy_expected_user = "", proxy_expected_pass = "", proxy_realm = "mochi-proxy";
|
||||
var huge = false, plugin = false;
|
||||
var authHeaderCount = 1;
|
||||
// user=xxx
|
||||
match = /user=([^&]*)/.exec(query);
|
||||
if (match)
|
||||
expected_user = match[1];
|
||||
|
||||
// pass=xxx
|
||||
match = /pass=([^&]*)/.exec(query);
|
||||
if (match)
|
||||
expected_pass = match[1];
|
||||
|
||||
// realm=xxx
|
||||
match = /realm=([^&]*)/.exec(query);
|
||||
if (match)
|
||||
realm = match[1];
|
||||
|
||||
// proxy_user=xxx
|
||||
match = /proxy_user=([^&]*)/.exec(query);
|
||||
if (match)
|
||||
proxy_expected_user = match[1];
|
||||
|
||||
// proxy_pass=xxx
|
||||
match = /proxy_pass=([^&]*)/.exec(query);
|
||||
if (match)
|
||||
proxy_expected_pass = match[1];
|
||||
|
||||
// proxy_realm=xxx
|
||||
match = /proxy_realm=([^&]*)/.exec(query);
|
||||
if (match)
|
||||
proxy_realm = match[1];
|
||||
|
||||
// huge=1
|
||||
match = /huge=1/.exec(query);
|
||||
if (match)
|
||||
huge = true;
|
||||
|
||||
// plugin=1
|
||||
match = /plugin=1/.exec(query);
|
||||
if (match)
|
||||
plugin = true;
|
||||
|
||||
// multiple=1
|
||||
match = /multiple=([^&]*)/.exec(query);
|
||||
if (match)
|
||||
authHeaderCount = match[1]+0;
|
||||
|
||||
|
||||
// Look for an authentication header, if any, in the request.
|
||||
//
|
||||
// EG: Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
|
||||
//
|
||||
// This test only supports Basic auth. The value sent by the client is
|
||||
// "username:password", obscured with base64 encoding.
|
||||
|
||||
var actual_user = "", actual_pass = "", authHeader;
|
||||
if (request.hasHeader("Authorization")) {
|
||||
authHeader = request.getHeader("Authorization");
|
||||
match = /Basic (.+)/.exec(authHeader);
|
||||
if (match.length != 2)
|
||||
throw "Couldn't parse auth header: " + authHeader;
|
||||
|
||||
var userpass = base64ToString(match[1]); // no atob() :-(
|
||||
match = /(.*):(.*)/.exec(userpass);
|
||||
if (match.length != 3)
|
||||
throw "Couldn't decode auth header: " + userpass;
|
||||
actual_user = match[1];
|
||||
actual_pass = match[2];
|
||||
}
|
||||
|
||||
var proxy_actual_user = "", proxy_actual_pass = "";
|
||||
if (request.hasHeader("Proxy-Authorization")) {
|
||||
authHeader = request.getHeader("Proxy-Authorization");
|
||||
match = /Basic (.+)/.exec(authHeader);
|
||||
if (match.length != 2)
|
||||
throw "Couldn't parse auth header: " + authHeader;
|
||||
|
||||
var userpass = base64ToString(match[1]); // no atob() :-(
|
||||
match = /(.*):(.*)/.exec(userpass);
|
||||
if (match.length != 3)
|
||||
throw "Couldn't decode auth header: " + userpass;
|
||||
proxy_actual_user = match[1];
|
||||
proxy_actual_pass = match[2];
|
||||
}
|
||||
|
||||
// Don't request authentication if the credentials we got were what we
|
||||
// expected.
|
||||
if (expected_user == actual_user &&
|
||||
expected_pass == actual_pass) {
|
||||
requestAuth = false;
|
||||
}
|
||||
if (proxy_expected_user == proxy_actual_user &&
|
||||
proxy_expected_pass == proxy_actual_pass) {
|
||||
requestProxyAuth = false;
|
||||
}
|
||||
|
||||
if (requestProxyAuth) {
|
||||
response.setStatusLine("1.0", 407, "Proxy authentication required");
|
||||
for (i = 0; i < authHeaderCount; ++i)
|
||||
response.setHeader("Proxy-Authenticate", "basic realm=\"" + proxy_realm + "\"", true);
|
||||
} else if (requestAuth) {
|
||||
response.setStatusLine("1.0", 401, "Authentication required");
|
||||
for (i = 0; i < authHeaderCount; ++i)
|
||||
response.setHeader("WWW-Authenticate", "basic realm=\"" + realm + "\"", true);
|
||||
} else {
|
||||
response.setStatusLine("1.0", 200, "OK");
|
||||
}
|
||||
|
||||
response.setHeader("Content-Type", "application/xhtml+xml", false);
|
||||
response.write("<html xmlns='http://www.w3.org/1999/xhtml'>");
|
||||
response.write("<p>Login: <span id='ok'>" + (requestAuth ? "FAIL" : "PASS") + "</span></p>\n");
|
||||
response.write("<p>Proxy: <span id='proxy'>" + (requestProxyAuth ? "FAIL" : "PASS") + "</span></p>\n");
|
||||
response.write("<p>Auth: <span id='auth'>" + authHeader + "</span></p>\n");
|
||||
response.write("<p>User: <span id='user'>" + actual_user + "</span></p>\n");
|
||||
response.write("<p>Pass: <span id='pass'>" + actual_pass + "</span></p>\n");
|
||||
|
||||
if (huge) {
|
||||
response.write("<div style='display: none'>");
|
||||
for (i = 0; i < 100000; i++) {
|
||||
response.write("123456789\n");
|
||||
}
|
||||
response.write("</div>");
|
||||
response.write("<span id='footnote'>This is a footnote after the huge content fill</span>");
|
||||
}
|
||||
|
||||
if (plugin) {
|
||||
response.write("<embed id='embedtest' style='width: 400px; height: 100px;' " +
|
||||
"type='application/x-test'></embed>\n");
|
||||
}
|
||||
|
||||
response.write("</html>");
|
||||
}
|
||||
|
||||
|
||||
// base64 decoder
|
||||
//
|
||||
// Yoinked from extensions/xml-rpc/src/nsXmlRpcClient.js because btoa()
|
||||
// doesn't seem to exist. :-(
|
||||
/* Convert Base64 data to a string */
|
||||
const toBinaryTable = [
|
||||
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
|
||||
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
|
||||
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63,
|
||||
52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1, 0,-1,-1,
|
||||
-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,
|
||||
15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,
|
||||
-1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
|
||||
41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1
|
||||
];
|
||||
const base64Pad = '=';
|
||||
|
||||
function base64ToString(data) {
|
||||
|
||||
var result = '';
|
||||
var leftbits = 0; // number of bits decoded, but yet to be appended
|
||||
var leftdata = 0; // bits decoded, but yet to be appended
|
||||
|
||||
// Convert one by one.
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var c = toBinaryTable[data.charCodeAt(i) & 0x7f];
|
||||
var padding = (data[i] == base64Pad);
|
||||
// Skip illegal characters and whitespace
|
||||
if (c == -1) continue;
|
||||
|
||||
// Collect data into leftdata, update bitcount
|
||||
leftdata = (leftdata << 6) | c;
|
||||
leftbits += 6;
|
||||
|
||||
// If we have 8 or more bits, append 8 bits to the result
|
||||
if (leftbits >= 8) {
|
||||
leftbits -= 8;
|
||||
// Append if not padding.
|
||||
if (!padding)
|
||||
result += String.fromCharCode((leftdata >> leftbits) & 0xff);
|
||||
leftdata &= (1 << leftbits) - 1;
|
||||
}
|
||||
}
|
||||
|
||||
// If there are any bits left, the base64 string was corrupted
|
||||
if (leftbits)
|
||||
throw Components.Exception('Corrupted base64 string');
|
||||
|
||||
return result;
|
||||
}
|
@ -2,18 +2,21 @@
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
const trimPref = "browser.urlbar.trimURLs";
|
||||
const phishyUserPassPref = "network.http.phishy-userpass-length";
|
||||
|
||||
function test() {
|
||||
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab();
|
||||
|
||||
registerCleanupFunction(function () {
|
||||
gBrowser.removeCurrentTab();
|
||||
gBrowser.removeTab(tab);
|
||||
Services.prefs.clearUserPref(trimPref);
|
||||
Services.prefs.clearUserPref(phishyUserPassPref);
|
||||
URLBarSetURI();
|
||||
});
|
||||
|
||||
Services.prefs.setBoolPref(trimPref, true);
|
||||
Services.prefs.setIntPref(phishyUserPassPref, 32); // avoid prompting about phishing
|
||||
|
||||
waitForExplicitFinish();
|
||||
|
||||
@ -32,7 +35,6 @@ var tests = [
|
||||
copyExpected: "e"
|
||||
},
|
||||
|
||||
|
||||
// pageproxystate="valid" from this point on (due to the load)
|
||||
{
|
||||
loadURL: "http://example.com/",
|
||||
@ -52,6 +54,13 @@ var tests = [
|
||||
copyExpected: "http://e"
|
||||
},
|
||||
|
||||
// Test that userPass is stripped out
|
||||
{
|
||||
loadURL: "http://user:pass@mochi.test:8888/browser/browser/base/content/test/authenticate.sjs?user=user&pass=pass",
|
||||
expectedURL: "mochi.test:8888/browser/browser/base/content/test/authenticate.sjs?user=user&pass=pass",
|
||||
copyExpected: "http://mochi.test:8888/browser/browser/base/content/test/authenticate.sjs?user=user&pass=pass"
|
||||
},
|
||||
|
||||
// Test escaping
|
||||
{
|
||||
loadURL: "http://example.com/()%C3%A9",
|
||||
|
39
browser/base/content/test/browser_wyciwyg_urlbarCopying.js
Normal file
39
browser/base/content/test/browser_wyciwyg_urlbarCopying.js
Normal file
@ -0,0 +1,39 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
let url = "http://mochi.test:8888/browser/browser/base/content/test/test_wyciwyg_copying.html";
|
||||
let tab = gBrowser.selectedTab = gBrowser.addTab(url);
|
||||
tab.linkedBrowser.addEventListener("pageshow", function () {
|
||||
let btn = content.document.getElementById("btn");
|
||||
executeSoon(function () {
|
||||
EventUtils.synthesizeMouseAtCenter(btn, {}, content);
|
||||
let currentURL = gBrowser.currentURI.spec;
|
||||
ok(/^wyciwyg:\/\//i.test(currentURL), currentURL + " is a wyciwyg URI");
|
||||
|
||||
executeSoon(function () {
|
||||
testURLBarCopy(url, endTest);
|
||||
});
|
||||
});
|
||||
}, false);
|
||||
|
||||
function endTest() {
|
||||
while (gBrowser.tabs.length > 1)
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
}
|
||||
|
||||
function testURLBarCopy(targetValue, cb) {
|
||||
info("Expecting copy of: " + targetValue);
|
||||
waitForClipboard(targetValue, function () {
|
||||
gURLBar.focus();
|
||||
gURLBar.select();
|
||||
|
||||
goDoCommand("cmd_copy");
|
||||
}, cb, cb);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,6 +54,7 @@ _BROWSER_FILES = \
|
||||
browser_inspector_treePanel_output.js \
|
||||
browser_inspector_treePanel_input.html \
|
||||
browser_inspector_treePanel_result.html \
|
||||
browser_inspector_registertools.js \
|
||||
browser_inspector_bug_665880.js \
|
||||
$(NULL)
|
||||
|
||||
|
@ -0,0 +1,275 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Inspector Highlighter Tests.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* The Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2011
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Michael Ratcliffe <mratcliffe@mozilla.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
let doc;
|
||||
let h1;
|
||||
let tool1;
|
||||
let tool2;
|
||||
let tool3;
|
||||
|
||||
function createDocument()
|
||||
{
|
||||
let div = doc.createElement("div");
|
||||
let h1 = doc.createElement("h1");
|
||||
let p1 = doc.createElement("p");
|
||||
let p2 = doc.createElement("p");
|
||||
let div2 = doc.createElement("div");
|
||||
let p3 = doc.createElement("p");
|
||||
doc.title = "Inspector Tree Selection Test";
|
||||
h1.textContent = "Inspector Tree Selection Test";
|
||||
p1.textContent = "This is some example text";
|
||||
p2.textContent = "Lorem ipsum dolor sit amet, consectetur adipisicing " +
|
||||
"elit, sed do eiusmod tempor incididunt ut labore et dolore magna " +
|
||||
"aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco " +
|
||||
"laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure " +
|
||||
"dolor in reprehenderit in voluptate velit esse cillum dolore eu " +
|
||||
"fugiat nulla pariatur. Excepteur sint occaecat cupidatat non " +
|
||||
"proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
|
||||
p3.textContent = "Lorem ipsum dolor sit amet, consectetur adipisicing " +
|
||||
"elit, sed do eiusmod tempor incididunt ut labore et dolore magna " +
|
||||
"aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco " +
|
||||
"laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure " +
|
||||
"dolor in reprehenderit in voluptate velit esse cillum dolore eu " +
|
||||
"fugiat nulla pariatur. Excepteur sint occaecat cupidatat non " +
|
||||
"proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
|
||||
div.appendChild(h1);
|
||||
div.appendChild(p1);
|
||||
div.appendChild(p2);
|
||||
div2.appendChild(p3);
|
||||
doc.body.appendChild(div);
|
||||
doc.body.appendChild(div2);
|
||||
setupHighlighterTests();
|
||||
}
|
||||
|
||||
function setupHighlighterTests()
|
||||
{
|
||||
h1 = doc.querySelectorAll("h1")[0];
|
||||
ok(h1, "we have the header node");
|
||||
Services.obs.addObserver(inspectorOpen, "inspector-opened", false);
|
||||
InspectorUI.toggleInspectorUI();
|
||||
}
|
||||
|
||||
function inspectorOpen()
|
||||
{
|
||||
info("we received the inspector-opened notification");
|
||||
Services.obs.removeObserver(inspectorOpen, "inspector-opened", false);
|
||||
Services.obs.addObserver(startToolTests, "inspector-highlighting", false);
|
||||
let rect = h1.getBoundingClientRect();
|
||||
executeSoon(function() {
|
||||
EventUtils.synthesizeMouse(h1, 2, 2, {type: "mousemove"}, content);
|
||||
});
|
||||
}
|
||||
|
||||
function startToolTests(evt)
|
||||
{
|
||||
info("we received the inspector-highlighting notification");
|
||||
Services.obs.removeObserver(startToolTests, "inspector-highlighting", false);
|
||||
InspectorUI.stopInspecting();
|
||||
|
||||
info("Getting InspectorUI.tools");
|
||||
let tools = InspectorUI.tools;
|
||||
tool1 = InspectorUI.tools["tool_1"];
|
||||
tool2 = InspectorUI.tools["tool_2"];
|
||||
tool3 = InspectorUI.tools["tool_3"];
|
||||
|
||||
info("Checking panel states 1");
|
||||
ok(tool1.context.panelIsClosed, "Panel 1 is closed");
|
||||
ok(tool2.context.panelIsClosed, "Panel 2 is closed");
|
||||
ok(tool3.context.panelIsClosed, "Panel 3 is closed");
|
||||
|
||||
info("Calling show method for all tools");
|
||||
tool1.onShow.apply(tool1.context, [h1]);
|
||||
tool2.onShow.apply(tool2.context, [h1]);
|
||||
tool3.onShow.apply(tool3.context, [h1]);
|
||||
|
||||
info("Checking panel states 2");
|
||||
ok(tool1.context.panelIsOpen, "Panel 1 is open");
|
||||
ok(tool2.context.panelIsOpen, "Panel 2 is open");
|
||||
ok(tool3.context.panelIsOpen, "Panel 3 is open");
|
||||
|
||||
info("Calling selectNode method for all tools");
|
||||
tool1.onSelect.apply(tool1.context, [h1]);
|
||||
tool2.onSelect.apply(tool2.context, [h1]);
|
||||
tool3.onSelect.apply(tool3.context, [h1]);
|
||||
|
||||
info("Calling hide method for all tools");
|
||||
tool1.onHide.apply(tool1.context, [h1]);
|
||||
tool2.onHide.apply(tool2.context, [h1]);
|
||||
tool3.onHide.apply(tool3.context, [h1]);
|
||||
|
||||
info("Checking panel states 3");
|
||||
ok(tool1.context.panelIsClosed, "Panel 1 is closed");
|
||||
ok(tool2.context.panelIsClosed, "Panel 2 is closed");
|
||||
ok(tool3.context.panelIsClosed, "Panel 3 is closed");
|
||||
|
||||
info("Showing tools 1 & 3");
|
||||
tool1.onShow.apply(tool1.context, [h1]);
|
||||
tool3.onShow.apply(tool3.context, [h1]);
|
||||
|
||||
info("Checking panel states 4");
|
||||
ok(tool1.context.panelIsOpen, "Panel 1 is open");
|
||||
ok(tool2.context.panelIsClosed, "Panel 2 is closed");
|
||||
ok(tool3.context.panelIsOpen, "Panel 3 is open");
|
||||
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("load", function() {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
waitForFocus(testSecondTab, content);
|
||||
}, true);
|
||||
|
||||
content.location = "data:text/html,registertool new tab test for inspector";
|
||||
}
|
||||
|
||||
function testSecondTab()
|
||||
{
|
||||
info("Opened second tab");
|
||||
info("Checking panel states 5");
|
||||
ok(tool1.context.panelIsClosed, "Panel 1 is closed");
|
||||
ok(tool2.context.panelIsClosed, "Panel 2 is closed");
|
||||
ok(tool3.context.panelIsClosed, "Panel 3 is closed");
|
||||
|
||||
info("Closing current tab");
|
||||
gBrowser.removeCurrentTab();
|
||||
|
||||
info("Checking panel states 6");
|
||||
ok(tool1.context.panelIsOpen, "Panel 1 is open");
|
||||
ok(tool2.context.panelIsClosed, "Panel 2 is closed");
|
||||
ok(tool3.context.panelIsOpen, "Panel 3 is open");
|
||||
|
||||
executeSoon(finishUp);
|
||||
}
|
||||
|
||||
function finishUp() {
|
||||
InspectorUI.closeInspectorUI(true);
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
}
|
||||
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("load", function() {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
doc = content.document;
|
||||
waitForFocus(registerTools, content);
|
||||
}, true);
|
||||
|
||||
content.location = "data:text/html,registertool tests for inspector";
|
||||
}
|
||||
|
||||
function registerTools()
|
||||
{
|
||||
createDocument();
|
||||
registerTool(new testTool("tool_1", "Tool 1", "Tool 1 tooltip", "I"));
|
||||
registerTool(new testTool("tool_2", "Tool 2", "Tool 2 tooltip", "J"));
|
||||
registerTool(new testTool("tool_3", "Tool 3", "Tool 3 tooltip", "K"));
|
||||
}
|
||||
|
||||
function registerTool(aTool)
|
||||
{
|
||||
InspectorUI.registerTool({
|
||||
id: aTool.id,
|
||||
label: aTool.label,
|
||||
tooltiptext: aTool.tooltip,
|
||||
accesskey: aTool.accesskey,
|
||||
context: aTool,
|
||||
onSelect: aTool.selectNode,
|
||||
onShow: aTool.show,
|
||||
onHide: aTool.hide,
|
||||
panel: aTool.panel
|
||||
});
|
||||
}
|
||||
|
||||
// Tool Object
|
||||
function testTool(aToolId, aLabel, aTooltip, aAccesskey)
|
||||
{
|
||||
this.id = aToolId;
|
||||
this.label = aLabel;
|
||||
this.tooltip = aTooltip;
|
||||
this.accesskey = aAccesskey
|
||||
this.panel = this.createPanel();
|
||||
}
|
||||
|
||||
testTool.prototype = {
|
||||
get panelIsOpen()
|
||||
{
|
||||
return this.panel.state == "open" || this.panel.state == "showing";
|
||||
},
|
||||
|
||||
get panelIsClosed()
|
||||
{
|
||||
return this.panel.state == "closed" || this.panel.state == "hiding";
|
||||
},
|
||||
|
||||
selectNode: function BIR_selectNode(aNode) {
|
||||
is(InspectorUI.selection, aNode,
|
||||
"selectNode: currently selected node was passed: " + this.id);
|
||||
},
|
||||
|
||||
show: function BIR_show(aNode) {
|
||||
this.panel.openPopup(gBrowser.selectedBrowser,
|
||||
"end_before", 0, 20, false, false);
|
||||
is(InspectorUI.selection, aNode,
|
||||
"show: currently selected node was passed: " + this.id);
|
||||
},
|
||||
|
||||
hide: function BIR_hide() {
|
||||
info(this.id + " hide");
|
||||
this.panel.hidePopup();
|
||||
},
|
||||
|
||||
createPanel: function BIR_createPanel() {
|
||||
let popupSet = document.getElementById("mainPopupSet");
|
||||
let ns = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
let panel = this.panel = document.createElementNS(ns, "panel");
|
||||
panel.setAttribute("orient", "vertical");
|
||||
panel.setAttribute("noautofocus", "true");
|
||||
panel.setAttribute("noautohide", "true");
|
||||
panel.setAttribute("titlebar", "normal");
|
||||
panel.setAttribute("close", "true");
|
||||
panel.setAttribute("label", "Panel for " + this.id);
|
||||
panel.setAttribute("width", 200);
|
||||
panel.setAttribute("height", 400);
|
||||
popupSet.appendChild(panel);
|
||||
|
||||
ok(panel.parentNode == popupSet, "Panel created and appended successfully");
|
||||
return panel;
|
||||
},
|
||||
};
|
@ -71,12 +71,12 @@ function part2(win) {
|
||||
// switch the selected tab to new tab
|
||||
win.gBrowser.selectedTab = newTab;
|
||||
|
||||
win.addEventListener("tabviewhidden", function () {
|
||||
win.removeEventListener("tabviewhidden", arguments.callee, false);
|
||||
whenTabViewIsHidden(function () {
|
||||
is(win.gBrowser.selectedTab, newTab, "The seleted tab should be the same as before (new tab)");
|
||||
win.close();
|
||||
finish();
|
||||
}, false);
|
||||
});
|
||||
|
||||
// show tabview
|
||||
EventUtils.synthesizeKey("e", { accelKey: true, shiftKey: true }, win);
|
||||
// hide tabview
|
||||
|
@ -9,8 +9,8 @@ function test() {
|
||||
|
||||
// open a new window and setup the window state.
|
||||
newWin = openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no");
|
||||
newWin.addEventListener("load", function(event) {
|
||||
this.removeEventListener("load", arguments.callee, false);
|
||||
newWin.addEventListener("load", function onLoad(event) {
|
||||
this.removeEventListener("load", onLoad, false);
|
||||
|
||||
let newState = {
|
||||
windows: [{
|
||||
|
@ -55,8 +55,8 @@ function onTabViewWindowLoaded(win, tab) {
|
||||
contentWindow.performSearch();
|
||||
|
||||
// prepare to finish when the main window gets focus back
|
||||
window.addEventListener('focus', function () {
|
||||
window.removeEventListener('focus', arguments.callee, true);
|
||||
window.addEventListener('focus', function onFocus() {
|
||||
window.removeEventListener('focus', onFocus, true);
|
||||
assertSearchIsDisabled();
|
||||
|
||||
// check that the right tab is active
|
||||
|
@ -11,12 +11,10 @@ function onTabViewShown(win) {
|
||||
let contentWindow = win.TabView.getContentWindow();
|
||||
|
||||
let finishTest = function () {
|
||||
win.addEventListener('tabviewhidden', function () {
|
||||
win.removeEventListener('tabviewhidden', arguments.callee, false);
|
||||
hideTabView(function () {
|
||||
win.close();
|
||||
finish();
|
||||
}, false);
|
||||
win.TabView.hide();
|
||||
}, win);
|
||||
}
|
||||
|
||||
// do not let the group arrange itself
|
||||
|
@ -8,16 +8,14 @@ function test() {
|
||||
let windowOne = openDialog(location, "", "chrome,all,dialog=no", "data:text/html,");
|
||||
let windowTwo;
|
||||
|
||||
windowOne.addEventListener("load", function() {
|
||||
windowOne.removeEventListener("load", arguments.callee, false);
|
||||
windowOne.gBrowser.selectedBrowser.addEventListener("load", function() {
|
||||
windowOne.gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
whenWindowLoaded(windowOne, function () {
|
||||
windowOne.gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
|
||||
windowOne.gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
|
||||
|
||||
windowTwo = openDialog(location, "", "chrome,all,dialog=no", "http://mochi.test:8888/");
|
||||
windowTwo.addEventListener("load", function() {
|
||||
windowTwo.removeEventListener("load", arguments.callee, false);
|
||||
windowTwo.gBrowser.selectedBrowser.addEventListener("load", function() {
|
||||
windowTwo.gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
whenWindowLoaded(windowTwo, function () {
|
||||
windowTwo.gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
|
||||
windowTwo.gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
|
||||
|
||||
newWindows = [ windowOne, windowTwo ];
|
||||
|
||||
@ -26,9 +24,9 @@ function test() {
|
||||
ok(!TabView.isVisible(), "Tab View is hidden");
|
||||
TabView.toggle();
|
||||
}, true);
|
||||
}, false);
|
||||
});
|
||||
}, true);
|
||||
}, false);
|
||||
});
|
||||
}
|
||||
|
||||
function onTabViewWindowLoaded() {
|
||||
|
@ -25,7 +25,7 @@ function onTabViewWindowLoaded() {
|
||||
|
||||
// create a group item
|
||||
let groupItem = createGroupItemWithBlankTabs(window, 300, 300, 400, 1);
|
||||
groupItemId = groupItem.id;
|
||||
let groupItemId = groupItem.id;
|
||||
is(groupItem.getChildren().length, 1, "The new group has a tab item");
|
||||
// start the tests
|
||||
waitForFocus(function() {
|
||||
|
@ -168,8 +168,8 @@ function whenTabViewIsHidden(callback, win) {
|
||||
return;
|
||||
}
|
||||
|
||||
win.addEventListener('tabviewhidden', function () {
|
||||
win.removeEventListener('tabviewhidden', arguments.callee, false);
|
||||
win.addEventListener('tabviewhidden', function onHidden() {
|
||||
win.removeEventListener('tabviewhidden', onHidden, false);
|
||||
callback();
|
||||
}, false);
|
||||
}
|
||||
@ -183,8 +183,8 @@ function whenTabViewIsShown(callback, win) {
|
||||
return;
|
||||
}
|
||||
|
||||
win.addEventListener('tabviewshown', function () {
|
||||
win.removeEventListener('tabviewshown', arguments.callee, false);
|
||||
win.addEventListener('tabviewshown', function onShown() {
|
||||
win.removeEventListener('tabviewshown', onShown, false);
|
||||
callback();
|
||||
}, false);
|
||||
}
|
||||
|
13
browser/base/content/test/test_wyciwyg_copying.html
Normal file
13
browser/base/content/test/test_wyciwyg_copying.html
Normal file
@ -0,0 +1,13 @@
|
||||
<html>
|
||||
<body>
|
||||
<script>
|
||||
function go() {
|
||||
var w = window.open();
|
||||
w.document.open();
|
||||
w.document.write("<html><body>test document</body></html>");
|
||||
w.document.close();
|
||||
}
|
||||
</script>
|
||||
<button id="btn" onclick="go();">test</button>
|
||||
</body>
|
||||
</html>
|
@ -510,6 +510,10 @@
|
||||
return selectedVal;
|
||||
|
||||
let uri = gBrowser.currentURI;
|
||||
// Only copy exposable URIs
|
||||
try {
|
||||
uri = Cc["@mozilla.org/docshell/urifixup;1"].getService(Ci.nsIURIFixup).createExposableURI(uri);
|
||||
} catch (ex) {}
|
||||
|
||||
// If the entire URL is selected, just use the actual loaded URI.
|
||||
if (inputVal == selectedVal) {
|
||||
|
@ -42,8 +42,6 @@
|
||||
// Services = object with smart getters for common XPCOM services
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
var TAB_DROP_TYPE = "application/x-moz-tabbrowser-tab";
|
||||
|
||||
var gBidiUI = false;
|
||||
|
||||
function getBrowserURL()
|
||||
|
@ -93,5 +93,3 @@ browser.jar:
|
||||
# the following files are browser-specific overrides
|
||||
* content/browser/license.html (/toolkit/content/license.html)
|
||||
% override chrome://global/content/license.html chrome://browser/content/license.html
|
||||
# XXXkhuey This really should live in browser/, but it's too late in the release cycle to move
|
||||
+ content/browser/NetworkPanel.xhtml (/toolkit/components/console/hudservice/NetworkPanel.xhtml)
|
||||
|
@ -47,8 +47,6 @@ endif
|
||||
|
||||
tier_app_dirs += $(MOZ_BRANDING_DIRECTORY)
|
||||
|
||||
tier_app_dirs += toolkit/components/console/hudservice
|
||||
|
||||
ifdef MOZ_SERVICES_SYNC
|
||||
tier_app_dirs += services
|
||||
endif
|
||||
|
@ -282,11 +282,11 @@ nsProfileMigrator::ImportRegistryProfiles(const nsACString& aAppName)
|
||||
|
||||
nsCOMPtr<nsIToolkitProfileService> profileSvc
|
||||
(do_GetService(NS_PROFILESERVICE_CONTRACTID));
|
||||
NS_ENSURE_TRUE(profileSvc, NS_ERROR_FAILURE);
|
||||
NS_ENSURE_TRUE(profileSvc, PR_FALSE);
|
||||
|
||||
nsCOMPtr<nsIProperties> dirService
|
||||
(do_GetService("@mozilla.org/file/directory_service;1"));
|
||||
NS_ENSURE_TRUE(dirService, NS_ERROR_FAILURE);
|
||||
NS_ENSURE_TRUE(dirService, PR_FALSE);
|
||||
|
||||
nsCOMPtr<nsILocalFile> regFile;
|
||||
#ifdef XP_WIN
|
||||
|
@ -151,9 +151,8 @@ BrowserGlue.prototype = {
|
||||
}
|
||||
delay = delay <= MAX_DELAY ? delay : MAX_DELAY;
|
||||
|
||||
let syncTemp = {};
|
||||
Cu.import("resource://services-sync/service.js", syncTemp);
|
||||
syncTemp.Weave.Service.delayedAutoConnect(delay);
|
||||
Cu.import("resource://services-sync/main.js");
|
||||
Weave.SyncScheduler.delayedAutoConnect(delay);
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -1396,17 +1396,13 @@ let PlacesControllerDragHelper = {
|
||||
|
||||
// Urls can be dropped on any insertionpoint.
|
||||
// XXXmano: remember that this method is called for each dragover event!
|
||||
// Thus we shouldn't use unwrapNodes here at all if possible.
|
||||
// I think it would be OK to accept bogus data here (e.g. text which was
|
||||
// somehow wrapped as TAB_DROP_TYPE, this is not in our control, and
|
||||
// will just case the actual drop to be a no-op), and only rule out valid
|
||||
// Thus we shouldn't use unwrapNodes here at all if possible. I think it
|
||||
// would be OK to accept bogus data here (this is not in our control and
|
||||
// will just case the actual drop to be a no-op) and only rule out valid
|
||||
// expected cases, which are either unsupported flavors, or items which
|
||||
// cannot be dropped in the current insertionpoint. The last case will
|
||||
// likely force us to use unwrapNodes for the private data types of
|
||||
// places.
|
||||
if (flavor == TAB_DROP_TYPE)
|
||||
continue;
|
||||
|
||||
let data = dt.mozGetDataAt(flavor, i);
|
||||
let dragged;
|
||||
try {
|
||||
@ -1520,21 +1516,8 @@ let PlacesControllerDragHelper = {
|
||||
|
||||
let data = dt.mozGetDataAt(flavor, i);
|
||||
let unwrapped;
|
||||
if (flavor != TAB_DROP_TYPE) {
|
||||
// There's only ever one in the D&D case.
|
||||
unwrapped = PlacesUtils.unwrapNodes(data, flavor)[0];
|
||||
}
|
||||
else if (data instanceof XULElement && data.localName == "tab" &&
|
||||
data.ownerDocument.defaultView instanceof ChromeWindow) {
|
||||
let uri = data.linkedBrowser.currentURI;
|
||||
let spec = uri ? uri.spec : "about:blank";
|
||||
let title = data.label;
|
||||
unwrapped = { uri: spec,
|
||||
title: data.label,
|
||||
type: PlacesUtils.TYPE_X_MOZ_URL};
|
||||
}
|
||||
else
|
||||
throw("bogus data was passed as a tab")
|
||||
// There's only ever one in the D&D case.
|
||||
unwrapped = PlacesUtils.unwrapNodes(data, flavor)[0];
|
||||
|
||||
let index = insertionPoint.index;
|
||||
|
||||
@ -1588,7 +1571,6 @@ let PlacesControllerDragHelper = {
|
||||
PlacesUtils.TYPE_X_MOZ_PLACE_SEPARATOR,
|
||||
PlacesUtils.TYPE_X_MOZ_PLACE,
|
||||
PlacesUtils.TYPE_X_MOZ_URL,
|
||||
TAB_DROP_TYPE,
|
||||
PlacesUtils.TYPE_UNICODE],
|
||||
};
|
||||
|
||||
|
@ -250,7 +250,7 @@ SessionStartup.prototype = {
|
||||
/* ........ Public API ................*/
|
||||
|
||||
/**
|
||||
* Get the session state as a string
|
||||
* Get the session state as a jsval
|
||||
*/
|
||||
get state() {
|
||||
return this._initialState;
|
||||
|
@ -116,7 +116,7 @@ const CAPABILITIES = [
|
||||
// These keys are for internal use only - they shouldn't be part of the JSON
|
||||
// that gets saved to disk nor part of the strings returned by the API.
|
||||
const INTERNAL_KEYS = ["_tabStillLoading", "_hosts", "_formDataSaved",
|
||||
"_shouldRestore"];
|
||||
"_shouldRestore", "_host", "_scheme"];
|
||||
|
||||
// These are tab events that we listen to.
|
||||
const TAB_EVENTS = ["TabOpen", "TabClose", "TabSelect", "TabShow", "TabHide",
|
||||
@ -128,6 +128,8 @@ const TAB_EVENTS = ["TabOpen", "TabClose", "TabSelect", "TabShow", "TabHide",
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
// debug.js adds NS_ASSERT. cf. bug 669196
|
||||
Cu.import("resource://gre/modules/debug.js");
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "NetUtil", function() {
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
@ -1669,10 +1671,31 @@ SessionStoreService.prototype = {
|
||||
tabData.index = history.index + 1;
|
||||
}
|
||||
else if (history && history.count > 0) {
|
||||
for (var j = 0; j < history.count; j++) {
|
||||
let entry = this._serializeHistoryEntry(history.getEntryAtIndex(j, false),
|
||||
aFullData, aTab.pinned);
|
||||
tabData.entries.push(entry);
|
||||
try {
|
||||
for (var j = 0; j < history.count; j++) {
|
||||
let entry = this._serializeHistoryEntry(history.getEntryAtIndex(j, false),
|
||||
aFullData, aTab.pinned);
|
||||
tabData.entries.push(entry);
|
||||
}
|
||||
// If we make it through the for loop, then we're ok and we should clear
|
||||
// any indicator of brokenness.
|
||||
delete aTab.__SS_broken_history;
|
||||
}
|
||||
catch (ex) {
|
||||
// In some cases, getEntryAtIndex will throw. This seems to be due to
|
||||
// history.count being higher than it should be. By doing this in a
|
||||
// try-catch, we'll update history to where it breaks, assert for
|
||||
// non-release builds, and still save sessionstore.js. We'll track if
|
||||
// we've shown the assert for this tab so we only show it once.
|
||||
// cf. bug 669196.
|
||||
if (!aTab.__SS_broken_history) {
|
||||
// First Focus the window & tab we're having trouble with.
|
||||
aTab.ownerDocument.defaultView.focus();
|
||||
aTab.ownerDocument.defaultView.gBrowser.selectedTab = aTab;
|
||||
NS_ASSERT(false, "SessionStore failed gathering complete history " +
|
||||
"for the focused window/tab. See bug 669196.");
|
||||
aTab.__SS_broken_history = true;
|
||||
}
|
||||
}
|
||||
tabData.index = history.index + 1;
|
||||
|
||||
@ -1747,7 +1770,15 @@ SessionStoreService.prototype = {
|
||||
_serializeHistoryEntry:
|
||||
function sss_serializeHistoryEntry(aEntry, aFullData, aIsPinned) {
|
||||
var entry = { url: aEntry.URI.spec };
|
||||
|
||||
|
||||
try {
|
||||
entry._host = aEntry.URI.host;
|
||||
entry._scheme = aEntry.URI.scheme;
|
||||
}
|
||||
catch (ex) {
|
||||
// We just won't attempt to get cookies for this entry.
|
||||
}
|
||||
|
||||
if (aEntry.title && aEntry.title != entry.url) {
|
||||
entry.title = aEntry.title;
|
||||
}
|
||||
@ -2155,21 +2186,20 @@ SessionStoreService.prototype = {
|
||||
*/
|
||||
_extractHostsForCookies:
|
||||
function sss__extractHostsForCookies(aEntry, aHosts, aCheckPrivacy, aIsPinned) {
|
||||
let match;
|
||||
|
||||
if ((match = /^https?:\/\/(?:[^@\/\s]+@)?([\w.-]+)/.exec(aEntry.url)) != null) {
|
||||
if (!aHosts[match[1]] &&
|
||||
(!aCheckPrivacy ||
|
||||
this._checkPrivacyLevel(this._getURIFromString(aEntry.url).schemeIs("https"),
|
||||
aIsPinned))) {
|
||||
// By setting this to true or false, we can determine when looking at
|
||||
// the host in _updateCookies if we should check for privacy.
|
||||
aHosts[match[1]] = aIsPinned;
|
||||
}
|
||||
// _host and _scheme may not be set (for about: urls for example), in which
|
||||
// case testing _scheme will be sufficient.
|
||||
if (/https?/.test(aEntry._scheme) && !aHosts[aEntry._host] &&
|
||||
(!aCheckPrivacy ||
|
||||
this._checkPrivacyLevel(aEntry._scheme == "https", aIsPinned))) {
|
||||
// By setting this to true or false, we can determine when looking at
|
||||
// the host in _updateCookies if we should check for privacy.
|
||||
aHosts[aEntry._host] = aIsPinned;
|
||||
}
|
||||
else if ((match = /^file:\/\/([^\/]*)/.exec(aEntry.url)) != null) {
|
||||
aHosts[match[1]] = true;
|
||||
else if (aEntry._scheme == "file") {
|
||||
aHosts[aEntry._host] = true;
|
||||
}
|
||||
|
||||
if (aEntry.children) {
|
||||
aEntry.children.forEach(function(entry) {
|
||||
this._extractHostsForCookies(entry, aHosts, aCheckPrivacy, aIsPinned);
|
||||
|
@ -12,14 +12,15 @@
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is the Netscape security libraries.
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Netscape Communications Corporation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 1994-2000
|
||||
# Portions created by the Initial Developer are Copyright (C) 1998
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Rob Campbell <rcampbell@mozilla.com>
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@ -35,4 +36,21 @@
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
include $(CORE_DEPTH)/coreconf/Linux.mk
|
||||
DEPTH = ../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
DIRS = \
|
||||
webconsole \
|
||||
$(NULL)
|
||||
|
||||
ifdef ENABLE_TESTS
|
||||
# DIRS += test # no tests yet
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
2
browser/devtools/jar.mn
Normal file
2
browser/devtools/jar.mn
Normal file
@ -0,0 +1,2 @@
|
||||
browser.jar:
|
||||
content/browser/NetworkPanel.xhtml (webconsole/NetworkPanel.xhtml)
|
@ -1730,7 +1730,7 @@ HUD_SERVICE.prototype =
|
||||
hud.consoleWindowUnregisterOnHide = false;
|
||||
|
||||
// Remove the HUDBox and the consolePanel if the Web Console is inside a
|
||||
// floating xul:panel.
|
||||
// floating panel.
|
||||
hud.HUDBox.parentNode.removeChild(hud.HUDBox);
|
||||
if (hud.consolePanel) {
|
||||
hud.consolePanel.parentNode.removeChild(hud.consolePanel);
|
||||
@ -2505,20 +2505,20 @@ HUD_SERVICE.prototype =
|
||||
let outputNode = this.hudReferences[hudId].outputNode;
|
||||
|
||||
let chromeDocument = outputNode.ownerDocument;
|
||||
let msgNode = chromeDocument.createElementNS(XUL_NS, "xul:hbox");
|
||||
let msgNode = chromeDocument.createElementNS(XUL_NS, "hbox");
|
||||
|
||||
let methodNode = chromeDocument.createElementNS(XUL_NS, "xul:label");
|
||||
let methodNode = chromeDocument.createElementNS(XUL_NS, "label");
|
||||
methodNode.setAttribute("value", aActivityObject.method);
|
||||
methodNode.classList.add("webconsole-msg-body-piece");
|
||||
msgNode.appendChild(methodNode);
|
||||
|
||||
let linkNode = chromeDocument.createElementNS(XUL_NS, "xul:hbox");
|
||||
let linkNode = chromeDocument.createElementNS(XUL_NS, "hbox");
|
||||
linkNode.setAttribute("flex", "1");
|
||||
linkNode.classList.add("webconsole-msg-body-piece");
|
||||
linkNode.classList.add("webconsole-msg-link");
|
||||
msgNode.appendChild(linkNode);
|
||||
|
||||
let urlNode = chromeDocument.createElementNS(XUL_NS, "xul:label");
|
||||
let urlNode = chromeDocument.createElementNS(XUL_NS, "label");
|
||||
urlNode.setAttribute("crop", "center");
|
||||
urlNode.setAttribute("flex", "1");
|
||||
urlNode.setAttribute("title", aActivityObject.url);
|
||||
@ -2528,7 +2528,7 @@ HUD_SERVICE.prototype =
|
||||
urlNode.classList.add("webconsole-msg-url");
|
||||
linkNode.appendChild(urlNode);
|
||||
|
||||
let statusNode = chromeDocument.createElementNS(XUL_NS, "xul:label");
|
||||
let statusNode = chromeDocument.createElementNS(XUL_NS, "label");
|
||||
statusNode.setAttribute("value", "");
|
||||
statusNode.classList.add("hud-clickable");
|
||||
statusNode.classList.add("webconsole-msg-body-piece");
|
||||
@ -3040,7 +3040,7 @@ HeadsUpDisplay.prototype = {
|
||||
*/
|
||||
get tab()
|
||||
{
|
||||
// TODO: we should only keep a reference to the xul:tab object and use
|
||||
// TODO: we should only keep a reference to the tab object and use
|
||||
// getters to determine the rest of objects we need - the chrome window,
|
||||
// document, etc. We should simplify the entire code to use only a single
|
||||
// tab object ref. See bug 656231.
|
||||
@ -3136,12 +3136,15 @@ HeadsUpDisplay.prototype = {
|
||||
|
||||
panel.addEventListener("popupshown", onPopupShown,false);
|
||||
|
||||
let onPopupHiding = (function HUD_onPopupHiding(aEvent) {
|
||||
let onPopupHidden = (function HUD_onPopupHidden(aEvent) {
|
||||
if (aEvent.target != panel) {
|
||||
return;
|
||||
}
|
||||
|
||||
panel.removeEventListener("popuphiding", onPopupHiding, false);
|
||||
panel.removeEventListener("popuphidden", onPopupHidden, false);
|
||||
if (panel.parentNode) {
|
||||
panel.parentNode.removeChild(panel);
|
||||
}
|
||||
|
||||
let width = 0;
|
||||
try {
|
||||
@ -3149,12 +3152,15 @@ HeadsUpDisplay.prototype = {
|
||||
}
|
||||
catch (ex) { }
|
||||
|
||||
if (width > -1) {
|
||||
if (width > 0) {
|
||||
Services.prefs.setIntPref("devtools.webconsole.width", panel.clientWidth);
|
||||
}
|
||||
|
||||
Services.prefs.setIntPref("devtools.webconsole.top", panel.popupBoxObject.y);
|
||||
Services.prefs.setIntPref("devtools.webconsole.left", panel.popupBoxObject.x);
|
||||
/*
|
||||
* Removed because of bug 674562
|
||||
* Services.prefs.setIntPref("devtools.webconsole.top", panel.panelBox.y);
|
||||
* Services.prefs.setIntPref("devtools.webconsole.left", panel.panelBox.x);
|
||||
*/
|
||||
|
||||
// Make sure we are not going to close again, drop the hudId reference of
|
||||
// the panel.
|
||||
@ -3170,19 +3176,6 @@ HeadsUpDisplay.prototype = {
|
||||
this.consolePanel = null;
|
||||
}).bind(this);
|
||||
|
||||
panel.addEventListener("popuphiding", onPopupHiding, false);
|
||||
|
||||
let onPopupHidden = (function HUD_onPopupHidden(aEvent) {
|
||||
if (aEvent.target != panel) {
|
||||
return;
|
||||
}
|
||||
|
||||
panel.removeEventListener("popuphidden", onPopupHidden, false);
|
||||
if (panel.parentNode) {
|
||||
panel.parentNode.removeChild(panel);
|
||||
}
|
||||
}).bind(this);
|
||||
|
||||
panel.addEventListener("popuphidden", onPopupHidden, false);
|
||||
|
||||
let lastIndex = -1;
|
||||
@ -3249,10 +3242,14 @@ HeadsUpDisplay.prototype = {
|
||||
positionConsole: function HUD_positionConsole(aPosition)
|
||||
{
|
||||
if (!(aPosition in this.positions)) {
|
||||
throw new Error("Incorrect argument: " + aPosition + ". Cannot position Web Console");
|
||||
throw new Error("Incorrect argument: " + aPosition +
|
||||
". Cannot position Web Console");
|
||||
}
|
||||
|
||||
if (aPosition == "window") {
|
||||
let closeButton = this.consoleFilterToolbar.
|
||||
querySelector(".webconsole-close-button");
|
||||
closeButton.setAttribute("hidden", "true");
|
||||
this.createOwnWindowPanel();
|
||||
this.positionMenuitems.window.setAttribute("checked", true);
|
||||
if (this.positionMenuitems.last) {
|
||||
@ -3308,6 +3305,10 @@ HeadsUpDisplay.prototype = {
|
||||
this.outputNode.ensureIndexIsVisible(lastIndex);
|
||||
}
|
||||
|
||||
let closeButton = this.consoleFilterToolbar.
|
||||
getElementsByClassName("webconsole-close-button")[0];
|
||||
closeButton.removeAttribute("hidden");
|
||||
|
||||
this.uiInOwnWindow = false;
|
||||
if (this.consolePanel) {
|
||||
this.HUDBox.removeAttribute("flex");
|
||||
@ -3584,7 +3585,7 @@ HeadsUpDisplay.prototype = {
|
||||
* Creates the UI for re-positioning the console
|
||||
*
|
||||
* @return nsIDOMNode
|
||||
* The xul:toolbarbutton which holds the menu that allows the user to
|
||||
* The toolbarbutton which holds the menu that allows the user to
|
||||
* change the console position.
|
||||
*/
|
||||
createPositionUI: function HUD_createPositionUI()
|
||||
@ -5396,22 +5397,22 @@ ConsoleUtils = {
|
||||
// Make the icon container, which is a vertical box. Its purpose is to
|
||||
// ensure that the icon stays anchored at the top of the message even for
|
||||
// long multi-line messages.
|
||||
let iconContainer = aDocument.createElementNS(XUL_NS, "xul:vbox");
|
||||
let iconContainer = aDocument.createElementNS(XUL_NS, "vbox");
|
||||
iconContainer.classList.add("webconsole-msg-icon-container");
|
||||
|
||||
// Make the icon node. It's sprited and the actual region of the image is
|
||||
// determined by CSS rules.
|
||||
let iconNode = aDocument.createElementNS(XUL_NS, "xul:image");
|
||||
let iconNode = aDocument.createElementNS(XUL_NS, "image");
|
||||
iconNode.classList.add("webconsole-msg-icon");
|
||||
iconContainer.appendChild(iconNode);
|
||||
|
||||
// Make the spacer that positions the icon.
|
||||
let spacer = aDocument.createElementNS(XUL_NS, "xul:spacer");
|
||||
let spacer = aDocument.createElementNS(XUL_NS, "spacer");
|
||||
spacer.setAttribute("flex", "1");
|
||||
iconContainer.appendChild(spacer);
|
||||
|
||||
// Create the message body, which contains the actual text of the message.
|
||||
let bodyNode = aDocument.createElementNS(XUL_NS, "xul:description");
|
||||
let bodyNode = aDocument.createElementNS(XUL_NS, "description");
|
||||
bodyNode.setAttribute("flex", "1");
|
||||
bodyNode.classList.add("webconsole-msg-body");
|
||||
|
||||
@ -5425,12 +5426,15 @@ ConsoleUtils = {
|
||||
|
||||
bodyNode.appendChild(aBody);
|
||||
|
||||
let repeatNode = aDocument.createElementNS(XUL_NS, "xul:label");
|
||||
let repeatContainer = aDocument.createElementNS(XUL_NS, "hbox");
|
||||
repeatContainer.setAttribute("align", "start");
|
||||
let repeatNode = aDocument.createElementNS(XUL_NS, "label");
|
||||
repeatNode.setAttribute("value", "1");
|
||||
repeatNode.classList.add("webconsole-msg-repeat");
|
||||
repeatContainer.appendChild(repeatNode);
|
||||
|
||||
// Create the timestamp.
|
||||
let timestampNode = aDocument.createElementNS(XUL_NS, "xul:label");
|
||||
let timestampNode = aDocument.createElementNS(XUL_NS, "label");
|
||||
timestampNode.classList.add("webconsole-timestamp");
|
||||
let timestamp = ConsoleUtils.timestamp();
|
||||
let timestampString = ConsoleUtils.timestampString(timestamp);
|
||||
@ -5445,7 +5449,7 @@ ConsoleUtils = {
|
||||
}
|
||||
|
||||
// Create the containing node and append all its elements to it.
|
||||
let node = aDocument.createElementNS(XUL_NS, "xul:richlistitem");
|
||||
let node = aDocument.createElementNS(XUL_NS, "richlistitem");
|
||||
node.clipboardText = aClipboardText;
|
||||
node.classList.add("hud-msg-node");
|
||||
|
||||
@ -5455,7 +5459,7 @@ ConsoleUtils = {
|
||||
node.appendChild(timestampNode); // childNode[0]
|
||||
node.appendChild(iconContainer); // childNode[1]
|
||||
node.appendChild(bodyNode); // childNode[2]
|
||||
node.appendChild(repeatNode); // childNode[3]
|
||||
node.appendChild(repeatContainer); // childNode[3]
|
||||
if (locationNode) {
|
||||
node.appendChild(locationNode); // childNode[4]
|
||||
}
|
||||
@ -5520,7 +5524,7 @@ ConsoleUtils = {
|
||||
createLocationNode:
|
||||
function ConsoleUtils_createLocationNode(aDocument, aSourceURL,
|
||||
aSourceLine) {
|
||||
let locationNode = aDocument.createElementNS(XUL_NS, "xul:label");
|
||||
let locationNode = aDocument.createElementNS(XUL_NS, "label");
|
||||
|
||||
// Create the text, which consists of an abbreviated version of the URL
|
||||
// plus an optional line number.
|
||||
@ -5590,8 +5594,9 @@ ConsoleUtils = {
|
||||
*/
|
||||
mergeFilteredMessageNode:
|
||||
function ConsoleUtils_mergeFilteredMessageNode(aOriginal, aFiltered) {
|
||||
// childNodes[3] is the node containing the number of repetitions of a node.
|
||||
let repeatNode = aOriginal.childNodes[3];
|
||||
// childNodes[3].firstChild is the node containing the number of repetitions
|
||||
// of a node.
|
||||
let repeatNode = aOriginal.childNodes[3].firstChild;
|
||||
if (!repeatNode) {
|
||||
return aOriginal; // no repeat node, return early.
|
||||
}
|
||||
@ -5658,7 +5663,7 @@ ConsoleUtils = {
|
||||
function ConsoleUtils_filterRepeatedConsole(aNode, aOutput) {
|
||||
let lastMessage = aOutput.lastChild;
|
||||
|
||||
// childNodes[2] is the xul:description element
|
||||
// childNodes[2] is the description element
|
||||
if (lastMessage &&
|
||||
aNode.childNodes[2].textContent ==
|
||||
lastMessage.childNodes[2].textContent) {
|
@ -21,6 +21,7 @@
|
||||
#
|
||||
# Contributor(s):
|
||||
# David Dahl <ddahl@mozilla.com>
|
||||
# Rob Campbell <rcampbell@mozilla.com>
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@ -36,14 +37,15 @@
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../../../..
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
EXTRA_JS_MODULES = HUDService.jsm \
|
||||
EXTRA_JS_MODULES = \
|
||||
HUDService.jsm \
|
||||
PropertyPanel.jsm \
|
||||
NetworkHelper.jsm \
|
||||
AutocompletePopup.jsm \
|
||||
@ -51,7 +53,7 @@ EXTRA_JS_MODULES = HUDService.jsm \
|
||||
|
||||
ifdef ENABLE_TESTS
|
||||
ifneq (mobile,$(MOZ_BUILD_APP))
|
||||
DIRS += tests
|
||||
DIRS += test
|
||||
endif
|
||||
endif
|
||||
|
@ -36,15 +36,13 @@
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../../../../..
|
||||
DEPTH = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = test_hudservice
|
||||
|
||||
DIRS = browser
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
@ -21,6 +21,7 @@
|
||||
# David Dahl <ddahl@mozilla.com>
|
||||
# Patrick Walton <pcwalton@mozilla.com>
|
||||
# Mihai Șucan <mihai.sucan@gmail.com>
|
||||
# Rob Campbell <rcampbell@mozilla.com>
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
@ -36,11 +37,11 @@
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../../../../../..
|
||||
DEPTH = ../../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
relativesrcdir = toolkit/components/console/hudservice/tests/browser
|
||||
relativesrcdir = browser/devtools/webconsole/test/browser
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
@ -37,7 +37,7 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
const TEST_REPLACED_API_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console-replaced-api.html";
|
||||
const TEST_REPLACED_API_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console-replaced-api.html";
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
@ -41,7 +41,7 @@
|
||||
// Tests that the page's resources are displayed in the console as they're
|
||||
// loaded
|
||||
|
||||
const TEST_NETWORK_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-network.html" + "?_date=" + Date.now();
|
||||
const TEST_NETWORK_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-network.html" + "?_date=" + Date.now();
|
||||
|
||||
function test() {
|
||||
addTab("data:text/html,Web Console basic network logging test");
|
@ -39,7 +39,7 @@
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
// Tests that the console object still exists after a page reload.
|
||||
const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
|
||||
|
||||
function test() {
|
||||
addTab(TEST_URI);
|
@ -40,7 +40,7 @@
|
||||
|
||||
// Tests that the input field is focused when the console is opened.
|
||||
|
||||
const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
|
||||
|
||||
function test() {
|
||||
addTab(TEST_URI);
|
@ -41,7 +41,7 @@
|
||||
// Tests to ensure that errors don't appear when the console is closed while a
|
||||
// completion is being performed.
|
||||
|
||||
const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
|
||||
|
||||
function test() {
|
||||
addTab(TEST_URI);
|
@ -40,7 +40,7 @@
|
||||
|
||||
// Tests that errors still show up in the Web Console after a page reload.
|
||||
|
||||
const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-error.html";
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-error.html";
|
||||
|
||||
function test() {
|
||||
addTab(TEST_URI);
|
@ -40,7 +40,7 @@
|
||||
|
||||
// Tests that console groups behave properly.
|
||||
|
||||
const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
|
||||
|
||||
function test() {
|
||||
addTab(TEST_URI);
|
@ -12,7 +12,7 @@
|
||||
|
||||
Cu.import("resource:///modules/HUDService.jsm");
|
||||
|
||||
const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
|
||||
|
||||
function test() {
|
||||
addTab(TEST_URI);
|
@ -10,7 +10,7 @@
|
||||
|
||||
// Tests that the Web Console close button functions.
|
||||
|
||||
const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
|
||||
|
||||
function test() {
|
||||
addTab(TEST_URI);
|
@ -41,7 +41,7 @@
|
||||
// Tests that exceptions thrown by content don't show up twice in the Web
|
||||
// Console.
|
||||
|
||||
const TEST_DUPLICATE_ERROR_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-duplicate-error.html";
|
||||
const TEST_DUPLICATE_ERROR_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-duplicate-error.html";
|
||||
|
||||
function test() {
|
||||
addTab(TEST_DUPLICATE_ERROR_URI);
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
|
||||
|
||||
let HUD, inputNode;
|
||||
|
@ -12,7 +12,7 @@
|
||||
// Tests that the Web Console limits the number of lines displayed according to
|
||||
// the user's preferences.
|
||||
|
||||
const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
|
||||
|
||||
function test() {
|
||||
addTab(TEST_URI);
|
@ -36,7 +36,7 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-bug-585956-console-trace.html";
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-bug-585956-console-trace.html";
|
||||
|
||||
function test() {
|
||||
addTab(TEST_URI);
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
|
||||
|
||||
function test() {
|
||||
addTab(TEST_URI);
|
@ -40,7 +40,7 @@
|
||||
|
||||
// Tests that adding text to one of the output labels doesn't cause errors.
|
||||
|
||||
const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
|
||||
|
||||
function test() {
|
||||
addTab(TEST_URI);
|
@ -36,7 +36,7 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
|
||||
|
||||
function test() {
|
||||
addTab(TEST_URI);
|
@ -36,11 +36,11 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-bug-593003-iframe-wrong-hud.html";
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-bug-593003-iframe-wrong-hud.html";
|
||||
|
||||
const TEST_IFRAME_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-bug-593003-iframe-wrong-hud-iframe.html";
|
||||
const TEST_IFRAME_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-bug-593003-iframe-wrong-hud-iframe.html";
|
||||
|
||||
const TEST_DUMMY_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
|
||||
const TEST_DUMMY_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
|
||||
|
||||
let tab1, tab2;
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
const TEST_URI = "http://example.com/browser/toolkit/components/console/hudservice/tests/browser/test-console.html";
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
|
||||
let HUD;
|
||||
|
||||
let outputItem;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user