Merge m-c to s-c (with resource merges in mobile/android/base/resources/drawable/).

--HG--
rename : mobile/android/base/resources/drawable-xlarge-mdpi-v11/tabs_button.xml => mobile/android/base/resources/drawable-xlarge-mdpi-v11/tabs_button.xml.in
rename : mobile/android/base/resources/drawable-xlarge-mdpi-v11/tabs_level.xml => mobile/android/base/resources/drawable-xlarge-mdpi-v11/tabs_level.xml.in
rename : mobile/android/base/resources/drawable/address_bar_url.xml => mobile/android/base/resources/drawable/address_bar_url.xml.in
rename : mobile/android/base/resources/drawable/menu_level.xml => mobile/android/base/resources/drawable/menu_level.xml.in
rename : mobile/android/base/resources/drawable/tabs_button.xml => mobile/android/base/resources/drawable/tabs_button.xml.in
rename : mobile/android/base/resources/drawable/tabs_level.xml => mobile/android/base/resources/drawable/tabs_level.xml.in
This commit is contained in:
Richard Newman 2012-12-02 00:32:38 -08:00
commit 90ef727123
914 changed files with 33779 additions and 14415 deletions

18
CLOBBER Normal file
View File

@ -0,0 +1,18 @@
# To Trigger a clobber replace ALL of the textual description below,
# giving a bug number and a one line description of why a clobber is
# required. Modifying this file will make configure check that a
# clobber has been performed before the build can continue.
#
# MERGE NOTE: When merging two branches that require a CLOBBER, you should
# merge both CLOBBER descriptions, to ensure that users on
# both branches correctly see the clobber warning.
#
# O <-- Users coming from both parents need to Clobber
# / \
# O O
# | |
# O <-- Clobber O <-- Clobber
#
# Note: The description below will be part of the error message shown to users.
#
Bug 816576 - libsoundtouch is now part of libxul and not a separate dynamic library.

View File

@ -72,13 +72,7 @@ EMBED_MANIFEST_AT = 2
include $(topsrcdir)/config/rules.mk
OS_LIBS = \
kernel32.lib \
rpcns4.lib \
rpcrt4.lib \
ole32.lib \
oleaut32.lib \
$(NULL)
OS_LIBS = $(call EXPAND_LIBNAME,uuid kernel32 rpcns4 rpcrt4 ole32 oleaut32)
# generate list of to-be-generated files that are missing
# but ignore special file dlldata.c

View File

@ -51,12 +51,7 @@ MIDL_GENERATED_FILES = \
SRCDIR_CSRCS = $(addprefix $(srcdir)/,$(CSRCS))
OS_LIBS = \
kernel32.lib \
rpcns4.lib \
rpcrt4.lib \
oleaut32.lib \
$(NULL)
OS_LIBS = $(call EXPAND_LIBNAME,kernel32 rpcns4 rpcrt4 oleaut32)
$(MIDL_GENERATED_FILES): done_gen

View File

@ -529,38 +529,48 @@ ApplicationAccessibleWrap::ApplicationAccessibleWrap():
} else {
MAI_LOG_DEBUG(("Fail to load lib: %s\n", sGail.libName));
}
}
}
MAI_LOG_DEBUG(("Mozilla Atk Implementation initializing\n"));
// XXX we can't do this in ApplicationAccessibleWrap's constructor because
// a11y::ApplicationAcc() will return null then which breaks atk's attempt to
// get the application's root accessible during initialization. this needs to
// be defined here because LoadGtkModule() and the library info is static. See
// bug 817133.
void
nsAccessNodeWrap::InitAccessibility()
{
if (!ShouldA11yBeEnabled())
return;
// Initialize the MAI Utility class, it will overwrite gail_util.
g_type_class_unref(g_type_class_ref(MAI_TYPE_UTIL));
// Initialize the MAI Utility class, it will overwrite gail_util.
g_type_class_unref(g_type_class_ref(MAI_TYPE_UTIL));
// Init atk-bridge now
PR_SetEnv("NO_AT_BRIDGE=0");
// load and initialize atk-bridge library
rv = LoadGtkModule(sAtkBridge);
if (NS_SUCCEEDED(rv)) {
(*sAtkBridge.init)();
} else {
MAI_LOG_DEBUG(("Fail to load lib: %s\n", sAtkBridge.libName));
}
if (!sToplevel_event_hook_added) {
sToplevel_event_hook_added = true;
sToplevel_show_hook =
g_signal_add_emission_hook(g_signal_lookup("show", GTK_TYPE_WINDOW),
0, toplevel_event_watcher,
reinterpret_cast<gpointer>(nsIAccessibleEvent::EVENT_SHOW), NULL);
sToplevel_hide_hook =
g_signal_add_emission_hook(g_signal_lookup("hide", GTK_TYPE_WINDOW),
0, toplevel_event_watcher,
reinterpret_cast<gpointer>(nsIAccessibleEvent::EVENT_HIDE), NULL);
}
// Init atk-bridge now
PR_SetEnv("NO_AT_BRIDGE=0");
nsresult rv = LoadGtkModule(sAtkBridge);
if (NS_SUCCEEDED(rv)) {
(*sAtkBridge.init)();
} else {
MAI_LOG_DEBUG(("Fail to load lib: %s\n", sAtkBridge.libName));
}
if (!sToplevel_event_hook_added) {
sToplevel_event_hook_added = true;
sToplevel_show_hook =
g_signal_add_emission_hook(g_signal_lookup("show", GTK_TYPE_WINDOW),
0, toplevel_event_watcher,
reinterpret_cast<gpointer>(nsIAccessibleEvent::EVENT_SHOW),
NULL);
sToplevel_hide_hook =
g_signal_add_emission_hook(g_signal_lookup("hide", GTK_TYPE_WINDOW), 0,
toplevel_event_watcher,
reinterpret_cast<gpointer>(nsIAccessibleEvent::EVENT_HIDE),
NULL);
}
}
ApplicationAccessibleWrap::~ApplicationAccessibleWrap()
{
MAI_LOG_DEBUG(("======Destory AppRootAcc=%p\n", (void*)this));

View File

@ -33,10 +33,6 @@ nsAccessNodeWrap::~nsAccessNodeWrap()
{
}
void nsAccessNodeWrap::InitAccessibility()
{
}
void nsAccessNodeWrap::ShutdownAccessibility()
{
}

View File

@ -176,10 +176,13 @@ static void
LogPresShell(nsIDocument* aDocumentNode)
{
nsIPresShell* ps = aDocumentNode->GetShell();
printf("presshell: %p, is %s destroying", static_cast<void*>(ps),
(ps->IsDestroying() ? "" : "not"));
nsIScrollableFrame *sf = ps ?
ps->GetRootScrollFrameAsScrollableExternal() : nullptr;
printf("presshell: %p", static_cast<void*>(ps));
nsIScrollableFrame* sf = nullptr;
if (ps) {
printf(", is %s destroying", (ps->IsDestroying() ? "" : "not"));
sf = ps->GetRootScrollFrameAsScrollable();
}
printf(", root scroll frame: %p", static_cast<void*>(sf));
}

View File

@ -87,7 +87,8 @@ TreeWalker::NextChildInternal(bool aNoWalkUp)
bool isSubtreeHidden = false;
Accessible* accessible = mWalkCache ? mDoc->GetAccessible(childNode) :
GetAccService()->GetOrCreateAccessible(childNode, mDoc, &isSubtreeHidden);
GetAccService()->GetOrCreateAccessible(childNode, mContext,
&isSubtreeHidden);
if (accessible)
return accessible;

View File

@ -110,7 +110,7 @@ static nsRoleMapEntry sWAIRoleMaps[] =
eNoValue,
eSortAction,
eNoLiveAttr,
kGenericAccType,
Accessible::eTableCellAccessible,
kNoReqStates,
eARIASelectable,
eARIAReadonly
@ -175,7 +175,7 @@ static nsRoleMapEntry sWAIRoleMaps[] =
eNoValue,
eNoAction,
eNoLiveAttr,
Accessible::eSelectAccessible,
Accessible::eSelectAccessible | Accessible::eTableAccessible,
states::FOCUSABLE,
eARIAMultiSelectable,
eARIAReadonly
@ -187,7 +187,7 @@ static nsRoleMapEntry sWAIRoleMaps[] =
eNoValue,
eNoAction,
eNoLiveAttr,
kGenericAccType,
Accessible::eTableCellAccessible,
kNoReqStates,
eARIASelectable,
eARIAReadonly
@ -429,7 +429,7 @@ static nsRoleMapEntry sWAIRoleMaps[] =
eNoValue,
eNoAction,
eNoLiveAttr,
kGenericAccType,
Accessible::eTableRowAccessible,
kNoReqStates,
eARIASelectable
},
@ -450,7 +450,7 @@ static nsRoleMapEntry sWAIRoleMaps[] =
eNoValue,
eSortAction,
eNoLiveAttr,
kGenericAccType,
Accessible::eTableCellAccessible,
kNoReqStates,
eARIASelectable,
eARIAReadonly
@ -603,7 +603,7 @@ static nsRoleMapEntry sWAIRoleMaps[] =
eNoValue,
eNoAction,
eNoLiveAttr,
Accessible::eSelectAccessible,
Accessible::eSelectAccessible | Accessible::eTableAccessible,
kNoReqStates,
eARIAReadonly,
eARIAMultiSelectable

View File

@ -208,33 +208,14 @@ nsAccessibilityService::GetRootDocumentAccessible(nsIPresShell* aPresShell,
already_AddRefed<Accessible>
nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame,
nsIContent* aContent,
DocAccessible* aDoc)
Accessible* aContext)
{
// We can have several cases here:
// 1) a text or html embedded document where the contentDocument variable in
// the object element holds the content;
// 2) web content that uses a plugin, which means we will have to go to
// the plugin to get the accessible content;
// 3) an image or imagemap, where the image frame points back to the object
// element DOMNode.
// nsObjectFrame means a plugin, so we need to use the accessibility support
// of the plugin.
if (aFrame->GetRect().IsEmpty())
return nullptr;
// 1) for object elements containing either HTML or TXT documents
nsCOMPtr<nsIDOMHTMLObjectElement> obj(do_QueryInterface(aContent));
if (obj) {
nsCOMPtr<nsIDOMDocument> domDoc;
obj->GetContentDocument(getter_AddRefs(domDoc));
if (domDoc) {
Accessible* newAcc = new OuterDocAccessible(aContent, aDoc);
NS_ADDREF(newAcc);
return newAcc;
}
}
#if defined(XP_WIN) || defined(MOZ_ACCESSIBILITY_ATK)
// 2) for plugins
nsRefPtr<nsNPAPIPluginInstance> pluginInstance;
if (NS_SUCCEEDED(aFrame->GetPluginInstance(getter_AddRefs(pluginInstance))) &&
pluginInstance) {
@ -244,7 +225,8 @@ nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame,
aFrame->GetPluginPort(&pluginPort);
Accessible* accessible =
new HTMLWin32ObjectOwnerAccessible(aContent, aDoc, pluginPort);
new HTMLWin32ObjectOwnerAccessible(aContent, aContext->Document(),
pluginPort);
NS_ADDREF(accessible);
return accessible;
@ -252,12 +234,14 @@ nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame,
if (!AtkSocketAccessible::gCanEmbed)
return nullptr;
// Note this calls into the plugin, so crazy things may happen and aFrame
// may go away.
nsCString plugId;
nsresult rv = pluginInstance->GetValueFromPlugin(
NPPVpluginNativeAccessibleAtkPlugId, &plugId);
if (NS_SUCCEEDED(rv) && !plugId.IsEmpty()) {
AtkSocketAccessible* socketAccessible =
new AtkSocketAccessible(aContent, aDoc, plugId);
new AtkSocketAccessible(aContent, aContext->Document(), plugId);
NS_ADDREF(socketAccessible);
return socketAccessible;
@ -266,11 +250,7 @@ nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame,
}
#endif
// 3) for images and imagemaps, or anything else with a child frame
// we have the object frame, get the image frame
nsIFrame* childFrame = aFrame->GetFirstPrincipalChild();
return childFrame ? CreateAccessibleByFrameType(childFrame, aContent, aDoc) :
nullptr;
return nullptr;
}
void
@ -678,17 +658,21 @@ nsAccessibilityService::IsLogged(const nsAString& aModule, bool* aIsLogged)
Accessible*
nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
DocAccessible* aDoc,
Accessible* aContext,
bool* aIsSubtreeHidden)
{
if (!aDoc || !aNode || gIsShutdown)
return nullptr;
NS_PRECONDITION(aContext && aNode && !gIsShutdown,
"Maybe let'd do a crash? Oh, yes, baby!");
if (aIsSubtreeHidden)
*aIsSubtreeHidden = false;
DocAccessible* document = aContext->Document();
// Check to see if we already have an accessible for this node in the cache.
Accessible* cachedAccessible = aDoc->GetAccessible(aNode);
// XXX: we don't have context check here. It doesn't really necessary until
// we have in-law children adoption.
Accessible* cachedAccessible = document->GetAccessible(aNode);
if (cachedAccessible)
return cachedAccessible;
@ -707,7 +691,7 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
return nullptr;
}
if (aNode->OwnerDoc() != aDoc->DocumentNode()) {
if (aNode->OwnerDoc() != document->DocumentNode()) {
NS_ERROR("Creating accessible for wrong document");
return nullptr;
}
@ -763,8 +747,8 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
return nullptr;
}
newAcc = CreateAccessibleByFrameType(frame, content, aDoc);
if (aDoc->BindToDocument(newAcc, nullptr)) {
newAcc = CreateAccessibleByFrameType(frame, content, aContext);
if (document->BindToDocument(newAcc, nullptr)) {
newAcc->AsTextLeaf()->SetText(text);
return newAcc;
}
@ -790,8 +774,8 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
return nullptr;
}
newAcc = new HyperTextAccessibleWrap(content, aDoc);
if (aDoc->BindToDocument(newAcc, aria::GetRoleMap(aNode)))
newAcc = new HyperTextAccessibleWrap(content, document);
if (document->BindToDocument(newAcc, aria::GetRoleMap(aNode)))
return newAcc;
return nullptr;
}
@ -802,115 +786,59 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
// it is referenced by ARIA relationship then treat role="presentation" on
// the element as the role is not there.
if (roleMapEntry && roleMapEntry->Is(nsGkAtoms::presentation)) {
if (!MustBeAccessible(content, aDoc))
if (!MustBeAccessible(content, document))
return nullptr;
roleMapEntry = nullptr;
}
if (!newAcc && isHTML) { // HTML accessibles
nsIAtom* frameType = frame->GetType();
bool partOfHTMLTable =
frameType == nsGkAtoms::tableCaptionFrame ||
frameType == nsGkAtoms::tableCellFrame ||
frameType == nsGkAtoms::tableRowGroupFrame ||
frameType == nsGkAtoms::tableRowFrame;
bool legalPartOfHTMLTable = partOfHTMLTable;
if (partOfHTMLTable) {
// Table-related frames don't get table-related roles
// unless they are inside a table, but they may still get generic
// accessibles
nsIContent *tableContent = content;
while ((tableContent = tableContent->GetParent()) != nullptr) {
nsIFrame *tableFrame = tableContent->GetPrimaryFrame();
if (!tableFrame)
continue;
if (tableFrame->GetType() == nsGkAtoms::tableOuterFrame) {
Accessible* tableAccessible = aDoc->GetAccessible(tableContent);
if (tableAccessible) {
if (!roleMapEntry) {
roles::Role role = tableAccessible->Role();
// No ARIA role and not in table: override role. For example,
// <table role="label"><td>content</td></table>
if (role != roles::TABLE && role != roles::TREE_TABLE)
roleMapEntry = &nsARIAMap::gEmptyRoleMap;
}
break;
}
#ifdef DEBUG
nsRoleMapEntry* tableRoleMapEntry = aria::GetRoleMap(tableContent);
NS_ASSERTION(tableRoleMapEntry && tableRoleMapEntry->Is(nsGkAtoms::presentation),
"No accessible for parent table and it didn't have role of presentation");
#endif
if (!roleMapEntry && !MustBeAccessible(content, aDoc)) {
// Table-related descendants of presentation table are also
// presentation if they aren't focusable and have not explicit ARIA
// role (don't create accessibles for them unless they need to fire
// focus events).
return nullptr;
}
// otherwise create ARIA based accessible.
legalPartOfHTMLTable = false;
break;
}
if (tableContent->Tag() == nsGkAtoms::table) {
// Stop before we are fooled by any additional table ancestors
// This table cell frameis part of a separate ancestor table.
legalPartOfHTMLTable = false;
break;
}
}
if (!tableContent)
legalPartOfHTMLTable = false;
}
if (roleMapEntry) {
// Create ARIA grid/treegrid accessibles if node is not a child or legal
// child of HTML table and is not a HTML table.
if ((!partOfHTMLTable || !legalPartOfHTMLTable) &&
frameType != nsGkAtoms::tableOuterFrame) {
if (roleMapEntry->role == roles::TABLE ||
roleMapEntry->role == roles::TREE_TABLE) {
newAcc = new ARIAGridAccessibleWrap(content, aDoc);
} else if (roleMapEntry->role == roles::GRID_CELL ||
roleMapEntry->role == roles::ROWHEADER ||
roleMapEntry->role == roles::COLUMNHEADER) {
newAcc = new ARIAGridCellAccessibleWrap(content, aDoc);
// Create pure ARIA grid/treegrid related accessibles if they weren't used
// on accessible HTML table elements.
if ((roleMapEntry->accTypes & Accessible::eTableCellAccessible)) {
if (aContext->IsOfType(Accessible::eTableRowAccessible) &&
(frame->AccessibleType() != eHTMLTableCellAccessible ||
aContext->GetContent() != content->GetParent())) {
newAcc = new ARIAGridCellAccessibleWrap(content, document);
}
} else if ((roleMapEntry->accTypes & Accessible::eTableAccessible) &&
frame->AccessibleType() != eHTMLTableAccessible) {
newAcc = new ARIAGridAccessibleWrap(content, document);
}
}
if (!newAcc) {
// Prefer to use markup (mostly tag name, perhaps attributes) to
// decide if and what kind of accessible to create.
// The method creates accessibles for table related content too therefore
// we do not call it if accessibles for table related content are
// prevented above.
newAcc = CreateHTMLAccessibleByMarkup(frame, content, aDoc,
legalPartOfHTMLTable);
// Prefer to use markup (mostly tag name, perhaps attributes) to decide if
// and what kind of accessible to create.
newAcc = CreateHTMLAccessibleByMarkup(frame, content, aContext);
// Try using frame to do it.
if (!newAcc && (!partOfHTMLTable || legalPartOfHTMLTable))
newAcc = CreateAccessibleByFrameType(frame, content, aDoc);
if (!newAcc)
newAcc = CreateAccessibleByFrameType(frame, content, aContext);
// If table has strong ARIA role then all table descendants shouldn't
// expose their native roles.
if (!roleMapEntry && newAcc) {
if (frame->AccessibleType() == eHTMLTableRowAccessible) {
nsRoleMapEntry* contextRoleMap = aContext->ARIARoleMap();
if (contextRoleMap &&
!(contextRoleMap->accTypes & Accessible::eTableAccessible))
roleMapEntry = &nsARIAMap::gEmptyRoleMap;
} else if (frame->AccessibleType() == eHTMLTableCellAccessible &&
aContext->ARIARoleMap() == &nsARIAMap::gEmptyRoleMap) {
roleMapEntry = &nsARIAMap::gEmptyRoleMap;
}
}
}
}
if (!newAcc) {
// Elements may implement nsIAccessibleProvider via XBL. This allows them to
// say what kind of accessible to create.
newAcc = CreateAccessibleByType(content, aDoc);
newAcc = CreateAccessibleByType(content, document);
}
if (!newAcc) {
@ -918,37 +846,37 @@ nsAccessibilityService::GetOrCreateAccessible(nsINode* aNode,
// on HTML elements
nsIAtom* tag = content->Tag();
if ((tag == nsGkAtoms::deck) || (tag == nsGkAtoms::tabpanels)) {
newAcc = new XULDeckAccessible(content, aDoc);
newAcc = new XULDeckAccessible(content, document);
} else if (content->IsSVG(nsGkAtoms::svg)) {
newAcc = new EnumRoleAccessible(content, aDoc, roles::DIAGRAM);
newAcc = new EnumRoleAccessible(content, document, roles::DIAGRAM);
} else if (content->IsMathML(nsGkAtoms::math)) {
newAcc = new EnumRoleAccessible(content, aDoc, roles::EQUATION);
newAcc = new EnumRoleAccessible(content, document, roles::EQUATION);
}
}
if (!newAcc)
newAcc = CreateAccessibleForDeckChild(frame, content, aDoc);
newAcc = CreateAccessibleForDeckChild(frame, content, document);
// If no accessible, see if we need to create a generic accessible because
// of some property that makes this object interesting
// We don't do this for <body>, <html>, <window>, <dialog> etc. which
// correspond to the doc accessible and will be created in any case
if (!newAcc && content->Tag() != nsGkAtoms::body && content->GetParent() &&
(roleMapEntry || MustBeAccessible(content, aDoc) ||
(roleMapEntry || MustBeAccessible(content, document) ||
(isHTML && nsCoreUtils::HasClickListener(content)))) {
// This content is focusable or has an interesting dynamic content accessibility property.
// If it's interesting we need it in the accessibility hierarchy so that events or
// other accessibles can point to it, or so that it can hold a state, etc.
if (isHTML) {
// Interesting HTML container which may have selectable text and/or embedded objects
newAcc = new HyperTextAccessibleWrap(content, aDoc);
newAcc = new HyperTextAccessibleWrap(content, document);
} else { // XUL, SVG, MathML etc.
// Interesting generic non-HTML container
newAcc = new AccessibleWrap(content, aDoc);
newAcc = new AccessibleWrap(content, document);
}
}
return aDoc->BindToDocument(newAcc, roleMapEntry) ? newAcc : nullptr;
return document->BindToDocument(newAcc, roleMapEntry) ? newAcc : nullptr;
}
////////////////////////////////////////////////////////////////////////////////
@ -1238,13 +1166,14 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
already_AddRefed<Accessible>
nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
nsIContent* aContent,
DocAccessible* aDoc,
bool aIsLegalPartOfHTMLTable)
Accessible* aContext)
{
if (aIsLegalPartOfHTMLTable) {
if (nsCoreUtils::IsHTMLTableHeader(aContent)) {
Accessible* accessible =
new HTMLTableHeaderCellAccessibleWrap(aContent, aDoc);
DocAccessible* document = aContext->Document();
if (aContext->IsOfType(Accessible::eTableRowAccessible)) {
if (nsCoreUtils::IsHTMLTableHeader(aContent) &&
aContext->GetContent() == aContent->GetParent()) {
Accessible* accessible = new HTMLTableHeaderCellAccessibleWrap(aContent,
document);
NS_ADDREF(accessible);
return accessible;
}
@ -1255,38 +1184,39 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
// This method assumes we're in an HTML namespace.
nsIAtom* tag = aContent->Tag();
if (tag == nsGkAtoms::figcaption) {
Accessible* accessible = new HTMLFigcaptionAccessible(aContent, aDoc);
Accessible* accessible = new HTMLFigcaptionAccessible(aContent, document);
NS_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::figure) {
Accessible* accessible = new HTMLFigureAccessible(aContent, aDoc);
Accessible* accessible = new HTMLFigureAccessible(aContent, document);
NS_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::legend) {
Accessible* accessible = new HTMLLegendAccessible(aContent, aDoc);
Accessible* accessible = new HTMLLegendAccessible(aContent, document);
NS_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::option) {
Accessible* accessible = new HTMLSelectOptionAccessible(aContent, aDoc);
Accessible* accessible = new HTMLSelectOptionAccessible(aContent, document);
NS_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::optgroup) {
Accessible* accessible = new HTMLSelectOptGroupAccessible(aContent, aDoc);
Accessible* accessible =
new HTMLSelectOptGroupAccessible(aContent, document);
NS_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::ul || tag == nsGkAtoms::ol ||
tag == nsGkAtoms::dl) {
Accessible* accessible = new HTMLListAccessible(aContent, aDoc);
Accessible* accessible = new HTMLListAccessible(aContent, document);
NS_ADDREF(accessible);
return accessible;
}
@ -1297,12 +1227,12 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
nsRoleMapEntry* roleMapEntry = aria::GetRoleMap(aContent);
if (roleMapEntry && roleMapEntry->role != roles::NOTHING &&
roleMapEntry->role != roles::LINK) {
Accessible* accessible = new HyperTextAccessibleWrap(aContent, aDoc);
Accessible* accessible = new HyperTextAccessibleWrap(aContent, document);
NS_ADDREF(accessible);
return accessible;
}
Accessible* accessible = new HTMLLinkAccessible(aContent, aDoc);
Accessible* accessible = new HTMLLinkAccessible(aContent, document);
NS_ADDREF(accessible);
return accessible;
}
@ -1310,7 +1240,7 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
if (tag == nsGkAtoms::dt || tag == nsGkAtoms::li) {
// Create list item accessible unconditionally by tag name. nsBlockFrame
// creates the list item accessible for other elements styled as list items.
Accessible* accessible = new HTMLLIAccessible(aContent, aDoc);
Accessible* accessible = new HTMLLIAccessible(aContent, document);
NS_ADDREF(accessible);
return accessible;
}
@ -1327,20 +1257,20 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
tag == nsGkAtoms::h5 ||
tag == nsGkAtoms::h6 ||
tag == nsGkAtoms::q) {
Accessible* accessible = new HyperTextAccessibleWrap(aContent, aDoc);
Accessible* accessible = new HyperTextAccessibleWrap(aContent, document);
NS_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::output) {
Accessible* accessible = new HTMLOutputAccessible(aContent, aDoc);
Accessible* accessible = new HTMLOutputAccessible(aContent, document);
NS_ADDREF(accessible);
return accessible;
}
if (tag == nsGkAtoms::progress) {
Accessible* accessible =
new HTMLProgressMeterAccessible(aContent, aDoc);
new HTMLProgressMeterAccessible(aContent, document);
NS_ADDREF(accessible);
return accessible;
}
@ -1351,86 +1281,109 @@ nsAccessibilityService::CreateHTMLAccessibleByMarkup(nsIFrame* aFrame,
already_AddRefed<Accessible>
nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame,
nsIContent* aContent,
DocAccessible* aDoc)
Accessible* aContext)
{
DocAccessible* document = aContext->Document();
nsRefPtr<Accessible> newAcc;
switch (aFrame->AccessibleType()) {
case eNoAccessible:
return nullptr;
case eHTMLBRAccessible:
newAcc = new HTMLBRAccessible(aContent, aDoc);
newAcc = new HTMLBRAccessible(aContent, document);
break;
case eHTMLButtonAccessible:
newAcc = new HTMLButtonAccessible(aContent, aDoc);
newAcc = new HTMLButtonAccessible(aContent, document);
break;
case eHTMLCanvasAccessible:
newAcc = new HTMLCanvasAccessible(aContent, aDoc);
newAcc = new HTMLCanvasAccessible(aContent, document);
break;
case eHTMLCaptionAccessible:
newAcc = new HTMLCaptionAccessible(aContent, aDoc);
if (aContext->IsOfType(Accessible::eTableAccessible) &&
aContext->GetContent() == aContent->GetParent()) {
newAcc = new HTMLCaptionAccessible(aContent, document);
}
break;
case eHTMLCheckboxAccessible:
newAcc = new HTMLCheckboxAccessible(aContent, aDoc);
newAcc = new HTMLCheckboxAccessible(aContent, document);
break;
case eHTMLComboboxAccessible:
newAcc = new HTMLComboboxAccessible(aContent, aDoc);
newAcc = new HTMLComboboxAccessible(aContent, document);
break;
case eHTMLFileInputAccessible:
newAcc = new HTMLFileInputAccessible(aContent, aDoc);
newAcc = new HTMLFileInputAccessible(aContent, document);
break;
case eHTMLGroupboxAccessible:
newAcc = new HTMLGroupboxAccessible(aContent, aDoc);
newAcc = new HTMLGroupboxAccessible(aContent, document);
break;
case eHTMLHRAccessible:
newAcc = new HTMLHRAccessible(aContent, aDoc);
newAcc = new HTMLHRAccessible(aContent, document);
break;
case eHTMLImageMapAccessible:
newAcc = new HTMLImageMapAccessible(aContent, aDoc);
newAcc = new HTMLImageMapAccessible(aContent, document);
break;
case eHTMLLabelAccessible:
newAcc = new HTMLLabelAccessible(aContent, aDoc);
newAcc = new HTMLLabelAccessible(aContent, document);
break;
case eHTMLLiAccessible:
newAcc = new HTMLLIAccessible(aContent, aDoc);
newAcc = new HTMLLIAccessible(aContent, document);
break;
case eHTMLSelectListAccessible:
newAcc = new HTMLSelectListAccessible(aContent, aDoc);
newAcc = new HTMLSelectListAccessible(aContent, document);
break;
case eHTMLMediaAccessible:
newAcc = new EnumRoleAccessible(aContent, aDoc, roles::GROUPING);
newAcc = new EnumRoleAccessible(aContent, document, roles::GROUPING);
break;
case eHTMLObjectFrameAccessible: {
nsObjectFrame* objectFrame = do_QueryFrame(aFrame);
newAcc = CreateHTMLObjectFrameAccessible(objectFrame, aContent, aDoc);
newAcc = CreateHTMLObjectFrameAccessible(objectFrame, aContent, aContext);
break;
}
case eHTMLRadioButtonAccessible:
newAcc = new HTMLRadioButtonAccessible(aContent, aDoc);
newAcc = new HTMLRadioButtonAccessible(aContent, document);
break;
case eHTMLTableAccessible:
newAcc = new HTMLTableAccessibleWrap(aContent, aDoc);
newAcc = new HTMLTableAccessibleWrap(aContent, document);
break;
case eHTMLTableCellAccessible:
newAcc = new HTMLTableCellAccessibleWrap(aContent, aDoc);
// Accessible HTML table cell must be a child of accessible HTML table row.
if (aContext->IsOfType(Accessible::eHTMLTableRowAccessible))
newAcc = new HTMLTableCellAccessibleWrap(aContent, document);
break;
case eHTMLTableRowAccessible:
newAcc = new EnumRoleAccessible(aContent, aDoc, roles::ROW);
case eHTMLTableRowAccessible: {
// Accessible HTML table row must be a child of tbody/tfoot/thead of
// accessible HTML table or must be a child of accessible of HTML table.
if (aContext->IsOfType(Accessible::eTableAccessible)) {
nsIContent* parentContent = aContent->GetParent();
nsIFrame* parentFrame = parentContent->GetPrimaryFrame();
if (parentFrame->GetType() == nsGkAtoms::tableRowGroupFrame) {
parentContent = parentContent->GetParent();
parentFrame = parentContent->GetPrimaryFrame();
}
if (parentFrame->GetType() == nsGkAtoms::tableOuterFrame &&
aContext->GetContent() == parentContent) {
newAcc = new HTMLTableRowAccessible(aContent, document);
}
}
break;
}
case eHTMLTextFieldAccessible:
newAcc = new HTMLTextFieldAccessible(aContent, aDoc);
newAcc = new HTMLTextFieldAccessible(aContent, document);
break;
case eHyperTextAccessible:
newAcc = new HyperTextAccessibleWrap(aContent, aDoc);
newAcc = new HyperTextAccessibleWrap(aContent, document);
break;
case eImageAccessible:
newAcc = new ImageAccessibleWrap(aContent, aDoc);
newAcc = new ImageAccessibleWrap(aContent, document);
break;
case eOuterDocAccessible:
newAcc = new OuterDocAccessible(aContent, aDoc);
newAcc = new OuterDocAccessible(aContent, document);
break;
case eTextLeafAccessible:
newAcc = new TextLeafAccessibleWrap(aContent, aDoc);
newAcc = new TextLeafAccessibleWrap(aContent, document);
break;
}

View File

@ -83,7 +83,7 @@ public:
bool aCanCreate);
already_AddRefed<Accessible>
CreateHTMLObjectFrameAccessible(nsObjectFrame* aFrame, nsIContent* aContent,
DocAccessible* aDoc);
Accessible* aContext);
/**
* Adds/remove ATK root accessible for gtk+ native window to/from children
@ -155,11 +155,11 @@ public:
* one.
*
* @param aNode [in] the given node
* @param aDoc [in] the doc accessible of the node
* @param aContext [in] context the accessible is created in
* @param aIsSubtreeHidden [out, optional] indicates whether the node's
* frame and its subtree is hidden
*/
Accessible* GetOrCreateAccessible(nsINode* aNode, DocAccessible* aDoc,
Accessible* GetOrCreateAccessible(nsINode* aNode, Accessible* aContext,
bool* aIsSubtreeHidden = nullptr);
private:
@ -192,15 +192,14 @@ private:
*/
already_AddRefed<Accessible>
CreateHTMLAccessibleByMarkup(nsIFrame* aFrame, nsIContent* aContent,
DocAccessible* aDoc,
bool aIsLegalPartOfHTMLTable);
Accessible* aContext);
/**
* Create an accessible whose type depends on the given frame.
*/
already_AddRefed<Accessible>
CreateAccessibleByFrameType(nsIFrame* aFrame, nsIContent* aContent,
DocAccessible* aDoc);
Accessible* aContext);
/**
* Create accessible if parent is a deck frame.

View File

@ -172,8 +172,12 @@ public:
/**
* Return true if ARIA role is specified on the element.
*/
bool HasARIARole() const
{ return mRoleMapEntry; }
bool HasARIARole() const { return mRoleMapEntry; }
/**
* Retrun ARIA role map if any.
*/
nsRoleMapEntry* ARIARoleMap() const { return mRoleMapEntry; }
/**
* Return accessible role specified by ARIA (see constants in
@ -692,6 +696,11 @@ public:
*/
bool HasOwnContent() const { return mContent && !(mFlags & eSharedNode); }
/**
* Return true if accessible is of given type.
*/
bool IsOfType(uint32_t aType) const { return mFlags & aType; }
/**
* Return true if the accessible has a numeric value.
*/
@ -778,17 +787,21 @@ public: // XXX: a small hack to make these visible for nsARIAMap
eHyperTextAccessible = 1 << 12,
eHTMLFileInputAccessible = 1 << 13,
eHTMLListItemAccessible = 1 << 14,
eImageAccessible = 1 << 15,
eImageMapAccessible = 1 << 16,
eListControlAccessible = 1 << 17,
eMenuButtonAccessible = 1 << 18,
eMenuPopupAccessible = 1 << 19,
eProgressAccessible = 1 << 20,
eRootAccessible = 1 << 21,
eSelectAccessible = 1 << 22,
eTextLeafAccessible = 1 << 23,
eXULDeckAccessible = 1 << 24,
eXULTreeAccessible = 1 << 25
eHTMLTableRowAccessible = 1 << 15,
eImageAccessible = 1 << 16,
eImageMapAccessible = 1 << 17,
eListControlAccessible = 1 << 18,
eMenuButtonAccessible = 1 << 19,
eMenuPopupAccessible = 1 << 20,
eProgressAccessible = 1 << 21,
eRootAccessible = 1 << 22,
eSelectAccessible = 1 << 23,
eTableAccessible = 1 << 24,
eTableCellAccessible = 1 << 25,
eTableRowAccessible = 1 << 26,
eTextLeafAccessible = 1 << 27,
eXULDeckAccessible = 1 << 28,
eXULTreeAccessible = 1 << 29
};
protected:

