mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge from mozilla-central.
This commit is contained in:
commit
5f12a6150b
@ -92,6 +92,10 @@ include $(topsrcdir)/config/rules.mk
|
||||
CFLAGS += $(MOZ_GTK2_CFLAGS)
|
||||
CXXFLAGS += $(MOZ_GTK2_CFLAGS)
|
||||
|
||||
ifdef MOZ_ENABLE_DBUS
|
||||
CXXFLAGS += $(MOZ_DBUS_CFLAGS)
|
||||
endif
|
||||
|
||||
LOCAL_INCLUDES += \
|
||||
-I$(srcdir) \
|
||||
-I$(srcdir)/../base \
|
||||
|
@ -449,13 +449,8 @@ nsAccessibleWrap::CreateMaiInterfaces(void)
|
||||
interfacesBits |= 1 << MAI_INTERFACE_DOCUMENT;
|
||||
}
|
||||
|
||||
//nsIAccessibleImage
|
||||
nsCOMPtr<nsIAccessibleImage> accessInterfaceImage;
|
||||
QueryInterface(NS_GET_IID(nsIAccessibleImage),
|
||||
getter_AddRefs(accessInterfaceImage));
|
||||
if (accessInterfaceImage) {
|
||||
if (IsImageAccessible())
|
||||
interfacesBits |= 1 << MAI_INTERFACE_IMAGE;
|
||||
}
|
||||
|
||||
// HyperLinkAccessible
|
||||
if (IsLink())
|
||||
|
@ -52,8 +52,12 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <atk/atk.h>
|
||||
#ifdef MOZ_ENABLE_DBUS
|
||||
#include <dbus/dbus.h>
|
||||
#endif
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::a11y;
|
||||
|
||||
typedef GType (* AtkGetTypeType) (void);
|
||||
GType g_atk_hyperlink_impl_type = G_TYPE_INVALID;
|
||||
@ -61,10 +65,7 @@ static bool sATKChecked = false;
|
||||
static PRLibrary *sATKLib = nsnull;
|
||||
static const char sATKLibName[] = "libatk-1.0.so.0";
|
||||
static const char sATKHyperlinkImplGetTypeSymbol[] =
|
||||
"atk_hyperlink_impl_get_type";
|
||||
static const char sAccEnv [] = "GNOME_ACCESSIBILITY";
|
||||
static const char sGconfAccessibilityKey[] =
|
||||
"/desktop/gnome/interface/accessibility";
|
||||
"atk_hyperlink_impl_get_type";
|
||||
|
||||
/* gail function pointer */
|
||||
static guint (* gail_add_global_event_listener) (GSignalEmissionHook listener,
|
||||
@ -614,27 +615,7 @@ toplevel_event_watcher(GSignalInvocationHint* ihint,
|
||||
bool
|
||||
nsApplicationAccessibleWrap::Init()
|
||||
{
|
||||
// XXX following code is copied from widget/gtk2/nsWindow.cpp
|
||||
// we should put it to somewhere that can be used from both modules
|
||||
// see bug 390761
|
||||
|
||||
// check if accessibility enabled/disabled by environment variable
|
||||
bool isGnomeATEnabled = false;
|
||||
const char *envValue = PR_GetEnv(sAccEnv);
|
||||
if (envValue) {
|
||||
isGnomeATEnabled = !!atoi(envValue);
|
||||
} else {
|
||||
//check gconf-2 setting
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIGConfService> gconf =
|
||||
do_GetService(NS_GCONFSERVICE_CONTRACTID, &rv);
|
||||
if (NS_SUCCEEDED(rv) && gconf) {
|
||||
gconf->GetBool(NS_LITERAL_CSTRING(sGconfAccessibilityKey),
|
||||
&isGnomeATEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
if (isGnomeATEnabled) {
|
||||
if (ShouldA11yBeEnabled()) {
|
||||
// load and initialize gail library
|
||||
nsresult rv = LoadGtkModule(sGail);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
@ -883,3 +864,130 @@ LoadGtkModule(GnomeAccessibilityModule& aModule)
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
|
||||
static const char sAccEnv [] = "GNOME_ACCESSIBILITY";
|
||||
#ifdef MOZ_ENABLE_DBUS
|
||||
static DBusPendingCall *sPendingCall = nsnull;
|
||||
#endif
|
||||
|
||||
void
|
||||
PreInit()
|
||||
{
|
||||
#ifdef MOZ_ENABLE_DBUS
|
||||
static bool sChecked = FALSE;
|
||||
if (sChecked)
|
||||
return;
|
||||
|
||||
sChecked = TRUE;
|
||||
|
||||
// dbus is only checked if GNOME_ACCESSIBILITY is unset
|
||||
// also make sure that a session bus address is available to prevent dbus from
|
||||
// starting a new one. Dbus confuses the test harness when it creates a new
|
||||
// process (see bug 693343)
|
||||
if (PR_GetEnv(sAccEnv) || !PR_GetEnv("DBUS_SESSION_BUS_ADDRESS"))
|
||||
return;
|
||||
|
||||
DBusConnection* bus = dbus_bus_get(DBUS_BUS_SESSION, nsnull);
|
||||
if (!bus)
|
||||
return;
|
||||
|
||||
dbus_connection_set_exit_on_disconnect(bus, FALSE);
|
||||
|
||||
DBusMessage *message;
|
||||
message = dbus_message_new_method_call("org.a11y.Bus", "/org/a11y/bus",
|
||||
"org.freedesktop.DBus.Properties",
|
||||
"Get");
|
||||
if (!message)
|
||||
goto dbus_done;
|
||||
|
||||
static const char* iface = "org.a11y.Status";
|
||||
static const char* member = "IsEnabled";
|
||||
dbus_message_append_args(message, DBUS_TYPE_STRING, &iface,
|
||||
DBUS_TYPE_STRING, &member, DBUS_TYPE_INVALID);
|
||||
dbus_connection_send_with_reply(bus, message, &sPendingCall, 1000);
|
||||
dbus_message_unref(message);
|
||||
|
||||
dbus_done:
|
||||
dbus_connection_unref(bus);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
ShouldA11yBeEnabled()
|
||||
{
|
||||
static bool sChecked = false, sShouldEnable = false;
|
||||
if (sChecked)
|
||||
return sShouldEnable;
|
||||
|
||||
sChecked = true;
|
||||
|
||||
// check if accessibility enabled/disabled by environment variable
|
||||
const char* envValue = PR_GetEnv(sAccEnv);
|
||||
if (envValue)
|
||||
return sShouldEnable = !!atoi(envValue);
|
||||
|
||||
#ifdef MOZ_ENABLE_DBUS
|
||||
PreInit();
|
||||
bool dbusSuccess = false;
|
||||
DBusMessage *reply = nsnull;
|
||||
if (!sPendingCall)
|
||||
goto dbus_done;
|
||||
|
||||
dbus_pending_call_block(sPendingCall);
|
||||
reply = dbus_pending_call_steal_reply(sPendingCall);
|
||||
dbus_pending_call_unref(sPendingCall);
|
||||
sPendingCall = nsnull;
|
||||
if (!reply ||
|
||||
dbus_message_get_type(reply) != DBUS_MESSAGE_TYPE_METHOD_RETURN ||
|
||||
strcmp(dbus_message_get_signature (reply), DBUS_TYPE_VARIANT_AS_STRING))
|
||||
goto dbus_done;
|
||||
|
||||
DBusMessageIter iter, iter_variant, iter_struct;
|
||||
dbus_bool_t dResult;
|
||||
dbus_message_iter_init(reply, &iter);
|
||||
dbus_message_iter_recurse (&iter, &iter_variant);
|
||||
switch (dbus_message_iter_get_arg_type(&iter_variant)) {
|
||||
case DBUS_TYPE_STRUCT:
|
||||
// at-spi2-core 2.2.0-2.2.1 had a bug where it returned a struct
|
||||
dbus_message_iter_recurse(&iter_variant, &iter_struct);
|
||||
if (dbus_message_iter_get_arg_type(&iter_struct) == DBUS_TYPE_BOOLEAN) {
|
||||
dbus_message_iter_get_basic(&iter_struct, &dResult);
|
||||
sShouldEnable = dResult;
|
||||
dbusSuccess = true;
|
||||
}
|
||||
|
||||
break;
|
||||
case DBUS_TYPE_BOOLEAN:
|
||||
dbus_message_iter_get_basic(&iter_variant, &dResult);
|
||||
sShouldEnable = dResult;
|
||||
dbusSuccess = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
dbus_done:
|
||||
if (reply)
|
||||
dbus_message_unref(reply);
|
||||
|
||||
if (dbusSuccess)
|
||||
return sShouldEnable;
|
||||
#endif
|
||||
|
||||
//check gconf-2 setting
|
||||
static const char sGconfAccessibilityKey[] =
|
||||
"/desktop/gnome/interface/accessibility";
|
||||
nsresult rv = NS_OK;
|
||||
nsCOMPtr<nsIGConfService> gconf =
|
||||
do_GetService(NS_GCONFSERVICE_CONTRACTID, &rv);
|
||||
if (NS_SUCCEEDED(rv) && gconf)
|
||||
gconf->GetBool(NS_LITERAL_CSTRING(sGconfAccessibilityKey), &sShouldEnable);
|
||||
|
||||
return sShouldEnable;
|
||||
}
|
||||
} // namespace a11y
|
||||
} // namespace mozilla
|
||||
|
||||
|
@ -37,9 +37,11 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsAccessibleWrap.h"
|
||||
#include "nsMaiInterfaceImage.h"
|
||||
|
||||
#include "nsAccessibleWrap.h"
|
||||
#include "nsHTMLImageAccessible.h"
|
||||
|
||||
extern "C" const gchar* getDescriptionCB(AtkObject* aAtkObj);
|
||||
|
||||
void
|
||||
@ -58,19 +60,13 @@ getImagePositionCB(AtkImage *aImage, gint *aAccX, gint *aAccY,
|
||||
AtkCoordType aCoordType)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aImage));
|
||||
if (!accWrap)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIAccessibleImage> image;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleImage),
|
||||
getter_AddRefs(image));
|
||||
if (!image)
|
||||
if (!accWrap || !accWrap->IsImageAccessible())
|
||||
return;
|
||||
|
||||
nsHTMLImageAccessible* image = accWrap->AsImage();
|
||||
PRUint32 geckoCoordType = (aCoordType == ATK_XY_WINDOW) ?
|
||||
nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE :
|
||||
nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE;
|
||||
|
||||
// Returned in screen coordinates
|
||||
image->GetImagePosition(geckoCoordType, aAccX, aAccY);
|
||||
}
|
||||
@ -85,14 +81,8 @@ void
|
||||
getImageSizeCB(AtkImage *aImage, gint *aAccWidth, gint *aAccHeight)
|
||||
{
|
||||
nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aImage));
|
||||
if (!accWrap)
|
||||
if (!accWrap || !accWrap->IsImageAccessible())
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIAccessibleImage> image;
|
||||
accWrap->QueryInterface(NS_GET_IID(nsIAccessibleImage),
|
||||
getter_AddRefs(image));
|
||||
if (!image)
|
||||
return;
|
||||
|
||||
image->GetImageSize(aAccWidth, aAccHeight);
|
||||
accWrap->AsImage()->GetImageSize(aAccWidth, aAccHeight);
|
||||
}
|
||||
|
@ -56,6 +56,21 @@ namespace a11y {
|
||||
*/
|
||||
FocusManager* FocusMgr();
|
||||
|
||||
#ifdef MOZ_ACCESSIBILITY_ATK
|
||||
/**
|
||||
* Perform initialization that should be done as soon as possible, in order
|
||||
* to minimize startup time.
|
||||
* XXX: this function and the next defined in nsApplicationAccessibleWrap.cpp
|
||||
*/
|
||||
void PreInit();
|
||||
|
||||
/**
|
||||
* Is platform accessibility enabled.
|
||||
* Only used on linux with atk for now.
|
||||
*/
|
||||
bool ShouldA11yBeEnabled();
|
||||
#endif
|
||||
|
||||
} // namespace a11y
|
||||
} // namespace mozilla
|
||||
|
||||
|
@ -590,75 +590,63 @@ nsresult nsAccessible::GetTranslatedString(const nsAString& aKey, nsAString& aSt
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool
|
||||
nsAccessible::IsVisible(bool* aIsOffscreen)
|
||||
PRUint64
|
||||
nsAccessible::VisibilityState()
|
||||
{
|
||||
PRUint64 vstates = states::INVISIBLE | states::OFFSCREEN;
|
||||
|
||||
// We need to check the parent chain for visibility.
|
||||
nsAccessible* accessible = this;
|
||||
do {
|
||||
// We don't want background tab page content to be aggressively invisible.
|
||||
// Otherwise this foils screen reader virtual buffer caches.
|
||||
PRUint32 role = accessible->Role();
|
||||
if (role == nsIAccessibleRole::ROLE_PROPERTYPAGE ||
|
||||
role == nsIAccessibleRole::ROLE_PANE) {
|
||||
break;
|
||||
}
|
||||
|
||||
nsIFrame* frame = accessible->GetFrame();
|
||||
if (!frame)
|
||||
return vstates;
|
||||
|
||||
const nsIView* view = frame->GetView();
|
||||
if (view && view->GetVisibility() == nsViewVisibility_kHide)
|
||||
return vstates;
|
||||
|
||||
} while (accessible = accessible->Parent());
|
||||
|
||||
nsIFrame* frame = GetFrame();
|
||||
const nsCOMPtr<nsIPresShell> shell(GetPresShell());
|
||||
|
||||
// We need to know if at least a kMinPixels around the object is visible,
|
||||
// otherwise it will be marked states::OFFSCREEN. The states::INVISIBLE flag
|
||||
// is for elements which are programmatically hidden.
|
||||
|
||||
*aIsOffscreen = true;
|
||||
if (IsDefunct())
|
||||
return false;
|
||||
|
||||
// otherwise it will be marked states::OFFSCREEN.
|
||||
const PRUint16 kMinPixels = 12;
|
||||
// Set up the variables we need, return false if we can't get at them all
|
||||
nsCOMPtr<nsIPresShell> shell(GetPresShell());
|
||||
if (!shell)
|
||||
return false;
|
||||
|
||||
nsIFrame *frame = GetFrame();
|
||||
if (!frame) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If visibility:hidden or visibility:collapsed then mark with STATE_INVISIBLE
|
||||
if (!frame->GetStyleVisibility()->IsVisible())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// We don't use the more accurate GetBoundsRect, because that is more expensive
|
||||
// and the STATE_OFFSCREEN flag that this is used for only needs to be a rough
|
||||
// indicator
|
||||
nsSize frameSize = frame->GetSize();
|
||||
nsRectVisibility rectVisibility =
|
||||
const nsSize frameSize = frame->GetSize();
|
||||
const nsRectVisibility rectVisibility =
|
||||
shell->GetRectVisibility(frame, nsRect(nsPoint(0,0), frameSize),
|
||||
nsPresContext::CSSPixelsToAppUnits(kMinPixels));
|
||||
|
||||
if (frame->GetRect().IsEmpty()) {
|
||||
bool isEmpty = true;
|
||||
if (rectVisibility == nsRectVisibility_kVisible)
|
||||
vstates &= ~states::OFFSCREEN;
|
||||
|
||||
nsIAtom *frameType = frame->GetType();
|
||||
if (frameType == nsGkAtoms::textFrame) {
|
||||
// Zero area rects can occur in the first frame of a multi-frame text flow,
|
||||
// in which case the rendered text is not empty and the frame should not be marked invisible
|
||||
nsAutoString renderedText;
|
||||
frame->GetRenderedText (&renderedText, nsnull, nsnull, 0, 1);
|
||||
isEmpty = renderedText.IsEmpty();
|
||||
}
|
||||
else if (frameType == nsGkAtoms::inlineFrame) {
|
||||
// Yuck. Unfortunately inline frames can contain larger frames inside of them,
|
||||
// so we can't really believe this is a zero area rect without checking more deeply.
|
||||
// GetBounds() will do that for us.
|
||||
PRInt32 x, y, width, height;
|
||||
GetBounds(&x, &y, &width, &height);
|
||||
isEmpty = width == 0 || height == 0;
|
||||
}
|
||||
// Zero area rects can occur in the first frame of a multi-frame text flow,
|
||||
// in which case the rendered text is not empty and the frame should not be
|
||||
// marked invisible.
|
||||
// XXX Can we just remove this check? Why do we need to mark empty
|
||||
// text invisible?
|
||||
if (frame->GetType() == nsGkAtoms::textFrame &&
|
||||
!(frame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) &&
|
||||
frame->GetRect().IsEmpty()) {
|
||||
nsAutoString renderedText;
|
||||
frame->GetRenderedText(&renderedText, nsnull, nsnull, 0, 1);
|
||||
if (renderedText.IsEmpty())
|
||||
return vstates;
|
||||
|
||||
if (isEmpty && !(frame->GetStateBits() & NS_FRAME_OUT_OF_FLOW)) {
|
||||
// Consider zero area objects hidden unless they are absolutely positioned
|
||||
// or floating and may have descendants that have a non-zero size
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// The frame intersects the viewport, but we need to check the parent view chain :(
|
||||
bool isVisible = frame->IsVisibleConsideringAncestors(nsIFrame::VISIBILITY_CROSS_CHROME_CONTENT_BOUNDARY);
|
||||
if (isVisible && rectVisibility == nsRectVisibility_kVisible) {
|
||||
*aIsOffscreen = false;
|
||||
}
|
||||
return isVisible;
|
||||
// Assume we are visible enough.
|
||||
return vstates &= ~states::INVISIBLE;
|
||||
}
|
||||
|
||||
PRUint64
|
||||
@ -701,15 +689,8 @@ nsAccessible::NativeState()
|
||||
state |= states::FOCUSED;
|
||||
}
|
||||
|
||||
// Check if states::INVISIBLE and
|
||||
// states::OFFSCREEN flags should be turned on for this object.
|
||||
bool isOffscreen;
|
||||
if (!IsVisible(&isOffscreen)) {
|
||||
state |= states::INVISIBLE;
|
||||
}
|
||||
if (isOffscreen) {
|
||||
state |= states::OFFSCREEN;
|
||||
}
|
||||
// Gather states::INVISIBLE and states::OFFSCREEN flags for this object.
|
||||
state |= VisibilityState();
|
||||
|
||||
nsIFrame *frame = GetFrame();
|
||||
if (frame && (frame->GetStateBits() & NS_FRAME_OUT_OF_FLOW))
|
||||
|
@ -60,6 +60,7 @@ class EmbeddedObjCollector;
|
||||
class KeyBinding;
|
||||
class nsAccessible;
|
||||
class nsHyperTextAccessible;
|
||||
class nsHTMLImageAccessible;
|
||||
class nsHTMLLIAccessible;
|
||||
struct nsRoleMapEntry;
|
||||
class Relation;
|
||||
@ -428,6 +429,9 @@ public:
|
||||
|
||||
inline bool IsHTMLListItem() const { return mFlags & eHTMLListItemAccessible; }
|
||||
nsHTMLLIAccessible* AsHTMLListItem();
|
||||
|
||||
inline bool IsImageAccessible() const { return mFlags & eImageAccessible; }
|
||||
nsHTMLImageAccessible* AsImage();
|
||||
|
||||
inline bool IsListControl() const { return mFlags & eListControlAccessible; }
|
||||
|
||||
@ -654,11 +658,12 @@ protected:
|
||||
eHyperTextAccessible = 1 << 7,
|
||||
eHTMLFileInputAccessible = 1 << 8,
|
||||
eHTMLListItemAccessible = 1 << 9,
|
||||
eListControlAccessible = 1 << 10,
|
||||
eMenuButtonAccessible = 1 << 11,
|
||||
eMenuPopupAccessible = 1 << 12,
|
||||
eRootAccessible = 1 << 13,
|
||||
eTextLeafAccessible = 1 << 14
|
||||
eImageAccessible = 1 << 10,
|
||||
eListControlAccessible = 1 << 11,
|
||||
eMenuButtonAccessible = 1 << 12,
|
||||
eMenuPopupAccessible = 1 << 13,
|
||||
eRootAccessible = 1 << 14,
|
||||
eTextLeafAccessible = 1 << 15
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
@ -671,7 +676,8 @@ protected:
|
||||
|
||||
virtual nsIFrame* GetBoundsFrame();
|
||||
virtual void GetBoundsRect(nsRect& aRect, nsIFrame** aRelativeFrame);
|
||||
bool IsVisible(bool *aIsOffscreen);
|
||||
|
||||
PRUint64 VisibilityState();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Name helpers
|
||||
|
@ -46,7 +46,7 @@
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMHTMLDocument.h"
|
||||
#include "nsIDOMHTMLElement.h"
|
||||
#include "nsIDOMRange.h"
|
||||
#include "nsRange.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIDOMXULElement.h"
|
||||
#include "nsIDocShell.h"
|
||||
@ -63,13 +63,10 @@
|
||||
#include "nsIView.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
|
||||
#include "nsContentCID.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
static NS_DEFINE_IID(kRangeCID, NS_RANGE_CID);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsCoreUtils
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@ -317,9 +314,7 @@ nsCoreUtils::ScrollSubstringTo(nsIFrame *aFrame,
|
||||
|
||||
nsPresContext *presContext = aFrame->PresContext();
|
||||
|
||||
nsCOMPtr<nsIDOMRange> scrollToRange = do_CreateInstance(kRangeCID);
|
||||
NS_ENSURE_TRUE(scrollToRange, NS_ERROR_FAILURE);
|
||||
|
||||
nsRefPtr<nsIDOMRange> scrollToRange = new nsRange();
|
||||
nsCOMPtr<nsISelectionController> selCon;
|
||||
aFrame->GetSelectionController(presContext, getter_AddRefs(selCon));
|
||||
NS_ENSURE_TRUE(selCon, NS_ERROR_FAILURE);
|
||||
|
@ -1278,13 +1278,18 @@ void*
|
||||
nsDocAccessible::GetNativeWindow() const
|
||||
{
|
||||
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mWeakShell));
|
||||
if (!shell)
|
||||
return nsnull;
|
||||
|
||||
nsIViewManager* vm = shell->GetViewManager();
|
||||
if (vm) {
|
||||
nsCOMPtr<nsIWidget> widget;
|
||||
vm->GetRootWidget(getter_AddRefs(widget));
|
||||
if (widget)
|
||||
return widget->GetNativeData(NS_NATIVE_WINDOW);
|
||||
}
|
||||
if (!vm)
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIWidget> widget;
|
||||
vm->GetRootWidget(getter_AddRefs(widget));
|
||||
if (widget)
|
||||
return widget->GetNativeData(NS_NATIVE_WINDOW);
|
||||
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
|
@ -92,5 +92,14 @@ private:
|
||||
bool IsValidLongDescIndex(PRUint8 aIndex);
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessible downcasting method
|
||||
inline nsHTMLImageAccessible*
|
||||
nsAccessible::AsImage()
|
||||
{
|
||||
return IsImageAccessible() ?
|
||||
static_cast<nsHTMLImageAccessible*>(this) : nsnull;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -45,12 +45,10 @@
|
||||
#include "nsTextAttrs.h"
|
||||
|
||||
#include "nsIClipboard.h"
|
||||
#include "nsContentCID.h"
|
||||
#include "nsFocusManager.h"
|
||||
#include "nsIDOMCharacterData.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMRange.h"
|
||||
#include "nsIDOMNSRange.h"
|
||||
#include "nsIDOMXULDocument.h"
|
||||
#include "nsIEditingSession.h"
|
||||
#include "nsIEditor.h"
|
||||
@ -67,8 +65,6 @@
|
||||
|
||||
using namespace mozilla::a11y;
|
||||
|
||||
static NS_DEFINE_IID(kRangeCID, NS_RANGE_CID);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsHyperTextAccessible
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@ -1739,7 +1735,7 @@ nsHyperTextAccessible::FrameSelection()
|
||||
|
||||
void
|
||||
nsHyperTextAccessible::GetSelectionDOMRanges(PRInt16 aType,
|
||||
nsCOMArray<nsIDOMRange>* aRanges)
|
||||
nsTArray<nsRange*>* aRanges)
|
||||
{
|
||||
nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
|
||||
if (!frameSelection)
|
||||
@ -1763,20 +1759,18 @@ nsHyperTextAccessible::GetSelectionDOMRanges(PRInt16 aType,
|
||||
return;
|
||||
|
||||
PRUint32 childCount = startNode->GetChildCount();
|
||||
nsCOMPtr<nsIDOMNode> startDOMNode(do_QueryInterface(startNode));
|
||||
nsCOMPtr<nsISelectionPrivate> privSel(do_QueryInterface(domSel));
|
||||
nsresult rv = privSel->
|
||||
GetRangesForIntervalCOMArray(startDOMNode, 0, startDOMNode, childCount,
|
||||
true, aRanges);
|
||||
GetRangesForIntervalArray(startNode, 0, startNode, childCount, true, aRanges);
|
||||
NS_ENSURE_SUCCESS(rv,);
|
||||
|
||||
// Remove collapsed ranges
|
||||
PRInt32 numRanges = aRanges->Count();
|
||||
for (PRInt32 count = 0; count < numRanges; count ++) {
|
||||
PRUint32 numRanges = aRanges->Length();
|
||||
for (PRUint32 count = 0; count < numRanges; count ++) {
|
||||
bool isCollapsed = false;
|
||||
(*aRanges)[count]->GetCollapsed(&isCollapsed);
|
||||
if (isCollapsed) {
|
||||
aRanges->RemoveObjectAt(count);
|
||||
aRanges->RemoveElementAt(count);
|
||||
--numRanges;
|
||||
--count;
|
||||
}
|
||||
@ -1792,9 +1786,9 @@ nsHyperTextAccessible::GetSelectionCount(PRInt32* aSelectionCount)
|
||||
NS_ENSURE_ARG_POINTER(aSelectionCount);
|
||||
*aSelectionCount = 0;
|
||||
|
||||
nsCOMArray<nsIDOMRange> ranges;
|
||||
nsTArray<nsRange*> ranges;
|
||||
GetSelectionDOMRanges(nsISelectionController::SELECTION_NORMAL, &ranges);
|
||||
*aSelectionCount = ranges.Count();
|
||||
*aSelectionCount = PRInt32(ranges.Length());
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -1811,14 +1805,14 @@ nsHyperTextAccessible::GetSelectionBounds(PRInt32 aSelectionNum,
|
||||
NS_ENSURE_ARG_POINTER(aEndOffset);
|
||||
*aStartOffset = *aEndOffset = 0;
|
||||
|
||||
nsCOMArray<nsIDOMRange> ranges;
|
||||
nsTArray<nsRange*> ranges;
|
||||
GetSelectionDOMRanges(nsISelectionController::SELECTION_NORMAL, &ranges);
|
||||
|
||||
PRInt32 rangeCount = ranges.Count();
|
||||
PRUint32 rangeCount = ranges.Length();
|
||||
if (aSelectionNum < 0 || aSelectionNum >= rangeCount)
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
nsCOMPtr<nsIDOMRange> range = ranges[aSelectionNum];
|
||||
nsRange* range = ranges[aSelectionNum];
|
||||
|
||||
// Get start point
|
||||
nsCOMPtr<nsIDOMNode> startDOMNode;
|
||||
@ -1880,8 +1874,7 @@ nsHyperTextAccessible::SetSelectionBounds(PRInt32 aSelectionNum,
|
||||
domSel->GetRangeCount(&rangeCount);
|
||||
nsCOMPtr<nsIDOMRange> range;
|
||||
if (aSelectionNum == rangeCount) { // Add a range
|
||||
range = do_CreateInstance(kRangeCID);
|
||||
NS_ENSURE_TRUE(range, NS_ERROR_OUT_OF_MEMORY);
|
||||
range = new nsRange();
|
||||
}
|
||||
else if (aSelectionNum < 0 || aSelectionNum > rangeCount) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
@ -2305,10 +2298,10 @@ nsHyperTextAccessible::GetDOMPointByFrameOffset(nsIFrame *aFrame,
|
||||
|
||||
// nsHyperTextAccessible
|
||||
nsresult
|
||||
nsHyperTextAccessible::DOMRangeBoundToHypertextOffset(nsIDOMRange *aRange,
|
||||
bool aIsStartBound,
|
||||
bool aIsStartHTOffset,
|
||||
PRInt32 *aHTOffset)
|
||||
nsHyperTextAccessible::RangeBoundToHypertextOffset(nsRange *aRange,
|
||||
bool aIsStartBound,
|
||||
bool aIsStartHTOffset,
|
||||
PRInt32 *aHTOffset)
|
||||
{
|
||||
nsCOMPtr<nsIDOMNode> DOMNode;
|
||||
PRInt32 nodeOffset = 0;
|
||||
@ -2346,20 +2339,18 @@ nsHyperTextAccessible::GetSpellTextAttribute(nsIDOMNode *aNode,
|
||||
PRInt32 *aHTEndOffset,
|
||||
nsIPersistentProperties *aAttributes)
|
||||
{
|
||||
nsCOMArray<nsIDOMRange> ranges;
|
||||
nsTArray<nsRange*> ranges;
|
||||
GetSelectionDOMRanges(nsISelectionController::SELECTION_SPELLCHECK, &ranges);
|
||||
|
||||
PRInt32 rangeCount = ranges.Count();
|
||||
PRUint32 rangeCount = ranges.Length();
|
||||
if (!rangeCount)
|
||||
return NS_OK;
|
||||
|
||||
for (PRInt32 index = 0; index < rangeCount; index++) {
|
||||
nsCOMPtr<nsIDOMRange> range = ranges[index];
|
||||
nsCOMPtr<nsIDOMNSRange> nsrange(do_QueryInterface(range));
|
||||
NS_ENSURE_STATE(nsrange);
|
||||
for (PRUint32 index = 0; index < rangeCount; index++) {
|
||||
nsRange* range = ranges[index];
|
||||
|
||||
PRInt16 result;
|
||||
nsresult rv = nsrange->ComparePoint(aNode, aNodeOffset, &result);
|
||||
nsresult rv = range->ComparePoint(aNode, aNodeOffset, &result);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
// ComparePoint checks boundary points, but we need to check that
|
||||
// text at aNodeOffset is inside the range.
|
||||
@ -2378,8 +2369,8 @@ nsHyperTextAccessible::GetSpellTextAttribute(nsIDOMNode *aNode,
|
||||
|
||||
if (result == 1) { // range is before point
|
||||
PRInt32 startHTOffset = 0;
|
||||
nsresult rv = DOMRangeBoundToHypertextOffset(range, false, true,
|
||||
&startHTOffset);
|
||||
nsresult rv = RangeBoundToHypertextOffset(range, false, true,
|
||||
&startHTOffset);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (startHTOffset > *aHTStartOffset)
|
||||
@ -2387,8 +2378,8 @@ nsHyperTextAccessible::GetSpellTextAttribute(nsIDOMNode *aNode,
|
||||
|
||||
} else if (result == -1) { // range is after point
|
||||
PRInt32 endHTOffset = 0;
|
||||
nsresult rv = DOMRangeBoundToHypertextOffset(range, true, false,
|
||||
&endHTOffset);
|
||||
nsresult rv = RangeBoundToHypertextOffset(range, true, false,
|
||||
&endHTOffset);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (endHTOffset < *aHTEndOffset)
|
||||
@ -2396,13 +2387,13 @@ nsHyperTextAccessible::GetSpellTextAttribute(nsIDOMNode *aNode,
|
||||
|
||||
} else { // point is in range
|
||||
PRInt32 startHTOffset = 0;
|
||||
nsresult rv = DOMRangeBoundToHypertextOffset(range, true, true,
|
||||
&startHTOffset);
|
||||
nsresult rv = RangeBoundToHypertextOffset(range, true, true,
|
||||
&startHTOffset);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
PRInt32 endHTOffset = 0;
|
||||
rv = DOMRangeBoundToHypertextOffset(range, false, false,
|
||||
&endHTOffset);
|
||||
rv = RangeBoundToHypertextOffset(range, false, false,
|
||||
&endHTOffset);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (startHTOffset > *aHTStartOffset)
|
||||
|
@ -360,7 +360,7 @@ protected:
|
||||
/**
|
||||
* Return selection ranges within the accessible subtree.
|
||||
*/
|
||||
void GetSelectionDOMRanges(PRInt16 aType, nsCOMArray<nsIDOMRange>* aRanges);
|
||||
void GetSelectionDOMRanges(PRInt16 aType, nsTArray<nsRange*>* aRanges);
|
||||
|
||||
nsresult SetSelectionRange(PRInt32 aStartPos, PRInt32 aEndPos);
|
||||
|
||||
@ -390,10 +390,10 @@ protected:
|
||||
* outside of hyper text
|
||||
* @param aHTOffset [out] the result offset
|
||||
*/
|
||||
nsresult DOMRangeBoundToHypertextOffset(nsIDOMRange *aRange,
|
||||
bool aIsStartBound,
|
||||
bool aIsStartOffset,
|
||||
PRInt32 *aHTOffset);
|
||||
nsresult RangeBoundToHypertextOffset(nsRange *aRange,
|
||||
bool aIsStartBound,
|
||||
bool aIsStartOffset,
|
||||
PRInt32 *aHTOffset);
|
||||
|
||||
/**
|
||||
* Set 'misspelled' text attribute and return range offsets where the
|
||||
|
@ -91,12 +91,14 @@ static const PRInt32 kIEnumVariantDisconnected = -1;
|
||||
// nsAccessibleWrap
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ITypeInfo* nsAccessibleWrap::gTypeInfo = NULL;
|
||||
|
||||
//-----------------------------------------------------
|
||||
// construction
|
||||
//-----------------------------------------------------
|
||||
nsAccessibleWrap::
|
||||
nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
|
||||
nsAccessible(aContent, aShell), mEnumVARIANTPosition(0), mTypeInfo(NULL)
|
||||
nsAccessible(aContent, aShell), mEnumVARIANTPosition(0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -105,8 +107,6 @@ nsAccessibleWrap::
|
||||
//-----------------------------------------------------
|
||||
nsAccessibleWrap::~nsAccessibleWrap()
|
||||
{
|
||||
if (mTypeInfo)
|
||||
mTypeInfo->Release();
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED0(nsAccessibleWrap, nsAccessible);
|
||||
@ -1835,19 +1835,19 @@ void nsAccessibleWrap::UpdateSystemCaret()
|
||||
ITypeInfo*
|
||||
nsAccessibleWrap::GetTI(LCID lcid)
|
||||
{
|
||||
if (mTypeInfo)
|
||||
return mTypeInfo;
|
||||
if (gTypeInfo)
|
||||
return gTypeInfo;
|
||||
|
||||
ITypeLib *typeLib = NULL;
|
||||
HRESULT hr = LoadRegTypeLib(LIBID_Accessibility, 1, 0, lcid, &typeLib);
|
||||
if (FAILED(hr))
|
||||
return NULL;
|
||||
|
||||
hr = typeLib->GetTypeInfoOfGuid(IID_IAccessible, &mTypeInfo);
|
||||
hr = typeLib->GetTypeInfoOfGuid(IID_IAccessible, &gTypeInfo);
|
||||
typeLib->Release();
|
||||
|
||||
if (FAILED(hr))
|
||||
return NULL;
|
||||
|
||||
return mTypeInfo;
|
||||
return gTypeInfo;
|
||||
}
|
||||
|
@ -356,9 +356,9 @@ protected:
|
||||
/**
|
||||
* Creates ITypeInfo for LIBID_Accessibility if it's needed and returns it.
|
||||
*/
|
||||
ITypeInfo *GetTI(LCID lcid);
|
||||
static ITypeInfo* GetTI(LCID lcid);
|
||||
|
||||
ITypeInfo *mTypeInfo;
|
||||
static ITypeInfo* gTypeInfo;
|
||||
|
||||
|
||||
enum navRelations {
|
||||
|
@ -28,6 +28,13 @@
|
||||
|
||||
function doTests()
|
||||
{
|
||||
|
||||
if (MAC) {
|
||||
todo(false, "Make these tests pass on OSX (bug 650294)");
|
||||
SimpleTest.finish();
|
||||
return;
|
||||
}
|
||||
|
||||
gQueue = new eventQueue(EVENT_TEXT_CARET_MOVED);
|
||||
|
||||
var id = "textbox";
|
||||
|
@ -63,6 +63,7 @@ _TEST_FILES =\
|
||||
test_stale.html \
|
||||
test_textbox.xul \
|
||||
test_tree.xul \
|
||||
test_visibility.html \
|
||||
z_frames.html \
|
||||
z_frames_article.html \
|
||||
z_frames_checkbox.html \
|
||||
|
71
accessible/tests/mochitest/states/test_visibility.html
Normal file
71
accessible/tests/mochitest/states/test_visibility.html
Normal file
@ -0,0 +1,71 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>visibility state testing</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()
|
||||
{
|
||||
testStates("div", 0, 0, STATE_INVISIBLE);
|
||||
testStates("div_off", STATE_OFFSCREEN, 0, STATE_INVISIBLE);
|
||||
testStates("div_abschild", 0, 0, STATE_INVISIBLE);
|
||||
|
||||
// Confirm destruction of accessibles.
|
||||
document.getElementById("div").style.visibility = "hidden";
|
||||
document.getElementById("div_off").style.visibility="hidden";
|
||||
document.getElementById("div_abschild").style.visibility="hidden";
|
||||
document.body.clientWidth; // flush layout
|
||||
testAccessibleTree("outer_div", {children:[]});
|
||||
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=591363"
|
||||
title="(in)visible state is not always correct?">
|
||||
Mozilla Bug 591363
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
|
||||
<div id="outer_div">
|
||||
|
||||
<!-- trivial cases -->
|
||||
<div id="div">div</div>
|
||||
<div id="div_off" style="position: absolute; left:-999px; top:-999px">
|
||||
offscreen!
|
||||
</div>
|
||||
|
||||
<!-- edge case: no rect but has out of flow child -->
|
||||
<div id="div_abschild">
|
||||
<p style="position: absolute; left: 120px; top:120px;">absolute</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -43,7 +43,11 @@
|
||||
]
|
||||
};
|
||||
|
||||
testAccessibleTree("menulist", accTree);
|
||||
if (!MAC) {
|
||||
testAccessibleTree("menulist", accTree);
|
||||
} else {
|
||||
todo(false, "Make this test pass on OSX (bug 650366)");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// editable menulist
|
||||
@ -81,9 +85,10 @@
|
||||
]
|
||||
};
|
||||
|
||||
// XXX Bug 551957
|
||||
if (!MAC) {
|
||||
testAccessibleTree("menulist2", accTree);
|
||||
} else {
|
||||
todo(false, "Make this test pass on OSX (bug 551957)");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
@ -90,6 +90,11 @@ if [ ! "$LIBXUL_SDK" ]; then
|
||||
mozglue/android/Makefile
|
||||
"
|
||||
fi
|
||||
if [ "$MOZ_LINKER" ]; then
|
||||
add_makefiles "
|
||||
mozglue/linker/Makefile
|
||||
"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$OS_ARCH" = "WINNT" ]; then
|
||||
|
@ -47,7 +47,7 @@ pref("browser.homescreenURL", "file:///data/local/homescreen.html,file:///system
|
||||
#endif
|
||||
|
||||
// URL for the dialer application.
|
||||
pref("dom.telephony.app.phone.url", "http://localhost:7777/dialer/dialer.html");
|
||||
pref("dom.telephony.app.phone.url", "http://localhost:6666/apps/dialer/dialer.html");
|
||||
|
||||
// Device pixel to CSS px ratio, in percent. Set to -1 to calculate based on display density.
|
||||
pref("browser.viewport.scaleRatio", -1);
|
||||
|
@ -402,7 +402,7 @@
|
||||
@BINPATH@/components/nsWifiWorker.manifest
|
||||
#endif
|
||||
#ifdef XP_MACOSX
|
||||
@BINPATH@/components/libalerts_s.dylib
|
||||
@BINPATH@/components/libalerts.dylib
|
||||
#endif
|
||||
#ifdef MOZ_ENABLE_DBUS
|
||||
@BINPATH@/components/@DLL_PREFIX@dbusservice@DLL_SUFFIX@
|
||||
|
@ -83,7 +83,7 @@ pref("extensions.update.autoUpdateDefault", true);
|
||||
|
||||
pref("extensions.hotfix.id", "firefox-hotfix@mozilla.org");
|
||||
pref("extensions.hotfix.cert.checkAttributes", true);
|
||||
pref("extensions.hotfix.certs.1.sha1Fingerprint", "foo");
|
||||
pref("extensions.hotfix.certs.1.sha1Fingerprint", "F1:DB:F9:6A:7B:B8:04:FA:48:3C:16:95:C7:2F:17:C6:5B:C2:9F:45");
|
||||
|
||||
// Disable add-ons installed into the shared user and shared system areas by
|
||||
// default. This does not include the application directory. See the SCOPE
|
||||
@ -1049,7 +1049,7 @@ pref("devtools.styleeditor.enabled", true);
|
||||
pref("devtools.chrome.enabled", false);
|
||||
|
||||
// Disable the GCLI enhanced command line.
|
||||
pref("devtools.gcli.enable", false);
|
||||
pref("devtools.gcli.enable", true);
|
||||
|
||||
// The last Web Console height. This is initially 0 which means that the Web
|
||||
// Console will use the default height next time it shows.
|
||||
|
@ -197,7 +197,7 @@ let gSyncUtils = {
|
||||
|| rv == Ci.nsIFilePicker.returnReplace) {
|
||||
let stream = Cc["@mozilla.org/network/file-output-stream;1"]
|
||||
.createInstance(Ci.nsIFileOutputStream);
|
||||
stream.init(filepicker.file, -1, -1, 0);
|
||||
stream.init(filepicker.file, -1, 0600, 0);
|
||||
|
||||
let serializer = new XMLSerializer();
|
||||
let output = serializer.serializeToString(iframe.contentDocument);
|
||||
|
@ -339,6 +339,9 @@ var MigrationWizard = {
|
||||
case "chrome":
|
||||
source = "sourceNameChrome";
|
||||
break;
|
||||
case "firefox":
|
||||
source = "sourceNameFirefox";
|
||||
break;
|
||||
}
|
||||
|
||||
// semi-wallpaper for crash when multiple profiles exist, since we haven't initialized mSourceProfile in places
|
||||
|
@ -76,6 +76,7 @@
|
||||
#endif
|
||||
#endif
|
||||
<radio id="chrome" label="&importFromChrome.label;" accesskey="&importFromChrome.accesskey;"/>
|
||||
<radio id="firefox" label="&importFromFirefox.label;" accesskey="&importFromFirefox.accesskey;"/>
|
||||
<radio id="fromfile" label="&importFromHTMLFile.label;" accesskey="&importFromHTMLFile.accesskey;" hidden="true"/>
|
||||
<radio id="nothing" label="&importFromNothing.label;" accesskey="&importFromNothing.accesskey;" hidden="true"/>
|
||||
</radiogroup>
|
||||
|
@ -1,2 +1,4 @@
|
||||
component {4cec1de4-1671-4fc3-a53e-6c539dc77a26} ChromeProfileMigrator.js
|
||||
contract @mozilla.org/profile/migrator;1?app=browser&type=chrome {4cec1de4-1671-4fc3-a53e-6c539dc77a26}
|
||||
component {91185366-ba97-4438-acba-48deaca63386} FirefoxProfileMigrator.js
|
||||
contract @mozilla.org/profile/migrator;1?app=browser&type=firefox {91185366-ba97-4438-acba-48deaca63386}
|
||||
|
@ -40,21 +40,13 @@ const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
const Cr = Components.results;
|
||||
const MIGRATOR = Ci.nsIBrowserProfileMigrator;
|
||||
|
||||
const LOCAL_FILE_CID = "@mozilla.org/file/local;1";
|
||||
const FILE_INPUT_STREAM_CID = "@mozilla.org/network/file-input-stream;1";
|
||||
|
||||
const BUNDLE_MIGRATION = "chrome://browser/locale/migration/migration.properties";
|
||||
|
||||
const MIGRATE_ALL = 0x0000;
|
||||
const MIGRATE_SETTINGS = 0x0001;
|
||||
const MIGRATE_COOKIES = 0x0002;
|
||||
const MIGRATE_HISTORY = 0x0004;
|
||||
const MIGRATE_FORMDATA = 0x0008;
|
||||
const MIGRATE_PASSWORDS = 0x0010;
|
||||
const MIGRATE_BOOKMARKS = 0x0020;
|
||||
const MIGRATE_OTHERDATA = 0x0040;
|
||||
|
||||
const S100NS_FROM1601TO1970 = 0x19DB1DED53E8000;
|
||||
const S100NS_PER_MS = 10;
|
||||
|
||||
@ -142,7 +134,7 @@ ChromeProfileMigrator.prototype = {
|
||||
* Notify to observers to start migration
|
||||
*
|
||||
* @param aType
|
||||
* notification type such as MIGRATE_BOOKMARKS
|
||||
* notification type such as MIGRATOR.BOOKMARKS
|
||||
*/
|
||||
_notifyStart : function Chrome_notifyStart(aType)
|
||||
{
|
||||
@ -154,7 +146,7 @@ ChromeProfileMigrator.prototype = {
|
||||
* Notify observers that a migration error occured with an item
|
||||
*
|
||||
* @param aType
|
||||
* notification type such as MIGRATE_BOOKMARKS
|
||||
* notification type such as MIGRATOR.BOOKMARKS
|
||||
*/
|
||||
_notifyError : function Chrome_notifyError(aType)
|
||||
{
|
||||
@ -166,7 +158,7 @@ ChromeProfileMigrator.prototype = {
|
||||
* If all items are finished, it sends migration end notification.
|
||||
*
|
||||
* @param aType
|
||||
* notification type such as MIGRATE_BOOKMARKS
|
||||
* notification type such as MIGRATOR.BOOKMARKS
|
||||
*/
|
||||
_notifyCompleted : function Chrome_notifyIfCompleted(aType)
|
||||
{
|
||||
@ -182,7 +174,7 @@ ChromeProfileMigrator.prototype = {
|
||||
*/
|
||||
_migrateBookmarks : function Chrome_migrateBookmarks()
|
||||
{
|
||||
this._notifyStart(MIGRATE_BOOKMARKS);
|
||||
this._notifyStart(MIGRATOR.BOOKMARKS);
|
||||
|
||||
try {
|
||||
PlacesUtils.bookmarks.runInBatchMode({
|
||||
@ -194,7 +186,7 @@ ChromeProfileMigrator.prototype = {
|
||||
|
||||
NetUtil.asyncFetch(file, function(aInputStream, aResultCode) {
|
||||
if (!Components.isSuccessCode(aResultCode)) {
|
||||
migrator._notifyCompleted(MIGRATE_BOOKMARKS);
|
||||
migrator._notifyCompleted(MIGRATOR.BOOKMARKS);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -232,14 +224,14 @@ ChromeProfileMigrator.prototype = {
|
||||
insertBookmarkItems(parentId, roots.other.children);
|
||||
}
|
||||
|
||||
migrator._notifyCompleted(MIGRATE_BOOKMARKS);
|
||||
migrator._notifyCompleted(MIGRATOR.BOOKMARKS);
|
||||
});
|
||||
}
|
||||
}, null);
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
this._notifyError(MIGRATE_BOOKMARKS);
|
||||
this._notifyCompleted(MIGRATE_BOOKMARKS);
|
||||
this._notifyError(MIGRATOR.BOOKMARKS);
|
||||
this._notifyCompleted(MIGRATOR.BOOKMARKS);
|
||||
}
|
||||
},
|
||||
|
||||
@ -248,7 +240,7 @@ ChromeProfileMigrator.prototype = {
|
||||
*/
|
||||
_migrateHistory : function Chrome_migrateHistory()
|
||||
{
|
||||
this._notifyStart(MIGRATE_HISTORY);
|
||||
this._notifyStart(MIGRATOR.HISTORY);
|
||||
|
||||
try {
|
||||
PlacesUtils.history.runInBatchMode({
|
||||
@ -305,7 +297,7 @@ ChromeProfileMigrator.prototype = {
|
||||
|
||||
handleCompletion : function(aReason) {
|
||||
this._db.asyncClose();
|
||||
this._self._notifyCompleted(MIGRATE_HISTORY);
|
||||
this._self._notifyCompleted(MIGRATOR.HISTORY);
|
||||
}
|
||||
});
|
||||
stmt.finalize();
|
||||
@ -313,8 +305,8 @@ ChromeProfileMigrator.prototype = {
|
||||
}, null);
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
this._notifyError(MIGRATE_HISTORY);
|
||||
this._notifyCompleted(MIGRATE_HISTORY);
|
||||
this._notifyError(MIGRATOR.HISTORY);
|
||||
this._notifyCompleted(MIGRATOR.HISTORY);
|
||||
}
|
||||
},
|
||||
|
||||
@ -323,7 +315,7 @@ ChromeProfileMigrator.prototype = {
|
||||
*/
|
||||
_migrateCookies : function Chrome_migrateCookies()
|
||||
{
|
||||
this._notifyStart(MIGRATE_COOKIES);
|
||||
this._notifyStart(MIGRATOR.COOKIES);
|
||||
|
||||
try {
|
||||
// Access sqlite3 database of Chrome's cookie
|
||||
@ -369,14 +361,14 @@ ChromeProfileMigrator.prototype = {
|
||||
|
||||
handleCompletion : function(aReason) {
|
||||
this._db.asyncClose();
|
||||
this._self._notifyCompleted(MIGRATE_COOKIES);
|
||||
this._self._notifyCompleted(MIGRATOR.COOKIES);
|
||||
},
|
||||
});
|
||||
stmt.finalize();
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
this._notifyError(MIGRATE_COOKIES);
|
||||
this._notifyCompleted(MIGRATE_COOKIES);
|
||||
this._notifyError(MIGRATOR.COOKIES);
|
||||
this._notifyCompleted(MIGRATOR.COOKIES);
|
||||
}
|
||||
},
|
||||
|
||||
@ -409,13 +401,13 @@ ChromeProfileMigrator.prototype = {
|
||||
// notification is sent
|
||||
this._pendingCount = 1;
|
||||
|
||||
if (aItems & MIGRATE_HISTORY)
|
||||
if (aItems & MIGRATOR.HISTORY)
|
||||
this._migrateHistory();
|
||||
|
||||
if (aItems & MIGRATE_COOKIES)
|
||||
if (aItems & MIGRATOR.COOKIES)
|
||||
this._migrateCookies();
|
||||
|
||||
if (aItems & MIGRATE_BOOKMARKS)
|
||||
if (aItems & MIGRATOR.BOOKMARKS)
|
||||
this._migrateBookmarks();
|
||||
|
||||
if (--this._pendingCount == 0) {
|
||||
@ -452,7 +444,7 @@ ChromeProfileMigrator.prototype = {
|
||||
file.append("Bookmarks");
|
||||
if (file.exists()) {
|
||||
this._paths.bookmarks = file.path;
|
||||
result += MIGRATE_BOOKMARKS;
|
||||
result += MIGRATOR.BOOKMARKS;
|
||||
}
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
@ -471,7 +463,7 @@ ChromeProfileMigrator.prototype = {
|
||||
file.append("History");
|
||||
if (file.exists()) {
|
||||
this._paths.history = file.path;
|
||||
result += MIGRATE_HISTORY;
|
||||
result += MIGRATOR.HISTORY;
|
||||
}
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
@ -482,7 +474,7 @@ ChromeProfileMigrator.prototype = {
|
||||
file.append("Cookies");
|
||||
if (file.exists()) {
|
||||
this._paths.cookies = file.path;
|
||||
result += MIGRATE_COOKIES;
|
||||
result += MIGRATOR.COOKIES;
|
||||
}
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
|
404
browser/components/migration/src/FirefoxProfileMigrator.js
Normal file
404
browser/components/migration/src/FirefoxProfileMigrator.js
Normal file
@ -0,0 +1,404 @@
|
||||
/* -*- Mode: js; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
* vim: sw=2 ts=2 sts=2 et
|
||||
* This Source Code is subject to the terms of the Mozilla Public License
|
||||
* version 2.0 (the "License"). You can obtain a copy of the License at
|
||||
* http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/*
|
||||
* Migrates from a Firefox profile in a lossy manner in order to clean up a user's profile. Data
|
||||
* is only migrated where the benefits outweigh the potential problems caused by importing
|
||||
* undesired/invalid configurations from the source profile.
|
||||
*/
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
const Cr = Components.results;
|
||||
const MIGRATOR = Ci.nsIBrowserProfileMigrator;
|
||||
|
||||
const LOCAL_FILE_CID = "@mozilla.org/file/local;1";
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
Components.utils.import("resource://gre/modules/PlacesUtils.jsm");
|
||||
Components.utils.import("resource://gre/modules/NetUtil.jsm");
|
||||
Components.utils.import("resource://gre/modules/FileUtils.jsm");
|
||||
|
||||
function FirefoxProfileMigrator()
|
||||
{
|
||||
// profD is not available when the migrator is run during startup so use ProfDS.
|
||||
this._paths.currentProfile = FileUtils.getDir("ProfDS", []);
|
||||
}
|
||||
|
||||
FirefoxProfileMigrator.prototype = {
|
||||
_paths: {
|
||||
bookmarks : null,
|
||||
cookies : null,
|
||||
currentProfile: null, // The currently running (destination) profile.
|
||||
encryptionKey: null,
|
||||
history : null,
|
||||
passwords: null,
|
||||
},
|
||||
|
||||
_homepageURL : null,
|
||||
_replaceBookmarks : false,
|
||||
_sourceProfile: null,
|
||||
_profilesCache: null,
|
||||
|
||||
/**
|
||||
* Notify to observers to start migration
|
||||
*
|
||||
* @param aType
|
||||
* notification type such as MIGRATOR.BOOKMARKS
|
||||
*/
|
||||
_notifyStart : function Firefox_notifyStart(aType)
|
||||
{
|
||||
Services.obs.notifyObservers(null, "Migration:ItemBeforeMigrate", aType);
|
||||
this._pendingCount++;
|
||||
},
|
||||
|
||||
/**
|
||||
* Notify observers that a migration error occured with an item
|
||||
*
|
||||
* @param aType
|
||||
* notification type such as MIGRATOR.BOOKMARKS
|
||||
*/
|
||||
_notifyError : function Firefox_notifyError(aType)
|
||||
{
|
||||
Services.obs.notifyObservers(null, "Migration:ItemError", aType);
|
||||
},
|
||||
|
||||
/**
|
||||
* Notify to observers to finish migration for item
|
||||
* If all items are finished, it sends migration end notification.
|
||||
*
|
||||
* @param aType
|
||||
* notification type such as MIGRATOR.BOOKMARKS
|
||||
*/
|
||||
_notifyCompleted : function Firefox_notifyIfCompleted(aType)
|
||||
{
|
||||
Services.obs.notifyObservers(null, "Migration:ItemAfterMigrate", aType);
|
||||
if (--this._pendingCount == 0) {
|
||||
// All items are migrated, so we have to send end notification.
|
||||
Services.obs.notifyObservers(null, "Migration:Ended", null);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* The directory used for bookmark backups
|
||||
* @return directory of the bookmark backups
|
||||
*/
|
||||
get _bookmarks_backup_folder()
|
||||
{
|
||||
let bookmarksBackupRelativePath = PlacesUtils.backups.profileRelativeFolderPath;
|
||||
let bookmarksBackupDir = this._sourceProfile.clone().QueryInterface(Ci.nsILocalFile);
|
||||
bookmarksBackupDir.appendRelativePath(bookmarksBackupRelativePath);
|
||||
return bookmarksBackupDir;
|
||||
},
|
||||
|
||||
/**
|
||||
* Migrating bookmark items
|
||||
*/
|
||||
_migrateBookmarks : function Firefox_migrateBookmarks()
|
||||
{
|
||||
this._notifyStart(MIGRATOR.BOOKMARKS);
|
||||
|
||||
try {
|
||||
let srcBackupsDir = this._bookmarks_backup_folder;
|
||||
let backupFolder = this._paths.currentProfile.clone();
|
||||
backupFolder.append(srcBackupsDir.leafName);
|
||||
if (!backupFolder.exists())
|
||||
srcBackupsDir.copyTo(this._paths.currentProfile, null);
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
// Don't notify about backup migration errors since actual bookmarks are
|
||||
// migrated with history.
|
||||
} finally {
|
||||
this._notifyCompleted(MIGRATOR.BOOKMARKS);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Migrating history
|
||||
*/
|
||||
_migrateHistory : function Firefox_migrateHistory()
|
||||
{
|
||||
this._notifyStart(MIGRATOR.HISTORY);
|
||||
|
||||
try {
|
||||
// access sqlite3 database of history
|
||||
let file = Cc[LOCAL_FILE_CID].createInstance(Ci.nsILocalFile);
|
||||
file.initWithPath(this._paths.history);
|
||||
file.copyTo(this._paths.currentProfile, null);
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
this._notifyError(MIGRATOR.HISTORY);
|
||||
} finally {
|
||||
this._notifyCompleted(MIGRATOR.HISTORY);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Migrating cookies
|
||||
*
|
||||
* @note Cookie permissions are not migrated since they may be inadvertently set leading to
|
||||
* website login problems.
|
||||
*/
|
||||
_migrateCookies : function Firefox_migrateCookies()
|
||||
{
|
||||
this._notifyStart(MIGRATOR.COOKIES);
|
||||
|
||||
try {
|
||||
// Access sqlite3 database of cookies
|
||||
let file = Cc[LOCAL_FILE_CID].createInstance(Ci.nsILocalFile);
|
||||
file.initWithPath(this._paths.cookies);
|
||||
file.copyTo(this._paths.currentProfile, null);
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
this._notifyError(MIGRATOR.COOKIES);
|
||||
} finally {
|
||||
this._notifyCompleted(MIGRATOR.COOKIES);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Migrating passwords
|
||||
*/
|
||||
_migratePasswords : function Firefox_migratePasswords()
|
||||
{
|
||||
this._notifyStart(MIGRATOR.PASSWORDS);
|
||||
|
||||
try {
|
||||
// Access sqlite3 database of passwords
|
||||
let file = Cc[LOCAL_FILE_CID].createInstance(Ci.nsILocalFile);
|
||||
file.initWithPath(this._paths.passwords);
|
||||
file.copyTo(this._paths.currentProfile, null);
|
||||
|
||||
let encryptionKey = Cc[LOCAL_FILE_CID].createInstance(Ci.nsILocalFile);
|
||||
encryptionKey.initWithPath(this._paths.encryptionKey);
|
||||
encryptionKey.copyTo(this._paths.currentProfile, null);
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
this._notifyError(MIGRATOR.PASSWORDS);
|
||||
} finally {
|
||||
this._notifyCompleted(MIGRATOR.PASSWORDS);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* nsIBrowserProfileMigrator interface implementation
|
||||
*/
|
||||
|
||||
/**
|
||||
* Let's migrate all items
|
||||
*
|
||||
* @param aItems
|
||||
* list of data items to migrate.
|
||||
* @param aStartup
|
||||
* non-null if called during startup.
|
||||
* @param aProfile
|
||||
* profile directory path to migrate from
|
||||
*/
|
||||
migrate : function Firefox_migrate(aItems, aStartup, aProfile)
|
||||
{
|
||||
if (aStartup) {
|
||||
aStartup.doStartup();
|
||||
this._replaceBookmarks = true;
|
||||
}
|
||||
|
||||
Services.obs.notifyObservers(null, "Migration:Started", null);
|
||||
|
||||
// Reset pending count. If this count becomes 0, "Migration:Ended"
|
||||
// notification is sent
|
||||
this._pendingCount = 1;
|
||||
|
||||
if (aItems & MIGRATOR.HISTORY)
|
||||
this._migrateHistory();
|
||||
|
||||
if (aItems & MIGRATOR.COOKIES)
|
||||
this._migrateCookies();
|
||||
|
||||
if (aItems & MIGRATOR.BOOKMARKS)
|
||||
this._migrateBookmarks();
|
||||
|
||||
if (aItems & MIGRATOR.PASSWORDS)
|
||||
this._migratePasswords();
|
||||
|
||||
if (--this._pendingCount == 0) {
|
||||
// When async imports are immediately completed unfortunately,
|
||||
// this will be called.
|
||||
// Usually, this notification is sent by _notifyCompleted()
|
||||
Services.obs.notifyObservers(null, "Migration:Ended", null);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* return supported migration types
|
||||
*
|
||||
* @param aProfile
|
||||
* the profile path to migrate from
|
||||
* @param aDoingStartup
|
||||
* non-null if called during startup.
|
||||
* @return supported migration types
|
||||
*
|
||||
* @todo Bug 715315 - make sure source databases are not in-use
|
||||
*/
|
||||
getMigrateData: function Firefox_getMigrateData(aProfile, aDoingStartup)
|
||||
{
|
||||
this._sourceProfile = Cc[LOCAL_FILE_CID].createInstance(Ci.nsILocalFile);
|
||||
this._sourceProfile.initWithPath(aProfile);
|
||||
|
||||
let result = 0;
|
||||
if (!this._sourceProfile.exists() || !this._sourceProfile.isReadable()) {
|
||||
Cu.reportError("source profile directory doesn't exist or is not readable");
|
||||
return result;
|
||||
}
|
||||
|
||||
// Migration initiated from the UI is not supported.
|
||||
if (!aDoingStartup)
|
||||
return result;
|
||||
|
||||
// Bookmark backups in JSON format
|
||||
try {
|
||||
let file = this._bookmarks_backup_folder;
|
||||
if (file.exists()) {
|
||||
this._paths.bookmarks = file.path;
|
||||
result += MIGRATOR.BOOKMARKS;
|
||||
}
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
}
|
||||
|
||||
// Bookmarks, history and favicons
|
||||
try {
|
||||
let file = this._sourceProfile.clone();
|
||||
file.append("places.sqlite");
|
||||
if (file.exists()) {
|
||||
this._paths.history = file.path;
|
||||
result += MIGRATOR.HISTORY;
|
||||
result |= MIGRATOR.BOOKMARKS;
|
||||
}
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
}
|
||||
|
||||
// Cookies
|
||||
try {
|
||||
let file = this._sourceProfile.clone();
|
||||
file.append("cookies.sqlite");
|
||||
if (file.exists()) {
|
||||
this._paths.cookies = file.path;
|
||||
result += MIGRATOR.COOKIES;
|
||||
}
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
}
|
||||
|
||||
// Passwords & encryption key
|
||||
try {
|
||||
let passwords = this._sourceProfile.clone();
|
||||
passwords.append("signons.sqlite");
|
||||
let encryptionKey = this._sourceProfile.clone();
|
||||
encryptionKey.append("key3.db");
|
||||
if (passwords.exists() && encryptionKey.exists()) {
|
||||
this._paths.passwords = passwords.path;
|
||||
this._paths.encryptionKey = encryptionKey.path;
|
||||
result += MIGRATOR.PASSWORDS;
|
||||
}
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* Whether we support migration of Firefox
|
||||
*
|
||||
* @return true if supported
|
||||
*/
|
||||
get sourceExists()
|
||||
{
|
||||
let userData = Services.dirsvc.get("DefProfRt", Ci.nsIFile).path;
|
||||
let result = 0;
|
||||
try {
|
||||
let userDataDir = Cc[LOCAL_FILE_CID].createInstance(Ci.nsILocalFile);
|
||||
userDataDir.initWithPath(userData);
|
||||
if (!userDataDir.exists() || !userDataDir.isReadable())
|
||||
return false;
|
||||
|
||||
let profiles = this.sourceProfiles;
|
||||
if (profiles.length < 1)
|
||||
return false;
|
||||
// Check that we can get data from at least one profile since profile selection has not
|
||||
// happened yet.
|
||||
for (let i = 0; i < profiles.length; i++) {
|
||||
result = this.getMigrateData(profiles.queryElementAt(i, Ci.nsISupportsString), true);
|
||||
if (result)
|
||||
break;
|
||||
}
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
}
|
||||
return result > 0;
|
||||
},
|
||||
|
||||
get sourceHasMultipleProfiles()
|
||||
{
|
||||
return this.sourceProfiles.length > 1;
|
||||
},
|
||||
|
||||
get sourceProfiles()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!this._profilesCache)
|
||||
{
|
||||
this._profilesCache = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
|
||||
let profileService = Cc["@mozilla.org/toolkit/profile-service;1"]
|
||||
.getService(Ci.nsIToolkitProfileService);
|
||||
// Only allow migrating from the default (selected) profile since this will be the only one
|
||||
// returned by the toolkit profile service after bug 214675 has landed.
|
||||
var profile = profileService.selectedProfile;
|
||||
if (profile.rootDir.path === this._paths.currentProfile.path)
|
||||
return null;
|
||||
|
||||
let str = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString);
|
||||
str.data = profile.rootDir.path;
|
||||
this._profilesCache.appendElement(str, false);
|
||||
}
|
||||
} catch (e) {
|
||||
Cu.reportError("Error detecting Firefox profiles: " + e);
|
||||
}
|
||||
return this._profilesCache;
|
||||
},
|
||||
|
||||
/**
|
||||
* Return home page URL
|
||||
*
|
||||
* @return home page URL
|
||||
*
|
||||
* @todo Bug 715348 will migrate preferences such as the homepage
|
||||
*/
|
||||
get sourceHomePageURL()
|
||||
{
|
||||
try {
|
||||
if (this._homepageURL)
|
||||
return this._homepageURL;
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
}
|
||||
return "";
|
||||
},
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([
|
||||
Ci.nsIBrowserProfileMigrator
|
||||
]),
|
||||
|
||||
classDescription: "Firefox Profile Migrator",
|
||||
contractID: "@mozilla.org/profile/migrator;1?app=browser&type=firefox",
|
||||
classID: Components.ID("{91185366-ba97-4438-acba-48deaca63386}")
|
||||
};
|
||||
|
||||
const NSGetFactory = XPCOMUtils.generateNSGetFactory([FirefoxProfileMigrator]);
|
@ -65,6 +65,7 @@ endif
|
||||
|
||||
EXTRA_PP_COMPONENTS = \
|
||||
ChromeProfileMigrator.js \
|
||||
FirefoxProfileMigrator.js \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_COMPONENTS = \
|
||||
|
@ -140,6 +140,7 @@ NS_IMPL_ISUPPORTS1(nsProfileMigrator, nsIProfileMigrator)
|
||||
#define INTERNAL_NAME_IEXPLORE "iexplore"
|
||||
#define INTERNAL_NAME_MOZILLA_SUITE "apprunner"
|
||||
#define INTERNAL_NAME_CHROME "chrome"
|
||||
#define INTERNAL_NAME_FIREFOX "firefox"
|
||||
#endif
|
||||
|
||||
nsresult
|
||||
@ -223,6 +224,10 @@ nsProfileMigrator::GetDefaultBrowserMigratorKey(nsACString& aKey,
|
||||
aKey = "chrome";
|
||||
return NS_OK;
|
||||
}
|
||||
else if (internalName.LowerCaseEqualsLiteral(INTERNAL_NAME_FIREFOX)) {
|
||||
aKey = "firefox";
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#else
|
||||
bool exists = false;
|
||||
@ -239,6 +244,7 @@ nsProfileMigrator::GetDefaultBrowserMigratorKey(nsACString& aKey,
|
||||
CHECK_MIGRATOR("safari");
|
||||
#endif
|
||||
CHECK_MIGRATOR("chrome");
|
||||
CHECK_MIGRATOR("firefox");
|
||||
|
||||
#undef CHECK_MIGRATOR
|
||||
#endif
|
||||
|
@ -8,6 +8,7 @@ this._scriptLoader.loadSubScript("chrome://mochikit/content/tests/SimpleTest/Chr
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
var searchEntries = ["test", "More Text", "Some Text"];
|
||||
var searchBar = BrowserSearch.searchBar;
|
||||
var searchButton = document.getAnonymousElementByAttribute(searchBar,
|
||||
"anonid", "search-go-button");
|
||||
@ -166,7 +167,7 @@ function test() {
|
||||
is(searchBar.value, "More Text", "drop text/uri-list on searchbar");
|
||||
SimpleTest.executeSoon(testRightClick);
|
||||
}
|
||||
|
||||
|
||||
function testRightClick() {
|
||||
init();
|
||||
searchBar.removeEventListener("popupshowing", stopPopup, true);
|
||||
@ -177,10 +178,29 @@ function test() {
|
||||
is(gBrowser.tabs.length, preTabNo, "RightClick did not open new tab");
|
||||
is(gBrowser.currentURI.spec, "about:blank", "RightClick did nothing");
|
||||
|
||||
finalize();
|
||||
testSearchHistory();
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
function testSearchHistory() {
|
||||
var textbox = searchBar._textbox;
|
||||
for (var i = 0; i < searchEntries.length; i++) {
|
||||
let exists = textbox._formHistSvc.entryExists(textbox.searchParam, searchEntries[i]);
|
||||
ok(exists, "form history entry '" + searchEntries[i] + "' should exist");
|
||||
}
|
||||
testAutocomplete();
|
||||
}
|
||||
|
||||
function testAutocomplete() {
|
||||
var popup = searchBar.textbox.popup;
|
||||
popup.addEventListener("popupshowing", function() {
|
||||
checkMenuEntries(searchEntries);
|
||||
finalize();
|
||||
popup.removeEventListener("popupshowing", this, false);
|
||||
}, false);
|
||||
searchBar.textbox.showHistoryPopup();
|
||||
}
|
||||
|
||||
function finalize() {
|
||||
searchBar.value = "";
|
||||
while (gBrowser.tabs.length != 1) {
|
||||
@ -211,5 +231,26 @@ function test() {
|
||||
buttonArg, null);
|
||||
aTarget.dispatchEvent(event);
|
||||
}
|
||||
|
||||
// modified from toolkit/components/satchel/test/test_form_autocomplete.html
|
||||
function checkMenuEntries(expectedValues) {
|
||||
var actualValues = getMenuEntries();
|
||||
is(actualValues.length, expectedValues.length, "Checking length of expected menu");
|
||||
for (var i = 0; i < expectedValues.length; i++)
|
||||
is(actualValues[i], expectedValues[i], "Checking menu entry #"+i);
|
||||
}
|
||||
|
||||
function getMenuEntries() {
|
||||
var entries = [];
|
||||
var autocompleteMenu = searchBar.textbox.popup;
|
||||
// Could perhaps pull values directly from the controller, but it seems
|
||||
// more reliable to test the values that are actually in the tree?
|
||||
var column = autocompleteMenu.tree.columns[0];
|
||||
var numRows = autocompleteMenu.tree.view.rowCount;
|
||||
for (var i = 0; i < numRows; i++) {
|
||||
entries.push(autocompleteMenu.tree.view.getValueAt(i, column));
|
||||
}
|
||||
return entries;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,8 +96,6 @@ static const MimeTypeAssociation appTypes[] = {
|
||||
{ "application/xhtml+xml", "xhtml xht" }
|
||||
};
|
||||
|
||||
static const char kDocumentIconPath[] = "firefox-document.png";
|
||||
|
||||
// GConf registry key constants
|
||||
#define DG_BACKGROUND "/desktop/gnome/background"
|
||||
|
||||
|
@ -84,6 +84,18 @@ gcli.addCommand({
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 'console close' command
|
||||
*/
|
||||
gcli.addCommand({
|
||||
name: "console close",
|
||||
description: gcli.lookup("consolecloseDesc"),
|
||||
exec: function(args, context) {
|
||||
let tab = HUDService.getHudReferenceById(context.environment.hudId).tab;
|
||||
HUDService.deactivateHUDForContext(tab);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 'inspect' command
|
||||
*/
|
||||
|
@ -3661,7 +3661,7 @@ HeadsUpDisplay.prototype = {
|
||||
consoleFilterToolbar.setAttribute("id", "viewGroup");
|
||||
this.consoleFilterToolbar = consoleFilterToolbar;
|
||||
|
||||
this.hintNode = this.makeXULNode("div");
|
||||
this.hintNode = this.makeXULNode("vbox");
|
||||
this.hintNode.setAttribute("class", "gcliterm-hint-node");
|
||||
|
||||
let hintParentNode = this.makeXULNode("vbox");
|
||||
@ -6835,7 +6835,7 @@ GcliTerm.prototype = {
|
||||
this.inputStack.setAttribute("class", "gcliterm-stack-node");
|
||||
this.element.appendChild(this.inputStack);
|
||||
|
||||
this.completeNode = this.document.createElement("div");
|
||||
this.completeNode = this.document.createElementNS(HTML_NS, "div");
|
||||
this.completeNode.setAttribute("class", "gcliterm-complete-node");
|
||||
this.completeNode.setAttribute("aria-live", "polite");
|
||||
this.inputStack.appendChild(this.completeNode);
|
||||
@ -6867,16 +6867,16 @@ GcliTerm.prototype = {
|
||||
if (aEvent.output.command.returnType == "html" && typeof output == "string") {
|
||||
output = this.document.createRange().createContextualFragment(
|
||||
'<div xmlns="' + HTML_NS + '" xmlns:xul="' + XUL_NS + '">' +
|
||||
output + '</div>').firstChild;
|
||||
output + '</div>');
|
||||
}
|
||||
|
||||
// See https://github.com/mozilla/domtemplate/blob/master/README.md
|
||||
// for docs on the template() function
|
||||
let element = this.document.createRange().createContextualFragment(
|
||||
'<richlistitem xmlns="' + XUL_NS + '" clipboardText="${clipboardText}"' +
|
||||
' timestamp="${timestamp}" id="${id}" class="hud-msg-node">' +
|
||||
' <label class="webconsole-timestamp" value="${timestampString}"/>' +
|
||||
' <vbox class="webconsole-msg-icon-container" style="${iconContainerStyle}">' +
|
||||
'<richlistitem xmlns="' + XUL_NS + '" _clipboardText="${clipboardText}"' +
|
||||
' _timestamp="${timestamp}" _id="${id}" class="hud-msg-node">' +
|
||||
' <label class="webconsole-timestamp" _value="${timestampString}"/>' +
|
||||
' <vbox class="webconsole-msg-icon-container" _style="${iconContainerStyle}">' +
|
||||
' <image class="webconsole-msg-icon"/>' +
|
||||
' <spacer flex="1"/>' +
|
||||
' </vbox>' +
|
||||
|
@ -3029,6 +3029,12 @@ JavascriptType.prototype.parse = function(arg) {
|
||||
return new Conversion(typed, arg, Status.ERROR, beginning.err);
|
||||
}
|
||||
|
||||
// If the current state is ParseState.COMPLEX, then we can't do completion.
|
||||
// so bail out now
|
||||
if (beginning.state === ParseState.COMPLEX) {
|
||||
return new Conversion(typed, arg);
|
||||
}
|
||||
|
||||
// If the current state is not ParseState.NORMAL, then we are inside of a
|
||||
// string which means that no completion is possible.
|
||||
if (beginning.state !== ParseState.NORMAL) {
|
||||
@ -3068,7 +3074,7 @@ JavascriptType.prototype.parse = function(arg) {
|
||||
// It would be nice to be able to report this error in some way but
|
||||
// as it can happen just when someone types '{sessionStorage.', it
|
||||
// almost doesn't really count as an error, so we ignore it
|
||||
return new Conversion(typed, arg, Status.INCOMPLETE, '');
|
||||
return new Conversion(typed, arg, Status.VALID, '');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3246,8 +3252,26 @@ function isVendorPrefixed(name) {
|
||||
* Constants used in return value of _findCompletionBeginning()
|
||||
*/
|
||||
var ParseState = {
|
||||
/**
|
||||
* We have simple input like window.foo, without any punctuation that makes
|
||||
* completion prediction be confusing or wrong
|
||||
*/
|
||||
NORMAL: 0,
|
||||
|
||||
/**
|
||||
* The cursor is in some Javascript that makes completion hard to predict,
|
||||
* like console.log(
|
||||
*/
|
||||
COMPLEX: 1,
|
||||
|
||||
/**
|
||||
* The cursor is inside single quotes (')
|
||||
*/
|
||||
QUOTE: 2,
|
||||
|
||||
/**
|
||||
* The cursor is inside single quotes (")
|
||||
*/
|
||||
DQUOTE: 3
|
||||
};
|
||||
|
||||
@ -3259,6 +3283,12 @@ var OPEN_CLOSE_BODY = {
|
||||
'(': ')'
|
||||
};
|
||||
|
||||
/**
|
||||
* How we distinguish between simple and complex JS input. We attempt
|
||||
* completion against simple JS.
|
||||
*/
|
||||
var simpleChars = /[a-zA-Z0-9.]/;
|
||||
|
||||
/**
|
||||
* Analyzes a given string to find the last statement that is interesting for
|
||||
* later completion.
|
||||
@ -3277,8 +3307,13 @@ JavascriptType.prototype._findCompletionBeginning = function(text) {
|
||||
var state = ParseState.NORMAL;
|
||||
var start = 0;
|
||||
var c;
|
||||
var complex = false;
|
||||
|
||||
for (var i = 0; i < text.length; i++) {
|
||||
c = text[i];
|
||||
if (!simpleChars.test(c)) {
|
||||
complex = true;
|
||||
}
|
||||
|
||||
switch (state) {
|
||||
// Normal JS state.
|
||||
@ -3344,6 +3379,10 @@ JavascriptType.prototype._findCompletionBeginning = function(text) {
|
||||
}
|
||||
}
|
||||
|
||||
if (state === ParseState.NORMAL && complex) {
|
||||
state = ParseState.COMPLEX;
|
||||
}
|
||||
|
||||
return {
|
||||
state: state,
|
||||
startPos: start
|
||||
@ -4338,7 +4377,6 @@ Requisition.prototype.toCanonicalString = function() {
|
||||
}, this);
|
||||
|
||||
// Canonically, if we've opened with a { then we should have a } to close
|
||||
var command = this.commandAssignment.getValue();
|
||||
if (cmd === '{') {
|
||||
if (this.getAssignment(0).getArg().suffix.indexOf('}') === -1) {
|
||||
line.push(' }');
|
||||
@ -5291,9 +5329,6 @@ define("text!gcli/commands/help_intro.html", [], "\n" +
|
||||
"<h2>${l10n.introHeader}</h2>\n" +
|
||||
"\n" +
|
||||
"<p>\n" +
|
||||
" <a target=\"_blank\" href=\"https://developer.mozilla.org/AppLinks/WebConsoleHelp?locale=${lang}\">\n" +
|
||||
" ${l10n.introBody}\n" +
|
||||
" </a>\n" +
|
||||
"</p>\n" +
|
||||
"");
|
||||
|
||||
@ -5374,7 +5409,7 @@ function Console(options) {
|
||||
this.focusManager.addMonitoredElement(this.gcliTerm.hintNode, 'gcliTerm');
|
||||
|
||||
this.inputter = new Inputter({
|
||||
document: options.contentDocument,
|
||||
document: options.chromeDocument,
|
||||
requisition: options.requisition,
|
||||
inputElement: options.inputElement,
|
||||
completeElement: options.completeElement,
|
||||
@ -5384,14 +5419,14 @@ function Console(options) {
|
||||
});
|
||||
|
||||
this.menu = new CommandMenu({
|
||||
document: options.contentDocument,
|
||||
document: options.chromeDocument,
|
||||
requisition: options.requisition,
|
||||
menuClass: 'gcliterm-menu'
|
||||
});
|
||||
this.hintElement.appendChild(this.menu.element);
|
||||
|
||||
this.argFetcher = new ArgFetcher({
|
||||
document: options.contentDocument,
|
||||
document: options.chromeDocument,
|
||||
requisition: options.requisition,
|
||||
argFetcherClass: 'gcliterm-argfetcher'
|
||||
});
|
||||
@ -5469,6 +5504,57 @@ Console.prototype.resizer = function() {
|
||||
this.hintElement.style.borderBottomColor = 'white';
|
||||
}
|
||||
}
|
||||
|
||||
// We also try to make the max-width of any GCLI elements so they don't
|
||||
// extend outside the scroll area.
|
||||
var doc = this.hintElement.ownerDocument;
|
||||
|
||||
var outputNode = this.hintElement.parentNode.parentNode.children[1];
|
||||
var outputs = outputNode.getElementsByClassName('gcliterm-msg-body');
|
||||
var listItems = outputNode.getElementsByClassName('hud-msg-node');
|
||||
|
||||
// This is an top-side estimate. We could try to calculate it, maybe using
|
||||
// something along these lines http://www.alexandre-gomes.com/?p=115 However
|
||||
// experience has shown this to be hard to get to work reliably
|
||||
// Also we don't need to be precise. If we use a number that is too big then
|
||||
// the only down-side is too great a right margin
|
||||
var scrollbarWidth = 20;
|
||||
|
||||
if (listItems.length > 0) {
|
||||
var parentWidth = outputNode.getBoundingClientRect().width - scrollbarWidth;
|
||||
var otherWidth;
|
||||
var body;
|
||||
|
||||
for (var i = 0; i < listItems.length; ++i) {
|
||||
var listItem = listItems[i];
|
||||
// a.k.a 'var otherWidth = 132'
|
||||
otherWidth = 0;
|
||||
body = null;
|
||||
|
||||
for (var j = 0; j < listItem.children.length; j++) {
|
||||
var child = listItem.children[j];
|
||||
|
||||
if (child.classList.contains('gcliterm-msg-body')) {
|
||||
body = child.children[0];
|
||||
}
|
||||
else {
|
||||
otherWidth += child.getBoundingClientRect().width;
|
||||
}
|
||||
|
||||
var styles = doc.defaultView.getComputedStyle(child, null);
|
||||
otherWidth += parseInt(styles.borderLeftWidth, 10) +
|
||||
parseInt(styles.borderRightWidth, 10) +
|
||||
parseInt(styles.paddingLeft, 10) +
|
||||
parseInt(styles.paddingRight, 10) +
|
||||
parseInt(styles.marginLeft, 10) +
|
||||
parseInt(styles.marginRight, 10);
|
||||
}
|
||||
|
||||
if (body) {
|
||||
body.style.width = (parentWidth - otherWidth) + 'px';
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
exports.Console = Console;
|
||||
@ -6039,7 +6125,7 @@ Completer.prototype.update = function(input) {
|
||||
// <span class="gcli-in-closebrace" if="${unclosedJs}">}<span>
|
||||
|
||||
var document = this.element.ownerDocument;
|
||||
var prompt = document.createElement('span');
|
||||
var prompt = dom.createElement(document, 'span');
|
||||
prompt.classList.add('gcli-prompt');
|
||||
prompt.appendChild(document.createTextNode(this.completionPrompt + ' '));
|
||||
this.element.appendChild(prompt);
|
||||
@ -6071,7 +6157,7 @@ Completer.prototype.update = function(input) {
|
||||
this.element.appendChild(document.createTextNode(prefix));
|
||||
}
|
||||
|
||||
var suffix = document.createElement('span');
|
||||
var suffix = dom.createElement(document, 'span');
|
||||
suffix.classList.add('gcli-in-ontab');
|
||||
suffix.appendChild(document.createTextNode(contents));
|
||||
this.element.appendChild(suffix);
|
||||
@ -6083,9 +6169,9 @@ Completer.prototype.update = function(input) {
|
||||
var unclosedJs = command && command.name === '{' &&
|
||||
this.requisition.getAssignment(0).getArg().suffix.indexOf('}') === -1;
|
||||
if (unclosedJs) {
|
||||
var close = document.createElement('span');
|
||||
var close = dom.createElement(document, 'span');
|
||||
close.classList.add('gcli-in-closebrace');
|
||||
close.appendChild(document.createTextNode('}'));
|
||||
close.appendChild(document.createTextNode(' }'));
|
||||
this.element.appendChild(close);
|
||||
}
|
||||
};
|
||||
@ -6111,7 +6197,7 @@ Completer.prototype.appendMarkupStatus = function(element, scores, input) {
|
||||
console.error('No state at i=' + i + '. scores.len=' + scores.length);
|
||||
state = Status.VALID;
|
||||
}
|
||||
span = document.createElement('span');
|
||||
span = dom.createElement(document, 'span');
|
||||
span.classList.add('gcli-in-' + state.toString().toLowerCase());
|
||||
lastStatus = scores[i];
|
||||
}
|
||||
|
@ -42,7 +42,12 @@
|
||||
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testInputFocus, false);
|
||||
}
|
||||
|
@ -43,7 +43,12 @@
|
||||
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testClosingAfterCompletion,
|
||||
false);
|
||||
|
@ -42,7 +42,12 @@
|
||||
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testGroups, false);
|
||||
}
|
||||
|
@ -43,7 +43,12 @@
|
||||
|
||||
const TEST_DUPLICATE_ERROR_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-duplicate-error.html";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
expectUncaughtException();
|
||||
addTab(TEST_DUPLICATE_ERROR_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testDuplicateErrors, false);
|
||||
|
@ -39,7 +39,12 @@
|
||||
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//browser/test-console.html";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testCompletion, false);
|
||||
}
|
||||
|
@ -38,7 +38,12 @@
|
||||
|
||||
const TEST_URI = "data:text/html,<p>bug 585991 - autocomplete popup keyboard usage test";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("load", tabLoaded, true);
|
||||
}
|
||||
|
@ -38,7 +38,12 @@
|
||||
|
||||
const TEST_URI = "data:text/html,<p>bug 585991 - autocomplete popup test";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("load", tabLoaded, true);
|
||||
}
|
||||
|
@ -10,7 +10,12 @@
|
||||
|
||||
const TEST_URI = "http://example.com/";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded",
|
||||
testSelectionWhenMovingBetweenBoxes, false);
|
||||
|
@ -10,7 +10,12 @@
|
||||
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("load", tabLoaded, true);
|
||||
}
|
||||
|
@ -11,8 +11,12 @@
|
||||
const TEST_URI = "data:text/html,Web Console test for bug 588342";
|
||||
let fm, notificationBox, input;
|
||||
|
||||
function test()
|
||||
{
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("load", tabLoad, true);
|
||||
|
@ -38,7 +38,12 @@
|
||||
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testInputExpansion, false);
|
||||
}
|
||||
|
@ -13,7 +13,12 @@
|
||||
// Tests that, when the user types an extraneous closing bracket, no error
|
||||
// appears.
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab("data:text/html,test for bug 592442");
|
||||
browser.addEventListener("load", testExtraneousClosingBrackets, true);
|
||||
}
|
||||
|
@ -154,7 +154,12 @@ function propertyPanelHidden(aEvent) {
|
||||
});
|
||||
}
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("load", tabLoad1, true);
|
||||
}
|
||||
|
@ -155,7 +155,12 @@ function performTests() {
|
||||
executeSoon(finishTest);
|
||||
}
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab("data:text/html,Web Console test for bug 594497 and bug 619598");
|
||||
browser.addEventListener("load", tabLoad, true);
|
||||
}
|
||||
|
@ -172,6 +172,7 @@ function testNext() {
|
||||
}
|
||||
|
||||
function testEnd() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
Services.console.unregisterListener(TestObserver);
|
||||
output.removeEventListener("DOMNodeInserted", onDOMNodeInserted, false);
|
||||
output = jsterm = null;
|
||||
@ -191,6 +192,7 @@ function onDOMNodeInserted(aEvent) {
|
||||
}
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
registerCleanupFunction(testEnd);
|
||||
|
||||
addTab("data:text/html,Web Console test for bug 595934 - message categories coverage.");
|
||||
|
@ -225,7 +225,12 @@ function testEnd() {
|
||||
executeSoon(finishTest);
|
||||
}
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("load", tabLoad, true);
|
||||
}
|
||||
|
@ -57,7 +57,12 @@ function tabLoad(aEvent) {
|
||||
});
|
||||
}
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab("data:text/html,Web Console test for bug 601352");
|
||||
browser.addEventListener("load", tabLoad, true);
|
||||
}
|
||||
|
@ -32,12 +32,17 @@ function onContentLoaded()
|
||||
finishTest();
|
||||
}
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
/**
|
||||
* Unit test for bug 611795:
|
||||
* Repeated CSS messages get collapsed into one.
|
||||
*/
|
||||
function test()
|
||||
{
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("load", function() {
|
||||
browser.removeEventListener("load", arguments.callee, true);
|
||||
|
@ -8,7 +8,12 @@
|
||||
|
||||
const TEST_URI = "data:text/html,Web Console test for bug 613280";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("load", tabLoaded, true);
|
||||
}
|
||||
|
@ -36,7 +36,12 @@ function tabLoad(aEvent) {
|
||||
finishTest();
|
||||
}
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab("data:text/html,Web Console test for bug 614793: jsterm result scroll");
|
||||
browser.addEventListener("load", tabLoad, true);
|
||||
}
|
||||
|
@ -38,7 +38,12 @@
|
||||
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("load", function() {
|
||||
browser.removeEventListener("load", arguments.callee, true);
|
||||
|
@ -41,7 +41,12 @@ const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//t
|
||||
let pb = Cc["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Ci.nsIPrivateBrowsingService);
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab("data:text/html,Web Console test for bug 618311 (private browsing)");
|
||||
|
||||
browser.addEventListener("load", function() {
|
||||
|
@ -42,7 +42,12 @@ function tabLoad(aEvent) {
|
||||
}, content);
|
||||
}
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("load", tabLoad, true);
|
||||
}
|
||||
|
@ -2,7 +2,12 @@
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
let itemsSet, HUD;
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab("data:text/html,Web Console test for bug 626484");
|
||||
browser.addEventListener("load", tabLoaded, true);
|
||||
}
|
||||
|
@ -3,7 +3,12 @@
|
||||
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-bug-632275-getters.html";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("load", tabLoaded, true);
|
||||
}
|
||||
|
@ -38,7 +38,12 @@
|
||||
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-bug-632347-iterators-generators.html";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("load", tabLoaded, true);
|
||||
}
|
||||
|
@ -76,7 +76,12 @@ function tabLoad(aEvent) {
|
||||
EventUtils.synthesizeKey("u", {});
|
||||
}
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("load", tabLoad, true);
|
||||
}
|
||||
|
@ -12,7 +12,12 @@ const TEST_URI = "http://example.com/browser/browser/devtools/" +
|
||||
|
||||
var gOldPref, gHudId;
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab("data:text/html,Web Console test for bug 644419: Console should " +
|
||||
"have user-settable log limits for each message category");
|
||||
browser.addEventListener("load", onLoad, true);
|
||||
|
@ -8,7 +8,12 @@
|
||||
|
||||
Cu.import("resource:///modules/PropertyPanel.jsm");
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab("data:text/html,Web Console autocompletion bug in document.body");
|
||||
browser.addEventListener("load", onLoad, true);
|
||||
}
|
||||
|
@ -133,8 +133,13 @@ function finishUp() {
|
||||
finish();
|
||||
}
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test()
|
||||
{
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
waitForExplicitFinish();
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("load", function() {
|
||||
|
@ -6,7 +6,12 @@
|
||||
|
||||
// Tests that the Console API implements the time() and timeEnd() methods.
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab("http://example.com/browser/browser/devtools/webconsole/" +
|
||||
"test/test-bug-658368-time-methods.html");
|
||||
openConsole();
|
||||
|
@ -4,7 +4,12 @@
|
||||
|
||||
const TEST_URI = "data:text/html,<p>bug 660806 - history navigation must not show the autocomplete popup";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("load", tabLoaded, true);
|
||||
}
|
||||
|
@ -7,7 +7,12 @@
|
||||
// Tests that console.group/groupEnd works as intended.
|
||||
const GROUP_INDENT = 12;
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab("data:text/html,Web Console test for bug 664131: Expand console " +
|
||||
"object with group methods");
|
||||
browser.addEventListener("load", onLoad, true);
|
||||
|
@ -40,7 +40,12 @@
|
||||
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testCompletion, false);
|
||||
}
|
||||
|
@ -42,7 +42,12 @@
|
||||
|
||||
const TEST_URI = "chrome://browser/content/browser.xul";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testChrome, false);
|
||||
}
|
||||
|
@ -42,7 +42,12 @@
|
||||
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testCompletion, false);
|
||||
}
|
||||
|
@ -42,7 +42,12 @@
|
||||
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded", onLoad, false);
|
||||
}
|
||||
|
@ -11,8 +11,13 @@
|
||||
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-own-console.html";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test()
|
||||
{
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("load", function() {
|
||||
browser.removeEventListener("load", arguments.callee, true);
|
||||
|
@ -12,8 +12,13 @@
|
||||
|
||||
const TEST_URI = "data:text/html,Web Console test for bug 586142";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test()
|
||||
{
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded", onLoad, false);
|
||||
}
|
||||
|
@ -42,7 +42,12 @@
|
||||
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testExecutionScope, false);
|
||||
}
|
||||
|
@ -46,7 +46,12 @@ const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//t
|
||||
const HISTORY_BACK = -1;
|
||||
const HISTORY_FORWARD = 1;
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testHistory, false);
|
||||
}
|
||||
|
@ -43,7 +43,12 @@
|
||||
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testHUDGetters, false);
|
||||
}
|
||||
|
@ -43,7 +43,12 @@
|
||||
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testJSInputAndOutputStyling,
|
||||
false);
|
||||
|
@ -42,7 +42,12 @@
|
||||
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testJSInputExpansion, false);
|
||||
}
|
||||
|
@ -43,7 +43,12 @@ const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//t
|
||||
|
||||
let jsterm;
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testJSTerm, false);
|
||||
}
|
||||
|
@ -43,7 +43,12 @@
|
||||
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testNullAndUndefinedOutput,
|
||||
false);
|
||||
|
@ -43,7 +43,12 @@
|
||||
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testOutputOrder, false);
|
||||
}
|
||||
|
@ -43,7 +43,12 @@
|
||||
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testPropertyPanel, false);
|
||||
}
|
||||
|
@ -43,7 +43,12 @@
|
||||
|
||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test//test-console.html";
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
Services.prefs.clearUserPref("devtools.gcli.enable");
|
||||
});
|
||||
|
||||
function test() {
|
||||
Services.prefs.setBoolPref("devtools.gcli.enable", false);
|
||||
addTab(TEST_URI);
|
||||
browser.addEventListener("DOMContentLoaded", testPropertyProvider, false);
|
||||
}
|
||||
|
@ -372,8 +372,9 @@
|
||||
#endif
|
||||
@BINPATH@/components/BrowserProfileMigrators.manifest
|
||||
@BINPATH@/components/ChromeProfileMigrator.js
|
||||
@BINPATH@/components/FirefoxProfileMigrator.js
|
||||
#ifdef XP_MACOSX
|
||||
@BINPATH@/components/libalerts_s.dylib
|
||||
@BINPATH@/components/libalerts.dylib
|
||||
#endif
|
||||
#ifdef MOZ_ENABLE_DBUS
|
||||
@BINPATH@/components/@DLL_PREFIX@dbusservice@DLL_SUFFIX@
|
||||
|
@ -44,6 +44,9 @@ components/@DLL_PREFIX@brwsrdir@DLL_SUFFIX@
|
||||
components/@DLL_PREFIX@myspell@DLL_SUFFIX@
|
||||
components/@DLL_PREFIX@spellchecker@DLL_SUFFIX@
|
||||
components/@DLL_PREFIX@spellchk@DLL_SUFFIX@
|
||||
#ifdef XP_MACOSX
|
||||
components/libalerts_s.dylib
|
||||
#endif
|
||||
components/aboutCertError.js
|
||||
components/aboutPrivateBrowsing.js
|
||||
components/aboutRights.js
|
||||
|
@ -113,7 +113,7 @@ helpSearchDesc=Search string
|
||||
# LOCALIZATION NOTE (helpSearchManual): A fuller description of the 'search'
|
||||
# parameter to the 'help' command. Displayed when the user asks for help on
|
||||
# what it does.
|
||||
helpSearchManual=A search string to use in narrowing down the list of commands that are displayed to the user. Any part of the string can match, regular expressions are not supported.
|
||||
helpSearchManual=A search string to use in narrowing down the list of commands that are displayed to the user. Any part of the command name can match, regular expressions are not supported.
|
||||
|
||||
# LOCALIZATION NOTE (helpManSynopsis): A heading shown at the top of a help
|
||||
# page for a command in the console It labels a summary of the parameters to
|
||||
|
@ -55,3 +55,8 @@ inspectNodeDesc=CSS selector
|
||||
# parameter to the 'inspect' command, displayed when the user asks for help
|
||||
# on what it does.
|
||||
inspectNodeManual=A CSS selector for use with Document.querySelector which identifies a single element
|
||||
|
||||
# LOCALIZATION NOTE (consolecloseDesc) A very short description of the
|
||||
# 'console close' command. This string is designed to be shown in a menu
|
||||
# alongside the command name, which is why it should be as short as possible.
|
||||
consolecloseDesc=Close the console
|
||||
|
@ -13,6 +13,8 @@
|
||||
<!ENTITY importFromSafari.accesskey "S">
|
||||
<!ENTITY importFromChrome.label "Chrome">
|
||||
<!ENTITY importFromChrome.accesskey "C">
|
||||
<!ENTITY importFromFirefox.label "Firefox">
|
||||
<!ENTITY importFromFirefox.accesskey "X">
|
||||
<!ENTITY importFromHTMLFile.label "From an HTML File">
|
||||
<!ENTITY importFromHTMLFile.accesskey "F">
|
||||
|
||||
|
@ -4,6 +4,7 @@ profileName_format=%S %S
|
||||
sourceNameIE=Internet Explorer
|
||||
sourceNameSafari=Safari
|
||||
sourceNameChrome=Google Chrome
|
||||
sourceNameFirefox=Mozilla Firefox
|
||||
|
||||
importedBookmarksFolder=From %S
|
||||
importedSearchURLsFolder=Keyword Searches (From %S)
|
||||
@ -20,10 +21,12 @@ importedSafariBookmarks=From Safari
|
||||
2_ie=Cookies
|
||||
2_safari=Cookies
|
||||
2_chrome=Cookies
|
||||
2_firefox=Cookies
|
||||
|
||||
4_ie=Browsing History
|
||||
4_safari=Browsing History
|
||||
4_chrome=Browsing History
|
||||
4_firefox=Browsing History
|
||||
|
||||
8_ie=Saved Form History
|
||||
8_safari=Saved Form History
|
||||
@ -32,10 +35,12 @@ importedSafariBookmarks=From Safari
|
||||
16_ie=Saved Passwords
|
||||
16_safari=Saved Passwords
|
||||
16_chrome=Saved Passwords
|
||||
16_firefox=Saved Passwords
|
||||
|
||||
32_ie=Favorites
|
||||
32_safari=Bookmarks
|
||||
32_chrome=Bookmarks
|
||||
32_firefox=Bookmarks
|
||||
|
||||
64_ie=Other Data
|
||||
64_safari=Other Data
|
||||
|
@ -67,11 +67,7 @@
|
||||
color: GrayText;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.hud-msg-node {
|
||||
list-style-image: url(chrome://browser/skin/devtools/webconsole.png);
|
||||
-moz-image-region: rect(0, 1px, 0, 0);
|
||||
font: 12px "DejaVu Sans Mono", monospace;
|
||||
}
|
||||
|
||||
.webconsole-msg-icon {
|
||||
@ -91,6 +87,9 @@
|
||||
-moz-margin-start: 3px;
|
||||
-moz-margin-end: 6px;
|
||||
white-space: pre-wrap;
|
||||
list-style-image: url(chrome://browser/skin/devtools/webconsole.png);
|
||||
-moz-image-region: rect(0, 1px, 0, 0);
|
||||
font: 12px "DejaVu Sans Mono", monospace;
|
||||
}
|
||||
|
||||
.webconsole-msg-body-piece {
|
||||
@ -133,7 +132,6 @@
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.hud-output-node,
|
||||
.jsterm-input-node,
|
||||
.jsterm-complete-node {
|
||||
font: 12px "DejaVu Sans Mono", monospace;
|
||||
|
@ -157,9 +157,7 @@ code {
|
||||
.twisty {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.nodeChildBox {
|
||||
|
@ -70,11 +70,7 @@
|
||||
color: GrayText;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.hud-msg-node {
|
||||
list-style-image: url(chrome://browser/skin/devtools/webconsole.png);
|
||||
-moz-image-region: rect(0, 1px, 0, 0);
|
||||
font: 11px Menlo, Monaco, monospace;
|
||||
}
|
||||
|
||||
.webconsole-msg-icon {
|
||||
@ -94,6 +90,9 @@
|
||||
-moz-margin-start: 3px;
|
||||
-moz-margin-end: 6px;
|
||||
white-space: pre-wrap;
|
||||
list-style-image: url(chrome://browser/skin/devtools/webconsole.png);
|
||||
-moz-image-region: rect(0, 1px, 0, 0);
|
||||
font: 11px Menlo, Monaco, monospace;
|
||||
}
|
||||
|
||||
.webconsole-msg-body-piece {
|
||||
@ -136,7 +135,6 @@
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.hud-output-node,
|
||||
.jsterm-input-node,
|
||||
.jsterm-complete-node {
|
||||
font: 11px Menlo, Monaco, monospace;
|
||||
|
@ -66,11 +66,7 @@
|
||||
color: GrayText;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.hud-msg-node {
|
||||
list-style-image: url(chrome://browser/skin/devtools/webconsole.png);
|
||||
-moz-image-region: rect(0, 1px, 0, 0);
|
||||
font: 12px Consolas, Lucida Console, monospace;
|
||||
}
|
||||
|
||||
.webconsole-msg-icon {
|
||||
@ -90,6 +86,9 @@
|
||||
-moz-margin-start: 3px;
|
||||
-moz-margin-end: 6px;
|
||||
white-space: pre-wrap;
|
||||
list-style-image: url(chrome://browser/skin/devtools/webconsole.png);
|
||||
-moz-image-region: rect(0, 1px, 0, 0);
|
||||
font: 12px Consolas, Lucida Console, monospace;
|
||||
}
|
||||
|
||||
.webconsole-msg-body-piece {
|
||||
@ -132,7 +131,6 @@
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.hud-output-node,
|
||||
.jsterm-input-node,
|
||||
.jsterm-complete-node {
|
||||
font: 12px Consolas, Lucida Console, monospace;
|
||||
|
@ -12,6 +12,7 @@
|
||||
import os
|
||||
import subprocess
|
||||
import re
|
||||
import sys
|
||||
|
||||
re_for_ld = re.compile('.*\((.*)\).*')
|
||||
|
||||
@ -67,7 +68,19 @@ def find_version(e):
|
||||
return encode_ver(last_version)
|
||||
|
||||
if __name__ == '__main__':
|
||||
cxx_env = os.environ['CXX']
|
||||
print 'MOZ_LIBSTDCXX_TARGET_VERSION=%s' % find_version(cxx_env)
|
||||
host_cxx_env = os.environ.get('HOST_CXX', cxx_env)
|
||||
print 'MOZ_LIBSTDCXX_HOST_VERSION=%s' % find_version(host_cxx_env)
|
||||
if os.uname()[0] == 'Darwin':
|
||||
sdk_dir = os.environ['MACOS_SDK_DIR']
|
||||
if 'MacOSX10.5.sdk' in sdk_dir:
|
||||
target_ver = 0
|
||||
host_ver = 0
|
||||
else:
|
||||
target_ver = encode_ver('3.4.9')
|
||||
host_ver = encode_ver('3.4.9')
|
||||
else:
|
||||
cxx_env = os.environ['CXX']
|
||||
target_ver = find_version(cxx_env)
|
||||
host_cxx_env = os.environ.get('HOST_CXX', cxx_env)
|
||||
host_ver = find_version(host_cxx_env)
|
||||
|
||||
print 'MOZ_LIBSTDCXX_TARGET_VERSION=%s' % target_ver
|
||||
print 'MOZ_LIBSTDCXX_HOST_VERSION=%s' % host_ver
|
||||
|
@ -1,2 +1,4 @@
|
||||
CC=/usr/bin/gcc-4.2
|
||||
CXX=/usr/bin/g++-4.2
|
||||
|
||||
ac_add_options --enable-stdcxx-compat
|
||||
|
@ -265,11 +265,11 @@ public class FennecNativeDriver implements Driver {
|
||||
// and returns a string version of the entire file.
|
||||
public static String getFile(String filename)
|
||||
{
|
||||
File file = new File(filename);
|
||||
StringBuilder text = new StringBuilder();
|
||||
|
||||
BufferedReader br = null;
|
||||
try {
|
||||
BufferedReader br = new BufferedReader(new FileReader(file));
|
||||
br = new BufferedReader(new FileReader(filename));
|
||||
String line;
|
||||
|
||||
while ((line = br.readLine()) != null) {
|
||||
@ -278,6 +278,11 @@ public class FennecNativeDriver implements Driver {
|
||||
}
|
||||
} catch(IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
br.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
return text.toString();
|
||||
}
|
||||
|
@ -77,7 +77,9 @@ public class FennecNativeElement implements Element {
|
||||
public void run() {
|
||||
View view = (View)mActivity.findViewById(id);
|
||||
if(view != null) {
|
||||
view.performClick();
|
||||
if (!view.performClick()) {
|
||||
Log.w("Robocop", "Robocop called click on an element with no listener");
|
||||
}
|
||||
} else {
|
||||
throw new RoboCopException("click: unable to find view "+id);
|
||||
}
|
||||
|
@ -57,6 +57,9 @@ namespace std {
|
||||
template ostream& ostream::_M_insert(double);
|
||||
template ostream& ostream::_M_insert(long);
|
||||
template ostream& ostream::_M_insert(unsigned long);
|
||||
#ifdef DEBUG
|
||||
template ostream& ostream::_M_insert(const void*);
|
||||
#endif
|
||||
template ostream& __ostream_insert(ostream&, const char*, streamsize);
|
||||
template istream& istream::_M_extract(double&);
|
||||
#endif
|
||||
|
@ -428,7 +428,7 @@ class Preprocessor:
|
||||
args = open(args, 'rU')
|
||||
except:
|
||||
raise Preprocessor.Error(self, 'FILE_NOT_FOUND', str(args))
|
||||
self.checkLineNumbers = bool(re.search('\.js(?:\.in)?$', args.name))
|
||||
self.checkLineNumbers = bool(re.search('\.(js|java)(?:\.in)?$', args.name))
|
||||
oldFile = self.context['FILE']
|
||||
oldLine = self.context['LINE']
|
||||
oldDir = self.context['DIRECTORY']
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user