mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Merge m-c to s-c.
--HG-- rename : browser/base/content/syncProgress.xhtml => browser/base/content/sync/progress.xhtml
This commit is contained in:
commit
4dc6a3ab13
@ -871,10 +871,11 @@ refChildCB(AtkObject *aAtkObj, gint aChildIndex)
|
||||
if (!childAtkObj)
|
||||
return nsnull;
|
||||
g_object_ref(childAtkObj);
|
||||
|
||||
//this will addref parent
|
||||
|
||||
if (aAtkObj != childAtkObj->accessible_parent)
|
||||
atk_object_set_parent(childAtkObj, aAtkObj);
|
||||
return childAtkObj;
|
||||
|
||||
return childAtkObj;
|
||||
}
|
||||
|
||||
gint
|
||||
|
@ -43,6 +43,8 @@
|
||||
#include "nsHyperTextAccessible.h"
|
||||
#include "nsRoleMap.h"
|
||||
|
||||
#include "nsIPersistentProperties2.h"
|
||||
|
||||
AtkAttributeSet* ConvertToAtkAttributeSet(nsIPersistentProperties* aAttributes);
|
||||
|
||||
void
|
||||
|
@ -110,3 +110,24 @@ StyleInfo::Margin(css::Side aSide, nsAString& aValue)
|
||||
aValue.AppendFloat(nsPresContext::AppUnitsToFloatCSSPixels(coordVal));
|
||||
aValue.AppendLiteral("px");
|
||||
}
|
||||
|
||||
void
|
||||
StyleInfo::FormatColor(const nscolor& aValue, nsString& aFormattedValue)
|
||||
{
|
||||
// Combine the string like rgb(R, G, B) from nscolor.
|
||||
aFormattedValue.AppendLiteral("rgb(");
|
||||
aFormattedValue.AppendInt(NS_GET_R(aValue));
|
||||
aFormattedValue.AppendLiteral(", ");
|
||||
aFormattedValue.AppendInt(NS_GET_G(aValue));
|
||||
aFormattedValue.AppendLiteral(", ");
|
||||
aFormattedValue.AppendInt(NS_GET_B(aValue));
|
||||
aFormattedValue.Append(')');
|
||||
}
|
||||
|
||||
void
|
||||
StyleInfo::FormatFontStyle(const nscoord& aValue, nsAString& aFormattedValue)
|
||||
{
|
||||
nsCSSKeyword keyword =
|
||||
nsCSSProps::ValueToKeywordEnum(aValue, nsCSSProps::kFontStyleKTable);
|
||||
AppendUTF8toUTF16(nsCSSKeywords::GetStringValue(keyword), aFormattedValue);
|
||||
}
|
||||
|
@ -60,6 +60,9 @@ public:
|
||||
void MarginTop(nsAString& aValue) { Margin(css::eSideTop, aValue); }
|
||||
void MarginBottom(nsAString& aValue) { Margin(css::eSideBottom, aValue); }
|
||||
|
||||
static void FormatColor(const nscolor& aValue, nsString& aFormattedValue);
|
||||
static void FormatFontStyle(const nscoord& aValue, nsAString& aFormattedValue);
|
||||
|
||||
private:
|
||||
StyleInfo() MOZ_DELETE;
|
||||
StyleInfo(const StyleInfo&) MOZ_DELETE;
|
||||
|
@ -364,9 +364,9 @@ nsAccDocManager::CreateDocOrRootAccessible(nsIDocument *aDocument)
|
||||
aDocument->IsResourceDoc() || !aDocument->IsActive())
|
||||
return nsnull;
|
||||
|
||||
// Ignore documents without presshell.
|
||||
nsIPresShell *presShell = aDocument->GetShell();
|
||||
if (!presShell)
|
||||
// Ignore documents without presshell and not having root frame.
|
||||
nsIPresShell* presShell = aDocument->GetShell();
|
||||
if (!presShell || !presShell->GetRootFrame())
|
||||
return nsnull;
|
||||
|
||||
// Do not create document accessible until role content is loaded, otherwise
|
||||
|
@ -41,12 +41,16 @@
|
||||
#include "nsAccUtils.h"
|
||||
#include "nsCoreUtils.h"
|
||||
#include "nsHyperTextAccessibleWrap.h"
|
||||
#include "StyleInfo.h"
|
||||
|
||||
#include "gfxFont.h"
|
||||
#include "gfxUserFontSet.h"
|
||||
#include "nsFontMetrics.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::a11y;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Constants and structures
|
||||
|
||||
@ -70,9 +74,6 @@ const char* const kCopyValue = nsnull;
|
||||
static nsCSSTextAttrMapItem gCSSTextAttrsMap[] =
|
||||
{
|
||||
// CSS name CSS value Attribute name Attribute value
|
||||
{ "color", kAnyValue, &nsGkAtoms::color, kCopyValue },
|
||||
{ "font-family", kAnyValue, &nsGkAtoms::font_family, kCopyValue },
|
||||
{ "font-style", kAnyValue, &nsGkAtoms::font_style, kCopyValue },
|
||||
{ "text-decoration", "line-through", &nsGkAtoms::textLineThroughStyle, "solid" },
|
||||
{ "text-decoration", "underline", &nsGkAtoms::textUnderlineStyle, "solid" },
|
||||
{ "vertical-align", kAnyValue, &nsGkAtoms::textPosition, kCopyValue }
|
||||
@ -152,43 +153,43 @@ nsTextAttrsMgr::GetAttributes(nsIPersistentProperties *aAttributes,
|
||||
|
||||
// "language" text attribute
|
||||
nsLangTextAttr langTextAttr(mHyperTextAcc, hyperTextElm, offsetNode);
|
||||
textAttrArray.AppendElement(static_cast<nsITextAttr*>(&langTextAttr));
|
||||
|
||||
// "color" text attribute
|
||||
nsCSSTextAttr colorTextAttr(0, hyperTextElm, offsetElm);
|
||||
textAttrArray.AppendElement(static_cast<nsITextAttr*>(&colorTextAttr));
|
||||
|
||||
// "font-family" text attribute
|
||||
nsCSSTextAttr fontFamilyTextAttr(1, hyperTextElm, offsetElm);
|
||||
textAttrArray.AppendElement(static_cast<nsITextAttr*>(&fontFamilyTextAttr));
|
||||
|
||||
// "font-style" text attribute
|
||||
nsCSSTextAttr fontStyleTextAttr(2, hyperTextElm, offsetElm);
|
||||
textAttrArray.AppendElement(static_cast<nsITextAttr*>(&fontStyleTextAttr));
|
||||
textAttrArray.AppendElement(&langTextAttr);
|
||||
|
||||
// "text-line-through-style" text attribute
|
||||
nsCSSTextAttr lineThroughTextAttr(3, hyperTextElm, offsetElm);
|
||||
textAttrArray.AppendElement(static_cast<nsITextAttr*>(&lineThroughTextAttr));
|
||||
nsCSSTextAttr lineThroughTextAttr(0, hyperTextElm, offsetElm);
|
||||
textAttrArray.AppendElement(&lineThroughTextAttr);
|
||||
|
||||
// "text-underline-style" text attribute
|
||||
nsCSSTextAttr underlineTextAttr(4, hyperTextElm, offsetElm);
|
||||
textAttrArray.AppendElement(static_cast<nsITextAttr*>(&underlineTextAttr));
|
||||
nsCSSTextAttr underlineTextAttr(1, hyperTextElm, offsetElm);
|
||||
textAttrArray.AppendElement(&underlineTextAttr);
|
||||
|
||||
// "text-position" text attribute
|
||||
nsCSSTextAttr posTextAttr(5, hyperTextElm, offsetElm);
|
||||
textAttrArray.AppendElement(static_cast<nsITextAttr*>(&posTextAttr));
|
||||
nsCSSTextAttr posTextAttr(2, hyperTextElm, offsetElm);
|
||||
textAttrArray.AppendElement(&posTextAttr);
|
||||
|
||||
// "background-color" text attribute
|
||||
nsBGColorTextAttr bgColorTextAttr(rootFrame, frame);
|
||||
textAttrArray.AppendElement(static_cast<nsITextAttr*>(&bgColorTextAttr));
|
||||
textAttrArray.AppendElement(&bgColorTextAttr);
|
||||
|
||||
// "color" text attribute
|
||||
ColorTextAttr colorTextAttr(rootFrame, frame);
|
||||
textAttrArray.AppendElement(&colorTextAttr);
|
||||
|
||||
// "font-family" text attribute
|
||||
FontFamilyTextAttr fontFamilyTextAttr(rootFrame, frame);
|
||||
textAttrArray.AppendElement(&fontFamilyTextAttr);
|
||||
|
||||
// "font-size" text attribute
|
||||
nsFontSizeTextAttr fontSizeTextAttr(rootFrame, frame);
|
||||
textAttrArray.AppendElement(static_cast<nsITextAttr*>(&fontSizeTextAttr));
|
||||
textAttrArray.AppendElement(&fontSizeTextAttr);
|
||||
|
||||
// "font-style" text attribute
|
||||
FontStyleTextAttr fontStyleTextAttr(rootFrame, frame);
|
||||
textAttrArray.AppendElement(&fontStyleTextAttr);
|
||||
|
||||
// "font-weight" text attribute
|
||||
nsFontWeightTextAttr fontWeightTextAttr(rootFrame, frame);
|
||||
textAttrArray.AppendElement(static_cast<nsITextAttr*>(&fontWeightTextAttr));
|
||||
textAttrArray.AppendElement(&fontWeightTextAttr);
|
||||
|
||||
// Expose text attributes if applicable.
|
||||
if (aAttributes) {
|
||||
@ -363,7 +364,7 @@ nsCSSTextAttr::Format(const nsAutoString& aValue, nsAString& aFormattedValue)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsBackgroundTextAttr
|
||||
// nsBGColorTextAttr
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
nsBGColorTextAttr::nsBGColorTextAttr(nsIFrame *aRootFrame, nsIFrame *aFrame) :
|
||||
@ -387,16 +388,8 @@ nsBGColorTextAttr::GetValueFor(nsIContent *aContent, nscolor *aValue)
|
||||
void
|
||||
nsBGColorTextAttr::Format(const nscolor& aValue, nsAString& aFormattedValue)
|
||||
{
|
||||
// Combine the string like rgb(R, G, B) from nscolor.
|
||||
nsAutoString value;
|
||||
value.AppendLiteral("rgb(");
|
||||
value.AppendInt(NS_GET_R(aValue));
|
||||
value.AppendLiteral(", ");
|
||||
value.AppendInt(NS_GET_G(aValue));
|
||||
value.AppendLiteral(", ");
|
||||
value.AppendInt(NS_GET_B(aValue));
|
||||
value.Append(')');
|
||||
|
||||
StyleInfo::FormatColor(aValue, value);
|
||||
aFormattedValue = value;
|
||||
}
|
||||
|
||||
@ -426,6 +419,87 @@ nsBGColorTextAttr::GetColor(nsIFrame *aFrame, nscolor *aColor)
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// ColorTextAttr
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ColorTextAttr::ColorTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame) :
|
||||
nsTextAttr<nscolor>(!aFrame)
|
||||
{
|
||||
mRootNativeValue = aRootFrame->GetStyleColor()->mColor;
|
||||
mIsRootDefined = true;
|
||||
|
||||
if (aFrame) {
|
||||
mNativeValue = aFrame->GetStyleColor()->mColor;
|
||||
mIsDefined = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
ColorTextAttr::GetValueFor(nsIContent* aContent, nscolor* aValue)
|
||||
{
|
||||
nsIFrame* frame = aContent->GetPrimaryFrame();
|
||||
if (frame) {
|
||||
*aValue = frame->GetStyleColor()->mColor;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
ColorTextAttr::Format(const nscolor& aValue, nsAString& aFormattedValue)
|
||||
{
|
||||
nsAutoString value;
|
||||
StyleInfo::FormatColor(aValue, value);
|
||||
aFormattedValue = value;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// FontFamilyTextAttr
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
FontFamilyTextAttr::FontFamilyTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame) :
|
||||
nsTextAttr<nsAutoString>(aFrame == nsnull)
|
||||
{
|
||||
mIsRootDefined = GetFontFamily(aRootFrame, mRootNativeValue);
|
||||
|
||||
if (aFrame)
|
||||
mIsDefined = GetFontFamily(aFrame, mNativeValue);
|
||||
}
|
||||
|
||||
bool
|
||||
FontFamilyTextAttr::GetValueFor(nsIContent* aElm, nsAutoString* aValue)
|
||||
{
|
||||
nsIFrame* frame = aElm->GetPrimaryFrame();
|
||||
if (!frame)
|
||||
return false;
|
||||
|
||||
return GetFontFamily(frame, *aValue);
|
||||
}
|
||||
|
||||
void
|
||||
FontFamilyTextAttr::Format(const nsAutoString& aValue,
|
||||
nsAString& aFormattedValue)
|
||||
{
|
||||
aFormattedValue = aValue;
|
||||
}
|
||||
|
||||
bool
|
||||
FontFamilyTextAttr::GetFontFamily(nsIFrame* aFrame, nsAutoString& aFamily)
|
||||
{
|
||||
nsRefPtr<nsFontMetrics> fm;
|
||||
nsLayoutUtils::GetFontMetricsForFrame(aFrame, getter_AddRefs(fm));
|
||||
|
||||
gfxFontGroup* fontGroup = fm->GetThebesFontGroup();
|
||||
gfxFont* font = fontGroup->GetFontAt(0);
|
||||
gfxFontEntry* fontEntry = font->GetFontEntry();
|
||||
aFamily = fontEntry->FamilyName();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsFontSizeTextAttr
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@ -450,7 +524,7 @@ nsFontSizeTextAttr::GetValueFor(nsIContent *aContent, nscoord *aValue)
|
||||
nsIFrame *frame = aContent->GetPrimaryFrame();
|
||||
if (!frame)
|
||||
return false;
|
||||
|
||||
|
||||
*aValue = GetFontSize(frame);
|
||||
return true;
|
||||
}
|
||||
@ -462,7 +536,7 @@ nsFontSizeTextAttr::Format(const nscoord& aValue, nsAString& aFormattedValue)
|
||||
//
|
||||
// Note: according to IA2, "The conversion doesn't have to be exact.
|
||||
// The intent is to give the user a feel for the size of the text."
|
||||
//
|
||||
//
|
||||
// ATK does not specify a unit and will likely follow IA2 here.
|
||||
//
|
||||
// XXX todo: consider sharing this code with layout module? (bug 474621)
|
||||
@ -484,6 +558,41 @@ nsFontSizeTextAttr::GetFontSize(nsIFrame *aFrame)
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// FontStyleTextAttr
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
FontStyleTextAttr::FontStyleTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame) :
|
||||
nsTextAttr<nscoord>(!aFrame)
|
||||
{
|
||||
mRootNativeValue = aRootFrame->GetStyleFont()->mFont.style;
|
||||
mIsRootDefined = true;
|
||||
|
||||
if (aFrame) {
|
||||
mNativeValue = aFrame->GetStyleFont()->mFont.style;
|
||||
mIsDefined = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
FontStyleTextAttr::GetValueFor(nsIContent* aContent, nscoord* aValue)
|
||||
{
|
||||
nsIFrame* frame = aContent->GetPrimaryFrame();
|
||||
if (frame) {
|
||||
*aValue = frame->GetStyleFont()->mFont.style;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
FontStyleTextAttr::Format(const nscoord& aValue, nsAString& aFormattedValue)
|
||||
{
|
||||
StyleInfo::FormatFontStyle(aValue, aFormattedValue);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// nsFontWeightTextAttr
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -41,17 +41,10 @@
|
||||
|
||||
class nsHyperTextAccessible;
|
||||
|
||||
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIDOMElement.h"
|
||||
|
||||
#include "nsIContent.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIPersistentProperties2.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsString.h"
|
||||
|
||||
class nsITextAttr;
|
||||
|
||||
/**
|
||||
@ -100,7 +93,6 @@ public:
|
||||
PRInt32 *aEndHTOffset = nsnull);
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
* Calculates range (start and end offsets) of text where the text attributes
|
||||
* are stretched. New offsets may be smaller if one of text attributes changes
|
||||
@ -307,6 +299,49 @@ private:
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Class is used for the work with 'color' text attribute in nsTextAttrsMgr
|
||||
* class.
|
||||
*/
|
||||
class ColorTextAttr : public nsTextAttr<nscolor>
|
||||
{
|
||||
public:
|
||||
ColorTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame);
|
||||
|
||||
// nsITextAttr
|
||||
virtual nsIAtom* GetName() const { return nsGkAtoms::color; }
|
||||
|
||||
protected:
|
||||
// nsTextAttr
|
||||
virtual bool GetValueFor(nsIContent* aContent, nscolor* aValue);
|
||||
virtual void Format(const nscolor& aValue, nsAString& aFormattedValue);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Class is used for the work with "font-family" text attribute in
|
||||
* nsTextAttrsMgr class.
|
||||
*/
|
||||
class FontFamilyTextAttr : public nsTextAttr<nsAutoString>
|
||||
{
|
||||
public:
|
||||
FontFamilyTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame);
|
||||
|
||||
// nsITextAttr
|
||||
virtual nsIAtom* GetName() const { return nsGkAtoms::font_family; }
|
||||
|
||||
protected:
|
||||
|
||||
// nsTextAttr
|
||||
virtual bool GetValueFor(nsIContent* aContent, nsAutoString* aValue);
|
||||
virtual void Format(const nsAutoString& aValue, nsAString& aFormattedValue);
|
||||
|
||||
private:
|
||||
|
||||
bool GetFontFamily(nsIFrame* aFrame, nsAutoString& aFamily);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Class is used for the work with "font-size" text attribute in nsTextAttrsMgr
|
||||
* class.
|
||||
@ -339,6 +374,26 @@ private:
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Class is used for the work with "font-style" text attribute in nsTextAttrsMgr
|
||||
* class.
|
||||
*/
|
||||
class FontStyleTextAttr : public nsTextAttr<nscoord>
|
||||
{
|
||||
public:
|
||||
FontStyleTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame);
|
||||
|
||||
// nsITextAttr
|
||||
virtual nsIAtom* GetName() const { return nsGkAtoms::font_style; }
|
||||
|
||||
protected:
|
||||
|
||||
// nsTextAttr
|
||||
virtual bool GetValueFor(nsIContent* aContent, nscoord* aValue);
|
||||
virtual void Format(const nscoord &aValue, nsAString &aFormattedValue);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Class is used for the work with "font-weight" text attribute in
|
||||
* nsTextAttrsMgr class.
|
||||
|
@ -46,7 +46,6 @@
|
||||
|
||||
#include "AccCollector.h"
|
||||
#include "nsAccessibleWrap.h"
|
||||
#include "nsTextAttrs.h"
|
||||
|
||||
#include "nsFrameSelection.h"
|
||||
#include "nsISelectionController.h"
|
||||
|
@ -45,6 +45,8 @@
|
||||
|
||||
#include "nsHyperTextAccessible.h"
|
||||
|
||||
#include "nsIPersistentProperties2.h"
|
||||
|
||||
// IUnknown
|
||||
|
||||
STDMETHODIMP
|
||||
|
@ -208,6 +208,39 @@ const kBoldFontWeight =
|
||||
const kInputFontSize = WIN ?
|
||||
"10pt" : (MAC ? "8pt" : function() { return true; });
|
||||
|
||||
const kAbsentFontFamily =
|
||||
function(aFontFamily) { return aFontFamily != "sans-serif"; }
|
||||
const kInputFontFamily =
|
||||
function(aFontFamily) { return aFontFamily != "sans-serif"; }
|
||||
|
||||
const kMonospaceFontFamily =
|
||||
function(aFontFamily) { return aFontFamily != "monospace"; }
|
||||
const kSansSerifFontFamily =
|
||||
function(aFontFamily) { return aFontFamily != "sans-serif"; }
|
||||
const kSerifFontFamily =
|
||||
function(aFontFamily) { return aFontFamily != "serif"; }
|
||||
|
||||
const kCursiveFontFamily = WIN ? "Comic Sans MS" :
|
||||
(LINUX ? "DejaVu Serif" : "MacFont");
|
||||
|
||||
/**
|
||||
* Return used font from the given computed style.
|
||||
*/
|
||||
function fontFamily(aComputedStyle)
|
||||
{
|
||||
var name = aComputedStyle.fontFamily;
|
||||
switch (name) {
|
||||
case "monospace":
|
||||
return kMonospaceFontFamily;
|
||||
case "sans-serif":
|
||||
return kSansSerifFontFamily;
|
||||
case "serif":
|
||||
return kSerifFontFamily;
|
||||
default:
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build an object of default text attributes expected for the given accessible.
|
||||
*
|
||||
@ -216,7 +249,7 @@ const kInputFontSize = WIN ?
|
||||
* @param aFontWeight [in, optional] kBoldFontWeight or kNormalFontWeight,
|
||||
* default value is kNormalFontWeight
|
||||
*/
|
||||
function buildDefaultTextAttrs(aID, aFontSize, aFontWeight)
|
||||
function buildDefaultTextAttrs(aID, aFontSize, aFontWeight, aFontFamily)
|
||||
{
|
||||
var elm = getNode(aID);
|
||||
var computedStyle = document.defaultView.getComputedStyle(elm, "");
|
||||
@ -229,7 +262,7 @@ function buildDefaultTextAttrs(aID, aFontSize, aFontWeight)
|
||||
"background-color": bgColor,
|
||||
"font-weight": aFontWeight ? aFontWeight : kNormalFontWeight,
|
||||
"color": computedStyle.color,
|
||||
"font-family": computedStyle.fontFamily,
|
||||
"font-family": aFontFamily ? aFontFamily : fontFamily(computedStyle),
|
||||
"text-position": computedStyle.verticalAlign
|
||||
};
|
||||
|
||||
|
@ -263,7 +263,7 @@
|
||||
// Walk from span with font-style to the one with font-family.
|
||||
tempElem = tempElem.nextSibling.nextSibling;
|
||||
gComputedStyle = document.defaultView.getComputedStyle(tempElem, "");
|
||||
attrs = { "font-family": gComputedStyle.fontFamily };
|
||||
attrs = { "font-family": kMonospaceFontFamily };
|
||||
testTextAttrs(ID, 70, attrs, defAttrs, 69, 83);
|
||||
|
||||
attrs = {};
|
||||
@ -281,6 +281,7 @@
|
||||
attrs = {};
|
||||
testTextAttrs(ID, 123, attrs, defAttrs, 122, 130);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// area10, different single style spans in non-styled paragraph
|
||||
ID = "area10";
|
||||
defAttrs = buildDefaultTextAttrs(ID, "12pt");
|
||||
@ -316,7 +317,7 @@
|
||||
// Walk from span with font-style to the one with font-family.
|
||||
tempElem = tempElem.nextSibling.nextSibling;
|
||||
gComputedStyle = document.defaultView.getComputedStyle(tempElem, "");
|
||||
attrs = {"font-family": gComputedStyle.fontFamily};
|
||||
attrs = { "font-family": kMonospaceFontFamily };
|
||||
testTextAttrs(ID, 71, attrs, defAttrs, 70, 84);
|
||||
|
||||
attrs = {};
|
||||
@ -334,6 +335,7 @@
|
||||
attrs = {};
|
||||
testTextAttrs(ID, 124, attrs, defAttrs, 123, 131);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// area11, "font-weight" tests
|
||||
ID = "area11";
|
||||
defAttrs = buildDefaultTextAttrs(ID, "12pt", kBoldFontWeight);
|
||||
@ -373,7 +375,8 @@
|
||||
testTextAttrs(ID, 0, attrs, defAttrs, 0, 0);
|
||||
|
||||
ID = "area14";
|
||||
defAttrs = buildDefaultTextAttrs(ID, kInputFontSize);
|
||||
defAttrs = buildDefaultTextAttrs(ID, kInputFontSize,
|
||||
kNormalFontWeight, kInputFontFamily);
|
||||
|
||||
attrs = { };
|
||||
testTextAttrs(ID, 0, attrs, defAttrs, 0, 0);
|
||||
@ -404,6 +407,36 @@
|
||||
// p
|
||||
testTextAttrs(ID, 23, { }, { }, 23, 24);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// area16, "font-family" tests
|
||||
ID = "area16";
|
||||
defAttrs = buildDefaultTextAttrs(ID, "12pt");
|
||||
testDefaultTextAttrs(ID, defAttrs);
|
||||
|
||||
attrs = { "font-family": kMonospaceFontFamily };
|
||||
testTextAttrs(ID, 0, attrs, defAttrs, 0, 4);
|
||||
|
||||
attrs = { };
|
||||
testTextAttrs(ID, 4, attrs, defAttrs, 4, 9);
|
||||
|
||||
attrs = { "font-family": kSerifFontFamily };
|
||||
testTextAttrs(ID, 9, attrs, defAttrs, 9, 13);
|
||||
|
||||
attrs = { };
|
||||
testTextAttrs(ID, 13, attrs, defAttrs, 13, 18);
|
||||
|
||||
attrs = { "font-family": kAbsentFontFamily };
|
||||
testTextAttrs(ID, 18, attrs, defAttrs, 18, 22);
|
||||
|
||||
attrs = { };
|
||||
testTextAttrs(ID, 22, attrs, defAttrs, 22, 27);
|
||||
|
||||
attrs = { "font-family": kCursiveFontFamily };
|
||||
testTextAttrs(ID, 27, attrs, defAttrs, 27, 31);
|
||||
|
||||
attrs = { };
|
||||
testTextAttrs(ID, 31, attrs, defAttrs, 31, 45);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
@ -417,6 +450,11 @@
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=345759"
|
||||
title="Implement text attributes">
|
||||
Mozilla Bug 345759
|
||||
</a><br>
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=473576"
|
||||
title="font-family text attribute should expose actual font used">
|
||||
Mozilla Bug 473576
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
@ -469,7 +507,7 @@
|
||||
<span style="font-size: 120%">bigger</span> smaller
|
||||
<span style="background-color: blue;">background blue</span> normal
|
||||
<span style="font-style: italic;">Different styling</span> normal
|
||||
<span style="font-family: tahoma;">Different font</span> normal
|
||||
<span style="font-family: monospace;">Different font</span> normal
|
||||
<span style="text-decoration: underline;">underlined</span> normal
|
||||
<span style="text-decoration: line-through;">strikethrough</span> normal
|
||||
</p>
|
||||
@ -478,7 +516,7 @@
|
||||
<span style="font-size: 120%">bigger</span> smaller
|
||||
<span style="background-color: blue;">background blue</span> normal
|
||||
<span style="font-style: italic;">Different styling</span> normal
|
||||
<span style="font-family: tahoma;">Different font</span> normal
|
||||
<span style="font-family: monospace;">Different font</span> normal
|
||||
<span style="text-decoration: underline;">underlined</span> normal
|
||||
<span style="text-decoration: line-through;">strikethrough</span> normal
|
||||
</p>
|
||||
@ -500,5 +538,13 @@
|
||||
|
||||
<!-- *plain*plain**bold*bold*-->
|
||||
<div id="area15"><p>embed</p>plain<p>embed</p>plain<p>embed</p><img src="../moz.png" alt="image"/><b>bold</b><p>embed</p><b>bold</b><p>embed</p></div>
|
||||
|
||||
<p id="area16" style="font-family: sans-serif;">
|
||||
<span style="font-family: monospace;">text</span>text
|
||||
<span style="font-family: serif;">text</span>text
|
||||
<span style="font-family: BodoniThatDoesntExist;">text</span>text
|
||||
<span style="font-family: Comic Sans MS, cursive;">text</span>text
|
||||
<span style="font-family: sans-serif, fantasy;">text</span>text
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -65,6 +65,7 @@ _TEST_FILES =\
|
||||
test_focus_aria_activedescendant.html \
|
||||
test_focus_autocomplete.xul \
|
||||
test_focus_browserui.xul \
|
||||
test_focus_canvas.html \
|
||||
test_focus_contextmenu.xul \
|
||||
test_focus_controls.html \
|
||||
test_focus_dialog.html \
|
||||
|
59
accessible/tests/mochitest/events/test_focus_canvas.html
Normal file
59
accessible/tests/mochitest/events/test_focus_canvas.html
Normal file
@ -0,0 +1,59 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Accessible focus testing in canvas subdom</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="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../events.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
//gA11yEventDumpToConsole = true;
|
||||
|
||||
var gQueue = null;
|
||||
function doTests()
|
||||
{
|
||||
gQueue = new eventQueue();
|
||||
|
||||
gQueue.push(new synthFocus("button"));
|
||||
gQueue.push(new synthTab("button", new focusChecker("textbox")));
|
||||
|
||||
gQueue.invoke(); // Will call SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTests);
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<a target="_blank"
|
||||
title="Expose content in Canvas element"
|
||||
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>
|
||||
<input id="button" type="button">
|
||||
<input id="textbox">
|
||||
</canvas>
|
||||
|
||||
<div id="eventdump"></div>
|
||||
</body>
|
||||
</html>
|
@ -49,7 +49,9 @@
|
||||
|
||||
this.finalCheck = function spelledTextInvoker_finalCheck()
|
||||
{
|
||||
var defAttrs = buildDefaultTextAttrs(this.DOMNode, kInputFontSize);
|
||||
var defAttrs = buildDefaultTextAttrs(this.DOMNode, kInputFontSize,
|
||||
kNormalFontWeight,
|
||||
kInputFontFamily);
|
||||
testDefaultTextAttrs(aID, defAttrs);
|
||||
|
||||
var attrs = { };
|
||||
|
@ -18,13 +18,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=495912
|
||||
<script type="application/javascript">
|
||||
function doTest()
|
||||
{
|
||||
var accTree = {
|
||||
role: ROLE_CANVAS,
|
||||
children: [
|
||||
]
|
||||
};
|
||||
testAccessibleTree("canvas", accTree);
|
||||
var accTree =
|
||||
{ CANVAS: [
|
||||
{ CHECKBUTTON: [] },
|
||||
{ ENTRY: [] }
|
||||
] };
|
||||
|
||||
testAccessibleTree("canvas", accTree);
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
@ -42,9 +42,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=495912
|
||||
<pre id="test">
|
||||
</pre>
|
||||
|
||||
<canvas id="canvas" tabindex="0">
|
||||
fallback content.
|
||||
</canvas>
|
||||
<canvas id="canvas" tabindex="0"><input type="checkbox"><input></canvas>
|
||||
|
||||
<script type="text/javascript">
|
||||
var c=document.getElementById("canvas");
|
||||
|
@ -47,6 +47,7 @@ include $(topsrcdir)/config/rules.mk
|
||||
|
||||
_TEST_FILES =\
|
||||
test_ariadialog.html \
|
||||
test_canvas.html \
|
||||
test_colorpicker.xul \
|
||||
test_cssoverflow.html \
|
||||
test_contextmenu.xul \
|
||||
|
92
accessible/tests/mochitest/treeupdate/test_canvas.html
Normal file
92
accessible/tests/mochitest/treeupdate/test_canvas.html
Normal file
@ -0,0 +1,92 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Canvas subdom mutation</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"
|
||||
src="../events.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Invokers
|
||||
|
||||
function addSubtree(aID)
|
||||
{
|
||||
this.node = getNode(aID);
|
||||
|
||||
this.eventSeq = [
|
||||
new invokerChecker(EVENT_SHOW, this.node)
|
||||
];
|
||||
|
||||
this.invoke = function addSubtree_invoke()
|
||||
{
|
||||
// ensure we start with no subtree
|
||||
testAccessibleTree("canvas", { CANVAS: [] });
|
||||
getNode("dialog").style.display = "block";
|
||||
}
|
||||
|
||||
this.finalCheck = function addSubtree_finalCheck() {
|
||||
testAccessibleTree("dialog", { DIALOG: [] });
|
||||
}
|
||||
|
||||
this.getID = function addSubtree_getID()
|
||||
{
|
||||
return "show canvas subdom";
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Test
|
||||
|
||||
//gA11yEventDumpID = "eventdump"; // debug stuff
|
||||
//gA11yEventDumpToConsole = true;
|
||||
|
||||
var gQueue = null;
|
||||
|
||||
function doTest()
|
||||
{
|
||||
gQueue = new eventQueue();
|
||||
|
||||
// make the subdom come alive!
|
||||
gQueue.push(new addSubtree("dialog"));
|
||||
|
||||
gQueue.invoke(); // SimpleTest.finish() will be called in the end
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a target="_blank"
|
||||
title="Expose content in Canvas element"
|
||||
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">
|
||||
<div id="dialog" role="dialog" style="display: none;">
|
||||
</div>
|
||||
</canvas>
|
||||
|
||||
<div id="eventdump"></div>
|
||||
</body>
|
||||
</html>
|
@ -410,6 +410,10 @@ pref("dom.mozBrowserFramesWhitelist", "http://localhost:7777");
|
||||
pref("dom.sms.enabled", true);
|
||||
pref("dom.sms.whitelist", "file://,http://localhost:7777");
|
||||
|
||||
// Temporary permission hack for WebContacts
|
||||
pref("dom.mozContacts.enabled", true);
|
||||
pref("dom.mozContacts.whitelist", "http://localhost:7777");
|
||||
|
||||
// Ignore X-Frame-Options headers.
|
||||
pref("b2g.ignoreXFrameOptions", true);
|
||||
|
||||
|
@ -1,165 +0,0 @@
|
||||
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /
|
||||
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/**
|
||||
* Command Updater
|
||||
*/
|
||||
let CommandUpdater = {
|
||||
/**
|
||||
* Gets a controller that can handle a particular command.
|
||||
* @param {string} command
|
||||
* A command to locate a controller for, preferring controllers that
|
||||
* show the command as enabled.
|
||||
* @return {object} In this order of precedence:
|
||||
* - the first controller supporting the specified command
|
||||
* associated with the focused element that advertises the
|
||||
* command as ENABLED.
|
||||
* - the first controller supporting the specified command
|
||||
* associated with the global window that advertises the
|
||||
* command as ENABLED.
|
||||
* - the first controller supporting the specified command
|
||||
* associated with the focused element.
|
||||
* - the first controller supporting the specified command
|
||||
* associated with the global window.
|
||||
*/
|
||||
_getControllerForCommand: function(command) {
|
||||
try {
|
||||
let commandDispatcher = top.document.commandDispatcher;
|
||||
let controller = commandDispatcher.getControllerForCommand(command);
|
||||
if (controller && controller.isCommandEnabled(command))
|
||||
return controller;
|
||||
}
|
||||
catch (e) { }
|
||||
|
||||
let controllerCount = window.controllers.getControllerCount();
|
||||
for (let i = 0; i < controllerCount; ++i) {
|
||||
let current = window.controllers.getControllerAt(i);
|
||||
try {
|
||||
if (current.supportsCommand(command) &&
|
||||
current.isCommandEnabled(command))
|
||||
return current;
|
||||
}
|
||||
catch (e) { }
|
||||
}
|
||||
return controller || window.controllers.getControllerForCommand(command);
|
||||
},
|
||||
|
||||
/**
|
||||
* Updates the state of a XUL <command> element for the specified command
|
||||
* depending on its state.
|
||||
* @param {string} command
|
||||
* The name of the command to update the XUL <command> element for.
|
||||
*/
|
||||
updateCommand: function(command) {
|
||||
let enabled = false;
|
||||
try {
|
||||
let controller = this._getControllerForCommand(command);
|
||||
if (controller) {
|
||||
enabled = controller.isCommandEnabled(command);
|
||||
}
|
||||
}
|
||||
catch (ex) { }
|
||||
|
||||
this.enableCommand(command, enabled);
|
||||
},
|
||||
|
||||
/**
|
||||
* Updates the state of a XUL <command> element for the specified command
|
||||
* depending on its state.
|
||||
* @param {string} command
|
||||
* The name of the command to update the XUL <command> element for.
|
||||
*/
|
||||
updateCommands: function(_commands) {
|
||||
let commands = _commands.split(',');
|
||||
for (let command in commands) {
|
||||
this.updateCommand(commands[command]);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Enables or disables a XUL <command> element.
|
||||
* @param {string} command
|
||||
* The name of the command to enable or disable.
|
||||
* @param {bool} enabled
|
||||
* true if the command should be enabled, false otherwise.
|
||||
*/
|
||||
enableCommand: function(command, enabled) {
|
||||
let element = document.getElementById(command);
|
||||
if (!element)
|
||||
return;
|
||||
|
||||
if (enabled)
|
||||
element.removeAttribute('disabled');
|
||||
else
|
||||
element.setAttribute('disabled', 'true');
|
||||
},
|
||||
|
||||
/**
|
||||
* Performs the action associated with a specified command using the most
|
||||
* relevant controller.
|
||||
* @param {string} command
|
||||
* The command to perform.
|
||||
*/
|
||||
doCommand: function(command) {
|
||||
let controller = this._getControllerForCommand(command);
|
||||
if (!controller)
|
||||
return;
|
||||
controller.doCommand(command);
|
||||
},
|
||||
|
||||
/**
|
||||
* Changes the label attribute for the specified command.
|
||||
* @param {string} command
|
||||
* The command to update.
|
||||
* @param {string} labelAttribute
|
||||
* The label value to use.
|
||||
*/
|
||||
setMenuValue: function(command, labelAttribute) {
|
||||
let commandNode = top.document.getElementById(command);
|
||||
if (commandNode) {
|
||||
let label = commandNode.getAttribute(labelAttribute);
|
||||
if (label)
|
||||
commandNode.setAttribute('label', label);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Changes the accesskey attribute for the specified command.
|
||||
* @param {string} command
|
||||
* The command to update.
|
||||
* @param {string} valueAttribute
|
||||
* The value attribute to use.
|
||||
*/
|
||||
setAccessKey: function(command, valueAttribute) {
|
||||
let commandNode = top.document.getElementById(command);
|
||||
if (commandNode) {
|
||||
let value = commandNode.getAttribute(valueAttribute);
|
||||
if (value)
|
||||
commandNode.setAttribute('accesskey', value);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Inform all the controllers attached to a node that an event has occurred
|
||||
* (e.g. the tree controllers need to be informed of blur events so that they
|
||||
* can change some of the menu items back to their default values)
|
||||
* @param {node} node
|
||||
* The node receiving the event.
|
||||
* @param {event} event
|
||||
* The event.
|
||||
*/
|
||||
onEvent: function(node, event) {
|
||||
let numControllers = node.controllers.getControllerCount();
|
||||
let controller;
|
||||
|
||||
for (let i = 0; i < numControllers; i++) {
|
||||
controller = node.controllers.getControllerAt(i);
|
||||
if (controller)
|
||||
controller.onEvent(event);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -16,6 +16,7 @@ const LocalFile = CC('@mozilla.org/file/local;1',
|
||||
|
||||
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
|
||||
Cu.import('resource://gre/modules/Services.jsm');
|
||||
Cu.import('resource://gre/modules/ContactService.jsm');
|
||||
|
||||
XPCOMUtils.defineLazyGetter(Services, 'env', function() {
|
||||
return Cc['@mozilla.org/process/environment;1']
|
||||
@ -32,11 +33,15 @@ XPCOMUtils.defineLazyGetter(Services, 'idle', function() {
|
||||
.getService(Ci.nsIIdleService);
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(Services, 'fm', function(){
|
||||
return Cc['@mozilla.org/focus-managr;1']
|
||||
.getService(Ci.nsFocusManager);
|
||||
XPCOMUtils.defineLazyGetter(Services, 'audioManager', function() {
|
||||
return Cc['@mozilla.org/telephony/audiomanager;1']
|
||||
.getService(Ci.nsIAudioManager);
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(Services, 'fm', function() {
|
||||
return Cc['@mozilla.org/focus-manager;1']
|
||||
.getService(Ci.nsFocusManager);
|
||||
});
|
||||
|
||||
#ifndef MOZ_WIDGET_GONK
|
||||
// In order to use http:// scheme instead of file:// scheme
|
||||
@ -60,7 +65,7 @@ function startupHttpd(baseDir, port) {
|
||||
// XXX never grant 'content-camera' to non-gaia apps
|
||||
function addPermissions(urls) {
|
||||
let permissions = [
|
||||
'indexedDB', 'indexedDB-unlimited', 'webapps-manage', 'offline-app', 'content-camera'
|
||||
'indexedDB', 'indexedDB-unlimited', 'webapps-manage', 'offline-app', 'content-camera', 'webcontacts-manage'
|
||||
];
|
||||
urls.forEach(function(url) {
|
||||
let uri = Services.io.newURI(url, null, null);
|
||||
@ -73,9 +78,6 @@ function addPermissions(urls) {
|
||||
}
|
||||
|
||||
var shell = {
|
||||
// FIXME/bug 678695: this should be a system setting
|
||||
preferredScreenBrightness: 1.0,
|
||||
|
||||
isDebug: false,
|
||||
|
||||
get contentBrowser() {
|
||||
@ -110,13 +112,23 @@ var shell = {
|
||||
return alert(msg);
|
||||
}
|
||||
|
||||
window.controllers.appendController(this);
|
||||
window.addEventListener('keypress', this);
|
||||
['keydown', 'keypress', 'keyup'].forEach((function listenKey(type) {
|
||||
window.addEventListener(type, this, false, true);
|
||||
window.addEventListener(type, this, true, true);
|
||||
}).bind(this));
|
||||
|
||||
window.addEventListener('MozApplicationManifest', this);
|
||||
window.addEventListener("AppCommand", this);
|
||||
window.addEventListener('mozfullscreenchange', this);
|
||||
this.contentBrowser.addEventListener('load', this, true);
|
||||
|
||||
// Until the volume can be set from the content side, set it to a
|
||||
// a specific value when the device starts. This way the front-end
|
||||
// can display a notification when the volume change and show a volume
|
||||
// level modified from this point.
|
||||
try {
|
||||
Services.audioManager.masterVolume = 0.5;
|
||||
} catch(e) {}
|
||||
|
||||
try {
|
||||
Services.io.offline = false;
|
||||
|
||||
@ -158,35 +170,8 @@ var shell = {
|
||||
},
|
||||
|
||||
stop: function shell_stop() {
|
||||
window.controllers.removeController(this);
|
||||
window.removeEventListener('keypress', this);
|
||||
window.removeEventListener('MozApplicationManifest', this);
|
||||
window.removeEventListener('AppCommand', this);
|
||||
},
|
||||
|
||||
supportsCommand: function shell_supportsCommand(cmd) {
|
||||
let isSupported = false;
|
||||
switch (cmd) {
|
||||
case 'cmd_close':
|
||||
isSupported = true;
|
||||
break;
|
||||
default:
|
||||
isSupported = false;
|
||||
break;
|
||||
}
|
||||
return isSupported;
|
||||
},
|
||||
|
||||
isCommandEnabled: function shell_isCommandEnabled(cmd) {
|
||||
return true;
|
||||
},
|
||||
|
||||
doCommand: function shell_doCommand(cmd) {
|
||||
switch (cmd) {
|
||||
case 'cmd_close':
|
||||
content.postMessage('appclose', '*');
|
||||
break;
|
||||
}
|
||||
window.removeEventListener('mozfullscreenchange', this);
|
||||
},
|
||||
|
||||
toggleDebug: function shell_toggleDebug() {
|
||||
@ -201,9 +186,7 @@ var shell = {
|
||||
}
|
||||
},
|
||||
|
||||
changeVolume: function shell_changeVolume(aDelta) {
|
||||
let audioManager = Cc["@mozilla.org/telephony/audiomanager;1"].getService(Ci.nsIAudioManager);
|
||||
|
||||
changeVolume: function shell_changeVolume(delta) {
|
||||
let steps = 10;
|
||||
try {
|
||||
steps = Services.prefs.getIntPref("media.volume.steps");
|
||||
@ -211,7 +194,11 @@ var shell = {
|
||||
steps = 1;
|
||||
} catch(e) {}
|
||||
|
||||
let volume = audioManager.masterVolume + aDelta / steps;
|
||||
let audioManager = Services.audioManager;
|
||||
if (!audioManager)
|
||||
return;
|
||||
|
||||
let volume = audioManager.masterVolume + delta / steps;
|
||||
if (volume > 1)
|
||||
volume = 1;
|
||||
if (volume < 0)
|
||||
@ -219,44 +206,58 @@ var shell = {
|
||||
audioManager.masterVolume = volume;
|
||||
},
|
||||
|
||||
forwardKeyToHomescreen: function shell_forwardKeyToHomescreen(evt) {
|
||||
let generatedEvent = content.document.createEvent('KeyboardEvent');
|
||||
generatedEvent.initKeyEvent(evt.type, true, true, evt.view, evt.ctrlKey,
|
||||
evt.altKey, evt.shiftKey, evt.metaKey,
|
||||
evt.keyCode, evt.charCode);
|
||||
|
||||
content.dispatchEvent(generatedEvent);
|
||||
},
|
||||
|
||||
handleEvent: function shell_handleEvent(evt) {
|
||||
switch (evt.type) {
|
||||
case 'keydown':
|
||||
case 'keyup':
|
||||
case 'keypress':
|
||||
switch (evt.keyCode) {
|
||||
case evt.DOM_VK_HOME:
|
||||
this.sendEvent(content, 'home');
|
||||
break;
|
||||
case evt.DOM_VK_SLEEP:
|
||||
this.toggleScreen();
|
||||
|
||||
let details = {
|
||||
'enabled': screen.mozEnabled
|
||||
};
|
||||
this.sendEvent(content, 'sleep', details);
|
||||
break;
|
||||
case evt.DOM_VK_ESCAPE:
|
||||
if (evt.defaultPrevented)
|
||||
return;
|
||||
this.doCommand('cmd_close');
|
||||
break;
|
||||
// If the home key is pressed, always forward it to the homescreen
|
||||
if (evt.eventPhase == evt.CAPTURING_PHASE) {
|
||||
if (evt.keyCode == evt.VK_DOM_HOME) {
|
||||
window.setTimeout(this.forwardKeyToHomescreen, 0, evt);
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 'AppCommand':
|
||||
switch (evt.command) {
|
||||
case 'Menu':
|
||||
if (Services.prefs.getBoolPref('b2g.keys.menu.enabled'))
|
||||
this.sendEvent(content, 'menu');
|
||||
break;
|
||||
case 'Search':
|
||||
if (Services.prefs.getBoolPref('b2g.keys.search.enabled'))
|
||||
this.toggleDebug();
|
||||
break;
|
||||
case 'VolumeUp':
|
||||
this.changeVolume(1);
|
||||
break;
|
||||
case 'VolumeDown':
|
||||
this.changeVolume(-1);
|
||||
break;
|
||||
|
||||
// If one of the other keys is used in an application and is
|
||||
// cancelled via preventDefault, do nothing.
|
||||
let homescreen = (evt.target.ownerDocument.defaultView == content);
|
||||
if (!homescreen && evt.defaultPrevented)
|
||||
return;
|
||||
|
||||
// If one of the other keys is used in an application and is
|
||||
// not used forward it to the homescreen
|
||||
if (!homescreen)
|
||||
window.setTimeout(this.forwardKeyToHomescreen, 0, evt);
|
||||
|
||||
// For debug purposes and because some of the APIs are not yet exposed
|
||||
// to the content, let's react on some of the keyup events.
|
||||
if (evt.type == 'keyup') {
|
||||
switch (evt.keyCode) {
|
||||
case evt.DOM_VK_F5:
|
||||
if (Services.prefs.getBoolPref('b2g.keys.search.enabled'))
|
||||
this.toggleDebug();
|
||||
break;
|
||||
|
||||
case evt.DOM_VK_PAGE_DOWN:
|
||||
this.changeVolume(-1);
|
||||
break;
|
||||
|
||||
case evt.DOM_VK_PAGE_UP:
|
||||
this.changeVolume(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@ -269,7 +270,6 @@ var shell = {
|
||||
break;
|
||||
case 'load':
|
||||
this.contentBrowser.removeEventListener('load', this, true);
|
||||
this.turnScreenOn();
|
||||
|
||||
let chromeWindow = window.QueryInterface(Ci.nsIDOMChromeWindow);
|
||||
chromeWindow.browserDOMWindow = new nsBrowserAccess();
|
||||
@ -316,20 +316,6 @@ var shell = {
|
||||
let event = content.document.createEvent('CustomEvent');
|
||||
event.initCustomEvent(type, true, true, details ? details : {});
|
||||
content.dispatchEvent(event);
|
||||
},
|
||||
toggleScreen: function shell_toggleScreen() {
|
||||
if (screen.mozEnabled)
|
||||
this.turnScreenOff();
|
||||
else
|
||||
this.turnScreenOn();
|
||||
},
|
||||
turnScreenOff: function shell_turnScreenOff() {
|
||||
screen.mozEnabled = false;
|
||||
screen.mozBrightness = 0.0;
|
||||
},
|
||||
turnScreenOn: function shell_turnScreenOn() {
|
||||
screen.mozEnabled = true;
|
||||
screen.mozBrightness = this.preferredScreenBrightness;
|
||||
}
|
||||
};
|
||||
|
||||
@ -338,7 +324,7 @@ var shell = {
|
||||
observe: function(subject, topic, time) {
|
||||
if (topic === "idle") {
|
||||
// TODO: Check wakelock status. See bug 697132.
|
||||
shell.turnScreenOff();
|
||||
screen.mozEnabled = false;
|
||||
}
|
||||
},
|
||||
}
|
||||
|
@ -15,7 +15,6 @@
|
||||
onload="shell.start();"
|
||||
onunload="shell.stop();">
|
||||
|
||||
<script type="application/javascript" src="chrome://browser/content/commandUtil.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/shell.js"/>
|
||||
#ifndef MOZ_TOUCH
|
||||
<script type="application/javascript" src="chrome://browser/content/touch.js"/>
|
||||
@ -24,10 +23,6 @@
|
||||
<script type="application/javascript" src="chrome://browser/content/httpd.js"/>
|
||||
#endif
|
||||
|
||||
<commandset id="mainCommandSet">
|
||||
<command id="cmd_close" oncommand="CommandUpdater.doCommand(this.id);"/>
|
||||
</commandset>
|
||||
|
||||
<browser id="homescreen"
|
||||
type="content-primary"
|
||||
flex="1"
|
||||
|
@ -9,7 +9,6 @@ chrome.jar:
|
||||
#ifndef MOZ_TOUCH
|
||||
content/touch.js (content/touch.js)
|
||||
#endif
|
||||
content/commandUtil.js (content/commandUtil.js)
|
||||
#ifndef MOZ_WIDGET_GONK
|
||||
content/httpd.js (content/httpd.js)
|
||||
#endif
|
||||
@ -22,4 +21,4 @@ chrome.jar:
|
||||
content/netError.css (content/netError.css)
|
||||
content/images/errorpage-larry-black.png (content/images/errorpage-larry-black.png)
|
||||
content/images/errorpage-larry-white.png (content/images/errorpage-larry-white.png)
|
||||
content/images/errorpage-warning.png (content/images/errorpage-warning.png)
|
||||
content/images/errorpage-warning.png (content/images/errorpage-warning.png)
|
||||
|
@ -155,6 +155,7 @@
|
||||
@BINPATH@/components/dom_bluetooth.xpt
|
||||
#endif
|
||||
@BINPATH@/components/dom_canvas.xpt
|
||||
@BINPATH@/components/dom_contacts.xpt
|
||||
@BINPATH@/components/dom_core.xpt
|
||||
@BINPATH@/components/dom_css.xpt
|
||||
@BINPATH@/components/dom_events.xpt
|
||||
@ -192,6 +193,7 @@
|
||||
@BINPATH@/components/find.xpt
|
||||
@BINPATH@/components/fuel.xpt
|
||||
@BINPATH@/components/gfx.xpt
|
||||
@BINPATH@/components/html5.xpt
|
||||
@BINPATH@/components/htmlparser.xpt
|
||||
@BINPATH@/components/imglib2.xpt
|
||||
@BINPATH@/components/imgicon.xpt
|
||||
@ -293,6 +295,8 @@
|
||||
; JavaScript components
|
||||
@BINPATH@/components/ConsoleAPI.manifest
|
||||
@BINPATH@/components/ConsoleAPI.js
|
||||
@BINPATH@/components/ContactManager.js
|
||||
@BINPATH@/components/ContactManager.manifest
|
||||
@BINPATH@/components/FeedProcessor.manifest
|
||||
@BINPATH@/components/FeedProcessor.js
|
||||
@BINPATH@/components/BrowserFeeds.manifest
|
||||
|
@ -320,6 +320,8 @@ pref("browser.urlbar.default.behavior", 0);
|
||||
pref("browser.urlbar.formatting.enabled", true);
|
||||
pref("browser.urlbar.trimURLs", true);
|
||||
|
||||
pref("browser.altClickSave", false);
|
||||
|
||||
// Number of milliseconds to wait for the http headers (and thus
|
||||
// the Content-Disposition filename) before giving up and falling back to
|
||||
// picking a filename without that info in hand so that the user sees some
|
||||
@ -958,6 +960,7 @@ pref("services.sync.prefs.sync.browser.download.manager.scanWhenDone", true);
|
||||
pref("services.sync.prefs.sync.browser.download.manager.showWhenStarting", true);
|
||||
pref("services.sync.prefs.sync.browser.formfill.enable", true);
|
||||
pref("services.sync.prefs.sync.browser.link.open_newwindow", true);
|
||||
pref("services.sync.prefs.sync.browser.newtabpage.enabled", true);
|
||||
pref("services.sync.prefs.sync.browser.offline-apps.notify", true);
|
||||
pref("services.sync.prefs.sync.browser.safebrowsing.enabled", true);
|
||||
pref("services.sync.prefs.sync.browser.safebrowsing.malware.enabled", true);
|
||||
@ -1028,6 +1031,9 @@ pref("devtools.errorconsole.enabled", false);
|
||||
// Enable the Inspector
|
||||
pref("devtools.inspector.enabled", true);
|
||||
pref("devtools.inspector.htmlHeight", 112);
|
||||
pref("devtools.inspector.htmlPanelOpen", false);
|
||||
pref("devtools.inspector.sidebarOpen", false);
|
||||
pref("devtools.inspector.activeSidebar", "ruleview");
|
||||
|
||||
// Enable the Debugger
|
||||
pref("devtools.debugger.enabled", false);
|
||||
|
@ -1,7 +0,0 @@
|
||||
richlistitem[type="tab"] {
|
||||
-moz-binding: url(chrome://browser/content/aboutSyncTabs-bindings.xml#tab-listing);
|
||||
}
|
||||
|
||||
richlistitem[type="client"] {
|
||||
-moz-binding: url(chrome://browser/content/aboutSyncTabs-bindings.xml#client-listing);
|
||||
}
|
@ -101,25 +101,25 @@ var StarUI = {
|
||||
this._restoreCommandsState();
|
||||
this._itemId = -1;
|
||||
if (this._batching) {
|
||||
PlacesUIUtils.ptm.endBatch();
|
||||
PlacesUtils.transactionManager.endBatch();
|
||||
this._batching = false;
|
||||
}
|
||||
|
||||
switch (this._actionOnHide) {
|
||||
case "cancel": {
|
||||
PlacesUIUtils.ptm.undoTransaction();
|
||||
PlacesUtils.transactionManager.undoTransaction();
|
||||
break;
|
||||
}
|
||||
case "remove": {
|
||||
// Remove all bookmarks for the bookmark's url, this also removes
|
||||
// the tags for the url.
|
||||
PlacesUIUtils.ptm.beginBatch();
|
||||
PlacesUtils.transactionManager.beginBatch();
|
||||
let itemIds = PlacesUtils.getBookmarksForURI(this._uriForRemoval);
|
||||
for (let i = 0; i < itemIds.length; i++) {
|
||||
let txn = PlacesUIUtils.ptm.removeItem(itemIds[i]);
|
||||
PlacesUIUtils.ptm.doTransaction(txn);
|
||||
let txn = new PlacesRemoveItemTransaction(itemIds[i]);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
}
|
||||
PlacesUIUtils.ptm.endBatch();
|
||||
PlacesUtils.transactionManager.endBatch();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -275,7 +275,7 @@ var StarUI = {
|
||||
|
||||
beginBatch: function SU_beginBatch() {
|
||||
if (!this._batching) {
|
||||
PlacesUIUtils.ptm.beginBatch();
|
||||
PlacesUtils.transactionManager.beginBatch();
|
||||
this._batching = true;
|
||||
}
|
||||
}
|
||||
@ -325,9 +325,10 @@ var PlacesCommandHook = {
|
||||
var parent = aParent != undefined ?
|
||||
aParent : PlacesUtils.unfiledBookmarksFolderId;
|
||||
var descAnno = { name: PlacesUIUtils.DESCRIPTION_ANNO, value: description };
|
||||
var txn = PlacesUIUtils.ptm.createItem(uri, parent, -1,
|
||||
title, null, [descAnno]);
|
||||
PlacesUIUtils.ptm.doTransaction(txn);
|
||||
var txn = new PlacesCreateBookmarkTransaction(uri, parent,
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
title, null, [descAnno]);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
// Set the character-set
|
||||
if (charset)
|
||||
PlacesUtils.history.setCharsetForURI(uri, charset);
|
||||
|
@ -25,6 +25,7 @@
|
||||
# Shawn Wilsher <me@shawnwilsher.com>
|
||||
# Ehsan Akhgari <ehsan.akhgari@gmail.com>
|
||||
# Rob Campbell <rcampbell@mozilla.com>
|
||||
# Paul Rouget <paul@mozilla.com>
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@ -153,6 +154,14 @@
|
||||
oncommand="InspectorUI.toggleSidebar();"/>
|
||||
<command id="Inspector:Tilt"
|
||||
oncommand="Tilt.initialize();"/>
|
||||
<command id="Inspector:HTMLPanel"
|
||||
oncommand="InspectorUI.toggleHTMLPanel();"/>
|
||||
<command id="Inspector:CopyInner"
|
||||
oncommand="InspectorUI.copyInnerHTML();"/>
|
||||
<command id="Inspector:CopyOuter"
|
||||
oncommand="InspectorUI.copyOuterHTML();"/>
|
||||
<command id="Inspector:DeleteNode"
|
||||
oncommand="InspectorUI.deleteNode();"/>
|
||||
</commandset>
|
||||
|
||||
<broadcasterset id="mainBroadcasterSet">
|
||||
@ -167,7 +176,7 @@
|
||||
type="checkbox" group="sidebar"
|
||||
sidebarurl="chrome://browser/content/history/history-panel.xul"
|
||||
oncommand="toggleSidebar('viewHistorySidebar');"/>
|
||||
|
||||
|
||||
<broadcaster id="viewWebPanelsSidebar" autoCheck="false"
|
||||
type="checkbox" group="sidebar" sidebarurl="chrome://browser/content/web-panels.xul"
|
||||
oncommand="toggleSidebar('viewWebPanelsSidebar');"/>
|
||||
|
@ -291,7 +291,7 @@ let gSyncUI = {
|
||||
if (win)
|
||||
win.focus();
|
||||
else {
|
||||
window.openDialog("chrome://browser/content/syncSetup.xul",
|
||||
window.openDialog("chrome://browser/content/sync/setup.xul",
|
||||
"weaveSetup", "centerscreen,chrome,resizable=no",
|
||||
wizardType);
|
||||
}
|
||||
@ -305,7 +305,7 @@ let gSyncUI = {
|
||||
if (win)
|
||||
win.focus();
|
||||
else
|
||||
window.openDialog("chrome://browser/content/syncAddDevice.xul",
|
||||
window.openDialog("chrome://browser/content/sync/addDevice.xul",
|
||||
"syncAddDevice", "centerscreen,chrome,resizable=no");
|
||||
},
|
||||
|
||||
@ -315,7 +315,7 @@ let gSyncUI = {
|
||||
win.focus();
|
||||
else
|
||||
Services.ww.activeWindow.openDialog(
|
||||
"chrome://browser/content/syncQuota.xul", "",
|
||||
"chrome://browser/content/sync/quota.xul", "",
|
||||
"centerscreen,chrome,dialog,modal");
|
||||
},
|
||||
|
||||
|
@ -329,12 +329,12 @@ window[chromehidden~="toolbar"] toolbar:not(.toolbar-primary):not(.chromeclass-m
|
||||
%ifdef MOZ_SERVICES_SYNC
|
||||
/* Sync notification UI */
|
||||
#sync-notifications {
|
||||
-moz-binding: url("chrome://browser/content/syncNotification.xml#notificationbox");
|
||||
-moz-binding: url("chrome://browser/content/sync/notification.xml#notificationbox");
|
||||
overflow-y: visible !important;
|
||||
}
|
||||
|
||||
#sync-notifications notification {
|
||||
-moz-binding: url("chrome://browser/content/syncNotification.xml#notification");
|
||||
-moz-binding: url("chrome://browser/content/sync/notification.xml#notification");
|
||||
}
|
||||
%endif
|
||||
|
||||
|
@ -1662,12 +1662,14 @@ function delayedStartup(isLoadingBlank, mustLoadSidebar) {
|
||||
gDownloadMgr = Cc["@mozilla.org/download-manager;1"].
|
||||
getService(Ci.nsIDownloadManager);
|
||||
|
||||
#ifdef XP_WIN
|
||||
if (Win7Features) {
|
||||
let tempScope = {};
|
||||
Cu.import("resource://gre/modules/DownloadTaskbarProgress.jsm",
|
||||
tempScope);
|
||||
tempScope.DownloadTaskbarProgress.onBrowserWindowLoad(window);
|
||||
}
|
||||
#endif
|
||||
}, 10000);
|
||||
|
||||
#ifndef XP_MACOSX
|
||||
@ -6992,11 +6994,13 @@ function getPluginInfo(pluginElement)
|
||||
|
||||
var gPluginHandler = {
|
||||
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
get CrashSubmit() {
|
||||
delete this.CrashSubmit;
|
||||
Cu.import("resource://gre/modules/CrashSubmit.jsm", this);
|
||||
return this.CrashSubmit;
|
||||
},
|
||||
#endif
|
||||
|
||||
// Map the plugin's name to a filtered version more suitable for user UI.
|
||||
makeNicePluginName : function (aName, aFilename) {
|
||||
@ -7136,6 +7140,7 @@ var gPluginHandler = {
|
||||
BrowserOpenAddonsMgr("addons://list/plugin");
|
||||
},
|
||||
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
// Callback for user clicking "submit a report" link
|
||||
submitReport : function(pluginDumpID, browserDumpID) {
|
||||
// The crash reporter wants a DOM element it can append an IFRAME to,
|
||||
@ -7144,6 +7149,7 @@ var gPluginHandler = {
|
||||
if (browserDumpID)
|
||||
this.CrashSubmit.submit(browserDumpID);
|
||||
},
|
||||
#endif
|
||||
|
||||
// Callback for user clicking a "reload page" link
|
||||
reloadPage: function (browser) {
|
||||
|
@ -38,6 +38,7 @@
|
||||
# David Dahl <ddahl@mozilla.com>
|
||||
# Frank Yan <fyan@mozilla.com>
|
||||
# Victor Porof <vporof@mozilla.com>
|
||||
# Paul Rouget <paul@mozilla.com>
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
@ -227,20 +228,21 @@
|
||||
</hbox>
|
||||
</panel>
|
||||
|
||||
<panel id="inspector-tree-panel"
|
||||
orient="vertical"
|
||||
hidden="true"
|
||||
ignorekeys="true"
|
||||
noautofocus="true"
|
||||
noautohide="true"
|
||||
titlebar="normal"
|
||||
close="true"
|
||||
label="&inspectPanelTitle.label;">
|
||||
<hbox id="tree-panel-resizer-box" align="end">
|
||||
<spacer flex="1" />
|
||||
<resizer dir="bottomend" />
|
||||
</hbox>
|
||||
</panel>
|
||||
<menupopup id="inspector-node-popup">
|
||||
<menuitem id="inspectorHTMLCopyInner"
|
||||
label="&inspectorHTMLCopyInner.label;"
|
||||
accesskey="&inspectorHTMLCopyInner.accesskey;"
|
||||
command="Inspector:CopyInner"/>
|
||||
<menuitem id="inspectorHTMLCopyOuter"
|
||||
label="&inspectorHTMLCopyOuter.label;"
|
||||
accesskey="&inspectorHTMLCopyOuter.accesskey;"
|
||||
command="Inspector:CopyOuter"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="inspectorHTMLDelete"
|
||||
label="&inspectorHTMLDelete.label;"
|
||||
accesskey="&inspectorHTMLDelete.accesskey;"
|
||||
command="Inspector:DeleteNode"/>
|
||||
</menupopup>
|
||||
|
||||
<menupopup id="toolbar-context-menu"
|
||||
onpopupshowing="onViewToolbarsPopupShowing(event);">
|
||||
@ -994,45 +996,44 @@
|
||||
class="devtools-toolbar"
|
||||
nowindowdrag="true"
|
||||
hidden="true">
|
||||
<vbox flex="1">
|
||||
<resizer id="inspector-top-resizer" flex="1"
|
||||
dir="top" disabled="true"
|
||||
element="inspector-tree-box"/>
|
||||
<hbox>
|
||||
#ifdef XP_MACOSX
|
||||
<toolbarbutton id="highlighter-closebutton"
|
||||
oncommand="InspectorUI.closeInspectorUI(false);"
|
||||
tooltiptext="&inspectCloseButton.tooltiptext;"/>
|
||||
<toolbarbutton id="highlighter-closebutton"
|
||||
oncommand="InspectorUI.closeInspectorUI(false);"
|
||||
tooltiptext="&inspectCloseButton.tooltiptext;"/>
|
||||
#endif
|
||||
<toolbarbutton id="inspector-inspect-toolbutton"
|
||||
class="devtools-toolbarbutton"
|
||||
label="&inspectButton.label;"
|
||||
accesskey="&inspectButton.accesskey;"
|
||||
command="Inspector:Inspect"/>
|
||||
<arrowscrollbox id="inspector-breadcrumbs"
|
||||
flex="1" orient="horizontal"
|
||||
clicktoscroll="true"/>
|
||||
<hbox id="inspector-tools">
|
||||
<toolbarbutton id="inspector-3D-button"
|
||||
class="devtools-toolbarbutton"
|
||||
hidden="true"
|
||||
label="&inspect3DViewButton.label;"
|
||||
accesskey="&inspect3DViewButton.accesskey;"
|
||||
command="Inspector:Tilt"/>
|
||||
<toolbarbutton id="inspector-style-button"
|
||||
class="devtools-toolbarbutton"
|
||||
label="&inspectStyleButton.label;"
|
||||
accesskey="&inspectStyleButton.accesskey;"
|
||||
command="Inspector:Sidebar"/>
|
||||
<!-- registered tools go here -->
|
||||
</hbox>
|
||||
<toolbarbutton id="inspector-inspect-toolbutton"
|
||||
class="devtools-toolbarbutton"
|
||||
label="&inspectButton.label;"
|
||||
accesskey="&inspectButton.accesskey;"
|
||||
command="Inspector:Inspect"/>
|
||||
<toolbarbutton id="inspector-treepanel-toolbutton"
|
||||
class="devtools-toolbarbutton"
|
||||
label="&htmlPanel.label;"
|
||||
accesskey="&htmlPanel.accesskey;"
|
||||
tooltiptext="&htmlPanel.tooltiptext;"
|
||||
command="Inspector:HTMLPanel"/>
|
||||
<arrowscrollbox id="inspector-breadcrumbs"
|
||||
flex="1" orient="horizontal"
|
||||
clicktoscroll="true"/>
|
||||
<hbox id="inspector-tools">
|
||||
<toolbarbutton id="inspector-3D-button"
|
||||
class="devtools-toolbarbutton"
|
||||
hidden="true"
|
||||
label="&inspect3DViewButton.label;"
|
||||
accesskey="&inspect3DViewButton.accesskey;"
|
||||
command="Inspector:Tilt"/>
|
||||
<toolbarbutton id="inspector-style-button"
|
||||
class="devtools-toolbarbutton"
|
||||
label="&inspectStyleButton.label;"
|
||||
accesskey="&inspectStyleButton.accesskey;"
|
||||
command="Inspector:Sidebar"/>
|
||||
<!-- registered tools go here -->
|
||||
</hbox>
|
||||
#ifndef XP_MACOSX
|
||||
<toolbarbutton id="highlighter-closebutton"
|
||||
oncommand="InspectorUI.closeInspectorUI(false);"
|
||||
tooltiptext="&inspectCloseButton.tooltiptext;"/>
|
||||
<toolbarbutton id="highlighter-closebutton"
|
||||
oncommand="InspectorUI.closeInspectorUI(false);"
|
||||
tooltiptext="&inspectCloseButton.tooltiptext;"/>
|
||||
#endif
|
||||
</hbox>
|
||||
</vbox>
|
||||
</toolbar>
|
||||
<toolbar id="addon-bar"
|
||||
toolbarname="&addonBarCmd.label;" accesskey="&addonBarCmd.accesskey;"
|
||||
|
@ -34,14 +34,6 @@
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
#inspector-top-resizer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#inspector-toolbar[treepanel-open] > vbox > #inspector-top-resizer {
|
||||
display: -moz-box;
|
||||
}
|
||||
|
||||
/*
|
||||
* Node Infobar
|
||||
*/
|
||||
|
@ -289,9 +289,14 @@ nsContextMenu.prototype = {
|
||||
this.showItem("context-viewvideo", this.onVideo && (!this.inSyntheticDoc || this.inFrame));
|
||||
this.setItemAttr("context-viewvideo", "disabled", !this.mediaURL);
|
||||
|
||||
// View background image depends on whether there is one.
|
||||
this.showItem("context-viewbgimage", shouldShow && !this._hasMultipleBGImages);
|
||||
this.showItem("context-sep-viewbgimage", shouldShow && !this._hasMultipleBGImages);
|
||||
// View background image depends on whether there is one, but don't make
|
||||
// background images of a stand-alone media document available.
|
||||
this.showItem("context-viewbgimage", shouldShow &&
|
||||
!this._hasMultipleBGImages &&
|
||||
!this.inSyntheticDoc);
|
||||
this.showItem("context-sep-viewbgimage", shouldShow &&
|
||||
!this._hasMultipleBGImages &&
|
||||
!this.inSyntheticDoc);
|
||||
document.getElementById("context-viewbgimage")
|
||||
.disabled = !this.hasBGImage;
|
||||
|
||||
@ -387,7 +392,9 @@ nsContextMenu.prototype = {
|
||||
this.showItem("context-delete", this.onTextInput);
|
||||
this.showItem("context-sep-paste", this.onTextInput);
|
||||
this.showItem("context-selectall", !(this.onLink || this.onImage ||
|
||||
this.onVideo || this.onAudio) || this.isDesignMode);
|
||||
this.onVideo || this.onAudio ||
|
||||
this.inSyntheticDoc) ||
|
||||
this.isDesignMode);
|
||||
this.showItem("context-sep-selectall", this.isContentSelected );
|
||||
|
||||
// XXX dr
|
||||
|
@ -1,3 +1,3 @@
|
||||
<p><b>Binaries</b> of this product have been made available to you by the
|
||||
<a href="http://www.mozilla.org/">Mozilla Project</a> under the Mozilla
|
||||
Public License. <a href="about:rights">Know your rights</a>.</p>
|
||||
Public License 2.0 (MPL). <a href="about:rights">Know your rights</a>.</p>
|
||||
|
7
browser/base/content/sync/aboutSyncTabs.css
Normal file
7
browser/base/content/sync/aboutSyncTabs.css
Normal file
@ -0,0 +1,7 @@
|
||||
richlistitem[type="tab"] {
|
||||
-moz-binding: url(chrome://browser/content/sync/aboutSyncTabs-bindings.xml#tab-listing);
|
||||
}
|
||||
|
||||
richlistitem[type="client"] {
|
||||
-moz-binding: url(chrome://browser/content/sync/aboutSyncTabs-bindings.xml#client-listing);
|
||||
}
|
@ -40,7 +40,7 @@
|
||||
|
||||
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/skin/aboutSyncTabs.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/content/aboutSyncTabs.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://browser/content/sync/aboutSyncTabs.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window [
|
||||
<!ENTITY % aboutSyncTabsDTD SYSTEM "chrome://browser/locale/aboutSyncTabs.dtd">
|
||||
@ -53,7 +53,7 @@
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
title="&tabs.otherComputers.label;">
|
||||
<script type="application/javascript;version=1.8" src="chrome://browser/content/aboutSyncTabs.js"/>
|
||||
<script type="application/javascript;version=1.8" src="chrome://browser/content/sync/aboutSyncTabs.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
|
||||
<html:head>
|
||||
<html:link rel="icon" href="chrome://browser/skin/sync-16.png"/>
|
@ -61,9 +61,9 @@
|
||||
onload="gSyncAddDevice.init();">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/syncAddDevice.js"/>
|
||||
src="chrome://browser/content/sync/addDevice.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/syncUtils.js"/>
|
||||
src="chrome://browser/content/sync/utils.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/utilityOverlay.js"/>
|
||||
<script type="application/javascript"
|
@ -60,9 +60,9 @@
|
||||
onwizardfinish="return Change.onDialogAccept();">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/syncGenericChange.js"/>
|
||||
src="chrome://browser/content/sync/genericChange.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/syncUtils.js"/>
|
||||
src="chrome://browser/content/sync/utils.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://global/content/printUtils.js"/>
|
||||
|
@ -64,7 +64,7 @@
|
||||
href="chrome://browser/skin/sync-16.png"/>
|
||||
|
||||
<script type="text/javascript;version=1.8"
|
||||
src="chrome://browser/content/syncProgress.js"/>
|
||||
src="chrome://browser/content/sync/progress.js"/>
|
||||
</head>
|
||||
<body onload="onLoad(event)" onunload="onUnload(event)" dir="&locale.dir;">
|
||||
<title>&setup.successPage.title;</title>
|
@ -60,7 +60,7 @@
|
||||
ondialogaccept="return gSyncQuota.onAccept();">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/syncQuota.js"/>
|
||||
src="chrome://browser/content/sync/quota.js"/>
|
||||
|
||||
<stringbundleset id="stringbundleset">
|
||||
<stringbundle id="quotaStrings"
|
@ -65,9 +65,9 @@
|
||||
onload="gSyncSetup.init()">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/syncSetup.js"/>
|
||||
src="chrome://browser/content/sync/setup.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/syncUtils.js"/>
|
||||
src="chrome://browser/content/sync/utils.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/utilityOverlay.js"/>
|
||||
<script type="application/javascript"
|
@ -76,7 +76,7 @@ let gSyncUtils = {
|
||||
}
|
||||
|
||||
// Open up the change dialog
|
||||
let changeXUL = "chrome://browser/content/syncGenericChange.xul";
|
||||
let changeXUL = "chrome://browser/content/sync/genericChange.xul";
|
||||
let changeOpt = "centerscreen,chrome,resizable=no";
|
||||
Services.ww.activeWindow.openDialog(changeXUL, "", changeOpt,
|
||||
type, duringSetup);
|
||||
@ -125,7 +125,7 @@ let gSyncUtils = {
|
||||
|
||||
// Create an invisible iframe whose contents we can print.
|
||||
let iframe = document.createElement("iframe");
|
||||
iframe.setAttribute("src", "chrome://browser/content/syncKey.xhtml");
|
||||
iframe.setAttribute("src", "chrome://browser/content/sync/key.xhtml");
|
||||
iframe.collapsed = true;
|
||||
document.documentElement.appendChild(iframe);
|
||||
iframe.contentWindow.addEventListener("load", function() {
|
@ -1418,7 +1418,9 @@
|
||||
<parameter name="aAll"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var tabsToClose = (aAll ? this.tabs.length : this.visibleTabs.length - 1)
|
||||
var tabsToClose = (aAll ?
|
||||
this.tabs.length - this._removingTabs.length :
|
||||
this.visibleTabs.length - 1)
|
||||
- gBrowser._numPinnedTabs;
|
||||
if (tabsToClose <= 1)
|
||||
return true;
|
||||
@ -1526,6 +1528,7 @@
|
||||
if (!animate /* the caller didn't opt in */ ||
|
||||
isLastTab ||
|
||||
aTab.pinned ||
|
||||
aTab.hidden ||
|
||||
this._removingTabs.length > 3 /* don't want lots of concurrent animations */ ||
|
||||
aTab.getAttribute("fadein") != "true" /* fade-in transition hasn't been triggered yet */ ||
|
||||
window.getComputedStyle(aTab).maxWidth == "0.1px" /* fade-in transition hasn't moved yet */ ||
|
||||
|
@ -93,7 +93,6 @@ endif
|
||||
# browser_drag.js is disabled, as it needs to be updated for the new behavior from bug 320638.
|
||||
|
||||
# browser_bug321000.js is disabled because newline handling is shaky (bug 592528)
|
||||
# browser_urlbarAutoFillTrimURLs.js is disabled till bug 720792 is fixed
|
||||
|
||||
_BROWSER_FILES = \
|
||||
head.js \
|
||||
@ -223,6 +222,7 @@ _BROWSER_FILES = \
|
||||
browser_tabfocus.js \
|
||||
browser_tabs_isActive.js \
|
||||
browser_tabs_owner.js \
|
||||
browser_urlbarAutoFillTrimURLs.js \
|
||||
browser_urlbarCopying.js \
|
||||
browser_urlbarEnter.js \
|
||||
browser_urlbarRevert.js \
|
||||
|
@ -73,8 +73,12 @@ let gTests = [
|
||||
// just be like Alt click.
|
||||
{
|
||||
desc: "Shift+Alt left click",
|
||||
setup: function() {},
|
||||
clean: function() {},
|
||||
setup: function() {
|
||||
gPrefService.setBoolPref("browser.altClickSave", true);
|
||||
},
|
||||
clean: function() {
|
||||
gPrefService.clearUserPref("browser.altClickSave");
|
||||
},
|
||||
event: { shiftKey: true,
|
||||
altKey: true },
|
||||
targets: [ "commonlink", "maplink" ],
|
||||
@ -84,8 +88,12 @@ let gTests = [
|
||||
|
||||
{
|
||||
desc: "Shift+Alt left click on XLinks",
|
||||
setup: function() {},
|
||||
clean: function() {},
|
||||
setup: function() {
|
||||
gPrefService.setBoolPref("browser.altClickSave", true);
|
||||
},
|
||||
clean: function() {
|
||||
gPrefService.clearUserPref("browser.altClickSave");
|
||||
},
|
||||
event: { shiftKey: true,
|
||||
altKey: true },
|
||||
targets: [ "mathxlink", "svgxlink"],
|
||||
@ -105,8 +113,12 @@ let gTests = [
|
||||
|
||||
{
|
||||
desc: "Alt click",
|
||||
setup: function() {},
|
||||
clean: function() {},
|
||||
setup: function() {
|
||||
gPrefService.setBoolPref("browser.altClickSave", true);
|
||||
},
|
||||
clean: function() {
|
||||
gPrefService.clearUserPref("browser.altClickSave");
|
||||
},
|
||||
event: { altKey: true },
|
||||
targets: [ "commonlink", "maplink" ],
|
||||
expectedInvokedMethods: [ "gatherTextUnder", "saveURL" ],
|
||||
@ -115,8 +127,12 @@ let gTests = [
|
||||
|
||||
{
|
||||
desc: "Alt click on XLinks",
|
||||
setup: function() {},
|
||||
clean: function() {},
|
||||
setup: function() {
|
||||
gPrefService.setBoolPref("browser.altClickSave", true);
|
||||
},
|
||||
clean: function() {
|
||||
gPrefService.clearUserPref("browser.altClickSave");
|
||||
},
|
||||
event: { altKey: true },
|
||||
targets: [ "mathxlink", "svgxlink" ],
|
||||
expectedInvokedMethods: [ "saveURL" ],
|
||||
@ -149,9 +165,7 @@ let gTests = [
|
||||
gPrefService.setBoolPref("browser.tabs.opentabfor.middleclick", false);
|
||||
},
|
||||
clean: function() {
|
||||
try {
|
||||
gPrefService.clearUserPref("browser.tabs.opentabfor.middleclick");
|
||||
} catch(ex) {}
|
||||
gPrefService.clearUserPref("browser.tabs.opentabfor.middleclick");
|
||||
},
|
||||
event: { button: 1 },
|
||||
targets: [ "commonlink", "mathxlink", "svgxlink", "maplink" ],
|
||||
@ -166,12 +180,8 @@ let gTests = [
|
||||
gPrefService.setBoolPref("general.autoScroll", false);
|
||||
},
|
||||
clean: function() {
|
||||
try {
|
||||
gPrefService.clearUserPref("middlemouse.contentLoadURL");
|
||||
} catch(ex) {}
|
||||
try {
|
||||
gPrefService.clearUserPref("general.autoScroll");
|
||||
} catch(ex) {}
|
||||
gPrefService.clearUserPref("middlemouse.contentLoadURL");
|
||||
gPrefService.clearUserPref("general.autoScroll");
|
||||
},
|
||||
event: { button: 1 },
|
||||
targets: [ "emptylink" ],
|
||||
|
@ -28,7 +28,6 @@ function test() {
|
||||
executeSoon(function () {
|
||||
let consoleListener = {
|
||||
observe: function (m) {
|
||||
info("m.message: " + m.message + "\n");
|
||||
if (m.message.indexOf("NS_ERROR_DOM_BAD_URI") > -1) {
|
||||
ok(true, "drop was blocked");
|
||||
executeSoon(finish);
|
||||
@ -45,21 +44,7 @@ function test() {
|
||||
// The drop handler throws an exception when dragging URIs that inherit
|
||||
// principal, e.g. javascript:
|
||||
expectUncaughtException();
|
||||
let originalHandler = homeButtonObserver.onDrop;
|
||||
homeButtonObserver.onDrop = function (aEvent) {
|
||||
info("homeButtonObserver.onDrop called");
|
||||
try {
|
||||
originalHandler(aEvent);
|
||||
} catch (ex) {
|
||||
info("originalHandler threw an exception: " + ex);
|
||||
throw ex;
|
||||
}
|
||||
};
|
||||
registerCleanupFunction(function () {
|
||||
homeButtonObserver.onDrop = originalHandler;
|
||||
});
|
||||
chromeUtils.synthesizeDrop(homeButton, homeButton, [[{type: "text/plain", data: "javascript:8888"}]], "copy", window, EventUtils);
|
||||
info("Triggered the second drop of a javascript: URI");
|
||||
});
|
||||
})
|
||||
});
|
||||
|
@ -9,6 +9,12 @@ let gFocusManager = Cc["@mozilla.org/focus-manager;1"].
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
registerCleanupFunction(function () {
|
||||
Services.prefs.clearUserPref("browser.altClickSave");
|
||||
});
|
||||
Services.prefs.setBoolPref("browser.altClickSave", true);
|
||||
|
||||
runAltLeftClickTest();
|
||||
}
|
||||
|
||||
|
@ -147,7 +147,7 @@ function whereToOpenLink( e, ignoreButton, ignoreAlt )
|
||||
#endif
|
||||
return shift ? "tabshifted" : "tab";
|
||||
|
||||
if (alt)
|
||||
if (alt && getBoolPref("browser.altClickSave", false))
|
||||
return "save";
|
||||
|
||||
if (shift || (middle && !middleUsesTabs))
|
||||
|
@ -41,6 +41,25 @@ browser.jar:
|
||||
* content/browser/pageinfo/feeds.xml (content/pageinfo/feeds.xml)
|
||||
* content/browser/pageinfo/permissions.js (content/pageinfo/permissions.js)
|
||||
* content/browser/pageinfo/security.js (content/pageinfo/security.js)
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
* content/browser/sync/aboutSyncTabs.xul (content/sync/aboutSyncTabs.xul)
|
||||
content/browser/sync/aboutSyncTabs.js (content/sync/aboutSyncTabs.js)
|
||||
content/browser/sync/aboutSyncTabs.css (content/sync/aboutSyncTabs.css)
|
||||
* content/browser/sync/aboutSyncTabs-bindings.xml (content/sync/aboutSyncTabs-bindings.xml)
|
||||
* content/browser/sync/setup.xul (content/sync/setup.xul)
|
||||
content/browser/sync/addDevice.js (content/sync/addDevice.js)
|
||||
* content/browser/sync/addDevice.xul (content/sync/addDevice.xul)
|
||||
content/browser/sync/setup.js (content/sync/setup.js)
|
||||
* content/browser/sync/genericChange.xul (content/sync/genericChange.xul)
|
||||
content/browser/sync/genericChange.js (content/sync/genericChange.js)
|
||||
* content/browser/sync/key.xhtml (content/sync/key.xhtml)
|
||||
* content/browser/sync/notification.xml (content/sync/notification.xml)
|
||||
* content/browser/sync/quota.xul (content/sync/quota.xul)
|
||||
content/browser/sync/quota.js (content/sync/quota.js)
|
||||
content/browser/sync/utils.js (content/sync/utils.js)
|
||||
content/browser/sync/progress.js (content/sync/progress.js)
|
||||
* content/browser/sync/progress.xhtml (content/sync/progress.xhtml)
|
||||
#endif
|
||||
* content/browser/openLocation.js (content/openLocation.js)
|
||||
* content/browser/openLocation.xul (content/openLocation.xul)
|
||||
* content/browser/safeMode.js (content/safeMode.js)
|
||||
@ -57,25 +76,6 @@ browser.jar:
|
||||
* content/browser/web-panels.xul (content/web-panels.xul)
|
||||
* content/browser/baseMenuOverlay.xul (content/baseMenuOverlay.xul)
|
||||
* content/browser/nsContextMenu.js (content/nsContextMenu.js)
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
* content/browser/aboutSyncTabs.xul (content/aboutSyncTabs.xul)
|
||||
content/browser/aboutSyncTabs.js (content/aboutSyncTabs.js)
|
||||
content/browser/aboutSyncTabs.css (content/aboutSyncTabs.css)
|
||||
* content/browser/aboutSyncTabs-bindings.xml (content/aboutSyncTabs-bindings.xml)
|
||||
* content/browser/syncSetup.xul (content/syncSetup.xul)
|
||||
content/browser/syncAddDevice.js (content/syncAddDevice.js)
|
||||
* content/browser/syncAddDevice.xul (content/syncAddDevice.xul)
|
||||
content/browser/syncSetup.js (content/syncSetup.js)
|
||||
* content/browser/syncGenericChange.xul (content/syncGenericChange.xul)
|
||||
content/browser/syncGenericChange.js (content/syncGenericChange.js)
|
||||
* content/browser/syncKey.xhtml (content/syncKey.xhtml)
|
||||
* content/browser/syncNotification.xml (content/syncNotification.xml)
|
||||
* content/browser/syncQuota.xul (content/syncQuota.xul)
|
||||
content/browser/syncQuota.js (content/syncQuota.js)
|
||||
content/browser/syncUtils.js (content/syncUtils.js)
|
||||
content/browser/syncProgress.js (content/syncProgress.js)
|
||||
* content/browser/syncProgress.xhtml (content/syncProgress.xhtml)
|
||||
#endif
|
||||
# XXX: We should exclude this one as well (bug 71895)
|
||||
* content/browser/hiddenWindow.xul (content/hiddenWindow.xul)
|
||||
#ifdef XP_MACOSX
|
||||
|
@ -97,9 +97,9 @@ static RedirEntry kRedirMap[] = {
|
||||
{ "sessionrestore", "chrome://browser/content/aboutSessionRestore.xhtml",
|
||||
nsIAboutModule::ALLOW_SCRIPT },
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
{ "sync-progress", "chrome://browser/content/syncProgress.xhtml",
|
||||
{ "sync-progress", "chrome://browser/content/sync/progress.xhtml",
|
||||
nsIAboutModule::ALLOW_SCRIPT },
|
||||
{ "sync-tabs", "chrome://browser/content/aboutSyncTabs.xul",
|
||||
{ "sync-tabs", "chrome://browser/content/sync/aboutSyncTabs.xul",
|
||||
nsIAboutModule::ALLOW_SCRIPT },
|
||||
#endif
|
||||
{ "home", "chrome://browser/content/aboutHome.xhtml",
|
||||
|
@ -1,3 +1,4 @@
|
||||
# -*- indent-tabs-mode: nil -*-
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
@ -774,18 +775,71 @@ BrowserGlue.prototype = {
|
||||
const PREF_TELEMETRY_REJECTED = "toolkit.telemetry.rejected";
|
||||
const PREF_TELEMETRY_INFOURL = "toolkit.telemetry.infoURL";
|
||||
const PREF_TELEMETRY_SERVER_OWNER = "toolkit.telemetry.server_owner";
|
||||
const PREF_TELEMETRY_ENABLED_BY_DEFAULT = "toolkit.telemetry.enabledByDefault";
|
||||
const PREF_TELEMETRY_NOTIFIED_OPTOUT = "toolkit.telemetry.notifiedOptOut";
|
||||
// This is used to reprompt users when privacy message changes
|
||||
const TELEMETRY_PROMPT_REV = 2;
|
||||
|
||||
function appendTelemetryNotification(notifyBox, message, buttons, hideclose) {
|
||||
// Stick notifications onto the selected tab of the active browser window.
|
||||
var win = this.getMostRecentBrowserWindow();
|
||||
var tabbrowser = win.gBrowser;
|
||||
var notifyBox = tabbrowser.getNotificationBox();
|
||||
|
||||
var browserBundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
|
||||
var brandBundle = Services.strings.createBundle("chrome://branding/locale/brand.properties");
|
||||
var productName = brandBundle.GetStringFromName("brandFullName");
|
||||
var serverOwner = Services.prefs.getCharPref(PREF_TELEMETRY_SERVER_OWNER);
|
||||
|
||||
function appendTelemetryNotification(message, buttons, hideclose) {
|
||||
let notification = notifyBox.appendNotification(message, "telemetry", null,
|
||||
notifyBox.PRIORITY_INFO_LOW,
|
||||
buttons);
|
||||
notification.setAttribute("hideclose", hideclose);
|
||||
notifyBox.PRIORITY_INFO_LOW,
|
||||
buttons);
|
||||
if (hideclose)
|
||||
notification.setAttribute("hideclose", hideclose);
|
||||
notification.persistence = -1; // Until user closes it
|
||||
return notification;
|
||||
}
|
||||
|
||||
function appendLearnMoreLink(notification) {
|
||||
let XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
let link = notification.ownerDocument.createElementNS(XULNS, "label");
|
||||
link.className = "text-link telemetry-text-link";
|
||||
link.setAttribute("value", browserBundle.GetStringFromName("telemetryLinkLabel"));
|
||||
let description = notification.ownerDocument.getAnonymousElementByAttribute(notification, "anonid", "messageText");
|
||||
description.appendChild(link);
|
||||
return link;
|
||||
}
|
||||
|
||||
var telemetryEnabledByDefault = false;
|
||||
try {
|
||||
telemetryEnabledByDefault = Services.prefs.getBoolPref(PREF_TELEMETRY_ENABLED_BY_DEFAULT);
|
||||
} catch(e) {}
|
||||
if (telemetryEnabledByDefault) {
|
||||
var telemetryNotifiedOptOut = false;
|
||||
try {
|
||||
telemetryNotifiedOptOut = Services.prefs.getBoolPref(PREF_TELEMETRY_NOTIFIED_OPTOUT);
|
||||
} catch(e) {}
|
||||
if (telemetryNotifiedOptOut)
|
||||
return;
|
||||
|
||||
var telemetryPrompt = browserBundle.formatStringFromName("telemetryOptOutPrompt",
|
||||
[productName, serverOwner, productName], 3);
|
||||
|
||||
Services.prefs.setBoolPref(PREF_TELEMETRY_NOTIFIED_OPTOUT, true);
|
||||
|
||||
let notification = appendTelemetryNotification(telemetryPrompt, null, false);
|
||||
let link = appendLearnMoreLink(notification);
|
||||
link.addEventListener('click', function() {
|
||||
// Open the learn more url in a new tab
|
||||
let url = Services.urlFormatter.formatURLPref("app.support.baseURL");
|
||||
url += "how-can-i-help-submitting-performance-data";
|
||||
tabbrowser.selectedTab = tabbrowser.addTab(url);
|
||||
// Remove the notification on which the user clicked
|
||||
notification.parentNode.removeNotification(notification, true);
|
||||
}, false);
|
||||
return;
|
||||
}
|
||||
|
||||
var telemetryPrompted = null;
|
||||
try {
|
||||
telemetryPrompted = Services.prefs.getIntPref(PREF_TELEMETRY_PROMPTED);
|
||||
@ -798,17 +852,7 @@ BrowserGlue.prototype = {
|
||||
Services.prefs.clearUserPref(PREF_TELEMETRY_PROMPTED);
|
||||
Services.prefs.clearUserPref(PREF_TELEMETRY_ENABLED);
|
||||
|
||||
// Stick the notification onto the selected tab of the active browser window.
|
||||
var win = this.getMostRecentBrowserWindow();
|
||||
var browser = win.gBrowser; // for closure in notification bar callback
|
||||
var notifyBox = browser.getNotificationBox();
|
||||
|
||||
var browserBundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
|
||||
var brandBundle = Services.strings.createBundle("chrome://branding/locale/brand.properties");
|
||||
|
||||
var productName = brandBundle.GetStringFromName("brandFullName");
|
||||
var serverOwner = Services.prefs.getCharPref(PREF_TELEMETRY_SERVER_OWNER);
|
||||
var telemetryPrompt = browserBundle.formatStringFromName("telemetryPrompt", [productName, serverOwner], 2);
|
||||
var telemetryPrompt = browserBundle.formatStringFromName("telemetryPrompt", [productName, serverOwner], 2);
|
||||
|
||||
var buttons = [
|
||||
{
|
||||
@ -832,23 +876,17 @@ BrowserGlue.prototype = {
|
||||
// Set pref to indicate we've shown the notification.
|
||||
Services.prefs.setIntPref(PREF_TELEMETRY_PROMPTED, TELEMETRY_PROMPT_REV);
|
||||
|
||||
let notification = appendTelemetryNotification(notifyBox, telemetryPrompt,
|
||||
buttons, true);
|
||||
let XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
let link = notification.ownerDocument.createElementNS(XULNS, "label");
|
||||
link.className = "text-link telemetry-text-link";
|
||||
link.setAttribute("value", browserBundle.GetStringFromName("telemetryLinkLabel"));
|
||||
let notification = appendTelemetryNotification(telemetryPrompt, buttons, true);
|
||||
let link = appendLearnMoreLink(notification);
|
||||
link.addEventListener('click', function() {
|
||||
// Open the learn more url in a new tab
|
||||
browser.selectedTab = browser.addTab(Services.prefs.getCharPref(PREF_TELEMETRY_INFOURL));
|
||||
tabbrowser.selectedTab = tabbrowser.addTab(Services.prefs.getCharPref(PREF_TELEMETRY_INFOURL));
|
||||
// Remove the notification on which the user clicked
|
||||
notification.parentNode.removeNotification(notification, true);
|
||||
// Add a new notification to that tab, with no "Learn more" link
|
||||
notifyBox = browser.getNotificationBox();
|
||||
appendTelemetryNotification(notifyBox, telemetryPrompt, buttons, true);
|
||||
notifyBox = tabbrowser.getNotificationBox();
|
||||
appendTelemetryNotification(telemetryPrompt, buttons, true);
|
||||
}, false);
|
||||
let description = notification.ownerDocument.getAnonymousElementByAttribute(notification, "anonid", "messageText");
|
||||
description.appendChild(link);
|
||||
},
|
||||
#endif
|
||||
|
||||
|
@ -436,7 +436,7 @@ var BookmarkPropertiesPanel = {
|
||||
if (this._batching)
|
||||
return;
|
||||
|
||||
PlacesUIUtils.ptm.beginBatch();
|
||||
PlacesUtils.transactionManager.beginBatch();
|
||||
this._batching = true;
|
||||
},
|
||||
|
||||
@ -444,7 +444,7 @@ var BookmarkPropertiesPanel = {
|
||||
if (!this._batching)
|
||||
return;
|
||||
|
||||
PlacesUIUtils.ptm.endBatch();
|
||||
PlacesUtils.transactionManager.endBatch();
|
||||
this._batching = false;
|
||||
},
|
||||
|
||||
@ -514,7 +514,7 @@ var BookmarkPropertiesPanel = {
|
||||
gEditItemOverlay.uninitPanel(true);
|
||||
gEditItemOverlay = null;
|
||||
this._endBatch();
|
||||
PlacesUIUtils.ptm.undoTransaction();
|
||||
PlacesUtils.transactionManager.undoTransaction();
|
||||
window.arguments[0].performed = false;
|
||||
},
|
||||
|
||||
@ -577,32 +577,44 @@ var BookmarkPropertiesPanel = {
|
||||
var childTransactions = [];
|
||||
|
||||
if (this._description) {
|
||||
childTransactions.push(
|
||||
PlacesUIUtils.ptm.editItemDescription(-1, this._description));
|
||||
let annoObj = { name : PlacesUIUtils.DESCRIPTION_ANNO,
|
||||
type : Ci.nsIAnnotationService.TYPE_STRING,
|
||||
flags : 0,
|
||||
value : this._description,
|
||||
expires: Ci.nsIAnnotationService.EXPIRE_NEVER };
|
||||
let editItemTxn = new PlacesSetItemAnnotationTransaction(-1, annoObj);
|
||||
childTransactions.push(editItemTxn);
|
||||
}
|
||||
|
||||
if (this._loadInSidebar) {
|
||||
childTransactions.push(
|
||||
PlacesUIUtils.ptm.setLoadInSidebar(-1, this._loadInSidebar));
|
||||
let annoObj = { name : PlacesUIUtils.LOAD_IN_SIDEBAR_ANNO,
|
||||
type : Ci.nsIAnnotationService.TYPE_INT32,
|
||||
flags : 0,
|
||||
value : this._loadInSidebar,
|
||||
expires: Ci.nsIAnnotationService.EXPIRE_NEVER };
|
||||
let setLoadTxn = new PlacesSetItemAnnotationTransaction(-1, annoObj);
|
||||
childTransactions.push(setLoadTxn);
|
||||
}
|
||||
|
||||
if (this._postData) {
|
||||
childTransactions.push(
|
||||
PlacesUIUtils.ptm.editBookmarkPostData(-1, this._postData));
|
||||
let postDataTxn = new PlacesEditBookmarkPostDataTransaction(-1, this._postData);
|
||||
childTransactions.push(postDataTxn);
|
||||
}
|
||||
|
||||
//XXX TODO: this should be in a transaction!
|
||||
if (this._charSet)
|
||||
PlacesUtils.history.setCharsetForURI(this._uri, this._charSet);
|
||||
|
||||
var transactions = [PlacesUIUtils.ptm.createItem(this._uri,
|
||||
aContainer, aIndex,
|
||||
this._title, this._keyword,
|
||||
annotations,
|
||||
childTransactions)];
|
||||
let createTxn = new PlacesCreateBookmarkTransaction(this._uri,
|
||||
aContainer,
|
||||
aIndex,
|
||||
this._title,
|
||||
this._keyword,
|
||||
annotations,
|
||||
childTransactions);
|
||||
|
||||
return PlacesUIUtils.ptm.aggregateTransactions(this._getDialogTitle(),
|
||||
transactions);
|
||||
return new PlacesAggregatedTransaction(this._getDialogTitle(),
|
||||
[createTxn]);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -614,7 +626,10 @@ var BookmarkPropertiesPanel = {
|
||||
for (var i = 0; i < this._URIs.length; ++i) {
|
||||
var uri = this._URIs[i];
|
||||
var title = this._getURITitleFromHistory(uri);
|
||||
transactions.push(PlacesUIUtils.ptm.createItem(uri, -1, -1, title));
|
||||
var createTxn = new PlacesCreateBookmarkTransaction(uri, -1,
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
title);
|
||||
transactions.push(createTxn);
|
||||
}
|
||||
return transactions;
|
||||
},
|
||||
@ -633,8 +648,9 @@ var BookmarkPropertiesPanel = {
|
||||
if (this._description)
|
||||
annotations.push(this._getDescriptionAnnotation(this._description));
|
||||
|
||||
return PlacesUIUtils.ptm.createFolder(this._title, aContainer, aIndex,
|
||||
annotations, childItemsTransactions);
|
||||
return new PlacesCreateFolderTransaction(this._title, aContainer,
|
||||
aIndex, annotations,
|
||||
childItemsTransactions);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -643,9 +659,9 @@ var BookmarkPropertiesPanel = {
|
||||
*/
|
||||
_getCreateNewLivemarkTransaction:
|
||||
function BPP__getCreateNewLivemarkTransaction(aContainer, aIndex) {
|
||||
return PlacesUIUtils.ptm.createLivemark(this._feedURI, this._siteURI,
|
||||
this._title,
|
||||
aContainer, aIndex);
|
||||
return new PlacesCreateLivemarkTransaction(this._feedURI, this._siteURI,
|
||||
this._title,
|
||||
aContainer, aIndex);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -666,7 +682,7 @@ var BookmarkPropertiesPanel = {
|
||||
txn = this._getCreateNewBookmarkTransaction(container, index);
|
||||
}
|
||||
|
||||
PlacesUIUtils.ptm.doTransaction(txn);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
this._itemId = PlacesUtils.bookmarks.getIdForItemAt(container, index);
|
||||
}
|
||||
};
|
||||
|
@ -1858,13 +1858,16 @@ PlacesMenu.prototype = {
|
||||
_onPopupHidden: function PM__onPopupHidden(aEvent) {
|
||||
// Avoid handling popuphidden of inner views.
|
||||
let popup = aEvent.originalTarget;
|
||||
if (!popup._placesNode || PlacesUIUtils.getViewForNode(popup) != this)
|
||||
let placesNode = popup._placesNode;
|
||||
if (!placesNode || PlacesUIUtils.getViewForNode(popup) != this)
|
||||
return;
|
||||
|
||||
// UI performance: folder queries are cheap, keep the resultnode open
|
||||
// so we don't rebuild its contents whenever the popup is reopened.
|
||||
if (!PlacesUtils.nodeIsFolder(popup._placesNode))
|
||||
popup._placesNode.containerOpen = false;
|
||||
// Though, we want to always close feed containers so their expiration
|
||||
// status will be checked at next opening.
|
||||
if (!PlacesUtils.nodeIsFolder(placesNode) || placesNode._feedURI)
|
||||
placesNode.containerOpen = false;
|
||||
|
||||
// The autoopened attribute is set for folders which have been
|
||||
// automatically opened when dragged over. Turn off this attribute
|
||||
|
@ -157,9 +157,9 @@ PlacesController.prototype = {
|
||||
isCommandEnabled: function PC_isCommandEnabled(aCommand) {
|
||||
switch (aCommand) {
|
||||
case "cmd_undo":
|
||||
return PlacesUIUtils.ptm.numberOfUndoItems > 0;
|
||||
return PlacesUtils.transactionManager.numberOfUndoItems > 0;
|
||||
case "cmd_redo":
|
||||
return PlacesUIUtils.ptm.numberOfRedoItems > 0;
|
||||
return PlacesUtils.transactionManager.numberOfRedoItems > 0;
|
||||
case "cmd_cut":
|
||||
case "placesCmd_cut":
|
||||
var nodes = this._view.selectedNodes;
|
||||
@ -230,10 +230,10 @@ PlacesController.prototype = {
|
||||
doCommand: function PC_doCommand(aCommand) {
|
||||
switch (aCommand) {
|
||||
case "cmd_undo":
|
||||
PlacesUIUtils.ptm.undoTransaction();
|
||||
PlacesUtils.transactionManager.undoTransaction();
|
||||
break;
|
||||
case "cmd_redo":
|
||||
PlacesUIUtils.ptm.redoTransaction();
|
||||
PlacesUtils.transactionManager.redoTransaction();
|
||||
break;
|
||||
case "cmd_cut":
|
||||
case "placesCmd_cut":
|
||||
@ -785,8 +785,8 @@ PlacesController.prototype = {
|
||||
var ip = this._view.insertionPoint;
|
||||
if (!ip)
|
||||
throw Cr.NS_ERROR_NOT_AVAILABLE;
|
||||
var txn = PlacesUIUtils.ptm.createSeparator(ip.itemId, ip.index);
|
||||
PlacesUIUtils.ptm.doTransaction(txn);
|
||||
var txn = new PlacesCreateSeparatorTransaction(ip.itemId, ip.index);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
// select the new item
|
||||
var insertedNodeId = PlacesUtils.bookmarks
|
||||
.getIdForItemAt(ip.itemId, ip.index);
|
||||
@ -807,8 +807,8 @@ PlacesController.prototype = {
|
||||
*/
|
||||
sortFolderByName: function PC_sortFolderByName() {
|
||||
var itemId = PlacesUtils.getConcreteItemId(this._view.selectedNode);
|
||||
var txn = PlacesUIUtils.ptm.sortFolderByName(itemId);
|
||||
PlacesUIUtils.ptm.doTransaction(txn);
|
||||
var txn = new PlacesSortFolderByNameTransaction(itemId);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -872,7 +872,8 @@ PlacesController.prototype = {
|
||||
// untag transaction.
|
||||
var tagItemId = PlacesUtils.getConcreteItemId(node.parent);
|
||||
var uri = NetUtil.newURI(node.uri);
|
||||
transactions.push(PlacesUIUtils.ptm.untagURI(uri, [tagItemId]));
|
||||
let txn = new PlacesUntagURITransaction(uri, [tagItemId]);
|
||||
transactions.push(txn);
|
||||
}
|
||||
else if (PlacesUtils.nodeIsTagQuery(node) && node.parent &&
|
||||
PlacesUtils.nodeIsQuery(node.parent) &&
|
||||
@ -884,8 +885,10 @@ PlacesController.prototype = {
|
||||
// must only remove the query node.
|
||||
var tag = node.title;
|
||||
var URIs = PlacesUtils.tagging.getURIsForTag(tag);
|
||||
for (var j = 0; j < URIs.length; j++)
|
||||
transactions.push(PlacesUIUtils.ptm.untagURI(URIs[j], [tag]));
|
||||
for (var j = 0; j < URIs.length; j++) {
|
||||
let txn = new PlacesUntagURITransaction(URIs[j], [tag]);
|
||||
transactions.push(txn);
|
||||
}
|
||||
}
|
||||
else if (PlacesUtils.nodeIsURI(node) &&
|
||||
PlacesUtils.nodeIsQuery(node.parent) &&
|
||||
@ -912,7 +915,8 @@ PlacesController.prototype = {
|
||||
// to skip nodes that are children of an already removed folder.
|
||||
removedFolders.push(node);
|
||||
}
|
||||
transactions.push(PlacesUIUtils.ptm.removeItem(node.itemId));
|
||||
let txn = new PlacesRemoveItemTransaction(node.itemId);
|
||||
transactions.push(txn);
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -931,8 +935,8 @@ PlacesController.prototype = {
|
||||
this._removeRange(ranges[i], transactions, removedFolders);
|
||||
|
||||
if (transactions.length > 0) {
|
||||
var txn = PlacesUIUtils.ptm.aggregateTransactions(txnName, transactions);
|
||||
PlacesUIUtils.ptm.doTransaction(txn);
|
||||
var txn = new PlacesAggregatedTransaction(txnName, transactions);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
}
|
||||
},
|
||||
|
||||
@ -1278,10 +1282,9 @@ PlacesController.prototype = {
|
||||
if (ip.isTag) {
|
||||
// Pasting into a tag container means tagging the item, regardless of
|
||||
// the requested action.
|
||||
transactions.push(
|
||||
new PlacesTagURITransaction(NetUtil.newURI(items[i].uri),
|
||||
[ip.itemId])
|
||||
);
|
||||
let tagTxn = new PlacesTagURITransaction(NetUtil.newURI(items[i].uri),
|
||||
[ip.itemId]);
|
||||
transactions.push(tagTxn);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1296,9 +1299,8 @@ PlacesController.prototype = {
|
||||
);
|
||||
}
|
||||
|
||||
PlacesUtils.transactionManager.doTransaction(
|
||||
new PlacesAggregatedTransaction("Paste", transactions)
|
||||
);
|
||||
let aggregatedTxn = new PlacesAggregatedTransaction("Paste", transactions);
|
||||
PlacesUtils.transactionManager.doTransaction(aggregatedTxn);
|
||||
|
||||
// Cut/past operations are not repeatable, so clear the clipboard.
|
||||
if (action == "cut") {
|
||||
@ -1548,7 +1550,8 @@ let PlacesControllerDragHelper = {
|
||||
insertionPoint.orientation == Ci.nsITreeView.DROP_ON) {
|
||||
let uri = NetUtil.newURI(unwrapped.uri);
|
||||
let tagItemId = insertionPoint.itemId;
|
||||
transactions.push(PlacesUIUtils.ptm.tagURI(uri,[tagItemId]));
|
||||
let tagTxn = new PlacesTagURITransaction(uri, [tagItemId]);
|
||||
transactions.push(tagTxn);
|
||||
}
|
||||
else {
|
||||
transactions.push(PlacesUIUtils.makeTransaction(unwrapped,
|
||||
@ -1557,8 +1560,8 @@ let PlacesControllerDragHelper = {
|
||||
}
|
||||
}
|
||||
|
||||
let txn = PlacesUIUtils.ptm.aggregateTransactions("DropItems", transactions);
|
||||
PlacesUIUtils.ptm.doTransaction(txn);
|
||||
let txn = new PlacesAggregatedTransaction("DropItems", transactions);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -435,15 +435,18 @@ var gEditItemOverlay = {
|
||||
tagsToAdd.push(tags[i]);
|
||||
}
|
||||
|
||||
if (tagsToRemove.length > 0)
|
||||
txns.push(PlacesUIUtils.ptm.untagURI(this._uri, tagsToRemove));
|
||||
if (tagsToAdd.length > 0)
|
||||
txns.push(PlacesUIUtils.ptm.tagURI(this._uri, tagsToAdd));
|
||||
if (tagsToRemove.length > 0) {
|
||||
let untagTxn = new PlacesUntagURITransaction(this._uri, tagsToRemove);
|
||||
txns.push(untagTxn);
|
||||
}
|
||||
if (tagsToAdd.length > 0) {
|
||||
let tagTxn = new PlacesTagURITransaction(this._uri, tagsToAdd);
|
||||
txns.push(tagTxn);
|
||||
}
|
||||
|
||||
if (txns.length > 0) {
|
||||
var aggregate = PlacesUIUtils.ptm.aggregateTransactions("Update tags",
|
||||
txns);
|
||||
PlacesUIUtils.ptm.doTransaction(aggregate);
|
||||
let aggregate = new PlacesAggregatedTransaction("Update tags", txns);
|
||||
PlacesUtils.transactionManager.doTransaction(aggregate);
|
||||
|
||||
// Ensure the tagsField is in sync, clean it up from empty tags
|
||||
var tags = PlacesUtils.tagging.getTagsForURI(this._uri).join(", ");
|
||||
@ -495,25 +498,31 @@ var gEditItemOverlay = {
|
||||
}
|
||||
|
||||
if (tagsToAdd.length > 0) {
|
||||
for (i = 0; i < this._uris.length; i++) {
|
||||
if (tagsToAdd[i].length > 0)
|
||||
txns.push(PlacesUIUtils.ptm.tagURI(this._uris[i], tagsToAdd[i]));
|
||||
for (let i = 0; i < this._uris.length; i++) {
|
||||
if (tagsToAdd[i].length > 0) {
|
||||
let tagTxn = new PlacesTagURITransaction(this._uris[i],
|
||||
tagsToAdd[i]);
|
||||
txns.push(tagTxn);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (tagsToRemove.length > 0) {
|
||||
for (var i = 0; i < this._uris.length; i++)
|
||||
txns.push(PlacesUIUtils.ptm.untagURI(this._uris[i], tagsToRemove));
|
||||
for (let i = 0; i < this._uris.length; i++) {
|
||||
let untagTxn = new PlacesUntagURITransaction(this._uris[i],
|
||||
tagsToRemove);
|
||||
txns.push(untagTxn);
|
||||
}
|
||||
}
|
||||
|
||||
if (txns.length > 0) {
|
||||
var aggregate = PlacesUIUtils.ptm.aggregateTransactions("Update tags",
|
||||
txns);
|
||||
PlacesUIUtils.ptm.doTransaction(aggregate);
|
||||
let aggregate = new PlacesAggregatedTransaction("Update tags", txns);
|
||||
PlacesUtils.transactionManager.doTransaction(aggregate);
|
||||
|
||||
this._allTags = tags;
|
||||
this._tags = [];
|
||||
for (i = 0; i < this._uris.length; i++)
|
||||
for (let i = 0; i < this._uris.length; i++) {
|
||||
this._tags[i] = PlacesUtils.tagging.getTagsForURI(this._uris[i]);
|
||||
}
|
||||
|
||||
// Ensure the tagsField is in sync, clean it up from empty tags
|
||||
this._initTextField("tagsField", tags, false);
|
||||
@ -528,8 +537,6 @@ var gEditItemOverlay = {
|
||||
return;
|
||||
|
||||
var namePicker = this._element("namePicker")
|
||||
var txns = [];
|
||||
const ptm = PlacesUIUtils.ptm;
|
||||
|
||||
// Here we update either the item title or its cached static title
|
||||
var newTitle = namePicker.value;
|
||||
@ -540,19 +547,21 @@ var gEditItemOverlay = {
|
||||
}
|
||||
else if (this._getItemStaticTitle() != newTitle) {
|
||||
this._mayUpdateFirstEditField("namePicker");
|
||||
txns.push(ptm.editItemTitle(this._itemId, newTitle));
|
||||
let txn = new PlacesEditItemTitleTransaction(this._itemId, newTitle);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
}
|
||||
|
||||
var aggregate = ptm.aggregateTransactions("Edit Item Title", txns);
|
||||
ptm.doTransaction(aggregate);
|
||||
},
|
||||
|
||||
onDescriptionFieldBlur: function EIO_onDescriptionFieldBlur() {
|
||||
var description = this._element("descriptionField").value;
|
||||
if (description != PlacesUIUtils.getItemDescription(this._itemId)) {
|
||||
var txn = PlacesUIUtils.ptm
|
||||
.editItemDescription(this._itemId, description);
|
||||
PlacesUIUtils.ptm.doTransaction(txn);
|
||||
var annoObj = { name : PlacesUIUtils.DESCRIPTION_ANNO,
|
||||
type : Ci.nsIAnnotationService.TYPE_STRING,
|
||||
flags : 0,
|
||||
value : description,
|
||||
expires: Ci.nsIAnnotationService.EXPIRE_NEVER };
|
||||
var txn = new PlacesSetItemAnnotationTransaction(this._itemId, annoObj);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
}
|
||||
},
|
||||
|
||||
@ -564,8 +573,8 @@ var gEditItemOverlay = {
|
||||
catch(ex) { return; }
|
||||
|
||||
if (!this._uri.equals(uri)) {
|
||||
var txn = PlacesUIUtils.ptm.editBookmarkURI(this._itemId, uri);
|
||||
PlacesUIUtils.ptm.doTransaction(txn);
|
||||
var txn = new PlacesEditBookmarkURITransaction(this._itemId, uri);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
this._uri = uri;
|
||||
}
|
||||
},
|
||||
@ -573,17 +582,22 @@ var gEditItemOverlay = {
|
||||
onKeywordFieldBlur: function EIO_onKeywordFieldBlur() {
|
||||
var keyword = this._element("keywordField").value;
|
||||
if (keyword != PlacesUtils.bookmarks.getKeywordForBookmark(this._itemId)) {
|
||||
var txn = PlacesUIUtils.ptm.editBookmarkKeyword(this._itemId, keyword);
|
||||
PlacesUIUtils.ptm.doTransaction(txn);
|
||||
var txn = new PlacesEditBookmarkKeywordTransaction(this._itemId, keyword);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
}
|
||||
},
|
||||
|
||||
onLoadInSidebarCheckboxCommand:
|
||||
function EIO_onLoadInSidebarCheckboxCommand() {
|
||||
var loadInSidebarChecked = this._element("loadInSidebarCheckbox").checked;
|
||||
var txn = PlacesUIUtils.ptm.setLoadInSidebar(this._itemId,
|
||||
loadInSidebarChecked);
|
||||
PlacesUIUtils.ptm.doTransaction(txn);
|
||||
var annoObj = { name : PlacesUIUtils.LOAD_IN_SIDEBAR_ANNO,
|
||||
type : Ci.nsIAnnotationService.TYPE_INT32,
|
||||
flags : 0,
|
||||
value : loadInSidebarChecked,
|
||||
expires: Ci.nsIAnnotationService.EXPIRE_NEVER };
|
||||
var txn = new PlacesSetItemAnnotationTransaction(this._itemId,
|
||||
annoObj);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
},
|
||||
|
||||
toggleFolderTreeVisibility: function EIO_toggleFolderTreeVisibility() {
|
||||
@ -672,8 +686,10 @@ var gEditItemOverlay = {
|
||||
// Move the item
|
||||
var container = this._getFolderIdFromMenuList();
|
||||
if (PlacesUtils.bookmarks.getFolderIdForItem(this._itemId) != container) {
|
||||
var txn = PlacesUIUtils.ptm.moveItem(this._itemId, container, -1);
|
||||
PlacesUIUtils.ptm.doTransaction(txn);
|
||||
var txn = new PlacesMoveItemTransaction(this._itemId,
|
||||
container,
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
|
||||
// Mark the containing folder as recently-used if it isn't in the
|
||||
// static list
|
||||
@ -720,15 +736,17 @@ var gEditItemOverlay = {
|
||||
var anno = this._getLastUsedAnnotationObject(false);
|
||||
while (this._recentFolders.length > MAX_FOLDER_ITEM_IN_MENU_LIST) {
|
||||
var folderId = this._recentFolders.pop().folderId;
|
||||
txns.push(PlacesUIUtils.ptm.setItemAnnotation(folderId, anno));
|
||||
let annoTxn = new PlacesSetItemAnnotationTransaction(folderId, anno);
|
||||
txns.push(annoTxn);
|
||||
}
|
||||
|
||||
// Mark folder as recently used
|
||||
anno = this._getLastUsedAnnotationObject(true);
|
||||
txns.push(PlacesUIUtils.ptm.setItemAnnotation(aFolderId, anno));
|
||||
let annoTxn = new PlacesSetItemAnnotationTransaction(aFolderId, anno);
|
||||
txns.push(annoTxn);
|
||||
|
||||
var aggregate = PlacesUIUtils.ptm.aggregateTransactions("Update last used folders", txns);
|
||||
PlacesUIUtils.ptm.doTransaction(aggregate);
|
||||
let aggregate = new PlacesAggregatedTransaction("Update last used folders", txns);
|
||||
PlacesUtils.transactionManager.doTransaction(aggregate);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -840,8 +858,8 @@ var gEditItemOverlay = {
|
||||
|
||||
// XXXmano: add a separate "New Folder" string at some point...
|
||||
var defaultLabel = this._element("newFolderButton").label;
|
||||
var txn = PlacesUIUtils.ptm.createFolder(defaultLabel, ip.itemId, ip.index);
|
||||
PlacesUIUtils.ptm.doTransaction(txn);
|
||||
var txn = new PlacesCreateFolderTransaction(defaultLabel, ip.itemId, ip.index);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
this._folderTree.focus();
|
||||
this._folderTree.selectItems([this._lastNewItem]);
|
||||
this._folderTree.startEditing(this._folderTree.view.selection.currentIndex,
|
||||
|
@ -67,13 +67,15 @@ var gMoveBookmarksDialog = {
|
||||
if (this._nodes[i].parent.itemId == selectedFolderID)
|
||||
continue;
|
||||
|
||||
transactions.push(new
|
||||
PlacesUIUtils.ptm.moveItem(this._nodes[i].itemId, selectedFolderID, -1));
|
||||
let txn = new PlacesMoveItemTransaction(this._nodes[i].itemId,
|
||||
selectedFolderID,
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX);
|
||||
transactions.push(txn);
|
||||
}
|
||||
|
||||
if (transactions.length != 0) {
|
||||
var txn = PlacesUIUtils.ptm.aggregateTransactions("Move Items", transactions);
|
||||
PlacesUIUtils.ptm.doTransaction(txn);
|
||||
let txn = new PlacesAggregatedTransaction("Move Items", transactions);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -828,11 +828,11 @@ var PlacesOrganizer = {
|
||||
return;
|
||||
|
||||
// Add the place: uri as a bookmark under the bookmarks root.
|
||||
var txn = PlacesUIUtils.ptm.createItem(placeURI,
|
||||
PlacesUtils.bookmarksMenuFolderId,
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
input.value);
|
||||
PlacesUIUtils.ptm.doTransaction(txn);
|
||||
var txn = new PlacesCreateBookmarkTransaction(placeURI,
|
||||
PlacesUtils.bookmarksMenuFolderId,
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
input.value);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
|
||||
// select and load the new query
|
||||
this._places.selectPlaceURI(placeSpec);
|
||||
|
@ -1660,8 +1660,8 @@ PlacesTreeView.prototype = {
|
||||
// We may only get here if the cell is editable.
|
||||
let node = this._rows[aRow];
|
||||
if (node.title != aText) {
|
||||
let txn = PlacesUIUtils.ptm.editItemTitle(node.itemId, aText);
|
||||
PlacesUIUtils.ptm.doTransaction(txn);
|
||||
let txn = new PlacesEditItemTitleTransaction(node.itemId, aText);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -64,7 +64,7 @@ _BROWSER_TEST_FILES = \
|
||||
browser_library_middleclick.js \
|
||||
browser_library_views_liveupdate.js \
|
||||
browser_views_liveupdate.js \
|
||||
browser_sidebarpanels_click.js \
|
||||
$(warning browser_sidebarpanels_click.js temporarily disabled cause it breaks the treeview, see bug 658744) \
|
||||
sidebarpanels_click_test_page.html \
|
||||
browser_library_infoBox.js \
|
||||
browser_markPageAsFollowedLink.js \
|
||||
|
@ -86,7 +86,7 @@ function test() {
|
||||
-1,
|
||||
true);
|
||||
ok(transaction, "create transaction");
|
||||
PlacesUIUtils.ptm.doTransaction(transaction);
|
||||
PlacesUtils.transactionManager.doTransaction(transaction);
|
||||
// confirm copy
|
||||
is(testRootNode.childCount, 2, "create test folder via copy");
|
||||
|
||||
@ -95,11 +95,11 @@ function test() {
|
||||
validate(folderBNode);
|
||||
|
||||
// undo the transaction, confirm the removal
|
||||
PlacesUIUtils.ptm.undoTransaction();
|
||||
PlacesUtils.transactionManager.undoTransaction();
|
||||
is(testRootNode.childCount, 1, "confirm undo removed the copied folder");
|
||||
|
||||
// redo the transaction
|
||||
PlacesUIUtils.ptm.redoTransaction();
|
||||
PlacesUtils.transactionManager.redoTransaction();
|
||||
is(testRootNode.childCount, 2, "confirm redo re-copied the folder");
|
||||
folderBNode = testRootNode.getChild(1);
|
||||
validate(folderBNode);
|
||||
@ -109,7 +109,7 @@ function test() {
|
||||
toolbarNode.containerOpen = false;
|
||||
|
||||
// clean up
|
||||
PlacesUIUtils.ptm.undoTransaction();
|
||||
PlacesUtils.transactionManager.undoTransaction();
|
||||
PlacesUtils.bookmarks.removeItem(folderAId);
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ function test() {
|
||||
ok(transaction, "create transaction");
|
||||
|
||||
// execute it, copying to the test root folder
|
||||
PlacesUIUtils.ptm.doTransaction(transaction);
|
||||
PlacesUtils.transactionManager.doTransaction(transaction);
|
||||
is(testRootNode.childCount, 2, "create test folder via copy");
|
||||
|
||||
// check GUIDs are different
|
||||
@ -95,12 +95,12 @@ function test() {
|
||||
ok(checkGUIDs(folderBNode, folderBGUIDs, true), "confirm test of new GUIDs");
|
||||
|
||||
// undo the transaction, confirm the removal
|
||||
PlacesUIUtils.ptm.undoTransaction();
|
||||
PlacesUtils.transactionManager.undoTransaction();
|
||||
is(testRootNode.childCount, 1, "confirm undo removed the copied folder");
|
||||
|
||||
// redo the transaction
|
||||
// confirming GUIDs persist through undo/redo
|
||||
PlacesUIUtils.ptm.redoTransaction();
|
||||
PlacesUtils.transactionManager.redoTransaction();
|
||||
is(testRootNode.childCount, 2, "confirm redo re-copied the folder");
|
||||
folderBNode = testRootNode.getChild(1);
|
||||
ok(checkGUIDs(folderBNode, folderAGUIDs, false), "folder B GUIDs after undo/redo don't match folder A GUIDs"); // sanity check
|
||||
@ -111,7 +111,7 @@ function test() {
|
||||
toolbarNode.containerOpen = false;
|
||||
|
||||
// clean up
|
||||
PlacesUIUtils.ptm.undoTransaction();
|
||||
PlacesUtils.transactionManager.undoTransaction();
|
||||
PlacesUtils.bookmarks.removeItem(testRootId);
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,4 @@ tail =
|
||||
[test_browserGlue_smartBookmarks.js]
|
||||
[test_clearHistory_shutdown.js]
|
||||
[test_leftpane_corruption_handling.js]
|
||||
[test_placesTxn.js]
|
||||
[test_PUIU_makeTransaction.js]
|
||||
[test_txnGUIDs.js]
|
||||
|
@ -157,7 +157,7 @@ let gSyncPane = {
|
||||
if (win)
|
||||
win.focus();
|
||||
else {
|
||||
window.openDialog("chrome://browser/content/syncSetup.xul",
|
||||
window.openDialog("chrome://browser/content/sync/setup.xul",
|
||||
"weaveSetup", "centerscreen,chrome,resizable=no",
|
||||
wizardType);
|
||||
}
|
||||
@ -168,7 +168,7 @@ let gSyncPane = {
|
||||
if (win)
|
||||
win.focus();
|
||||
else
|
||||
window.openDialog("chrome://browser/content/syncQuota.xul", "",
|
||||
window.openDialog("chrome://browser/content/sync/quota.xul", "",
|
||||
"centerscreen,chrome,dialog,modal");
|
||||
},
|
||||
|
||||
@ -180,7 +180,7 @@ let gSyncPane = {
|
||||
if (win)
|
||||
win.focus();
|
||||
else
|
||||
window.openDialog("chrome://browser/content/syncAddDevice.xul",
|
||||
window.openDialog("chrome://browser/content/sync/addDevice.xul",
|
||||
"syncAddDevice", "centerscreen,chrome,resizable=no");
|
||||
},
|
||||
|
||||
|
@ -69,7 +69,7 @@
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/preferences/sync.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://browser/content/syncUtils.js"/>
|
||||
src="chrome://browser/content/sync/utils.js"/>
|
||||
|
||||
|
||||
<deck id="weavePrefsDeck">
|
||||
|
@ -1681,11 +1681,16 @@ SessionStoreService.prototype = {
|
||||
// If we're still here, then the window is usable. Look at the open tabs in
|
||||
// comparison to home pages. If all the tabs are home pages then we'll end
|
||||
// up overwriting all of them. Otherwise we'll just close the tabs that
|
||||
// match home pages.
|
||||
let homePages = aWindow.gHomeButton.getHomePage().split("|");
|
||||
// match home pages. Tabs with the about:blank URI will always be
|
||||
// overwritten.
|
||||
let homePages = ["about:blank"];
|
||||
let removableTabs = [];
|
||||
let tabbrowser = aWindow.gBrowser;
|
||||
let normalTabsLen = tabbrowser.tabs.length - tabbrowser._numPinnedTabs;
|
||||
let startupPref = this._prefBranch.getIntPref("startup.page");
|
||||
if (startupPref == 1)
|
||||
homePages = homePages.concat(aWindow.gHomeButton.getHomePage().split("|"));
|
||||
|
||||
for (let i = tabbrowser._numPinnedTabs; i < tabbrowser.tabs.length; i++) {
|
||||
let tab = tabbrowser.tabs[i];
|
||||
if (homePages.indexOf(tab.linkedBrowser.currentURI.spec) != -1) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
ac_add_options --enable-debug
|
||||
ac_add_options --enable-trace-malloc
|
||||
ac_add_options --enable-signmar
|
||||
|
||||
. $topsrcdir/build/unix/mozconfig.linux
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
|
||||
ac_add_options --enable-update-packaging
|
||||
ac_add_options --enable-codesighs
|
||||
ac_add_options --enable-signmar
|
||||
|
||||
# Nightlies only since this has a cost in performance
|
||||
ac_add_options --enable-js-diagnostics
|
||||
|
@ -1,5 +1,6 @@
|
||||
ac_add_options --enable-debug
|
||||
ac_add_options --enable-trace-malloc
|
||||
ac_add_options --enable-signmar
|
||||
|
||||
. $topsrcdir/build/unix/mozconfig.linux
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
|
||||
ac_add_options --enable-update-packaging
|
||||
ac_add_options --enable-codesighs
|
||||
ac_add_options --enable-signmar
|
||||
|
||||
# Nightlies only since this has a cost in performance
|
||||
ac_add_options --enable-js-diagnostics
|
||||
|
@ -7,6 +7,7 @@ ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
|
||||
ac_add_options --enable-update-packaging
|
||||
ac_add_options --enable-codesighs
|
||||
ac_add_options --disable-install-strip
|
||||
ac_add_options --enable-signmar
|
||||
|
||||
# Nightlies only since this has a cost in performance
|
||||
ac_add_options --enable-js-diagnostics
|
||||
|
@ -7,6 +7,7 @@ ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
|
||||
ac_add_options --enable-update-packaging
|
||||
ac_add_options --enable-codesighs
|
||||
ac_add_options --disable-install-strip
|
||||
ac_add_options --enable-signmar
|
||||
|
||||
# Nightlies only since this has a cost in performance
|
||||
ac_add_options --enable-js-diagnostics
|
||||
|
@ -1,6 +1,7 @@
|
||||
. $topsrcdir/build/macosx/mozconfig.leopard
|
||||
ac_add_options --enable-debug
|
||||
ac_add_options --enable-trace-malloc
|
||||
ac_add_options --enable-signmar
|
||||
|
||||
# Enable parallel compiling
|
||||
mk_add_options MOZ_MAKE_FLAGS="-j12"
|
||||
|
@ -1,6 +1,7 @@
|
||||
. $topsrcdir/build/macosx/mozconfig.leopard
|
||||
ac_add_options --enable-debug
|
||||
ac_add_options --enable-trace-malloc
|
||||
ac_add_options --enable-signmar
|
||||
|
||||
# Enable parallel compiling
|
||||
mk_add_options MOZ_MAKE_FLAGS="-j4"
|
||||
|
@ -3,6 +3,7 @@
|
||||
ac_add_options --enable-debug
|
||||
ac_add_options --enable-trace-malloc
|
||||
ac_add_options --enable-accessibility
|
||||
ac_add_options --enable-signmar
|
||||
|
||||
# Enable parallel compiling
|
||||
mk_add_options MOZ_MAKE_FLAGS="-j12"
|
||||
|
@ -3,6 +3,7 @@
|
||||
ac_add_options --enable-debug
|
||||
ac_add_options --enable-trace-malloc
|
||||
ac_add_options --enable-accessibility
|
||||
ac_add_options --enable-signmar
|
||||
|
||||
# Enable parallel compiling
|
||||
mk_add_options MOZ_MAKE_FLAGS="-j4"
|
||||
|
@ -1,5 +1,6 @@
|
||||
ac_add_options --enable-debug
|
||||
ac_add_options --enable-trace-malloc
|
||||
ac_add_options --enable-signmar
|
||||
|
||||
# Needed to enable breakpad in application.ini
|
||||
export MOZILLA_OFFICIAL=1
|
||||
|
@ -4,6 +4,7 @@ mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) $(MOZ_OBJDIR)/_profile/pgo/profiles
|
||||
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
|
||||
ac_add_options --enable-update-packaging
|
||||
ac_add_options --enable-jemalloc
|
||||
ac_add_options --enable-signmar
|
||||
|
||||
# Nightlies only since this has a cost in performance
|
||||
ac_add_options --enable-js-diagnostics
|
||||
|
@ -3,6 +3,7 @@ ac_add_options --host=x86_64-pc-mingw32
|
||||
|
||||
ac_add_options --enable-debug
|
||||
ac_add_options --enable-trace-malloc
|
||||
ac_add_options --enable-signmar
|
||||
|
||||
# Needed to enable breakpad in application.ini
|
||||
export MOZILLA_OFFICIAL=1
|
||||
|
@ -7,6 +7,7 @@ mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) $(MOZ_OBJDIR)/_profile/pgo/profiles
|
||||
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
|
||||
ac_add_options --enable-update-packaging
|
||||
ac_add_options --enable-jemalloc
|
||||
ac_add_options --enable-signmar
|
||||
|
||||
# Nightlies only since this has a cost in performance
|
||||
ac_add_options --enable-js-diagnostics
|
||||
|
@ -42,8 +42,8 @@ MOZ_UPDATER=1
|
||||
MOZ_PHOENIX=1
|
||||
|
||||
if test "$OS_ARCH" = "WINNT"; then
|
||||
MOZ_VERIFY_MAR_SIGNATURE=1
|
||||
if ! test "$HAVE_64BIT_OS"; then
|
||||
MOZ_VERIFY_MAR_SIGNATURE=1
|
||||
MOZ_MAINTENANCE_SERVICE=1
|
||||
fi
|
||||
fi
|
||||
@ -54,8 +54,13 @@ MOZ_SERVICES_SYNC=1
|
||||
MOZ_APP_VERSION=$FIREFOX_VERSION
|
||||
MOZ_EXTENSIONS_DEFAULT=" gnomevfs"
|
||||
# MOZ_APP_DISPLAYNAME will be set by branding/configure.sh
|
||||
# Changing either of these values requires a clobber to ensure correct results,
|
||||
# Changing MOZ_*BRANDING_DIRECTORY requires a clobber to ensure correct results,
|
||||
# because branding dependencies are broken.
|
||||
# MOZ_BRANDING_DIRECTORY is the default branding directory used when none is
|
||||
# specified. It should never point to the "official" branding directory.
|
||||
# For mozilla-beta, mozilla-release, or mozilla-central repositories, use
|
||||
# "nightly" branding (until bug 659568 is fixed).
|
||||
# For the mozilla-aurora repository, use "aurora".
|
||||
MOZ_BRANDING_DIRECTORY=browser/branding/nightly
|
||||
MOZ_OFFICIAL_BRANDING_DIRECTORY=browser/branding/official
|
||||
MOZ_APP_ID={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
|
||||
|
@ -150,35 +150,35 @@ DebuggerView.Stackframes = {
|
||||
*
|
||||
* @param number aDepth
|
||||
* The frame depth specified by the debugger.
|
||||
* @param string aFrameIdText
|
||||
* The id to be displayed in the list.
|
||||
* @param string aFrameNameText
|
||||
* The name to be displayed in the list.
|
||||
* @param string aFrameDetailsText
|
||||
* The details to be displayed in the list.
|
||||
* @return object
|
||||
* The newly created html node representing the added frame.
|
||||
*/
|
||||
addFrame: function DVF_addFrame(aDepth, aFrameIdText, aFrameNameText) {
|
||||
addFrame: function DVF_addFrame(aDepth, aFrameNameText, aFrameDetailsText) {
|
||||
// make sure we don't duplicate anything
|
||||
if (document.getElementById("stackframe-" + aDepth)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let frame = document.createElement("div");
|
||||
let frameId = document.createElement("span");
|
||||
let frameName = document.createElement("span");
|
||||
let frameDetails = document.createElement("span");
|
||||
|
||||
// create a list item to be added to the stackframes container
|
||||
frame.id = "stackframe-" + aDepth;
|
||||
frame.className = "dbg-stackframe list-item";
|
||||
|
||||
// this list should display the id and name of the frame
|
||||
frameId.className = "dbg-stackframe-id";
|
||||
// this list should display the name and details for the frame
|
||||
frameName.className = "dbg-stackframe-name";
|
||||
frameId.appendChild(document.createTextNode(aFrameIdText));
|
||||
frameDetails.className = "dbg-stackframe-details";
|
||||
frameName.appendChild(document.createTextNode(aFrameNameText));
|
||||
frameDetails.appendChild(document.createTextNode(aFrameDetailsText));
|
||||
|
||||
frame.appendChild(frameId);
|
||||
frame.appendChild(frameName);
|
||||
frame.appendChild(frameDetails);
|
||||
|
||||
this._frames.appendChild(frame);
|
||||
|
||||
@ -349,7 +349,7 @@ DebuggerView.Properties = {
|
||||
}
|
||||
|
||||
// compute the id of the element if not specified
|
||||
aId = aId || (aName + "-scope");
|
||||
aId = aId || (aName.toLowerCase().trim().replace(" ", "-") + "-scope");
|
||||
|
||||
// contains generic nodes and functionality
|
||||
let element = this._createPropertyElement(aName, aId, "scope", this._vars);
|
||||
@ -541,12 +541,12 @@ DebuggerView.Properties = {
|
||||
* An array containing the key and grip properties, specifying
|
||||
* the value and/or type & class of the variable (if the type
|
||||
* is not specified, it will be inferred from the value).
|
||||
* e.g. ["someProp0": 42]
|
||||
* ["someProp1": true]
|
||||
* ["someProp2": "nasu"]
|
||||
* ["someProp3": { type: "undefined" }]
|
||||
* ["someProp4": { type: "null" }]
|
||||
* ["someProp5": { type: "object", class: "Object" }]
|
||||
* e.g. ["someProp0", 42]
|
||||
* ["someProp1", true]
|
||||
* ["someProp2", "nasu"]
|
||||
* ["someProp3", { type: "undefined" }]
|
||||
* ["someProp4", { type: "null" }]
|
||||
* ["someProp5", { type: "object", class: "Object" }]
|
||||
* @param string aName
|
||||
* Optional, the property name.
|
||||
* @paarm string aId
|
||||
@ -1074,6 +1074,7 @@ DebuggerView.Scripts = {
|
||||
*
|
||||
* @param string aUrl
|
||||
* The script URL.
|
||||
* @return boolean
|
||||
*/
|
||||
contains: function DVS_contains(aUrl) {
|
||||
if (this._scripts.getElementsByAttribute("value", aUrl).length > 0) {
|
||||
@ -1082,6 +1083,21 @@ DebuggerView.Scripts = {
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks whether the script with the specified label is among the scripts
|
||||
* known to the debugger and shown in the list.
|
||||
*
|
||||
* @param string aLabel
|
||||
* The script label.
|
||||
* @return boolean
|
||||
*/
|
||||
containsLabel: function DVS_containsLabel(aLabel) {
|
||||
if (this._scripts.getElementsByAttribute("label", aLabel).length > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks whether the script with the specified URL is selected in the list.
|
||||
*
|
||||
@ -1109,30 +1125,30 @@ DebuggerView.Scripts = {
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* Adds a script to the scripts container.
|
||||
* If the script already exists (was previously added), null is returned.
|
||||
* Otherwise, the newly created element is returned.
|
||||
*
|
||||
* @param string aUrl
|
||||
* The script url.
|
||||
* @param string aLabel
|
||||
* The simplified script location to be shown.
|
||||
* @param string aScript
|
||||
* The source script.
|
||||
* @param string aScriptNameText
|
||||
* Optional, title displayed instead of url.
|
||||
* @return object
|
||||
* The newly created html node representing the added script.
|
||||
*/
|
||||
addScript: function DVS_addScript(aUrl, aSource, aScriptNameText) {
|
||||
addScript: function DVS_addScript(aLabel, aScript) {
|
||||
// make sure we don't duplicate anything
|
||||
if (this.contains(aUrl)) {
|
||||
if (this.containsLabel(aLabel)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let script = this._scripts.appendItem(aScriptNameText || aUrl, aUrl);
|
||||
script.setUserData("sourceScript", aSource, null);
|
||||
let script = this._scripts.appendItem(aLabel, aScript.url);
|
||||
script.setAttribute("tooltiptext", aScript.url);
|
||||
script.setUserData("sourceScript", aScript, null);
|
||||
|
||||
this._scripts.selectedItem = script;
|
||||
return script;
|
||||
},
|
||||
|
@ -67,6 +67,26 @@
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.dbg-stackframe {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dbg-stackframe-name {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.dbg-stackframe-details {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.dbg-stackframe-name:-moz-locale-dir(rtl) {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.dbg-stackframe-details:-moz-locale-dir(rtl) {
|
||||
float: left;
|
||||
}
|
||||
|
||||
/**
|
||||
* Properties elements
|
||||
*/
|
||||
|
@ -370,10 +370,12 @@ var StackFrames = {
|
||||
*/
|
||||
_addFramePanel: function SF_addFramePanel(aFrame) {
|
||||
let depth = aFrame.depth;
|
||||
let idText = "#" + aFrame.depth + " ";
|
||||
let nameText = this._frameTitle(aFrame);
|
||||
let label = SourceScripts._getScriptLabel(aFrame.where.url);
|
||||
|
||||
let panel = DebuggerView.Stackframes.addFrame(depth, idText, nameText);
|
||||
let startText = this._frameTitle(aFrame);
|
||||
let endText = label + ":" + aFrame.where.line;
|
||||
|
||||
let panel = DebuggerView.Stackframes.addFrame(depth, startText, endText);
|
||||
|
||||
if (panel) {
|
||||
panel.stackFrame = aFrame;
|
||||
@ -397,7 +399,7 @@ var StackFrames = {
|
||||
*/
|
||||
_frameTitle: function SF_frameTitle(aFrame) {
|
||||
if (aFrame.type == "call") {
|
||||
return aFrame["calleeName"] ? aFrame["calleeName"] + "()" : "(anonymous)";
|
||||
return aFrame["calleeName"] ? aFrame["calleeName"] : "(anonymous)";
|
||||
}
|
||||
|
||||
return "(" + aFrame.type + ")";
|
||||
@ -416,6 +418,7 @@ StackFrames.onClick = StackFrames.onClick.bind(StackFrames);
|
||||
var SourceScripts = {
|
||||
pageSize: 25,
|
||||
activeThread: null,
|
||||
_labelsCache: null,
|
||||
|
||||
/**
|
||||
* Watch a given thread client.
|
||||
@ -431,6 +434,7 @@ var SourceScripts = {
|
||||
aThreadClient.addListener("paused", this.onPaused);
|
||||
aThreadClient.addListener("scriptsadded", this.onScripts);
|
||||
aThreadClient.addListener("scriptscleared", this.onScriptsCleared);
|
||||
this.clearLabelsCache();
|
||||
this.onScriptsCleared();
|
||||
aCallback && aCallback();
|
||||
},
|
||||
@ -509,26 +513,86 @@ var SourceScripts = {
|
||||
return;
|
||||
}
|
||||
|
||||
let url = aUrl;
|
||||
// Trim the query part.
|
||||
let q = url.indexOf('?');
|
||||
if (q > -1) {
|
||||
url = url.slice(0, q);
|
||||
}
|
||||
|
||||
if (url.slice(-3) == ".js") {
|
||||
if (this._trimUrlQuery(aUrl).slice(-3) == ".js") {
|
||||
window.editor.setMode(SourceEditor.MODES.JAVASCRIPT);
|
||||
} else {
|
||||
window.editor.setMode(SourceEditor.MODES.HTML);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Trims the query part of a url string, if necessary.
|
||||
*
|
||||
* @param string aUrl
|
||||
* The script url.
|
||||
* @return string
|
||||
*/
|
||||
_trimUrlQuery: function SS_trimUrlQuery(aUrl) {
|
||||
let q = aUrl.indexOf('?');
|
||||
if (q > -1) {
|
||||
return aUrl.slice(0, q);
|
||||
}
|
||||
return aUrl;
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets a unique, simplified label from a script url.
|
||||
* ex: a). ici://some.address.com/random/subrandom/
|
||||
* b). ni://another.address.org/random/subrandom/page.html
|
||||
* c). san://interesting.address.gro/random/script.js
|
||||
* d). si://interesting.address.moc/random/another/script.js
|
||||
* =>
|
||||
* a). subrandom/
|
||||
* b). page.html
|
||||
* c). script.js
|
||||
* d). another/script.js
|
||||
*
|
||||
* @param string aUrl
|
||||
* The script url.
|
||||
* @param string aHref
|
||||
* The content location href to be used. If unspecified, it will
|
||||
* defalult to debugged panrent window location.
|
||||
* @return string
|
||||
* The simplified label.
|
||||
*/
|
||||
_getScriptLabel: function SS_getScriptLabel(aUrl, aHref) {
|
||||
let url = this._trimUrlQuery(aUrl);
|
||||
|
||||
if (this._labelsCache[url]) {
|
||||
return this._labelsCache[url];
|
||||
}
|
||||
|
||||
let href = aHref || window.parent.content.location.href;
|
||||
let pathElements = url.split("/");
|
||||
let label = pathElements.pop() || (pathElements.pop() + "/");
|
||||
|
||||
// if the label as a leaf name is alreay present in the scripts list
|
||||
if (DebuggerView.Scripts.containsLabel(label)) {
|
||||
label = url.replace(href.substring(0, href.lastIndexOf("/") + 1), "");
|
||||
|
||||
// if the path/to/script is exactly the same, we're in different domains
|
||||
if (DebuggerView.Scripts.containsLabel(label)) {
|
||||
label = url;
|
||||
}
|
||||
}
|
||||
|
||||
return this._labelsCache[url] = label;
|
||||
},
|
||||
|
||||
/**
|
||||
* Clears the labels cache, populated by SS_getScriptLabel().
|
||||
* This should be done every time the content location changes.
|
||||
*/
|
||||
clearLabelsCache: function SS_clearLabelsCache() {
|
||||
this._labelsCache = {};
|
||||
},
|
||||
|
||||
/**
|
||||
* Add the specified script to the list and display it in the editor if the
|
||||
* editor is empty.
|
||||
*/
|
||||
_addScript: function SS_addScript(aScript) {
|
||||
DebuggerView.Scripts.addScript(aScript.url, aScript);
|
||||
DebuggerView.Scripts.addScript(this._getScriptLabel(aScript.url), aScript);
|
||||
|
||||
if (window.editor.getCharCount() == 0) {
|
||||
this._showScript(aScript);
|
||||
|
@ -10,9 +10,7 @@ var gTab = null;
|
||||
var gDebuggee = null;
|
||||
var gDebugger = null;
|
||||
|
||||
const DEBUGGER_TAB_URL = "http://example.com/browser/browser/devtools/" +
|
||||
"debugger/test/" +
|
||||
"browser_dbg_debuggerstatement.html";
|
||||
const DEBUGGER_TAB_URL = EXAMPLE_URL + "browser_dbg_debuggerstatement.html";
|
||||
|
||||
function test() {
|
||||
debug_tab_pane(DEBUGGER_TAB_URL, function(aTab, aDebuggee, aPane) {
|
||||
|
@ -8,9 +8,7 @@
|
||||
|
||||
var gClient = null;
|
||||
var gTab = null;
|
||||
const DEBUGGER_TAB_URL = "http://example.com/browser/browser/devtools/" +
|
||||
"debugger/test/" +
|
||||
"browser_dbg_debuggerstatement.html";
|
||||
const DEBUGGER_TAB_URL = EXAMPLE_URL + "browser_dbg_debuggerstatement.html";
|
||||
|
||||
function test()
|
||||
{
|
||||
@ -34,7 +32,8 @@ function test_early_debugger_statement(aActor)
|
||||
gClient.addListener("paused", paused);
|
||||
// This should continue without nesting an event loop and calling
|
||||
// the onPaused hook, because we haven't attached yet.
|
||||
gTab.linkedBrowser.contentWindow.wrappedJSObject.runDebuggerStatement();
|
||||
// TODO: uncomment this when bug 723563 is fixed.
|
||||
//gTab.linkedBrowser.contentWindow.wrappedJSObject.runDebuggerStatement();
|
||||
|
||||
gClient.removeListener("paused", paused);
|
||||
|
||||
|
@ -87,7 +87,7 @@ function test_attach_removed_tab()
|
||||
});
|
||||
|
||||
gClient.request({ to: gTab2Actor, type: "attach" }, function(aResponse) {
|
||||
is(aResponse.type, "exited", "Tab should consider itself exited.");
|
||||
is(aResponse.error, "noSuchActor", "Tab should be gone.");
|
||||
finish_test();
|
||||
});
|
||||
}
|
||||
|
@ -83,7 +83,60 @@ function testSimpleCall() {
|
||||
|
||||
function resumeAndFinish() {
|
||||
gDebugger.StackFrames.activeThread.resume(function() {
|
||||
removeTab(gTab);
|
||||
finish();
|
||||
let vs = gDebugger.DebuggerView.Scripts;
|
||||
let ss = gDebugger.SourceScripts;
|
||||
|
||||
is(ss._trimUrlQuery("a/b/c.d?test=1&random=4"), "a/b/c.d",
|
||||
"Trimming the url query isn't done properly.");
|
||||
|
||||
let urls = [
|
||||
{ href: "ici://some.address.com/random/", leaf: "subrandom/" },
|
||||
{ href: "ni://another.address.org/random/subrandom/", leaf: "page.html" },
|
||||
{ href: "san://interesting.address.gro/random/", leaf: "script.js" },
|
||||
{ href: "si://interesting.address.moc/random/", leaf: "script.js" },
|
||||
{ href: "si://interesting.address.moc/random/", leaf: "x/script.js" },
|
||||
{ href: "si://interesting.address.moc/random/", leaf: "x/y/script.js?a=1" },
|
||||
{ href: "si://interesting.address.moc/random/x/", leaf: "y/script.js?a=1&b=2" },
|
||||
{ href: "si://interesting.address.moc/random/x/y/", leaf: "script.js?a=1&b=2&c=3" }
|
||||
];
|
||||
|
||||
vs._scripts.removeEventListener("select", vs._onScriptsChange, false);
|
||||
|
||||
urls.forEach(function(url) {
|
||||
executeSoon(function() {
|
||||
let loc = url.href + url.leaf;
|
||||
vs.addScript(ss._getScriptLabel(loc, url.href), { url: loc });
|
||||
});
|
||||
});
|
||||
|
||||
executeSoon(function() {
|
||||
for (let i = 0; i < vs._scripts.itemCount; i++) {
|
||||
let lab = vs._scripts.getItemAtIndex(i).getAttribute("label");
|
||||
let loc = urls[i].href + urls[i].leaf;
|
||||
|
||||
info("label: " + i + " " + lab);
|
||||
ok(vs.contains(loc), "Script url is incorrect: " + loc);
|
||||
}
|
||||
|
||||
ok(gDebugger.DebuggerView.Scripts.containsLabel("subrandom/"),
|
||||
"Script (0) label is incorrect.");
|
||||
ok(gDebugger.DebuggerView.Scripts.containsLabel("page.html"),
|
||||
"Script (1) label is incorrect.");
|
||||
ok(gDebugger.DebuggerView.Scripts.containsLabel("script.js"),
|
||||
"Script (2) label is incorrect.");
|
||||
ok(gDebugger.DebuggerView.Scripts.containsLabel("si://interesting.address.moc/random/script.js"),
|
||||
"Script (3) label is incorrect.");
|
||||
ok(gDebugger.DebuggerView.Scripts.containsLabel("x/script.js"),
|
||||
"Script (4) label is incorrect.");
|
||||
ok(gDebugger.DebuggerView.Scripts.containsLabel("x/y/script.js"),
|
||||
"Script (5) label is incorrect.");
|
||||
|
||||
is(vs._scripts.itemCount, 6,
|
||||
"Got too many script items in the list!");
|
||||
|
||||
|
||||
removeTab(gTab);
|
||||
finish();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -6,8 +6,7 @@
|
||||
* Make sure that the property view displays function parameters.
|
||||
*/
|
||||
|
||||
const TAB_URL = "http://example.com/browser/browser/devtools/debugger/test/" +
|
||||
"browser_dbg_frame-parameters.html";
|
||||
const TAB_URL = EXAMPLE_URL + "browser_dbg_frame-parameters.html";
|
||||
|
||||
var gPane = null;
|
||||
var gTab = null;
|
||||
|
@ -6,8 +6,7 @@
|
||||
* Make sure that the property view displays the properties of objects.
|
||||
*/
|
||||
|
||||
const TAB_URL = "http://example.com/browser/browser/devtools/debugger/test/" +
|
||||
"browser_dbg_frame-parameters.html";
|
||||
const TAB_URL = EXAMPLE_URL + "browser_dbg_frame-parameters.html";
|
||||
|
||||
var gPane = null;
|
||||
var gTab = null;
|
||||
|
@ -6,8 +6,8 @@
|
||||
* Make sure that switching the displayed script in the UI works as advertised.
|
||||
*/
|
||||
|
||||
const TAB_URL = "http://example.com/browser/browser/devtools/debugger/" +
|
||||
"test/browser_dbg_script-switching.html";
|
||||
const TAB_URL = EXAMPLE_URL + "browser_dbg_script-switching.html";
|
||||
|
||||
let tempScope = {};
|
||||
Cu.import("resource:///modules/source-editor.jsm", tempScope);
|
||||
let SourceEditor = tempScope.SourceEditor;
|
||||
@ -40,6 +40,24 @@ function testScriptsDisplay() {
|
||||
|
||||
is(gScripts.itemCount, 2, "Found the expected number of scripts.");
|
||||
|
||||
for (let i = 0; i < gScripts.itemCount; i++) {
|
||||
info("label: " + i + " " + gScripts.getItemAtIndex(i).getAttribute("label"));
|
||||
}
|
||||
|
||||
let label1 = "test-script-switching-01.js";
|
||||
let label2 = "test-script-switching-02.js";
|
||||
|
||||
ok(gDebugger.DebuggerView.Scripts.contains(EXAMPLE_URL +
|
||||
label1), "First script url is incorrect.");
|
||||
ok(gDebugger.DebuggerView.Scripts.contains(EXAMPLE_URL +
|
||||
label2), "Second script url is incorrect.");
|
||||
|
||||
ok(gDebugger.DebuggerView.Scripts.containsLabel(
|
||||
label1), "First script label is incorrect.");
|
||||
ok(gDebugger.DebuggerView.Scripts.containsLabel(
|
||||
label2), "Second script label is incorrect.");
|
||||
|
||||
|
||||
ok(gDebugger.editor.getText().search(/debugger/) != -1,
|
||||
"The correct script was loaded initially.");
|
||||
|
||||
|
@ -6,8 +6,8 @@
|
||||
* pane and highlights the proper line.
|
||||
*/
|
||||
|
||||
const TAB_URL = "http://example.com/browser/browser/devtools/debugger/" +
|
||||
"test/browser_dbg_script-switching.html";
|
||||
const TAB_URL = EXAMPLE_URL + "browser_dbg_script-switching.html";
|
||||
|
||||
let tempScope = {};
|
||||
Cu.import("resource:///modules/source-editor.jsm", tempScope);
|
||||
let SourceEditor = tempScope.SourceEditor;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user