View File

@ -145,7 +145,7 @@ HTMLSelectListAccessible::CacheOptSiblings(nsIContent* aParentContent)
// Get an accessible for option or optgroup and cache it.
nsRefPtr<Accessible> accessible =
GetAccService()->GetOrCreateAccessible(childContent, mDoc);
GetAccService()->GetOrCreateAccessible(childContent, this);
if (accessible)
AppendChild(accessible);

View File

@ -321,6 +321,19 @@ HTMLTableHeaderCellAccessible::NativeRole()
return roles::COLUMNHEADER;
}
////////////////////////////////////////////////////////////////////////////////
// HTMLTableRowAccessible
////////////////////////////////////////////////////////////////////////////////
NS_IMPL_ISUPPORTS_INHERITED0(HTMLTableRowAccessible, Accessible)
role
HTMLTableRowAccessible::NativeRole()
{
return roles::ROW;
}
////////////////////////////////////////////////////////////////////////////////
// HTMLTableAccessible
////////////////////////////////////////////////////////////////////////////////
@ -329,6 +342,7 @@ HTMLTableAccessible::
HTMLTableAccessible(nsIContent* aContent, DocAccessible* aDoc) :
AccessibleWrap(aContent, aDoc), xpcAccessibleTable(this)
{
mFlags |= eTableAccessible;
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -85,6 +85,24 @@ public:
};
/**
* HTML table row accessible (html:tr).
*/
class HTMLTableRowAccessible : public AccessibleWrap
{
public:
HTMLTableRowAccessible(nsIContent* aContent, DocAccessible* aDoc) :
AccessibleWrap(aContent, aDoc)
{ mFlags |= eTableRowAccessible | eHTMLTableRowAccessible; }
virtual ~HTMLTableRowAccessible() { }
NS_DECL_ISUPPORTS_INHERITED
// Accessible
virtual a11y::role NativeRole();
};
/**
* HTML table accessible (html:table).
*/

View File

@ -28,6 +28,7 @@ XULTreeGridAccessible::
XULTreeGridAccessible(nsIContent* aContent, DocAccessible* aDoc) :
XULTreeAccessible(aContent, aDoc), xpcAccessibleTable(this)
{
mFlags |= eTableAccessible;
}
////////////////////////////////////////////////////////////////////////////////
@ -279,6 +280,8 @@ XULTreeGridRowAccessible::
nsITreeView* aTreeView, int32_t aRow) :
XULTreeItemAccessibleBase(aContent, aDoc, aTreeAcc, aTree, aTreeView, aRow)
{
mFlags |= eTableRowAccessible;
mAccessibleCache.Init(kDefaultTreeCacheSize);
}

View File

@ -369,6 +369,9 @@ function testAccessibleTree(aAccOrElmOrID, aAccTree)
testStates(acc, statesObj.states, statesObj.extraStates,
statesObj.absentStates, statesObj.absentExtraStates);
} else if (prop == "tagName") {
is(accTree[prop], acc.DOMNode.tagName, msg);
} else if (prop != "children") {
is(acc[prop], accTree[prop], msg);
}

View File

@ -115,7 +115,8 @@
//////////////////////////////////////////////////////////////////////////
// test gEmptyRoleMap
testRole("cell", ROLE_NOTHING);
testRole("buttontable_row", ROLE_NOTHING);
testRole("buttontable_cell", ROLE_NOTHING);
// abstract roles
var abstract_roles = ["composite", "landmark", "structure", "widget",
@ -275,8 +276,8 @@
<!-- test gEmptyRoleMap -->
<table role="button">
<tr>
<td id="cell">cell</td>
<tr id="buttontable_row">
<td id="buttontable_cell">cell</td>
</tr>
</table>

View File

@ -21,7 +21,7 @@
src="../events.js"></script>
<script type="application/javascript">
//gA11yEventDumpToConsole = true; // debug stuff
gA11yEventDumpToConsole = true; // debug stuff
var gLinkWindow = null;
function closeDocChecker()
@ -86,9 +86,11 @@
testStates("link_traversed", 0, 0, STATE_TRAVERSED);
// a: traversed state
enableLogging("docload"); // debug stuff
gQueue = new eventQueue();
gQueue.push(new clickLink("link_traversed"));
gQueue.onFinish = function() { gLinkWindow.close(); }
gQueue.onFinish = function() { gLinkWindow.close(); disableLogging(); }
gQueue.invoke(); // will call SimpleTest.finsih();
}

View File

@ -32,6 +32,124 @@
testAccessibleTree("grid", accTree);
//////////////////////////////////////////////////////////////////////////
// crazy grids (mad mix of ARIA and HTML tables)
accTree = {
role: ROLE_TABLE,
children: [
{ // div@role="row"
role: ROLE_ROW,
tagName: "DIV",
children: [
{ // caption text leaf
role: ROLE_TEXT_LEAF,
name: "caption",
children: [ ]
},
{ // th text leaf
role: ROLE_TEXT_LEAF,
name: "header1",
children: [ ]
},
{ // td@role="columnheader"
role: ROLE_COLUMNHEADER,
name: "header2",
children: [ { TEXT_LEAF: [ ] } ]
}
]
}
]
};
testAccessibleTree("crazy_grid1", accTree);
accTree = {
role: ROLE_TABLE,
children: [
{ // tr@role="row"
role: ROLE_ROW,
tagName: "TR",
children: [
{ // td text leaf
role: ROLE_TEXT_LEAF,
name: "cell1",
children: [ ]
},
{ // td@role="gridcell"
role: ROLE_GRID_CELL,
name: "cell2",
children: [ { TEXT_LEAF: [ ] } ]
}
]
}
]
};
testAccessibleTree("crazy_grid2", accTree);
accTree = {
role: ROLE_TABLE,
children: [
{ // div@role="row"
role: ROLE_ROW,
children: [
{ // div@role="gridcell"
role: ROLE_GRID_CELL,
children: [
{ // text leaf from presentational table
role: ROLE_TEXT_LEAF,
name: "cell3",
children: [ ]
},
]
}
]
}
]
};
testAccessibleTree("crazy_grid3", accTree);
accTree = {
role: ROLE_TABLE,
children: [
{ // div@role="row"
role: ROLE_ROW,
children: [
{ // div@role="gridcell"
role: ROLE_GRID_CELL,
children: [
{ // table
role: ROLE_TABLE,
children: [
{ // tr
role: ROLE_ROW,
children: [
{ // td
role: ROLE_CELL,
children: [
{ // caption text leaf of presentational table
role: ROLE_TEXT_LEAF,
name: "caption",
children: [ ]
},
{ // td text leaf of presentational table
role: ROLE_TEXT_LEAF,
name: "cell4",
children: [ ]
}
]
}
]
}
]
}
]
}
]
}
]
};
testAccessibleTree("crazy_grid4", accTree);
SimpleTest.finish();
}
@ -59,5 +177,55 @@
</div>
</div>
</div>
<div id="crazy_grid1" role="grid">
<div role="row">
<table role="presentation">
<caption>caption</caption>
<tr>
<th>header1</th>
<td role="columnheader">header2</td>
</tr>
</table>
</div>
</div>
<div id="crazy_grid2" role="grid">
<table role="presentation">
<tr role="row">
<td id="ct_cell1">cell1</td>
<td role="gridcell">cell2</td>
</tr>
</table>
</div>
<div id="crazy_grid3" role="grid">
<div role="row">
<div role="gridcell">
<table role="presentation">
<tr>
<td>cell3</td>
</tr>
</table>
</div>
</div>
</div>
<div id="crazy_grid4" role="grid">
<div role="row">
<div role="gridcell">
<table>
<tr>
<td>
<table role="presentation">
<caption>caption</caption>
<tr><td>cell4</td></tr>
</table>
</td>
</tr>
</table>
</div>
</div>
</div>
</body>
</html>

View File

@ -27,7 +27,6 @@
var tree =
{ PUSHBUTTON: [ // table
{ NOTHING: [ // tbody
{ NOTHING: [ // tr
{ NOTHING: [ // th
{ TEXT_LEAF: [ ] }
@ -35,8 +34,7 @@
{ NOTHING: [ // td
{ TEXT_LEAF: [ ] }
] }
] },
] },
] }
] };
testAccessibleTree("button_table", tree);

657
b2g/app/BootAnimation.cpp Normal file
View File

@ -0,0 +1,657 @@
/* Copyright 2012 Mozilla Foundation and Mozilla contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <GLES2/gl2.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <algorithm>
#include <endian.h>
#include <fcntl.h>
#include <string>
#include <sys/mman.h>
#include <sys/stat.h>
#include <vector>
#include "mozilla/Util.h"
#include "mozilla/NullPtr.h"
#include "png.h"
#include "android/log.h"
#include "ui/FramebufferNativeWindow.h"
#include "hardware_legacy/power.h"
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "Gonk" , ## args)
#define LOGW(args...) __android_log_print(ANDROID_LOG_WARN, "Gonk", ## args)
#define LOGE(args...) __android_log_print(ANDROID_LOG_ERROR, "Gonk", ## args)
using namespace android;
using namespace mozilla;
using namespace std;
static sp<FramebufferNativeWindow> gNativeWindow;
static pthread_t sAnimationThread;
static bool sRunAnimation;
/* See http://www.pkware.com/documents/casestudies/APPNOTE.TXT */
struct local_file_header {
uint32_t signature;
uint16_t min_version;
uint16_t general_flag;
uint16_t compression;
uint16_t lastmod_time;
uint16_t lastmod_date;
uint32_t crc32;
uint32_t compressed_size;
uint32_t uncompressed_size;
uint16_t filename_size;
uint16_t extra_field_size;
char data[0];
uint32_t GetDataSize() const
{
return letoh32(uncompressed_size);
}
uint32_t GetSize() const
{
/* XXX account for data descriptor */
return sizeof(local_file_header) + letoh16(filename_size) +
letoh16(extra_field_size) + GetDataSize();
}
const char * GetData() const
{
return data + letoh16(filename_size) + letoh16(extra_field_size);
}
} __attribute__((__packed__));
struct data_descriptor {
uint32_t crc32;
uint32_t compressed_size;
uint32_t uncompressed_size;
} __attribute__((__packed__));
struct cdir_entry {
uint32_t signature;
uint16_t creator_version;
uint16_t min_version;
uint16_t general_flag;
uint16_t compression;
uint16_t lastmod_time;
uint16_t lastmod_date;
uint32_t crc32;
uint32_t compressed_size;
uint32_t uncompressed_size;
uint16_t filename_size;
uint16_t extra_field_size;
uint16_t file_comment_size;
uint16_t disk_num;
uint16_t internal_attr;
uint32_t external_attr;
uint32_t offset;
char data[0];
uint32_t GetDataSize() const
{
return letoh32(compressed_size);
}
uint32_t GetSize() const
{
return sizeof(cdir_entry) + letoh16(filename_size) +
letoh16(extra_field_size) + letoh16(file_comment_size);
}
bool Valid() const
{
return signature == htole32(0x02014b50);
}
} __attribute__((__packed__));
struct cdir_end {
uint32_t signature;
uint16_t disk_num;
uint16_t cdir_disk;
uint16_t disk_entries;
uint16_t cdir_entries;
uint32_t cdir_size;
uint32_t cdir_offset;
uint16_t comment_size;
char comment[0];
bool Valid() const
{
return signature == htole32(0x06054b50);
}
} __attribute__((__packed__));
/* We don't have access to libjar and the zip reader in android
* doesn't quite fit what we want to do. */
class ZipReader {
const char *mBuf;
const cdir_end *mEnd;
const char *mCdir_limit;
uint32_t mBuflen;
public:
ZipReader() : mBuf(nullptr) {}
~ZipReader() {
if (mBuf)
munmap((void *)mBuf, mBuflen);
}
bool OpenArchive(const char *path)
{
int fd;
do {
fd = open(path, O_RDONLY);
} while (fd == -1 && errno == EINTR);
if (fd == -1)
return false;
struct stat sb;
if (fstat(fd, &sb) == -1 || sb.st_size < sizeof(cdir_end)) {
close(fd);
return false;
}
mBuflen = sb.st_size;
mBuf = (char *)mmap(nullptr, sb.st_size, PROT_READ, MAP_SHARED, fd, 0);
close(fd);
if (!mBuf) {
return false;
}
madvise(mBuf, sb.st_size, MADV_SEQUENTIAL);
mEnd = (cdir_end *)(mBuf + mBuflen - sizeof(cdir_end));
while (!mEnd->Valid() &&
(char *)mEnd > mBuf) {
mEnd = (cdir_end *)((char *)mEnd - 1);
}
mCdir_limit = mBuf + letoh32(mEnd->cdir_offset) + letoh32(mEnd->cdir_size);
if (!mEnd->Valid() || mCdir_limit > (char *)mEnd) {
munmap((void *)mBuf, mBuflen);
mBuf = nullptr;
return false;
}
return true;
}
/* Pass null to get the first cdir entry */
const cdir_entry * GetNextEntry(const cdir_entry *prev)
{
const cdir_entry *entry;
if (prev)
entry = (cdir_entry *)((char *)prev + prev->GetSize());
else
entry = (cdir_entry *)(mBuf + letoh32(mEnd->cdir_offset));
if (((char *)entry + entry->GetSize()) > mCdir_limit ||
!entry->Valid())
return nullptr;
return entry;
}
string GetEntryName(const cdir_entry *entry)
{
uint16_t len = letoh16(entry->filename_size);
string name;
name.append(entry->data, len);
return name;
}
const local_file_header * GetLocalEntry(const cdir_entry *entry)
{
const local_file_header * data =
(local_file_header *)(mBuf + letoh32(entry->offset));
if (((char *)data + data->GetSize()) > (char *)mEnd)
return nullptr;
return data;
}
};
struct AnimationFrame {
char path[256];
char *buf;
uint16_t width;
uint16_t height;
const local_file_header *file;
AnimationFrame() : buf(nullptr) {}
AnimationFrame(const AnimationFrame &frame) : buf(nullptr) {
strncpy(path, frame.path, sizeof(path));
file = frame.file;
}
~AnimationFrame()
{
if (buf)
free(buf);
}
bool operator<(const AnimationFrame &other) const
{
return strcmp(path, other.path) < 0;
}
void ReadPngFrame();
};
struct AnimationPart {
int32_t count;
int32_t pause;
char path[256];
vector<AnimationFrame> frames;
};
using namespace android;
struct RawReadState {
const char *start;
uint32_t offset;
uint32_t length;
};
static void
RawReader(png_structp png_ptr, png_bytep data, png_size_t length)
{
RawReadState *state = (RawReadState *)png_get_io_ptr(png_ptr);
if (length > (state->length - state->offset))
png_err(png_ptr);
memcpy(data, state->start + state->offset, length);
state->offset += length;
}
void
AnimationFrame::ReadPngFrame()
{
png_structp pngread = png_create_read_struct(PNG_LIBPNG_VER_STRING,
nullptr, nullptr, nullptr);
png_infop pnginfo = png_create_info_struct(pngread);
RawReadState state;
state.start = file->GetData();
state.length = file->GetDataSize();
state.offset = 0;
png_set_read_fn(pngread, &state, RawReader);
setjmp(png_jmpbuf(pngread));
png_read_info(pngread, pnginfo);
width = png_get_image_width(pngread, pnginfo);
height = png_get_image_height(pngread, pnginfo);
buf = (char *)malloc(width * height * 3);
vector<char *> rows(height + 1);
uint32_t stride = width * 3;
for (int i = 0; i < height; i++) {
rows[i] = buf + (stride * i);
}
rows[height] = nullptr;
png_set_palette_to_rgb(pngread);
png_read_image(pngread, (png_bytepp)&rows.front());
png_destroy_read_struct(&pngread, &pnginfo, nullptr);
}
static const EGLint kEGLConfigAttribs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
EGL_NONE
};
static bool
CreateConfig(EGLConfig* aConfig, EGLDisplay display, int format)
{
EGLConfig configs[64];
EGLint ncfg = ArrayLength(configs);
if (!eglChooseConfig(display, kEGLConfigAttribs,
configs, ncfg, &ncfg) ||
ncfg < 1) {
return false;
}
for (int j = 0; j < ncfg; ++j) {
EGLConfig config = configs[j];
EGLint id;
if (eglGetConfigAttrib(display, config,
EGL_NATIVE_VISUAL_ID, &id) &&
id > 0 && id == format)
{
*aConfig = config;
return true;
}
}
return false;
}
static void *
AnimationThread(void *)
{
ZipReader reader;
if (!reader.OpenArchive("/system/media/bootanimation.zip")) {
LOGW("Could not open boot animation");
return nullptr;
}
EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
eglInitialize(display, nullptr, nullptr);
int format;
ANativeWindow const * const window = gNativeWindow.get();
window->query(window, NATIVE_WINDOW_FORMAT, &format);
EGLConfig config = NULL;
CreateConfig(&config, display, format);
if (!config) {
LOGW("Could not find config for pixel format");
return nullptr;
}
EGLSurface surface = eglCreateWindowSurface(display, config, gNativeWindow.get(), nullptr);
const cdir_entry *entry = nullptr;
const local_file_header *file = nullptr;
while ((entry = reader.GetNextEntry(entry))) {
string name = reader.GetEntryName(entry);
if (!name.compare("desc.txt")) {
file = reader.GetLocalEntry(entry);
break;
}
}
if (!file) {
LOGW("Could not find desc.txt in boot animation");
return nullptr;
}
string descCopy;
descCopy.append(file->GetData(), entry->GetDataSize());
int32_t width, height, fps;
const char *line = descCopy.c_str();
const char *end;
bool headerRead = true;
vector<AnimationPart> parts;
/*
* bootanimation.zip
*
* This is the boot animation file format that Android uses.
* It's a zip file with a directories containing png frames
* and a desc.txt that describes how they should be played.
*
* desc.txt contains two types of lines
* 1. [width] [height] [fps]
* There is one of these lines per bootanimation.
* If the width and height are smaller than the screen,
* the frames are centered on a black background.
* XXX: Currently we stretch instead of centering the frame.
* 2. p [count] [pause] [path]
* This describes one animation part.
* Each animation part is played in sequence.
* An animation part contains all the files/frames in the
* directory specified in [path]
* [count] indicates the number of times this part repeats.
* [pause] indicates the number of frames that this part
* should pause for after playing the full sequence but
* before repeating.
*/
do {
end = strstr(line, "\n");
AnimationPart part;
if (headerRead &&
sscanf(line, "%d %d %d", &width, &height, &fps) == 3) {
headerRead = false;
} else if (sscanf(line, "p %d %d %s",
&part.count, &part.pause, part.path)) {
parts.push_back(part);
}
} while (end && *(line = end + 1));
for (uint32_t i = 0; i < parts.size(); i++) {
AnimationPart &part = parts[i];
entry = nullptr;
char search[256];
snprintf(search, sizeof(search), "%s/", part.path);
while ((entry = reader.GetNextEntry(entry))) {
string name = reader.GetEntryName(entry);
if (name.find(search) ||
!entry->GetDataSize() ||
name.length() >= 256)
continue;
part.frames.push_back();
AnimationFrame &frame = part.frames.back();
strcpy(frame.path, name.c_str());
frame.file = reader.GetLocalEntry(entry);
}
sort(part.frames.begin(), part.frames.end());
}
static EGLint gContextAttribs[] = {
EGL_CONTEXT_CLIENT_VERSION, 2,
EGL_NONE, 0
};
EGLContext context = eglCreateContext(display, config, EGL_NO_CONTEXT, gContextAttribs);
eglMakeCurrent(display, surface, surface, context);
glEnable(GL_TEXTURE_2D);
const char *vsString =
"attribute vec2 aPosition; "
"attribute vec2 aTexCoord; "
"varying vec2 vTexCoord; "
"void main() { "
" gl_Position = vec4(aPosition, 0.0, 1.0); "
" vTexCoord = aTexCoord; "
"}";
const char *fsString =
"precision mediump float; "
"varying vec2 vTexCoord; "
"uniform sampler2D sTexture; "
"void main() { "
" gl_FragColor = vec4(texture2D(sTexture, vTexCoord).rgb, 1.0); "
"}";
GLint status;
GLuint vsh = glCreateShader(GL_VERTEX_SHADER);
glShaderSource(vsh, 1, &vsString, nullptr);
glCompileShader(vsh);
glGetShaderiv(vsh, GL_COMPILE_STATUS, &status);
if (!status) {
LOGE("Failed to compile vertex shader");
return nullptr;
}
GLuint fsh = glCreateShader(GL_FRAGMENT_SHADER);
glShaderSource(fsh, 1, &fsString, nullptr);
glCompileShader(fsh);
glGetShaderiv(fsh, GL_COMPILE_STATUS, &status);
if (!status) {
LOGE("Failed to compile fragment shader");
return nullptr;
}
GLuint programId = glCreateProgram();
glAttachShader(programId, vsh);
glAttachShader(programId, fsh);
glLinkProgram(programId);
glGetProgramiv(programId, GL_LINK_STATUS, &status);
if (!status) {
LOG("Failed to link program");
return nullptr;
}
GLint positionLoc = glGetAttribLocation(programId, "aPosition");
GLint texCoordLoc = glGetAttribLocation(programId, "aTexCoord");
GLint textureLoc = glGetUniformLocation(programId, "sTexture");
glUseProgram(programId);
GLfloat texCoords[] = { 0.0f, 1.0f,
0.0f, 0.0f,
1.0f, 1.0f,
1.0f, 0.0f };
GLfloat vCoords[] = { -1.0f, -1.0f,
-1.0f, 1.0f,
1.0f, -1.0f,
1.0f, 1.0f };
GLuint rectBuf, texBuf;
glGenBuffers(1, &rectBuf);
glGenBuffers(1, &texBuf);
GLuint tex;
glGenTextures(1, &tex);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glEnableVertexAttribArray(positionLoc);
glBindBuffer(GL_ARRAY_BUFFER, rectBuf);
glBufferData(GL_ARRAY_BUFFER, sizeof(vCoords), vCoords, GL_STATIC_DRAW);
glVertexAttribPointer(positionLoc, 2, GL_FLOAT, GL_FALSE, 0, 0);
glEnableVertexAttribArray(texCoordLoc);
glBindBuffer(GL_ARRAY_BUFFER, texBuf);
glBufferData(GL_ARRAY_BUFFER, sizeof(texCoords), texCoords, GL_STATIC_DRAW);
glVertexAttribPointer(texCoordLoc, 2, GL_FLOAT, GL_FALSE, 0, 0);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glUniform1i(textureLoc, 0);
uint32_t frameDelayUs = 1000000 / fps;
for (uint32_t i = 0; i < parts.size(); i++) {
AnimationPart &part = parts[i];
uint32_t j = 0;
while (sRunAnimation && (!part.count || j++ < part.count)) {
for (uint32_t k = 0; k < part.frames.size(); k++) {
struct timeval tv1, tv2;
gettimeofday(&tv1, nullptr);
AnimationFrame &frame = part.frames[k];
if (!frame.buf) {
frame.ReadPngFrame();
}
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB,
frame.width, frame.height, 0,
GL_RGB, GL_UNSIGNED_BYTE, frame.buf);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
gettimeofday(&tv2, nullptr);
timersub(&tv2, &tv1, &tv2);
if (tv2.tv_usec < frameDelayUs) {
usleep(frameDelayUs - tv2.tv_usec);
} else {
LOGW("Frame delay is %d us but decoding took %d us", frameDelayUs, tv2.tv_usec);
}
eglSwapBuffers(display, surface);
if (part.count && j >= part.count) {
free(frame.buf);
frame.buf = nullptr;
}
}
usleep(frameDelayUs * part.pause);
}
}
glBindTexture(GL_TEXTURE_2D, 0);
glUseProgram(0);
glDeleteTextures(1, &tex);
glDeleteBuffers(1, &texBuf);
glDeleteBuffers(1, &rectBuf);
glDeleteProgram(programId);
glDeleteShader(fsh);
glDeleteShader(vsh);
eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglDestroyContext(display, context);
eglDestroySurface(display, surface);
return nullptr;
}
static int
CancelBufferNoop(ANativeWindow* aWindow, android_native_buffer_t* aBuffer)
{
return 0;
}
__attribute__ ((visibility ("default")))
FramebufferNativeWindow*
NativeWindow()
{
if (gNativeWindow.get()) {
return gNativeWindow.get();
}
// Some gralloc HALs need this in order to open the
// framebuffer device after we restart with the screen off.
//
// NB: this *must* run BEFORE allocating the
// FramebufferNativeWindow. Do not separate these two C++
// statements.
set_screen_state(1);
// We (apparently) don't have a way to tell if allocating the
// fbs succeeded or failed.
gNativeWindow = new FramebufferNativeWindow();
// Bug 776742: FrambufferNativeWindow doesn't set the cancelBuffer
// function pointer, causing EGL to segfault when the window surface
// is destroyed (i.e. on process exit). This workaround stops us
// from hard crashing in that situation.
gNativeWindow->cancelBuffer = CancelBufferNoop;
sRunAnimation = true;
pthread_create(&sAnimationThread, nullptr, AnimationThread, nullptr);
return gNativeWindow.get();
}
__attribute__ ((visibility ("default")))
void
StopBootAnimation()
{
if (sRunAnimation) {
sRunAnimation = false;
pthread_join(sAnimationThread, nullptr);
}
}

