Merge from mozilla-central.
@ -44,7 +44,8 @@
|
||||
#include "nsMai.h"
|
||||
#include "prlink.h"
|
||||
#include "prenv.h"
|
||||
#include "nsIPrefBranch.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "nsIGConfService.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsAccessibilityService.h"
|
||||
@ -53,6 +54,8 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include <atk/atk.h>
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
typedef GType (* AtkGetTypeType) (void);
|
||||
GType g_atk_hyperlink_impl_type = G_TYPE_INVALID;
|
||||
static bool sATKChecked = false;
|
||||
@ -61,10 +64,12 @@ 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 sSysPrefService [] =
|
||||
"@mozilla.org/system-preference-service;1";
|
||||
static const char sUseSystemPrefsKey[] =
|
||||
"config.use_system_prefs";
|
||||
static const char sAccessibilityKey [] =
|
||||
"config.use_system_prefs.accessibility";
|
||||
static const char sGconfAccessibilityKey[] =
|
||||
"/desktop/gnome/interface/accessibility";
|
||||
|
||||
/* gail function pointer */
|
||||
static guint (* gail_add_global_event_listener) (GSignalEmissionHook listener,
|
||||
@ -625,11 +630,17 @@ nsApplicationAccessibleWrap::Init()
|
||||
isGnomeATEnabled = !!atoi(envValue);
|
||||
} else {
|
||||
//check gconf-2 setting
|
||||
if (Preferences::GetBool(sUseSystemPrefsKey, false)) {
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIPrefBranch> sysPrefService =
|
||||
do_GetService(sSysPrefService, &rv);
|
||||
if (NS_SUCCEEDED(rv) && sysPrefService) {
|
||||
sysPrefService->GetBoolPref(sAccessibilityKey, &isGnomeATEnabled);
|
||||
nsCOMPtr<nsIGConfService> gconf =
|
||||
do_GetService(NS_GCONFSERVICE_CONTRACTID, &rv);
|
||||
if (NS_SUCCEEDED(rv) && gconf) {
|
||||
gconf->GetBool(NS_LITERAL_CSTRING(sGconfAccessibilityKey),
|
||||
&isGnomeATEnabled);
|
||||
}
|
||||
} else {
|
||||
isGnomeATEnabled =
|
||||
Preferences::GetBool(sAccessibilityKey, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,7 @@
|
||||
#include "nsIContentViewer.h"
|
||||
#include "nsCURILoader.h"
|
||||
#include "nsDocAccessible.h"
|
||||
#include "nsHTMLCanvasAccessible.h"
|
||||
#include "nsHTMLImageMapAccessible.h"
|
||||
#include "nsHTMLLinkAccessible.h"
|
||||
#include "nsHTMLSelectAccessible.h"
|
||||
@ -275,6 +276,16 @@ nsAccessibilityService::CreateHTMLComboboxAccessible(nsIContent* aContent,
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
nsAccessibilityService::CreateHTMLCanvasAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
{
|
||||
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
|
||||
nsAccessible* accessible = new nsHTMLCanvasAccessible(aContent, weakShell);
|
||||
NS_IF_ADDREF(accessible);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
already_AddRefed<nsAccessible>
|
||||
nsAccessibilityService::CreateHTMLImageAccessible(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell)
|
||||
|
@ -83,6 +83,8 @@ public:
|
||||
CreateHTML4ButtonAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
virtual already_AddRefed<nsAccessible>
|
||||
CreateHTMLButtonAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
already_AddRefed<nsAccessible>
|
||||
CreateHTMLCanvasAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
virtual already_AddRefed<nsAccessible>
|
||||
CreateHTMLCaptionAccessible(nsIContent* aContent, nsIPresShell* aPresShell);
|
||||
virtual already_AddRefed<nsAccessible>
|
||||
|
@ -404,6 +404,12 @@ public:
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Downcasting and types
|
||||
|
||||
inline bool IsAbbreviation() const
|
||||
{
|
||||
return mContent->IsHTML() &&
|
||||
(mContent->Tag() == nsGkAtoms::abbr || mContent->Tag() == nsGkAtoms::acronym);
|
||||
}
|
||||
|
||||
inline bool IsApplication() const { return mFlags & eApplicationAccessible; }
|
||||
|
||||
bool IsAutoComplete() const { return mFlags & eAutoCompleteAccessible; }
|
||||
|
@ -391,15 +391,12 @@ nsRootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
|
||||
nsINode* targetNode = accessible->GetNode();
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
bool isTree = targetNode->IsElement() &&
|
||||
targetNode->AsElement()->NodeInfo()->Equals(nsGkAtoms::tree, kNameSpaceID_XUL);
|
||||
nsRefPtr<nsXULTreeAccessible> treeAcc;
|
||||
if (targetNode->IsElement() &&
|
||||
targetNode->AsElement()->NodeInfo()->Equals(nsGkAtoms::tree,
|
||||
kNameSpaceID_XUL)) {
|
||||
treeAcc = do_QueryObject(accessible);
|
||||
|
||||
if (isTree) {
|
||||
nsRefPtr<nsXULTreeAccessible> treeAcc = do_QueryObject(accessible);
|
||||
NS_ASSERTION(treeAcc,
|
||||
"Accessible for xul:tree isn't nsXULTreeAccessible.");
|
||||
|
||||
if (treeAcc) {
|
||||
if (eventType.EqualsLiteral("TreeViewChanged")) {
|
||||
treeAcc->TreeViewChanged();
|
||||
return;
|
||||
@ -415,7 +412,6 @@ nsRootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (eventType.EqualsLiteral("RadioStateChange")) {
|
||||
@ -451,18 +447,16 @@ nsRootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
|
||||
return;
|
||||
}
|
||||
|
||||
nsAccessible *treeItemAccessible = nsnull;
|
||||
nsAccessible* treeItemAcc = nsnull;
|
||||
#ifdef MOZ_XUL
|
||||
// If it's a tree element, need the currently selected item
|
||||
if (isTree) {
|
||||
treeItemAccessible = accessible->CurrentItem();
|
||||
if (treeItemAccessible)
|
||||
accessible = treeItemAccessible;
|
||||
// If it's a tree element, need the currently selected item.
|
||||
if (treeAcc) {
|
||||
treeItemAcc = accessible->CurrentItem();
|
||||
if (treeItemAcc)
|
||||
accessible = treeItemAcc;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
if (treeItemAccessible && eventType.EqualsLiteral("OpenStateChange")) {
|
||||
if (treeItemAcc && eventType.EqualsLiteral("OpenStateChange")) {
|
||||
PRUint64 state = accessible->State();
|
||||
bool isEnabled = (state & states::EXPANDED) != 0;
|
||||
|
||||
@ -472,7 +466,7 @@ nsRootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
|
||||
return;
|
||||
}
|
||||
|
||||
if (treeItemAccessible && eventType.EqualsLiteral("select")) {
|
||||
if (treeItemAcc && eventType.EqualsLiteral("select")) {
|
||||
// XXX: We shouldn't be based on DOM select event which doesn't provide us
|
||||
// any context info. We should integrate into nsTreeSelection instead.
|
||||
// If multiselect tree, we should fire selectionadd or selection removed
|
||||
@ -491,8 +485,10 @@ nsRootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
|
||||
return;
|
||||
}
|
||||
|
||||
nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_SELECTION,
|
||||
treeItemAccessible);
|
||||
nsRefPtr<AccSelChangeEvent> selChangeEvent =
|
||||
new AccSelChangeEvent(treeAcc, treeItemAcc,
|
||||
AccSelChangeEvent::eSelectionAdd);
|
||||
nsEventShell::FireEvent(selChangeEvent);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -50,6 +50,7 @@ LIBXUL_LIBRARY = 1
|
||||
|
||||
|
||||
CPPSRCS = \
|
||||
nsHTMLCanvasAccessible.cpp \
|
||||
nsHTMLFormControlAccessible.cpp \
|
||||
nsHTMLImageAccessible.cpp \
|
||||
nsHTMLImageMapAccessible.cpp \
|
||||
|
52
accessible/src/html/nsHTMLCanvasAccessible.cpp
Normal file
@ -0,0 +1,52 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation
|
||||
* Portions created by the Initial Developer are Copyright (C) 2011
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsHTMLCanvasAccessible.h"
|
||||
|
||||
using namespace mozilla::a11y;
|
||||
|
||||
nsHTMLCanvasAccessible::
|
||||
nsHTMLCanvasAccessible(nsIContent* aContent, nsIWeakReference* aShell) :
|
||||
nsHyperTextAccessible(aContent, aShell)
|
||||
{
|
||||
}
|
||||
|
||||
PRUint32
|
||||
nsHTMLCanvasAccessible::NativeRole()
|
||||
{
|
||||
return nsIAccessibleRole::ROLE_CANVAS;
|
||||
}
|
56
accessible/src/html/nsHTMLCanvasAccessible.h
Normal file
@ -0,0 +1,56 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Mozilla Foundation
|
||||
* Portions created by the Initial Developer are Copyright (C) 2011
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsHyperTextAccessible.h"
|
||||
|
||||
#ifndef _nsHTMLCanvasAccessible_H_
|
||||
#define _nsHTMLCanvasAccessible_H_
|
||||
|
||||
/**
|
||||
* HTML canvas accessible (html:canvas).
|
||||
*/
|
||||
class nsHTMLCanvasAccessible : public nsHyperTextAccessible
|
||||
{
|
||||
public:
|
||||
nsHTMLCanvasAccessible(nsIContent* aContent, nsIWeakReference* aShell);
|
||||
virtual ~nsHTMLCanvasAccessible() { }
|
||||
|
||||
// nsAccessible
|
||||
virtual PRUint32 NativeRole();
|
||||
};
|
||||
|
||||
#endif
|
@ -124,6 +124,7 @@ nsHTMLTableCellAccessible::GetAttributesInternal(nsIPersistentProperties *aAttri
|
||||
nsresult rv = nsHyperTextAccessibleWrap::GetAttributesInternal(aAttributes);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// table-cell-index attribute
|
||||
nsCOMPtr<nsIAccessibleTable> tableAcc(GetTableAccessible());
|
||||
if (!tableAcc)
|
||||
return NS_OK;
|
||||
@ -139,6 +140,32 @@ nsHTMLTableCellAccessible::GetAttributesInternal(nsIPersistentProperties *aAttri
|
||||
nsAutoString stringIdx;
|
||||
stringIdx.AppendInt(idx);
|
||||
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::tableCellIndex, stringIdx);
|
||||
|
||||
// abbr attribute
|
||||
|
||||
// Pick up object attribute from abbr DOM element (a child of the cell) or
|
||||
// from abbr DOM attribute.
|
||||
nsAutoString abbrText;
|
||||
if (GetChildCount() == 1) {
|
||||
nsAccessible* abbr = FirstChild();
|
||||
if (abbr->IsAbbreviation()) {
|
||||
nsTextEquivUtils::
|
||||
AppendTextEquivFromTextContent(abbr->GetContent()->GetFirstChild(),
|
||||
&abbrText);
|
||||
}
|
||||
}
|
||||
if (abbrText.IsEmpty())
|
||||
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::abbr, abbrText);
|
||||
|
||||
if (!abbrText.IsEmpty())
|
||||
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::abbr, abbrText);
|
||||
|
||||
// axis attribute
|
||||
nsAutoString axisText;
|
||||
mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::axis, axisText);
|
||||
if (!axisText.IsEmpty())
|
||||
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::axis, axisText);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -2059,6 +2059,25 @@ nsHyperTextAccessible::ScrollSubstringToPoint(PRInt32 aStartIndex,
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsAccessible public
|
||||
|
||||
nsresult
|
||||
nsHyperTextAccessible::GetNameInternal(nsAString& aName)
|
||||
{
|
||||
nsresult rv = nsAccessibleWrap::GetNameInternal(aName);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Get name from title attribute for HTML abbr and acronym elements making it
|
||||
// a valid name from markup. Otherwise their name isn't picked up by recursive
|
||||
// name computation algorithm. See NS_OK_NAME_FROM_TOOLTIP.
|
||||
if (aName.IsEmpty() && IsAbbreviation()) {
|
||||
nsAutoString name;
|
||||
if (mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::title, name)) {
|
||||
name.CompressWhitespace();
|
||||
aName = name;
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsHyperTextAccessible::InvalidateChildren()
|
||||
{
|
||||
|
@ -86,6 +86,7 @@ public:
|
||||
// nsAccessible
|
||||
virtual PRInt32 GetLevelInternal();
|
||||
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
|
||||
virtual nsresult GetNameInternal(nsAString& aName);
|
||||
virtual PRUint32 NativeRole();
|
||||
virtual PRUint64 NativeState();
|
||||
|
||||
|
@ -43,9 +43,12 @@
|
||||
#include "nsIWinAccessNode.h"
|
||||
#include "nsRootAccessible.h"
|
||||
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "nsArrayUtils.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
// Window property used by ipc related code in identifying accessible
|
||||
// tab windows.
|
||||
const PRUnichar* kPropNameTabContent = L"AccessibleTabWindow";
|
||||
@ -185,13 +188,12 @@ nsWinUtils::HideNativeWindow(HWND aWnd)
|
||||
bool
|
||||
nsWinUtils::IsWindowEmulationFor(LPCWSTR kModuleHandle)
|
||||
{
|
||||
#ifdef MOZ_E10S_COMPAT
|
||||
// Window emulation is always enabled in multiprocess Firefox.
|
||||
if (Preferences::GetBool("browser.tabs.remote"))
|
||||
return kModuleHandle ? ::GetModuleHandleW(kModuleHandle) : true;
|
||||
#else
|
||||
|
||||
return kModuleHandle ? ::GetModuleHandleW(kModuleHandle) :
|
||||
::GetModuleHandleW(kJAWSModuleHandle) ||
|
||||
::GetModuleHandleW(kWEModuleHandle) ||
|
||||
::GetModuleHandleW(kDolphinModuleHandle);
|
||||
#endif
|
||||
}
|
||||
|
@ -92,6 +92,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=558036
|
||||
testAttrs("radio", {"checkable" : "true"}, true);
|
||||
testAttrs("checkbox", {"checkable" : "true"}, true);
|
||||
testAttrs("draggable", {"draggable" : "true"}, true);
|
||||
testAttrs("th1", { "abbr": "SS#" }, true);
|
||||
testAttrs("th2", { "abbr": "SS#" }, true);
|
||||
testAttrs("th2", { "axis": "social" }, true);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
@ -175,5 +178,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=558036
|
||||
<input id="radio" type="radio"/>
|
||||
<input id="checkbox" type="checkbox"/>
|
||||
<div id="draggable" draggable="true">Draggable div</div>
|
||||
<table>
|
||||
<tr>
|
||||
<th id="th1"><abbr title="Social Security Number">SS#</abbr></th>
|
||||
<th id="th2" abbr="SS#" axis="social">Social Security Number</th>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -132,6 +132,10 @@
|
||||
// the name from its children.
|
||||
testName("tablemenuitem", "menuitem 1");
|
||||
|
||||
// Get the name from child acronym title attribute rather than from
|
||||
// acronym content.
|
||||
testName("label_with_acronym", "O A T F World Wide Web");
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// title attribute
|
||||
|
||||
@ -220,6 +224,11 @@
|
||||
title="Accessible name is duplicated when input has a label associated uisng for/id and is wrapped around the input">
|
||||
Mozilla Bug 669312
|
||||
</a>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=704416"
|
||||
title="HTML acronym and abbr names should be provided by @title">
|
||||
Mozilla Bug 704416
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
@ -395,6 +404,11 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<label id="label_with_acronym">
|
||||
<acronym title="O A T F">OATF</acronym>
|
||||
<abbr title="World Wide Web">WWW</abbr>
|
||||
</label>
|
||||
|
||||
<!-- name from title attribute -->
|
||||
<span id="btn_title" role="group" title="title">15</span>
|
||||
|
||||
|
@ -7,6 +7,7 @@ const ROLE_APPLICATION = nsIAccessibleRole.ROLE_APPLICATION;
|
||||
const ROLE_APP_ROOT = nsIAccessibleRole.ROLE_APP_ROOT;
|
||||
const ROLE_AUTOCOMPLETE = nsIAccessibleRole.ROLE_AUTOCOMPLETE;
|
||||
const ROLE_BUTTONDROPDOWNGRID = nsIAccessibleRole.ROLE_BUTTONDROPDOWNGRID;
|
||||
const ROLE_CANVAS = nsIAccessibleRole.ROLE_CANVAS;
|
||||
const ROLE_CAPTION = nsIAccessibleRole.ROLE_CAPTION;
|
||||
const ROLE_CELL = nsIAccessibleRole.ROLE_CELL;
|
||||
const ROLE_CHECKBUTTON = nsIAccessibleRole.ROLE_CHECKBUTTON;
|
||||
|
@ -52,6 +52,7 @@ _TEST_FILES =\
|
||||
test_aria_imgmap.html \
|
||||
test_aria_presentation.html \
|
||||
test_button.xul \
|
||||
test_canvas.html \
|
||||
test_combobox.xul \
|
||||
test_cssoverflow.html \
|
||||
test_dochierarchy.html \
|
||||
|
57
accessible/tests/mochitest/tree/test_canvas.html
Normal file
@ -0,0 +1,57 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=495912
|
||||
-->
|
||||
<head>
|
||||
<title>File Input Control tests</title>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
||||
|
||||
<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">
|
||||
function doTest()
|
||||
{
|
||||
var accTree = {
|
||||
role: ROLE_CANVAS,
|
||||
children: [
|
||||
]
|
||||
};
|
||||
testAccessibleTree("canvas", accTree);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a target="_blank"
|
||||
title="Expose alternative content in Canvas element to ATs"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=495912">Mozilla Bug 495912</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
|
||||
<canvas id="canvas" tabindex="0">
|
||||
fallback content.
|
||||
</canvas>
|
||||
|
||||
<script type="text/javascript">
|
||||
var c=document.getElementById("canvas");
|
||||
var cxt=c.getContext("2d");
|
||||
cxt.fillStyle="#005500";
|
||||
cxt.fillRect(0,0,150,75);
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
1
aclocal.m4
vendored
@ -12,6 +12,7 @@ builtin(include, build/autoconf/codeset.m4)dnl
|
||||
builtin(include, build/autoconf/altoptions.m4)dnl
|
||||
builtin(include, build/autoconf/mozprog.m4)dnl
|
||||
builtin(include, build/autoconf/mozheader.m4)dnl
|
||||
builtin(include, build/autoconf/mozcommonheader.m4)dnl
|
||||
builtin(include, build/autoconf/acwinpaths.m4)dnl
|
||||
builtin(include, build/autoconf/lto.m4)dnl
|
||||
builtin(include, build/autoconf/gcc-pr49911.m4)dnl
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0"?>
|
||||
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1318359094000">
|
||||
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1321712096000">
|
||||
<emItems>
|
||||
<emItem blockID="i41" id="{99079a25-328f-4bd4-be04-00955acaa0a7}">
|
||||
<versionRange minVersion="0.1" maxVersion="4.3.1.00" severity="1">
|
||||
@ -117,6 +117,13 @@
|
||||
<versionRange minVersion="2.2" maxVersion="2.2">
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i45" id="{22119944-ED35-4ab1-910B-E619EA06A115}">
|
||||
<versionRange minVersion="0.1" maxVersion="7.6.1">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
<versionRange minVersion="8.0a1" maxVersion="*" />
|
||||
</targetApplication>
|
||||
</versionRange>
|
||||
</emItem>
|
||||
<emItem blockID="i3" id="langpack-vi-VN@firefox.mozilla.org">
|
||||
<versionRange minVersion="2.0" maxVersion="2.0">
|
||||
</versionRange>
|
||||
|
@ -1038,6 +1038,18 @@ pref("devtools.hud.height", 0);
|
||||
// window - in a separate window/popup panel.
|
||||
pref("devtools.webconsole.position", "above");
|
||||
|
||||
// Remember the Web Console filters
|
||||
pref("devtools.webconsole.filter.network", true);
|
||||
pref("devtools.webconsole.filter.networkinfo", true);
|
||||
pref("devtools.webconsole.filter.csserror", true);
|
||||
pref("devtools.webconsole.filter.cssparser", true);
|
||||
pref("devtools.webconsole.filter.exception", true);
|
||||
pref("devtools.webconsole.filter.jswarn", true);
|
||||
pref("devtools.webconsole.filter.error", true);
|
||||
pref("devtools.webconsole.filter.warn", true);
|
||||
pref("devtools.webconsole.filter.info", true);
|
||||
pref("devtools.webconsole.filter.log", true);
|
||||
|
||||
// The number of lines that are displayed in the web console for the Net,
|
||||
// CSS, JS and Web Developer categories.
|
||||
pref("devtools.hud.loglimit.network", 200);
|
||||
|
@ -241,8 +241,20 @@
|
||||
#endif
|
||||
<key id="key_openAddons" key="&addons.commandkey;" command="Tools:Addons" modifiers="accel,shift"/>
|
||||
<key id="key_errorConsole" key="&errorConsoleCmd.commandkey;" oncommand="toJavaScriptConsole();" modifiers="accel,shift" disabled="true"/>
|
||||
<key id="key_webConsole" key="&webConsoleCmd.commandkey;" oncommand="HUDConsoleUI.toggleHUD();" modifiers="accel,shift"/>
|
||||
<key id="key_inspect" key="&inspectMenu.commandkey;" command="Tools:Inspect" modifiers="accel,shift"/>
|
||||
<key id="key_webConsole" key="&webConsoleCmd.commandkey;" oncommand="HUDConsoleUI.toggleHUD();"
|
||||
#ifdef XP_MACOSX
|
||||
modifiers="accel,alt"
|
||||
#else
|
||||
modifiers="accel,shift"
|
||||
#endif
|
||||
/>
|
||||
<key id="key_inspect" key="&inspectMenu.commandkey;" command="Tools:Inspect"
|
||||
#ifdef XP_MACOSX
|
||||
modifiers="accel,alt"
|
||||
#else
|
||||
modifiers="accel,shift"
|
||||
#endif
|
||||
/>
|
||||
<key id="key_scratchpad" keycode="&scratchpad.keycode;" modifiers="shift"
|
||||
keytext="&scratchpad.keytext;" command="Tools:Scratchpad"/>
|
||||
<key id="key_styleeditor" keycode="&styleeditor.keycode;" modifiers="shift"
|
||||
|
@ -3481,7 +3481,6 @@ const BrowserSearch = {
|
||||
openLinkIn(submission.uri.spec,
|
||||
useNewTab ? "tab" : "current",
|
||||
{ postData: submission.postData,
|
||||
inBackground: false,
|
||||
relatedToCurrent: true });
|
||||
},
|
||||
|
||||
@ -3951,6 +3950,9 @@ var FullScreen = {
|
||||
return;
|
||||
}
|
||||
|
||||
if (gFindBarInitialized)
|
||||
gFindBar.close();
|
||||
|
||||
this.showWarning(true);
|
||||
|
||||
// Exit DOM full-screen mode upon open, close, or change tab.
|
||||
|
@ -418,7 +418,7 @@ nsContextMenu.prototype = {
|
||||
this.showItem("context-media-unmute", onMedia && this.target.muted);
|
||||
this.showItem("context-media-showcontrols", onMedia && !this.target.controls);
|
||||
this.showItem("context-media-hidecontrols", onMedia && this.target.controls);
|
||||
this.showItem("context-video-fullscreen", this.onVideo);
|
||||
this.showItem("context-video-fullscreen", this.onVideo && this.target.ownerDocument.mozFullScreenElement == null);
|
||||
var statsShowing = this.onVideo && this.target.wrappedJSObject.mozMediaStatisticsShowing;
|
||||
this.showItem("context-video-showstats", this.onVideo && this.target.controls && !statsShowing);
|
||||
this.showItem("context-video-hidestats", this.onVideo && this.target.controls && statsShowing);
|
||||
@ -859,10 +859,15 @@ nsContextMenu.prototype = {
|
||||
},
|
||||
|
||||
fullScreenVideo: function () {
|
||||
this.target.pause();
|
||||
|
||||
let video = this.target;
|
||||
if (document.mozFullScreenEnabled)
|
||||
video.mozRequestFullScreen();
|
||||
else {
|
||||
// Fallback for the legacy full-screen video implementation.
|
||||
video.pause();
|
||||
openDialog("chrome://browser/content/fullscreen-video.xhtml",
|
||||
"", "chrome,centerscreen,dialog=no", this.target);
|
||||
"", "chrome,centerscreen,dialog=no", video);
|
||||
}
|
||||
},
|
||||
|
||||
// Change current window to the URL of the background image.
|
||||
|
@ -340,6 +340,9 @@ var MigrationWizard = {
|
||||
case "safari":
|
||||
source = "sourceNameSafari";
|
||||
break;
|
||||
case "chrome":
|
||||
source = "sourceNameChrome";
|
||||
break;
|
||||
}
|
||||
|
||||
// semi-wallpaper for crash when multiple profiles exist, since we haven't initialized mSourceProfile in places
|
||||
|
@ -79,6 +79,7 @@
|
||||
#endif
|
||||
<radio id="opera" label="&importFromOpera.label;" accesskey="&importFromOpera.accesskey;"/>
|
||||
#endif
|
||||
<radio id="chrome" label="&importFromChrome.label;" accesskey="&importFromChrome.accesskey;"/>
|
||||
<radio id="fromfile" label="&importFromHTMLFile.label;" accesskey="&importFromHTMLFile.accesskey;" hidden="true"/>
|
||||
<radio id="nothing" label="&importFromNothing.label;" accesskey="&importFromNothing.accesskey;" hidden="true"/>
|
||||
</radiogroup>
|
||||
|
@ -0,0 +1,2 @@
|
||||
component {4cec1de4-1671-4fc3-a53e-6c539dc77a26} ChromeProfileMigrator.js
|
||||
contract @mozilla.org/profile/migrator;1?app=browser&type=chrome {4cec1de4-1671-4fc3-a53e-6c539dc77a26}
|
532
browser/components/migration/src/ChromeProfileMigrator.js
Normal file
@ -0,0 +1,532 @@
|
||||
/* -*- Mode: js; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
* vim: sw=2 ts=2 sts=2 et
|
||||
* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License
|
||||
* at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
||||
* the License for the specific language governing rights and
|
||||
* limitations under the License.
|
||||
*
|
||||
* The Original Code is the Browser Profile Migrator.
|
||||
*
|
||||
* The Initial Developer of the Original Code is the Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2011
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Makoto Kato <m_kato@ga2.so-net.ne.jp> (Original Author)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
|
||||
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;
|
||||
|
||||
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");
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "bookmarksSubfolderTitle", function () {
|
||||
// get "import from google chrome" string for folder
|
||||
let strbundle =
|
||||
Services.strings.createBundle(BUNDLE_MIGRATION);
|
||||
let sourceNameChrome = strbundle.GetStringFromName("sourceNameChrome");
|
||||
return strbundle.formatStringFromName("importedBookmarksFolder",
|
||||
[sourceNameChrome],
|
||||
1);
|
||||
});
|
||||
|
||||
/*
|
||||
* Convert Chrome time format to Date object
|
||||
*
|
||||
* @param aTime
|
||||
* Chrome time
|
||||
* @return converted Date object
|
||||
* @note Google Chrome uses FILETIME / 10 as time.
|
||||
* FILETIME is based on same structure of Windows.
|
||||
*/
|
||||
function chromeTimeToDate(aTime)
|
||||
{
|
||||
return new Date((aTime * S100NS_PER_MS - S100NS_FROM1601TO1970 ) / 10000);
|
||||
}
|
||||
|
||||
/*
|
||||
* Insert bookmark items into specific folder.
|
||||
*
|
||||
* @param aFolderId
|
||||
* id of folder where items will be inserted
|
||||
* @param aItems
|
||||
* bookmark items to be inserted
|
||||
*/
|
||||
function insertBookmarkItems(aFolderId, aItems)
|
||||
{
|
||||
for (let i = 0; i < aItems.length; i++) {
|
||||
let item = aItems[i];
|
||||
|
||||
try {
|
||||
if (item.type == "url") {
|
||||
PlacesUtils.bookmarks.insertBookmark(aFolderId,
|
||||
NetUtil.newURI(item.url),
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
item.name);
|
||||
} else if (item.type == "folder") {
|
||||
let newFolderId =
|
||||
PlacesUtils.bookmarks.createFolder(aFolderId,
|
||||
item.name,
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX);
|
||||
|
||||
insertBookmarkItems(newFolderId, item.children);
|
||||
}
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function ChromeProfileMigrator()
|
||||
{
|
||||
}
|
||||
|
||||
ChromeProfileMigrator.prototype = {
|
||||
_paths: {
|
||||
bookmarks : null,
|
||||
cookies : null,
|
||||
history : null,
|
||||
prefs : null,
|
||||
},
|
||||
|
||||
_homepageURL : null,
|
||||
_replaceBookmarks : false,
|
||||
|
||||
/*
|
||||
* Notify to observers to start migration
|
||||
*
|
||||
* @param aType
|
||||
* notification type such as MIGRATE_BOOKMARKS
|
||||
*/
|
||||
|
||||
_notifyStart : function Chrome_notifyStart(aType)
|
||||
{
|
||||
Services.obs.notifyObservers(null, "Migration:ItemBeforeMigrate", aType);
|
||||
this._pendingCount++;
|
||||
},
|
||||
|
||||
/*
|
||||
* Notify to observers to finish migration for item
|
||||
* If all items are finished, it sends migration end notification.
|
||||
*
|
||||
* @param aType
|
||||
* notification type such as MIGRATE_BOOKMARKS
|
||||
*/
|
||||
_notifyCompleted : function Chrome_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);
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
* Migrating bookmark items
|
||||
*/
|
||||
_migrateBookmarks : function Chrome_migrateBookmarks()
|
||||
{
|
||||
this._notifyStart(MIGRATE_BOOKMARKS);
|
||||
|
||||
try {
|
||||
PlacesUtils.bookmarks.runInBatchMode({
|
||||
_self : this,
|
||||
runBatched : function (aUserData) {
|
||||
let migrator = this._self;
|
||||
let file = Cc[LOCAL_FILE_CID].createInstance(Ci.nsILocalFile);
|
||||
file.initWithPath(migrator._paths.bookmarks);
|
||||
|
||||
NetUtil.asyncFetch(file, function(aInputStream, aResultCode) {
|
||||
if (!Components.isSuccessCode(aResultCode)) {
|
||||
migrator._notifyCompleted(MIGRATE_BOOKMARKS);
|
||||
return;
|
||||
}
|
||||
|
||||
// Parse Chrome bookmark file that is JSON format
|
||||
let bookmarkJSON = NetUtil.readInputStreamToString(aInputStream,
|
||||
aInputStream.available(),
|
||||
{ charset : "UTF-8" });
|
||||
let roots = JSON.parse(bookmarkJSON).roots;
|
||||
|
||||
// Importing bookmark bar items
|
||||
if (roots.bookmark_bar.children &&
|
||||
roots.bookmark_bar.children.length > 0) {
|
||||
// Toolbar
|
||||
let parentId = PlacesUtils.toolbarFolderId;
|
||||
if (!migrator._replaceBookmarks) {
|
||||
parentId =
|
||||
PlacesUtils.bookmarks.createFolder(parentId,
|
||||
bookmarksSubfolderTitle,
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX);
|
||||
}
|
||||
insertBookmarkItems(parentId, roots.bookmark_bar.children);
|
||||
}
|
||||
|
||||
// Importing bookmark menu items
|
||||
if (roots.other.children &&
|
||||
roots.other.children.length > 0) {
|
||||
// Bookmark menu
|
||||
let parentId = PlacesUtils.bookmarksMenuFolderId;
|
||||
if (!migrator._replaceBookmarks) {
|
||||
parentId =
|
||||
PlacesUtils.bookmarks.createFolder(parentId,
|
||||
bookmarksSubfolderTitle,
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX);
|
||||
}
|
||||
insertBookmarkItems(parentId, roots.other.children);
|
||||
}
|
||||
|
||||
migrator._notifyCompleted(MIGRATE_BOOKMARKS);
|
||||
});
|
||||
}
|
||||
}, null);
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
this._notifyCompleted(MIGRATE_BOOKMARKS);
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
* Migrating history
|
||||
*/
|
||||
_migrateHistory : function Chrome_migrateHistory()
|
||||
{
|
||||
this._notifyStart(MIGRATE_HISTORY);
|
||||
|
||||
try {
|
||||
PlacesUtils.history.runInBatchMode({
|
||||
_self : this,
|
||||
runBatched : function (aUserData) {
|
||||
// access sqlite3 database of Chrome's history
|
||||
let file = Cc[LOCAL_FILE_CID].createInstance(Ci.nsILocalFile);
|
||||
file.initWithPath(this._self._paths.history);
|
||||
|
||||
let dbConn = Services.storage.openUnsharedDatabase(file);
|
||||
let stmt = dbConn.createAsyncStatement(
|
||||
"SELECT url, title, last_visit_time, typed_count FROM urls WHERE hidden = 0");
|
||||
|
||||
stmt.executeAsync({
|
||||
_asyncHistory : Cc["@mozilla.org/browser/history;1"]
|
||||
.getService(Ci.mozIAsyncHistory),
|
||||
_db : dbConn,
|
||||
_self : this._self,
|
||||
handleResult : function(aResults) {
|
||||
let places = [];
|
||||
for (let row = aResults.getNextRow(); row; row = aResults.getNextRow()) {
|
||||
try {
|
||||
// if having typed_count, we changes transition type to typed.
|
||||
let transType = PlacesUtils.history.TRANSITION_LINK;
|
||||
if (row.getResultByName("typed_count") > 0)
|
||||
transType = PlacesUtils.history.TRANSITION_TYPED;
|
||||
|
||||
places.push({
|
||||
uri: NetUtil.newURI(row.getResultByName("url")),
|
||||
title: row.getResultByName("title"),
|
||||
visits: [{
|
||||
transitionType: transType,
|
||||
visitDate: chromeTimeToDate(
|
||||
row.getResultByName(
|
||||
"last_visit_time")) * 1000,
|
||||
}],
|
||||
});
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
this._asyncHistory.updatePlaces(places);
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
}
|
||||
},
|
||||
|
||||
handleError : function(aError) {
|
||||
Cu.reportError("Async statement execution returned with '" +
|
||||
aError.result + "', '" + aError.message + "'");
|
||||
},
|
||||
|
||||
handleCompletion : function(aReason) {
|
||||
this._db.asyncClose();
|
||||
this._self._notifyCompleted(MIGRATE_HISTORY);
|
||||
}
|
||||
});
|
||||
stmt.finalize();
|
||||
}
|
||||
}, null);
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
this._notifyCompleted(MIGRATE_HISTORY);
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
* Migrating cookies
|
||||
*/
|
||||
_migrateCookies : function Chrome_migrateCookies()
|
||||
{
|
||||
this._notifyStart(MIGRATE_COOKIES);
|
||||
|
||||
try {
|
||||
// Access sqlite3 database of Chrome's cookie
|
||||
let file = Cc[LOCAL_FILE_CID].createInstance(Ci.nsILocalFile);
|
||||
file.initWithPath(this._paths.cookies);
|
||||
|
||||
let dbConn = Services.storage.openUnsharedDatabase(file);
|
||||
let stmt = dbConn.createAsyncStatement(
|
||||
"SELECT host_key, path, name, value, secure, httponly, expires_utc FROM cookies");
|
||||
|
||||
stmt.executeAsync({
|
||||
_db : dbConn,
|
||||
_self : this,
|
||||
handleResult : function(aResults) {
|
||||
for (let row = aResults.getNextRow(); row; row = aResults.getNextRow()) {
|
||||
let host_key = row.getResultByName("host_key");
|
||||
if (host_key.match(/^\./)) {
|
||||
// 1st character of host_key may be ".", so we have to remove it
|
||||
host_key = host_key.substr(1);
|
||||
}
|
||||
|
||||
try {
|
||||
let expiresUtc =
|
||||
chromeTimeToDate(row.getResultByName("expires_utc")) / 1000;
|
||||
Services.cookies.add(host_key,
|
||||
row.getResultByName("path"),
|
||||
row.getResultByName("name"),
|
||||
row.getResultByName("value"),
|
||||
row.getResultByName("secure"),
|
||||
row.getResultByName("httponly"),
|
||||
false,
|
||||
parseInt(expiresUtc));
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
handleError : function(aError) {
|
||||
Cu.reportError("Async statement execution returned with '" +
|
||||
aError.result + "', '" + aError.message + "'");
|
||||
},
|
||||
|
||||
handleCompletion : function(aReason) {
|
||||
this._db.asyncClose();
|
||||
this._self._notifyCompleted(MIGRATE_COOKIES);
|
||||
},
|
||||
});
|
||||
stmt.finalize();
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
this._notifyCompleted(MIGRATE_COOKIES);
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
* nsIBrowserProfileMigrator interface implementation
|
||||
*/
|
||||
|
||||
/*
|
||||
* Let's migrate all items
|
||||
*
|
||||
* @param aItems
|
||||
* list of data items to migrate. but this is unused.
|
||||
* @param aStartup
|
||||
* non-null if called during startup.
|
||||
* @param aProfile
|
||||
* this is unused due to single profile support only
|
||||
*/
|
||||
migrate : function Chrome_migrate(aItems, aStartup, aProfile)
|
||||
{
|
||||
if (aStartup) {
|
||||
aStartup.doStartup();
|
||||
this._replaceBookmarks = true;
|
||||
}
|
||||
|
||||
Services.obs.notifyObservers(null, "Migration:Started", null);
|
||||
|
||||
// Reset panding count. If this count becomes 0, "Migration:Ended"
|
||||
// notification is sent
|
||||
this._pendingCount = 1;
|
||||
|
||||
if (aItems & MIGRATE_HISTORY)
|
||||
this._migrateHistory();
|
||||
|
||||
if (aItems & MIGRATE_COOKIES)
|
||||
this._migrateCookies();
|
||||
|
||||
if (aItems & MIGRATE_BOOKMARKS)
|
||||
this._migrateBookmarks();
|
||||
|
||||
if (--this._pendingCount == 0) {
|
||||
// When async imports are immeditelly 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
|
||||
* this is unused due to single profile support only
|
||||
* @param aDoingStartup
|
||||
* non-null if called during startup.
|
||||
* @return supported migration types
|
||||
*/
|
||||
getMigrateData: function Chrome_getMigrateData(aProfile, aDoingStartup)
|
||||
{
|
||||
#ifdef XP_WIN
|
||||
let chromepath = Services.dirsvc.get("LocalAppData", Ci.nsIFile).path +
|
||||
"\\Google\\Chrome\\User Data\\Default\\";
|
||||
#elifdef XP_MACOSX
|
||||
let chromepath = Services.dirsvc.get("Home", Ci.nsIFile).path +
|
||||
"/Library/Application Support/Google/Chrome/Default/";
|
||||
#else
|
||||
let chromepath = Services.dirsvc.get("Home", Ci.nsIFile).path +
|
||||
"/.config/google-chrome/Default/";
|
||||
#endif
|
||||
|
||||
let result = 0;
|
||||
|
||||
// bookmark and preference are JSON format
|
||||
|
||||
try {
|
||||
let file = Cc[LOCAL_FILE_CID].createInstance(Ci.nsILocalFile);
|
||||
file.initWithPath(chromepath + "Bookmarks");
|
||||
if (file.exists()) {
|
||||
this._paths.bookmarks = file.path
|
||||
result += MIGRATE_BOOKMARKS;
|
||||
}
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
}
|
||||
|
||||
if (!this._paths.prefs)
|
||||
this._paths.prefs = chromepath + "Preferences";
|
||||
|
||||
// history and cookies are SQLite database
|
||||
|
||||
try {
|
||||
let file = Cc[LOCAL_FILE_CID].createInstance(Ci.nsILocalFile);
|
||||
file.initWithPath(chromepath + "History");
|
||||
if (file.exists()) {
|
||||
this._paths.history = file.path
|
||||
result += MIGRATE_HISTORY;
|
||||
}
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
}
|
||||
|
||||
try {
|
||||
let file = Cc[LOCAL_FILE_CID].createInstance(Ci.nsILocalFile);
|
||||
file.initWithPath(chromepath + "Cookies");
|
||||
if (file.exists()) {
|
||||
this._paths.cookies = file.path
|
||||
result += MIGRATE_COOKIES;
|
||||
}
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
/*
|
||||
* Whether we support migration of Chrome
|
||||
*
|
||||
* @return true if supported
|
||||
*/
|
||||
sourceExists: function Chrome_sourceExists()
|
||||
{
|
||||
let result = this.getMigrateData(null, false);
|
||||
return result != 0;
|
||||
},
|
||||
|
||||
// Although Chrome supports multi-profiles, there is no way
|
||||
// to get profile lists.
|
||||
sourceHasMultipleProfiles: false,
|
||||
sourceProfiles: null,
|
||||
|
||||
/*
|
||||
* Return home page URL
|
||||
*
|
||||
* @return home page URL
|
||||
*/
|
||||
sourceHomePageURL: function Chrome_sourceHomePageURL()
|
||||
{
|
||||
try {
|
||||
if (this._homepageURL)
|
||||
return this._homepageURL;
|
||||
|
||||
if (!this._paths.prefs)
|
||||
this.getMigrateData(null, false);
|
||||
|
||||
// XXX reading and parsing JSON is synchronous.
|
||||
let file = Cc[LOCAL_FILE_CID].createInstance(Ci.nsILocalFile);
|
||||
file.initWithPath(this._paths.prefs);
|
||||
let fstream = Cc[FILE_INPUT_STREAM_CID].
|
||||
createInstance(Ci.nsIFileInputStream);
|
||||
fstream.init(file, -1, 0, 0);
|
||||
this._homepageURL = JSON.parse(
|
||||
NetUtil.readInputStreamToString(fstream, fstream.available(),
|
||||
{ charset: "UTF-8" })).homepage;
|
||||
return this._homepageURL;
|
||||
} catch (e) {
|
||||
Cu.reportError(e);
|
||||
}
|
||||
return "";
|
||||
},
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([
|
||||
Ci.nsIBrowserProfileMigrator
|
||||
]),
|
||||
|
||||
classDescription: "Chrome Profile Migrator",
|
||||
contractID: "@mozilla.org/profile/migrator;1?app=browser&type=chrome",
|
||||
classID: Components.ID("{4cec1de4-1671-4fc3-a53e-6c539dc77a26}")
|
||||
};
|
||||
|
||||
const NSGetFactory = XPCOMUtils.generateNSGetFactory([ChromeProfileMigrator]);
|
@ -67,5 +67,13 @@ CPPSRCS += nsSafariProfileMigrator.cpp \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
EXTRA_PP_COMPONENTS = \
|
||||
ChromeProfileMigrator.js \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_COMPONENTS = \
|
||||
BrowserProfileMigrators.manifest \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
@ -163,6 +163,7 @@ NS_IMPL_ISUPPORTS1(nsProfileMigrator, nsIProfileMigrator)
|
||||
#define INTERNAL_NAME_IEXPLORE "iexplore"
|
||||
#define INTERNAL_NAME_MOZILLA_SUITE "apprunner"
|
||||
#define INTERNAL_NAME_OPERA "opera"
|
||||
#define INTERNAL_NAME_CHROME "chrome"
|
||||
#endif
|
||||
|
||||
nsresult
|
||||
@ -246,6 +247,10 @@ nsProfileMigrator::GetDefaultBrowserMigratorKey(nsACString& aKey,
|
||||
aKey = "opera";
|
||||
return NS_OK;
|
||||
}
|
||||
else if (internalName.LowerCaseEqualsLiteral(INTERNAL_NAME_CHROME)) {
|
||||
aKey = "chrome";
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#else
|
||||
bool exists = false;
|
||||
@ -262,6 +267,7 @@ nsProfileMigrator::GetDefaultBrowserMigratorKey(nsACString& aKey,
|
||||
CHECK_MIGRATOR("safari");
|
||||
#endif
|
||||
CHECK_MIGRATOR("opera");
|
||||
CHECK_MIGRATOR("chrome");
|
||||
|
||||
#undef CHECK_MIGRATOR
|
||||
#endif
|
||||
|
@ -447,7 +447,6 @@ PlacesController.prototype = {
|
||||
* "tagChild" node is a child of a tag
|
||||
* "folder" node is a folder
|
||||
* "query" node is a query
|
||||
* "dynamiccontainer" node is a dynamic container
|
||||
* "separator" node is a separator line
|
||||
* "host" node is a host
|
||||
*
|
||||
@ -490,9 +489,6 @@ PlacesController.prototype = {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Ci.nsINavHistoryResultNode.RESULT_TYPE_DYNAMIC_CONTAINER:
|
||||
nodeData["dynamiccontainer"] = true;
|
||||
break;
|
||||
case Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER:
|
||||
case Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER_SHORTCUT:
|
||||
nodeData["folder"] = true;
|
||||
|
@ -1,8 +1,8 @@
|
||||
ac_add_options --enable-debug
|
||||
ac_add_options --enable-trace-malloc
|
||||
|
||||
CC=/tools/gcc-4.5-0moz2/bin/gcc
|
||||
CXX=/tools/gcc-4.5-0moz2/bin/g++
|
||||
. $topsrcdir/build/unix/mozconfig.linux
|
||||
|
||||
# Avoid dependency on libstdc++ 4.5
|
||||
ac_add_options --enable-stdcxx-compat
|
||||
|
||||
|
@ -3,5 +3,5 @@ ac_add_options --enable-official-branding
|
||||
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
|
||||
ac_add_options --enable-update-packaging
|
||||
|
||||
CC=/tools/gcc-4.5-0moz2/bin/gcc
|
||||
CXX=/tools/gcc-4.5-0moz2/bin/g++
|
||||
. $topsrcdir/build/unix/mozconfig.linux
|
||||
|
||||
|
@ -5,8 +5,8 @@ ac_add_options --enable-codesighs
|
||||
# Nightlies only since this has a cost in performance
|
||||
ac_add_options --enable-js-diagnostics
|
||||
|
||||
CC=/tools/gcc-4.5-0moz2/bin/gcc
|
||||
CXX=/tools/gcc-4.5-0moz2/bin/g++
|
||||
. $topsrcdir/build/unix/mozconfig.linux
|
||||
|
||||
# Avoid dependency on libstdc++ 4.5
|
||||
ac_add_options --enable-stdcxx-compat
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
ac_add_options --enable-update-packaging
|
||||
ac_add_options --enable-codesighs
|
||||
|
||||
CC=/tools/gcc-4.5-0moz2/bin/gcc
|
||||
CXX=/tools/gcc-4.5-0moz2/bin/g++
|
||||
. $topsrcdir/build/unix/mozconfig.linux
|
||||
|
||||
# Avoid dependency on libstdc++ 4.5
|
||||
ac_add_options --enable-stdcxx-compat
|
||||
|
||||
|
@ -2,8 +2,8 @@ ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
|
||||
ac_add_options --enable-update-packaging
|
||||
ac_add_options --enable-official-branding
|
||||
|
||||
CC=/tools/gcc-4.5-0moz2/bin/gcc
|
||||
CXX=/tools/gcc-4.5-0moz2/bin/g++
|
||||
. $topsrcdir/build/unix/mozconfig.linux
|
||||
|
||||
# Avoid dependency on libstdc++ 4.5
|
||||
ac_add_options --enable-stdcxx-compat
|
||||
|
||||
|
@ -9,8 +9,8 @@ ac_add_options --disable-updater
|
||||
ac_add_options --prefix=$PREFIX
|
||||
ac_add_options --libdir=$LIBDIR
|
||||
|
||||
CC=/tools/gcc-4.5-0moz2/bin/gcc
|
||||
CXX=/tools/gcc-4.5-0moz2/bin/g++
|
||||
. $topsrcdir/build/unix/mozconfig.linux
|
||||
|
||||
# Avoid dependency on libstdc++ 4.5
|
||||
ac_add_options --enable-stdcxx-compat
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
ac_add_options --enable-debug
|
||||
ac_add_options --enable-trace-malloc
|
||||
|
||||
CC=/tools/gcc-4.5-0moz2/bin/gcc
|
||||
CXX=/tools/gcc-4.5-0moz2/bin/g++
|
||||
. $topsrcdir/build/unix/mozconfig.linux
|
||||
|
||||
# Avoid dependency on libstdc++ 4.5
|
||||
ac_add_options --enable-stdcxx-compat
|
||||
|
||||
|
@ -3,5 +3,5 @@ ac_add_options --enable-official-branding
|
||||
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
|
||||
ac_add_options --enable-update-packaging
|
||||
|
||||
CC=/tools/gcc-4.5-0moz2/bin/gcc
|
||||
CXX=/tools/gcc-4.5-0moz2/bin/g++
|
||||
. $topsrcdir/build/unix/mozconfig.linux
|
||||
|
||||
|
@ -5,8 +5,8 @@ ac_add_options --enable-codesighs
|
||||
# Nightlies only since this has a cost in performance
|
||||
ac_add_options --enable-js-diagnostics
|
||||
|
||||
CC=/tools/gcc-4.5-0moz2/bin/gcc
|
||||
CXX=/tools/gcc-4.5-0moz2/bin/g++
|
||||
. $topsrcdir/build/unix/mozconfig.linux
|
||||
|
||||
# Avoid dependency on libstdc++ 4.5
|
||||
ac_add_options --enable-stdcxx-compat
|
||||
|
||||
|
@ -2,8 +2,8 @@ ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
|
||||
ac_add_options --enable-update-packaging
|
||||
ac_add_options --enable-official-branding
|
||||
|
||||
CC=/tools/gcc-4.5-0moz2/bin/gcc
|
||||
CXX=/tools/gcc-4.5-0moz2/bin/g++
|
||||
. $topsrcdir/build/unix/mozconfig.linux
|
||||
|
||||
# Avoid dependency on libstdc++ 4.5
|
||||
ac_add_options --enable-stdcxx-compat
|
||||
|
||||
|
@ -9,8 +9,8 @@ ac_add_options --disable-updater
|
||||
ac_add_options --prefix=$PREFIX
|
||||
ac_add_options --libdir=$LIBDIR
|
||||
|
||||
CC=/tools/gcc-4.5-0moz2/bin/gcc
|
||||
CXX=/tools/gcc-4.5-0moz2/bin/g++
|
||||
. $topsrcdir/build/unix/mozconfig.linux
|
||||
|
||||
# Avoid dependency on libstdc++ 4.5
|
||||
ac_add_options --enable-stdcxx-compat
|
||||
|
||||
|
@ -66,6 +66,9 @@ const SCRATCHPAD_CONTEXT_CONTENT = 1;
|
||||
const SCRATCHPAD_CONTEXT_BROWSER = 2;
|
||||
const SCRATCHPAD_L10N = "chrome://browser/locale/devtools/scratchpad.properties";
|
||||
const DEVTOOLS_CHROME_ENABLED = "devtools.chrome.enabled";
|
||||
const BUTTON_POSITION_SAVE = 0;
|
||||
const BUTTON_POSITION_CANCEL = 1;
|
||||
const BUTTON_POSITION_DONT_SAVE = 2;
|
||||
|
||||
/**
|
||||
* The scratchpad object handles the Scratchpad window functionality.
|
||||
@ -601,22 +604,34 @@ var Scratchpad = {
|
||||
|
||||
/**
|
||||
* Save the textbox content to the currently open file.
|
||||
*
|
||||
* @param function aCallback
|
||||
* Optional function you want to call when file is saved
|
||||
*/
|
||||
saveFile: function SP_saveFile()
|
||||
saveFile: function SP_saveFile(aCallback)
|
||||
{
|
||||
if (!this.filename) {
|
||||
return this.saveFileAs();
|
||||
return this.saveFileAs(aCallback);
|
||||
}
|
||||
|
||||
let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
|
||||
file.initWithPath(this.filename);
|
||||
this.exportToFile(file, true, false, this.onTextSaved.bind(this));
|
||||
|
||||
this.exportToFile(file, true, false, function(aStatus) {
|
||||
this.onTextSaved();
|
||||
if (aCallback) {
|
||||
aCallback(aStatus);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Save the textbox content to a new file.
|
||||
*
|
||||
* @param function aCallback
|
||||
* Optional function you want to call when file is saved
|
||||
*/
|
||||
saveFileAs: function SP_saveFileAs()
|
||||
saveFileAs: function SP_saveFileAs(aCallback)
|
||||
{
|
||||
let fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
|
||||
fp.init(window, this.strings.GetStringFromName("saveFileAs"),
|
||||
@ -624,7 +639,13 @@ var Scratchpad = {
|
||||
fp.defaultString = "scratchpad.js";
|
||||
if (fp.show() != Ci.nsIFilePicker.returnCancel) {
|
||||
this.setFilename(fp.file.path);
|
||||
this.exportToFile(fp.file, true, false, this.onTextSaved.bind(this));
|
||||
|
||||
this.exportToFile(fp.file, true, false, function(aStatus) {
|
||||
this.onTextSaved();
|
||||
if (aCallback) {
|
||||
aCallback(aStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@ -845,6 +866,9 @@ var Scratchpad = {
|
||||
if (aStatus && !Components.isSuccessCode(aStatus)) {
|
||||
return;
|
||||
}
|
||||
if (!document) {
|
||||
return; // file saved to disk after window has closed
|
||||
}
|
||||
document.title = document.title.replace(/^\*/, "");
|
||||
this.saved = true;
|
||||
this.editor.addEventListener(SourceEditor.EVENTS.TEXT_CHANGED,
|
||||
@ -882,6 +906,66 @@ var Scratchpad = {
|
||||
this.editor = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Prompt to save scratchpad if it has unsaved changes.
|
||||
*
|
||||
* @param function aCallback
|
||||
* Optional function you want to call when file is saved
|
||||
* @return boolean
|
||||
* Whether the window should be closed
|
||||
*/
|
||||
promptSave: function SP_promptSave(aCallback)
|
||||
{
|
||||
if (this.filename && !this.saved) {
|
||||
let ps = Services.prompt;
|
||||
let flags = ps.BUTTON_POS_0 * ps.BUTTON_TITLE_SAVE +
|
||||
ps.BUTTON_POS_1 * ps.BUTTON_TITLE_CANCEL +
|
||||
ps.BUTTON_POS_2 * ps.BUTTON_TITLE_DONT_SAVE;
|
||||
|
||||
let button = ps.confirmEx(window,
|
||||
this.strings.GetStringFromName("confirmClose.title"),
|
||||
this.strings.GetStringFromName("confirmClose"),
|
||||
flags, null, null, null, null, {});
|
||||
|
||||
if (button == BUTTON_POSITION_CANCEL) {
|
||||
return false;
|
||||
}
|
||||
if (button == BUTTON_POSITION_SAVE) {
|
||||
this.saveFile(aCallback);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
* Handler for window close event. Prompts to save scratchpad if
|
||||
* there are unsaved changes.
|
||||
*
|
||||
* @param nsIDOMEvent aEvent
|
||||
*/
|
||||
onClose: function SP_onClose(aEvent)
|
||||
{
|
||||
let toClose = this.promptSave();
|
||||
if (!toClose) {
|
||||
aEvent.preventDefault();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Close the scratchpad window. Prompts before closing if the scratchpad
|
||||
* has unsaved changes.
|
||||
*
|
||||
* @param function aCallback
|
||||
* Optional function you want to call when file is saved
|
||||
*/
|
||||
close: function SP_close(aCallback)
|
||||
{
|
||||
let toClose = this.promptSave(aCallback);
|
||||
if (toClose) {
|
||||
window.close();
|
||||
}
|
||||
},
|
||||
|
||||
_observers: [],
|
||||
|
||||
/**
|
||||
@ -951,3 +1035,4 @@ XPCOMUtils.defineLazyGetter(Scratchpad, "strings", function () {
|
||||
|
||||
addEventListener("DOMContentLoaded", Scratchpad.onLoad.bind(Scratchpad), false);
|
||||
addEventListener("unload", Scratchpad.onUnload.bind(Scratchpad), false);
|
||||
addEventListener("close", Scratchpad.onClose.bind(Scratchpad), false);
|
||||
|
@ -69,7 +69,7 @@
|
||||
<command id="sp-cmd-printFile" oncommand="Scratchpad.printFile();" disabled="true"/>
|
||||
-->
|
||||
|
||||
<command id="sp-cmd-close" oncommand="window.close();"/>
|
||||
<command id="sp-cmd-close" oncommand="Scratchpad.close();"/>
|
||||
<command id="sp-cmd-run" oncommand="Scratchpad.run();"/>
|
||||
<command id="sp-cmd-inspect" oncommand="Scratchpad.inspect();"/>
|
||||
<command id="sp-cmd-display" oncommand="Scratchpad.display();"/>
|
||||
|
@ -59,6 +59,7 @@ _BROWSER_TEST_FILES = \
|
||||
browser_scratchpad_bug_699130_edit_ui_updates.js \
|
||||
browser_scratchpad_bug_669612_unsaved.js \
|
||||
head.js \
|
||||
browser_scratchpad_bug_653427_confirm_close.js \
|
||||
|
||||
libs:: $(_BROWSER_TEST_FILES)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
|
||||
|
@ -0,0 +1,188 @@
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
|
||||
// only finish() when correct number of tests are done
|
||||
const expected = 5;
|
||||
var count = 0;
|
||||
function done()
|
||||
{
|
||||
if (++count == expected) {
|
||||
cleanup();
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
var ScratchpadManager = Scratchpad.ScratchpadManager;
|
||||
var gFile;
|
||||
|
||||
var oldPrompt = Services.prompt;
|
||||
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
|
||||
gFile = createTempFile("fileForBug653427.tmp");
|
||||
writeFile(gFile, "text", testUnsaved.call(this));
|
||||
|
||||
testNew();
|
||||
testSavedFile();
|
||||
|
||||
content.location = "data:text/html,<p>test scratchpad save file prompt on closing";
|
||||
}
|
||||
|
||||
function testNew()
|
||||
{
|
||||
let win = ScratchpadManager.openScratchpad();
|
||||
|
||||
win.addEventListener("load", function() {
|
||||
win.Scratchpad.close();
|
||||
|
||||
ok(win.closed, "new scratchpad window should close without prompting")
|
||||
done();
|
||||
});
|
||||
}
|
||||
|
||||
function testSavedFile()
|
||||
{
|
||||
let win = ScratchpadManager.openScratchpad();
|
||||
|
||||
win.addEventListener("load", function() {
|
||||
win.Scratchpad.filename = "test.js";
|
||||
win.Scratchpad.saved = true;
|
||||
win.Scratchpad.close();
|
||||
|
||||
ok(win.closed, "scratchpad from file with no changes should close")
|
||||
done();
|
||||
});
|
||||
}
|
||||
|
||||
function testUnsaved()
|
||||
{
|
||||
testUnsavedFileCancel();
|
||||
testUnsavedFileSave();
|
||||
testUnsavedFileDontSave();
|
||||
}
|
||||
|
||||
function testUnsavedFileCancel()
|
||||
{
|
||||
let win = ScratchpadManager.openScratchpad();
|
||||
|
||||
win.addEventListener("load", function() {
|
||||
win.Scratchpad.filename = "test.js";
|
||||
win.Scratchpad.saved = false;
|
||||
|
||||
Services.prompt = {
|
||||
confirmEx: function() {
|
||||
return win.BUTTON_POSITION_CANCEL;
|
||||
}
|
||||
}
|
||||
|
||||
win.Scratchpad.close();
|
||||
|
||||
ok(!win.closed, "cancelling dialog shouldn't close scratchpad");
|
||||
|
||||
win.close();
|
||||
done();
|
||||
});
|
||||
}
|
||||
|
||||
function testUnsavedFileSave()
|
||||
{
|
||||
let win = ScratchpadManager.openScratchpad();
|
||||
|
||||
win.addEventListener("load", function() {
|
||||
win.Scratchpad.importFromFile(gFile, true, function(status, content) {
|
||||
win.Scratchpad.filename = gFile.path;
|
||||
win.Scratchpad.onTextSaved();
|
||||
|
||||
let text = "new text";
|
||||
win.Scratchpad.setText(text);
|
||||
|
||||
Services.prompt = {
|
||||
confirmEx: function() {
|
||||
return win.BUTTON_POSITION_SAVE;
|
||||
}
|
||||
}
|
||||
|
||||
win.Scratchpad.close(function() {
|
||||
readFile(gFile, function(savedContent) {
|
||||
is(savedContent, text, 'prompted "Save" worked when closing scratchpad');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
ok(win.closed, 'pressing "Save" in dialog should close scratchpad');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function testUnsavedFileDontSave()
|
||||
{
|
||||
let win = ScratchpadManager.openScratchpad();
|
||||
|
||||
win.addEventListener("load", function() {
|
||||
win.Scratchpad.filename = gFile.path;
|
||||
win.Scratchpad.saved = false;
|
||||
|
||||
Services.prompt = {
|
||||
confirmEx: function() {
|
||||
return win.BUTTON_POSITION_DONT_SAVE;
|
||||
}
|
||||
}
|
||||
|
||||
win.Scratchpad.close();
|
||||
|
||||
ok(win.closed, 'pressing "Don\'t Save" in dialog should close scratchpad');
|
||||
done();
|
||||
});
|
||||
}
|
||||
|
||||
function cleanup()
|
||||
{
|
||||
Services.prompt = oldPrompt;
|
||||
gFile.remove(false);
|
||||
gFile = null;
|
||||
}
|
||||
|
||||
function createTempFile(name)
|
||||
{
|
||||
let file = FileUtils.getFile("TmpD", [name]);
|
||||
file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666);
|
||||
file.QueryInterface(Ci.nsILocalFile)
|
||||
return file;
|
||||
}
|
||||
|
||||
function writeFile(file, content, callback)
|
||||
{
|
||||
let fout = Cc["@mozilla.org/network/file-output-stream;1"].
|
||||
createInstance(Ci.nsIFileOutputStream);
|
||||
fout.init(file.QueryInterface(Ci.nsILocalFile), 0x02 | 0x08 | 0x20,
|
||||
0644, fout.DEFER_OPEN);
|
||||
|
||||
let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].
|
||||
createInstance(Ci.nsIScriptableUnicodeConverter);
|
||||
converter.charset = "UTF-8";
|
||||
let fileContentStream = converter.convertToInputStream(content);
|
||||
|
||||
NetUtil.asyncCopy(fileContentStream, fout, callback);
|
||||
}
|
||||
|
||||
function readFile(file, callback)
|
||||
{
|
||||
let channel = NetUtil.newChannel(file);
|
||||
channel.contentType = "application/javascript";
|
||||
|
||||
NetUtil.asyncFetch(channel, function(inputStream, status) {
|
||||
ok(Components.isSuccessCode(status),
|
||||
"file was read successfully");
|
||||
|
||||
let content = NetUtil.readInputStreamToString(inputStream,
|
||||
inputStream.available());
|
||||
callback(content);
|
||||
});
|
||||
}
|
@ -1638,6 +1638,7 @@ HUD_SERVICE.prototype =
|
||||
{
|
||||
this.filterPrefs[aHUDId][aToggleType] = aState;
|
||||
this.adjustVisibilityForMessageType(aHUDId, aToggleType, aState);
|
||||
Services.prefs.setBoolPref(PREFS_PREFIX + aToggleType, aState);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -6289,18 +6290,17 @@ HeadsUpDisplayUICommands = {
|
||||
// Adjust the state of the button appropriately.
|
||||
let menuPopup = this.parentNode;
|
||||
|
||||
let allChecked = true;
|
||||
let someChecked = false;
|
||||
let menuItem = menuPopup.firstChild;
|
||||
while (menuItem) {
|
||||
if (menuItem.getAttribute("checked") !== "true") {
|
||||
allChecked = false;
|
||||
if (menuItem.getAttribute("checked") === "true") {
|
||||
someChecked = true;
|
||||
break;
|
||||
}
|
||||
menuItem = menuItem.nextSibling;
|
||||
}
|
||||
|
||||
let toolbarButton = menuPopup.parentNode;
|
||||
toolbarButton.setAttribute("checked", allChecked);
|
||||
toolbarButton.setAttribute("checked", someChecked);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -6338,8 +6338,7 @@ HeadsUpDisplayUICommands = {
|
||||
var prefs = Services.prefs;
|
||||
|
||||
const GLOBAL_STORAGE_INDEX_ID = "GLOBAL_CONSOLE";
|
||||
const PREFS_BRANCH_PREF = "devtools.hud.display.filter";
|
||||
const PREFS_PREFIX = "devtools.hud.display.filter.";
|
||||
const PREFS_PREFIX = "devtools.webconsole.filter.";
|
||||
const PREFS = { network: PREFS_PREFIX + "network",
|
||||
networkinfo: PREFS_PREFIX + "networkinfo",
|
||||
csserror: PREFS_PREFIX + "csserror",
|
||||
@ -6350,7 +6349,6 @@ const PREFS = { network: PREFS_PREFIX + "network",
|
||||
info: PREFS_PREFIX + "info",
|
||||
warn: PREFS_PREFIX + "warn",
|
||||
log: PREFS_PREFIX + "log",
|
||||
global: PREFS_PREFIX + "global",
|
||||
};
|
||||
|
||||
function ConsoleStorage()
|
||||
@ -6365,55 +6363,7 @@ function ConsoleStorage()
|
||||
// TODO: need to create a method that truncates the message
|
||||
// see bug 570543
|
||||
|
||||
// store an index of display prefs
|
||||
this.displayPrefs = {};
|
||||
|
||||
// check prefs for existence, create & load if absent, load them if present
|
||||
let filterPrefs;
|
||||
let defaultDisplayPrefs;
|
||||
|
||||
try {
|
||||
filterPrefs = prefs.getBoolPref(PREFS_BRANCH_PREF);
|
||||
}
|
||||
catch (ex) {
|
||||
filterPrefs = false;
|
||||
}
|
||||
|
||||
// TODO: for FINAL release,
|
||||
// use the sitePreferencesService to save specific site prefs
|
||||
// see bug 570545
|
||||
|
||||
if (filterPrefs) {
|
||||
defaultDisplayPrefs = {
|
||||
network: (prefs.getBoolPref(PREFS.network) ? true: false),
|
||||
networkinfo: (prefs.getBoolPref(PREFS.networkinfo) ? true: false),
|
||||
csserror: (prefs.getBoolPref(PREFS.csserror) ? true: false),
|
||||
cssparser: (prefs.getBoolPref(PREFS.cssparser) ? true: false),
|
||||
exception: (prefs.getBoolPref(PREFS.exception) ? true: false),
|
||||
jswarn: (prefs.getBoolPref(PREFS.jswarn) ? true: false),
|
||||
error: (prefs.getBoolPref(PREFS.error) ? true: false),
|
||||
info: (prefs.getBoolPref(PREFS.info) ? true: false),
|
||||
warn: (prefs.getBoolPref(PREFS.warn) ? true: false),
|
||||
log: (prefs.getBoolPref(PREFS.log) ? true: false),
|
||||
global: (prefs.getBoolPref(PREFS.global) ? true: false),
|
||||
};
|
||||
}
|
||||
else {
|
||||
prefs.setBoolPref(PREFS_BRANCH_PREF, false);
|
||||
// default prefs for each HeadsUpDisplay
|
||||
prefs.setBoolPref(PREFS.network, true);
|
||||
prefs.setBoolPref(PREFS.networkinfo, true);
|
||||
prefs.setBoolPref(PREFS.csserror, true);
|
||||
prefs.setBoolPref(PREFS.cssparser, true);
|
||||
prefs.setBoolPref(PREFS.exception, true);
|
||||
prefs.setBoolPref(PREFS.jswarn, true);
|
||||
prefs.setBoolPref(PREFS.error, true);
|
||||
prefs.setBoolPref(PREFS.info, true);
|
||||
prefs.setBoolPref(PREFS.warn, true);
|
||||
prefs.setBoolPref(PREFS.log, true);
|
||||
prefs.setBoolPref(PREFS.global, false);
|
||||
|
||||
defaultDisplayPrefs = {
|
||||
this.defaultDisplayPrefs = {
|
||||
network: prefs.getBoolPref(PREFS.network),
|
||||
networkinfo: prefs.getBoolPref(PREFS.networkinfo),
|
||||
csserror: prefs.getBoolPref(PREFS.csserror),
|
||||
@ -6424,30 +6374,11 @@ function ConsoleStorage()
|
||||
info: prefs.getBoolPref(PREFS.info),
|
||||
warn: prefs.getBoolPref(PREFS.warn),
|
||||
log: prefs.getBoolPref(PREFS.log),
|
||||
global: prefs.getBoolPref(PREFS.global),
|
||||
};
|
||||
}
|
||||
this.defaultDisplayPrefs = defaultDisplayPrefs;
|
||||
}
|
||||
|
||||
ConsoleStorage.prototype = {
|
||||
|
||||
updateDefaultDisplayPrefs:
|
||||
function CS_updateDefaultDisplayPrefs(aPrefsObject) {
|
||||
prefs.setBoolPref(PREFS.network, (aPrefsObject.network ? true : false));
|
||||
prefs.setBoolPref(PREFS.networkinfo,
|
||||
(aPrefsObject.networkinfo ? true : false));
|
||||
prefs.setBoolPref(PREFS.csserror, (aPrefsObject.csserror ? true : false));
|
||||
prefs.setBoolPref(PREFS.cssparser, (aPrefsObject.cssparser ? true : false));
|
||||
prefs.setBoolPref(PREFS.exception, (aPrefsObject.exception ? true : false));
|
||||
prefs.setBoolPref(PREFS.jswarn, (aPrefsObject.jswarn ? true : false));
|
||||
prefs.setBoolPref(PREFS.error, (aPrefsObject.error ? true : false));
|
||||
prefs.setBoolPref(PREFS.info, (aPrefsObject.info ? true : false));
|
||||
prefs.setBoolPref(PREFS.warn, (aPrefsObject.warn ? true : false));
|
||||
prefs.setBoolPref(PREFS.log, (aPrefsObject.log ? true : false));
|
||||
prefs.setBoolPref(PREFS.global, (aPrefsObject.global ? true : false));
|
||||
},
|
||||
|
||||
sequenceId: function CS_sequencerId()
|
||||
{
|
||||
if (!this.sequencer) {
|
||||
|
@ -150,6 +150,7 @@ _BROWSER_TEST_FILES = \
|
||||
browser_gcli_require.js \
|
||||
browser_gcli_web.js \
|
||||
browser_webconsole_bug_658368_time_methods.js \
|
||||
browser_webconsole_bug_622303_persistent_filters.js \
|
||||
head.js \
|
||||
$(NULL)
|
||||
|
||||
|
@ -27,15 +27,14 @@ function onContentLoaded()
|
||||
|
||||
executeSoon(
|
||||
function (){
|
||||
HUDService.setFilterState(hudId, "cssparser", false);
|
||||
|
||||
let msg = "the unknown CSS property warning is not displayed, " +
|
||||
"after filtering";
|
||||
testLogEntry(outputNode, "foobarCssParser", msg, true, true);
|
||||
|
||||
HUDService.setFilterState(hudId, "cssparser", true);
|
||||
finishTest();
|
||||
}
|
||||
);
|
||||
|
||||
finishTest();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -54,6 +54,9 @@ function tabReload(aEvent) {
|
||||
ok(scrollBox.scrollTop >= scrollBox.scrollHeight - scrollBox.clientHeight -
|
||||
nodeHeight * 2, "scroll location is correct");
|
||||
|
||||
HUDService.setFilterState(hud.hudId, "network", true);
|
||||
HUDService.setFilterState(hud.hudId, "networkinfo", true);
|
||||
|
||||
executeSoon(finishTest);
|
||||
}
|
||||
|
||||
|
@ -59,17 +59,17 @@ function testMenuFilterButton(aCategory) {
|
||||
ok(isChecked(button), "the button for category " + aCategory + " is " +
|
||||
"checked after turning on all its menu items");
|
||||
|
||||
// Turn one filter off; make sure the button is no longer checked.
|
||||
// Turn one filter off; make sure the button is still checked.
|
||||
prefKey = firstMenuItem.getAttribute("prefKey");
|
||||
chooseMenuItem(firstMenuItem);
|
||||
ok(!isChecked(firstMenuItem), "the first menu item for category " +
|
||||
aCategory + " is no longer checked after clicking it");
|
||||
ok(!HUDService.filterPrefs[hudId][prefKey], prefKey + " messages are " +
|
||||
"turned off after clicking the appropriate menu item");
|
||||
ok(!isChecked(button), "the button for category " + aCategory + " is no " +
|
||||
"longer checked after turning off its first menu item");
|
||||
ok(isChecked(button), "the button for category " + aCategory + " is still " +
|
||||
"checked after turning off its first menu item");
|
||||
|
||||
// Turn all the filters on by clicking the main part of the button.
|
||||
// Turn all the filters off by clicking the main part of the button.
|
||||
let anonymousNodes = document.getAnonymousNodes(button);
|
||||
let subbutton;
|
||||
for (let i = 0; i < anonymousNodes.length; i++) {
|
||||
@ -82,6 +82,22 @@ function testMenuFilterButton(aCategory) {
|
||||
ok(subbutton, "we have the subbutton for category " + aCategory);
|
||||
|
||||
clickButton(subbutton);
|
||||
ok(!isChecked(button), "the button for category " + aCategory + " is " +
|
||||
"no longer checked after clicking its main part");
|
||||
|
||||
menuItem = firstMenuItem;
|
||||
while (menuItem) {
|
||||
let prefKey = menuItem.getAttribute("prefKey");
|
||||
ok(!isChecked(menuItem), "menu item " + prefKey + " for category " +
|
||||
aCategory + " is no longer checked after clicking the button");
|
||||
ok(!HUDService.filterPrefs[hudId][prefKey], prefKey + " messages are " +
|
||||
"off after clicking the button");
|
||||
menuItem = menuItem.nextSibling;
|
||||
}
|
||||
|
||||
// Turn all the filters on by clicking the main part of the button.
|
||||
clickButton(subbutton);
|
||||
|
||||
ok(isChecked(button), "the button for category " + aCategory + " is " +
|
||||
"checked after clicking its main part");
|
||||
|
||||
@ -95,21 +111,16 @@ function testMenuFilterButton(aCategory) {
|
||||
menuItem = menuItem.nextSibling;
|
||||
}
|
||||
|
||||
// Turn all the filters off by clicking the main part of the button.
|
||||
clickButton(subbutton);
|
||||
ok(!isChecked(subbutton), "the button for category " + aCategory + " is " +
|
||||
"no longer checked after clicking it");
|
||||
|
||||
// Uncheck the main button by unchecking all the filters
|
||||
menuItem = firstMenuItem;
|
||||
while (menuItem) {
|
||||
let prefKey = menuItem.getAttribute("prefKey");
|
||||
ok(!isChecked(menuItem), "menu item " + prefKey + " for category " +
|
||||
aCategory + " is no longer checked after clicking the button");
|
||||
ok(!HUDService.filterPrefs[hudId][prefKey], prefKey + " messages are " +
|
||||
"off after clicking the button");
|
||||
chooseMenuItem(menuItem);
|
||||
menuItem = menuItem.nextSibling;
|
||||
}
|
||||
|
||||
ok(!isChecked(button), "the button for category " + aCategory + " is " +
|
||||
"unchecked after unchecking all its filters");
|
||||
|
||||
// Turn all the filters on again by clicking the button.
|
||||
clickButton(subbutton);
|
||||
}
|
||||
|
@ -0,0 +1,59 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function test() {
|
||||
let prefService = Services.prefs;
|
||||
let prefs = [
|
||||
"network",
|
||||
"networkinfo",
|
||||
"csserror",
|
||||
"cssparser",
|
||||
"exception",
|
||||
"jswarn",
|
||||
"error",
|
||||
"warn",
|
||||
"info",
|
||||
"log"
|
||||
];
|
||||
|
||||
//Set all prefs to true
|
||||
prefs.forEach(function(pref) {
|
||||
prefService.setBoolPref("devtools.webconsole.filter." + pref, true);
|
||||
});
|
||||
|
||||
addTab("about:blank");
|
||||
openConsole();
|
||||
|
||||
let hud = HUDService.getHudByWindow(content);
|
||||
let hudId = HUDService.getHudIdByWindow(content);
|
||||
|
||||
//Check if the filters menuitems exists and is checked
|
||||
prefs.forEach(function(pref) {
|
||||
let checked = hud.HUDBox.querySelector("menuitem[prefKey=" + pref + "]").
|
||||
getAttribute("checked");
|
||||
is(checked, "true", "menuitem for " + pref + " exists and is checked");
|
||||
});
|
||||
|
||||
//Set all prefs to false
|
||||
prefs.forEach(function(pref) {
|
||||
HUDService.setFilterState(hudId, pref, false);
|
||||
});
|
||||
|
||||
//Re-init the console
|
||||
closeConsole();
|
||||
openConsole();
|
||||
|
||||
hud = HUDService.getHudByWindow(content);
|
||||
|
||||
//Check if filters menuitems exists and are unchecked
|
||||
prefs.forEach(function(pref) {
|
||||
let checked = hud.HUDBox.querySelector("menuitem[prefKey=" + pref + "]").
|
||||
getAttribute("checked");
|
||||
is(checked, "false", "menuitem for " + pref + " exists and is not checked");
|
||||
prefService.clearUserPref("devtools.webconsole.filter." + pref);
|
||||
});
|
||||
|
||||
gBrowser.removeCurrentTab();
|
||||
|
||||
finish();
|
||||
}
|
@ -148,6 +148,7 @@
|
||||
@BINPATH@/components/dom_json.xpt
|
||||
@BINPATH@/components/dom_range.xpt
|
||||
@BINPATH@/components/dom_sidebar.xpt
|
||||
@BINPATH@/components/dom_sms.xpt
|
||||
@BINPATH@/components/dom_storage.xpt
|
||||
@BINPATH@/components/dom_stylesheets.xpt
|
||||
@BINPATH@/components/dom_threads.xpt
|
||||
@ -356,6 +357,8 @@
|
||||
@BINPATH@/components/contentSecurityPolicy.js
|
||||
@BINPATH@/components/contentAreaDropListener.manifest
|
||||
@BINPATH@/components/contentAreaDropListener.js
|
||||
@BINPATH@/components/BrowserProfileMigrators.manifest
|
||||
@BINPATH@/components/ChromeProfileMigrator.js
|
||||
#ifdef XP_MACOSX
|
||||
@BINPATH@/components/libalerts_s.dylib
|
||||
#endif
|
||||
|
@ -314,6 +314,7 @@ searchplugins/atlas-sk.src
|
||||
searchplugins/baidu.gif
|
||||
searchplugins/baidu.png
|
||||
searchplugins/baidu.src
|
||||
searchplugins/bluu.xml
|
||||
searchplugins/bok-NO.gif
|
||||
searchplugins/bok-NO.png
|
||||
searchplugins/bok-NO.src
|
||||
|
@ -429,14 +429,23 @@ can reach it easily. -->
|
||||
<!ENTITY thisFrameMenu.accesskey "h">
|
||||
|
||||
<!-- Media (video/audio) controls -->
|
||||
<!-- LOCALIZATION NOTE: The access keys for "Play" and
|
||||
"Pause" are the same because the two context-menu
|
||||
items are mutually exclusive. -->
|
||||
<!ENTITY mediaPlay.label "Play">
|
||||
<!ENTITY mediaPlay.accesskey "P">
|
||||
<!ENTITY mediaPause.label "Pause">
|
||||
<!ENTITY mediaPause.accesskey "P">
|
||||
<!-- LOCALIZATION NOTE: The access keys for "Mute" and
|
||||
"Unmute" are the same because the two context-menu
|
||||
items are mutually exclusive. -->
|
||||
<!ENTITY mediaMute.label "Mute">
|
||||
<!ENTITY mediaMute.accesskey "M">
|
||||
<!ENTITY mediaUnmute.label "Unmute">
|
||||
<!ENTITY mediaUnmute.accesskey "m">
|
||||
<!-- LOCALIZATION NOTE: The access keys for "Show Controls" and
|
||||
"Hide Controls" are the same because the two context-menu
|
||||
items are mutually exclusive. -->
|
||||
<!ENTITY mediaShowControls.label "Show Controls">
|
||||
<!ENTITY mediaShowControls.accesskey "C">
|
||||
<!ENTITY mediaHideControls.label "Hide Controls">
|
||||
@ -445,6 +454,9 @@ can reach it easily. -->
|
||||
<!ENTITY videoFullScreen.accesskey "F">
|
||||
<!ENTITY videoSaveImage.label "Save Snapshot As…">
|
||||
<!ENTITY videoSaveImage.accesskey "S">
|
||||
<!-- LOCALIZATION NOTE: The access keys for "Show Statistics" and
|
||||
"Hide Statistics" are the same because the two context-menu
|
||||
items are mutually exclusive. -->
|
||||
<!ENTITY videoShowStats.label "Show Statistics">
|
||||
<!ENTITY videoShowStats.accesskey "t">
|
||||
<!ENTITY videoHideStats.label "Hide Statistics">
|
||||
|
@ -38,6 +38,14 @@ saveFileAs=Save File As
|
||||
# save fails.
|
||||
saveFile.failed=The file save operation failed.
|
||||
|
||||
# LOCALIZATION NOTE (confirmClose): This is message in the prompt dialog when
|
||||
# you try to close a scratchpad with unsaved changes.
|
||||
confirmClose=Do you want to save the changes you made to this scratchpad?
|
||||
|
||||
# LOCALIZATION NOTE (confirmClose.title): This is title of the prompt dialog when
|
||||
# you try to close a scratchpad with unsaved changes.
|
||||
confirmClose.title=Unsaved Changes
|
||||
|
||||
# LOCALIZATION NOTE (scratchpadIntro): This is a multi-line comment explaining
|
||||
# how to use the Scratchpad. Note that this should be a valid JavaScript
|
||||
# comment inside /* and */.
|
||||
|
@ -15,6 +15,8 @@
|
||||
<!ENTITY importFromOpera.accesskey "O">
|
||||
<!ENTITY importFromSafari.label "Safari">
|
||||
<!ENTITY importFromSafari.accesskey "S">
|
||||
<!ENTITY importFromChrome.label "Chrome">
|
||||
<!ENTITY importFromChrome.accesskey "C">
|
||||
<!ENTITY importFromHTMLFile.label "From an HTML File">
|
||||
<!ENTITY importFromHTMLFile.accesskey "F">
|
||||
|
||||
|
@ -5,6 +5,7 @@ sourceNameIE=Internet Explorer
|
||||
sourceNameSeamonkey=Netscape 6/7/Mozilla
|
||||
sourceNameOpera=Opera
|
||||
sourceNameSafari=Safari
|
||||
sourceNameChrome=Google Chrome
|
||||
|
||||
importedBookmarksFolder=From %S
|
||||
importedSearchURLsFolder=Keyword Searches (From %S)
|
||||
@ -21,34 +22,41 @@ importedOperaSearchUrls=Keyword Searches (From Opera)
|
||||
1_opera=Preferences
|
||||
1_seamonkey=Preferences
|
||||
1_safari=Preferences
|
||||
1_chrome=Preferences
|
||||
|
||||
2_ie=Cookies
|
||||
2_opera=Cookies
|
||||
2_seamonkey=Cookies
|
||||
2_safari=Cookies
|
||||
2_chrome=Cookies
|
||||
|
||||
4_ie=Browsing History
|
||||
4_opera=Browsing History
|
||||
4_seamonkey=Browsing History
|
||||
4_safari=Browsing History
|
||||
4_chrome=Browsing History
|
||||
|
||||
8_ie=Saved Form History
|
||||
8_opera=Saved Form History
|
||||
8_seamonkey=Saved Form History
|
||||
8_safari=Saved Form History
|
||||
8_chrome=Saved Form History
|
||||
|
||||
16_ie=Saved Passwords
|
||||
16_opera=Saved Passwords
|
||||
16_seamonkey=Saved Passwords
|
||||
16_safari=Saved Passwords
|
||||
16_chrome=Saved Passwords
|
||||
|
||||
32_ie=Favorites
|
||||
32_opera=Bookmarks
|
||||
32_seamonkey=Bookmarks
|
||||
32_safari=Bookmarks
|
||||
32_chrome=Bookmarks
|
||||
|
||||
64_ie=Other Data
|
||||
64_opera=Other Data
|
||||
64_seamonkey=Other Data
|
||||
64_safari=Other Data
|
||||
64_chrome=Other Data
|
||||
|
||||
|
@ -222,7 +222,7 @@ menuitem.bookmark-item {
|
||||
}
|
||||
|
||||
.bookmark-item[query][tagContainer] {
|
||||
list-style-image: url("chrome://mozapps/skin/places/tagContainerIcon.png");
|
||||
list-style-image: url("chrome://browser/skin/places/tag.png");
|
||||
}
|
||||
|
||||
.bookmark-item[query][dayContainer] {
|
||||
|
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 799 B |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 799 B |
@ -39,10 +39,10 @@ browser.jar:
|
||||
skin/classic/browser/urlbar-arrow.png
|
||||
skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png)
|
||||
skin/classic/browser/feeds/feedIcon16.png (feeds/feedIcon16.png)
|
||||
skin/classic/browser/feeds/videoFeedIcon.png (feeds/videoFeedIcon.png)
|
||||
skin/classic/browser/feeds/videoFeedIcon16.png (feeds/videoFeedIcon16.png)
|
||||
skin/classic/browser/feeds/audioFeedIcon.png (feeds/audioFeedIcon.png)
|
||||
skin/classic/browser/feeds/audioFeedIcon16.png (feeds/audioFeedIcon16.png)
|
||||
skin/classic/browser/feeds/videoFeedIcon.png (feeds/feedIcon.png)
|
||||
skin/classic/browser/feeds/videoFeedIcon16.png (feeds/feedIcon16.png)
|
||||
skin/classic/browser/feeds/audioFeedIcon.png (feeds/feedIcon.png)
|
||||
skin/classic/browser/feeds/audioFeedIcon16.png (feeds/feedIcon16.png)
|
||||
skin/classic/browser/feeds/subscribe.css (feeds/subscribe.css)
|
||||
skin/classic/browser/feeds/subscribe-ui.css (feeds/subscribe-ui.css)
|
||||
skin/classic/browser/places/bookmarksMenu.png (places/bookmarksMenu.png)
|
||||
|
@ -77,7 +77,7 @@ treechildren::-moz-tree-image(query, OrganizerQuery_Downloads) {
|
||||
|
||||
treechildren::-moz-tree-image(title, query, tagContainer),
|
||||
treechildren::-moz-tree-image(query, OrganizerQuery_Tags) {
|
||||
list-style-image: url("chrome://mozapps/skin/places/tagContainerIcon.png");
|
||||
list-style-image: url("chrome://browser/skin/places/tag.png");
|
||||
}
|
||||
|
||||
/* calendar icon for folders grouping items by date */
|
||||
|
@ -88,6 +88,17 @@
|
||||
padding: 2px 4px;
|
||||
}
|
||||
|
||||
/* Because of -moz-box-align: center above, separators will be invisible unless
|
||||
we set their min-height. See bug 583510 for more information. */
|
||||
toolbarseparator {
|
||||
min-height: 22px;
|
||||
}
|
||||
|
||||
/* We need more height when toolbar buttons show both icon and text. */
|
||||
toolbar[mode="full"] toolbarseparator {
|
||||
min-height: 36px;
|
||||
}
|
||||
|
||||
#nav-bar {
|
||||
padding-bottom: 4px !important;
|
||||
}
|
||||
@ -231,7 +242,7 @@ toolbarbutton.bookmark-item > menupopup {
|
||||
}
|
||||
|
||||
.bookmark-item[query][tagContainer] {
|
||||
list-style-image: url("chrome://mozapps/skin/places/tagContainerIcon.png");
|
||||
list-style-image: url("chrome://browser/skin/places/tag.png");
|
||||
}
|
||||
|
||||
.bookmark-item[query][dayContainer] {
|
||||
@ -1902,6 +1913,7 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
|
||||
}
|
||||
|
||||
.tabbrowser-tab[selected="true"] {
|
||||
color: #000;
|
||||
z-index: 1;
|
||||
position: relative;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 852 B |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 852 B |
@ -51,10 +51,10 @@ browser.jar:
|
||||
skin/classic/browser/feeds/subscribe-ui.css (feeds/subscribe-ui.css)
|
||||
skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png)
|
||||
skin/classic/browser/feeds/feedIcon16.png (feeds/feedIcon16.png)
|
||||
skin/classic/browser/feeds/videoFeedIcon.png (feeds/videoFeedIcon.png)
|
||||
skin/classic/browser/feeds/videoFeedIcon16.png (feeds/videoFeedIcon16.png)
|
||||
skin/classic/browser/feeds/audioFeedIcon.png (feeds/audioFeedIcon.png)
|
||||
skin/classic/browser/feeds/audioFeedIcon16.png (feeds/audioFeedIcon16.png)
|
||||
skin/classic/browser/feeds/videoFeedIcon.png (feeds/feedIcon.png)
|
||||
skin/classic/browser/feeds/videoFeedIcon16.png (feeds/feedIcon16.png)
|
||||
skin/classic/browser/feeds/audioFeedIcon.png (feeds/feedIcon.png)
|
||||
skin/classic/browser/feeds/audioFeedIcon16.png (feeds/feedIcon16.png)
|
||||
skin/classic/browser/setDesktopBackground.css
|
||||
skin/classic/browser/inspector.css
|
||||
skin/classic/browser/monitor.png
|
||||
|
@ -2,12 +2,6 @@
|
||||
|
||||
/* Sidebars */
|
||||
|
||||
.sidebar-placesTree {
|
||||
background-color: transparent !important;
|
||||
-moz-appearance: none !important;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
#bookmarksPanel,
|
||||
#history-panel,
|
||||
#sidebar-search-container {
|
||||
@ -150,7 +144,7 @@ treechildren::-moz-tree-image(query, OrganizerQuery_Downloads) {
|
||||
|
||||
treechildren::-moz-tree-image(title, query, tagContainer),
|
||||
treechildren::-moz-tree-image(query, OrganizerQuery_Tags) {
|
||||
list-style-image: url("chrome://mozapps/skin/places/tagContainerIcon.png");
|
||||
list-style-image: url("chrome://browser/skin/places/tag.png");
|
||||
}
|
||||
|
||||
/* calendar icon for folders grouping items by date */
|
||||
|
Before Width: | Height: | Size: 441 B |
@ -621,7 +621,7 @@ menuitem.bookmark-item {
|
||||
}
|
||||
|
||||
.bookmark-item[query][tagContainer] {
|
||||
list-style-image: url("chrome://mozapps/skin/places/tagContainerIcon.png");
|
||||
list-style-image: url("chrome://browser/skin/places/tag.png");
|
||||
-moz-image-region: auto;
|
||||
}
|
||||
|
||||
@ -2633,13 +2633,15 @@ panel[dimmed="true"] {
|
||||
-moz-image-region: rect(0, 16px, 16px, 0);
|
||||
min-width: 16px;
|
||||
width: 16px;
|
||||
-moz-appearance: none;
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
#highlighter-closebutton:hover {
|
||||
-moz-image-region: rect(0, 32px, 16px, 16px);
|
||||
}
|
||||
|
||||
#highlighter-closebutton:active {
|
||||
#highlighter-closebutton:hover:active {
|
||||
-moz-image-region: rect(0, 48px, 16px, 32px);
|
||||
}
|
||||
|
||||
@ -2855,7 +2857,6 @@ panel[dimmed="true"] {
|
||||
/* The content of the button can be larger than the button */
|
||||
overflow: hidden;
|
||||
min-height: 25px;
|
||||
|
||||
margin: 0 -11px 0 0;
|
||||
padding: 0 9px;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 787 B |
Before Width: | Height: | Size: 791 B |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 787 B |
Before Width: | Height: | Size: 791 B |
@ -6,7 +6,7 @@ browser.jar:
|
||||
skin/classic/browser/sanitizeDialog.css (sanitizeDialog.css)
|
||||
* skin/classic/browser/aboutPrivateBrowsing.css (aboutPrivateBrowsing.css)
|
||||
* skin/classic/browser/aboutSessionRestore.css (aboutSessionRestore.css)
|
||||
skin/classic/browser/aboutSessionRestore-window-icon.png (aboutSessionRestore-window-icon.png)
|
||||
skin/classic/browser/aboutSessionRestore-window-icon.png (preferences/application.png)
|
||||
skin/classic/browser/aboutCertError.css (aboutCertError.css)
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
skin/classic/browser/aboutSyncTabs.css
|
||||
@ -51,10 +51,10 @@ browser.jar:
|
||||
skin/classic/browser/urlbar-history-dropmarker.png
|
||||
skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png)
|
||||
skin/classic/browser/feeds/feedIcon16.png (feeds/feedIcon16.png)
|
||||
skin/classic/browser/feeds/audioFeedIcon.png (feeds/audioFeedIcon.png)
|
||||
skin/classic/browser/feeds/audioFeedIcon16.png (feeds/audioFeedIcon16.png)
|
||||
skin/classic/browser/feeds/videoFeedIcon.png (feeds/videoFeedIcon.png)
|
||||
skin/classic/browser/feeds/videoFeedIcon16.png (feeds/videoFeedIcon16.png)
|
||||
skin/classic/browser/feeds/audioFeedIcon.png (feeds/feedIcon.png)
|
||||
skin/classic/browser/feeds/audioFeedIcon16.png (feeds/feedIcon16.png)
|
||||
skin/classic/browser/feeds/videoFeedIcon.png (feeds/feedIcon.png)
|
||||
skin/classic/browser/feeds/videoFeedIcon16.png (feeds/feedIcon16.png)
|
||||
skin/classic/browser/feeds/subscribe.css (feeds/subscribe.css)
|
||||
skin/classic/browser/feeds/subscribe-ui.css (feeds/subscribe-ui.css)
|
||||
skin/classic/browser/inspector.css
|
||||
@ -204,10 +204,10 @@ browser.jar:
|
||||
skin/classic/aero/browser/urlbar-history-dropmarker.png
|
||||
skin/classic/aero/browser/feeds/feedIcon.png (feeds/feedIcon-aero.png)
|
||||
skin/classic/aero/browser/feeds/feedIcon16.png (feeds/feedIcon16-aero.png)
|
||||
skin/classic/aero/browser/feeds/audioFeedIcon.png (feeds/audioFeedIcon-aero.png)
|
||||
skin/classic/aero/browser/feeds/audioFeedIcon16.png (feeds/audioFeedIcon16-aero.png)
|
||||
skin/classic/aero/browser/feeds/videoFeedIcon.png (feeds/videoFeedIcon-aero.png)
|
||||
skin/classic/aero/browser/feeds/videoFeedIcon16.png (feeds/videoFeedIcon16-aero.png)
|
||||
skin/classic/aero/browser/feeds/audioFeedIcon.png (feeds/feedIcon-aero.png)
|
||||
skin/classic/aero/browser/feeds/audioFeedIcon16.png (feeds/feedIcon16-aero.png)
|
||||
skin/classic/aero/browser/feeds/videoFeedIcon.png (feeds/feedIcon-aero.png)
|
||||
skin/classic/aero/browser/feeds/videoFeedIcon16.png (feeds/feedIcon16-aero.png)
|
||||
skin/classic/aero/browser/feeds/subscribe.css (feeds/subscribe.css)
|
||||
skin/classic/aero/browser/feeds/subscribe-ui.css (feeds/subscribe-ui.css)
|
||||
skin/classic/aero/browser/inspector.css
|
||||
@ -228,7 +228,7 @@ browser.jar:
|
||||
skin/classic/aero/browser/places/history.png (places/history-aero.png)
|
||||
skin/classic/aero/browser/places/allBookmarks.png (places/allBookmarks-aero.png)
|
||||
skin/classic/aero/browser/places/unsortedBookmarks.png (places/unsortedBookmarks-aero.png)
|
||||
skin/classic/aero/browser/places/searching_16.png (places/searching_16-aero.png)
|
||||
skin/classic/aero/browser/places/searching_16.png (places/searching_16.png)
|
||||
skin/classic/aero/browser/places/downloads.png (places/downloads.png)
|
||||
skin/classic/aero/browser/preferences/alwaysAsk.png (preferences/alwaysAsk-aero.png)
|
||||
skin/classic/aero/browser/preferences/application.png (preferences/application-aero.png)
|
||||
@ -237,7 +237,6 @@ browser.jar:
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
skin/classic/aero/browser/preferences/Options-sync.png (preferences/Options-sync.png)
|
||||
#endif
|
||||
skin/classic/aero/browser/preferences/plugin.png (preferences/plugin-aero.png)
|
||||
skin/classic/aero/browser/preferences/saveFile.png (preferences/saveFile-aero.png)
|
||||
* skin/classic/aero/browser/preferences/preferences.css (preferences/preferences.css)
|
||||
skin/classic/aero/browser/preferences/applications.css (preferences/applications.css)
|
||||
|
@ -81,7 +81,7 @@ treechildren::-moz-tree-image(title, query) {
|
||||
|
||||
treechildren::-moz-tree-image(title, query, tagContainer),
|
||||
treechildren::-moz-tree-image(query, OrganizerQuery_Tags) {
|
||||
list-style-image: url("chrome://mozapps/skin/places/tagContainerIcon.png");
|
||||
list-style-image: url("chrome://browser/skin/places/tag.png");
|
||||
-moz-image-region: auto;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 539 B |
41
build/autoconf/mozcommonheader.m4
Normal file
@ -0,0 +1,41 @@
|
||||
dnl ***** BEGIN LICENSE BLOCK *****
|
||||
dnl Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
dnl
|
||||
dnl The contents of this file are subject to the Mozilla Public License Version
|
||||
dnl 1.1 (the "License"); you may not use this file except in compliance with
|
||||
dnl the License. You may obtain a copy of the License at
|
||||
dnl http://www.mozilla.org/MPL/
|
||||
dnl
|
||||
dnl Software distributed under the License is distributed on an "AS IS" basis,
|
||||
dnl WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
dnl for the specific language governing rights and limitations under the
|
||||
dnl License.
|
||||
dnl
|
||||
dnl The Original Code is mozilla.org code.
|
||||
dnl
|
||||
dnl The Initial Developer of the Original Code is the
|
||||
dnl Mozilla Foundation <http://www.mozilla.org>
|
||||
dnl
|
||||
dnl Portions created by the Initial Developer are Copyright (C) 2009
|
||||
dnl the Initial Developer. All Rights Reserved.
|
||||
dnl
|
||||
dnl
|
||||
dnl Alternatively, the contents of this file may be used under the terms of
|
||||
dnl either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
dnl or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
dnl in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
dnl of those above. If you wish to allow use of your version of this file only
|
||||
dnl under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
dnl use your version of this file under the terms of the MPL, indicate your
|
||||
dnl decision by deleting the provisions above and replace them with the notice
|
||||
dnl and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
dnl the provisions above, a recipient may use your version of this file under
|
||||
dnl the terms of any one of the MPL, the GPL or the LGPL.
|
||||
dnl
|
||||
dnl ***** END LICENSE BLOCK *****
|
||||
|
||||
AC_DEFUN(MOZ_CHECK_COMMON_HEADERS,
|
||||
MOZ_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h sys/bitypes.h \
|
||||
memory.h unistd.h gnu/libc-version.h nl_types.h malloc.h \
|
||||
X11/XKBlib.h io.h cpuid.h)
|
||||
)
|
@ -36,13 +36,14 @@ dnl the terms of any one of the MPL, the GPL or the LGPL.
|
||||
dnl
|
||||
dnl ***** END LICENSE BLOCK *****
|
||||
|
||||
dnl MOZ_CHECK_HEADER(HEADER-FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
||||
dnl MOZ_CHECK_HEADER(HEADER-FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, INCLUDES]]])
|
||||
AC_DEFUN([MOZ_CHECK_HEADER],
|
||||
[ dnl Do the transliteration at runtime so arg 1 can be a shell variable.
|
||||
ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
|
||||
AC_MSG_CHECKING([for $1])
|
||||
AC_CACHE_VAL(ac_cv_header_$ac_safe,
|
||||
[ AC_TRY_COMPILE([#include <$1>], ,
|
||||
[ AC_TRY_COMPILE([$4
|
||||
#include <$1>], ,
|
||||
eval "ac_cv_header_$ac_safe=yes",
|
||||
eval "ac_cv_header_$ac_safe=no") ])
|
||||
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
|
||||
@ -54,12 +55,12 @@ AC_DEFUN([MOZ_CHECK_HEADER],
|
||||
fi
|
||||
])
|
||||
|
||||
dnl MOZ_CHECK_HEADERS(HEADER-FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
||||
dnl MOZ_CHECK_HEADERS(HEADER-FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, INCLUDES]]])
|
||||
AC_DEFUN([MOZ_CHECK_HEADERS],
|
||||
[ for ac_hdr in $1
|
||||
do
|
||||
MOZ_CHECK_HEADER($ac_hdr,
|
||||
[ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
|
||||
AC_DEFINE_UNQUOTED($ac_tr_hdr) $2], $3)
|
||||
AC_DEFINE_UNQUOTED($ac_tr_hdr) $2], $3, [$4])
|
||||
done
|
||||
])
|
||||
|
@ -367,6 +367,9 @@ user_pref("app.update.enabled", false);
|
||||
user_pref("browser.panorama.experienced_first_run", true); // Assume experienced
|
||||
user_pref("dom.w3c_touch_events.enabled", true);
|
||||
user_pref("toolkit.telemetry.prompted", 2);
|
||||
// Existing tests assume there is no font size inflation.
|
||||
user_pref("font.size.inflation.emPerLine", 0);
|
||||
user_pref("font.size.inflation.minTwips", 0);
|
||||
|
||||
// Only load extensions from the application and user profile
|
||||
// AddonManager.SCOPE_PROFILE + AddonManager.SCOPE_APPLICATION
|
||||
|
2
build/unix/mozconfig.linux
Normal file
@ -0,0 +1,2 @@
|
||||
CC=/tools/gcc-4.5-0moz2/bin/gcc
|
||||
CXX=/tools/gcc-4.5-0moz2/bin/g++
|
@ -119,7 +119,6 @@ MOZ_CALLGRIND = @MOZ_CALLGRIND@
|
||||
MOZ_VTUNE = @MOZ_VTUNE@
|
||||
MOZ_ETW = @MOZ_ETW@
|
||||
MOZ_TRACE_JSCALLS = @MOZ_TRACE_JSCALLS@
|
||||
MOZ_TRACEVIS = @MOZ_TRACEVIS@
|
||||
DEHYDRA_PATH = @DEHYDRA_PATH@
|
||||
|
||||
NS_TRACE_MALLOC = @NS_TRACE_MALLOC@
|
||||
|
27
configure.in
@ -3409,12 +3409,7 @@ freebsd*|openbsd*)
|
||||
CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
|
||||
;;
|
||||
esac
|
||||
MOZ_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h)
|
||||
MOZ_CHECK_HEADERS(sys/bitypes.h memory.h unistd.h)
|
||||
MOZ_CHECK_HEADERS(gnu/libc-version.h nl_types.h)
|
||||
MOZ_CHECK_HEADERS(malloc.h)
|
||||
MOZ_CHECK_HEADERS(X11/XKBlib.h)
|
||||
MOZ_CHECK_HEADERS(io.h)
|
||||
MOZ_CHECK_COMMON_HEADERS
|
||||
|
||||
dnl These are all the places some variant of statfs can be hiding.
|
||||
MOZ_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
|
||||
@ -5935,12 +5930,11 @@ if test "$MOZ_XTF"; then
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl Pref extensions (autoconfig and system-pref)
|
||||
dnl Pref extensions (autoconfig)
|
||||
dnl ========================================================
|
||||
MOZ_ARG_DISABLE_BOOL(pref-extensions,
|
||||
[ --disable-pref-extensions
|
||||
Disable pref extensions such as autoconfig and
|
||||
system-pref],
|
||||
Disable pref extensions such as autoconfig],
|
||||
MOZ_PREF_EXTENSIONS=,
|
||||
MOZ_PREF_EXTENSIONS=1 )
|
||||
|
||||
@ -7326,17 +7320,6 @@ if test -n "$MOZ_TRACE_JSCALLS"; then
|
||||
AC_DEFINE(MOZ_TRACE_JSCALLS)
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Use TraceVis
|
||||
dnl ========================================================
|
||||
MOZ_ARG_ENABLE_BOOL(tracevis,
|
||||
[ --enable-tracevis Enable TraceVis tracing tool (default=no)],
|
||||
MOZ_TRACEVIS=1,
|
||||
MOZ_TRACEVIS= )
|
||||
if test -n "$MOZ_TRACEVIS"; then
|
||||
AC_DEFINE(MOZ_TRACEVIS)
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Use incremental GC
|
||||
dnl ========================================================
|
||||
@ -8761,8 +8744,8 @@ if test "$USE_FC_FREETYPE"; then
|
||||
if test "$COMPILE_ENVIRONMENT"; then
|
||||
_SAVE_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $FT2_CFLAGS $XCFLAGS"
|
||||
AC_CHECK_HEADERS(fontconfig/fcfreetype.h, ,
|
||||
[AC_MSG_ERROR(Can't find header fontconfig/fcfreetype.h.)])
|
||||
MOZ_CHECK_HEADERS([fontconfig/fcfreetype.h], ,
|
||||
[AC_MSG_ERROR(Can't find header fontconfig/fcfreetype.h.)], [#include <fontconfig/fontconfig.h>])
|
||||
CPPFLAGS="$_SAVE_CPPFLAGS"
|
||||
else
|
||||
AC_DEFINE(HAVE_FONTCONFIG_FCFREETYPE_H)
|
||||
|
@ -1290,11 +1290,6 @@ public:
|
||||
static void TraceWrapper(nsWrapperCache* aCache, TraceCallback aCallback,
|
||||
void *aClosure);
|
||||
|
||||
/**
|
||||
* Convert nsIContent::IME_STATUS_* to nsIWidget::IME_STATUS_*
|
||||
*/
|
||||
static PRUint32 GetWidgetStatusFromIMEStatus(PRUint32 aState);
|
||||
|
||||
/*
|
||||
* Notify when the first XUL menu is opened and when the all XUL menus are
|
||||
* closed. At opening, aInstalling should be TRUE, otherwise, it should be
|
||||
|
@ -46,8 +46,8 @@ class nsDOMAttributeMap;
|
||||
class nsIContent;
|
||||
|
||||
#define NS_IATTRIBUTE_IID \
|
||||
{ 0xf809b623, 0x5b1e, 0x4121, \
|
||||
{ 0xb8, 0x9d, 0x19, 0x24, 0x7b, 0x70, 0x77, 0x08 } }
|
||||
{ 0x536167ae, 0x8a9c, 0x4712, \
|
||||
{ 0x8b, 0x61, 0x3, 0x43, 0xf6, 0xbc, 0x64, 0x75 } }
|
||||
|
||||
class nsIAttribute : public nsINode
|
||||
{
|
||||
|
@ -63,8 +63,11 @@ class nsIDOMCSSStyleDeclaration;
|
||||
namespace mozilla {
|
||||
namespace css {
|
||||
class StyleRule;
|
||||
}
|
||||
}
|
||||
} // namespace css
|
||||
namespace widget {
|
||||
struct IMEState;
|
||||
} // namespace widget
|
||||
} // namespace mozilla
|
||||
|
||||
enum nsLinkState {
|
||||
eLinkState_Unknown = 0,
|
||||
@ -75,8 +78,8 @@ enum nsLinkState {
|
||||
|
||||
// IID for the nsIContent interface
|
||||
#define NS_ICONTENT_IID \
|
||||
{ 0xb651e0a7, 0x1471, 0x49cc, \
|
||||
{ 0xb4, 0xe1, 0xc2, 0xca, 0x01, 0xfe, 0xb7, 0x80 } }
|
||||
{ 0xed40a3e5, 0xd7ed, 0x473e, \
|
||||
{ 0x85, 0xe3, 0x82, 0xc3, 0xf0, 0x41, 0xdb, 0x52 } }
|
||||
|
||||
/**
|
||||
* A node of content in a document's content model. This interface
|
||||
@ -84,6 +87,8 @@ enum nsLinkState {
|
||||
*/
|
||||
class nsIContent : public nsINode {
|
||||
public:
|
||||
typedef mozilla::widget::IMEState IMEState;
|
||||
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
// If you're using the external API, the only thing you can know about
|
||||
// nsIContent is that it exists with an IID
|
||||
@ -604,40 +609,18 @@ public:
|
||||
* Get desired IME state for the content.
|
||||
*
|
||||
* @return The desired IME status for the content.
|
||||
* This is a combination of IME_STATUS_* flags,
|
||||
* controlling what happens to IME when the content takes focus.
|
||||
* If this is IME_STATUS_NONE, IME remains in its current state.
|
||||
* IME_STATUS_ENABLE and IME_STATUS_DISABLE must not be set
|
||||
* together; likewise IME_STATUS_OPEN and IME_STATUS_CLOSE must
|
||||
* not be set together.
|
||||
* If you return IME_STATUS_DISABLE, you should not set the
|
||||
* OPEN or CLOSE flag; that way, when IME is next enabled,
|
||||
* the previous OPEN/CLOSE state will be restored (unless the newly
|
||||
* focused content specifies the OPEN/CLOSE state by setting the OPEN
|
||||
* or CLOSE flag with the ENABLE flag).
|
||||
* IME_STATUS_PASSWORD should be returned only from password editor,
|
||||
* this value has a special meaning. It is used as alternative of
|
||||
* IME_STATUS_DISABLED.
|
||||
* IME_STATUS_PLUGIN should be returned only when plug-in has focus.
|
||||
* When a plug-in is focused content, we should send native events
|
||||
* directly. Because we don't process some native events, but they may
|
||||
* be needed by the plug-in.
|
||||
* This is a combination of an IME enabled value and
|
||||
* an IME open value of widget::IMEState.
|
||||
* If you return DISABLED, you should not set the OPEN and CLOSE
|
||||
* value.
|
||||
* PASSWORD should be returned only from password editor, this value
|
||||
* has a special meaning. It is used as alternative of DISABLED.
|
||||
* PLUGIN should be returned only when plug-in has focus. When a
|
||||
* plug-in is focused content, we should send native events directly.
|
||||
* Because we don't process some native events, but they may be needed
|
||||
* by the plug-in.
|
||||
*/
|
||||
enum {
|
||||
IME_STATUS_NONE = 0x0000,
|
||||
IME_STATUS_ENABLE = 0x0001,
|
||||
IME_STATUS_DISABLE = 0x0002,
|
||||
IME_STATUS_PASSWORD = 0x0004,
|
||||
IME_STATUS_PLUGIN = 0x0008,
|
||||
IME_STATUS_OPEN = 0x0010,
|
||||
IME_STATUS_CLOSE = 0x0020
|
||||
};
|
||||
enum {
|
||||
IME_STATUS_MASK_ENABLED = IME_STATUS_ENABLE | IME_STATUS_DISABLE |
|
||||
IME_STATUS_PASSWORD | IME_STATUS_PLUGIN,
|
||||
IME_STATUS_MASK_OPENED = IME_STATUS_OPEN | IME_STATUS_CLOSE
|
||||
};
|
||||
virtual PRUint32 GetDesiredIMEState();
|
||||
virtual IMEState GetDesiredIMEState();
|
||||
|
||||
/**
|
||||
* Gets content node with the binding (or native code, possibly on the
|
||||
|
@ -41,7 +41,7 @@ interface nsIDOMEventListener;
|
||||
interface nsIDOMBlob;
|
||||
interface nsIDOMFileError;
|
||||
|
||||
[scriptable, builtinclass, uuid(fc316500-87c4-411e-ab75-dd62468f4174)]
|
||||
[scriptable, builtinclass, uuid(d158de26-904e-4731-b42c-8b3a4d172703)]
|
||||
interface nsIDOMFileReader : nsIDOMEventTarget
|
||||
{
|
||||
[implicit_jscontext]
|
||||
|
@ -64,7 +64,7 @@
|
||||
#include "nsSMILAnimationController.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsIDocumentEncoder.h"
|
||||
#include "nsIAnimationFrameListener.h"
|
||||
#include "nsIFrameRequestCallback.h"
|
||||
#include "nsEventStates.h"
|
||||
#include "nsIStructuredCloneContainer.h"
|
||||
#include "nsIBFCacheEntry.h"
|
||||
@ -124,8 +124,8 @@ class Element;
|
||||
} // namespace mozilla
|
||||
|
||||
#define NS_IDOCUMENT_IID \
|
||||
{ 0x184e0a3c, 0x1899, 0x417d, \
|
||||
{ 0xbf, 0xf4, 0x5a, 0x15, 0xe6, 0xe8, 0xaa, 0x94 } }
|
||||
{ 0x3b78f6, 0x6dc5, 0x44c6, \
|
||||
{ 0xbc, 0x28, 0x60, 0x2a, 0xb2, 0x4f, 0xfb, 0x7b } }
|
||||
|
||||
// Flag for AddStyleSheet().
|
||||
#define NS_STYLESHEET_FROM_CATALOG (1 << 0)
|
||||
@ -1518,18 +1518,14 @@ public:
|
||||
*/
|
||||
virtual Element* LookupImageElement(const nsAString& aElementId) = 0;
|
||||
|
||||
void ScheduleBeforePaintEvent(nsIAnimationFrameListener* aListener);
|
||||
void BeforePaintEventFiring()
|
||||
{
|
||||
mHavePendingPaint = false;
|
||||
}
|
||||
void ScheduleFrameRequestCallback(nsIFrameRequestCallback* aCallback);
|
||||
|
||||
typedef nsTArray< nsCOMPtr<nsIAnimationFrameListener> > AnimationListenerList;
|
||||
typedef nsTArray< nsCOMPtr<nsIFrameRequestCallback> > FrameRequestCallbackList;
|
||||
/**
|
||||
* Put this documents animation frame listeners into the provided
|
||||
* Put this document's frame request callbacks into the provided
|
||||
* list, and forget about them.
|
||||
*/
|
||||
void TakeAnimationFrameListeners(AnimationListenerList& aListeners);
|
||||
void TakeFrameRequestCallbacks(FrameRequestCallbackList& aCallbacks);
|
||||
|
||||
// This returns true when the document tree is being teared down.
|
||||
bool InUnlinkOrDeletion() { return mInUnlinkOrDeletion; }
|
||||
@ -1746,9 +1742,6 @@ protected:
|
||||
// True if document has ever had script handling object.
|
||||
bool mHasHadScriptHandlingObject;
|
||||
|
||||
// True if we're waiting for a before-paint event.
|
||||
bool mHavePendingPaint;
|
||||
|
||||
// True if we're an SVG document being used as an image.
|
||||
bool mIsBeingUsedAsImage;
|
||||
|
||||
@ -1812,7 +1805,7 @@ protected:
|
||||
|
||||
nsCOMPtr<nsIDocumentEncoder> mCachedEncoder;
|
||||
|
||||
AnimationListenerList mAnimationFrameListeners;
|
||||
FrameRequestCallbackList mFrameRequestCallbacks;
|
||||
|
||||
// This object allows us to evict ourself from the back/forward cache. The
|
||||
// pointer is non-null iff we're currently in the bfcache.
|
||||
|
@ -288,8 +288,8 @@ private:
|
||||
|
||||
// IID for the nsINode interface
|
||||
#define NS_INODE_IID \
|
||||
{ 0x20d16be2, 0x3c58, 0x4099, \
|
||||
{ 0xbf, 0xa6, 0xd0, 0xe7, 0x6b, 0xb1, 0x3d, 0xc5 } }
|
||||
{ 0xd026d280, 0x5b25, 0x41c0, \
|
||||
{ 0x92, 0xcf, 0x6, 0xf6, 0xf, 0xb, 0x9a, 0xfe } }
|
||||
|
||||
/**
|
||||
* An internal interface that abstracts some DOMNode-related parts that both
|
||||
@ -728,6 +728,7 @@ public:
|
||||
*/
|
||||
NS_DECL_NSIDOMEVENTTARGET
|
||||
using nsIDOMEventTarget::AddEventListener;
|
||||
using nsIDOMEventTarget::AddSystemEventListener;
|
||||
|
||||
/**
|
||||
* Adds a mutation observer to be notified when this node, or any of its
|
||||
|
@ -53,7 +53,7 @@ interface nsIDOMBlob;
|
||||
#include "jsapi.h"
|
||||
%}
|
||||
|
||||
[scriptable, builtinclass, uuid(dea238a1-240f-45f4-9f07-7769bc69eb76)]
|
||||
[scriptable, builtinclass, uuid(e2b59e48-3655-4429-a94c-b4332c346ba2)]
|
||||
interface nsIXMLHttpRequestEventTarget : nsIDOMEventTarget {
|
||||
// event handler attributes
|
||||
attribute nsIDOMEventListener onabort;
|
||||
@ -64,7 +64,7 @@ interface nsIXMLHttpRequestEventTarget : nsIDOMEventTarget {
|
||||
attribute nsIDOMEventListener onloadend;
|
||||
};
|
||||
|
||||
[scriptable, builtinclass, uuid(09ff3682-7759-4441-a765-f70e1a1fabcf)]
|
||||
[scriptable, builtinclass, uuid(db9357fc-edf7-42b2-aab2-c24ab19ece20)]
|
||||
interface nsIXMLHttpRequestUpload : nsIXMLHttpRequestEventTarget {
|
||||
// for future use
|
||||
};
|
||||
|
@ -51,6 +51,9 @@
|
||||
#include "nsISHContainer.h"
|
||||
#include "nsIWindowWatcher.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "nsIXULWindow.h"
|
||||
#include "nsIAppShellService.h"
|
||||
#include "nsAppShellCID.h"
|
||||
|
||||
static bool sInited = 0;
|
||||
PRUint32 nsCCUncollectableMarker::sGeneration = 0;
|
||||
@ -231,6 +234,19 @@ nsCCUncollectableMarker::Observe(nsISupports* aSubject, const char* aTopic,
|
||||
MarkWindowList(windowList);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIAppShellService> appShell =
|
||||
do_GetService(NS_APPSHELLSERVICE_CONTRACTID);
|
||||
if (appShell) {
|
||||
nsCOMPtr<nsIXULWindow> hw;
|
||||
appShell->GetHiddenWindow(getter_AddRefs(hw));
|
||||
if (hw) {
|
||||
nsCOMPtr<nsIDocShell> shell;
|
||||
hw->GetDocShell(getter_AddRefs(shell));
|
||||
nsCOMPtr<nsIDocShellTreeNode> shellTreeNode = do_QueryInterface(shell);
|
||||
MarkDocShell(shellTreeNode);
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -212,6 +212,7 @@ static NS_DEFINE_CID(kXTFServiceCID, NS_XTFSERVICE_CID);
|
||||
|
||||
using namespace mozilla::dom;
|
||||
using namespace mozilla::layers;
|
||||
using namespace mozilla::widget;
|
||||
using namespace mozilla;
|
||||
|
||||
const char kLoadAsData[] = "loadAsData";
|
||||
@ -4026,25 +4027,6 @@ nsContentUtils::DropJSObjects(void* aScriptObjectHolder)
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* static */
|
||||
PRUint32
|
||||
nsContentUtils::GetWidgetStatusFromIMEStatus(PRUint32 aState)
|
||||
{
|
||||
switch (aState & nsIContent::IME_STATUS_MASK_ENABLED) {
|
||||
case nsIContent::IME_STATUS_DISABLE:
|
||||
return nsIWidget::IME_STATUS_DISABLED;
|
||||
case nsIContent::IME_STATUS_ENABLE:
|
||||
return nsIWidget::IME_STATUS_ENABLED;
|
||||
case nsIContent::IME_STATUS_PASSWORD:
|
||||
return nsIWidget::IME_STATUS_PASSWORD;
|
||||
case nsIContent::IME_STATUS_PLUGIN:
|
||||
return nsIWidget::IME_STATUS_PLUGIN;
|
||||
default:
|
||||
NS_ERROR("The given state doesn't have valid enable state");
|
||||
return nsIWidget::IME_STATUS_ENABLED;
|
||||
}
|
||||
}
|
||||
|
||||
/* static */
|
||||
void
|
||||
nsContentUtils::NotifyInstalledMenuKeyboardListener(bool aInstalling)
|
||||
@ -5444,6 +5426,10 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHOD_(void) NoteWeakMapping(void* map, void* key, void* val)
|
||||
{
|
||||
}
|
||||
|
||||
bool mFound;
|
||||
|
||||
private:
|
||||
|