17
b2g/app/BootAnimation.h Normal file
View File

@ -0,0 +1,17 @@
#ifndef BOOTANIMATION_H
#define BOOTANIMATION_H
namespace android {
class FramebufferNativeWindow;
}
/* This returns a FramebufferNativeWindow if one exists.
* If not, one is created and the boot animation is started. */
__attribute__ ((weak))
android::FramebufferNativeWindow* NativeWindow();
/* This stops the boot animation if it's still running. */
__attribute__ ((weak))
void StopBootAnimation();
#endif /* BOOTANIMATION_H */

View File

@ -24,6 +24,21 @@ endif
CPPSRCS = nsBrowserApp.cpp
ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
CPPSRCS += BootAnimation.cpp
LIBS += \
-lGLESv2 \
-lEGL \
-lui \
-lhardware_legacy \
-lhardware \
-lcutils \
$(DEPTH)/media/libpng/$(LIB_PREFIX)mozpng.$(LIB_SUFFIX) \
$(MOZ_ZLIB_LIBS) \
$(NULL)
OS_LDFLAGS += -Wl,--export-dynamic
endif
LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base
LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/build

View File

@ -355,7 +355,7 @@ pref("security.fileuri.strict_origin_policy", false);
// Default Content Security Policy to apply to privileged and certified apps
pref("security.apps.privileged.CSP.default", "default-src *; script-src 'self'; object-src 'none'; style-src 'self' 'unsafe-inline'");
pref("security.apps.certified.CSP.default", "options inline-script eval-script; default-src *; script-src 'self'; object-src 'none'; style-src 'self'");
pref("security.apps.certified.CSP.default", "default-src *; script-src 'self'; object-src 'none'; style-src 'self'");
// Temporarily force-enable GL compositing. This is default-disabled
// deep within the bowels of the widgetry system. Remove me when GL

View File

@ -28,6 +28,11 @@
#define snprintf _snprintf
#define strcasecmp _stricmp
#endif
#ifdef MOZ_WIDGET_GONK
#include "BootAnimation.h"
#endif
#include "BinaryPath.h"
#include "nsXPCOMPrivate.h" // for MAXPATHLEN and XPCOM_DLL
@ -139,6 +144,11 @@ static int do_main(int argc, char* argv[])
argc -= 2;
}
#ifdef MOZ_WIDGET_GONK
/* Called to start the boot animation */
(void) NativeWindow();
#endif
if (appini) {
nsXREAppData *appData;
rv = XRE_CreateAppData(appini, &appData);

View File

@ -2,7 +2,7 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!ENTITY brandShortName "B2G">
<!ENTITY brandFullName "Mozilla B2G">
<!ENTITY vendorShortName "Mozilla">
<!ENTITY logoTrademark "B2G and the B2G logos are trademarks of the Mozilla Foundation.">
<!ENTITY brandShortName "Firefox">
<!ENTITY brandFullName "Mozilla Firefox">
<!ENTITY vendorShortName "Mozilla">
<!ENTITY logoTrademark "Firefox and the Firefox logos are trademarks of the Mozilla Foundation.">

View File

@ -2,5 +2,5 @@
# 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/.
brandShortName=B2G
brandFullName=Mozilla B2G
brandShortName=Firefox
brandFullName=Mozilla Firefox

View File

@ -2,7 +2,7 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!ENTITY brandShortName "B2G">
<!ENTITY brandFullName "Mozilla B2G">
<!ENTITY brandShortName "Firefox">
<!ENTITY brandFullName "Mozilla Firefox">
<!ENTITY vendorShortName "Mozilla">
<!ENTITY logoTrademark "">
<!ENTITY logoTrademark "Firefox and the Firefox logos are trademarks of the Mozilla Foundation.">

View File

@ -2,5 +2,5 @@
# 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/.
brandShortName=B2G
brandFullName=Mozilla B2G
brandShortName=Firefox
brandFullName=Mozilla Firefox

View File

@ -71,7 +71,7 @@ if ("nsIAudioManager" in Ci) {
audioSettings = [
// settings name, default value, stream type
['audio.volume.voice_call', 10, nsIAudioManager.STREAM_TYPE_VOICE_CALL],
['audio.volume.system', 10, nsIAudioManager.STREAM_TYPE_SYSTEM],
['audio.volume.system', 15, nsIAudioManager.STREAM_TYPE_SYSTEM],
['audio.volume.ring', 7, nsIAudioManager.STREAM_TYPE_RING],
['audio.volume.music', 15, nsIAudioManager.STREAM_TYPE_MUSIC],
['audio.volume.alarm', 7, nsIAudioManager.STREAM_TYPE_ALARM],
@ -80,7 +80,7 @@ if ("nsIAudioManager" in Ci) {
['audio.volume.enforced_audible', 7, nsIAudioManager.STREAM_TYPE_ENFORCED_AUDIBLE],
['audio.volume.dtmf', 15, nsIAudioManager.STREAM_TYPE_DTMF],
['audio.volume.tts', 15, nsIAudioManager.STREAM_TYPE_TTS],
['audio.volume.fm', 10, nsIAudioManager.STREAM_TYPE_FM],
['audio.volume.fm', 15, nsIAudioManager.STREAM_TYPE_FM],
];
}

View File

@ -403,6 +403,8 @@ var shell = {
content.removeEventListener('load', shell_homeLoaded);
shell.isHomeLoaded = true;
Services.obs.notifyObservers(null, "browser-ui-startup-complete", "");
if ('pendingChromeEvents' in shell) {
shell.pendingChromeEvents.forEach((shell.sendChromeEvent).bind(shell));
}
@ -722,6 +724,7 @@ var WebappsHelper = {
return;
let installer = this._installers[detail.id];
delete this._installers[detail.id];
switch (detail.type) {
case "webapps-install-granted":
DOMApplicationRegistry.confirmInstall(installer);

View File

@ -2,6 +2,8 @@
* 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/. */
"use strict"
let DEBUG = 0;
let debug;
if (DEBUG) {
@ -16,6 +18,8 @@ const Cr = Components.results;
const Cu = Components.utils;
const Cc = Components.classes;
const PROMPT_FOR_UNKNOWN = ['geolocation'];
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Webapps.jsm");
@ -36,7 +40,9 @@ function rememberPermission(aPermission, aPrincipal)
{
let type =
permissionManager.testExactPermissionFromPrincipal(aPrincipal, aPerm);
if (type == Ci.nsIPermissionManager.PROMPT_ACTION) {
if (type == Ci.nsIPermissionManager.PROMPT_ACTION ||
(type == Ci.nsIPermissionManager.UNKNOWN_ACTION &&
PROMPT_FOR_UNKNOWN.indexOf(aPermission) >= 0)) {
permissionManager.addFromPrincipal(aPrincipal,
aPerm,
Ci.nsIPermissionManager.ALLOW_ACTION);
@ -49,8 +55,7 @@ function rememberPermission(aPermission, aPrincipal)
for (let idx in access) {
convertPermToAllow(aPermission + "-" + access[idx], aPrincipal);
}
}
else {
} else {
convertPermToAllow(aPermission, aPrincipal);
}
}
@ -60,7 +65,6 @@ function ContentPermissionPrompt() {}
ContentPermissionPrompt.prototype = {
handleExistingPermission: function handleExistingPermission(request) {
let promptForUnknown = ['geolocation'];
let access = (request.access && request.access !== "unused") ? request.type + "-" + request.access :
request.type;
let result = Services.perms.testExactPermissionFromPrincipal(request.principal, access);
@ -69,7 +73,7 @@ ContentPermissionPrompt.prototype = {
return true;
}
if (result == Ci.nsIPermissionManager.DENY_ACTION ||
result == Ci.nsIPermissionManager.UNKNOWN_ACTION && promptForUnknown.indexOf(access) < 0) {
result == Ci.nsIPermissionManager.UNKNOWN_ACTION && PROMPT_FOR_UNKNOWN.indexOf(access) < 0) {
request.cancel();
return true;
}

View File

@ -260,10 +260,23 @@ UpdatePrompt.prototype = {
},
downloadUpdate: function UP_downloadUpdate(aUpdate) {
if (!aUpdate) {
aUpdate = Services.um.activeUpdate;
if (!aUpdate) {
log("No active update found to download");
return;
}
}
Services.aus.downloadUpdate(aUpdate, true);
Services.aus.addDownloadListener(this);
},
handleDownloadCancel: function UP_handleDownloadCancel() {
log("Pausing download");
Services.aus.pauseDownload();
},
finishUpdate: function UP_finishUpdate() {
if (!this._update.isOSUpdate) {
// Standard gecko+gaia updates will just need to restart the process
@ -347,6 +360,9 @@ UpdatePrompt.prototype = {
this.handleAvailableResult(detail);
this._update = null;
break;
case "update-download-cancel":
this.handleDownloadCancel();
break;
case "update-prompt-apply-result":
this.handleApplyPromptResult(detail);
break;

View File

@ -28,6 +28,7 @@ MOZ_APP_STATIC_INI=1
if test "$OS_TARGET" = "Android"; then
MOZ_CAPTURE=1
MOZ_RAW=1
MOZ_AUDIO_CHANNEL_MANAGER=1
fi
# use custom widget for html:select

View File

@ -54,7 +54,6 @@
@BINPATH@/@DLL_PREFIX@xpcom@DLL_SUFFIX@
@BINPATH@/@DLL_PREFIX@nspr4@DLL_SUFFIX@
@BINPATH@/@DLL_PREFIX@mozalloc@DLL_SUFFIX@
@BINPATH@/@DLL_PREFIX@soundtouch@DLL_SUFFIX@
#ifdef XP_MACOSX
@BINPATH@/XUL
#else

View File

@ -13,15 +13,6 @@ include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
ifdef LOCALE_MERGEDIR
vpath crashreporter%.ini $(LOCALE_MERGEDIR)/b2g/crashreporter
endif
vpath crashreporter%.ini $(LOCALE_SRCDIR)/crashreporter
ifdef LOCALE_MERGEDIR
vpath crashreporter%.ini @srcdir@/en-US/crashreporter
endif
SUBMAKEFILES += \
$(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/Makefile \
$(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales/Makefile \
@ -85,12 +76,15 @@ NO_JA_JP_MAC_AB_CD := $(if $(filter ja-JP-mac, $(AB_CD)),ja,$(AB_CD))
libs-%:
$(NSINSTALL) -D $(DIST)/install
@$(MAKE) -C ../../toolkit/locales libs-$*
@$(MAKE) -C ../../services/sync/locales AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) -C ../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) -C ../../intl/locales AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=$(PREF_DIR)
@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
# Tailored target to just add the chrome processing for multi-locale builds
chrome-%:
@$(MAKE) -C ../../toolkit/locales chrome-$*
@$(MAKE) chrome AB_CD=$*
@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales chrome AB_CD=$*
repackage-win32-installer: WIN32_INSTALLER_OUT=$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
repackage-win32-installer: $(call ESCAPE_SPACE,$(WIN32_INSTALLER_IN)) $(SUBMAKEFILES) libs-$(AB_CD)
@ -118,7 +112,6 @@ clobber-zip:
$(STAGEDIST)/chrome/$(AB_CD).manifest \
$(STAGEDIST)/defaults/pref/b2g-l10n.js
$(STAGEDIST)/dictionaries \
$(STAGEDIST)/hyphenation \
$(STAGEDIST)/defaults/profile \
$(STAGEDIST)/chrome/$(AB_CD)
@ -132,26 +125,6 @@ langpack: langpack-$(AB_CD)
installers-%: clobber-% langpack-% repackage-win32-installer-% repackage-zip-%
@echo "repackaging done"
ifdef MOZ_UPDATER
libs:: $(call MERGE_FILE,updater/updater.ini)
ifeq ($(OS_ARCH),WINNT)
cat $< $(srcdir)/../installer/windows/nsis/updater_append.ini | \
sed -e "s/^InfoText=/Info=/" -e "s/^TitleText=/Title=/" | \
sed -e "s/%MOZ_APP_DISPLAYNAME%/$(MOZ_APP_DISPLAYNAME)/" > \
$(FINAL_TARGET)/updater.ini
else
cat $< | \
sed -e "s/^InfoText=/Info=/" -e "s/^TitleText=/Title=/" | \
sed -e "s/%MOZ_APP_DISPLAYNAME%/$(MOZ_APP_DISPLAYNAME)/" > \
$(FINAL_TARGET)/updater.ini
endif
endif
ifdef MOZ_CRASHREPORTER
libs:: crashreporter-override.ini
$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)
endif
# When we unpack b2g on MacOS X the platform.ini and application.ini are in slightly
# different locations that on all other platforms
ifeq (Darwin, $(OS_ARCH))

View File

@ -1,45 +1,2 @@
ar
be
ca
cs
da
de
el
es-AR
es-ES
et
eu
fa
fi
fr
fy-NL
ga-IE
gd
gl
he
hu
id
it
ja
ja-JP-mac
ko
lt
nb-NO
nl
nn-NO
pa-IN
pl
pt-BR
pt-PT
ro
ru
sk
sl
sq
sr
th
tr
uk
vi
zh-CN
zh-TW

View File

@ -1,22 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!ENTITY aboutPage.title "About &brandShortName;">
<!ENTITY aboutPage.faq.label "FAQ">
<!ENTITY aboutPage.support.label "Support">
<!ENTITY aboutPage.privacyPolicy.label "Privacy Policy">
<!ENTITY aboutPage.rights.label "Know Your Rights">
<!ENTITY aboutPage.relNotes.label "Release Notes">
<!ENTITY aboutPage.credits.label "Credits">
<!ENTITY aboutPage.checkForUpdates.button "Check for Updates">
<!ENTITY aboutPage.checkForUpdates.checking "Looking for updates…">
<!ENTITY aboutPage.checkForUpdates.none "No updates available">
<!ENTITY aboutPage.checkForUpdates.found "Update available">
<!-- LOCALIZATION NOTE:
These strings are concatenated in order. Unneeded strings may be left blank.
-->
<!ENTITY aboutPage.licenseLink "Licensing information">
<!ENTITY aboutPage.licenseLinkSuffix ".">

View File

@ -1,38 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!ENTITY % brandDTD
SYSTEM "chrome://branding/locale/brand.dtd">
%brandDTD;
<!-- These strings are used by Firefox's custom about:certerror page,
a replacement for the standard security certificate errors produced
by NSS/PSM via netError.xhtml. -->
<!ENTITY certerror.pagetitle "Untrusted Connection">
<!ENTITY certerror.longpagetitle "This Connection is Untrusted">
<!-- Localization note (certerror.introPara1) - The string "#1" will
be replaced at runtime with the name of the server to which the user
was trying to connect. -->
<!ENTITY certerror.introPara1 "You have asked &brandShortName; to connect
securely to <b>#1</b>, but we can't confirm that your connection is secure.">
<!ENTITY certerror.whatShouldIDo.heading "What Should I Do?">
<!ENTITY certerror.whatShouldIDo.content "If you usually connect to
this site without problems, this error could mean that someone is
trying to impersonate the site, and you shouldn't continue.">
<!ENTITY certerror.getMeOutOfHere.label "Get me out of here!">
<!ENTITY certerror.expert.heading "I Understand the Risks">
<!ENTITY certerror.expert.content "If you understand what's going on, you
can tell &brandShortName; to start trusting this site's identification.
<b>Even if you trust the site, this error could mean that someone is
tampering with your connection.</b>">
<!ENTITY certerror.expert.contentPara2 "Don't add an exception unless
you know there's a good reason why this site doesn't use trusted identification.">
<!ENTITY certerror.addTemporaryException.label "Visit site">
<!ENTITY certerror.addPermanentException.label "Add permanent exception">
<!ENTITY certerror.technical.heading "Technical Details">

View File

@ -1,12 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!--
LOCALIZATION NOTE (geolocation.learnMore): Use the
unicode ellipsis char, \u2026,
or use "..." unless \u2026 doesn't suit traditions in your
locale.
-->
<!ENTITY geolocation.learnMore "Learn More…">

View File

@ -1,38 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
rememberValue = Use Password Manager to remember this value.
rememberPassword = Use Password Manager to remember this password.
savePasswordTitle = Confirm
# 1st string is product name, 2nd is the username for the login, 3rd is the
# login's hostname. Note that long usernames may be truncated.
saveLoginText = Do you want %1$S to remember the password for "%2$S" on %3$S?
# 1st string is product name, 2nd is the login's hostname
saveLoginTextNoUsername = Do you want %1$S to remember this password on %2$S?
notNowButtonText = &Not Now
notifyBarNotNowButtonText = Not Now
notifyBarNotNowButtonAccessKey =
neverForSiteButtonText = Ne&ver for This Site
notifyBarNeverForSiteButtonText = Never
notifyBarNeverForSiteButtonAccessKey =
rememberButtonText = &Remember
notifyBarRememberButtonText = Remember
notifyBarRememberButtonAccessKey =
passwordChangeTitle = Confirm Password Change
passwordChangeText = Would you like to change the stored password for %S?
passwordChangeTextNoUser = Would you like to change the stored password for this login?
notifyBarChangeButtonText = Change
notifyBarChangeButtonAccessKey =
notifyBarDontChangeButtonText = Don't Change
notifyBarDontChangeButtonAccessKey =
userSelectText = Please confirm which user you are changing the password for
hidePasswords=Hide Passwords
hidePasswordsAccessKey=P
showPasswords=Show Passwords
showPasswordsAccessKey=P
noMasterPasswordPrompt=Are you sure you wish to show your passwords?
removeAllPasswordsPrompt=Are you sure you wish to remove all passwords?
removeAllPasswordsTitle=Remove all passwords
loginsSpielAll=Passwords for the following sites are stored on your computer:
loginsSpielFiltered=The following passwords match your search:

View File

@ -1,29 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!ENTITY safeb.palm.warning.title "Suspected Web Forgery">
<!ENTITY safeb.palm.message.p1 "This page has been reported as a web forgery designed to trick users into sharing personal or financial information. Entering any personal information on this page may result in identity theft or other fraud. &#160;">
<!ENTITY safeb.palm.message.p1.linkText "Read more &#187;">
<!ENTITY safeb.palm.p1.linkStatusText "Read more &#133;">
<!ENTITY safeb.palm.message.p2.start "These types of web forgeries are used in scams known as phishing attacks, in which fraudulent web pages and emails are used to imitate sources you may trust. You can find out more about ">
<!ENTITY safeb.palm.message.p2.linkText "how &brandShortName; protects you">
<!ENTITY safeb.palm.message.p2.end " from phishing attacks.">
<!ENTITY safeb.palm.accept.label "Get me out of here!">
<!ENTITY safeb.palm.accept.statustext "Navigate to my home page">
<!ENTITY safeb.palm.decline.label "Ignore this warning">
<!ENTITY safeb.palm.decline.statustext "Close warning" >
<!ENTITY safeb.palm.notforgery.label2 "This isn't a web forgery…">
<!ENTITY safeb.palm.reportPage.label "Why was this page blocked?">
<!ENTITY safeb.blocked.malwarePage.title "Reported Attack Page!">
<!-- Localization note (safeb.blocked.malware.shortDesc) - Please don't translate the contents of the <span id="malware_sitename"/> tag. It will be replaced at runtime with a domain name (e.g. www.badsite.com) -->
<!ENTITY safeb.blocked.malwarePage.shortDesc "This web page at <span id='malware_sitename'/> has been reported as an attack page and has been blocked based on your security preferences.">
<!ENTITY safeb.blocked.malwarePage.longDesc "<p>Attack pages try to install programs that steal private information, use your computer to attack others, or damage your system.</p><p>Some attack pages intentionally distribute harmful software, but many are compromised without the knowledge or permission of their owners.</p>">
<!ENTITY safeb.blocked.phishingPage.title2 "Suspected Web Forgery!">
<!ENTITY safeb.blocked.phishingPage.shortDesc2 "Entering any personal information on this page may result in identity theft or other fraud.">
<!ENTITY safeb.blocked.phishingPage.longDesc2 "<p>These types of web forgeries are used in scams known as phishing attacks, in which fraudulent web pages and emails are used to imitate sources you may trust.</p>">

View File

@ -1,11 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!ENTITY webapps.title.placeholder "Enter a title">
<!ENTITY webapps.permissions "Allow access:">
<!ENTITY webapps.perm.geolocation "Location-aware browsing">
<!ENTITY webapps.perm.offline "Offline data storage">
<!ENTITY webapps.perm.notifications "Desktop notifications">
<!ENTITY webapps.perm.requestedHint "(requested)">
<!ENTITY webapps.add-homescreen "Add to home screen">

View File

@ -1,14 +0,0 @@
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
# This file is in the UTF-8 encoding
[Strings]
# LOCALIZATION NOTE (CrashReporterProductErrorText2): %s is replaced with another string containing detailed information.
CrashReporterProductErrorText2=B2G has crashed. Unfortunately the crash reporter is unable to submit a crash report.\n\nDetails: %s
CrashReporterDescriptionText2=B2G has crashed. Your tabs will be listed on the B2G Start page when you restart.\n\nPlease help us fix the problem!
# LOCALIZATION NOTE (CheckSendReport): The %s is replaced with the vendor name.
CheckSendReport=Send %s a crash report
CheckIncludeURL=Include the page address
Quit2=Quit B2G
Restart=Restart B2G

View File

@ -1,21 +0,0 @@
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
; This file is in the UTF-8 encoding
[Strings]
AppShortName=%MOZ_APP_DISPLAYNAME%
AppLongName=Mozilla %MOZ_APP_DISPLAYNAME%
WindowCaption=Mozilla %MOZ_APP_DISPLAYNAME% Setup
InstallTo=Install %MOZ_APP_DISPLAYNAME% to
Install=Install
Cancel=Cancel
InstalledSuccessfully=Mozilla %MOZ_APP_DISPLAYNAME% has been installed successfully.
ExtractionError=Archive extraction error:
ThereWereErrors=There were errors during installation:
CreatingUserProfile=Creating user profile. Please wait...
UninstallCaption=Mozilla %MOZ_APP_DISPLAYNAME% Uninstall
FilesWillBeRemoved=All files will be removed from
AreYouSure=Are you sure?
InstallationNotFound=Mozilla %MOZ_APP_DISPLAYNAME% installation not found.
UninstalledSuccessfully=Mozilla %MOZ_APP_DISPLAYNAME% has been uninstalled successfully.

View File

@ -1,8 +0,0 @@
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
; This file is in the UTF-8 encoding
[Strings]
TitleText=%MOZ_APP_DISPLAYNAME% Update
InfoText=%MOZ_APP_DISPLAYNAME% is installing your updates and will start in a few moments…

View File

@ -5,31 +5,10 @@
def test(mod, path, entity = None):
import re
# ignore anything but b2g, which is our local repo checkout name
# ignore anything but b2g and specific overloads from dom and toolkit
if mod not in ("netwerk", "dom", "toolkit", "security/manager",
"services/sync", "embedding/android",
"mobile",
"b2g"):
return False
return "ignore"
# Ignore Lorentz strings, at least temporarily
if mod == "toolkit" and path == "chrome/mozapps/plugins/plugins.dtd":
if entity.startswith('reloadPlugin.'): return False
if entity.startswith('report.'): return False
if mod != "b2g":
# we only have exceptions for b2g
return True
if not entity:
return not (re.match(r"b2g-l10n.js", path) or
re.match(r"defines.inc", path))
if path == "defines.inc":
return entity != "MOZ_LANGPACK_CONTRIBUTORS"
if path != "chrome/region.properties":
# only region.properties exceptions remain, compare all others
return True
return not (re.match(r"browser\.search\.order\.[1-9]", entity) or
re.match(r"browser\.contentHandlers\.types\.[0-5]", entity) or
re.match(r"gecko\.handlerService\.schemes\.", entity) or
re.match(r"gecko\.handlerService\.defaultHandlersVersion", entity))
return "error"

View File

@ -5,14 +5,9 @@
@AB_CD@.jar:
% locale browser @AB_CD@ %locale/@AB_CD@/browser/
locale/@AB_CD@/browser/about.dtd (%chrome/about.dtd)
locale/@AB_CD@/browser/aboutCertError.dtd (%chrome/aboutCertError.dtd)
locale/@AB_CD@/browser/notification.dtd (%chrome/notification.dtd)
locale/@AB_CD@/browser/webapps.dtd (%chrome/webapps.dtd)
locale/@AB_CD@/browser/phishing.dtd (%chrome/phishing.dtd)
% locale b2g-l10n @AB_CD@ %locale/@AB_CD@/b2g-l10n/
* locale/@AB_CD@/browser/netError.dtd (%chrome/overrides/netError.dtd)
% override chrome://global/locale/netError.dtd chrome://browser/locale/netError.dtd
* locale/@AB_CD@/browser/appstrings.properties (%chrome/overrides/appstrings.properties)
% override chrome://global/locale/appstrings.properties chrome://browser/locale/appstrings.properties
% override chrome://global/locale/netError.dtd chrome://b2g-l10n/locale/netError.dtd
% override chrome://global/locale/appstrings.properties chrome://b2g-l10n/locale/appstrings.properties
* locale/@AB_CD@/b2g-l10n/netError.dtd (%chrome/overrides/netError.dtd)
* locale/@AB_CD@/b2g-l10n/appstrings.properties (%chrome/overrides/appstrings.properties)

View File

@ -11,4 +11,3 @@ dirs = b2g
[includes]
toolkit = toolkit/locales/l10n.ini
services_sync = services/sync/locales/l10n.ini

View File

@ -1,5 +1,5 @@
<?xml version="1.0"?>
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1352745754000">
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1354308657000">
<emItems>
<emItem blockID="i58" id="webmaster@buzzzzvideos.info">
<versionRange minVersion="0" maxVersion="*">
@ -158,6 +158,10 @@
<versionRange minVersion=" " maxVersion="6.*">
</versionRange>
</emItem>
<emItem blockID="i228" id="crossriderapp5060@crossrider.com">
<versionRange minVersion="0" maxVersion="*" severity="1">
</versionRange>
</emItem>
<emItem blockID="i4" id="{4B3803EA-5230-4DC3-A7FC-33638F3D3542}">
<versionRange minVersion="1.2" maxVersion="1.2">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
@ -184,6 +188,10 @@
<versionRange minVersion="0" maxVersion="*">
</versionRange>
</emItem>
<emItem blockID="i222" id="dealcabby@jetpack">
<versionRange minVersion="0" maxVersion="*" severity="1">
</versionRange>
</emItem>
<emItem blockID="i51" id="admin@youtubeplayer.com">
<versionRange minVersion="0" maxVersion="*">
</versionRange>
@ -229,6 +237,10 @@
<versionRange minVersion="0" maxVersion="*">
</versionRange>
</emItem>
<emItem blockID="i224" id="{336D0C35-8A85-403a-B9D2-65C292C39087}">
<versionRange minVersion="0" maxVersion="*" severity="1">
</versionRange>
</emItem>
<emItem blockID="i43" id="supportaccessplugin@gmail.com">
</emItem>
<emItem blockID="i54" id="applebeegifts@mozilla.doslash.org">
@ -283,11 +295,13 @@
<versionRange minVersion="0" maxVersion="*">
</versionRange>
</emItem>
<emItem blockID="i2" id="fdm_ffext@freedownloadmanager.org">
<emItem blockID="i216" id="fdm_ffext@freedownloadmanager.org">
<versionRange minVersion="1.0" maxVersion="1.3.1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="3.0a1" maxVersion="*" />
</targetApplication>
</versionRange>
<versionRange minVersion="1.5.7.5" maxVersion="1.5.7.5" severity="1">
</versionRange>
</emItem>
<emItem blockID="i6" id="{3f963a5b-e555-4543-90e2-c3908898db71}">
@ -353,6 +367,18 @@
<versionRange minVersion="0" maxVersion="*">
</versionRange>
</emItem>
<emItem blockID="i220" id="pricepeep@getpricepeep.com">
<versionRange minVersion="0" maxVersion="*" severity="1">
</versionRange>
</emItem>
<emItem blockID="i226" id="{462be121-2b54-4218-bf00-b9bf8135b23f}">
<versionRange minVersion="0" maxVersion="*" severity="1">
</versionRange>
</emItem>
<emItem blockID="i218" id="ffxtlbr@claro.com">
<versionRange minVersion="0" maxVersion="*" severity="1">
</versionRange>
</emItem>
<emItem blockID="i70" id="psid-vhvxQHMZBOzUZA@jetpack">
<versionRange minVersion="0" maxVersion="*" severity="1">
</versionRange>
@ -473,40 +499,84 @@
<match name="filename" exp="npuplaypc\.dll" /> <versionRange minVersion="0" maxVersion="1.0.0.0" severity="1"></versionRange>
</pluginItem>
<pluginItem blockID="p119">
<match name="name" exp="Java\(TM\) Plug-in 1\.(6\.0_(\d|[0-2]\d?|3[0-2])|7\.0(_0?([1-4]))?)([^\d\._]|$)" /> <match name="filename" exp="libnpjp2\.so" /> <versionRange severity="1"></versionRange>
<match name="name" exp="Java\(TM\) Plug-in 1\.(6\.0_(\d|[0-2]\d?|3[0-2])|7\.0(_0?([1-4]))?)([^\d\._]|$)" /> <match name="filename" exp="libnpjp2\.so" /> <versionRange severity="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="0.1" maxVersion="17.*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p123">
<match name="filename" exp="JavaPlugin2_NPAPI\.plugin" /> <versionRange minVersion="0" maxVersion="14.2.0" severity="1"></versionRange>
<match name="filename" exp="JavaPlugin2_NPAPI\.plugin" /> <versionRange minVersion="0" maxVersion="14.2.0" severity="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="0.1" maxVersion="17.*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p125">
<match name="name" exp="Java\(TM\) Platform SE ((6( U(\d|([0-2]\d)|3[0-2]))?)|(7(\sU[0-4])?))(\s[^\d\._U]|$)" /> <match name="filename" exp="npjp2\.dll" /> <versionRange severity="1"></versionRange>
<match name="name" exp="Java\(TM\) Platform SE ((6( U(\d|([0-2]\d)|3[0-2]))?)|(7(\sU[0-4])?))(\s[^\d\._U]|$)" /> <match name="filename" exp="npjp2\.dll" /> <versionRange severity="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="0.1" maxVersion="17.*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p129">
<match name="filename" exp="Silverlight\.plugin" /> <versionRange minVersion="0" maxVersion="5.0.99999" severity="1"></versionRange>
</pluginItem>
<pluginItem blockID="p132">
<match name="name" exp="Java\(TM\) Plug-in 1\.7\.0(_0?([5-6]))?([^\d\._]|$)" /> <match name="filename" exp="libnpjp2\.so" /> <versionRange severity="1"></versionRange>
<match name="name" exp="Java\(TM\) Plug-in 1\.7\.0(_0?([5-6]))?([^\d\._]|$)" /> <match name="filename" exp="libnpjp2\.so" /> <versionRange severity="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="0.1" maxVersion="17.*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p134">
<match name="name" exp="Java\(TM\) Platform SE 7 U[5-6](\s[^\d\._U]|$)" /> <match name="filename" exp="npjp2\.dll" /> <versionRange severity="1"></versionRange>
<match name="name" exp="Java\(TM\) Platform SE 7 U[5-6](\s[^\d\._U]|$)" /> <match name="filename" exp="npjp2\.dll" /> <versionRange severity="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="0.1" maxVersion="17.*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p138">
<match name="filename" exp="JavaAppletPlugin\.plugin" /> <versionRange minVersion="Java 7 Update 01" maxVersion="Java 7 Update 06" severity="1"></versionRange>
<match name="filename" exp="JavaAppletPlugin\.plugin" /> <versionRange minVersion="Java 7 Update 01" maxVersion="Java 7 Update 06" severity="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="0.1" maxVersion="17.*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p152">
<match name="filename" exp="npctrl\.dll" /> <versionRange minVersion="0" maxVersion="4.1.10328.0" severity="0" vulnerabilitystatus="1"></versionRange>
<match name="filename" exp="npctrl\.dll" /> <versionRange minVersion="0" maxVersion="4.1.10328.0" severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="4.0" maxVersion="16.*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p154">
<match name="filename" exp="npctrl\.dll" /> <versionRange minVersion="5.0" maxVersion="5.1.10410.0" severity="0" vulnerabilitystatus="1"></versionRange>
<match name="filename" exp="npctrl\.dll" /> <versionRange minVersion="5.0" maxVersion="5.1.10410.0" severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="4.0" maxVersion="16.*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p156">
<match name="filename" exp="nppdf32\.dll" /> <versionRange minVersion="0" maxVersion="9.5.1" severity="0" vulnerabilitystatus="1"></versionRange>
<match name="filename" exp="nppdf32\.dll" /> <versionRange minVersion="0" maxVersion="9.5.1" severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="4.0" maxVersion="16.*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p158">
<match name="filename" exp="nppdf32\.dll" /> <versionRange minVersion="10.0" maxVersion="10.1.3" severity="0" vulnerabilitystatus="1"></versionRange>
<match name="filename" exp="nppdf32\.dll" /> <versionRange minVersion="10.0" maxVersion="10.1.3" severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="4.0" maxVersion="16.*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p160">
<match name="filename" exp="NPSWF32\.dll" /> <versionRange minVersion="0" maxVersion="10.2.9999" severity="0" vulnerabilitystatus="1"></versionRange>
<match name="filename" exp="NPSWF32\.dll" /> <versionRange minVersion="0" maxVersion="10.2.9999" severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="4.0" maxVersion="16.*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p176">
<match name="filename" exp="(NPSWF32\.dll)|(Flash\ Player\.plugin)" /> <versionRange minVersion="0" maxVersion="10.3.183.18.999" severity="0" vulnerabilitystatus="1">
@ -525,42 +595,63 @@
<pluginItem blockID="p180">
<match name="filename" exp="JavaAppletPlugin\.plugin" /> <versionRange minVersion="Java 7 Update 07" maxVersion="Java 7 Update 08" severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="17.0" maxVersion="*" />
<versionRange minVersion="18.0a1" maxVersion="*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p182">
<match name="name" exp="Java\(TM\) Platform SE 7 U[7-8](\s[^\d\._U]|$)" /> <match name="filename" exp="npjp2\.dll" /> <versionRange severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="17.0" maxVersion="*" />
<versionRange minVersion="18.0a1" maxVersion="*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p184">
<match name="name" exp="Java\(TM\) Plug-in 1\.7\.0(_0?([7-8]))?([^\d\._]|$)" /> <match name="filename" exp="libnpjp2\.so" /> <versionRange severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="17.0" maxVersion="*" />
<versionRange minVersion="18.0a1" maxVersion="*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p186">
<match name="name" exp="Java\(TM\) Platform SE 6 U3[3-6](\s[^\d\._U]|$)" /> <match name="filename" exp="npjp2\.dll" /> <versionRange severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="17.0" maxVersion="*" />
<versionRange minVersion="18.0a1" maxVersion="*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p188">
<match name="filename" exp="JavaAppletPlugin\.plugin" /> <versionRange minVersion="Java 6 Update 0" maxVersion="Java 6 Update 36" severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="17.0" maxVersion="*" />
<versionRange minVersion="18.0a1" maxVersion="*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p190">
<match name="name" exp="Java\(TM\) Plug-in 1\.6\.0_3[3-6]([^\d\._]|$)" /> <match name="filename" exp="libnpjp2\.so" /> <versionRange severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="17.0" maxVersion="*" />
<versionRange minVersion="18.0a1" maxVersion="*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p210">
<match name="name" exp="Java\(TM\) Plug-in 1\.7\.0(_0?7)?([^\d\._]|$)" /> <match name="filename" exp="libnpjp2\.so" /> <versionRange severity="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="0.1" maxVersion="17.*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p212">
<match name="filename" exp="JavaAppletPlugin\.plugin" /> <versionRange minVersion="Java 7 Update 07" maxVersion="Java 7 Update 07" severity="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="0.1" maxVersion="17.*" />
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p214">
<match name="name" exp="Java\(TM\) Platform SE 7 U7(\s[^\d\._U]|$)" /> <match name="filename" exp="npjp2\.dll" /> <versionRange severity="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
<versionRange minVersion="0.1" maxVersion="17.*" />
</targetApplication>
</versionRange>
</pluginItem>
@ -583,11 +674,14 @@
<gfxBlacklistEntry blockID="g192"> <os>WINNT 6.2</os> <vendor>0x1002</vendor> <feature>DIRECT2D</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>9.10.8.0</driverVersion> <driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g194"> <os>WINNT 6.2</os> <vendor>0x1022</vendor> <feature>DIRECT2D</feature> <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus> <driverVersion>9.10.8.0</driverVersion> <driverVersionComparator>LESS_THAN_OR_EQUAL</driverVersionComparator> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g198"> <os>Darwin 10</os> <vendor>0x10de</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g200"> <os>Darwin 11</os> <vendor>0x10de</vendor> <featureStatus>WEBGL_MSAA</featureStatus> <driverVersion>BLOCKED_DEVICE</driverVersion> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g200"> <os>Darwin 11</os> <vendor>0x10de</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g202"> <os>Darwin 12</os> <vendor>0x10de</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g204"> <os>Darwin 10</os> <vendor>0x8086</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g206"> <os>Darwin 11</os> <vendor>0x8086</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g208"> <os>Darwin 12</os> <vendor>0x8086</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g230"> <os>Darwin 10</os> <vendor>0x1002</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g232"> <os>Darwin 11</os> <vendor>0x1002</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus> </gfxBlacklistEntry>
<gfxBlacklistEntry blockID="g234"> <os>Darwin 12</os> <vendor>0x1002</vendor> <feature>WEBGL_MSAA</feature> <featureStatus>BLOCKED_DEVICE</featureStatus> </gfxBlacklistEntry>
</gfxItems>

View File

@ -1003,11 +1003,16 @@ pref("devtools.toolbar.visible", false);
pref("devtools.gcli.allowSet", false);
pref("devtools.commands.dir", "");
// Toolbox preferences
pref("devtools.toolbox.footer.height", 250);
pref("devtools.toolbox.sidebar.width", 500);
pref("devtools.toolbox.host", "bottom");
pref("devtools.toolbox.selectedTool", "webconsole");
pref("devtools.toolbox.toolbarSpec", '["tilt toggle","scratchpad","resize toggle"]');
pref("devtools.toolbox.sideEnabled", 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");
pref("devtools.inspector.markupPreview", false);
@ -1039,17 +1044,11 @@ pref("devtools.debugger.ui.variables-sorting-enabled", true);
pref("devtools.debugger.ui.variables-non-enum-visible", true);
pref("devtools.debugger.ui.variables-searchbox-visible", false);
// Enable the style inspector
pref("devtools.styleinspector.enabled", true);
// Enable the Tilt inspector
pref("devtools.tilt.enabled", true);
pref("devtools.tilt.intro_transition", true);
pref("devtools.tilt.outro_transition", true);
// Enable the rules view
pref("devtools.ruleview.enabled", true);
// Enable the Scratchpad tool.
pref("devtools.scratchpad.enabled", true);
@ -1074,17 +1073,6 @@ pref("devtools.gcli.eagerHelper", 2);
// Do we allow the 'pref set' command
pref("devtools.gcli.allowSet", false);
// The last Web Console height. This is initially 0 which means that the Web
// Console will use the default height next time it shows.
// Change to -1 if you do not want the Web Console to remember its last height.
pref("devtools.hud.height", 0);
// Remember the Web Console position. Possible values:
// above - above the web page,
// below - below the web page,
// window - in a separate window/popup panel.
pref("devtools.webconsole.position", "below");
// Remember the Web Console filters
pref("devtools.webconsole.filter.network", true);
pref("devtools.webconsole.filter.networkinfo", true);

View File

@ -150,20 +150,27 @@
<menu id="appmenu_webDeveloper"
label="&appMenuWebDeveloper.label;">
<menupopup id="appmenu_webDeveloper_popup">
<menuitem id="appmenu_devToolbar" observes="devtoolsMenuBroadcaster_DevToolbar"/>
<menuitem id="appmenu_webConsole" observes="devtoolsMenuBroadcaster_WebConsole"/>
<menuitem id="appmenu_remoteWebConsole" observes="devtoolsMenuBroadcaster_RemoteWebConsole"/>
<menuitem id="appmenu_pageinspect" observes="devtoolsMenuBroadcaster_Inspect"/>
<menuitem id="appmenu_responsiveUI" observes="devtoolsMenuBroadcaster_ResponsiveUI"/>
<menuitem id="appmenu_debugger" observes="devtoolsMenuBroadcaster_Debugger"/>
<menuitem id="appmenu_remoteDebugger" observes="devtoolsMenuBroadcaster_RemoteDebugger"/>
<menuitem id="appmenu_chromeDebugger" observes="devtoolsMenuBroadcaster_ChromeDebugger"/>
<menuitem id="appmenu_scratchpad" observes="devtoolsMenuBroadcaster_Scratchpad"/>
<menuitem id="appmenu_styleeditor" observes="devtoolsMenuBroadcaster_StyleEditor"/>
<menuitem id="appmenu_pageSource" observes="devtoolsMenuBroadcaster_PageSource"/>
<menuitem id="appmenu_errorConsole" observes="devtoolsMenuBroadcaster_ErrorConsole"/>
<menuitem id="appmenu_devToolbox"
observes="devtoolsMenuBroadcaster_DevToolbox"/>
<menuseparator id="appmenu_devtools_separator"/>
<menuitem id="appmenu_devToolbar"
observes="devtoolsMenuBroadcaster_DevToolbar"/>
<menuitem id="appmenu_chromeDebugger"
observes="devtoolsMenuBroadcaster_ChromeDebugger"/>
<menuitem id="appmenu_responsiveUI"
observes="devtoolsMenuBroadcaster_ResponsiveUI"/>
<menuitem id="appmenu_scratchpad"
observes="devtoolsMenuBroadcaster_Scratchpad"/>
<menuitem id="appmenu_pageSource"
observes="devtoolsMenuBroadcaster_PageSource"/>
<menuitem id="appmenu_errorConsole"
observes="devtoolsMenuBroadcaster_ErrorConsole"/>
<menuseparator id="appmenu_devToolsConnectSeparator"/>
<menuitem id="appmenu_devtools_connect"
observes="devtoolsMenuBroadcaster_connect"/>
<menuseparator id="appmenu_devToolsEndSeparator"/>
<menuitem id="appmenu_getMoreDevtools" observes="devtoolsMenuBroadcaster_GetMoreTools"/>
<menuitem id="appmenu_getMoreDevtools"
observes="devtoolsMenuBroadcaster_GetMoreTools"/>
<menuseparator/>
#define ID_PREFIX appmenu_developer_
#define OMIT_ACCESSKEYS

View File

@ -28,6 +28,12 @@
label="&openLinkCmd.label;"
accesskey="&openLinkCmd.accesskey;"
oncommand="gContextMenu.openLink();"/>
#ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING
<menuitem id="context-openlinkprivate"
label="&openLinkInPrivateWindowCmd.label;"
accesskey="&openLinkInPrivateWindowCmd.accesskey;"
oncommand="gContextMenu.openLinkInPrivateWindow();"/>
#endif
<menuseparator id="context-sep-open"/>
<menuitem id="context-bookmarklink"
label="&bookmarkThisLinkCmd.label;"

View File

@ -564,20 +564,34 @@
label="&webDeveloperMenu.label;"
accesskey="&webDeveloperMenu.accesskey;">
<menupopup id="menuWebDeveloperPopup">
<menuitem id="menu_devToolbar" observes="devtoolsMenuBroadcaster_DevToolbar" accesskey="&devToolbarMenu.accesskey;"/>
<menuitem id="webConsole" observes="devtoolsMenuBroadcaster_WebConsole" accesskey="&webConsoleCmd.accesskey;"/>
<menuitem id="menu_remoteWebConsole" observes="devtoolsMenuBroadcaster_RemoteWebConsole"/>
<menuitem id="menu_pageinspect" observes="devtoolsMenuBroadcaster_Inspect" accesskey="&inspectMenu.accesskey;"/>
<menuitem id="menu_responsiveUI" observes="devtoolsMenuBroadcaster_ResponsiveUI" accesskey="&responsiveDesignTool.accesskey;"/>
<menuitem id="menu_debugger" observes="devtoolsMenuBroadcaster_Debugger" accesskey="&debuggerMenu.accesskey;"/>
<menuitem id="menu_remoteDebugger" observes="devtoolsMenuBroadcaster_RemoteDebugger"/>
<menuitem id="menu_chromeDebugger" observes="devtoolsMenuBroadcaster_ChromeDebugger"/>
<menuitem id="menu_scratchpad" observes="devtoolsMenuBroadcaster_Scratchpad" accesskey="&scratchpad.accesskey;"/>
<menuitem id="menu_styleeditor" observes="devtoolsMenuBroadcaster_StyleEditor" accesskey="&styleeditor.accesskey;"/>
<menuitem id="menu_pageSource" observes="devtoolsMenuBroadcaster_PageSource" accesskey="&pageSourceCmd.accesskey;"/>
<menuitem id="javascriptConsole" observes="devtoolsMenuBroadcaster_ErrorConsole" accesskey="&errorConsoleCmd.accesskey;"/>
<menuitem id="menu_devToolbox"
observes="devtoolsMenuBroadcaster_DevToolbox"
accesskey="&devToolbox.accesskey;"/>
<menuseparator id="menu_devtools_separator"/>
<menuitem id="menu_devToolbar"
observes="devtoolsMenuBroadcaster_DevToolbar"
accesskey="&devToolbarMenu.accesskey;"/>
<menuitem id="menu_chromeDebugger"
observes="devtoolsMenuBroadcaster_ChromeDebugger"/>
<menuitem id="menu_responsiveUI"
observes="devtoolsMenuBroadcaster_ResponsiveUI"
accesskey="&responsiveDesignTool.accesskey;"/>
<menuitem id="menu_scratchpad"
observes="devtoolsMenuBroadcaster_Scratchpad"
accesskey="&scratchpad.accesskey;"/>
<menuitem id="menu_pageSource"
observes="devtoolsMenuBroadcaster_PageSource"
accesskey="&pageSourceCmd.accesskey;"/>
<menuitem id="javascriptConsole"
observes="devtoolsMenuBroadcaster_ErrorConsole"
accesskey="&errorConsoleCmd.accesskey;"/>
<menuseparator id="menu_devToolsConnectSeparator"/>
<menuitem id="menu_devtools_connect"
observes="devtoolsMenuBroadcaster_connect"/>
<menuseparator id="devToolsEndSeparator"/>
<menuitem id="getMoreDevtools" observes="devtoolsMenuBroadcaster_GetMoreTools" accesskey="&getMoreDevtoolsCmd.accesskey;"/>
<menuitem id="getMoreDevtools"
observes="devtoolsMenuBroadcaster_GetMoreTools"
accesskey="&getMoreDevtoolsCmd.accesskey;"/>
</menupopup>
</menu>
<menuitem id="menu_pageInfo"

View File

@ -88,19 +88,15 @@
<command id="Tools:Search" oncommand="BrowserSearch.webSearch();"/>
<command id="Tools:Downloads" oncommand="BrowserDownloadsUI();"/>
<command id="Tools:DevToolbox" oncommand="gDevTools.toggleToolboxCommand(gBrowser);"/>
<command id="Tools:DevToolbar" oncommand="DeveloperToolbar.toggle();" disabled="true" hidden="true"/>
<command id="Tools:DevToolbarFocus" oncommand="DeveloperToolbar.focusToggle();" disabled="true"/>
<command id="Tools:WebConsole" oncommand="HUDConsoleUI.toggleHUD();"/>
<command id="Tools:RemoteWebConsole" oncommand="HUDConsoleUI.toggleRemoteHUD();" disabled="true" hidden="true"/>
<command id="Tools:Inspect" oncommand="InspectorUI.toggleInspectorUI();"/>
<command id="Tools:Debugger" oncommand="DebuggerUI.toggleDebugger();" disabled="true" hidden="true"/>
<command id="Tools:RemoteDebugger" oncommand="DebuggerUI.toggleRemoteDebugger();" disabled="true" hidden="true"/>
<command id="Tools:ChromeDebugger" oncommand="DebuggerUI.toggleChromeDebugger();" disabled="true" hidden="true"/>
<command id="Tools:Scratchpad" oncommand="Scratchpad.openScratchpad();" disabled="true" hidden="true"/>
<command id="Tools:StyleEditor" oncommand="StyleEditor.toggle();" disabled="true" hidden="true"/>
<command id="Tools:ResponsiveUI" oncommand="ResponsiveUI.toggle();" disabled="true" hidden="true"/>
<command id="Tools:Addons" oncommand="BrowserOpenAddonsMgr();"/>
<command id="Tools:ErrorConsole" oncommand="toJavaScriptConsole()" disabled="true" hidden="true"/>
<command id="Tools:DevToolsConnect" oncommand="DevToolsXULCommands.openConnectScreen(gBrowser)"/>
<command id="Tools:Sanitize"
oncommand="Cc['@mozilla.org/browser/browserglue;1'].getService(Ci.nsIBrowserGlue).sanitize(window);"/>
<command id="Tools:PrivateBrowsing"
@ -128,27 +124,6 @@
oncommand="PlacesCommandHook.showPlacesOrganizer('History');"/>
</commandset>
<commandset id="inspectorCommands">
<command id="Inspector:Inspect"
oncommand="InspectorUI.toggleInspection();"/>
<command id="Inspector:Sidebar"
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();"/>
<command id="Inspector:ToggleVeil"
oncommand="InspectorUI.toggleVeil();"/>
<command id="Inspector:ToggleInfobar"
oncommand="InspectorUI.toggleInfobar();"/>
</commandset>
<broadcasterset id="mainBroadcasterSet">
<broadcaster id="viewBookmarksSidebar" autoCheck="false" label="&bookmarksButton.label;"
type="checkbox" group="sidebar" sidebarurl="chrome://browser/content/bookmarks/bookmarksPanel.xul"
@ -197,33 +172,15 @@
<broadcaster id="socialActiveBroadcaster" hidden="true"/>
<!-- DevTools broadcasters -->
<broadcaster id="devtoolsMenuBroadcaster_DevToolbox"
label="&devToolbarToolsButton.label;"
type="checkbox" autocheck="false"
command="Tools:DevToolbox"/>
<broadcaster id="devtoolsMenuBroadcaster_DevToolbar"
label="&devToolbarMenu.label;"
type="checkbox" autocheck="false"
command="Tools:DevToolbar"
key="key_devToolbar"/>
<broadcaster id="devtoolsMenuBroadcaster_WebConsole"
label="&webConsoleCmd.label;"
type="checkbox" autocheck="false"
key="key_webConsole"
command="Tools:WebConsole"/>
<broadcaster id="devtoolsMenuBroadcaster_RemoteWebConsole"
label="&remoteWebConsoleCmd.label;"
type="checkbox" autocheck="false"
command="Tools:RemoteWebConsole"/>
<broadcaster id="devtoolsMenuBroadcaster_Inspect"
label="&inspectMenu.label;"
type="checkbox" autocheck="false"
command="Tools:Inspect"
key="key_inspect"/>
<broadcaster id="devtoolsMenuBroadcaster_Debugger"
label="&debuggerMenu.label2;"
type="checkbox" autocheck="false"
command="Tools:Debugger"
key="key_debugger"/>
<broadcaster id="devtoolsMenuBroadcaster_RemoteDebugger"
label="&remoteDebuggerMenu.label;"
command="Tools:RemoteDebugger"/>
<broadcaster id="devtoolsMenuBroadcaster_ChromeDebugger"
label="&chromeDebuggerMenu.label;"
command="Tools:ChromeDebugger"/>
@ -231,11 +188,6 @@
label="&scratchpad.label;"
command="Tools:Scratchpad"
key="key_scratchpad"/>
<broadcaster id="devtoolsMenuBroadcaster_StyleEditor"
label="&styleeditor.label;"
type="checkbox" autocheck="false"
command="Tools:StyleEditor"
key="key_styleeditor"/>
<broadcaster id="devtoolsMenuBroadcaster_ResponsiveUI"
label="&responsiveDesignTool.label;"
type="checkbox" autocheck="false"
@ -252,6 +204,9 @@
<broadcaster id="devtoolsMenuBroadcaster_GetMoreTools"
label="&getMoreDevtoolsCmd.label;"
oncommand="openUILinkIn('https://addons.mozilla.org/firefox/collections/mozilla/webdeveloper/', 'tab');"/>
<broadcaster id="devtoolsMenuBroadcaster_connect"
label="&devtoolsConnect.label;"
command="Tools:DevToolsConnect"/>
<!-- SocialAPI broadcasters -->
<broadcaster id="socialBroadcaster_userDetails"
@ -273,7 +228,7 @@
#
# Search Command Key Logic works like this:
#
#
# Unix: Ctrl+K (cross platform binding)
# Ctrl+J (in case of emacs Ctrl-K conflict)
# Mac: Cmd+K (cross platform binding)
@ -305,27 +260,6 @@
<key id="key_errorConsole" key="&errorConsoleCmd.commandkey;" command="Tools:ErrorConsole" modifiers="accel,shift"/>
<key id="key_devToolbar" keycode="&devToolbar.keycode;" modifiers="shift"
keytext="&devToolbar.keytext;" command="Tools:DevToolbarFocus"/>
<key id="key_webConsole" key="&webConsoleCmd.commandkey;" oncommand="HUDConsoleUI.toggleHUD();"
#ifdef XP_MACOSX
modifiers="accel,alt"
#else
modifiers="accel,shift"
#endif
/>
<key id="key_debugger" key="&debuggerMenu.commandkey;" command="Tools:Debugger"
#ifdef XP_MACOSX
modifiers="accel,alt"
#else
modifiers="accel,shift"
#endif
/>
<key id="key_inspect" key="&inspectMenu.commandkey;" command="Inspector:Inspect"
#ifdef XP_MACOSX
modifiers="accel,alt"
#else
modifiers="accel,shift"
#endif
/>
<key id="key_responsiveUI" key="&responsiveDesignTool.commandkey;" command="Tools:ResponsiveUI"
#ifdef XP_MACOSX
modifiers="accel,alt"
@ -335,8 +269,6 @@
/>
<key id="key_scratchpad" keycode="&scratchpad.keycode;" modifiers="shift"
keytext="&scratchpad.keytext;" command="Tools:Scratchpad"/>
<key id="key_styleeditor" keycode="&styleeditor.keycode;" modifiers="shift"
keytext="&styleeditor.keytext;" command="Tools:StyleEditor"/>
<key id="openFileKb" key="&openFileCmd.commandkey;" command="Browser:OpenFile" modifiers="accel"/>
<key id="key_savePage" key="&savePageCmd.commandkey;" command="Browser:SavePage" modifiers="accel"/>
<key id="printKb" key="&printCmd.commandkey;" command="cmd_print" modifiers="accel"/>

View File

@ -562,10 +562,6 @@ statuspanel[inactive][previoustype=overLink] {
-moz-box-align: end;
}
.styleInspector {
min-width: 350px;
}
.panel-inner-arrowcontentfooter[footertype="promobox"] {
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#promobox");
}
@ -593,22 +589,16 @@ html|*#gcli-output-frame,
direction: ltr;
}
#developer-toolbar-webconsole[error-count] > .toolbarbutton-icon {
#developer-toolbar-toolbox-button[error-count] > .toolbarbutton-icon {
display: none;
}
#developer-toolbar-webconsole[error-count]:before {
#developer-toolbar-toolbox-button[error-count]:before {
content: attr(error-count);
display: -moz-box;
-moz-box-pack: center;
}
/* We don't show the Style Editor button in the developer toolbar for now.
See bug 771203 */
#developer-toolbar-styleeditor {
display: none;
}
/* Responsive Mode */
.browserContainer[responsivemode] {

View File

@ -115,28 +115,15 @@ XPCOMUtils.defineLazyGetter(this, "DeveloperToolbar", function() {
return new tmp.DeveloperToolbar(window, document.getElementById("developer-toolbar"));
});
XPCOMUtils.defineLazyGetter(this, "InspectorUI", function() {
let tmp = {};
Cu.import("resource:///modules/inspector.jsm", tmp);
return new tmp.InspectorUI(window);
});
XPCOMUtils.defineLazyGetter(this, "DebuggerUI", function() {
let tmp = {};
Cu.import("resource:///modules/devtools/DebuggerUI.jsm", tmp);
return new tmp.DebuggerUI(window);
});
XPCOMUtils.defineLazyGetter(this, "Tilt", function() {
let tmp = {};
Cu.import("resource:///modules/devtools/Tilt.jsm", tmp);
return new tmp.Tilt(window);
});
XPCOMUtils.defineLazyModuleGetter(this, "Social",
"resource:///modules/Social.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PageThumbs",
"resource:///modules/PageThumbs.jsm");
@ -1428,26 +1415,6 @@ var gBrowserInit = {
}
}
// Enable Debugger?
let enabled = gPrefService.getBoolPref("devtools.debugger.enabled");
if (enabled) {
let cmd = document.getElementById("Tools:Debugger");
cmd.removeAttribute("disabled");
cmd.removeAttribute("hidden");
}
// Enable Remote Debugger?
let enabled = gPrefService.getBoolPref("devtools.debugger.remote-enabled");
if (enabled) {
let cmd = document.getElementById("Tools:RemoteDebugger");
cmd.removeAttribute("disabled");
cmd.removeAttribute("hidden");
cmd = document.getElementById("Tools:RemoteWebConsole");
cmd.removeAttribute("disabled");
cmd.removeAttribute("hidden");
}
// Enable Chrome Debugger?
let enabled = gPrefService.getBoolPref("devtools.chrome.enabled") &&
gPrefService.getBoolPref("devtools.debugger.chrome-enabled") &&
@ -1476,14 +1443,6 @@ var gBrowserInit = {
cmd.removeAttribute("hidden");
}
// Enable Style Editor?
let styleEditorEnabled = gPrefService.getBoolPref(StyleEditor.prefEnabledName);
if (styleEditorEnabled) {
let cmd = document.getElementById("Tools:StyleEditor");
cmd.removeAttribute("disabled");
cmd.removeAttribute("hidden");
}
#ifdef MENUBAR_CAN_AUTOHIDE
// If the user (or the locale) hasn't enabled the top-level "Character
// Encoding" menu via the "browser.menu.showCharacterEncoding" preference,
@ -1501,6 +1460,9 @@ var gBrowserInit = {
cmd.removeAttribute("hidden");
}
// Add Devtools menuitems and listeners
gDevTools.registerBrowserWindow(window);
let appMenuButton = document.getElementById("appmenu-button");
let appMenuPopup = document.getElementById("appmenu-popup");
if (appMenuButton && appMenuPopup) {
@ -1543,8 +1505,7 @@ var gBrowserInit = {
if (!gStartupRan)
return;
if (!__lookupGetter__("InspectorUI"))
InspectorUI.destroy();
gDevTools.forgetBrowserWindow(window);
// First clean up services initialized in gBrowserInit.onLoad (or those whose
// uninit methods don't depend on the services having been initialized).
@ -1642,7 +1603,7 @@ var gBrowserInit = {
'viewToolbarsMenu', 'viewSidebarMenuMenu', 'Browser:Reload',
'viewFullZoomMenu', 'pageStyleMenu', 'charsetMenu', 'View:PageSource', 'View:FullScreen',
'viewHistorySidebar', 'Browser:AddBookmarkAs', 'Browser:BookmarkAllTabs',
'View:PageInfo', 'Tasks:InspectPage', 'Browser:ToggleTabView', 'Browser:ToggleAddonBar'];
'View:PageInfo', 'Browser:ToggleTabView', 'Browser:ToggleAddonBar'];
var element;
for (let disabledItem of disabledItems) {
@ -7448,6 +7409,12 @@ var TabContextMenu = {
}
};
XPCOMUtils.defineLazyModuleGetter(this, "gDevTools",
"resource:///modules/devtools/gDevTools.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "DevToolsXULCommands",
"resource:///modules/devtools/gDevTools.jsm");
XPCOMUtils.defineLazyGetter(this, "HUDConsoleUI", function () {
let tempScope = {};
Cu.import("resource:///modules/HUDService.jsm", tempScope);
@ -7544,41 +7511,6 @@ XPCOMUtils.defineLazyGetter(ResponsiveUI, "ResponsiveUIManager", function() {
return tmp.ResponsiveUIManager;
});
var StyleEditor = {
prefEnabledName: "devtools.styleeditor.enabled",
/**
* Opens the style editor. If the UI is already open, it will be focused.
*
* @param {CSSStyleSheet} [aSelectedStyleSheet] default Stylesheet.
* @param {Number} [aLine] Line to which the caret should be moved (one-indexed).
* @param {Number} [aCol] Column to which the caret should be moved (one-indexed).
*/
openChrome: function SE_openChrome(aSelectedStyleSheet, aLine, aCol)
{
let contentWindow = gBrowser.selectedBrowser.contentWindow;
let win = this.StyleEditorManager.getEditorForWindow(contentWindow);
if (win) {
this.StyleEditorManager.selectEditor(win);
return win;
} else {
return this.StyleEditorManager.newEditor(contentWindow, window,
aSelectedStyleSheet, aLine, aCol);
}
},
toggle: function SE_toggle()
{
this.StyleEditorManager.toggleEditor(gBrowser.contentWindow, window);
}
};
XPCOMUtils.defineLazyGetter(StyleEditor, "StyleEditorManager", function() {
let tmp = {};
Cu.import("resource:///modules/devtools/StyleEditor.jsm", tmp);
return new tmp.StyleEditorManager(window);
});
XPCOMUtils.defineLazyGetter(window, "gShowPageResizers", function () {
#ifdef XP_WIN
// Only show resizers on Windows 2000 and XP

View File

@ -278,22 +278,6 @@
noautofocus="true"
position="topcenter topright"/>
<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);">
<menuseparator/>
@ -663,6 +647,7 @@
removable="false"
title="&socialToolbar.title;"
hidden="true"
skipintoolbarset="true"
observes="socialActiveBroadcaster">
<toolbarbutton id="social-provider-button"
class="toolbarbutton-1"
@ -1065,19 +1050,6 @@
<chatbar id="pinnedchats" layer="true" mousethrough="always" hidden="true"/>
<statuspanel id="statusbar-display" inactive="true"/>
</vbox>
<splitter id="devtools-side-splitter" hidden="true"/>
<vbox id="devtools-sidebar-box" hidden="true"
style="min-width: 18em; width: 22em; max-width: 42em;" persist="width">
<toolbar id="devtools-sidebar-toolbar"
class="devtools-toolbar"
nowindowdrag="true">
<spacer flex="1"/>
<toolbarbutton tooltiptext="&inspectSidebarCloseButton.tooltiptext;"
class="devtools-closebutton"
command="Inspector:Sidebar"/>
</toolbar>
<deck id="devtools-sidebar-deck" flex="1"/>
</vbox>
<splitter id="social-sidebar-splitter"
class="chromeclass-extrachrome sidebar-splitter"
observes="socialSidebarBroadcaster"/>
@ -1116,52 +1088,6 @@
</hbox>
<vbox id="browser-bottombox" layer="true">
<toolbar id="inspector-toolbar"
class="devtools-toolbar"
nowindowdrag="true"
hidden="true">
#ifdef XP_MACOSX
<toolbarbutton id="highlighter-closebutton"
class="devtools-closebutton"
oncommand="InspectorUI.closeInspectorUI(false);"
tooltiptext="&inspectCloseButton.tooltiptext;"/>
#endif
<toolbarbutton id="inspector-inspect-toolbutton"
class="devtools-toolbarbutton"
command="Inspector:Inspect"/>
<toolbarbutton id="inspector-treepanel-toolbutton"
class="devtools-toolbarbutton"
tabindex="0"
aria-label="&markupButton.arialabel;"
accesskey="&markupButton.accesskey;"
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;"
tabindex="0"
command="Inspector:Tilt"/>
<toolbarbutton id="inspector-style-button"
class="devtools-toolbarbutton"
label="&inspectStyleButton.label;"
accesskey="&inspectStyleButton.accesskey;"
tabindex="0"
command="Inspector:Sidebar"/>
<!-- registered tools go here -->
</hbox>
#ifndef XP_MACOSX
<toolbarbutton id="highlighter-closebutton"
class="devtools-closebutton"
oncommand="InspectorUI.closeInspectorUI(false);"
tooltiptext="&inspectCloseButton.tooltiptext;"/>
#endif
</toolbar>
<toolbar id="developer-toolbar"
class="devtools-toolbar"
hidden="true">
@ -1178,36 +1104,9 @@
<hbox class="gclitoolbar-complete-node"/>
<textbox class="gclitoolbar-input-node" rows="1"/>
</stack>
<toolbarbutton id="developer-toolbar-webconsole"
<toolbarbutton id="developer-toolbar-toolbox-button"
class="developer-toolbar-button"
observes="devtoolsMenuBroadcaster_WebConsole"/>
<toolbarbutton id="developer-toolbar-inspector"
class="developer-toolbar-button"
observes="devtoolsMenuBroadcaster_Inspect"/>
<toolbarbutton id="developer-toolbar-styleeditor"
class="developer-toolbar-button"
observes="devtoolsMenuBroadcaster_StyleEditor"/>
<toolbarbutton id="developer-toolbar-debugger"
class="developer-toolbar-button"
observes="devtoolsMenuBroadcaster_Debugger"/>
<toolbarbutton id="developer-toolbar-other-tools"
type="menu"
class="developer-toolbar-button"
label="&devToolbarOtherToolsButton.label;">
<menupopup position="before_end">
<menuitem observes="devtoolsMenuBroadcaster_DevToolbar"/>
<menuitem observes="devtoolsMenuBroadcaster_ResponsiveUI"/>
<menuitem observes="devtoolsMenuBroadcaster_RemoteDebugger"/>
<menuitem observes="devtoolsMenuBroadcaster_ChromeDebugger"/>
<menuitem observes="devtoolsMenuBroadcaster_Scratchpad"/>
<menuitem observes="devtoolsMenuBroadcaster_StyleEditor"/>
<menuitem observes="devtoolsMenuBroadcaster_PageSource"/>
<menuitem observes="devtoolsMenuBroadcaster_ErrorConsole"/>
<menuseparator/>
<menuitem observes="devtoolsMenuBroadcaster_GetMoreTools"/>
</menupopup>
</toolbarbutton>
observes="devtoolsMenuBroadcaster_DevToolbox"/>
#ifndef XP_MACOSX
<toolbarbutton id="developer-toolbar-closebutton"
class="devtools-closebutton"

View File

@ -2,64 +2,60 @@
* 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/. */
#highlighter-container {
.highlighter-container {
pointer-events: none;
}
#highlighter-controls {
.highlighter-controls {
position: absolute;
top: 0;
left: 0;
}
#highlighter-outline-container {
.highlighter-outline-container {
overflow: hidden;
position: relative;
}
#highlighter-outline {
.highlighter-outline {
position: absolute;
}
#highlighter-outline[hidden] {
.highlighter-outline[hidden] {
opacity: 0;
pointer-events: none;
display: -moz-box;
}
#highlighter-outline:not([disable-transitions]) {
.highlighter-outline:not([disable-transitions]) {
transition-property: opacity, top, left, width, height;
transition-duration: 0.1s;
transition-timing-function: linear;
}
.inspector-breadcrumbs-button {
direction: ltr;
}
/*
* Node Infobar
*/
#highlighter-nodeinfobar-container {
.highlighter-nodeinfobar-container {
position: absolute;
max-width: 95%;
}
#highlighter-nodeinfobar-container[hidden] {
.highlighter-nodeinfobar-container[hidden] {
opacity: 0;
pointer-events: none;
display: -moz-box;
}
#highlighter-nodeinfobar-container:not([disable-transitions]),
#highlighter-nodeinfobar-container[disable-transitions][force-transitions] {
.highlighter-nodeinfobar-container:not([disable-transitions]),
.highlighter-nodeinfobar-container[disable-transitions][force-transitions] {
transition-property: transform, opacity, top, left;
transition-duration: 0.1s;
transition-timing-function: linear;
}
#highlighter-nodeinfobar-text {
.highlighter-nodeinfobar-text {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
@ -70,19 +66,19 @@
display: none;
}
#highlighter-nodeinfobar-container:not([locked]):not(:hover) > #highlighter-nodeinfobar > .highlighter-nodeinfobar-button {
.highlighter-nodeinfobar-container:not([locked]):not(:hover) > .highlighter-nodeinfobar > .highlighter-nodeinfobar-button {
visibility: hidden;
}
#highlighter-nodeinfobar-container[locked] > #highlighter-nodeinfobar,
#highlighter-nodeinfobar-container:not([locked]):hover > #highlighter-nodeinfobar {
.highlighter-nodeinfobar-container[locked] > .highlighter-nodeinfobar,
.highlighter-nodeinfobar-container:not([locked]):hover > .highlighter-nodeinfobar {
pointer-events: auto;
}
html|*#highlighter-nodeinfobar-id,
html|*#highlighter-nodeinfobar-classes,
html|*#highlighter-nodeinfobar-pseudo-classes,
html|*#highlighter-nodeinfobar-tagname {
html|*.highlighter-nodeinfobar-id,
html|*.highlighter-nodeinfobar-classes,
html|*.highlighter-nodeinfobar-pseudo-classes,
html|*.highlighter-nodeinfobar-tagname {
-moz-user-select: text;
cursor: text;
}
@ -91,41 +87,18 @@ html|*#highlighter-nodeinfobar-tagname {
display: none;
}
#highlighter-nodeinfobar-container[position="top"]:not([hide-arrow]) > #highlighter-nodeinfobar-arrow-bottom {
.highlighter-nodeinfobar-container[position="top"]:not([hide-arrow]) > .highlighter-nodeinfobar-arrow-bottom {
display: block;
}
#highlighter-nodeinfobar-container[position="bottom"]:not([hide-arrow]) > #highlighter-nodeinfobar-arrow-top {
.highlighter-nodeinfobar-container[position="bottom"]:not([hide-arrow]) > .highlighter-nodeinfobar-arrow-top {
display: block;
}
#highlighter-nodeinfobar-container[disabled] {
.highlighter-nodeinfobar-container[disabled] {
visibility: hidden;
}
html|*#highlighter-nodeinfobar-tagname {
html|*.highlighter-nodeinfobar-tagname {
text-transform: lowercase;
}
.devtools-toolbarbutton:not([label]) > .toolbarbutton-text {
display: none;
}
#inspector-option-toolbarbutton > .toolbarbutton-menu-dropmarker {
display: none;
}
#inspector-layoutview-container > iframe {
/* header size */
height: 28px;
}
#inspector-layoutview-container:not([disable-transitions]) > iframe {
transition-property: height;
transition-duration: 0.2s;
}
#inspector-layoutview-container > iframe[open] {
/* header size + layout view size: 28px + 145px */
height: 173px;
}

View File

@ -138,7 +138,13 @@ nsContextMenu.prototype = {
}
var shouldShow = this.onSaveableLink || isMailtoInternal || this.onPlainTextLink;
#ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING
var isWindowPrivate = PrivateBrowsingUtils.isWindowPrivate(window);
this.showItem("context-openlink", shouldShow && !isWindowPrivate);
this.showItem("context-openlinkprivate", shouldShow);
#else
this.showItem("context-openlink", shouldShow);
#endif
this.showItem("context-openlinkintab", shouldShow);
this.showItem("context-openlinkincurrent", this.onPlainTextLink);
this.showItem("context-sep-open", shouldShow);
@ -412,11 +418,19 @@ nsContextMenu.prototype = {
},
inspectNode: function CM_inspectNode() {
if (InspectorUI.isTreePanelOpen) {
InspectorUI.inspectNode(this.target);
InspectorUI.stopInspecting();
let gBrowser = this.browser.ownerDocument.defaultView.gBrowser;
let imported = {};
Cu.import("resource:///modules/devtools/Target.jsm", imported);
var target = imported.TargetFactory.forTab(gBrowser.selectedTab);
let inspector = gDevTools.getPanelForTarget("inspector", target);
if (inspector && inspector.isReady) {
inspector.selection.setNode(this.target);
} else {
InspectorUI.openInspectorUI(this.target);
let toolbox = gDevTools.openToolboxForTab(target, "inspector");
toolbox.once("inspector-ready", function(event, panel) {
let inspector = gDevTools.getPanelForTarget("inspector", target);
inspector.selection.setNode(this.target, "browser-context-menu");
}.bind(this));
}
},
@ -676,6 +690,16 @@ nsContextMenu.prototype = {
referrerURI: doc.documentURIObject });
},
// Open linked-to URL in a new private window.
openLinkInPrivateWindow : function () {
var doc = this.target.ownerDocument;
urlSecurityCheck(this.linkURL, doc.nodePrincipal);
openLinkIn(this.linkURL, "window",
{ charset: doc.characterSet,
referrerURI: doc.documentURIObject,
private: true });
},
// Open linked-to URL in a new tab.
openLinkInTab: function() {
var doc = this.target.ownerDocument;

View File

@ -50,6 +50,11 @@ MOCHITEST_FILES += \
test_contextmenu.html \
subtst_contextmenu.html \
$(NULL)
ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING
MOCHITEST_FILES += \
privateBrowsingMode.js \
$(NULL)
endif
endif
# The following tests are disabled because they are unreliable:
@ -158,7 +163,6 @@ _BROWSER_FILES = \
browser_bug735471.js \
browser_bug743421.js \
browser_bug749738.js \
browser_bug767836.js \
browser_bug783614.js \
browser_bug797677.js \
browser_canonizeURL.js \
@ -308,12 +312,14 @@ endif
ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING
_BROWSER_FILES += \
browser_bug763468_perwindowpb.js \
browser_bug767836_perwindowpb.js \
browser_private_browsing_window.js \
browser_save_link-perwindowpb.js \
$(NULL)
else
_BROWSER_FILES += \
browser_bug763468.js \
browser_bug767836.js \
browser_save_link.js \
$(NULL)
endif

View File

@ -0,0 +1,83 @@
/* 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/. */
function test() {
//initialization
waitForExplicitFinish();
let newTabPrefName = "browser.newtab.url";
let newTabURL;
let testURL = "http://example.com/";
let mode;
function doTest(aIsPrivateMode, aWindow, aCallback) {
openNewTab(aWindow, function () {
if (aIsPrivateMode) {
mode = "per window private browsing";
newTabURL = "about:privatebrowsing";
} else {
mode = "normal";
newTabURL = Services.prefs.getCharPref(newTabPrefName) || "about:blank";
}
// Check the new tab opened while in normal/private mode
is(aWindow.gBrowser.selectedBrowser.currentURI.spec, newTabURL,
"URL of NewTab should be " + newTabURL + " in " + mode + " mode");
// Set the custom newtab url
Services.prefs.setCharPref(newTabPrefName, testURL);
ok(Services.prefs.prefHasUserValue(newTabPrefName), "Custom newtab url is set");
// Open a newtab after setting the custom newtab url
openNewTab(aWindow, function () {
is(aWindow.gBrowser.selectedBrowser.currentURI.spec, testURL,
"URL of NewTab should be the custom url");
// clear the custom url preference
Services.prefs.clearUserPref(newTabPrefName);
ok(!Services.prefs.prefHasUserValue(newTabPrefName), "No custom newtab url is set");
aWindow.gBrowser.removeTab(aWindow.gBrowser.selectedTab);
aWindow.gBrowser.removeTab(aWindow.gBrowser.selectedTab);
aWindow.close();
aCallback()
});
});
}
function testOnWindow(aIsPrivate, aCallback) {
whenNewWindowLoaded({private: aIsPrivate}, function(win) {
executeSoon(function() aCallback(win));
});
}
// check whether any custom new tab url has been configured
ok(!Services.prefs.prefHasUserValue(newTabPrefName), "No custom newtab url is set");
// test normal mode
testOnWindow(false, function(aWindow) {
doTest(false, aWindow, function() {
// test private mode
testOnWindow(true, function(aWindow) {
doTest(true, aWindow, function() {
finish();
});
});
});
});
}
function openNewTab(aWindow, aCallback) {
// Open a new tab
aWindow.BrowserOpenTab();
let browser = aWindow.gBrowser.selectedBrowser;
if (browser.contentDocument.readyState == "complete") {
executeSoon(aCallback);
return;
}
browser.addEventListener("load", function onLoad() {
browser.removeEventListener("load", onLoad, true);
executeSoon(aCallback);
}, true);
}

View File

@ -0,0 +1,3 @@
// This file is only present in per-window private browsing buikds.
var perWindowPrivateBrowsing = true;

View File

@ -14,6 +14,8 @@ Browser context menu tests.
</div>
<pre id="test">
<script> var perWindowPrivateBrowsing = false; </script>
<script type="text/javascript" src="privateBrowsingMode.js"></script>
<script class="testbody" type="text/javascript">
/** Test for Login Manager: multiple login autocomplete. **/
@ -292,13 +294,24 @@ function runTest(testNum) {
case 3:
// Context menu for text link
checkContextMenu(["context-openlinkintab", true,
"context-openlink", true,
"---", null,
"context-bookmarklink", true,
"context-savelink", true,
"context-copylink", true
].concat(inspectItems));
if (perWindowPrivateBrowsing) {
checkContextMenu(["context-openlinkintab", true,
"context-openlink", true,
"context-openlinkprivate", true,
"---", null,
"context-bookmarklink", true,
"context-savelink", true,
"context-copylink", true
].concat(inspectItems));
} else {
checkContextMenu(["context-openlinkintab", true,
"context-openlink", true,
"---", null,
"context-bookmarklink", true,
"context-savelink", true,
"context-copylink", true
].concat(inspectItems));
}
closeContextMenu();
openContextMenuFor(mailto); // Invoke context menu for next test.
break;
@ -750,18 +763,34 @@ function runTest(testNum) {
// Context menu for selected text which matches valid URL pattern
if (SpecialPowers.Services.appinfo.OS == "Darwin") {
// This test is only enabled on Mac due to bug 736399.
checkContextMenu(["context-openlinkincurrent", true,
"context-openlinkintab", true,
"context-openlink", true,
"---", null,
"context-bookmarklink", true,
"context-savelink", true,
"context-copy", true,
"context-selectall", true,
"---", null,
"context-searchselect", true,
"context-viewpartialsource-selection", true
].concat(inspectItems));
if (perWindowPrivateBrowsing) {
checkContextMenu(["context-openlinkincurrent", true,
"context-openlinkintab", true,
"context-openlink", true,
"context-openlinkprivate", true,
"---", null,
"context-bookmarklink", true,
"context-savelink", true,
"context-copy", true,
"context-selectall", true,
"---", null,
"context-searchselect", true,
"context-viewpartialsource-selection", true
].concat(inspectItems));
} else {
checkContextMenu(["context-openlinkincurrent", true,
"context-openlinkintab", true,
"context-openlink", true,
"---", null,
"context-bookmarklink", true,
"context-savelink", true,
"context-copy", true,
"context-selectall", true,
"---", null,
"context-searchselect", true,
"context-viewpartialsource-selection", true
].concat(inspectItems));
}
}
closeContextMenu();
// clear the selection because following tests don't expect any selection
@ -772,22 +801,42 @@ function runTest(testNum) {
case 26:
// Context menu for image link
checkContextMenu(["context-openlinkintab", true,
"context-openlink", true,
"---", null,
"context-bookmarklink", true,
"context-savelink", true,
"context-copylink", true,
"---", null,
"context-viewimage", true,
"context-copyimage-contents", true,
"context-copyimage", true,
"---", null,
"context-saveimage", true,
"context-sendimage", true,
"context-setDesktopBackground", true,
"context-viewimageinfo", true
].concat(inspectItems));
if (perWindowPrivateBrowsing) {
checkContextMenu(["context-openlinkintab", true,
"context-openlink", true,
"context-openlinkprivate", true,
"---", null,
"context-bookmarklink", true,
"context-savelink", true,
"context-copylink", true,
"---", null,
"context-viewimage", true,
"context-copyimage-contents", true,
"context-copyimage", true,
"---", null,
"context-saveimage", true,
"context-sendimage", true,
"context-setDesktopBackground", true,
"context-viewimageinfo", true
].concat(inspectItems));
} else {
checkContextMenu(["context-openlinkintab", true,
"context-openlink", true,
"---", null,
"context-bookmarklink", true,
"context-savelink", true,
"context-copylink", true,
"---", null,
"context-viewimage", true,
"context-copyimage-contents", true,
"context-copyimage", true,
"---", null,
"context-saveimage", true,
"context-sendimage", true,
"context-setDesktopBackground", true,
"context-viewimageinfo", true
].concat(inspectItems));
}
closeContextMenu();
selectInputText(select_inputtext); // Select text prior to opening context menu.
openContextMenuFor(select_inputtext); // Invoke context menu for next test.

View File

@ -222,6 +222,7 @@ function openLinkIn(url, where, params) {
// Currently, this parameter works only for where=="tab" or "current"
var aIsUTF8 = params.isUTF8;
var aInitiatingDoc = params.initiatingDoc;
var aIsPrivate = params.private;
if (where == "save") {
if (!aInitiatingDoc) {
@ -267,8 +268,14 @@ function openLinkIn(url, where, params) {
sa.AppendElement(aPostData);
sa.AppendElement(allowThirdPartyFixupSupports);
Services.ww.openWindow(w || window, getBrowserURL(),
null, "chrome,dialog=no,all", sa);
let features = "chrome,dialog=no,all";
#ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING
if (aIsPrivate) {
features += ",private";
}
#endif
Services.ww.openWindow(w || window, getBrowserURL(), null, features, sa);
return;
}

View File

@ -123,7 +123,7 @@ browser.jar:
* content/browser/license.html (/toolkit/content/license.html)
% override chrome://global/content/license.html chrome://browser/content/license.html
#ifdef MOZ_SAFE_BROWSING
* content/browser/report-phishing-overlay.xul (content/report-phishing-overlay.xul)
content/browser/report-phishing-overlay.xul (content/report-phishing-overlay.xul)
content/browser/blockedSite.xhtml (content/blockedSite.xhtml)
% overlay chrome://browser/content/browser.xul chrome://browser/content/report-phishing-overlay.xul
#endif

View File

@ -685,8 +685,8 @@ const DownloadsView = {
{
// If the item is visible, just return it, otherwise return a mock object
// that doesn't react to notifications.
if (aDataItem.downloadId in this._viewItems) {
return this._viewItems[aDataItem.downloadId];
if (aDataItem.downloadGuid in this._viewItems) {
return this._viewItems[aDataItem.downloadGuid];
}
return this._invisibleViewItem;
},
@ -707,7 +707,7 @@ const DownloadsView = {
{
let element = document.createElement("richlistitem");
let viewItem = new DownloadsViewItem(aDataItem, element);
this._viewItems[aDataItem.downloadId] = viewItem;
this._viewItems[aDataItem.downloadGuid] = viewItem;
if (aNewest) {
this.richListBox.insertBefore(element, this.richListBox.firstChild);
} else {
@ -725,7 +725,7 @@ const DownloadsView = {
this.richListBox.removeChild(element);
this.richListBox.selectedIndex = Math.min(previousSelectedIndex,
this.richListBox.itemCount - 1);
delete this._viewItems[aDataItem.downloadId];
delete this._viewItems[aDataItem.downloadGuid];
},
//////////////////////////////////////////////////////////////////////////////
@ -861,8 +861,8 @@ function DownloadsViewItem(aDataItem, aElement)
let attributes = {
"type": "download",
"class": "download-state",
"id": "downloadsItem_" + this.dataItem.downloadId,
"downloadId": this.dataItem.downloadId,
"id": "downloadsItem_" + this.dataItem.downloadGuid,
"downloadGuid": this.dataItem.downloadGuid,
"state": this.dataItem.state,
"progress": this.dataItem.inProgress ? this.dataItem.percentComplete : 100,
"target": this.dataItem.target,
@ -1170,8 +1170,8 @@ const DownloadsViewController = {
* related to a single item in the downloads list widgets.
*/
function DownloadsViewItemController(aElement) {
let downloadId = aElement.getAttribute("downloadId");
this.dataItem = DownloadsCommon.data.dataItems[downloadId];
let downloadGuid = aElement.getAttribute("downloadGuid");
this.dataItem = DownloadsCommon.data.dataItems[downloadGuid];
}
DownloadsViewItemController.prototype = {
@ -1232,24 +1232,22 @@ DownloadsViewItemController.prototype = {
commands: {
cmd_delete: function DVIC_cmd_delete()
{
this.commands.downloadsCmd_cancel.apply(this);
Services.downloads.removeDownload(this.dataItem.downloadId);
this.dataItem.getDownload(function (aDownload) {
if (this.dataItem.inProgress) {
aDownload.cancel();
this._ensureLocalFileRemoved();
}
aDownload.remove();
}.bind(this));
},
downloadsCmd_cancel: function DVIC_downloadsCmd_cancel()
{
if (this.dataItem.inProgress) {
Services.downloads.cancelDownload(this.dataItem.downloadId);
// It is possible that in some cases the Download Manager service
// doesn't delete the file from disk when canceling. See bug 732924.
try {
let localFile = this.dataItem.localFile;
if (localFile.exists()) {
localFile.remove(false);
}
} catch (ex) { }
this.dataItem.getDownload(function (aDownload) {
aDownload.cancel();
this._ensureLocalFileRemoved();
}.bind(this));
}
},
@ -1295,23 +1293,25 @@ DownloadsViewItemController.prototype = {
}
// Actually open the file.
try {
let launched = false;
this.dataItem.getDownload(function (aDownload) {
try {
let mimeInfo = this.dataItem.download.MIMEInfo;
if (mimeInfo.preferredAction == mimeInfo.useHelperApp) {
mimeInfo.launchWithFile(localFile);
launched = true;
let launched = false;
try {
let mimeInfo = aDownload.MIMEInfo;
if (mimeInfo.preferredAction == mimeInfo.useHelperApp) {
mimeInfo.launchWithFile(localFile);
launched = true;
}
} catch (ex) { }
if (!launched) {
localFile.launch();
}
} catch (ex) { }
if (!launched) {
localFile.launch();
} catch (ex) {
// If launch fails, try sending it through the system's external "file:"
// URL handler.
this._openExternal(localFile);
}
} catch (ex) {
// If launch fails, try sending it through the system's external "file:"
// URL handler.
this._openExternal(localFile);
}
}.bind(this));
// We explicitly close the panel here to give the user the feedback that
// their click has been received, and we're handling the action.
@ -1354,16 +1354,20 @@ DownloadsViewItemController.prototype = {
downloadsCmd_pauseResume: function DVIC_downloadsCmd_pauseResume()
{
if (this.dataItem.paused) {
Services.downloads.resumeDownload(this.dataItem.downloadId);
} else {
Services.downloads.pauseDownload(this.dataItem.downloadId);
}
this.dataItem.getDownload(function (aDownload) {
if (this.dataItem.paused) {
aDownload.resume();
} else {
aDownload.pause();
}
}.bind(this));
},
downloadsCmd_retry: function DVIC_downloadsCmd_retry()
{
Services.downloads.retryDownload(this.dataItem.downloadId);
this.dataItem.getDownload(function (aDownload) {
aDownload.retry();
});
},
downloadsCmd_openReferrer: function DVIC_downloadsCmd_openReferrer()
@ -1412,6 +1416,21 @@ DownloadsViewItemController.prototype = {
let protocolSvc = Cc["@mozilla.org/uriloader/external-protocol-service;1"]
.getService(Ci.nsIExternalProtocolService);
protocolSvc.loadUrl(makeFileURI(aFile));
},
/**
* Support function that deletes the local file for a download. This is
* used in cases where the Download Manager service doesn't delete the file
* from disk when cancelling. See bug 732924.
*/
_ensureLocalFileRemoved: function DVIC_ensureLocalFileRemoved()
{
try {
let localFile = this.dataItem.localFile;
if (localFile.exists()) {
localFile.remove(false);
}
} catch (ex) { }
}
};

View File

@ -206,10 +206,10 @@ this.DownloadsCommon = {
},
/**
* Given an iterable collection of nsIDownload's, generates and returns
* Given an iterable collection of DownloadDataItems, generates and returns
* statistics about that collection.
*
* @param aDownloads An iterable collection of nsIDownloads.
* @param aDataItems An iterable collection of DownloadDataItems.
*
* @return Object whose properties are the generated statistics. Currently,
* we return the following properties:
@ -226,7 +226,7 @@ this.DownloadsCommon = {
* complete.
* percentComplete : The percentage of bytes successfully downloaded.
*/
summarizeDownloads: function DC_summarizeDownloads(aDownloads)
summarizeDownloads: function DC_summarizeDownloads(aDataItems)
{
let summary = {
numActive: 0,
@ -238,17 +238,15 @@ this.DownloadsCommon = {
// slowestSpeed is Infinity so that we can use Math.min to
// find the slowest speed. We'll set this to 0 afterwards if
// it's still at Infinity by the time we're done iterating all
// downloads.
// dataItems.
slowestSpeed: Infinity,
rawTimeLeft: -1,
percentComplete: -1
}
// If no download has been loaded, don't use the methods of the Download
// Manager service, so that it is not initialized unnecessarily.
for (let download of aDownloads) {
for (let dataItem of aDataItems) {
summary.numActive++;
switch (download.state) {
switch (dataItem.state) {
case nsIDM.DOWNLOAD_PAUSED:
summary.numPaused++;
break;
@ -257,21 +255,21 @@ this.DownloadsCommon = {
break;
case nsIDM.DOWNLOAD_DOWNLOADING:
summary.numDownloading++;
if (download.size > 0 && download.speed > 0) {
let sizeLeft = download.size - download.amountTransferred;
if (dataItem.maxBytes > 0 && dataItem.speed > 0) {
let sizeLeft = dataItem.maxBytes - dataItem.currBytes;
summary.rawTimeLeft = Math.max(summary.rawTimeLeft,
sizeLeft / download.speed);
sizeLeft / dataItem.speed);
summary.slowestSpeed = Math.min(summary.slowestSpeed,
download.speed);
dataItem.speed);
}
break;
}
// Only add to total values if we actually know the download size.
if (download.size > 0 &&
download.state != nsIDM.DOWNLOAD_CANCELED &&
download.state != nsIDM.DOWNLOAD_FAILED) {
summary.totalSize += download.size;
summary.totalTransferred += download.amountTransferred;
if (dataItem.maxBytes > 0 &&
dataItem.state != nsIDM.DOWNLOAD_CANCELED &&
dataItem.state != nsIDM.DOWNLOAD_FAILED) {
summary.totalSize += dataItem.maxBytes;
summary.totalTransferred += dataItem.currBytes;
}
}
@ -371,7 +369,7 @@ const DownloadsData = {
{
// Start receiving real-time events.
aDownloadManagerService.addListener(this);
Services.obs.addObserver(this, "download-manager-remove-download", false);
Services.obs.addObserver(this, "download-manager-remove-download-guid", false);
Services.obs.addObserver(this, "download-manager-database-type-changed",
false);
},
@ -385,7 +383,7 @@ const DownloadsData = {
// Stop receiving real-time events.
Services.obs.removeObserver(this, "download-manager-database-type-changed");
Services.obs.removeObserver(this, "download-manager-remove-download");
Services.obs.removeObserver(this, "download-manager-remove-download-guid");
Services.downloads.removeListener(this);
},
@ -437,12 +435,12 @@ const DownloadsData = {
// Indicate to the view that a batch loading operation is in progress.
aView.onDataLoadStarting();
// Sort backwards by download identifier, ensuring that the most recent
// Sort backwards by start time, ensuring that the most recent
// downloads are added first regardless of their state.
let loadedItemsArray = [dataItem
for each (dataItem in this.dataItems)
if (dataItem)];
loadedItemsArray.sort(function(a, b) b.downloadId - a.downloadId);
loadedItemsArray.sort(function(a, b) b.startTime - a.startTime);
loadedItemsArray.forEach(
function (dataItem) aView.onDataItemAdded(dataItem, false)
);
@ -498,7 +496,7 @@ const DownloadsData = {
* if it doesn't already exist in the list. This should implement
* either nsIDownload or mozIStorageRow. If the item exists, this
* argument is only used to retrieve the download identifier.
* @param aMayReuseId
* @param aMayReuseGUID
* If false, indicates that the download should not be added if a
* download with the same identifier was removed in the meantime. This
* ensures that, while loading the list asynchronously, downloads that
@ -507,21 +505,21 @@ const DownloadsData = {
* @return New or existing data item, or null if the item was deleted from the
* list of available downloads.
*/
_getOrAddDataItem: function DD_getOrAddDataItem(aSource, aMayReuseId)
_getOrAddDataItem: function DD_getOrAddDataItem(aSource, aMayReuseGUID)
{
let downloadId = (aSource instanceof Ci.nsIDownload)
? aSource.id
: aSource.getResultByName("id");
if (downloadId in this.dataItems) {
let existingItem = this.dataItems[downloadId];
if (existingItem || !aMayReuseId) {
let downloadGuid = (aSource instanceof Ci.nsIDownload)
? aSource.guid
: aSource.getResultByName("guid");
if (downloadGuid in this.dataItems) {
let existingItem = this.dataItems[downloadGuid];
if (existingItem || !aMayReuseGUID) {
// Returns null if the download was removed and we can't reuse the item.
return existingItem;
}
}
let dataItem = new DownloadsDataItem(aSource);
this.dataItems[downloadId] = dataItem;
this.dataItems[downloadGuid] = dataItem;
// Create the view items before returning.
let addToStartOfList = aSource instanceof Ci.nsIDownload;
@ -612,10 +610,10 @@ const DownloadsData = {
// Order by descending download identifier so that the most recent
// downloads are notified first to the listening views.
let statement = Services.downloads.DBConnection.createAsyncStatement(
"SELECT id, target, name, source, referrer, state, "
"SELECT guid, target, name, source, referrer, state, "
+ "startTime, endTime, currBytes, maxBytes "
+ "FROM moz_downloads "
+ "ORDER BY id DESC"
+ "ORDER BY startTime DESC"
);
try {
this._pendingStatement = statement.executeAsync(this);
@ -691,10 +689,11 @@ const DownloadsData = {
observe: function DD_observe(aSubject, aTopic, aData)
{
switch (aTopic) {
case "download-manager-remove-download":
case "download-manager-remove-download-guid":
// If a single download was removed, remove the corresponding data item.
if (aSubject) {
this._removeDataItem(aSubject.QueryInterface(Ci.nsISupportsPRUint32));
this._removeDataItem(aSubject.QueryInterface(Ci.nsISupportsCString)
.data);
break;
}
@ -702,11 +701,15 @@ const DownloadsData = {
// and remove those that don't exist anymore.
for each (let dataItem in this.dataItems) {
if (dataItem) {
try {
Services.downloads.getDownload(dataItem.downloadId);
} catch (ex) {
this._removeDataItem(dataItem.downloadId);
}
// Bug 449811 - We have to bind to the dataItem because Javascript
// doesn't do fresh let-bindings per loop iteration.
let dataItemBinding = dataItem;
Services.downloads.getDownloadByGUID(dataItemBinding.downloadGuid,
function(aStatus, aResult) {
if (aStatus == Components.results.NS_ERROR_NOT_AVAILABLE) {
this._removeDataItem(dataItemBinding.downloadGuid);
}
}.bind(this));
}
}
break;
@ -758,15 +761,11 @@ const DownloadsData = {
// the database with the same ID as before. This means that the nsIDownload
// that the dataItem holds might now need updating.
//
// It's possible, however, that dataItem.download is still a lazy getter
// if we never read the download property after initializing the dataItem
// from a data row in the downloads database. In that case, we can leave
// it alone - the next time the download property is accessed, the right
// download object will be retrieved.
let downloadIsGetter = Object.getOwnPropertyDescriptor(dataItem, "download")
.value === undefined;
if (!downloadIsGetter) {
dataItem.download = aDownload;
// We only overwrite this in the event that _download exists, because if it
// doesn't, that means that no caller ever tried to get the nsIDownload,
// which means it was never retrieved and doesn't need to be overwritten.
if (dataItem._download) {
dataItem._download = aDownload;
}
this._views.forEach(
@ -884,10 +883,10 @@ DownloadsDataItem.prototype = {
*/
_initFromDownload: function DDI_initFromDownload(aDownload)
{
this.download = aDownload;
this._download = aDownload;
// Fetch all the download properties eagerly.
this.downloadId = aDownload.id;
this.downloadGuid = aDownload.guid;
this.file = aDownload.target.spec;
this.target = aDownload.displayName;
this.uri = aDownload.source.spec;
@ -917,7 +916,8 @@ DownloadsDataItem.prototype = {
_initFromDataRow: function DDI_initFromDataRow(aStorageRow)
{
// Get the download properties from the data row.
this.downloadId = aStorageRow.getResultByName("id");
this._download = null;
this.downloadGuid = aStorageRow.getResultByName("guid");
this.file = aStorageRow.getResultByName("target");
this.target = aStorageRow.getResultByName("name");
this.uri = aStorageRow.getResultByName("source");
@ -928,10 +928,6 @@ DownloadsDataItem.prototype = {
this.currBytes = aStorageRow.getResultByName("currBytes");
this.maxBytes = aStorageRow.getResultByName("maxBytes");
// Allows accessing the underlying download object lazily.
XPCOMUtils.defineLazyGetter(this, "download", function ()
Services.downloads.getDownload(this.downloadId));
// Now we have to determine if the download is resumable, but don't want to
// access the underlying download object unnecessarily. The only case where
// the property is relevant is when we are currently downloading data, and
@ -939,10 +935,15 @@ DownloadsDataItem.prototype = {
// loaded very soon in any case. In all the other cases, including a paused
// download, we assume that the download is resumable. The property will be
// updated as soon as the underlying download state changes.
// We'll start by assuming we're resumable, and then if we're downloading,
// update resumable property in case we were wrong.
this.resumable = true;
if (this.state == nsIDM.DOWNLOAD_DOWNLOADING) {
this.resumable = this.download.resumable;
} else {
this.resumable = true;
this.getDownload(function(aDownload) {
this.resumable = aDownload.resumable;
}.bind(this));
}
// Compute the other properties without accessing the download object.
@ -952,6 +953,35 @@ DownloadsDataItem.prototype = {
: Math.round(this.currBytes / this.maxBytes * 100);
},
/**
* Asynchronous getter for the download object corresponding to this data item.
*
* @param aCallback
* A callback function which will be called when the download object is
* available. It should accept one argument which will be the download
* object.
*/
getDownload: function DDI_getDownload(aCallback) {
if (this._download) {
// Return the download object asynchronously to the caller
let download = this._download;
Services.tm.mainThread.dispatch(function () aCallback(download),
Ci.nsIThread.DISPATCH_NORMAL);
} else {
Services.downloads.getDownloadByGUID(this.downloadGuid,
function(aStatus, aResult) {
if (!Components.isSuccessCode(aStatus)) {
Cu.reportError(
new Components.Exception("Cannot retrieve download for GUID: " +
this.downloadGuid));
} else {
this._download = aResult;
aCallback(aResult);
}
}.bind(this));
}
},
/**
* Indicates whether the download is proceeding normally, and not finished
* yet. This includes paused downloads. When this property is true, the
@ -1452,19 +1482,16 @@ const DownloadsIndicatorData = {
_lastTimeLeft: -1,
/**
* A generator function for the downloads that this summary is currently
* A generator function for the dataItems that this summary is currently
* interested in. This generator is passed off to summarizeDownloads in order
* to generate statistics about the downloads we care about - in this case,
* it's all active downloads.
* to generate statistics about the dataItems we care about - in this case,
* it's all dataItems for active downloads.
*/
_activeDownloads: function DID_activeDownloads()
_activeDataItems: function DID_activeDataItems()
{
// If no download has been loaded, don't use the methods of the Download
// Manager service, so that it is not initialized unnecessarily.
if (this._itemCount > 0) {
let downloads = Services.downloads.activeDownloads;
while (downloads.hasMoreElements()) {
yield downloads.getNext().QueryInterface(Ci.nsIDownload);
for each (let dataItem in DownloadsCommon.data.dataItems) {
if (dataItem && dataItem.inProgress) {
yield dataItem;
}
}
},
@ -1475,7 +1502,7 @@ const DownloadsIndicatorData = {
_refreshProperties: function DID_refreshProperties()
{
let summary =
DownloadsCommon.summarizeDownloads(this._activeDownloads());
DownloadsCommon.summarizeDownloads(this._activeDataItems());
// Determine if the indicator should be shown or get attention.
this._hasDownloads = (this._itemCount > 0);
@ -1563,7 +1590,7 @@ DownloadsSummaryData.prototype = {
DownloadsViewPrototype.removeView.call(this, aView);
if (this._views.length == 0) {
// Clear out our collection of DownloadsDataItems. If we ever have
// Clear out our collection of DownloadDataItems. If we ever have
// another view registered with us, this will get re-populated.
this._dataItems = [];
}
@ -1656,17 +1683,17 @@ DownloadsSummaryData.prototype = {
//// Property updating based on current download status
/**
* A generator function for the downloads that this summary is currently
* A generator function for the dataItems that this summary is currently
* interested in. This generator is passed off to summarizeDownloads in order
* to generate statistics about the downloads we care about - in this case,
* it's the downloads in this._dataItems after the first few to exclude,
* to generate statistics about the dataItems we care about - in this case,
* it's the dataItems in this._dataItems after the first few to exclude,
* which was set when constructing this DownloadsSummaryData instance.
*/
_downloadsForSummary: function DSD_downloadsForSummary()
_dataItemsForSummary: function DSD_dataItemsForSummary()
{
if (this._dataItems.length > 0) {
for (let i = this._numToExclude; i < this._dataItems.length; ++i) {
yield this._dataItems[i].download;
yield this._dataItems[i];
}
}
},
@ -1678,7 +1705,7 @@ DownloadsSummaryData.prototype = {
{
// Pre-load summary with default values.
let summary =
DownloadsCommon.summarizeDownloads(this._downloadsForSummary());
DownloadsCommon.summarizeDownloads(this._dataItemsForSummary());
this._description = DownloadsCommon.strings
.otherDownloads(summary.numActive);

View File

@ -172,7 +172,7 @@ function gen_addDownloadRows(aDataRows)
.join(", ");
let statement = Services.downloads.DBConnection.createAsyncStatement(
"INSERT INTO moz_downloads (" + columnNames +
") VALUES(" + parameterNames + ")");
", guid) VALUES(" + parameterNames + ", GENERATE_GUID())");
try {
// Execute the statement for each of the provided downloads in reverse.
for (let i = aDataRows.length - 1; i >= 0; i--) {
@ -193,7 +193,7 @@ function gen_addDownloadRows(aDataRows)
handleResult: function(aResultSet) { },
handleError: function(aError)
{
Cu.reportError(aError);
Cu.reportError(aError.message + " (Result = " + aError.result + ")");
},
handleCompletion: function(aReason)
{
@ -202,8 +202,10 @@ function gen_addDownloadRows(aDataRows)
});
yield;
// At each iteration, ensure that the end time in the global template is
// distinct, as this column is used to sort each download in its category.
// At each iteration, ensure that the start and end time in the global
// template is distinct, as these column are used to sort each download
// in its category.
gDownloadRowTemplate.startTime++;
gDownloadRowTemplate.endTime++;
}
} finally {

View File

@ -445,14 +445,14 @@ BrowserGlue.prototype = {
// them to the user.
let changedIDs = AddonManager.getStartupChanges(AddonManager.STARTUP_CHANGE_INSTALLED);
if (changedIDs.length > 0) {
let browser = this.getMostRecentBrowserWindow().gBrowser;
let win = this.getMostRecentBrowserWindow();
AddonManager.getAddonsByIDs(changedIDs, function(aAddons) {
aAddons.forEach(function(aAddon) {
// If the add-on isn't user disabled or can't be enabled then skip it.
if (!aAddon.userDisabled || !(aAddon.permissions & AddonManager.PERM_CAN_ENABLE))
return;
browser.selectedTab = browser.addTab("about:newaddon?id=" + aAddon.id);
win.openUILinkIn("about:newaddon?id=" + aAddon.id, "tab");
})
});
}
@ -717,8 +717,7 @@ BrowserGlue.prototype = {
_showRightsNotification: function BG__showRightsNotification() {
// 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 notifyBox = win.gBrowser.getNotificationBox();
var brandBundle = Services.strings.createBundle("chrome://branding/locale/brand.properties");
var rightsBundle = Services.strings.createBundle("chrome://global/locale/aboutRights.properties");
@ -734,7 +733,7 @@ BrowserGlue.prototype = {
accessKey: buttonAccessKey,
popup: null,
callback: function(aNotificationBar, aButton) {
browser.selectedTab = browser.addTab("about:rights");
win.openUILinkIn("about:rights", "tab");
}
}
];
@ -799,8 +798,7 @@ BrowserGlue.prototype = {
stringName: "pu.notifyButton.accesskey"});
let win = this.getMostRecentBrowserWindow();
let browser = win.gBrowser; // for closure in notification bar callback
let notifyBox = browser.getNotificationBox();
let notifyBox = win.gBrowser.getNotificationBox();
let buttons = [
{
@ -808,7 +806,7 @@ BrowserGlue.prototype = {
accessKey: key,
popup: null,
callback: function(aNotificationBar, aButton) {
browser.selectedTab = browser.addTab(url);
win.openUILinkIn(url, "tab");
}
}
];
@ -847,8 +845,7 @@ BrowserGlue.prototype = {
if (topic != "alertclickcallback")
return;
let win = self.getMostRecentBrowserWindow();
let browser = win.gBrowser;
browser.selectedTab = browser.addTab(data);
win.openUILinkIn(data, "tab");
}
try {
@ -926,7 +923,7 @@ BrowserGlue.prototype = {
// 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);
win.openUILinkIn(url, "tab");
// Remove the notification on which the user clicked
notification.parentNode.removeNotification(notification, true);
}, false);
@ -973,7 +970,7 @@ BrowserGlue.prototype = {
let link = appendLearnMoreLink(notification);
link.addEventListener('click', function() {
// Open the learn more url in a new tab
tabbrowser.selectedTab = tabbrowser.addTab(Services.prefs.getCharPref(PREF_TELEMETRY_INFOURL));
win.openUILinkIn(Services.prefs.getCharPref(PREF_TELEMETRY_INFOURL), "tab");
// 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
@ -991,8 +988,7 @@ BrowserGlue.prototype = {
var updateUrl = formatter.formatURLPref(PREF_PLUGINS_UPDATEURL);
var win = this.getMostRecentBrowserWindow();
var browser = win.gBrowser;
browser.selectedTab = browser.addTab(updateUrl);
win.openUILinkIn(updateUrl, "tab");
},
/**
@ -1223,7 +1219,7 @@ BrowserGlue.prototype = {
formatURLPref("app.support.baseURL");
url += helpTopic;
var browser = this.getMostRecentBrowserWindow().gBrowser;
var win = this.getMostRecentBrowserWindow();
var buttons = [
{
@ -1231,12 +1227,12 @@ BrowserGlue.prototype = {
accessKey: accessKey,
popup: null,
callback: function(aNotificationBar, aButton) {
browser.selectedTab = browser.addTab(url);
win.openUILinkIn(url, "tab");
}
}
];
var notifyBox = browser.getNotificationBox();
var notifyBox = win.gBrowser.getNotificationBox();
var notification = notifyBox.appendNotification(text, title, null,
notifyBox.PRIORITY_CRITICAL_MEDIUM,
buttons);

View File

@ -628,7 +628,7 @@
<!--
This overrides the searchParam property in autocomplete.xml. We're
hijacking this property as a vehicle for delivering the privacy
information about the window into the guys of nsSearchSuggestions.
information about the window into the guts of nsSearchSuggestions.
Note that the setter is the same as the parent. We were not sure whether
we can override just the getter. If that proves to be the case, the setter

View File

@ -68,7 +68,6 @@ _BROWSER_FILES = \
browser_tabview_bug619937.js \
browser_tabview_bug622835.js \
browser_tabview_bug623768.js \
browser_tabview_bug624265.js \
browser_tabview_bug624692.js \
browser_tabview_bug624727.js \
browser_tabview_bug624847.js \
@ -167,6 +166,17 @@ _BROWSER_FILES = \
test_bug678374_icon16.png \
$(NULL)
ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING
_BROWSER_FILES += \
browser_tabview_bug624265_perwindowpb.js \
$(NULL)
else
_BROWSER_FILES += \
browser_tabview_bug624265.js \
$(NULL)
endif
# browser_tabview_bug597980.js is disabled for leaking, see bug 711907
libs:: $(_BROWSER_FILES)

View File

@ -0,0 +1,166 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
function test() {
let tests = [];
let getContentWindow = function (aWindow) {
return aWindow.TabView.getContentWindow();
}
let assertOneSingleGroupItem = function (aWindow) {
is(getContentWindow(aWindow).GroupItems.groupItems.length, 1, 'There is one single groupItem');
}
let assertNumberOfVisibleTabs = function (aWindow, numTabs) {
is(aWindow.gBrowser.visibleTabs.length, numTabs, 'There should be ' + numTabs + ' visible tabs');
}
let next = function (aWindow) {
while (aWindow.gBrowser.tabs.length-1)
aWindow.gBrowser.removeTab(aWindow.gBrowser.tabs[1]);
hideTabView(function() {
let callback = tests.shift();
if (!callback) {
executeSoon(function() {
assertOneSingleGroupItem(aWindow);
aWindow.close();
finish();
});
} else {
assertOneSingleGroupItem(aWindow);
callback(aWindow);
}
}, aWindow);
}
// [624265] testing undo close tab
let testUndoCloseTabs = function (aWindow) {
aWindow.gBrowser.loadOneTab('http://mochi.test:8888/', {inBackground: true});
aWindow.gBrowser.loadOneTab('http://mochi.test:8888/', {inBackground: true});
afterAllTabsLoaded(function () {
assertNumberOfVisibleTabs(aWindow, 3);
aWindow.gBrowser.removeTab(aWindow.gBrowser.tabs[1]);
aWindow.gBrowser.selectedTab = aWindow.gBrowser.tabs[1];
restoreTab(function () {
assertNumberOfVisibleTabs(aWindow, 3);
assertOneSingleGroupItem(aWindow);
next(aWindow);
}, 0, aWindow);
}, aWindow);
}
// [623792] duplicating tab via middle click on reload button
let testDuplicateTab = function (aWindow) {
aWindow.gBrowser.loadOneTab('http://mochi.test:8888/', {inBackground: true});
afterAllTabsLoaded(function () {
// Valid choices for 'where' are window|tabshifted|tab
aWindow.duplicateTabIn(aWindow.gBrowser.selectedTab, 'tab');
afterAllTabsLoaded(function () {
assertNumberOfVisibleTabs(aWindow, 3);
assertOneSingleGroupItem(aWindow);
next(aWindow);
}, aWindow);
}, aWindow);
}
// [623792] duplicating tabs via middle click on forward/back buttons
let testBackForwardDuplicateTab = function (aWindow) {
let tab = aWindow.gBrowser.loadOneTab('http://mochi.test:8888/#1', {inBackground: true});
aWindow.gBrowser.selectedTab = tab;
afterAllTabsLoaded(function () {
tab.linkedBrowser.loadURI('http://mochi.test:8888/#2');
afterAllTabsLoaded(function () {
ok(aWindow.gBrowser.canGoBack, 'browser can go back in history');
aWindow.BrowserBack({button: 1});
afterAllTabsLoaded(function () {
assertNumberOfVisibleTabs(aWindow, 3);
ok(aWindow.gBrowser.canGoForward, 'browser can go forward in history');
aWindow.BrowserForward({button: 1});
afterAllTabsLoaded(function () {
assertNumberOfVisibleTabs(aWindow, 4);
assertOneSingleGroupItem(aWindow);
next(aWindow);
}, aWindow);
}, aWindow);
}, aWindow);
}, aWindow);
}
// [624102] check state after return from private browsing
let testPrivateBrowsing = function (aWindow) {
aWindow.gBrowser.loadOneTab('http://mochi.test:8888/#1', {inBackground: true});
aWindow.gBrowser.loadOneTab('http://mochi.test:8888/#2', {inBackground: true});
let cw = getContentWindow(aWindow);
let box = new cw.Rect(20, 20, 250, 200);
let groupItem = new cw.GroupItem([], {bounds: box, immediately: true});
cw.UI.setActive(groupItem);
aWindow.gBrowser.selectedTab = aWindow.gBrowser.loadOneTab('http://mochi.test:8888/#3', {inBackground: true});
aWindow.gBrowser.loadOneTab('http://mochi.test:8888/#4', {inBackground: true});
afterAllTabsLoaded(function () {
assertNumberOfVisibleTabs(aWindow, 2);
enterAndLeavePrivateBrowsing(function () {
assertNumberOfVisibleTabs(aWindow, 2);
aWindow.gBrowser.selectedTab = aWindow.gBrowser.tabs[0];
closeGroupItem(cw.GroupItems.groupItems[1], function() {
next(aWindow);
});
});
}, aWindow);
}
function testOnWindow(aIsPrivate, aCallback) {
let win = OpenBrowserWindow({private: aIsPrivate});
win.addEventListener("load", function onLoad() {
win.removeEventListener("load", onLoad, false);
executeSoon(function() { aCallback(win) });
}, false);
}
function enterAndLeavePrivateBrowsing(callback) {
testOnWindow(true, function (aWindow) {
aWindow.close();
callback();
});
}
waitForExplicitFinish();
// Tests for #624265
tests.push(testUndoCloseTabs);
// Tests for #623792
tests.push(testDuplicateTab);
tests.push(testBackForwardDuplicateTab);
// Tests for #624102
tests.push(testPrivateBrowsing);
testOnWindow(false, function(aWindow) {
loadTabView(function() {
next(aWindow);
}, aWindow);
});
}
function loadTabView(callback, aWindow) {
showTabView(function () {
hideTabView(callback, aWindow);
}, aWindow);
}

View File

@ -13,7 +13,7 @@ include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
DIRS = \
highlighter \
inspector \
markupview \
webconsole \
commandline \
@ -26,6 +26,7 @@ DIRS = \
layoutview \
shared \
responsivedesign \
framework \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@ -12,6 +12,12 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "HUDService",
"resource:///modules/HUDService.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TargetFactory",
"resource:///modules/devtools/Target.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "gDevTools",
"resource:///modules/devtools/gDevTools.jsm");
/**
* 'break' command
*/
@ -30,12 +36,15 @@ gcli.addCommand({
description: gcli.lookup("breaklistDesc"),
returnType: "html",
exec: function(args, context) {
let win = HUDService.currentContext();
let dbg = win.DebuggerUI.getDebugger();
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
let dbg = gDevTools.getPanelForTarget("jsdebugger", target);
if (!dbg) {
return gcli.lookup("breakaddDebuggerStopped");
}
let breakpoints = dbg.breakpoints;
let breakpoints = dbg.getAllBreakpoints();
if (Object.keys(breakpoints).length === 0) {
return gcli.lookup("breaklistNone");
@ -76,11 +85,13 @@ gcli.addCommand({
type: {
name: "selection",
data: function() {
let win = HUDService.currentContext();
let dbg = win.DebuggerUI.getDebugger();
let gBrowser = HUDService.currentContext().gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
let dbg = gDevTools.getPanelForTarget("jsdebugger", target);
let files = [];
if (dbg) {
let sourcesView = dbg.contentWindow.DebuggerView.Sources;
let sourcesView = dbg.panelWin.DebuggerView.Sources;
for (let item in sourcesView) {
files.push(item.value);
}
@ -99,8 +110,11 @@ gcli.addCommand({
returnType: "html",
exec: function(args, context) {
args.type = "line";
let win = HUDService.currentContext();
let dbg = win.DebuggerUI.getDebugger();
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
let dbg = gDevTools.getPanelForTarget("jsdebugger", target);
if (!dbg) {
return gcli.lookup("breakaddDebuggerStopped");
}
@ -131,12 +145,14 @@ gcli.addCommand({
name: "number",
min: 0,
max: function() {
let win = HUDService.currentContext();
let dbg = win.DebuggerUI.getDebugger();
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
let dbg = gDevTools.getPanelForTarget("jsdebugger", target);
if (!dbg) {
return gcli.lookup("breakaddDebuggerStopped");
}
return Object.keys(dbg.breakpoints).length - 1;
return Object.keys(dbg.getAllBreakpoints()).length - 1;
},
},
description: gcli.lookup("breakdelBreakidDesc")
@ -144,14 +160,16 @@ gcli.addCommand({
],
returnType: "html",
exec: function(args, context) {
let win = HUDService.currentContext();
let dbg = win.DebuggerUI.getDebugger();
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
let dbg = gDevTools.getPanelForTarget("jsdebugger", target);
if (!dbg) {
return gcli.lookup("breakaddDebuggerStopped");
}
let breakpoints = dbg.breakpoints;
let id = Object.keys(dbg.breakpoints)[args.breakid];
let breakpoints = dbg.getAllBreakpoints();
let id = Object.keys(breakpoints)[args.breakid];
if (!id || !(id in breakpoints)) {
return gcli.lookup("breakNotFound");
}

View File

@ -9,8 +9,8 @@ this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "HUDService",
"resource:///modules/HUDService.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "gDevTools",
"resource:///modules/devtools/gDevTools.jsm");
XPCOMUtils.defineLazyGetter(this, "Debugger", function() {
let JsDebugger = {};
@ -22,6 +22,9 @@ XPCOMUtils.defineLazyGetter(this, "Debugger", function() {
return global.Debugger;
});
XPCOMUtils.defineLazyModuleGetter(this, "TargetFactory",
"resource:///modules/devtools/Target.jsm");
let debuggers = [];
/**
@ -50,8 +53,9 @@ gcli.addCommand({
debuggers.push(dbg);
let tab = context.environment.chromeDocument.defaultView.gBrowser.selectedTab;
HUDService.activateHUDForContext(tab);
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
gDevTools.openToolboxForTab(target, "webconsole");
return gcli.lookup("calllogStartReply");
},

View File

@ -10,8 +10,10 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "HUDService",
"resource:///modules/HUDService.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "gDevTools",
"resource:///modules/devtools/gDevTools.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TargetFactory",
"resource:///modules/devtools/Target.jsm");
XPCOMUtils.defineLazyGetter(this, "Debugger", function() {
let JsDebugger = {};
@ -108,8 +110,9 @@ gcli.addCommand({
": " + this.callDescription(frame));
}.bind(this);
let tab = context.environment.chromeDocument.defaultView.gBrowser.selectedTab;
HUDService.activateHUDForContext(tab);
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
gDevTools.openToolboxForTab(target, "webconsole");
return gcli.lookup("calllogChromeStartReply");
},

View File

@ -11,6 +11,10 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "HUDService",
"resource:///modules/HUDService.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "gDevTools",
"resource:///modules/devtools/gDevTools.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TargetFactory",
"resource:///modules/devtools/Target.jsm");
/**
* 'console' command
@ -44,8 +48,9 @@ gcli.addCommand({
name: "console close",
description: gcli.lookup("consolecloseDesc"),
exec: function Command_consoleClose(args, context) {
let tab = context.environment.chromeDocument.defaultView.gBrowser.selectedTab
HUDService.deactivateHUDForContext(tab);
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
gDevTools.closeToolbox(target);
}
});
@ -56,7 +61,8 @@ gcli.addCommand({
name: "console open",
description: gcli.lookup("consoleopenDesc"),
exec: function Command_consoleOpen(args, context) {
let tab = context.environment.chromeDocument.defaultView.gBrowser.selectedTab
HUDService.activateHUDForContext(tab);
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
gDevTools.openToolboxForTab(target, "webconsole");
}
});

View File

@ -9,6 +9,11 @@ this.EXPORTED_SYMBOLS = [ ];
Cu.import("resource:///modules/devtools/gcli.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "gDevTools",
"resource:///modules/devtools/gDevTools.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TargetFactory",
"resource:///modules/devtools/Target.jsm");
/**
* 'dbg' command
*/
@ -26,19 +31,9 @@ gcli.addCommand({
description: gcli.lookup("dbgOpen"),
params: [],
exec: function (args, context) {
let win = context.environment.chromeDocument.defaultView;
let tab = win.gBrowser.selectedTab;
let dbg = win.DebuggerUI.findDebugger();
if (dbg) {
if (dbg.ownerTab !== tab) {
win.DebuggerUI.toggleDebugger();
}
return;
}
win.DebuggerUI.toggleDebugger();
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
gDevTools.openToolboxForTab(target, "jsdebugger");
}
});
@ -50,12 +45,12 @@ gcli.addCommand({
description: gcli.lookup("dbgClose"),
params: [],
exec: function (args, context) {
let win = context.environment.chromeDocument.defaultView;
let tab = win.gBrowser.selectedTab;
let dbg = win.DebuggerUI.findDebugger();
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
let dbg = gDevTools.getPanelForTarget("jsdebugger", target);
if (dbg) {
dbg.close();
if (dbg /* FIXME: and debugger panel is currently active */) {
gDevTools.closeToolbox(target);
}
}
});
@ -68,11 +63,12 @@ gcli.addCommand({
description: gcli.lookup("dbgInterrupt"),
params: [],
exec: function(args, context) {
let win = context.environment.chromeDocument.defaultView;
let dbg = win.DebuggerUI.getDebugger();
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
let dbg = gDevTools.getPanelForTarget("jsdebugger", target);
if (dbg) {
let controller = dbg.contentWindow.DebuggerController;
let controller = dbg._controller;
let thread = controller.activeThread;
if (!thread.paused) {
thread.interrupt();
@ -89,11 +85,12 @@ gcli.addCommand({
description: gcli.lookup("dbgContinue"),
params: [],
exec: function(args, context) {
let win = context.environment.chromeDocument.defaultView;
let dbg = win.DebuggerUI.getDebugger();
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
let dbg = gDevTools.getPanelForTarget("jsdebugger", target);
if (dbg) {
let controller = dbg.contentWindow.DebuggerController;
let controller = dbg._controller;
let thread = controller.activeThread;
if (thread.paused) {
thread.resume();
@ -121,11 +118,12 @@ gcli.addCommand({
description: gcli.lookup("dbgStepOverDesc"),
params: [],
exec: function(args, context) {
let win = context.environment.chromeDocument.defaultView;
let dbg = win.DebuggerUI.getDebugger();
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
let dbg = gDevTools.getPanelForTarget("jsdebugger", target);
if (dbg) {
let controller = dbg.contentWindow.DebuggerController;
let controller = dbg._controller;
let thread = controller.activeThread;
if (thread.paused) {
thread.stepOver();
@ -142,11 +140,12 @@ gcli.addCommand({
description: gcli.lookup("dbgStepInDesc"),
params: [],
exec: function(args, context) {
let win = context.environment.chromeDocument.defaultView;
let dbg = win.DebuggerUI.getDebugger();
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
let dbg = gDevTools.getPanelForTarget("jsdebugger", target);
if (dbg) {
let controller = dbg.contentWindow.DebuggerController;
let controller = dbg._controller;
let thread = controller.activeThread;
if (thread.paused) {
thread.stepIn();
@ -163,11 +162,12 @@ gcli.addCommand({
description: gcli.lookup("dbgStepOutDesc"),
params: [],
exec: function(args, context) {
let win = context.environment.chromeDocument.defaultView;
let dbg = win.DebuggerUI.getDebugger();
let gBrowser = context.environment.chromeDocument.defaultView.gBrowser;
let target = TargetFactory.forTab(gBrowser.selectedTab);
let dbg = gDevTools.getPanelForTarget("jsdebugger", target);
if (dbg) {
let controller = dbg.contentWindow.DebuggerController;
let controller = dbg._controller;
let thread = controller.activeThread;
if (thread.paused) {
thread.stepOut();

View File

@ -24,3 +24,4 @@ Cu.import("resource:///modules/devtools/CmdResize.jsm");
Cu.import("resource:///modules/devtools/CmdRestart.jsm");
Cu.import("resource:///modules/devtools/CmdScreenshot.jsm");
Cu.import("resource:///modules/devtools/CmdTilt.jsm");
Cu.import("resource:///modules/devtools/CmdScratchpad.jsm");

View File

@ -1,3 +1,11 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
let tempScope = {};
Cu.import("resource:///modules/devtools/Target.jsm", tempScope);
let TargetFactory = tempScope.TargetFactory;
function test() {
const TEST_URI = "http://example.com/browser/browser/devtools/commandline/" +
"test/browser_dbg_cmd.html";
@ -7,54 +15,40 @@ function test() {
});
}
function testDbgCmd() {
DeveloperToolbarTest.exec({
typed: "dbg open",
blankOutput: true
});
function testCommands(dbg, cmd) {
// Wait for the initial resume...
dbg._controller.activeThread.addOneTimeListener("resumed", function () {
info("Starting tests.");
let pane = DebuggerUI.findDebugger();
ok(pane, "Debugger was opened.");
let frame = pane._frame;
let contentDoc = content.window.document;
let output = contentDoc.querySelector("input[type=text]");
let btnDoit = contentDoc.querySelector("input[type=button]");
frame.addEventListener("Debugger:Connected", function dbgConnected(aEvent) {
frame.removeEventListener("Debugger:Connected", dbgConnected, true);
// Wait for the initial resume...
aEvent.target.ownerDocument.defaultView.gClient
.addOneTimeListener("resumed", function() {
info("Starting tests.");
let contentDoc = content.window.document;
let output = contentDoc.querySelector("input[type=text]");
let btnDoit = contentDoc.querySelector("input[type=button]");
cmd("dbg interrupt", function() {
ok(true, "debugger is paused");
pane.contentWindow.gClient.addOneTimeListener("resumed", function() {
ok(true, "debugger continued");
pane.contentWindow.gClient.addOneTimeListener("paused", function() {
cmd("dbg interrupt", function() {
ok(true, "debugger is paused");
dbg._controller.activeThread.addOneTimeListener("resumed", function () {
ok(true, "debugger continued");
dbg._controller.activeThread.addOneTimeListener("paused", function() {
cmd("dbg step in", function() {
cmd("dbg step in", function() {
cmd("dbg step in", function() {
cmd("dbg step in", function() {
is(output.value, "step in", "debugger stepped in");
cmd("dbg step over", function() {
is(output.value, "step over", "debugger stepped over");
cmd("dbg step out", function() {
is(output.value, "step out", "debugger stepped out");
is(output.value, "step in", "debugger stepped in");
cmd("dbg step over", function() {
is(output.value, "step over", "debugger stepped over");
cmd("dbg step out", function() {
is(output.value, "step out", "debugger stepped out");
cmd("dbg continue", function() {
cmd("dbg continue", function() {
cmd("dbg continue", function() {
is(output.value, "dbg continue", "debugger continued");
DeveloperToolbarTest.exec({
typed: "dbg close",
blankOutput: true
});
let dbg = DebuggerUI.findDebugger();
ok(!dbg, "Debugger was closed.");
finish();
is(output.value, "dbg continue", "debugger continued");
DeveloperToolbarTest.exec({
typed: "dbg close",
blankOutput: true
});
let target = TargetFactory.forTab(gBrowser.selectedTab);
ok(!gDevTools.getToolboxForTarget(target),
"Debugger was closed.");
finish();
});
});
});
@ -62,21 +56,42 @@ function testDbgCmd() {
});
});
});
EventUtils.sendMouseEvent({type:"click"}, btnDoit);
});
DeveloperToolbarTest.exec({
typed: "dbg continue",
blankOutput: true
});
EventUtils.sendMouseEvent({type:"click"}, btnDoit);
});
DeveloperToolbarTest.exec({
typed: "dbg continue",
blankOutput: true
});
});
});
}
function testDbgCmd() {
DeveloperToolbarTest.exec({
typed: "dbg open",
blankOutput: true
});
let target = TargetFactory.forTab(gBrowser.selectedTab);
let toolbox = gDevTools.getToolboxForTarget(target);
toolbox.once("jsdebugger-ready", function dbgReady() {
let dbg = gDevTools.getPanelForTarget("jsdebugger", target);
ok(dbg, "DebuggerPanel exists");
function cmd(aTyped, aCallback) {
pane.contentWindow.gClient.addOneTimeListener("paused", aCallback);
dbg._controller.activeThread.addOneTimeListener("paused", aCallback);
DeveloperToolbarTest.exec({
typed: aTyped,
blankOutput: true
});
}
if (dbg._controller.activeThread) {
testCommands(dbg, cmd);
} else {
dbg.once("connected", testCommands.bind(null, dbg, cmd));
}
});
}

View File

@ -6,6 +6,10 @@
const TEST_URI = "http://example.com/browser/browser/devtools/commandline/" +
"test/browser_dbg_cmd_break.html";
let tempScope = {};
Cu.import("resource:///modules/devtools/Target.jsm", tempScope);
let TargetFactory = tempScope.TargetFactory;
function test() {
DeveloperToolbarTest.test(TEST_URI, [ testBreakCommands ]);
}
@ -35,86 +39,84 @@ function testBreakCommands() {
status: 'ERROR'
});
let pane = DebuggerUI.toggleDebugger();
let target = TargetFactory.forTab(gBrowser.selectedTab);
let toolbox = gDevTools.openToolboxForTab(target, "jsdebugger");
toolbox.once("jsdebugger-ready", function dbgReady() {
let dbg = gDevTools.getPanelForTarget("jsdebugger", target);
ok(dbg, "DebuggerPanel exists");
dbg.once("connected", function() {
// Wait for the initial resume...
dbg.panelWin.gClient.addOneTimeListener("resumed", function() {
dbg._view.Variables.lazyEmpty = false;
var dbgConnected = DeveloperToolbarTest.checkCalled(function() {
pane._frame.removeEventListener("Debugger:Connected", dbgConnected, true);
// Wait for the initial resume.
let client = pane.contentWindow.gClient;
var resumed = DeveloperToolbarTest.checkCalled(function() {
var framesAdded = DeveloperToolbarTest.checkCalled(function() {
helpers.setInput('break add line ' + TEST_URI + ' ' + content.wrappedJSObject.line0);
helpers.check({
hints: '',
status: 'VALID',
args: {
file: { value: TEST_URI },
line: { value: content.wrappedJSObject.line0 },
}
});
DeveloperToolbarTest.exec({
args: {
type: 'line',
file: TEST_URI,
line: content.wrappedJSObject.line0
},
completed: false
});
helpers.setInput('break list');
helpers.check({
input: 'break list',
hints: '',
markup: 'VVVVVVVVVV',
status: 'VALID'
});
DeveloperToolbarTest.exec();
var cleanup = DeveloperToolbarTest.checkCalled(function() {
helpers.setInput('break del 9');
var client = dbg.panelWin.gClient;
var framesAdded = DeveloperToolbarTest.checkCalled(function() {
helpers.setInput('break add line ' + TEST_URI + ' ' + content.wrappedJSObject.line0);
helpers.check({
input: 'break del 9',
hints: '',
markup: 'VVVVVVVVVVE',
status: 'ERROR',
args: {
breakid: { status: 'ERROR', message: '9 is greater than maximum allowed: 0.' },
}
});
helpers.setInput('break del 0');
helpers.check({
input: 'break del 0',
hints: '',
markup: 'VVVVVVVVVVV',
hints: '',
status: 'VALID',
args: {
breakid: { value: 0 },
file: { value: TEST_URI },
line: { value: content.wrappedJSObject.line0 },
}
});
DeveloperToolbarTest.exec({
args: { breakid: 0 },
args: {
type: 'line',
file: TEST_URI,
line: content.wrappedJSObject.line0
},
completed: false
});
helpers.setInput('break list');
helpers.check({
input: 'break list',
hints: '',
markup: 'VVVVVVVVVV',
status: 'VALID'
});
DeveloperToolbarTest.exec();
var cleanup = DeveloperToolbarTest.checkCalled(function() {
helpers.setInput('break del 9');
helpers.check({
input: 'break del 9',
hints: '',
markup: 'VVVVVVVVVVE',
status: 'ERROR',
args: {
breakid: { status: 'ERROR', message: '9 is greater than maximum allowed: 0.' },
}
});
helpers.setInput('break del 0');
helpers.check({
input: 'break del 0',
hints: '',
markup: 'VVVVVVVVVVV',
status: 'VALID',
args: {
breakid: { value: 0 },
}
});
DeveloperToolbarTest.exec({
args: { breakid: 0 },
completed: false
});
});
client.activeThread.resume(cleanup);
});
client.activeThread.resume(cleanup);
client.activeThread.addOneTimeListener("framesadded", framesAdded);
// Trigger newScript notifications using eval.
content.wrappedJSObject.firstCall();
});
client.activeThread.addOneTimeListener("framesadded", framesAdded);
// Trigger newScript notifications using eval.
content.wrappedJSObject.firstCall();
});
client.addOneTimeListener("resumed", resumed);
});
pane._frame.addEventListener("Debugger:Connected", dbgConnected, true);
}

View File

@ -0,0 +1,89 @@
/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const Cu = Components.utils;
this.EXPORTED_SYMBOLS = ["DebuggerPanel"];
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource:///modules/devtools/EventEmitter.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "DebuggerServer",
"resource://gre/modules/devtools/dbg-server.jsm");
function DebuggerPanel(iframeWindow, toolbox) {
this._toolbox = toolbox;
this._controller = iframeWindow.DebuggerController;
this._view = iframeWindow.DebuggerView;
this._controller._target = this.target;
this._bkp = this._controller.Breakpoints;
this.panelWin = iframeWindow;
this._ensureOnlyOneRunningDebugger();
if (!this.target.isRemote) {
if (!DebuggerServer.initialized) {
DebuggerServer.init();
DebuggerServer.addBrowserActors();
}
}
let onDebuggerLoaded = function () {
iframeWindow.removeEventListener("Debugger:Loaded", onDebuggerLoaded, true);
this.setReady();
}.bind(this);
let onDebuggerConnected = function () {
iframeWindow.removeEventListener("Debugger:Connected",
onDebuggerConnected, true);
this.emit("connected");
}.bind(this);
iframeWindow.addEventListener("Debugger:Loaded", onDebuggerLoaded, true);
iframeWindow.addEventListener("Debugger:Connected",
onDebuggerConnected, true);
new EventEmitter(this);
}
DebuggerPanel.prototype = {
// DevToolPanel API
get target() this._toolbox.target,
get isReady() this._isReady,
setReady: function() {
this._isReady = true;
this.emit("ready");
},
destroy: function() {
},
// DebuggerPanel API
addBreakpoint: function() {
this._bkp.addBreakpoint.apply(this._bkp, arguments);
},
removeBreakpoint: function() {
this._bkp.removeBreakpoint.apply(this._bkp, arguments);
},
getBreakpoint: function() {
return this._bkp.getBreakpoint.apply(this._bkp, arguments);
},
getAllBreakpoints: function() {
return this._bkp.store;
},
// Private
_ensureOnlyOneRunningDebugger: function() {
// FIXME
},
};

View File

@ -48,6 +48,7 @@ let DebuggerController = {
return;
}
this._isInitialized = true;
window.removeEventListener("load", this._startupDebugger, true);
DebuggerView.initialize(function() {
@ -145,14 +146,34 @@ let DebuggerController = {
* wiring event handlers as necessary.
*/
_connect: function DC__connect() {
if (window._isRemoteDebugger && !this._prepareConnection()) {
function callback() {
window.dispatchEvent("Debugger:Connected");
}
let client;
// Remote debugging gets the debuggee from a RemoteTarget object.
if (this._target && this._target.isRemote) {
client = this.client = this._target.client;
this._target.on("close", this._onTabDetached);
this._target.on("navigate", this._onTabNavigated);
if (this._target.chrome) {
let dbg = this._target.form.chromeDebugger;
this._startChromeDebugging(client, dbg, callback);
} else {
this._startDebuggingTab(client, this._target.form, callback);
}
return;
}
let transport = (window._isChromeDebugger || window._isRemoteDebugger)
// Content debugging can connect directly to the page.
// TODO: convert this to use a TabTarget.
let transport = window._isChromeDebugger
? debuggerSocketConnect(Prefs.remoteHost, Prefs.remotePort)
: DebuggerServer.connectPipe();
client = this.client = new DebuggerClient(transport);
let client = this.client = new DebuggerClient(transport);
client.addListener("tabNavigated", this._onTabNavigated);
client.addListener("tabDetached", this._onTabDetached);
@ -160,12 +181,11 @@ let DebuggerController = {
client.listTabs(function(aResponse) {
if (window._isChromeDebugger) {
let dbg = aResponse.chromeDebugger;
this._startChromeDebugging(client, dbg);
this._startChromeDebugging(client, dbg, callback);
} else {
let tab = aResponse.tabs[aResponse.selected];
this._startDebuggingTab(client, tab);
this._startDebuggingTab(client, tab, callback);
}
window.dispatchEvent("Debugger:Connected");
}.bind(this));
}.bind(this));
},
@ -180,9 +200,12 @@ let DebuggerController = {
}
this.client.removeListener("tabNavigated", this._onTabNavigated);
this.client.removeListener("tabDetached", this._onTabDetached);
this.client.close();
this.client = null;
if (!this._target.isRemote) {
this.client.close();
this.client = null;
}
this.tabClient = null;
this.activeThread = null;
},
@ -212,7 +235,8 @@ let DebuggerController = {
* @param object aTabGrip
* The remote protocol grip of the tab.
*/
_startDebuggingTab: function DC__startDebuggingTab(aClient, aTabGrip) {
_startDebuggingTab: function DC__startDebuggingTab
(aClient, aTabGrip, aCallback=function(){}) {
if (!aClient) {
Cu.reportError("No client found!");
return;
@ -238,6 +262,7 @@ let DebuggerController = {
this.SourceScripts.connect();
aThreadClient.resume();
aCallback();
}.bind(this));
}.bind(this));
},
@ -250,7 +275,8 @@ let DebuggerController = {
* @param object aChromeDebugger
* The remote protocol grip of the chrome debugger.
*/
_startChromeDebugging: function DC__startChromeDebugging(aClient, aChromeDebugger) {
_startChromeDebugging: function DC__startChromeDebugging
(aClient, aChromeDebugger, aCallback=function(){}) {
if (!aClient) {
Cu.reportError("No client found!");
return;
@ -269,6 +295,7 @@ let DebuggerController = {
this.SourceScripts.connect();
aThreadClient.resume();
aCallback();
}.bind(this));
},

View File

@ -25,7 +25,6 @@ ToolbarView.prototype = {
*/
initialize: function DVT_initialize() {
dumpn("Initializing the ToolbarView");
this._closeButton = document.getElementById("close");
this._togglePanesButton = document.getElementById("toggle-panes");
this._resumeButton = document.getElementById("resume");
this._stepOverButton = document.getElementById("step-over");
@ -44,7 +43,6 @@ ToolbarView.prototype = {
this._stepInTooltip = L10N.getFormatStr("stepInTooltip", [stepInKey]);
this._stepOutTooltip = L10N.getFormatStr("stepOutTooltip", [stepOutKey]);
this._closeButton.addEventListener("click", this._onCloseClick, false);
this._togglePanesButton.addEventListener("mousedown", this._onTogglePanesPressed, false);
this._resumeButton.addEventListener("mousedown", this._onResumePressed, false);
this._stepOverButton.addEventListener("mousedown", this._onStepOverPressed, false);
@ -55,7 +53,6 @@ ToolbarView.prototype = {
this._stepInButton.setAttribute("tooltiptext", this._stepInTooltip);
this._stepOutButton.setAttribute("tooltiptext", this._stepOutTooltip);
this.toggleCloseButton(!window._isRemoteDebugger && !window._isChromeDebugger);
// TODO: bug 806775
// this.toggleChromeGlobalsContainer(window._isChromeDebugger);
},
@ -65,7 +62,6 @@ ToolbarView.prototype = {
*/
destroy: function DVT_destroy() {
dumpn("Destroying the ToolbarView");
this._closeButton.removeEventListener("click", this._onCloseClick, false);
this._togglePanesButton.removeEventListener("mousedown", this._onTogglePanesPressed, false);
this._resumeButton.removeEventListener("mousedown", this._onResumePressed, false);
this._stepOverButton.removeEventListener("mousedown", this._onStepOverPressed, false);
@ -73,16 +69,6 @@ ToolbarView.prototype = {
this._stepOutButton.removeEventListener("mousedown", this._onStepOutPressed, false);
},
/**
* Sets the close button hidden or visible. It's hidden by default.
*
* @param boolean aVisibleFlag
* Specifies the intended visibility.
*/
toggleCloseButton: function DVT_toggleCloseButton(aVisibleFlag) {
this._closeButton.setAttribute("hidden", !aVisibleFlag);
},
/**
* Sets the resume button state based on the debugger active thread.
*
@ -177,7 +163,6 @@ ToolbarView.prototype = {
}
},
_closeButton: null,
_togglePanesButton: null,
_resumeButton: null,
_stepOverButton: null,

View File

@ -174,11 +174,6 @@
<vbox id="body" flex="1">
<toolbar id="dbg-toolbar" class="devtools-toolbar">
#ifdef XP_MACOSX
<toolbarbutton id="close"
class="devtools-closebutton"
tooltiptext="&debuggerUI.closeButton.tooltip;"/>
#endif
<hbox id="debugger-controls">
<toolbarbutton id="resume"
class="devtools-toolbarbutton"
@ -208,11 +203,6 @@
class="devtools-option-toolbarbutton"
tooltiptext="&debuggerUI.optsButton.tooltip;"
popup="debuggerPrefsContextMenu"/>
#ifndef XP_MACOSX
<toolbarbutton id="close"
class="devtools-closebutton"
tooltiptext="&debuggerUI.closeButton.tooltip;"/>
#endif
</toolbar>
<panel id="searchbox-panel"

View File

@ -13,8 +13,8 @@ include $(DEPTH)/config/autoconf.mk
MOCHITEST_BROWSER_TESTS = \
browser_dbg_leaktest.js \
browser_dbg_createChrome.js \
browser_dbg_debugger-tab-switch.js \
browser_dbg_debugger-tab-switch-window.js \
$(browser_dbg_debugger-tab-switch.js disabled until issues 106, 40 are fixed) \
$(browser_dbg_debugger-tab-switch-window.js disabled until issues 106, 40 are fixed) \
browser_dbg_debuggerstatement.js \
browser_dbg_listtabs.js \
browser_dbg_tabactor-01.js \
@ -47,7 +47,6 @@ MOCHITEST_BROWSER_TESTS = \
browser_dbg_reload-same-script.js \
browser_dbg_reload-preferred-script.js \
browser_dbg_pane-collapse.js \
browser_dbg_panesize.js \
browser_dbg_panesize-inner.js \
browser_dbg_stack-01.js \
browser_dbg_stack-02.js \
@ -84,7 +83,6 @@ MOCHITEST_BROWSER_TESTS = \
browser_dbg_iframes.js \
browser_dbg_pause-exceptions.js \
browser_dbg_multiple-windows.js \
browser_dbg_menustatus.js \
browser_dbg_bfcache.js \
browser_dbg_breakpoint-new-script.js \
browser_dbg_bug737803_editor_actual_location.js \

View File

@ -20,7 +20,7 @@ function test()
gTab = aTab;
gDebuggee = aDebuggee;
gPane = aPane;
gDebugger = gPane.contentWindow;
gDebugger = gPane.panelWin;
testInitialLoad();
});

View File

@ -17,7 +17,7 @@ function test()
debug_tab_pane(TAB_URL, function(aTab, aDebuggee, aPane) {
gTab = aTab;
gPane = aPane;
gDebugger = gPane.contentWindow;
gDebugger = gPane.panelWin;
gDebuggee = aDebuggee;
testAddBreakpoint();

View File

@ -31,9 +31,11 @@ function test()
gTab = aTab;
gDebuggee = aDebuggee;
gPane = aPane;
gDebugger = gPane.contentWindow;
gDebugger = gPane.panelWin;
resumed = true;
gDebugger.addEventListener("Debugger:SourceShown", onScriptShown);
gDebugger.DebuggerController.activeThread.addOneTimeListener("framesadded", function() {
framesAdded = true;
executeSoon(startTest);
@ -50,12 +52,10 @@ function test()
executeSoon(startTest);
}
window.addEventListener("Debugger:SourceShown", onScriptShown);
function startTest()
{
if (scriptShown && framesAdded && resumed && !testStarted) {
window.removeEventListener("Debugger:SourceShown", onScriptShown);
gDebugger.removeEventListener("Debugger:SourceShown", onScriptShown);
testStarted = true;
Services.tm.currentThread.dispatch({ run: performTest }, 0);
}
@ -77,7 +77,7 @@ function test()
isnot(gScripts.selectedValue, gScripts.values[0],
"the correct script is selected");
gBreakpoints = gPane.breakpoints;
gBreakpoints = gPane.getAllBreakpoints();
is(Object.keys(gBreakpoints), 0, "no breakpoints");
ok(!gPane.getBreakpoint("foo", 3), "getBreakpoint('foo', 3) returns falsey");
@ -127,7 +127,7 @@ function test()
is(Object.keys(gBreakpoints).length, 1,
"the list of debugger breakpoints holds only one breakpoint");
is(gPane.getBreakpoint(gScripts.selectedValue, 6), aBreakpointClient,
"getBreakpoint(selectedScript, 2) returns the correct breakpoint");
"getBreakpoint returns the correct breakpoint");
info("remove the first breakpoint");
gEditor.addEventListener(SourceEditor.EVENTS.BREAKPOINT_CHANGE,

View File

@ -29,9 +29,11 @@ function test()
gTab = aTab;
gDebuggee = aDebuggee;
gPane = aPane;
gDebugger = gPane.contentWindow;
gDebugger = gPane.panelWin;
resumed = true;
gDebugger.addEventListener("Debugger:SourceShown", onScriptShown);
gDebugger.DebuggerController.activeThread.addOneTimeListener("framesadded", function() {
framesAdded = true;
executeSoon(startTest);
@ -48,12 +50,10 @@ function test()
executeSoon(startTest);
}
window.addEventListener("Debugger:SourceShown", onScriptShown);
function startTest()
{
if (scriptShown && framesAdded && resumed && !testStarted) {
window.removeEventListener("Debugger:SourceShown", onScriptShown);
gDebugger.removeEventListener("Debugger:SourceShown", onScriptShown);
testStarted = true;
Services.tm.currentThread.dispatch({ run: performTest }, 0);
}
@ -79,7 +79,7 @@ function test()
isnot(gScripts.selectedValue, gScripts.values[0],
"the correct script is selected");
gBreakpoints = gPane.breakpoints;
gBreakpoints = gPane.getAllBreakpoints();
is(Object.keys(gBreakpoints), 0, "no breakpoints");
ok(!gPane.getBreakpoint("chocolate", 3), "getBreakpoint('chocolate', 3) returns falsey");

View File

@ -19,7 +19,7 @@ function test()
gTab = aTab;
gDebuggee = aDebuggee;
gPane = aPane;
gDebugger = gPane.contentWindow;
gDebugger = gPane.panelWin;
gWatch = gDebugger.DebuggerView.WatchExpressions;
gDebugger.DebuggerView.togglePanes({ visible: true, animated: false });

View File

@ -20,7 +20,7 @@ function test()
gTab = aTab;
gDebuggee = aDebuggee;
gPane = aPane;
gDebugger = gPane.contentWindow;
gDebugger = gPane.panelWin;
gWatch = gDebugger.DebuggerView.WatchExpressions;
gVars = gDebugger.DebuggerView.Variables;

View File

@ -28,7 +28,7 @@ function test()
gTab = aTab;
gDebuggee = aDebuggee;
gPane = aPane;
gDebugger = gPane.contentWindow;
gDebugger = gPane.panelWin;
resumed = true;
gDebugger.DebuggerController.activeThread.addOneTimeListener("framesadded", function() {

View File

@ -30,9 +30,11 @@ function test() {
gTab = aTab;
gPane = aPane;
gDebuggee = aDebuggee;
gDebugger = gPane.contentWindow;
gDebugger = gPane.panelWin;
resumed = true;
gDebugger.addEventListener("Debugger:SourceShown", onScriptShown);
gDebugger.DebuggerController.activeThread.addOneTimeListener("framesadded", function () {
framesAdded = true;
executeSoon(startTest);
@ -48,11 +50,9 @@ function test() {
executeSoon(startTest);
}
window.addEventListener("Debugger:SourceShown", onScriptShown);
function startTest() {
if (scriptShown && framesAdded && resumed && !testStarted) {
window.removeEventListener("Debugger:SourceShown", onScriptShown);
gDebugger.removeEventListener("Debugger:SourceShown", onScriptShown);
testStarted = true;
Services.tm.currentThread.dispatch({ run: performTest }, 0);
}
@ -61,7 +61,7 @@ function test() {
function performTest() {
gScripts = gDebugger.DebuggerView.Sources;
gEditor = gDebugger.editor;
gBreakpoints = gPane.breakpoints;
gBreakpoints = gPane.getAllBreakpoints();
is(Object.keys(gBreakpoints), 0, "There are no breakpoints");
gEditor.addEventListener(SourceEditor.EVENTS.BREAKPOINT_CHANGE,

View File

@ -29,7 +29,7 @@ function test()
gTab = aTab;
gDebuggee = aDebuggee;
gPane = aPane;
gDebugger = gPane.contentWindow;
gDebugger = gPane.panelWin;
gBreakpoints = gDebugger.DebuggerController.Breakpoints;
gBreakpointsPane = gDebugger.DebuggerView.Breakpoints;
@ -79,7 +79,7 @@ function test()
is(gScripts.selectedValue, gScripts.values[0],
"The correct script is selected");
gBreakpoints = gPane.breakpoints;
gBreakpoints = gPane.getAllBreakpoints();
is(Object.keys(gBreakpoints).length, 13, "thirteen breakpoints");
ok(!gPane.getBreakpoint("foo", 3), "getBreakpoint('foo', 3) returns falsey");

View File

@ -33,7 +33,7 @@ function test()
gTab = aTab;
gDebuggee = aDebuggee;
gPane = aPane;
gDebugger = gPane.contentWindow;
gDebugger = gPane.panelWin;
gBreakpoints = gDebugger.DebuggerController.Breakpoints;
gBreakpointsPane = gDebugger.DebuggerView.Breakpoints;
@ -83,7 +83,7 @@ function test()
is(gScripts.selectedValue, gScripts.values[0],
"The correct script is selected");
gBreakpoints = gPane.breakpoints;
gBreakpoints = gPane.getAllBreakpoints();
is(Object.keys(gBreakpoints), 0, "no breakpoints");
ok(!gPane.getBreakpoint("foo", 3), "getBreakpoint('foo', 3) returns falsey");

View File

@ -13,7 +13,7 @@ function test() {
gTab = aTab;
gDebuggee = aDebuggee;
gPane = aPane;
gDebugger = gPane.contentWindow;
gDebugger = gPane.panelWin;
testNonEnumProperties();
});

View File

@ -15,7 +15,7 @@ function test() {
debug_tab_pane(DEBUGGER_TAB_URL, function(aTab, aDebuggee, aPane) {
gTab = aTab;
gPane = aPane;
gDebugger = gPane.contentWindow;
gDebugger = gPane.panelWin;
testCleanExit();
});

View File

@ -18,7 +18,7 @@ function test() {
debug_remote(TEST_URL, function(aTab, aDebuggee, aWindow) {
gTab = aTab;
gWindow = aWindow;
let gDebugger = gWindow.contentWindow;
let gDebugger = gWindow.panelWin;
info("Current remote window x: " +
Services.prefs.getIntPref("devtools.debugger.ui.win-x"));

Some files were not shown because too many files have changed in this diff Show More