mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge cedar to mozilla-central
This commit is contained in:
commit
ec953fc5a6
1
.hgtags
1
.hgtags
@ -63,3 +63,4 @@ a71bd564ebf5bf4f93d13e84114f759c263130b0 MOBILE_MERGE_DONE
|
||||
a71bd564ebf5bf4f93d13e84114f759c263130b0 MOBILE_MERGE_DONE_20110406
|
||||
a95d426422816513477e5863add1b00ac7041dcb AURORA_BASE_20110412
|
||||
138f593553b66c9f815e8f57870c19d6347f7702 UPDATE_PACKAGING_R14
|
||||
9eae975b3d6fb7748fe5a3c0113d449b1c7cc0b2 AURORA_BASE_20110524
|
||||
|
@ -477,7 +477,8 @@ nsRoleMapEntry nsARIAMap::gWAIRoleMap[] =
|
||||
eNoValue,
|
||||
eSwitchAction,
|
||||
eNoLiveAttr,
|
||||
kNoReqStates
|
||||
kNoReqStates,
|
||||
eARIASelectable
|
||||
},
|
||||
{
|
||||
"tablist",
|
||||
|
@ -1533,15 +1533,20 @@ nsAccessible::State()
|
||||
return states::DEFUNCT;
|
||||
|
||||
PRUint64 state = NativeState();
|
||||
// Apply ARIA states to be sure accessible states will be overriden.
|
||||
// Apply ARIA states to be sure accessible states will be overridden.
|
||||
ApplyARIAState(&state);
|
||||
|
||||
if (mRoleMapEntry && mRoleMapEntry->role == nsIAccessibleRole::ROLE_PAGETAB) {
|
||||
if (mRoleMapEntry && mRoleMapEntry->role == nsIAccessibleRole::ROLE_PAGETAB &&
|
||||
!(state & states::SELECTED) &&
|
||||
!mContent->AttrValueIs(kNameSpaceID_None,
|
||||
nsAccessibilityAtoms::aria_selected,
|
||||
nsAccessibilityAtoms::_false, eCaseMatters)) {
|
||||
// Special case: for tabs, focused implies selected, unless explicitly
|
||||
// false, i.e. aria-selected="false".
|
||||
if (state & states::FOCUSED) {
|
||||
state |= states::SELECTED;
|
||||
} else {
|
||||
// Expose 'selected' state on ARIA tab if the focus is on internal element
|
||||
// of related tabpanel.
|
||||
// If focus is in a child of the tab panel surely the tab is selected!
|
||||
nsCOMPtr<nsIAccessible> tabPanel = nsRelUtils::
|
||||
GetRelatedAccessible(this, nsIAccessibleRelation::RELATION_LABEL_FOR);
|
||||
|
||||
|
@ -1037,6 +1037,14 @@ nsDocAccessible::AttributeChangedImpl(nsIContent* aContent, PRInt32 aNameSpaceID
|
||||
return;
|
||||
}
|
||||
|
||||
if (aAttribute == nsAccessibilityAtoms::aria_busy) {
|
||||
PRBool isOn = !aContent->AttrValueIs(aNameSpaceID, aAttribute,
|
||||
nsAccessibilityAtoms::_true, eCaseMatters);
|
||||
nsRefPtr<AccEvent> event = new AccStateChangeEvent(aContent, states::BUSY, isOn);
|
||||
FireDelayedAccessibleEvent(event);
|
||||
return;
|
||||
}
|
||||
|
||||
if (aAttribute == nsAccessibilityAtoms::selected ||
|
||||
aAttribute == nsAccessibilityAtoms::aria_selected) {
|
||||
// ARIA or XUL selection
|
||||
|
@ -35,6 +35,9 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#define CreateEvent CreateEventA
|
||||
#include "nsIDOMDocument.h"
|
||||
|
||||
#include "States.h"
|
||||
#include "nsAccessibilityService.h"
|
||||
#include "nsApplicationAccessibleWrap.h"
|
||||
@ -48,7 +51,6 @@
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIDocShellTreeNode.h"
|
||||
#include "nsIDocShellTreeOwner.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
@ -76,11 +78,8 @@
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsRootAccessible.h"
|
||||
#include "nsIDOMNSEventTarget.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsFocusManager.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
#include "nsXULTreeAccessible.h"
|
||||
@ -415,11 +414,11 @@ nsRootAccessible::FireCurrentFocusEvent()
|
||||
return; // No current focus
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMDocumentEvent> docEvent = do_QueryInterface(mDocument);
|
||||
if (docEvent) {
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(mDocument);
|
||||
if (domDoc) {
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
if (NS_SUCCEEDED(docEvent->CreateEvent(NS_LITERAL_STRING("Events"),
|
||||
getter_AddRefs(event))) &&
|
||||
if (NS_SUCCEEDED(domDoc->CreateEvent(NS_LITERAL_STRING("Events"),
|
||||
getter_AddRefs(event))) &&
|
||||
NS_SUCCEEDED(event->InitEvent(NS_LITERAL_STRING("focus"), PR_TRUE, PR_TRUE))) {
|
||||
|
||||
nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(event));
|
||||
|
@ -26,35 +26,60 @@
|
||||
*/
|
||||
var gQueue = null;
|
||||
|
||||
// Debug stuff.
|
||||
//gA11yEventDumpID = "eventdump";
|
||||
// gA11yEventDumpToConsole = true;
|
||||
|
||||
function expandNode(aNodeOrID, bExpand)
|
||||
{
|
||||
this.DOMNode = getNode(aNodeOrID);
|
||||
|
||||
this.invoke = function expand_invoke() {
|
||||
this.invoke = function expandNode_invoke() {
|
||||
// Note: this should fire an EVENT_STATE_CHANGE
|
||||
this.DOMNode.setAttribute("aria-expanded", bExpand);
|
||||
};
|
||||
|
||||
this.check = function expand_check() {
|
||||
this.check = function expandNode_check() {
|
||||
testStates(aNodeOrID,
|
||||
bExpand ? STATE_EXPANDED : STATE_COLLAPSED,
|
||||
EXT_STATE_EXPANDABLE);
|
||||
};
|
||||
|
||||
this.getID = function changeValue_getID() {
|
||||
this.getID = function expandNode_getID() {
|
||||
return prettyName(aNodeOrID) + " aria-expanded changed";
|
||||
};
|
||||
}
|
||||
|
||||
function busyify(aNodeOrID, aBusy)
|
||||
{
|
||||
this.DOMNode = getNode(aNodeOrID);
|
||||
|
||||
this.invoke = function busyify_invoke() {
|
||||
this.DOMNode.setAttribute("aria-busy", aBusy);
|
||||
};
|
||||
|
||||
this.check = function busyify_check(event) {
|
||||
testStates(aNodeOrID,
|
||||
(aBusy ? STATE_BUSY : 0), 0,
|
||||
(aBusy ? 0 : STATE_BUSY), 0);
|
||||
};
|
||||
|
||||
this.getID = function busyify_getID() {
|
||||
return prettyName(aNodeOrID) + " aria-busy changed to " + aBusy;
|
||||
};
|
||||
}
|
||||
|
||||
function doTests()
|
||||
{
|
||||
gQueue = new eventQueue(nsIAccessibleEvent.EVENT_STATE_CHANGE);
|
||||
gQueue = new eventQueue(EVENT_STATE_CHANGE);
|
||||
|
||||
gQueue.push(new expandNode("section", true));
|
||||
gQueue.push(new expandNode("section", false));
|
||||
gQueue.push(new expandNode("div", true));
|
||||
gQueue.push(new expandNode("div", false));
|
||||
|
||||
gQueue.push(new busyify("aria_doc", true));
|
||||
gQueue.push(new busyify("aria_doc", false));
|
||||
gQueue.invoke(); // Will call SimpleTest.finish();
|
||||
}
|
||||
|
||||
@ -71,6 +96,11 @@
|
||||
Mozilla Bug 551684
|
||||
</a>
|
||||
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=648133"
|
||||
title="fire state change event for aria-busy"
|
||||
Mozilla Bug 648133
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
@ -81,5 +111,7 @@
|
||||
<div id="section" role="section" aria-expanded="false">expandable section</div>
|
||||
<div id="div" aria-expanded="false">expandable native div</div>
|
||||
|
||||
<!-- aria-busy -->
|
||||
<div id="aria_doc" role="document" tabindex="0">A document</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -48,6 +48,7 @@ include $(topsrcdir)/config/rules.mk
|
||||
_TEST_FILES =\
|
||||
test_aria.html \
|
||||
test_aria_imgmap.html \
|
||||
test_aria_tabs.html \
|
||||
test_doc.html \
|
||||
test_docarticle.html \
|
||||
test_editablebody.html \
|
||||
|
137
accessible/tests/mochitest/states/test_aria_tabs.html
Normal file
137
accessible/tests/mochitest/states/test_aria_tabs.html
Normal file
@ -0,0 +1,137 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>Test ARIA tab accessible selected state</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/MochiKit/packed.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<script type="application/javascript"
|
||||
src="../common.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../states.js"></script>
|
||||
<script type="application/javascript"
|
||||
src="../events.js"></script>
|
||||
|
||||
<script type="application/javascript">
|
||||
function focusARIATab(aID, aIsSelected)
|
||||
{
|
||||
this.DOMNode = getNode(aID);
|
||||
|
||||
this.invoke = function focusARIATab_invoke()
|
||||
{
|
||||
this.DOMNode.focus();
|
||||
}
|
||||
|
||||
this.check = function focusARIATab_check(aEvent)
|
||||
{
|
||||
testStates(this.DOMNode, aIsSelected ? STATE_SELECTED : 0, 0,
|
||||
aIsSelected ? 0 : STATE_SELECTED);
|
||||
}
|
||||
|
||||
this.getID = function focusARIATab_getID()
|
||||
{
|
||||
return "Focused ARIA Tab with aria-selected=" +
|
||||
(aIsSelected ? "true, should" : "false, shouldn't") +
|
||||
" have selected state on " + prettyName(aID);
|
||||
}
|
||||
}
|
||||
|
||||
function focusActiveDescendantTab(aTabID, aTabListID, aIsSelected)
|
||||
{
|
||||
this.DOMNode = getNode(aTabID);
|
||||
this.tabListDOMNode = getNode(aTabListID);
|
||||
|
||||
this.invoke = function focusActiveDescendantTab_invoke()
|
||||
{
|
||||
this.tabListDOMNode.setAttribute("aria-activedescendant", aTabID);
|
||||
this.tabListDOMNode.focus();
|
||||
}
|
||||
|
||||
this.check = function focusActiveDescendantTab_check(aEvent)
|
||||
{
|
||||
testStates(this.DOMNode, aIsSelected ? STATE_SELECTED : 0, 0,
|
||||
aIsSelected ? 0 : STATE_SELECTED);
|
||||
}
|
||||
|
||||
this.getID = function tabActiveDescendant_getID()
|
||||
{
|
||||
return "ARIA Tab with activedescendant " +
|
||||
(aIsSelected ? "should" : "shouldn't") +
|
||||
" have the selected state on " + prettyName(aTabID);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Test
|
||||
|
||||
//gA11yEventDumpID = "eventdump"; // debug stuff
|
||||
//gA11yEventDumpToConsole = true;
|
||||
|
||||
var gQueue = null;
|
||||
|
||||
function doTest()
|
||||
{
|
||||
// simple tabs
|
||||
testStates("aria_tab1", 0, 0, STATE_SELECTED);
|
||||
testStates("aria_tab2", STATE_SELECTED);
|
||||
|
||||
// To make sure our focus != selected is truly under test, we need to
|
||||
// make sure our cache of what currently has focus is correct, which
|
||||
// we update asyncronously.
|
||||
gQueue = new eventQueue(EVENT_FOCUS);
|
||||
|
||||
gQueue.push(new focusARIATab("aria_tab1", true));
|
||||
gQueue.push(new focusARIATab("aria_tab3", false));
|
||||
gQueue.push(new focusARIATab("aria_tab2", true));
|
||||
|
||||
// selection through aria-activedescendant
|
||||
// Make sure initially setting it selects the tab.
|
||||
gQueue.push(new focusActiveDescendantTab("aria_tab5", "aria_tablist2", true));
|
||||
|
||||
// Now, make sure if one is selected selection gets transferred properly.
|
||||
gQueue.push(new focusActiveDescendantTab("aria_tab6", "aria_tablist2", true));
|
||||
|
||||
// Now, make sure the focused but explicitly unselected one behaves.
|
||||
gQueue.push(new focusActiveDescendantTab("aria_tab4", "aria_tablist2", false));
|
||||
|
||||
gQueue.invoke(); // SimpleTest.finish() will be called in the end
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addA11yLoadEvent(doTest);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a target="_blank"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=653601"
|
||||
title="aria-selected ignored for ARIA tabs">
|
||||
Mozilla Bug 653601
|
||||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
|
||||
<!-- tab -->
|
||||
<div id="aria_tablist" role="tablist">
|
||||
<div id="aria_tab1" role="tab" tabindex="0">unselected tab</div>
|
||||
<div id="aria_tab2" role="tab" tabindex="0" aria-selected="true">selected tab</div>
|
||||
<div id="aria_tab3" role="tab" tabindex="0" aria-selected="false">focused explicitly unselected tab</div>
|
||||
</div>
|
||||
|
||||
<!-- test activeDescendant -->
|
||||
<div id="aria_tablist2" role="tablist" tabindex="0">
|
||||
<div id="aria_tab4" role="tab" aria-selected="false">focused explicitly unselected tab</div>
|
||||
<div id="aria_tab5" role="tab">initially selected tab</div>
|
||||
<div id="aria_tab6" role="tab">later selected tab</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -102,51 +102,20 @@ CPPSRCS = nsBrowserApp.cpp
|
||||
LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
|
||||
LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base
|
||||
|
||||
ifdef BUILD_STATIC_LIBS
|
||||
ifdef _MSC_VER
|
||||
STATIC_COMPONENTS_LINKER_PATH = -LIBPATH:$(DEPTH)/staticlib
|
||||
else
|
||||
STATIC_COMPONENTS_LINKER_PATH = -L$(DEPTH)/staticlib
|
||||
endif
|
||||
LIBS += $(DEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
|
||||
else
|
||||
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
||||
LIBS += $(DIST)/bin/XUL
|
||||
TK_LIBS := $(TK_LIBS)
|
||||
else
|
||||
EXTRA_DSO_LIBS += xul
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
||||
TK_LIBS := $(TK_LIBS)
|
||||
endif
|
||||
|
||||
ifdef MOZ_ENABLE_LIBXUL
|
||||
APP_XPCOM_LIBS = $(XPCOM_GLUE_LDOPTS)
|
||||
else
|
||||
MOZILLA_INTERNAL_API = 1
|
||||
APP_XPCOM_LIBS = $(XPCOM_LIBS)
|
||||
endif
|
||||
|
||||
LIBS += \
|
||||
$(STATIC_COMPONENTS_LINKER_PATH) \
|
||||
$(EXTRA_DSO_LIBS) \
|
||||
$(APP_XPCOM_LIBS) \
|
||||
$(XPCOM_GLUE_LDOPTS) \
|
||||
$(NSPR_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
ifdef BUILD_STATIC_LIBS
|
||||
LIBS += \
|
||||
$(MOZ_JS_LIBS) \
|
||||
$(TK_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
# Add explicit X11 dependency when building against X11 toolkits
|
||||
ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
|
||||
LIBS += $(XLDFLAGS) $(XLIBS) $(ZLIB_LIBS)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef MOZ_JPROF
|
||||
LIBS += -ljprof
|
||||
endif
|
||||
@ -171,18 +140,6 @@ ifdef _MSC_VER
|
||||
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
|
||||
endif
|
||||
|
||||
ifdef BUILD_STATIC_LIBS
|
||||
include $(topsrcdir)/config/static-config.mk
|
||||
|
||||
EXTRA_DEPS += \
|
||||
$(STATIC_EXTRA_DEPS) \
|
||||
$(NULL)
|
||||
DEFINES += $(STATIC_DEFINES)
|
||||
CPPSRCS += $(STATIC_CPPSRCS)
|
||||
EXTRA_DSO_LIBS += $(STATIC_EXTRA_DSO_LIBS)
|
||||
EXTRA_LIBS += $(STATIC_EXTRA_LIBS)
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool)
|
||||
OS_LIBS += $(call EXPAND_LIBNAME,usp10 msimg32)
|
||||
@ -195,9 +152,6 @@ RCFLAGS += -DMOZ_PHOENIX -I$(srcdir)
|
||||
else
|
||||
RCFLAGS += -DMOZ_PHOENIX --include-dir $(srcdir)
|
||||
endif
|
||||
ifdef BUILD_STATIC_LIBS
|
||||
RCFLAGS += -DMOZ_STATIC_BUILD
|
||||
endif
|
||||
ifdef DEBUG
|
||||
RCFLAGS += -DDEBUG
|
||||
endif
|
||||
@ -206,9 +160,6 @@ endif
|
||||
ifeq ($(OS_ARCH),OS2)
|
||||
RESFILE=splashos2.res
|
||||
RCFLAGS += -DMOZ_PHOENIX
|
||||
ifdef BUILD_STATIC_LIBS
|
||||
RCFLAGS += -DMOZ_STATIC_BUILD -i $(DIST)/include
|
||||
endif
|
||||
ifdef DEBUG
|
||||
RCFLAGS += -DDEBUG
|
||||
endif
|
||||
@ -217,12 +168,6 @@ endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
ifdef BUILD_STATIC_LIBS
|
||||
include $(topsrcdir)/config/static-rules.mk
|
||||
|
||||
DEFINES += -DIMPL_XREAPI
|
||||
endif
|
||||
|
||||
ifeq ($(MOZ_WIDGET_TOOLKIT),photon)
|
||||
LIBS += -lphexlib
|
||||
endif
|
||||
|
@ -91,6 +91,9 @@ function onBuiltinSurveyLoad() {
|
||||
explanation.innerHTML = "";
|
||||
}
|
||||
drawSurveyForm(task, contentDiv);
|
||||
// Allow surveys to define arbitrary page load handlers - call them
|
||||
// after creating the rest of the page:
|
||||
task.onPageLoad(task, document);
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,7 +117,7 @@ function drawSurveyForm(task, contentDiv) {
|
||||
for (let i = 0; i < surveyQuestions.length; i++) {
|
||||
let question = surveyQuestions[i].question;
|
||||
let explanation = surveyQuestions[i].explanation;
|
||||
let elem;
|
||||
let elem, j;
|
||||
|
||||
elem = document.createElement("h3");
|
||||
elem.innerHTML = (i+1) + ". " + question;
|
||||
@ -129,7 +132,7 @@ function drawSurveyForm(task, contentDiv) {
|
||||
let choices = surveyQuestions[i].choices;
|
||||
switch (surveyQuestions[i].type) {
|
||||
case MULTIPLE_CHOICE:
|
||||
for (let j = 0; j < choices.length; j++) {
|
||||
for (j = 0; j < choices.length; j++) {
|
||||
let newRadio = document.createElement("input");
|
||||
newRadio.setAttribute("type", "radio");
|
||||
newRadio.setAttribute("name", "answer_to_" + i);
|
||||
@ -148,7 +151,7 @@ function drawSurveyForm(task, contentDiv) {
|
||||
case CHECK_BOXES_WITH_FREE_ENTRY:
|
||||
let checkboxName = "answer_to_" + i;
|
||||
// Check boxes:
|
||||
for (let j = 0; j < choices.length; j++) {
|
||||
for (j = 0; j < choices.length; j++) {
|
||||
let newCheck = document.createElement("input");
|
||||
newCheck.setAttribute("type", "checkbox");
|
||||
newCheck.setAttribute("name", checkboxName);
|
||||
@ -188,7 +191,7 @@ function drawSurveyForm(task, contentDiv) {
|
||||
inputBox.addEventListener(
|
||||
"keypress", function() {
|
||||
let elements = document.getElementsByName(checkboxName);
|
||||
for (let j = (elements.length - 1); j >= 0; j--) {
|
||||
for (j = (elements.length - 1); j >= 0; j--) {
|
||||
if (elements[j].value == freeformId) {
|
||||
elements[j].checked = true;
|
||||
break;
|
||||
@ -213,7 +216,7 @@ function drawSurveyForm(task, contentDiv) {
|
||||
let label = document.createElement("span");
|
||||
label.innerHTML = surveyQuestions[i].min_label;
|
||||
contentDiv.appendChild(label);
|
||||
for (let j = surveyQuestions[i].scale_minimum;
|
||||
for (j = surveyQuestions[i].scale_minimum;
|
||||
j <= surveyQuestions[i].scale_maximum;
|
||||
j++) {
|
||||
let newRadio = document.createElement("input");
|
||||
@ -243,7 +246,7 @@ function drawSurveyForm(task, contentDiv) {
|
||||
let freeformId = "freeform_" + i;
|
||||
let radioName = "answer_to_" + i;
|
||||
|
||||
for (let j = 0; j < choices.length; j++) {
|
||||
for (j = 0; j < choices.length; j++) {
|
||||
let newRadio = document.createElement("input");
|
||||
newRadio.setAttribute("type", "radio");
|
||||
newRadio.setAttribute("name", radioName);
|
||||
|
@ -512,15 +512,15 @@ exports.RemoteExperimentLoader.prototype = {
|
||||
remoteExperiments[filename] = this._loader.require(filename);
|
||||
this._logger.info("Loaded " + filename + " OK.");
|
||||
} catch(e) {
|
||||
/* Turn the load-time errors into strings and store them, so we can display
|
||||
* them on a debug page or include them with a data upload! (Don't store
|
||||
* exception objects directly as that causes garbage collector problems-
|
||||
* aka bug 646122) */
|
||||
let errStr = e.name + " on line " + e.lineNumber + " of file " +
|
||||
e.fileName + ": " + e.message;
|
||||
/* Turn the load-time errors into strings and store them, so we can display
|
||||
* them on a debug page or include them with a data upload! (Don't store
|
||||
* exception objects directly as that causes garbage collector problems-
|
||||
* aka bug 646122) */
|
||||
let errStr = e.name + " on line " + e.lineNumber + " of file " +
|
||||
e.fileName + ": " + e.message;
|
||||
this._loadErrors.push(errStr);
|
||||
this._logger.warn("Error loading " + filename);
|
||||
this._logger.warn(e);
|
||||
this._logger.warn(errStr);
|
||||
}
|
||||
}
|
||||
return remoteExperiments;
|
||||
|
@ -597,7 +597,7 @@ TestPilotExperiment.prototype = {
|
||||
}
|
||||
}
|
||||
} catch(e) {
|
||||
this._logger.warn("Error in getStudyMetadata: " + e);
|
||||
this._dataStore.logException("getStudyMetadata: " + e);
|
||||
}
|
||||
return null;
|
||||
},
|
||||
@ -660,6 +660,7 @@ TestPilotExperiment.prototype = {
|
||||
// This method handles all date-related status changes and should be
|
||||
// called periodically.
|
||||
let currentDate = this._now();
|
||||
let self = this;
|
||||
|
||||
// Reset automatically recurring tests:
|
||||
if (this._recursAutomatically &&
|
||||
@ -703,7 +704,6 @@ TestPilotExperiment.prototype = {
|
||||
currentDate <= this._endDate) {
|
||||
this._logger.info("Study now starting.");
|
||||
// clear the data before starting.
|
||||
let self = this;
|
||||
this._dataStore.wipeAllData(function() {
|
||||
// Experiment is now in progress.
|
||||
self.changeStatus(TaskConstants.STATUS_IN_PROGRESS, true);
|
||||
@ -714,7 +714,6 @@ TestPilotExperiment.prototype = {
|
||||
// What happens when a test finishes:
|
||||
if (this._status < TaskConstants.STATUS_FINISHED &&
|
||||
currentDate > this._endDate) {
|
||||
let self = this;
|
||||
let setDataDeletionDate = true;
|
||||
this._logger.info("Passed End Date - Switched Task Status to Finished");
|
||||
this.changeStatus(TaskConstants.STATUS_FINISHED);
|
||||
@ -896,7 +895,6 @@ TestPilotExperiment.prototype = {
|
||||
optOut: function TestPilotExperiment_optOut(reason, callback) {
|
||||
// Regardless of study ID, post the opt-out message to a special
|
||||
// database table of just opt-out messages; include study ID in metadata.
|
||||
let url = Application.prefs.getValue(DATA_UPLOAD_PREF, "") + "opt-out";
|
||||
let logger = this._logger;
|
||||
|
||||
this.onExperimentShutdown();
|
||||
@ -909,6 +907,7 @@ TestPilotExperiment.prototype = {
|
||||
if (reason) {
|
||||
// Send us the reason...
|
||||
// (TODO: include metadata?)
|
||||
let url = Application.prefs.getValue(DATA_UPLOAD_PREF, "") + "opt-out";
|
||||
let answer = {id: this._id,
|
||||
reason: reason};
|
||||
let dataString = JSON.stringify(answer);
|
||||
@ -924,17 +923,23 @@ TestPilotExperiment.prototype = {
|
||||
if (req.readyState == 4) {
|
||||
if (req.status == 200 || req.status == 201 || req.status == 202) {
|
||||
logger.info("Quit reason posted successfully " + req.responseText);
|
||||
callback(true);
|
||||
if (callback) {
|
||||
callback(true);
|
||||
}
|
||||
} else {
|
||||
logger.warn(req.status + " posting error " + req.responseText);
|
||||
callback(false);
|
||||
if (callback) {
|
||||
callback(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
logger.trace("Sending quit reason.");
|
||||
req.send(dataString);
|
||||
} else {
|
||||
callback(false);
|
||||
if (callback) {
|
||||
callback(false);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -961,6 +966,7 @@ TestPilotBuiltinSurvey.prototype = {
|
||||
this._versionNumber = surveyInfo.versionNumber;
|
||||
this._questions = surveyInfo.surveyQuestions;
|
||||
this._explanation = surveyInfo.surveyExplanation;
|
||||
this._onPageLoad = surveyInfo.onPageLoad;
|
||||
},
|
||||
|
||||
get taskType() {
|
||||
@ -988,6 +994,12 @@ TestPilotBuiltinSurvey.prototype = {
|
||||
return this._studyId;
|
||||
},
|
||||
|
||||
onPageLoad: function(task, document) {
|
||||
if (this._onPageLoad) {
|
||||
this._onPageLoad(task, document);
|
||||
}
|
||||
},
|
||||
|
||||
onDetailPageOpened: function TPS_onDetailPageOpened() {
|
||||
if (this._status < TaskConstants.STATUS_IN_PROGRESS) {
|
||||
this.changeStatus( TaskConstants.STATUS_IN_PROGRESS, true );
|
||||
@ -1204,4 +1216,4 @@ TestPilotLegacyStudy.prototype = {
|
||||
// TODO test that they don't say "thanks for contributing" if the
|
||||
// user didn't actually complete them...
|
||||
};
|
||||
TestPilotLegacyStudy.prototype.__proto__ = TestPilotTask;
|
||||
TestPilotLegacyStudy.prototype.__proto__ = TestPilotTask;
|
||||
|
@ -264,7 +264,7 @@ pref("browser.urlbar.doubleClickSelectsAll", true);
|
||||
#else
|
||||
pref("browser.urlbar.doubleClickSelectsAll", false);
|
||||
#endif
|
||||
pref("browser.urlbar.autoFill", false);
|
||||
pref("browser.urlbar.autoFill", true);
|
||||
// 0: Match anywhere (e.g., middle of words)
|
||||
// 1: Match on word boundaries and then try matching anywhere
|
||||
// 2: Match only on word boundaries (e.g., after / or .)
|
||||
@ -901,6 +901,17 @@ pref("dom.ipc.plugins.enabled.x86_64", true);
|
||||
pref("dom.ipc.plugins.enabled", true);
|
||||
#endif
|
||||
|
||||
// This pref governs whether we attempt to work around problems caused by
|
||||
// plugins using OS calls to manipulate the cursor while running out-of-
|
||||
// process. These workarounds all involve intercepting (hooking) certain
|
||||
// OS calls in the plugin process, then arranging to make certain OS calls
|
||||
// in the browser process. Eventually plugins will be required to use the
|
||||
// NPAPI to manipulate the cursor, and these workarounds will be removed.
|
||||
// See bug 621117.
|
||||
#ifdef XP_MACOSX
|
||||
pref("dom.ipc.plugins.nativeCursorSupport", true);
|
||||
#endif
|
||||
|
||||
#ifdef XP_WIN
|
||||
pref("browser.taskbar.previews.enable", false);
|
||||
pref("browser.taskbar.previews.max", 20);
|
||||
|
@ -201,6 +201,10 @@
|
||||
label="&errorConsoleCmd.label;"
|
||||
key="key_errorConsole"
|
||||
oncommand="toJavaScriptConsole();"/>
|
||||
<menuseparator id="appmenu_devToolsEndSeparator"/>
|
||||
<menuitem id="appmenu_getMoreDevtools"
|
||||
label="&getMoreDevtoolsCmd.label;"
|
||||
oncommand="openUILinkIn('https://addons.mozilla.org/firefox/collections/mozilla/webdeveloper/', 'tab');"/>
|
||||
<menuseparator/>
|
||||
#define ID_PREFIX appmenu_developer_
|
||||
#define OMIT_ACCESSKEYS
|
||||
|
@ -567,6 +567,11 @@
|
||||
accesskey="&errorConsoleCmd.accesskey;"
|
||||
key="key_errorConsole"
|
||||
oncommand="toJavaScriptConsole();"/>
|
||||
<menuseparator id="devToolsEndSeparator"/>
|
||||
<menuitem id="getMoreDevtools"
|
||||
label="&getMoreDevtoolsCmd.label;"
|
||||
accesskey="&getMoreDevtoolsCmd.accesskey;"
|
||||
oncommand="openUILinkIn('https://addons.mozilla.org/firefox/collections/mozilla/webdeveloper/', 'tab');"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menuitem id="menu_pageInfo"
|
||||
|
@ -496,3 +496,7 @@ statuspanel[label=""] {
|
||||
width: 100%;
|
||||
-moz-box-align: end;
|
||||
}
|
||||
|
||||
.panel-inner-arrowcontentfooter[footertype="promobox"] {
|
||||
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#promobox");
|
||||
}
|
||||
|
@ -261,10 +261,10 @@ function UpdateBackForwardCommands(aWebNavigation) {
|
||||
function SetClickAndHoldHandlers() {
|
||||
var timer;
|
||||
|
||||
function timerCallback(aButton) {
|
||||
function openMenu(aButton) {
|
||||
cancelHold(aButton);
|
||||
aButton.firstChild.hidden = false;
|
||||
aButton.open = true;
|
||||
timer = null;
|
||||
}
|
||||
|
||||
function mousedownHandler(aEvent) {
|
||||
@ -276,7 +276,29 @@ function SetClickAndHoldHandlers() {
|
||||
// Prevent the menupopup from opening immediately
|
||||
aEvent.currentTarget.firstChild.hidden = true;
|
||||
|
||||
timer = setTimeout(timerCallback, 500, aEvent.currentTarget);
|
||||
aEvent.currentTarget.addEventListener("mouseout", mouseoutHandler, false);
|
||||
aEvent.currentTarget.addEventListener("mouseup", mouseupHandler, false);
|
||||
timer = setTimeout(openMenu, 500, aEvent.currentTarget);
|
||||
}
|
||||
|
||||
function mouseoutHandler(aEvent) {
|
||||
let buttonRect = aEvent.currentTarget.getBoundingClientRect();
|
||||
if (aEvent.clientX >= buttonRect.left &&
|
||||
aEvent.clientX <= buttonRect.right &&
|
||||
aEvent.clientY >= buttonRect.bottom)
|
||||
openMenu(aEvent.currentTarget);
|
||||
else
|
||||
cancelHold(aEvent.currentTarget);
|
||||
}
|
||||
|
||||
function mouseupHandler(aEvent) {
|
||||
cancelHold(aEvent.currentTarget);
|
||||
}
|
||||
|
||||
function cancelHold(aButton) {
|
||||
clearTimeout(timer);
|
||||
aButton.removeEventListener("mouseout", mouseoutHandler, false);
|
||||
aButton.removeEventListener("mouseup", mouseupHandler, false);
|
||||
}
|
||||
|
||||
function clickHandler(aEvent) {
|
||||
@ -292,17 +314,8 @@ function SetClickAndHoldHandlers() {
|
||||
}
|
||||
}
|
||||
|
||||
function stopTimer(aEvent) {
|
||||
if (timer) {
|
||||
clearTimeout(timer);
|
||||
timer = null;
|
||||
}
|
||||
}
|
||||
|
||||
function _addClickAndHoldListenersOnElement(aElm) {
|
||||
aElm.addEventListener("mousedown", mousedownHandler, true);
|
||||
aElm.addEventListener("mouseup", stopTimer, false);
|
||||
aElm.addEventListener("mouseout", stopTimer, false);
|
||||
aElm.addEventListener("click", clickHandler, true);
|
||||
}
|
||||
|
||||
|
@ -177,6 +177,7 @@
|
||||
|
||||
<panel id="editBookmarkPanel"
|
||||
type="arrow"
|
||||
footertype="promobox"
|
||||
orient="vertical"
|
||||
ignorekeys="true"
|
||||
hidden="true"
|
||||
@ -337,8 +338,13 @@
|
||||
|
||||
<menupopup id="placesContext"/>
|
||||
|
||||
<panel id="notification-popup" type="arrow" position="after_start"
|
||||
hidden="true" orient="vertical"/>
|
||||
<panel id="notification-popup"
|
||||
type="arrow"
|
||||
footertype="promobox"
|
||||
position="after_start"
|
||||
hidden="true"
|
||||
orient="vertical"
|
||||
role="alert"/>
|
||||
|
||||
<!-- Popup for site identity information -->
|
||||
<panel id="identity-popup"
|
||||
|
@ -64,6 +64,7 @@ const RECAPTCHA_DOMAIN = "https://www.google.com";
|
||||
Cu.import("resource://services-sync/main.js");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/PlacesUtils.jsm");
|
||||
Cu.import("resource://gre/modules/PluralForm.jsm");
|
||||
|
||||
var gSyncSetup = {
|
||||
@ -822,7 +823,9 @@ var gSyncSetup = {
|
||||
if (this._case1Setup)
|
||||
break;
|
||||
|
||||
let places_db = Weave.Svc.History.DBConnection;
|
||||
let places_db = PlacesUtils.history
|
||||
.QueryInterface(Ci.nsPIPlacesDatabase)
|
||||
.DBConnection;
|
||||
if (Weave.Engines.get("history").enabled) {
|
||||
let daysOfHistory = 0;
|
||||
let stm = places_db.createStatement(
|
||||
@ -853,7 +856,7 @@ var gSyncSetup = {
|
||||
"FROM moz_bookmarks b " +
|
||||
"LEFT JOIN moz_bookmarks t ON " +
|
||||
"b.parent = t.id WHERE b.type = 1 AND t.parent <> :tag");
|
||||
stm.params.tag = Weave.Svc.Bookmark.tagsFolder;
|
||||
stm.params.tag = PlacesUtils.tagsFolderId;
|
||||
if (stm.executeStep())
|
||||
bookmarks = stm.row.bookmarks;
|
||||
// Support %S for historical reasons (see bug 600141)
|
||||
@ -867,7 +870,7 @@ var gSyncSetup = {
|
||||
}
|
||||
|
||||
if (Weave.Engines.get("passwords").enabled) {
|
||||
let logins = Weave.Svc.Login.getAllLogins({});
|
||||
let logins = Services.logins.getAllLogins({});
|
||||
// Support %S for historical reasons (see bug 600141)
|
||||
document.getElementById("passwordCount").value =
|
||||
PluralForm.get(logins.length,
|
||||
|
@ -55,8 +55,8 @@ let gSyncUtils = {
|
||||
else if (thisDocEl.id == "BrowserPreferences" && !thisDocEl.instantApply)
|
||||
openUILinkIn(url, "window");
|
||||
else if (document.documentElement.id == "change-dialog")
|
||||
Weave.Svc.WinMediator.getMostRecentWindow("navigator:browser")
|
||||
.openUILinkIn(url, "tab");
|
||||
Services.wm.getMostRecentWindow("navigator:browser")
|
||||
.openUILinkIn(url, "tab");
|
||||
else
|
||||
openUILinkIn(url, "tab");
|
||||
},
|
||||
@ -69,7 +69,7 @@ let gSyncUtils = {
|
||||
|
||||
openChange: function openChange(type, duringSetup) {
|
||||
// Just re-show the dialog if it's already open
|
||||
let openedDialog = Weave.Svc.WinMediator.getMostRecentWindow("Sync:" + type);
|
||||
let openedDialog = Services.wm.getMostRecentWindow("Sync:" + type);
|
||||
if (openedDialog != null) {
|
||||
openedDialog.focus();
|
||||
return;
|
||||
@ -78,8 +78,8 @@ let gSyncUtils = {
|
||||
// Open up the change dialog
|
||||
let changeXUL = "chrome://browser/content/syncGenericChange.xul";
|
||||
let changeOpt = "centerscreen,chrome,resizable=no";
|
||||
Weave.Svc.WinWatcher.activeWindow.openDialog(changeXUL, "", changeOpt,
|
||||
type, duringSetup);
|
||||
Services.ww.activeWindow.openDialog(changeXUL, "", changeOpt,
|
||||
type, duringSetup);
|
||||
},
|
||||
|
||||
changePassword: function () {
|
||||
|
@ -170,6 +170,7 @@ _BROWSER_FILES = \
|
||||
browser_bug616836.js \
|
||||
browser_bug623893.js \
|
||||
browser_bug624734.js \
|
||||
browser_bug647886.js \
|
||||
browser_findbarClose.js \
|
||||
browser_contextSearchTabPosition.js \
|
||||
browser_ctrlTab.js \
|
||||
@ -231,7 +232,6 @@ _BROWSER_FILES = \
|
||||
browser_visibleTabs_bookmarkAllPages.js \
|
||||
browser_visibleTabs_bookmarkAllTabs.js \
|
||||
browser_visibleTabs_tabPreview.js \
|
||||
browser_webdev_menu.js \
|
||||
bug592338.html \
|
||||
disablechrome.html \
|
||||
discovery.html \
|
||||
|
@ -31,7 +31,7 @@ function test() {
|
||||
|
||||
content.location =
|
||||
"data:text/html," +
|
||||
"<style type='text/css'>#test-image,#not-test-image {background-image: url('about:logo?c');}</style>" +
|
||||
"<style type='text/css'>%23test-image,%23not-test-image {background-image: url('about:logo?c');}</style>" +
|
||||
"<img src='about:logo?b' height=300 width=350 alt=2 id='not-test-image'>" +
|
||||
"<img src='about:logo?b' height=300 width=350 alt=2>" +
|
||||
"<img src='about:logo?a' height=200 width=250>" +
|
||||
|
34
browser/base/content/test/browser_bug647886.js
Normal file
34
browser/base/content/test/browser_bug647886.js
Normal file
@ -0,0 +1,34 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
gBrowser.selectedBrowser.addEventListener("load", function () {
|
||||
gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
|
||||
|
||||
content.history.pushState({}, "2", "2.html");
|
||||
|
||||
testBackButton();
|
||||
}, true);
|
||||
|
||||
loadURI("http://example.com");
|
||||
}
|
||||
|
||||
function testBackButton() {
|
||||
var backButton = document.getElementById("back-button");
|
||||
var rect = backButton.getBoundingClientRect();
|
||||
|
||||
info("waiting for the history menu to open");
|
||||
|
||||
backButton.addEventListener("popupshown", function (event) {
|
||||
backButton.removeEventListener("popupshown", arguments.callee, false);
|
||||
|
||||
ok(true, "history menu opened");
|
||||
event.target.hidePopup();
|
||||
finish();
|
||||
}, false);
|
||||
|
||||
EventUtils.synthesizeMouseAtCenter(backButton, {type: "mousedown"});
|
||||
EventUtils.synthesizeMouse(backButton, rect.width / 2, rect.height, {type: "mouseup"});
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
/* vim: set ts=2 et sw=2 tw=80: */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function menuTest()
|
||||
{
|
||||
gBrowser.selectedBrowser.removeEventListener("load", menuTest, true);
|
||||
|
||||
let menuContents = [
|
||||
"menu_pageinspect",
|
||||
"webConsole",
|
||||
"menu_scratchpad",
|
||||
"menu_pageSource",
|
||||
"javascriptConsole"
|
||||
];
|
||||
|
||||
let menu = document.getElementById("webDeveloperMenu");
|
||||
ok(menu, "we have the menu");
|
||||
|
||||
let popup = menu.firstChild;
|
||||
is(popup.id, "menuWebDeveloperPopup", "menu first child is menuWebDeveloperPopup");
|
||||
|
||||
is(popup.childNodes.length, menuContents.length, "popup childNodes.length matches");
|
||||
|
||||
for(let a = 0; a < popup.children.length; a++) {
|
||||
isnot(menuContents.indexOf(popup.children[a].id), -1, "menuitem " + popup.children[a].id + " in popup");
|
||||
};
|
||||
|
||||
gBrowser.removeCurrentTab();
|
||||
finish();
|
||||
}
|
||||
|
||||
function test()
|
||||
{
|
||||
waitForExplicitFinish();
|
||||
|
||||
gBrowser.selectedTab = gBrowser.addTab();
|
||||
gBrowser.selectedBrowser.addEventListener("load", menuTest, true);
|
||||
|
||||
content.location = "data:text/html,<title>Web Developer Menu Test</title>" +
|
||||
"<p>testing the Web Developer Menu";
|
||||
}
|
||||
|
@ -15,12 +15,12 @@ function test() {
|
||||
}
|
||||
|
||||
// very long page that produces black bars at the right
|
||||
let html1 = '<html><body style="background-color: #00f;">' +
|
||||
'<div style="background: #fff; width: 95%; height: 10000px; ' +
|
||||
let html1 = '<html><body style="background-color: %2300f;">' +
|
||||
'<div style="background: %23fff; width: 95%; height: 10000px; ' +
|
||||
' margin: 0 auto;"></div></body></html>';
|
||||
|
||||
// very short page that produces black bars at the bottom
|
||||
let html2 = '<html><body style="background-color: #00f;"></body></html>';
|
||||
let html2 = '<html><body style="background-color: %2300f;"></body></html>';
|
||||
|
||||
let tests = [{
|
||||
url: 'data:text/html,' + html1,
|
||||
|
@ -907,7 +907,7 @@
|
||||
</xul:vbox>
|
||||
<xul:vbox pack="start">
|
||||
<xul:toolbarbutton anonid="closebutton"
|
||||
class="messageCloseButton popup-notification-closebutton"
|
||||
class="messageCloseButton popup-notification-closebutton tabbable"
|
||||
xbl:inherits="oncommand=closebuttoncommand"
|
||||
tooltiptext="&closeNotification.tooltip;"/>
|
||||
</xul:vbox>
|
||||
@ -954,7 +954,7 @@
|
||||
</xul:vbox>
|
||||
<xul:vbox pack="start">
|
||||
<xul:toolbarbutton anonid="closebutton"
|
||||
class="messageCloseButton popup-notification-closebutton"
|
||||
class="messageCloseButton popup-notification-closebutton tabbable"
|
||||
xbl:inherits="oncommand=closebuttoncommand"
|
||||
tooltiptext="&closeNotification.tooltip;"/>
|
||||
</xul:vbox>
|
||||
@ -1277,4 +1277,131 @@
|
||||
</implementation>
|
||||
</binding>
|
||||
|
||||
<binding id="promobox">
|
||||
<content>
|
||||
<xul:hbox class="panel-promo-box" align="start" flex="1">
|
||||
<xul:hbox align="center" flex="1">
|
||||
<xul:image class="panel-promo-icon"/>
|
||||
<xul:description anonid="promo-message" class="panel-promo-message" flex="1">
|
||||
placeholder <xul:description anonid="promo-link" class="plain text-link inline-link"/>
|
||||
</xul:description>
|
||||
</xul:hbox>
|
||||
<xul:toolbarbutton class="panel-promo-closebutton"
|
||||
oncommand="document.getBindingParent(this).onCloseButtonCommand();"
|
||||
tooltiptext="&closeNotification.tooltip;"/>
|
||||
</xul:hbox>
|
||||
</content>
|
||||
|
||||
<implementation implements="nsIDOMEventListener">
|
||||
<constructor><![CDATA[
|
||||
this._panel.addEventListener("popupshowing", this, false);
|
||||
]]></constructor>
|
||||
|
||||
<destructor><![CDATA[
|
||||
this._panel.removeEventListener("popupshowing", this, false);
|
||||
]]></destructor>
|
||||
|
||||
<field name="_panel" readonly="true"><![CDATA[
|
||||
let node = this.parentNode;
|
||||
while(node && node.localName != "panel") {
|
||||
node = node.parentNode;
|
||||
}
|
||||
node;
|
||||
]]></field>
|
||||
<field name="_promomessage" readonly="true">
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "promo-message");
|
||||
</field>
|
||||
<field name="_promolink" readonly="true">
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "promo-link");
|
||||
</field>
|
||||
<field name="_brandBundle" readonly="true">
|
||||
Services.strings.createBundle("chrome://branding/locale/brand.properties");
|
||||
</field>
|
||||
<property name="_viewsLeft">
|
||||
<getter><![CDATA[
|
||||
try {
|
||||
return Services.prefs.getIntPref("browser.syncPromoViewsLeft");
|
||||
} catch(ex) {}
|
||||
return 5;
|
||||
]]></getter>
|
||||
<setter><![CDATA[
|
||||
Services.prefs.setIntPref("browser.syncPromoViewsLeft", val);
|
||||
return val;
|
||||
]]></setter>
|
||||
</property>
|
||||
<property name="_notificationType">
|
||||
<getter><![CDATA[
|
||||
// Use the popupid attribute to identify the notification type,
|
||||
// otherwise just rely on the panel id for common arrowpanels.
|
||||
let type = this._panel.firstChild.getAttribute("popupid") ||
|
||||
this._panel.id;
|
||||
if (/^password-/.test(type))
|
||||
return "passwords";
|
||||
if (type == "editBookmarkPanel")
|
||||
return "bookmarks";
|
||||
return null;
|
||||
]]></getter>
|
||||
</property>
|
||||
<property name="_notificationMessage">
|
||||
<getter><![CDATA[
|
||||
return gNavigatorBundle.getFormattedString(
|
||||
"syncPromoNotification." + this._notificationType + ".label",
|
||||
[this._brandBundle.GetStringFromName("syncBrandShortName")]
|
||||
);
|
||||
]]></getter>
|
||||
</property>
|
||||
<method name="onCloseButtonCommand">
|
||||
<body><![CDATA[
|
||||
this._viewsLeft = 0;
|
||||
this.hidden = true;
|
||||
]]></body>
|
||||
</method>
|
||||
<method name="handleEvent">
|
||||
<parameter name="event"/>
|
||||
<body><![CDATA[
|
||||
if (event.type != "popupshowing" || event.target != this._panel)
|
||||
return;
|
||||
|
||||
// A previous notification may have unhidden this.
|
||||
this.hidden = true;
|
||||
|
||||
// Only handle supported notification panels.
|
||||
if (!this._notificationType) {
|
||||
return;
|
||||
}
|
||||
|
||||
let viewsLeft = this._viewsLeft;
|
||||
if (viewsLeft) {
|
||||
if (Services.prefs.prefHasUserValue("services.sync.username")) {
|
||||
// If the user has already setup Sync, don't show the notification.
|
||||
this._viewsLeft = 0;
|
||||
// Be sure to hide the panel, in case it was visible and the user
|
||||
// decided to setup Sync after noticing it.
|
||||
viewsLeft = 0;
|
||||
// The panel is still hidden, just bail out.
|
||||
return;
|
||||
}
|
||||
else {
|
||||
this._viewsLeft = viewsLeft - 1;
|
||||
}
|
||||
|
||||
this._promolink.setAttribute("href", "https://services.mozilla.com/sync/");
|
||||
this._promolink.value = gNavigatorBundle.getString("syncPromoNotification.learnMoreLinkText");
|
||||
|
||||
this.hidden = false;
|
||||
|
||||
// HACK: The description element doesn't wrap correctly in panels,
|
||||
// thus set a width on it, based on the available space, before
|
||||
// setting its textContent.
|
||||
this._panel.addEventListener("popupshown", function (evt) {
|
||||
this._panel.removeEventListener("popupshown", arguments.callee, true);
|
||||
this._promomessage.width = this._promomessage.getBoundingClientRect().width;
|
||||
this._promomessage.firstChild.textContent = this._notificationMessage;
|
||||
}.bind(this), true);
|
||||
}
|
||||
]]></body>
|
||||
</method>
|
||||
</implementation>
|
||||
</binding>
|
||||
|
||||
</bindings>
|
||||
|
@ -1,3 +1,5 @@
|
||||
brandShortName=Aurora
|
||||
brandFullName=Aurora
|
||||
vendorShortName=Mozilla
|
||||
|
||||
syncBrandShortName=Sync
|
||||
|
@ -1,3 +1,5 @@
|
||||
brandShortName=Nightly
|
||||
brandFullName=Nightly
|
||||
vendorShortName=Mozilla
|
||||
|
||||
syncBrandShortName=Sync
|
||||
|
@ -7,3 +7,5 @@ homePageImport=Import your home page from %S
|
||||
|
||||
homePageMigrationPageTitle=Home Page Selection
|
||||
homePageMigrationDescription=Please select the home page you wish to use:
|
||||
|
||||
syncBrandShortName=Sync
|
||||
|
@ -1,3 +1,5 @@
|
||||
brandShortName=Mozilla Developer Preview
|
||||
brandFullName=Mozilla Developer Preview
|
||||
vendorShortName=mozilla.org
|
||||
|
||||
syncBrandShortName=Sync
|
||||
|
@ -74,12 +74,4 @@ EXTRA_DSO_LDOPTS += \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
ifndef MOZ_ENABLE_LIBXUL
|
||||
ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
|
||||
# Doesn't work, couldn't figure out why
|
||||
#EXTRA_DSO_LIBS += thebes
|
||||
EXTRA_DSO_LDOPTS += $(LIBXUL_DIST)/lib/$(LIB_PREFIX)thebes.$(IMPORT_LIB_SUFFIX)
|
||||
endif
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
@ -96,69 +96,55 @@ var PlacesUIUtils = {
|
||||
return bundle.GetStringFromName(key);
|
||||
},
|
||||
|
||||
/**
|
||||
* Get a transaction for copying a uri item from one container to another
|
||||
* as a bookmark.
|
||||
* @param aData
|
||||
* JSON object of dropped or pasted item properties
|
||||
* @param aContainer
|
||||
* The container being copied into
|
||||
* @param aIndex
|
||||
* The index within the container the item is copied to
|
||||
* @returns A nsITransaction object that performs the copy.
|
||||
*/
|
||||
_getURIItemCopyTransaction: function (aData, aContainer, aIndex) {
|
||||
return this.ptm.createItem(PlacesUtils._uri(aData.uri), aContainer, aIndex,
|
||||
aData.title, "");
|
||||
},
|
||||
get _copyableAnnotations() [
|
||||
this.DESCRIPTION_ANNO,
|
||||
this.LOAD_IN_SIDEBAR_ANNO,
|
||||
PlacesUtils.POST_DATA_ANNO,
|
||||
PlacesUtils.READ_ONLY_ANNO,
|
||||
],
|
||||
|
||||
/**
|
||||
* Get a transaction for copying a bookmark item from one container to
|
||||
* another.
|
||||
* Get a transaction for copying a uri item (either a bookmark or a history
|
||||
* entry) from one container to another.
|
||||
*
|
||||
* @param aData
|
||||
* JSON object of dropped or pasted item properties
|
||||
* @param aContainer
|
||||
* The container being copied into
|
||||
* @param aIndex
|
||||
* The index within the container the item is copied to
|
||||
* @param [optional] aExcludeAnnotations
|
||||
* Optional, array of annotations (listed by their names) to exclude
|
||||
* when copying the item.
|
||||
* @returns A nsITransaction object that performs the copy.
|
||||
* @return A nsITransaction object that performs the copy.
|
||||
*
|
||||
* @note Since a copy creates a completely new item, only some internal
|
||||
* annotations are synced from the old one.
|
||||
* @see this._copyableAnnotations for the list of copyable annotations.
|
||||
*/
|
||||
_getBookmarkItemCopyTransaction:
|
||||
function PUIU__getBookmarkItemCopyTransaction(aData, aContainer, aIndex,
|
||||
aExcludeAnnotations) {
|
||||
var itemURL = PlacesUtils._uri(aData.uri);
|
||||
var itemTitle = aData.title;
|
||||
var keyword = aData.keyword || null;
|
||||
var annos = aData.annos || [];
|
||||
// always exclude GUID when copying any item
|
||||
var excludeAnnos = [PlacesUtils.GUID_ANNO];
|
||||
if (aExcludeAnnotations)
|
||||
excludeAnnos = excludeAnnos.concat(aExcludeAnnotations);
|
||||
annos = annos.filter(function(aValue, aIndex, aArray) {
|
||||
return excludeAnnos.indexOf(aValue.name) == -1;
|
||||
});
|
||||
var childTxns = [];
|
||||
if (aData.dateAdded)
|
||||
childTxns.push(this.ptm.editItemDateAdded(null, aData.dateAdded));
|
||||
if (aData.lastModified)
|
||||
childTxns.push(this.ptm.editItemLastModified(null, aData.lastModified));
|
||||
if (aData.tags) {
|
||||
var tags = aData.tags.split(", ");
|
||||
// filter out tags already present, so that undo doesn't remove them
|
||||
// from pre-existing bookmarks
|
||||
var storedTags = PlacesUtils.tagging.getTagsForURI(itemURL);
|
||||
tags = tags.filter(function (aTag) {
|
||||
return (storedTags.indexOf(aTag) == -1);
|
||||
}, this);
|
||||
if (tags.length)
|
||||
childTxns.push(this.ptm.tagURI(itemURL, tags));
|
||||
_getURIItemCopyTransaction:
|
||||
function PUIU__getURIItemCopyTransaction(aData, aContainer, aIndex)
|
||||
{
|
||||
let transactions = [];
|
||||
if (aData.dateAdded) {
|
||||
transactions.push(
|
||||
new PlacesEditItemDateAddedTransaction(null, aData.dateAdded)
|
||||
);
|
||||
}
|
||||
if (aData.lastModified) {
|
||||
transactions.push(
|
||||
new PlacesEditItemLastModifiedTransaction(null, aData.lastModified)
|
||||
);
|
||||
}
|
||||
|
||||
return this.ptm.createItem(itemURL, aContainer, aIndex, itemTitle, keyword,
|
||||
annos, childTxns);
|
||||
let keyword = aData.keyword || null;
|
||||
let annos = [];
|
||||
if (aData.annos) {
|
||||
annos = aData.annos.filter(function (aAnno) {
|
||||
return this._copyableAnnotations.indexOf(aAnno.name) != -1;
|
||||
}, this);
|
||||
}
|
||||
|
||||
return new PlacesCreateBookmarkTransaction(PlacesUtils._uri(aData.uri),
|
||||
aContainer, aIndex, aData.title,
|
||||
keyword, annos, transactions);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -171,94 +157,133 @@ var PlacesUIUtils = {
|
||||
* The container we are copying into
|
||||
* @param aIndex
|
||||
* The index in the destination container to insert the new items
|
||||
* @returns A nsITransaction object that will perform the copy.
|
||||
* @return A nsITransaction object that will perform the copy.
|
||||
*
|
||||
* @note Since a copy creates a completely new item, only some internal
|
||||
* annotations are synced from the old one.
|
||||
* @see this._copyableAnnotations for the list of copyable annotations.
|
||||
*/
|
||||
_getFolderCopyTransaction:
|
||||
function PUIU__getFolderCopyTransaction(aData, aContainer, aIndex) {
|
||||
function getChildItemsTransactions(aChildren) {
|
||||
var childItemsTransactions = [];
|
||||
var cc = aChildren.length;
|
||||
var index = aIndex;
|
||||
for (var i = 0; i < cc; ++i) {
|
||||
var txn = null;
|
||||
var node = aChildren[i];
|
||||
|
||||
function PUIU__getFolderCopyTransaction(aData, aContainer, aIndex)
|
||||
{
|
||||
function getChildItemsTransactions(aChildren)
|
||||
{
|
||||
let transactions = [];
|
||||
let index = aIndex;
|
||||
aChildren.forEach(function (node, i) {
|
||||
// Make sure that items are given the correct index, this will be
|
||||
// passed by the transaction manager to the backend for the insertion.
|
||||
// Insertion behaves differently if index == DEFAULT_INDEX (append)
|
||||
if (aIndex != PlacesUtils.bookmarks.DEFAULT_INDEX)
|
||||
// Insertion behaves differently for DEFAULT_INDEX (append).
|
||||
if (aIndex != PlacesUtils.bookmarks.DEFAULT_INDEX) {
|
||||
index = i;
|
||||
}
|
||||
|
||||
if (node.type == PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER) {
|
||||
if (node.livemark && node.annos) // node is a livemark
|
||||
txn = PlacesUIUtils._getLivemarkCopyTransaction(node, aContainer, index);
|
||||
else
|
||||
txn = PlacesUIUtils._getFolderCopyTransaction(node, aContainer, index);
|
||||
if (node.livemark && node.annos) {
|
||||
transactions.push(
|
||||
PlacesUIUtils._getLivemarkCopyTransaction(node, aContainer, index)
|
||||
);
|
||||
}
|
||||
else {
|
||||
transactions.push(
|
||||
PlacesUIUtils._getFolderCopyTransaction(node, aContainer, index)
|
||||
);
|
||||
}
|
||||
}
|
||||
else if (node.type == PlacesUtils.TYPE_X_MOZ_PLACE_SEPARATOR)
|
||||
txn = PlacesUIUtils.ptm.createSeparator(-1, index);
|
||||
else if (node.type == PlacesUtils.TYPE_X_MOZ_PLACE)
|
||||
txn = PlacesUIUtils._getBookmarkItemCopyTransaction(node, -1, index);
|
||||
|
||||
if (txn)
|
||||
childItemsTransactions.push(txn);
|
||||
else
|
||||
throw("Unexpected item under a bookmarks folder");
|
||||
}
|
||||
return childItemsTransactions;
|
||||
else if (node.type == PlacesUtils.TYPE_X_MOZ_PLACE_SEPARATOR) {
|
||||
transactions.push(new PlacesCreateSeparatorTransaction(-1, index));
|
||||
}
|
||||
else if (node.type == PlacesUtils.TYPE_X_MOZ_PLACE) {
|
||||
transactions.push(
|
||||
PlacesUIUtils._getURIItemCopyTransaction(node, -1, index)
|
||||
);
|
||||
}
|
||||
else {
|
||||
throw new Error("Unexpected item under a bookmarks folder");
|
||||
}
|
||||
});
|
||||
return transactions;
|
||||
}
|
||||
|
||||
// tag folders use tag transactions
|
||||
if (aContainer == PlacesUtils.tagsFolderId) {
|
||||
var txns = [];
|
||||
if (aContainer == PlacesUtils.tagsFolderId) { // Copying a tag folder.
|
||||
let transactions = [];
|
||||
if (aData.children) {
|
||||
aData.children.forEach(function(aChild) {
|
||||
txns.push(this.ptm.tagURI(PlacesUtils._uri(aChild.uri), [aData.title]));
|
||||
}, this);
|
||||
transactions.push(
|
||||
new PlacesTagURITransaction(PlacesUtils._uri(aChild.uri),
|
||||
[aData.title])
|
||||
);
|
||||
});
|
||||
}
|
||||
return this.ptm.aggregateTransactions("addTags", txns);
|
||||
return new PlacesAggregatedTransaction("addTags", transactions);
|
||||
}
|
||||
else if (aData.livemark && aData.annos) {
|
||||
// Place is a Livemark Container
|
||||
|
||||
if (aData.livemark && aData.annos) { // Copying a livemark.
|
||||
return this._getLivemarkCopyTransaction(aData, aContainer, aIndex);
|
||||
}
|
||||
else {
|
||||
var childItems = getChildItemsTransactions(aData.children);
|
||||
if (aData.dateAdded)
|
||||
childItems.push(this.ptm.editItemDateAdded(null, aData.dateAdded));
|
||||
if (aData.lastModified)
|
||||
childItems.push(this.ptm.editItemLastModified(null, aData.lastModified));
|
||||
|
||||
var annos = aData.annos || [];
|
||||
annos = annos.filter(function(aAnno) {
|
||||
// always exclude GUID when copying any item
|
||||
return aAnno.name != PlacesUtils.GUID_ANNO;
|
||||
});
|
||||
return this.ptm.createFolder(aData.title, aContainer, aIndex, annos, childItems);
|
||||
let transactions = getChildItemsTransactions(aData.children);
|
||||
if (aData.dateAdded) {
|
||||
transactions.push(
|
||||
new PlacesEditItemDateAddedTransaction(null, aData.dateAdded)
|
||||
);
|
||||
}
|
||||
if (aData.lastModified) {
|
||||
transactions.push(
|
||||
new PlacesEditItemLastModifiedTransaction(null, aData.lastModified)
|
||||
);
|
||||
}
|
||||
|
||||
let annos = [];
|
||||
if (aData.annos) {
|
||||
annos = aData.annos.filter(function (aAnno) {
|
||||
return this._copyableAnnotations.indexOf(aAnno.name) != -1;
|
||||
}, this);
|
||||
}
|
||||
|
||||
return new PlacesCreateFolderTransaction(aData.title, aContainer, aIndex,
|
||||
annos, transactions);
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets a transaction for copying a live bookmark item from one container to
|
||||
* another.
|
||||
*
|
||||
* @param aData
|
||||
* Unwrapped live bookmarkmark data
|
||||
* @param aContainer
|
||||
* The container we are copying into
|
||||
* @param aIndex
|
||||
* The index in the destination container to insert the new items
|
||||
* @return A nsITransaction object that will perform the copy.
|
||||
*
|
||||
* @note Since a copy creates a completely new item, only some internal
|
||||
* annotations are synced from the old one.
|
||||
* @see this._copyableAnnotations for the list of copyable annotations.
|
||||
*/
|
||||
_getLivemarkCopyTransaction:
|
||||
function PUIU__getLivemarkCopyTransaction(aData, aContainer, aIndex) {
|
||||
if (!aData.livemark || !aData.annos)
|
||||
throw("node is not a livemark");
|
||||
// Place is a Livemark Container
|
||||
var feedURI = null;
|
||||
var siteURI = null;
|
||||
aData.annos = aData.annos.filter(function(aAnno) {
|
||||
if (aAnno.name == PlacesUtils.LMANNO_FEEDURI) {
|
||||
feedURI = PlacesUtils._uri(aAnno.value);
|
||||
return false;
|
||||
}
|
||||
else if (aAnno.name == PlacesUtils.LMANNO_SITEURI) {
|
||||
siteURI = PlacesUtils._uri(aAnno.value);
|
||||
return false;
|
||||
}
|
||||
// always exclude GUID when copying any item
|
||||
return aAnno.name != PlacesUtils.GUID_ANNO;
|
||||
});
|
||||
return this.ptm.createLivemark(feedURI, siteURI, aData.title, aContainer,
|
||||
aIndex, aData.annos);
|
||||
function PUIU__getLivemarkCopyTransaction(aData, aContainer, aIndex)
|
||||
{
|
||||
if (!aData.livemark || !aData.annos) {
|
||||
throw new Error("node is not a livemark");
|
||||
}
|
||||
|
||||
let feedURI, siteURI;
|
||||
let annos = [];
|
||||
if (aData.annos) {
|
||||
annos = aData.annos.filter(function (aAnno) {
|
||||
if (aAnno.name == PlacesUtils.LMANNO_FEEDURI) {
|
||||
feedURI = PlacesUtils._uri(aAnno.value);
|
||||
}
|
||||
else if (aAnno.name == PlacesUtils.LMANNO_SITEURI) {
|
||||
siteURI = PlacesUtils._uri(aAnno.value);
|
||||
}
|
||||
return this._copyableAnnotations.indexOf(aAnno.name) != -1
|
||||
}, this);
|
||||
}
|
||||
|
||||
return new PlacesCreateLivemarkTransaction(feedURI, siteURI, aData.title,
|
||||
aContainer, aIndex, annos);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -277,40 +302,44 @@ var PlacesUIUtils = {
|
||||
* @returns An object implementing nsITransaction that can perform
|
||||
* the move/insert.
|
||||
*/
|
||||
makeTransaction: function PUIU_makeTransaction(data, type, container,
|
||||
index, copy) {
|
||||
makeTransaction:
|
||||
function PUIU_makeTransaction(data, type, container, index, copy)
|
||||
{
|
||||
switch (data.type) {
|
||||
case PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER:
|
||||
if (copy)
|
||||
if (copy) {
|
||||
return this._getFolderCopyTransaction(data, container, index);
|
||||
}
|
||||
|
||||
// Otherwise move the item.
|
||||
return this.ptm.moveItem(data.id, container, index);
|
||||
return new PlacesMoveItemTransaction(data.id, container, index);
|
||||
break;
|
||||
case PlacesUtils.TYPE_X_MOZ_PLACE:
|
||||
if (data.id == -1) // Not bookmarked.
|
||||
if (copy || data.id == -1) { // Id is -1 if the place is not bookmarked.
|
||||
return this._getURIItemCopyTransaction(data, container, index);
|
||||
}
|
||||
|
||||
if (copy)
|
||||
return this._getBookmarkItemCopyTransaction(data, container, index);
|
||||
// Otherwise move the item.
|
||||
return this.ptm.moveItem(data.id, container, index);
|
||||
return new PlacesMoveItemTransaction(data.id, container, index);
|
||||
break;
|
||||
case PlacesUtils.TYPE_X_MOZ_PLACE_SEPARATOR:
|
||||
// There is no data in a separator, so copying it just amounts to
|
||||
// inserting a new separator.
|
||||
if (copy)
|
||||
return this.ptm.createSeparator(container, index);
|
||||
if (copy) {
|
||||
// There is no data in a separator, so copying it just amounts to
|
||||
// inserting a new separator.
|
||||
return new PlacesCreateSeparatorTransaction(container, index);
|
||||
}
|
||||
|
||||
// Otherwise move the item.
|
||||
return this.ptm.moveItem(data.id, container, index);
|
||||
return new PlacesMoveItemTransaction(data.id, container, index);
|
||||
break;
|
||||
default:
|
||||
if (type == PlacesUtils.TYPE_X_MOZ_URL ||
|
||||
type == PlacesUtils.TYPE_UNICODE ||
|
||||
type == this.TYPE_TAB_DROP) {
|
||||
var title = (type != PlacesUtils.TYPE_UNICODE) ? data.title :
|
||||
data.uri;
|
||||
return this.ptm.createItem(PlacesUtils._uri(data.uri),
|
||||
container, index, title);
|
||||
let title = type != PlacesUtils.TYPE_UNICODE ? data.title
|
||||
: data.uri;
|
||||
return new PlacesCreateBookmarkTransaction(PlacesUtils._uri(data.uri),
|
||||
container, index, title);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
@ -0,0 +1,353 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function waitForBookmarkNotification(aNotification, aCallback, aProperty)
|
||||
{
|
||||
PlacesUtils.bookmarks.addObserver({
|
||||
validate: function (aMethodName, aData)
|
||||
{
|
||||
if (aMethodName == aNotification &&
|
||||
(!aProperty || aProperty == aData.property)) {
|
||||
PlacesUtils.bookmarks.removeObserver(this);
|
||||
aCallback(aData);
|
||||
}
|
||||
},
|
||||
|
||||
// nsINavBookmarkObserver
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarkObserver]),
|
||||
onBeginUpdateBatch: function onBeginUpdateBatch()
|
||||
this.validate(arguments.callee.name, arguments),
|
||||
onEndUpdateBatch: function onEndUpdateBatch()
|
||||
this.validate(arguments.callee.name, arguments),
|
||||
onItemAdded: function onItemAdded(aItemId, aParentId, aIndex, aItemType,
|
||||
aURI, aTitle)
|
||||
{
|
||||
return this.validate(arguments.callee.name, { id: aItemId,
|
||||
index: aIndex,
|
||||
type: aItemType,
|
||||
url: aURI ? aURI.spec : null,
|
||||
title: aTitle });
|
||||
},
|
||||
onBeforeItemRemoved: function onBeforeItemRemoved()
|
||||
this.validate(arguments.callee.name, arguments),
|
||||
onItemRemoved: function onItemRemoved()
|
||||
this.validate(arguments.callee.name, arguments),
|
||||
onItemChanged: function onItemChanged(aItemId, aProperty, aIsAnno,
|
||||
aNewValue, aLastModified, aItemType)
|
||||
{
|
||||
return this.validate(arguments.callee.name,
|
||||
{ id: aItemId,
|
||||
get index() PlacesUtils.bookmarks.getItemIndex(this.id),
|
||||
type: aItemType,
|
||||
property: aProperty,
|
||||
get url() aItemType == PlacesUtils.bookmarks.TYPE_BOOKMARK ?
|
||||
PlacesUtils.bookmarks.getBookmarkURI(this.id).spec :
|
||||
null,
|
||||
get title() PlacesUtils.bookmarks.getItemTitle(this.id),
|
||||
});
|
||||
},
|
||||
onItemVisited: function onItemVisited()
|
||||
this.validate(arguments.callee.name, arguments),
|
||||
onItemMoved: function onItemMoved(aItemId, aOldParentId, aOldIndex,
|
||||
aNewParentId, aNewIndex, aItemType)
|
||||
{
|
||||
this.validate(arguments.callee.name, { id: aItemId,
|
||||
index: aNewIndex,
|
||||
type: aItemType });
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
|
||||
function wrapNodeByIdAndParent(aItemId, aParentId)
|
||||
{
|
||||
let wrappedNode;
|
||||
let root = PlacesUtils.getFolderContents(aParentId, false, false).root;
|
||||
for (let i = 0; i < root.childCount; ++i) {
|
||||
let node = root.getChild(i);
|
||||
if (node.itemId == aItemId) {
|
||||
let type;
|
||||
if (PlacesUtils.nodeIsContainer(node)) {
|
||||
type = PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER;
|
||||
}
|
||||
else if (PlacesUtils.nodeIsURI(node)) {
|
||||
type = PlacesUtils.TYPE_X_MOZ_PLACE;
|
||||
}
|
||||
else if (PlacesUtils.nodeIsSeparator(node)) {
|
||||
type = PlacesUtils.TYPE_X_MOZ_PLACE_SEPARATOR;
|
||||
}
|
||||
else {
|
||||
do_throw("Unknown node type");
|
||||
}
|
||||
wrappedNode = PlacesUtils.wrapNode(node, type);
|
||||
}
|
||||
}
|
||||
root.containerOpen = false;
|
||||
return JSON.parse(wrappedNode);
|
||||
}
|
||||
|
||||
add_test(function test_text_paste()
|
||||
{
|
||||
const TEST_URL = "http://places.moz.org/"
|
||||
const TEST_TITLE = "Places bookmark"
|
||||
|
||||
waitForBookmarkNotification("onItemAdded", function(aData)
|
||||
{
|
||||
do_check_eq(aData.title, TEST_TITLE);
|
||||
do_check_eq(aData.url, TEST_URL);
|
||||
do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
|
||||
do_check_eq(aData.index, 0);
|
||||
run_next_test();
|
||||
});
|
||||
|
||||
let txn = PlacesUIUtils.makeTransaction(
|
||||
{ title: TEST_TITLE, uri: TEST_URL },
|
||||
PlacesUtils.TYPE_X_MOZ_URL,
|
||||
PlacesUtils.unfiledBookmarksFolderId,
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
true // Unused for text.
|
||||
);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
});
|
||||
|
||||
add_test(function test_container()
|
||||
{
|
||||
const TEST_TITLE = "Places folder"
|
||||
|
||||
waitForBookmarkNotification("onItemChanged", function(aData)
|
||||
{
|
||||
do_check_eq(aData.title, TEST_TITLE);
|
||||
do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_FOLDER);
|
||||
do_check_eq(aData.index, 1);
|
||||
|
||||
waitForBookmarkNotification("onItemAdded", function(aData)
|
||||
{
|
||||
do_check_eq(aData.title, TEST_TITLE);
|
||||
do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_FOLDER);
|
||||
do_check_eq(aData.index, 2);
|
||||
let id = aData.id;
|
||||
|
||||
waitForBookmarkNotification("onItemMoved", function(aData)
|
||||
{
|
||||
do_check_eq(aData.id, id);
|
||||
do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_FOLDER);
|
||||
do_check_eq(aData.index, 1);
|
||||
|
||||
run_next_test();
|
||||
});
|
||||
|
||||
let txn = PlacesUIUtils.makeTransaction(
|
||||
wrapNodeByIdAndParent(aData.id, PlacesUtils.unfiledBookmarksFolderId),
|
||||
0, // Unused for real nodes.
|
||||
PlacesUtils.unfiledBookmarksFolderId,
|
||||
1, // Move to position 1.
|
||||
false
|
||||
);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
});
|
||||
|
||||
try {
|
||||
let txn = PlacesUIUtils.makeTransaction(
|
||||
wrapNodeByIdAndParent(aData.id, PlacesUtils.unfiledBookmarksFolderId),
|
||||
0, // Unused for real nodes.
|
||||
PlacesUtils.unfiledBookmarksFolderId,
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
true
|
||||
);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
} catch(ex) {
|
||||
do_throw(ex);
|
||||
}
|
||||
}, "random-anno");
|
||||
|
||||
let id = PlacesUtils.bookmarks.createFolder(PlacesUtils.unfiledBookmarksFolderId,
|
||||
TEST_TITLE,
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX);
|
||||
PlacesUtils.annotations.setItemAnnotation(id, PlacesUIUtils.DESCRIPTION_ANNO,
|
||||
"description", 0,
|
||||
PlacesUtils.annotations.EXPIRE_NEVER);
|
||||
PlacesUtils.annotations.setItemAnnotation(id, "random-anno",
|
||||
"random-value", 0,
|
||||
PlacesUtils.annotations.EXPIRE_NEVER);
|
||||
});
|
||||
|
||||
|
||||
add_test(function test_separator()
|
||||
{
|
||||
waitForBookmarkNotification("onItemChanged", function(aData)
|
||||
{
|
||||
do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_SEPARATOR);
|
||||
do_check_eq(aData.index, 3);
|
||||
|
||||
waitForBookmarkNotification("onItemAdded", function(aData)
|
||||
{
|
||||
do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_SEPARATOR);
|
||||
do_check_eq(aData.index, 4);
|
||||
let id = aData.id;
|
||||
|
||||
waitForBookmarkNotification("onItemMoved", function(aData)
|
||||
{
|
||||
do_check_eq(aData.id, id);
|
||||
do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_SEPARATOR);
|
||||
do_check_eq(aData.index, 1);
|
||||
|
||||
run_next_test();
|
||||
});
|
||||
|
||||
let txn = PlacesUIUtils.makeTransaction(
|
||||
wrapNodeByIdAndParent(aData.id, PlacesUtils.unfiledBookmarksFolderId),
|
||||
0, // Unused for real nodes.
|
||||
PlacesUtils.unfiledBookmarksFolderId,
|
||||
1, // Move to position 1.
|
||||
false
|
||||
);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
});
|
||||
|
||||
try {
|
||||
let txn = PlacesUIUtils.makeTransaction(
|
||||
wrapNodeByIdAndParent(aData.id, PlacesUtils.unfiledBookmarksFolderId),
|
||||
0, // Unused for real nodes.
|
||||
PlacesUtils.unfiledBookmarksFolderId,
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
true
|
||||
);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
} catch(ex) {
|
||||
do_throw(ex);
|
||||
}
|
||||
}, "random-anno");
|
||||
|
||||
let id = PlacesUtils.bookmarks.insertSeparator(PlacesUtils.unfiledBookmarksFolderId,
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX);
|
||||
PlacesUtils.annotations.setItemAnnotation(id, "random-anno",
|
||||
"random-value", 0,
|
||||
PlacesUtils.annotations.EXPIRE_NEVER);
|
||||
});
|
||||
|
||||
add_test(function test_bookmark()
|
||||
{
|
||||
const TEST_URL = "http://places.moz.org/"
|
||||
const TEST_TITLE = "Places bookmark"
|
||||
|
||||
waitForBookmarkNotification("onItemChanged", function(aData)
|
||||
{
|
||||
do_check_eq(aData.title, TEST_TITLE);
|
||||
do_check_eq(aData.url, TEST_URL);
|
||||
do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
|
||||
do_check_eq(aData.index, 5);
|
||||
|
||||
waitForBookmarkNotification("onItemAdded", function(aData)
|
||||
{
|
||||
do_check_eq(aData.title, TEST_TITLE);
|
||||
do_check_eq(aData.url, TEST_URL);
|
||||
do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
|
||||
do_check_eq(aData.index, 6);
|
||||
let id = aData.id;
|
||||
|
||||
waitForBookmarkNotification("onItemMoved", function(aData)
|
||||
{
|
||||
do_check_eq(aData.id, id);
|
||||
do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
|
||||
do_check_eq(aData.index, 1);
|
||||
|
||||
run_next_test();
|
||||
});
|
||||
|
||||
let txn = PlacesUIUtils.makeTransaction(
|
||||
wrapNodeByIdAndParent(aData.id, PlacesUtils.unfiledBookmarksFolderId),
|
||||
0, // Unused for real nodes.
|
||||
PlacesUtils.unfiledBookmarksFolderId,
|
||||
1, // Move to position 1.
|
||||
false
|
||||
);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
});
|
||||
|
||||
try {
|
||||
let txn = PlacesUIUtils.makeTransaction(
|
||||
wrapNodeByIdAndParent(aData.id, PlacesUtils.unfiledBookmarksFolderId),
|
||||
0, // Unused for real nodes.
|
||||
PlacesUtils.unfiledBookmarksFolderId,
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
true
|
||||
);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
} catch(ex) {
|
||||
do_throw(ex);
|
||||
}
|
||||
}, "random-anno");
|
||||
|
||||
let id = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
|
||||
NetUtil.newURI(TEST_URL),
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
TEST_TITLE);
|
||||
PlacesUtils.annotations.setItemAnnotation(id, PlacesUIUtils.DESCRIPTION_ANNO,
|
||||
"description", 0,
|
||||
PlacesUtils.annotations.EXPIRE_NEVER);
|
||||
PlacesUtils.annotations.setItemAnnotation(id, "random-anno",
|
||||
"random-value", 0,
|
||||
PlacesUtils.annotations.EXPIRE_NEVER);
|
||||
});
|
||||
|
||||
add_test(function test_visit()
|
||||
{
|
||||
const TEST_URL = "http://places.moz.org/"
|
||||
const TEST_TITLE = "Places bookmark"
|
||||
|
||||
waitForBookmarkNotification("onItemAdded", function(aData)
|
||||
{
|
||||
do_check_eq(aData.title, TEST_TITLE);
|
||||
do_check_eq(aData.url, TEST_URL);
|
||||
do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
|
||||
do_check_eq(aData.index, 7);
|
||||
|
||||
waitForBookmarkNotification("onItemAdded", function(aData)
|
||||
{
|
||||
do_check_eq(aData.title, TEST_TITLE);
|
||||
do_check_eq(aData.url, TEST_URL);
|
||||
do_check_eq(aData.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
|
||||
do_check_eq(aData.index, 8);
|
||||
run_next_test();
|
||||
});
|
||||
|
||||
try {
|
||||
let node = wrapNodeByIdAndParent(aData.id, PlacesUtils.unfiledBookmarksFolderId);
|
||||
// Simulate a not-bookmarked node, will copy it to a new bookmark.
|
||||
node.id = -1;
|
||||
let txn = PlacesUIUtils.makeTransaction(
|
||||
node,
|
||||
0, // Unused for real nodes.
|
||||
PlacesUtils.unfiledBookmarksFolderId,
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
true
|
||||
);
|
||||
PlacesUtils.transactionManager.doTransaction(txn);
|
||||
} catch(ex) {
|
||||
do_throw(ex);
|
||||
}
|
||||
});
|
||||
|
||||
PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
|
||||
NetUtil.newURI(TEST_URL),
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
TEST_TITLE);
|
||||
});
|
||||
|
||||
add_test(function check_annotations() {
|
||||
// As last step check how many items for each annotation exist.
|
||||
|
||||
// Copies should retain the description annotation.
|
||||
let descriptions =
|
||||
PlacesUtils.annotations.getItemsWithAnnotation(PlacesUIUtils.DESCRIPTION_ANNO, {});
|
||||
do_check_eq(descriptions.length, 4);
|
||||
|
||||
// Only the original bookmarks should have this annotation.
|
||||
let others = PlacesUtils.annotations.getItemsWithAnnotation("random-anno", {});
|
||||
do_check_eq(others.length, 3);
|
||||
run_next_test();
|
||||
});
|
||||
|
||||
function run_test()
|
||||
{
|
||||
run_next_test();
|
||||
}
|
@ -20,4 +20,5 @@ tail =
|
||||
[test_clearHistory_shutdown.js]
|
||||
[test_leftpane_corruption_handling.js]
|
||||
[test_placesTxn.js]
|
||||
[test_PUIU_makeTransaction.js]
|
||||
[test_txnGUIDs.js]
|
||||
|
@ -1 +1 @@
|
||||
6.0a1
|
||||
7.0a1
|
||||
|
@ -41,9 +41,7 @@ MOZ_APP_VENDOR=Mozilla
|
||||
MOZ_UPDATER=1
|
||||
MOZ_PHOENIX=1
|
||||
|
||||
MOZ_ENABLE_LIBXUL=1
|
||||
MOZ_CHROME_FILE_FORMAT=omni
|
||||
MOZ_STATIC_BUILD_UNSUPPORTED=1
|
||||
# always enabled for form history
|
||||
MOZ_MORKREADER=1
|
||||
MOZ_SAFE_BROWSING=1
|
||||
|
@ -47,16 +47,7 @@ include $(topsrcdir)/config/rules.mk
|
||||
|
||||
MOZ_PKG_REMOVALS = $(srcdir)/removed-files.in
|
||||
|
||||
ifdef MOZ_ENABLE_LIBXUL
|
||||
MOZ_PKG_MANIFEST_P = $(srcdir)/package-manifest.in
|
||||
else
|
||||
define message
|
||||
You need to build with --enable-libxul (the default, unless you specify
|
||||
--disable-libxul or --enable-shared or --enable-debug) to package a build.
|
||||
endef
|
||||
default libs installer::
|
||||
$(error $(message))
|
||||
endif
|
||||
|
||||
MOZ_NONLOCALIZED_PKG_LIST = \
|
||||
xpcom \
|
||||
@ -127,8 +118,7 @@ GENERATE_CACHE = \
|
||||
rm -rf jsloader && \
|
||||
$(UNZIP) startupCache.zip && \
|
||||
rm startupCache.zip && \
|
||||
find jsloader | xargs touch -t 201001010000 && \
|
||||
$(ZIP) -r9mX omni.jar jsloader
|
||||
$(ZIP) -r9m omni.jar jsloader
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/toolkit/mozapps/installer/packager.mk
|
||||
|
@ -58,6 +58,7 @@
|
||||
#endif
|
||||
#ifdef XP_MACOSX
|
||||
@BINPATH@/@MOZ_CHILD_PROCESS_NAME@.app/
|
||||
@BINPATH@/@DLL_PREFIX@plugin_child_interpose@DLL_SUFFIX@
|
||||
#else
|
||||
@BINPATH@/@MOZ_CHILD_PROCESS_NAME@
|
||||
#endif
|
||||
|
@ -1277,21 +1277,13 @@ xpicleanup@BIN_SUFFIX@
|
||||
mozcrt19.dll
|
||||
#endif
|
||||
#endif
|
||||
#ifdef MOZ_ENABLE_LIBXUL
|
||||
@DLL_PREFIX@xpcom_core@DLL_SUFFIX@
|
||||
components/@DLL_PREFIX@jar50@DLL_SUFFIX@
|
||||
#ifdef XP_WIN
|
||||
components/xpinstal.dll
|
||||
#else
|
||||
components/@DLL_PREFIX@jsd@DLL_SUFFIX@
|
||||
components/@DLL_PREFIX@xpinstall@DLL_SUFFIX@
|
||||
#endif
|
||||
@DLL_PREFIX@xpcom_core@DLL_SUFFIX@
|
||||
components/@DLL_PREFIX@jar50@DLL_SUFFIX@
|
||||
#ifdef XP_WIN
|
||||
components/xpinstal.dll
|
||||
#else
|
||||
#ifdef XP_MACOSX
|
||||
XUL
|
||||
#else
|
||||
@DLL_PREFIX@xul@DLL_SUFFIX@
|
||||
#endif
|
||||
components/@DLL_PREFIX@jsd@DLL_SUFFIX@
|
||||
components/@DLL_PREFIX@xpinstall@DLL_SUFFIX@
|
||||
#endif
|
||||
#ifndef MOZ_UPDATER
|
||||
components/nsUpdateService.js
|
||||
|
@ -226,6 +226,9 @@ can reach it easily. -->
|
||||
<!ENTITY inspectObjectButton.label "Object">
|
||||
<!ENTITY inspectObjectButton.accesskey "O">
|
||||
|
||||
<!ENTITY getMoreDevtoolsCmd.label "Get More Tools">
|
||||
<!ENTITY getMoreDevtoolsCmd.accesskey "M">
|
||||
|
||||
<!ENTITY fileMenu.label "File">
|
||||
<!ENTITY fileMenu.accesskey "F">
|
||||
<!ENTITY newNavigatorCmd.label "New Window">
|
||||
|
@ -316,3 +316,10 @@ safeModeRestartButton=Restart
|
||||
# menu, set this to "true". Otherwise, you can leave it as "false".
|
||||
browser.menu.showCharacterEncoding=false
|
||||
|
||||
# LOCALIZATION NOTE (syncPromoNotification.bookmarks.label): This appears in
|
||||
# the add bookmark star panel. %S will be replaced by syncBrandShortName.
|
||||
syncPromoNotification.bookmarks.label=You can access your bookmarks on all your devices with %S.
|
||||
# LOCALIZATION NOTE (syncPromoNotification.passwords.label): This appears in
|
||||
# the remember password panel. %S will be replaced by syncBrandShortName.
|
||||
syncPromoNotification.passwords.label=You can access your passwords on all your devices with %S.
|
||||
syncPromoNotification.learnMoreLinkText=Learn More
|
||||
|
@ -1404,6 +1404,31 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
|
||||
min-width: 27em;
|
||||
}
|
||||
|
||||
.panel-promo-box {
|
||||
margin: 8px -10px -10px -10px;
|
||||
padding: 8px 16px;
|
||||
border-top: 1px solid ThreeDShadow;
|
||||
background-image: -moz-linear-gradient(hsla(0,0%,0%,.15), hsla(0,0%,0%,.08) 6px);
|
||||
}
|
||||
|
||||
.panel-promo-icon {
|
||||
list-style-image: url("chrome://browser/skin/sync-24.png");
|
||||
-moz-margin-end: 10px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.panel-promo-closebutton {
|
||||
list-style-image: url("moz-icon://stock/gtk-close?size=menu");
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
-moz-margin-end: -6px;
|
||||
}
|
||||
|
||||
.panel-promo-closebutton > .toolbarbutton-text {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* Content area */
|
||||
#sidebar {
|
||||
background-color: Window;
|
||||
|
@ -87,6 +87,7 @@ browser.jar:
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
skin/classic/browser/sync-16-throbber.png
|
||||
skin/classic/browser/sync-16.png
|
||||
skin/classic/browser/sync-24.png
|
||||
skin/classic/browser/sync-24-throbber.png
|
||||
skin/classic/browser/sync-32.png
|
||||
skin/classic/browser/sync-bg.png
|
||||
|
BIN
browser/themes/gnomestripe/browser/sync-24.png
Normal file
BIN
browser/themes/gnomestripe/browser/sync-24.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
@ -1394,6 +1394,47 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
|
||||
text-align: end;
|
||||
}
|
||||
|
||||
.panel-promo-box {
|
||||
margin: 8px -16px -16px -16px;
|
||||
padding: 8px 16px;
|
||||
background-color: hsla(0,0%,7%,.3);
|
||||
border-top: 1px solid hsla(0,0%,100%,.1);
|
||||
border-bottom-left-radius: 6px;
|
||||
border-bottom-right-radius: 6px;
|
||||
box-shadow: 0 1px 1px hsla(0,0%,0%,.25) inset;
|
||||
}
|
||||
|
||||
.panel-promo-message > .text-link {
|
||||
color: hsl(210,100%,75%);
|
||||
}
|
||||
|
||||
.panel-promo-icon {
|
||||
list-style-image: url("chrome://browser/skin/sync-24.png");
|
||||
-moz-margin-end: 10px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.panel-promo-closebutton {
|
||||
list-style-image: url("chrome://global/skin/notification/close.png");
|
||||
-moz-image-region: rect(0, 16px, 16px, 0);
|
||||
border: none;
|
||||
-moz-margin-end: -14px;
|
||||
margin-top: -8px;
|
||||
}
|
||||
|
||||
.panel-promo-closebutton:hover {
|
||||
-moz-image-region: rect(0, 32px, 16px, 16px);
|
||||
}
|
||||
|
||||
.panel-promo-closebutton:hover:active {
|
||||
-moz-image-region: rect(0, 48px, 16px, 32px);
|
||||
}
|
||||
|
||||
.panel-promo-closebutton > .toolbarbutton-text {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* ----- SIDEBAR ELEMENTS ----- */
|
||||
|
||||
#sidebar,
|
||||
|
@ -126,6 +126,7 @@ browser.jar:
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
skin/classic/browser/sync-throbber.png
|
||||
skin/classic/browser/sync-16.png
|
||||
skin/classic/browser/sync-24.png
|
||||
skin/classic/browser/sync-32.png
|
||||
skin/classic/browser/sync-bg.png
|
||||
skin/classic/browser/sync-desktopIcon.png
|
||||
|
BIN
browser/themes/pinstripe/browser/sync-24.png
Normal file
BIN
browser/themes/pinstripe/browser/sync-24.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
@ -31,6 +31,10 @@
|
||||
margin-top: -1px;
|
||||
-moz-margin-start: 1px;
|
||||
}
|
||||
|
||||
.panel-promo-message {
|
||||
font-style: italic;
|
||||
}
|
||||
}
|
||||
|
||||
@media all and (-moz-windows-default-theme) {
|
||||
|
@ -1515,6 +1515,46 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
|
||||
min-width: 27em;
|
||||
}
|
||||
|
||||
.panel-promo-box {
|
||||
margin: 8px -16px -16px -16px;
|
||||
padding: 8px 16px;
|
||||
background-color: #f1f5fb;
|
||||
color: GrayText;
|
||||
%ifndef WINSTRIPE_AERO
|
||||
border-bottom-left-radius: 6px;
|
||||
border-bottom-right-radius: 6px;
|
||||
%endif
|
||||
box-shadow: 0px 1px 2px rgb(204,214,234) inset;
|
||||
}
|
||||
|
||||
.panel-promo-icon {
|
||||
list-style-image: url("chrome://browser/skin/sync-24.png");
|
||||
-moz-margin-end: 10px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.panel-promo-closebutton {
|
||||
-moz-appearance: none;
|
||||
list-style-image: url("chrome://global/skin/icons/close.png");
|
||||
-moz-image-region: rect(0, 16px, 16px, 0);
|
||||
border: none;
|
||||
-moz-margin-end: -10px;
|
||||
margin-top: -5px;
|
||||
}
|
||||
|
||||
.panel-promo-closebutton:hover {
|
||||
-moz-image-region: rect(0, 32px, 16px, 16px);
|
||||
}
|
||||
|
||||
.panel-promo-closebutton:hover:active {
|
||||
-moz-image-region: rect(0, 48px, 16px, 32px);
|
||||
}
|
||||
|
||||
.panel-promo-closebutton > .toolbarbutton-text {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* ::::: content area ::::: */
|
||||
|
||||
#sidebar {
|
||||
|
@ -104,6 +104,7 @@ browser.jar:
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
skin/classic/browser/sync-throbber.png
|
||||
skin/classic/browser/sync-16.png
|
||||
skin/classic/browser/sync-24.png
|
||||
skin/classic/browser/sync-32.png
|
||||
skin/classic/browser/sync-bg.png
|
||||
skin/classic/browser/sync-desktopIcon.png
|
||||
@ -218,6 +219,7 @@ browser.jar:
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
skin/classic/aero/browser/sync-throbber.png
|
||||
skin/classic/aero/browser/sync-16.png
|
||||
skin/classic/aero/browser/sync-24.png
|
||||
skin/classic/aero/browser/sync-32.png
|
||||
skin/classic/aero/browser/sync-bg.png
|
||||
skin/classic/aero/browser/sync-desktopIcon.png
|
||||
|
BIN
browser/themes/winstripe/browser/sync-24.png
Normal file
BIN
browser/themes/winstripe/browser/sync-24.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
@ -122,10 +122,8 @@ ifdef WRAP_SYSTEM_INCLUDES
|
||||
export::
|
||||
if test ! -d system_wrappers; then mkdir system_wrappers; fi
|
||||
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) \
|
||||
-DBUILD_STATIC_LIBS=$(BUILD_STATIC_LIBS) \
|
||||
-DMOZ_TREE_CAIRO=$(MOZ_TREE_CAIRO) \
|
||||
-DMOZ_TREE_PIXMAN=$(MOZ_TREE_PIXMAN) \
|
||||
-DMOZ_ENABLE_LIBXUL=$(MOZ_ENABLE_LIBXUL) \
|
||||
-DMOZ_NATIVE_HUNSPELL=$(MOZ_NATIVE_HUNSPELL) \
|
||||
-DMOZ_NATIVE_BZ2=$(MOZ_NATIVE_BZ2) \
|
||||
-DMOZ_NATIVE_ZLIB=$(MOZ_NATIVE_ZLIB) \
|
||||
|
@ -124,8 +124,6 @@ STDCXX_COMPAT = @STDCXX_COMPAT@
|
||||
INCREMENTAL_LINKER = @INCREMENTAL_LINKER@
|
||||
MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@
|
||||
MOZ_MAIL_NEWS = @MOZ_MAIL_NEWS@
|
||||
BUILD_STATIC_LIBS = @BUILD_STATIC_LIBS@
|
||||
MOZ_ENABLE_LIBXUL = @MOZ_ENABLE_LIBXUL@
|
||||
ENABLE_TESTS = @ENABLE_TESTS@
|
||||
IBMBIDI = @IBMBIDI@
|
||||
MOZ_UNIVERSALCHARDET = @MOZ_UNIVERSALCHARDET@
|
||||
@ -455,11 +453,7 @@ ZLIB_LIBS = @ZLIB_LIBS@
|
||||
ZLIB_REQUIRES =
|
||||
else
|
||||
ZLIB_CFLAGS = @MOZ_ZLIB_CFLAGS@
|
||||
ifdef MOZ_ENABLE_LIBXUL
|
||||
MOZ_ZLIB_LIBS = @MOZ_ZLIB_LIBS@
|
||||
else
|
||||
ZLIB_LIBS = @MOZ_ZLIB_LIBS@
|
||||
endif
|
||||
ZLIB_REQUIRES = zlib
|
||||
endif
|
||||
|
||||
|
@ -245,35 +245,12 @@ endif # WINNT && !GNU_CC
|
||||
|
||||
#
|
||||
# Build using PIC by default
|
||||
# Do not use PIC if not building a shared lib (see exceptions below)
|
||||
#
|
||||
|
||||
ifndef BUILD_STATIC_LIBS
|
||||
_ENABLE_PIC=1
|
||||
endif
|
||||
ifneq (,$(FORCE_SHARED_LIB)$(FORCE_USE_PIC))
|
||||
_ENABLE_PIC=1
|
||||
endif
|
||||
|
||||
# If module is going to be merged into the nsStaticModule,
|
||||
# make sure that the entry points are translated and
|
||||
# the module is built static.
|
||||
|
||||
ifdef IS_COMPONENT
|
||||
ifdef EXPORT_LIBRARY
|
||||
ifneq (,$(BUILD_STATIC_LIBS))
|
||||
ifdef MODULE_NAME
|
||||
DEFINES += -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT=1
|
||||
FORCE_STATIC_LIB=1
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Determine if module being compiled is destined
|
||||
# to be merged into libxul
|
||||
|
||||
ifdef MOZ_ENABLE_LIBXUL
|
||||
ifdef LIBXUL_LIBRARY
|
||||
ifdef IS_COMPONENT
|
||||
ifdef MODULE_NAME
|
||||
@ -283,17 +260,14 @@ $(error Component makefile does not specify MODULE_NAME.)
|
||||
endif
|
||||
endif
|
||||
FORCE_STATIC_LIB=1
|
||||
_ENABLE_PIC=1
|
||||
SHORT_LIBNAME=
|
||||
endif
|
||||
endif
|
||||
|
||||
# If we are building this component into an extension/xulapp, it cannot be
|
||||
# statically linked. In the future we may want to add a xulapp meta-component
|
||||
# build option.
|
||||
|
||||
ifdef XPI_NAME
|
||||
_ENABLE_PIC=1
|
||||
ifdef IS_COMPONENT
|
||||
EXPORT_LIBRARY=
|
||||
FORCE_STATIC_LIB=
|
||||
@ -301,19 +275,6 @@ FORCE_SHARED_LIB=1
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# Disable PIC if necessary
|
||||
#
|
||||
|
||||
ifndef _ENABLE_PIC
|
||||
DSO_CFLAGS=
|
||||
ifeq ($(OS_ARCH)_$(HAVE_GCC3_ABI),Darwin_1)
|
||||
DSO_PIC_CFLAGS=-mdynamic-no-pic
|
||||
else
|
||||
DSO_PIC_CFLAGS=
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef SHARED_LIBRARY_NAME
|
||||
ifdef LIBRARY_NAME
|
||||
SHARED_LIBRARY_NAME=$(LIBRARY_NAME)
|
||||
@ -371,7 +332,6 @@ endif
|
||||
|
||||
# Force XPCOM/widget/gfx methods to be _declspec(dllexport) when we're
|
||||
# building libxul libraries
|
||||
ifdef MOZ_ENABLE_LIBXUL
|
||||
ifdef LIBXUL_LIBRARY
|
||||
DEFINES += \
|
||||
-D_IMPL_NS_COM \
|
||||
@ -388,20 +348,6 @@ ifndef JS_SHARED_LIBRARY
|
||||
DEFINES += -DSTATIC_EXPORTABLE_JS_API
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Force _all_ exported methods to be |_declspec(dllexport)| when we're
|
||||
# building them into the executable.
|
||||
|
||||
ifeq (,$(filter-out WINNT OS2, $(OS_ARCH)))
|
||||
ifdef BUILD_STATIC_LIBS
|
||||
DEFINES += \
|
||||
-D_IMPL_NS_GFX \
|
||||
-D_IMPL_NS_MSG_BASE \
|
||||
-D_IMPL_NS_WIDGET \
|
||||
$(NULL)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Flags passed to JarMaker.py
|
||||
MAKE_JARS_FLAGS = \
|
||||
|
@ -10,4 +10,4 @@
|
||||
# hardcoded milestones in the tree from these two files.
|
||||
#--------------------------------------------------------
|
||||
|
||||
6.0a1
|
||||
7.0a1
|
||||
|
@ -201,10 +201,15 @@ def optimizejar(jar, outjar, inlog = None):
|
||||
readahead = struct.unpack("<I", jarblob.readAt(0, 4))[0]
|
||||
print("%s: startup data ends at byte %d" % (outjar, readahead));
|
||||
|
||||
total_stripped = 0;
|
||||
jarblob.offset = cdir_offset
|
||||
central_directory = []
|
||||
for i in range(0, dirend.cdir_entries):
|
||||
for i in range(0, dirend.cdir_entries):
|
||||
entry = jarblob.read_struct(cdir_entry)
|
||||
if entry.filename[-1:] == "/":
|
||||
total_stripped += len(entry.pack())
|
||||
else:
|
||||
total_stripped += entry.extrafield_size
|
||||
central_directory.append(entry)
|
||||
|
||||
reordered_count = 0
|
||||
@ -235,7 +240,7 @@ def optimizejar(jar, outjar, inlog = None):
|
||||
# This also lets us specify how many entries should be preread
|
||||
dirend.cdir_offset = 4
|
||||
# make room for central dir + end of dir + 4 extra bytes at front
|
||||
out_offset = dirend.cdir_offset + dirend.cdir_size + size_of(cdir_end)
|
||||
out_offset = dirend.cdir_offset + dirend.cdir_size + size_of(cdir_end) - total_stripped
|
||||
outfd.seek(out_offset)
|
||||
|
||||
cdir_data = ""
|
||||
@ -245,6 +250,19 @@ def optimizejar(jar, outjar, inlog = None):
|
||||
# read in the header twice..first for comparison, second time for convenience when writing out
|
||||
jarfile = jarblob.read_struct(local_file_header, entry.offset)
|
||||
assert_true(jarfile.filename == entry.filename, "Directory/Localheader mismatch")
|
||||
# drop directory entries
|
||||
if entry.filename[-1:] == "/":
|
||||
total_stripped += len(jarfile.pack())
|
||||
dirend.cdir_entries -= 1
|
||||
continue
|
||||
# drop extra field data
|
||||
else:
|
||||
total_stripped += jarfile.extra_field_size;
|
||||
entry.extrafield = jarfile.extra_field = ""
|
||||
entry.extrafield_size = jarfile.extra_field_size = 0
|
||||
# January 1st, 2010
|
||||
entry.lastmod_date = jarfile.lastmod_date = ((2010 - 1980) << 9) | (1 << 5) | 1
|
||||
entry.lastmod_time = jarfile.lastmod_time = 0
|
||||
data = jarfile.pack()
|
||||
outfd.write(data)
|
||||
old_entry_offset = entry.offset
|
||||
@ -270,11 +288,11 @@ def optimizejar(jar, outjar, inlog = None):
|
||||
if inlog is None:
|
||||
dirend.cdir_offset = out_offset
|
||||
|
||||
dirend.cdir_size = len(cdir_data)
|
||||
dirend_data = dirend.pack()
|
||||
assert_true(size_of(cdir_end) == len(dirend_data), "Failed to serialize directory end correctly. Serialized size;%d, expected:%d"%(len(dirend_data), size_of(cdir_end)));
|
||||
|
||||
outfd.seek(dirend.cdir_offset)
|
||||
assert_true(len(cdir_data) == dirend.cdir_size, "Failed to serialize central directory correctly. Serialized size;%d, expected:%d expected-size:%d" % (len(cdir_data), dirend.cdir_size, dirend.cdir_size - len(cdir_data)));
|
||||
outfd.write(cdir_data)
|
||||
outfd.write(dirend_data)
|
||||
|
||||
@ -286,6 +304,7 @@ def optimizejar(jar, outjar, inlog = None):
|
||||
outfd.seek(out_offset)
|
||||
outfd.write(dirend_data)
|
||||
|
||||
print "Stripped %d bytes" % total_stripped
|
||||
print "%s %d/%d in %s" % (("Ordered" if inlog is not None else "Deoptimized"),
|
||||
reordered_count, len(central_directory), outjar)
|
||||
outfd.close()
|
||||
@ -296,20 +315,15 @@ if len(sys.argv) != 5:
|
||||
exit(1)
|
||||
|
||||
def optimize(JAR_LOG_DIR, IN_JAR_DIR, OUT_JAR_DIR):
|
||||
if not os.path.exists(JAR_LOG_DIR):
|
||||
print("No jar logs found in %s. No jars to optimize." % JAR_LOG_DIR)
|
||||
exit(0)
|
||||
|
||||
ls = os.listdir(JAR_LOG_DIR)
|
||||
for logfile in ls:
|
||||
if not logfile.endswith(".jar.log"):
|
||||
ls = os.listdir(IN_JAR_DIR)
|
||||
for jarfile in ls:
|
||||
if not jarfile.endswith(".jar"):
|
||||
continue
|
||||
injarfile = os.path.join(IN_JAR_DIR, logfile[:-4])
|
||||
outjarfile = os.path.join(OUT_JAR_DIR, logfile[:-4])
|
||||
if not os.path.exists(injarfile):
|
||||
print "Warning: Skipping %s, %s doesn't exist" % (logfile, injarfile)
|
||||
continue
|
||||
logfile = os.path.join(JAR_LOG_DIR, logfile)
|
||||
injarfile = os.path.join(IN_JAR_DIR, jarfile)
|
||||
outjarfile = os.path.join(OUT_JAR_DIR, jarfile)
|
||||
logfile = os.path.join(JAR_LOG_DIR, jarfile + ".log")
|
||||
if not os.path.isfile(logfile):
|
||||
logfile = None
|
||||
optimizejar(injarfile, outjarfile, logfile)
|
||||
|
||||
def deoptimize(JAR_LOG_DIR, IN_JAR_DIR, OUT_JAR_DIR):
|
||||
|
@ -216,7 +216,7 @@ endif # ENABLE_TESTS
|
||||
#
|
||||
# Library rules
|
||||
#
|
||||
# If BUILD_STATIC_LIBS or FORCE_STATIC_LIB is set, build a static library.
|
||||
# If FORCE_STATIC_LIB is set, build a static library.
|
||||
# Otherwise, build a shared library.
|
||||
#
|
||||
|
||||
@ -239,7 +239,7 @@ endif
|
||||
endif
|
||||
|
||||
ifdef LIBRARY
|
||||
ifneq (_1,$(FORCE_SHARED_LIB)_$(BUILD_STATIC_LIBS))
|
||||
ifdef FORCE_SHARED_LIB
|
||||
ifdef MKSHLIB
|
||||
|
||||
ifdef LIB_IS_C_ONLY
|
||||
@ -266,24 +266,12 @@ ifeq ($(OS_ARCH),OS2)
|
||||
DEF_FILE := $(SHARED_LIBRARY:.dll=.def)
|
||||
endif
|
||||
|
||||
ifdef MOZ_ENABLE_LIBXUL
|
||||
EMBED_MANIFEST_AT=2
|
||||
endif
|
||||
|
||||
endif # MKSHLIB
|
||||
endif # FORCE_SHARED_LIB && !BUILD_STATIC_LIBS
|
||||
endif # FORCE_SHARED_LIB
|
||||
endif # LIBRARY
|
||||
|
||||
ifeq (,$(BUILD_STATIC_LIBS)$(FORCE_STATIC_LIB))
|
||||
LIBRARY := $(NULL)
|
||||
endif
|
||||
|
||||
ifeq (_1,$(FORCE_SHARED_LIB)_$(BUILD_STATIC_LIBS))
|
||||
SHARED_LIBRARY := $(NULL)
|
||||
DEF_FILE := $(NULL)
|
||||
IMPORT_LIBRARY := $(NULL)
|
||||
endif
|
||||
|
||||
ifdef FORCE_STATIC_LIB
|
||||
ifndef FORCE_SHARED_LIB
|
||||
SHARED_LIBRARY := $(NULL)
|
||||
@ -294,7 +282,7 @@ endif
|
||||
|
||||
ifdef FORCE_SHARED_LIB
|
||||
ifndef FORCE_STATIC_LIB
|
||||
LIBRARY := $(NULL)
|
||||
LIBRARY := $(NULL)
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -785,12 +773,6 @@ export::
|
||||
ifdef LIBRARY_NAME
|
||||
ifdef EXPORT_LIBRARY
|
||||
ifdef IS_COMPONENT
|
||||
ifdef BUILD_STATIC_LIBS
|
||||
@$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_LINK_COMPS) $(STATIC_LIBRARY_NAME)
|
||||
ifdef MODULE_NAME
|
||||
@$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_LINK_COMP_NAMES) $(MODULE_NAME)
|
||||
endif
|
||||
endif # BUILD_STATIC_LIBS
|
||||
else # !IS_COMPONENT
|
||||
$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_LINK_LIBS) $(STATIC_LIBRARY_NAME)
|
||||
endif # IS_COMPONENT
|
||||
|
@ -1,119 +0,0 @@
|
||||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Netscape Communications Corporation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 1998
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
# Static components makefile
|
||||
# Include this makefile after config/config.mk & before config/rules.mk
|
||||
# This makefile will provide the defines for statically linking
|
||||
# all of the components into the binary.
|
||||
|
||||
STATIC_CPPSRCS += nsStaticComponents.cpp
|
||||
STATIC_DEFINES += -D_BUILD_STATIC_BIN=1
|
||||
STATIC_REQUIRES += \
|
||||
xpcom \
|
||||
string \
|
||||
$(NULL)
|
||||
|
||||
STATIC_EXTRA_LIBS += \
|
||||
$(addsuffix .$(LIB_SUFFIX),$(addprefix $(DEPTH)/staticlib/components/$(LIB_PREFIX),$(shell cat $(FINAL_LINK_COMPS)))) \
|
||||
$(addsuffix .$(LIB_SUFFIX),$(addprefix $(DEPTH)/staticlib/$(LIB_PREFIX),$(shell cat $(FINAL_LINK_LIBS)))) \
|
||||
$(NULL)
|
||||
|
||||
STATIC_COMPONENT_LIST = $(shell cat $(FINAL_LINK_COMP_NAMES))
|
||||
|
||||
STATIC_EXTRA_DEPS += $(FINAL_LINK_COMPS) $(FINAL_LINK_LIBS) $(addsuffix .$(LIB_SUFFIX),$(addprefix $(DEPTH)/staticlib/components/$(LIB_PREFIX),$(shell cat $(FINAL_LINK_COMPS)))) $(addsuffix .$(LIB_SUFFIX),$(addprefix $(DEPTH)/staticlib/$(LIB_PREFIX),$(shell cat $(FINAL_LINK_LIBS))))
|
||||
|
||||
STATIC_EXTRA_DEPS += \
|
||||
$(topsrcdir)/config/static-config.mk \
|
||||
$(topsrcdir)/config/static-rules.mk \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_PSM
|
||||
STATIC_EXTRA_DEPS += $(NSS_DEP_LIBS)
|
||||
endif
|
||||
|
||||
STATIC_EXTRA_LIBS += \
|
||||
$(PNG_LIBS) \
|
||||
$(JPEG_LIBS) \
|
||||
$(ZLIB_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_PSM
|
||||
STATIC_EXTRA_LIBS += \
|
||||
$(NSS_LIBS) \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
STATIC_EXTRA_LIBS += $(MOZ_CAIRO_LIBS)
|
||||
|
||||
STATIC_EXTRA_LIBS += $(QCMS_LIBS)
|
||||
|
||||
ifdef MOZ_ENABLE_GTK2
|
||||
STATIC_EXTRA_LIBS += $(XLDFLAGS) $(XT_LIBS) -lgthread-2.0
|
||||
STATIC_EXTRA_LIBS += $(MOZ_PANGO_LIBS)
|
||||
endif
|
||||
|
||||
ifdef MOZ_STORAGE
|
||||
STATIC_EXTRA_LIBS += $(SQLITE_LIBS)
|
||||
endif
|
||||
|
||||
ifdef MOZ_ENABLE_STARTUP_NOTIFICATION
|
||||
STATIC_EXTRA_LIBS += $(MOZ_STARTUP_NOTIFICATION_LIBS)
|
||||
endif
|
||||
|
||||
ifdef MOZ_SYDNEYAUDIO
|
||||
ifeq ($(OS_ARCH),Linux)
|
||||
STATIC_EXTRA_LIBS += $(MOZ_ALSA_LIBS)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Component Makefile always brings in this.
|
||||
# STATIC_EXTRA_LIBS += $(TK_LIBS)
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
STATIC_EXTRA_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool imm32)
|
||||
# XXX temporary workaround until link ordering issue is solved
|
||||
ifdef GNU_CC
|
||||
STATIC_EXTRA_LIBS += $(call EXPAND_LIBNAME,winmm wsock32 gdi32)
|
||||
endif
|
||||
STATIC_EXTRA_LIBS += $(call EXPAND_LIBNAME, usp10)
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),AIX)
|
||||
STATIC_EXTRA_LIBS += $(call EXPAND_LIBNAME,odm cfg)
|
||||
endif
|
||||
|
||||
LOCAL_INCLUDES += -I$(topsrcdir)/config
|
@ -1,25 +0,0 @@
|
||||
|
||||
ifdef _NO_AUTO_VARS
|
||||
_TARGET = $(srcdir)/$(@F)
|
||||
else
|
||||
_TARGET = $@
|
||||
endif
|
||||
|
||||
$(warning FINAL_LINK_COMP_NAMES = $(FINAL_LINK_COMP_NAMES))
|
||||
$(warning FINAL_LINK_COMPS = $(FINAL_LINK_COMPS))
|
||||
|
||||
nsStaticComponents.cpp: $(topsrcdir)/config/nsStaticComponents.cpp.in $(GLOBAL_DEPS) $(FINAL_LINK_COMP_NAMES)
|
||||
rm -f $@
|
||||
cat $< | \
|
||||
sed -e "s|%MODULE_LIST%|$(foreach m, $(STATIC_COMPONENT_LIST),MODULE($(m)))|" \
|
||||
> $(_TARGET)
|
||||
|
||||
GARBAGE += nsStaticComponents.cpp
|
||||
|
||||
ifeq ($(OS_ARCH),IRIX)
|
||||
LDFLAGS += -Wl,-LD_LAYOUT:lgot_buffer=80
|
||||
endif
|
||||
|
||||
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
||||
LIBS += -framework QuickTime -framework IOKit -lcrypto
|
||||
endif
|
@ -70,9 +70,6 @@ bstring.h
|
||||
builtin.h
|
||||
Button.h
|
||||
byteswap.h
|
||||
#if MOZ_ENABLE_LIBXUL!=1
|
||||
#define WRAP_CAIRO_HEADERS
|
||||
#endif
|
||||
#if MOZ_TREE_CAIRO!=1
|
||||
#define WRAP_CAIRO_HEADERS
|
||||
#endif
|
||||
@ -994,15 +991,6 @@ png.h
|
||||
#if MOZ_NATIVE_ZLIB==1
|
||||
zlib.h
|
||||
#endif
|
||||
#if MOZ_ENABLE_LIBXUL!=1
|
||||
#if BUILD_STATIC_LIBS!=1
|
||||
#define WRAP_LCMS_HEADERS
|
||||
#endif
|
||||
#endif
|
||||
#ifdef WRAP_LCMS_HEADERS
|
||||
icc34.h
|
||||
lcms.h
|
||||
#endif
|
||||
#ifdef MOZ_ENABLE_STARTUP_NOTIFICATION
|
||||
libsn/sn.h
|
||||
libsn/sn-common.h
|
||||
|
48
configure.in
48
configure.in
@ -4433,8 +4433,6 @@ dnl =
|
||||
dnl ========================================================
|
||||
MOZ_ARG_HEADER(External Packages)
|
||||
|
||||
MOZ_ENABLE_LIBXUL=1
|
||||
|
||||
MOZ_ARG_WITH_STRING(libxul-sdk,
|
||||
[ --with-libxul-sdk=PFX Use the libXUL SDK at <PFX>],
|
||||
LIBXUL_SDK_DIR=$withval)
|
||||
@ -4448,7 +4446,6 @@ elif test -n "$LIBXUL_SDK_DIR" -a "$LIBXUL_SDK_DIR" != "no"; then
|
||||
AC_MSG_ERROR([$LIBXUL_SDK/include/xpcom-config.h doesn't exist])
|
||||
fi
|
||||
|
||||
MOZ_ENABLE_LIBXUL=1
|
||||
fi
|
||||
AC_SUBST(LIBXUL_SDK)
|
||||
|
||||
@ -4465,10 +4462,6 @@ MOZ_ARG_WITH_BOOL(system-libxul,
|
||||
[ --with-system-libxul Use system installed libxul SDK],
|
||||
SYSTEM_LIBXUL=1)
|
||||
|
||||
if test -n "$SYSTEM_LIBXUL" -a -z "$MOZ_ENABLE_LIBXUL"; then
|
||||
AC_MSG_ERROR([--with-system-libxul needs --with-libxul-sdk])
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl = If NSPR was not detected in the system,
|
||||
dnl = use the one in the source tree (mozilla/nsprpub)
|
||||
@ -4796,7 +4789,6 @@ dnl ========================================================
|
||||
|
||||
MOZ_ARG_HEADER(Application)
|
||||
|
||||
BUILD_STATIC_LIBS=
|
||||
ENABLE_TESTS=1
|
||||
MOZ_ACTIVEX_SCRIPTING_SUPPORT=
|
||||
MOZ_BRANDING_DIRECTORY=
|
||||
@ -6146,9 +6138,12 @@ if test -n "$MOZ_ANGLE"; then
|
||||
# Otherwise just take whatever comes first
|
||||
MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK' | head -n 1`
|
||||
fi
|
||||
echo "MOZ_DIRECTX_SDK_REG_KEY=$MOZ_DIRECTX_SDK_REG_KEY"
|
||||
MOZ_DIRECTX_SDK_PATH=`reg query "$MOZ_DIRECTX_SDK_REG_KEY" //v InstallPath | grep REG_SZ | sed 's/.*\([[a-zA-Z]]\)\\:\\\\/\\1\\:\\\\/'`
|
||||
echo "MOZ_DIRECTX_SDK_PATH=$MOZ_DIRECTX_SDK_PATH"
|
||||
|
||||
if test -n "`echo $MOZ_DIRECTX_SDK_REG_KEY | grep 'February 2010'`" ; then
|
||||
AC_MSG_WARN([Found the February 2010 DirectX SDK. This is too old. We now require the June 2010 DirectX SDK, or newer.])
|
||||
else
|
||||
MOZ_DIRECTX_SDK_PATH=`reg query "$MOZ_DIRECTX_SDK_REG_KEY" //v InstallPath | grep REG_SZ | sed 's/.*\([[a-zA-Z]]\)\\:\\\\/\\1\\:\\\\/'`
|
||||
fi
|
||||
|
||||
MOZ_ANGLE=
|
||||
|
||||
@ -6160,12 +6155,12 @@ if test -n "$MOZ_ANGLE"; then
|
||||
fi
|
||||
|
||||
if test -z "$MOZ_ANGLE" ; then
|
||||
AC_MSG_WARN([Couldn't find the DirectX SDK, needed for ANGLE. Please install it (February 2010 or newer). To explicitly build without ANGLE, reconfigure with --disable-angle.])
|
||||
AC_MSG_WARN([Couldn't find the DirectX SDK, needed for ANGLE. Please install it (June 2010 or newer). To explicitly build without ANGLE, reconfigure with --disable-angle.])
|
||||
AC_MSG_WARN([This will become an error in the future.])
|
||||
fi
|
||||
|
||||
if test -n "$MOZ_ANGLE" ; then
|
||||
# Get the SDK numeric version (e.g. 42 or 43) by looking at the dependencies of d3dx9.lib
|
||||
# Get the SDK numeric version (e.g. 43) by looking at the dependencies of d3dx9.lib
|
||||
MOZ_D3DX9_VERSION=`dumpbin //headers "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_DIRECTX_SDK_CPU_SUFFIX/d3dx9.lib | egrep d3dx9_[[0-9]][[0-9]]\.dll | head -n1 | sed 's/.*\([[0-9]][[0-9]]\).*/\\1/g'`
|
||||
|
||||
if test -z "$MOZ_D3DX9_VERSION" ; then
|
||||
@ -8101,22 +8096,6 @@ dnl =
|
||||
dnl ========================================================
|
||||
MOZ_ARG_HEADER(Static build options)
|
||||
|
||||
MOZ_ARG_ENABLE_BOOL(static,
|
||||
[ --enable-static Enable building internal static libs],
|
||||
BUILD_STATIC_LIBS=1,
|
||||
BUILD_STATIC_LIBS=)
|
||||
|
||||
MOZ_ENABLE_LIBXUL=1
|
||||
|
||||
MOZ_ARG_DISABLE_BOOL(libxul,
|
||||
[ --disable-libxul Disable building libxul (not supported)],
|
||||
MOZ_ENABLE_LIBXUL=,
|
||||
MOZ_ENABLE_LIBXUL=1)
|
||||
|
||||
if test -z "$MOZ_ENABLE_LIBXUL"; then
|
||||
AC_MSG_ERROR([--disable-libxul is no longer supported.])
|
||||
fi
|
||||
|
||||
# split JS out by default to avoid VS2005 PGO crash (bug 591836).
|
||||
if test "$OS_ARCH" = "WINNT" -a "$CPU_ARCH" != "x86_64" ; then
|
||||
ENABLE_SHARED_JS=1
|
||||
@ -8137,17 +8116,8 @@ else
|
||||
fi
|
||||
AC_SUBST(JS_SHARED_LIBRARY)
|
||||
|
||||
if test -n "$MOZ_STATIC_BUILD_UNSUPPORTED" -a -n "$BUILD_STATIC_LIBS"; then
|
||||
AC_MSG_ERROR([--enable-static is not supported for building $MOZ_BUILD_APP.])
|
||||
fi
|
||||
|
||||
if test -n "$MOZ_ENABLE_LIBXUL" -a -n "$BUILD_STATIC_LIBS"; then
|
||||
AC_MSG_ERROR([--enable-libxul is not compatible with --enable-static])
|
||||
fi
|
||||
|
||||
AC_SUBST(LIBXUL_LIBS)
|
||||
XPCOM_LIBS="$LIBXUL_LIBS"
|
||||
AC_DEFINE(MOZ_ENABLE_LIBXUL)
|
||||
|
||||
dnl ========================================================
|
||||
dnl =
|
||||
@ -8798,8 +8768,6 @@ AC_SUBST(JAR)
|
||||
|
||||
AC_SUBST(MOZ_PROFILELOCKING)
|
||||
|
||||
AC_SUBST(BUILD_STATIC_LIBS)
|
||||
AC_SUBST(MOZ_ENABLE_LIBXUL)
|
||||
AC_SUBST(ENABLE_TESTS)
|
||||
AC_SUBST(IBMBIDI)
|
||||
AC_SUBST(MOZ_UNIVERSALCHARDET)
|
||||
|
@ -928,7 +928,7 @@ public:
|
||||
/**
|
||||
* This method creates and dispatches a trusted event.
|
||||
* Works only with events which can be created by calling
|
||||
* nsIDOMDocumentEvent::CreateEvent() with parameter "Events".
|
||||
* nsIDOMDocument::CreateEvent() with parameter "Events".
|
||||
* @param aDoc The document which will be used to create the event.
|
||||
* @param aTarget The target of the event, should be QIable to
|
||||
* nsIDOMEventTarget.
|
||||
@ -949,7 +949,7 @@ public:
|
||||
* This method creates and dispatches a trusted event to the chrome
|
||||
* event handler.
|
||||
* Works only with events which can be created by calling
|
||||
* nsIDOMDocumentEvent::CreateEvent() with parameter "Events".
|
||||
* nsIDOMDocument::CreateEvent() with parameter "Events".
|
||||
* @param aDocument The document which will be used to create the event,
|
||||
* and whose window's chrome handler will be used to
|
||||
* dispatch the event.
|
||||
|
@ -82,7 +82,7 @@ interface nsIDOMFile : nsIDOMBlob
|
||||
};
|
||||
|
||||
[scriptable, uuid(c4a77171-039b-4f84-97f9-820fb51626af)]
|
||||
interface nsIDOMBlobBuilder : nsISupports
|
||||
interface nsIDOMMozBlobBuilder : nsISupports
|
||||
{
|
||||
nsIDOMBlob getBlob([optional] in DOMString contentType);
|
||||
[implicit_jscontext] void append(in jsval data);
|
||||
|
@ -115,7 +115,6 @@
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#ifdef MOZ_XTF
|
||||
#include "nsIXTFService.h"
|
||||
static NS_DEFINE_CID(kXTFServiceCID, NS_XTFSERVICE_CID);
|
||||
@ -3345,13 +3344,13 @@ nsresult GetEventAndTarget(nsIDocument* aDoc, nsISupports* aTarget,
|
||||
nsIDOMEvent** aEvent,
|
||||
nsIDOMEventTarget** aTargetOut)
|
||||
{
|
||||
nsCOMPtr<nsIDOMDocumentEvent> docEvent(do_QueryInterface(aDoc));
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(aDoc);
|
||||
nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(aTarget));
|
||||
NS_ENSURE_TRUE(docEvent && target, NS_ERROR_INVALID_ARG);
|
||||
NS_ENSURE_TRUE(domDoc && target, NS_ERROR_INVALID_ARG);
|
||||
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
nsresult rv =
|
||||
docEvent->CreateEvent(NS_LITERAL_STRING("Events"), getter_AddRefs(event));
|
||||
domDoc->CreateEvent(NS_LITERAL_STRING("Events"), getter_AddRefs(event));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(event));
|
||||
@ -5530,11 +5529,11 @@ nsContentUtils::DispatchXULCommand(nsIContent* aTarget,
|
||||
{
|
||||
NS_ENSURE_STATE(aTarget);
|
||||
nsIDocument* doc = aTarget->GetOwnerDoc();
|
||||
nsCOMPtr<nsIDOMDocumentEvent> docEvent = do_QueryInterface(doc);
|
||||
NS_ENSURE_STATE(docEvent);
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(doc);
|
||||
NS_ENSURE_STATE(domDoc);
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
docEvent->CreateEvent(NS_LITERAL_STRING("xulcommandevent"),
|
||||
getter_AddRefs(event));
|
||||
domDoc->CreateEvent(NS_LITERAL_STRING("xulcommandevent"),
|
||||
getter_AddRefs(event));
|
||||
nsCOMPtr<nsIDOMXULCommandEvent> xulCommand = do_QueryInterface(event);
|
||||
nsCOMPtr<nsIPrivateDOMEvent> pEvent = do_QueryInterface(xulCommand);
|
||||
NS_ENSURE_STATE(pEvent);
|
||||
|
@ -221,7 +221,7 @@ nsDOMMultipartBlob::MozSlice(PRInt64 aStart, PRInt64 aEnd,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
class nsDOMBlobBuilder : public nsIDOMBlobBuilder
|
||||
class nsDOMBlobBuilder : public nsIDOMMozBlobBuilder
|
||||
{
|
||||
public:
|
||||
nsDOMBlobBuilder()
|
||||
@ -229,7 +229,7 @@ public:
|
||||
{}
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIDOMBLOBBUILDER
|
||||
NS_DECL_NSIDOMMOZBLOBBUILDER
|
||||
protected:
|
||||
nsresult AppendVoidPtr(void* aData, PRUint32 aLength);
|
||||
nsresult AppendString(JSString* aString, JSContext* aCx);
|
||||
@ -287,7 +287,7 @@ DOMCI_DATA(MozBlobBuilder, nsDOMBlobBuilder)
|
||||
NS_IMPL_ADDREF(nsDOMBlobBuilder)
|
||||
NS_IMPL_RELEASE(nsDOMBlobBuilder)
|
||||
NS_INTERFACE_MAP_BEGIN(nsDOMBlobBuilder)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMBlobBuilder)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMMozBlobBuilder)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MozBlobBuilder)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
@ -271,7 +271,7 @@ NS_IMETHODIMP
|
||||
nsDOMFileReader::Abort()
|
||||
{
|
||||
if (mReadyState != nsIDOMFileReader::LOADING)
|
||||
return NS_OK;
|
||||
return NS_ERROR_DOM_FILE_ABORT_ERR;
|
||||
|
||||
//Clear progress and file data
|
||||
mProgressEventWasDelayed = PR_FALSE;
|
||||
|
@ -1685,7 +1685,6 @@ NS_INTERFACE_TABLE_HEAD(nsDocument)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_DOCUMENT_INTERFACE_TABLE_BEGIN(nsDocument)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDocument)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOM3DocumentEvent)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocumentStyle)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMNSDocumentStyle)
|
||||
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMDocumentXBL)
|
||||
@ -4130,14 +4129,13 @@ nsDocument::DispatchContentLoadedEvents()
|
||||
if (target_frame) {
|
||||
nsCOMPtr<nsIDocument> parent = mParentDocument;
|
||||
do {
|
||||
nsCOMPtr<nsIDOMDocumentEvent> document_event =
|
||||
do_QueryInterface(parent);
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(parent);
|
||||
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
nsCOMPtr<nsIPrivateDOMEvent> privateEvent;
|
||||
if (document_event) {
|
||||
document_event->CreateEvent(NS_LITERAL_STRING("Events"),
|
||||
getter_AddRefs(event));
|
||||
if (domDoc) {
|
||||
domDoc->CreateEvent(NS_LITERAL_STRING("Events"),
|
||||
getter_AddRefs(event));
|
||||
|
||||
privateEvent = do_QueryInterface(event);
|
||||
}
|
||||
@ -6360,19 +6358,6 @@ nsDocument::CreateEvent(const nsAString& aEventType, nsIDOMEvent** aReturn)
|
||||
aEventType, aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocument::CreateEventGroup(nsIDOMEventGroup **aInstancePtrResult)
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIDOMEventGroup> group(do_CreateInstance(kDOMEventGroupCID, &rv));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
*aInstancePtrResult = group;
|
||||
NS_ADDREF(*aInstancePtrResult);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsDocument::FlushPendingNotifications(mozFlushType aType)
|
||||
{
|
||||
|
@ -69,8 +69,6 @@
|
||||
#include "nsIParser.h"
|
||||
#include "nsBindingManager.h"
|
||||
#include "nsINodeInfo.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOM3DocumentEvent.h"
|
||||
#include "nsHashtable.h"
|
||||
#include "nsInterfaceHashtable.h"
|
||||
#include "nsIBoxObject.h"
|
||||
@ -493,8 +491,6 @@ protected:
|
||||
class nsDocument : public nsIDocument,
|
||||
public nsIDOMXMLDocument, // inherits nsIDOMDocument
|
||||
public nsIDOMNSDocument,
|
||||
public nsIDOMDocumentEvent,
|
||||
public nsIDOM3DocumentEvent,
|
||||
public nsIDOMNSDocumentStyle,
|
||||
public nsIDOMDocumentXBL,
|
||||
public nsSupportsWeakReference,
|
||||
@ -798,12 +794,6 @@ public:
|
||||
// nsIDOMNSDocument
|
||||
NS_DECL_NSIDOMNSDOCUMENT
|
||||
|
||||
// nsIDOMDocumentEvent
|
||||
NS_DECL_NSIDOMDOCUMENTEVENT
|
||||
|
||||
// nsIDOM3DocumentEvent
|
||||
NS_DECL_NSIDOM3DOCUMENTEVENT
|
||||
|
||||
// nsIDOMDocumentStyle
|
||||
NS_DECL_NSIDOMDOCUMENTSTYLE
|
||||
|
||||
@ -1252,7 +1242,6 @@ protected:
|
||||
NS_NODE_OFFSET_AND_INTERFACE_TABLE_BEGIN(_class) \
|
||||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocument, nsDocument) \
|
||||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMNSDocument, nsDocument) \
|
||||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocumentEvent, nsDocument) \
|
||||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMEventTarget, nsDocument) \
|
||||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMNode, nsDocument)
|
||||
|
||||
|
@ -1339,10 +1339,33 @@ nsEventSource::DispatchAllMessageEvents()
|
||||
return;
|
||||
}
|
||||
|
||||
// Let's play get the JSContext
|
||||
nsCOMPtr<nsIScriptGlobalObject> sgo = do_QueryInterface(mOwner);
|
||||
NS_ENSURE_TRUE(sgo,);
|
||||
|
||||
nsIScriptContext* scriptContext = sgo->GetContext();
|
||||
NS_ENSURE_TRUE(scriptContext,);
|
||||
|
||||
JSContext* cx = (JSContext*)scriptContext->GetNativeContext();
|
||||
NS_ENSURE_TRUE(cx,);
|
||||
|
||||
while (mMessagesToDispatch.GetSize() > 0) {
|
||||
nsAutoPtr<Message>
|
||||
message(static_cast<Message*>(mMessagesToDispatch.PopFront()));
|
||||
|
||||
// Now we can turn our string into a jsval
|
||||
jsval jsData;
|
||||
{
|
||||
JSString* jsString;
|
||||
JSAutoRequest ar(cx);
|
||||
jsString = JS_NewUCStringCopyN(cx,
|
||||
message->mData.get(),
|
||||
message->mData.Length());
|
||||
NS_ENSURE_TRUE(jsString,);
|
||||
|
||||
jsData = STRING_TO_JSVAL(jsString);
|
||||
}
|
||||
|
||||
// create an event that uses the MessageEvent interface,
|
||||
// which does not bubble, is not cancelable, and has no default action
|
||||
|
||||
@ -1356,7 +1379,7 @@ nsEventSource::DispatchAllMessageEvents()
|
||||
nsCOMPtr<nsIDOMMessageEvent> messageEvent = do_QueryInterface(event);
|
||||
rv = messageEvent->InitMessageEvent(message->mEventName,
|
||||
PR_FALSE, PR_FALSE,
|
||||
message->mData,
|
||||
jsData,
|
||||
NS_ConvertUTF8toUTF16(mOrigin),
|
||||
message->mLastEventID, nsnull);
|
||||
if (NS_FAILED(rv)) {
|
||||
|
@ -50,7 +50,7 @@
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMDataContainerEvent.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIExternalProtocolHandler.h"
|
||||
#include "nsEventStates.h"
|
||||
@ -257,16 +257,16 @@ nsPluginCrashedEvent::Run()
|
||||
LOG(("OBJLC []: Firing plugin crashed event for content %p\n",
|
||||
mContent.get()));
|
||||
|
||||
nsCOMPtr<nsIDOMDocumentEvent> domEventDoc =
|
||||
nsCOMPtr<nsIDOMDocument> domDoc =
|
||||
do_QueryInterface(mContent->GetDocument());
|
||||
if (!domEventDoc) {
|
||||
if (!domDoc) {
|
||||
NS_WARNING("Couldn't get document for PluginCrashed event!");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
domEventDoc->CreateEvent(NS_LITERAL_STRING("datacontainerevents"),
|
||||
getter_AddRefs(event));
|
||||
domDoc->CreateEvent(NS_LITERAL_STRING("datacontainerevents"),
|
||||
getter_AddRefs(event));
|
||||
nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(event));
|
||||
nsCOMPtr<nsIDOMDataContainerEvent> containerEvent(do_QueryInterface(event));
|
||||
if (!privateEvent || !containerEvent) {
|
||||
|
@ -39,6 +39,7 @@
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsWebSocket.h"
|
||||
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIDocument.h"
|
||||
@ -57,7 +58,6 @@
|
||||
#include "nsICharsetConverterManager.h"
|
||||
#include "nsIUnicodeEncoder.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMMessageEvent.h"
|
||||
#include "nsIPromptFactory.h"
|
||||
#include "nsIWindowWatcher.h"
|
||||
@ -819,6 +819,31 @@ nsWebSocket::CreateAndDispatchMessageEvent(const nsACString& aData)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Let's play get the JSContext
|
||||
nsCOMPtr<nsIScriptGlobalObject> sgo = do_QueryInterface(mOwner);
|
||||
NS_ENSURE_TRUE(sgo, NS_ERROR_FAILURE);
|
||||
|
||||
nsIScriptContext* scriptContext = sgo->GetContext();
|
||||
NS_ENSURE_TRUE(scriptContext, NS_ERROR_FAILURE);
|
||||
|
||||
JSContext* cx = (JSContext*)scriptContext->GetNativeContext();
|
||||
NS_ENSURE_TRUE(cx, NS_ERROR_FAILURE);
|
||||
|
||||
// Now we can turn our string into a jsval
|
||||
|
||||
jsval jsData;
|
||||
{
|
||||
NS_ConvertUTF8toUTF16 utf16Data(aData);
|
||||
JSString* jsString;
|
||||
JSAutoRequest ar(cx);
|
||||
jsString = JS_NewUCStringCopyN(cx,
|
||||
utf16Data.get(),
|
||||
utf16Data.Length());
|
||||
NS_ENSURE_TRUE(jsString, NS_ERROR_FAILURE);
|
||||
|
||||
jsData = STRING_TO_JSVAL(jsString);
|
||||
}
|
||||
|
||||
// create an event that uses the MessageEvent interface,
|
||||
// which does not bubble, is not cancelable, and has no default action
|
||||
|
||||
@ -829,7 +854,7 @@ nsWebSocket::CreateAndDispatchMessageEvent(const nsACString& aData)
|
||||
nsCOMPtr<nsIDOMMessageEvent> messageEvent = do_QueryInterface(event);
|
||||
rv = messageEvent->InitMessageEvent(NS_LITERAL_STRING("message"),
|
||||
PR_FALSE, PR_FALSE,
|
||||
NS_ConvertUTF8toUTF16(aData),
|
||||
jsData,
|
||||
mUTF16Origin,
|
||||
EmptyString(), nsnull);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -23,10 +23,10 @@ var gen = runTest();
|
||||
function runTest() {
|
||||
var iframe = $('iframe');
|
||||
iframe.src = "http://noxul.example.com/tests/content/base/test/file_bug590870.html";
|
||||
is((yield), "true", "shouldn't be able to create XUL elements");
|
||||
is((yield), true, "shouldn't be able to create XUL elements");
|
||||
|
||||
iframe.src = "file_bug590870.html";
|
||||
is((yield), "false", "should be able to create XUL elements");
|
||||
is((yield), false, "should be able to create XUL elements");
|
||||
|
||||
SimpleTest.finish();
|
||||
yield;
|
||||
|
@ -22,7 +22,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=601803
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
window.onmessage = function (event) {
|
||||
is(event.data, "false", "Shouldn't throw when adopting a node cross-compartment");
|
||||
is(event.data, false, "Shouldn't throw when adopting a node cross-compartment");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
|
@ -259,7 +259,13 @@ r.onloadend = function (event) {
|
||||
r.onload = function() { ok(false, "load should not fire for aborted reads") };
|
||||
r.onerror = function() { ok(false, "error should not fire for aborted reads") };
|
||||
r.onprogress = function() { ok(false, "progress should not fire for aborted reads") };
|
||||
r.abort();
|
||||
var abortThrew = false;
|
||||
try {
|
||||
r.abort();
|
||||
} catch(e) {
|
||||
abortThrew = true;
|
||||
}
|
||||
is(abortThrew, true, "abort() must throw if not loading");
|
||||
is(abortHasRun, false, "abort() is a no-op unless loading");
|
||||
r.readAsText(asciiFile);
|
||||
r.abort();
|
||||
@ -277,7 +283,13 @@ r.onabort = function (event) {
|
||||
is(event.target.result, null, "file data should be null on aborted reads");
|
||||
}
|
||||
r.onload = function() { ok(false, "load should not fire for aborted reads") };
|
||||
r.abort();
|
||||
var abortThrew = false;
|
||||
try {
|
||||
r.abort();
|
||||
} catch(e) {
|
||||
abortThrew = true;
|
||||
}
|
||||
is(abortThrew, true, "abort() must throw if not loading");
|
||||
is(reuseAbortHasRun, false, "abort() is a no-op unless loading");
|
||||
r.readAsText(asciiFile);
|
||||
r.readAsText(asciiFile);
|
||||
|
@ -53,7 +53,6 @@
|
||||
#include "nsIVariant.h"
|
||||
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
|
@ -535,13 +535,13 @@ if (!gl) {
|
||||
// linkSuccess: false,
|
||||
// passMsg: 'shader that uses 257 character identifier should fail',
|
||||
//},
|
||||
{ vShaderId: 'vshader',
|
||||
vShaderSuccess: true,
|
||||
fShaderId: 'fshaderWith256CharacterIdentifier',
|
||||
fShaderSuccess: true,
|
||||
linkSuccess: true,
|
||||
passMsg: 'shader that uses 256 character identifier should succeed',
|
||||
},
|
||||
//{ vShaderId: 'vshader',
|
||||
// vShaderSuccess: true,
|
||||
// fShaderId: 'fshaderWith256CharacterIdentifier',
|
||||
// fShaderSuccess: true,
|
||||
// linkSuccess: true,
|
||||
// passMsg: 'shader that uses 256 character identifier should succeed',
|
||||
//},
|
||||
{ vShaderId: 'vshader',
|
||||
vShaderSuccess: true,
|
||||
fShaderId: 'fshaderWithLongLine',
|
||||
|
@ -38,17 +38,29 @@
|
||||
|
||||
#include "nsDOMMessageEvent.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "jsapi.h"
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMMessageEvent)
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsDOMMessageEvent, nsDOMEvent)
|
||||
if (tmp->mDataRooted) {
|
||||
tmp->UnrootData();
|
||||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mSource)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsDOMMessageEvent, nsDOMEvent)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mSource)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsDOMMessageEvent)
|
||||
if (JSVAL_IS_GCTHING(tmp->mData)) {
|
||||
void *gcThing = JSVAL_TO_GCTHING(tmp->mData);
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(gcThing, "mData")
|
||||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_END
|
||||
|
||||
DOMCI_DATA(MessageEvent, nsDOMMessageEvent)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMMessageEvent)
|
||||
@ -59,10 +71,41 @@ NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
|
||||
NS_IMPL_ADDREF_INHERITED(nsDOMMessageEvent, nsDOMEvent)
|
||||
NS_IMPL_RELEASE_INHERITED(nsDOMMessageEvent, nsDOMEvent)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMMessageEvent::GetData(nsAString& aData)
|
||||
nsDOMMessageEvent::nsDOMMessageEvent(nsPresContext* aPresContext,
|
||||
nsEvent* aEvent)
|
||||
: nsDOMEvent(aPresContext, aEvent),
|
||||
mData(JSVAL_VOID),
|
||||
mDataRooted(false)
|
||||
{
|
||||
aData = mData;
|
||||
}
|
||||
|
||||
nsDOMMessageEvent::~nsDOMMessageEvent()
|
||||
{
|
||||
if (mDataRooted)
|
||||
UnrootData();
|
||||
}
|
||||
|
||||
void
|
||||
nsDOMMessageEvent::RootData()
|
||||
{
|
||||
NS_ASSERTION(!mDataRooted, "...");
|
||||
NS_HOLD_JS_OBJECTS(this, nsDOMMessageEvent);
|
||||
mDataRooted = true;
|
||||
}
|
||||
|
||||
void
|
||||
nsDOMMessageEvent::UnrootData()
|
||||
{
|
||||
NS_ASSERTION(mDataRooted, "...");
|
||||
NS_DROP_JS_OBJECTS(this, nsDOMMessageEvent);
|
||||
mDataRooted = false;
|
||||
mData = JSVAL_VOID;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMMessageEvent::GetData(jsval* aData)
|
||||
{
|
||||
*aData = mData;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -91,7 +134,7 @@ NS_IMETHODIMP
|
||||
nsDOMMessageEvent::InitMessageEvent(const nsAString& aType,
|
||||
PRBool aCanBubble,
|
||||
PRBool aCancelable,
|
||||
const nsAString& aData,
|
||||
const jsval& aData,
|
||||
const nsAString& aOrigin,
|
||||
const nsAString& aLastEventId,
|
||||
nsIDOMWindow* aSource)
|
||||
@ -99,7 +142,12 @@ nsDOMMessageEvent::InitMessageEvent(const nsAString& aType,
|
||||
nsresult rv = nsDOMEvent::InitEvent(aType, aCanBubble, aCancelable);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// Allowing double-initialization seems a little silly, but we have a test
|
||||
// for it so it might be important ...
|
||||
if (mDataRooted)
|
||||
UnrootData();
|
||||
mData = aData;
|
||||
RootData();
|
||||
mOrigin = aOrigin;
|
||||
mLastEventId = aLastEventId;
|
||||
mSource = aSource;
|
||||
@ -113,8 +161,6 @@ NS_NewDOMMessageEvent(nsIDOMEvent** aInstancePtrResult,
|
||||
nsEvent* aEvent)
|
||||
{
|
||||
nsDOMMessageEvent* it = new nsDOMMessageEvent(aPresContext, aEvent);
|
||||
if (nsnull == it)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
return CallQueryInterface(it, aInstancePtrResult);
|
||||
}
|
||||
|
@ -54,21 +54,23 @@ class nsDOMMessageEvent : public nsDOMEvent,
|
||||
public nsIDOMMessageEvent
|
||||
{
|
||||
public:
|
||||
nsDOMMessageEvent(nsPresContext* aPresContext, nsEvent* aEvent)
|
||||
: nsDOMEvent(aPresContext, aEvent)
|
||||
{
|
||||
}
|
||||
nsDOMMessageEvent(nsPresContext* aPresContext, nsEvent* aEvent);
|
||||
~nsDOMMessageEvent();
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDOMMessageEvent, nsDOMEvent)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(nsDOMMessageEvent,
|
||||
nsDOMEvent)
|
||||
|
||||
NS_DECL_NSIDOMMESSAGEEVENT
|
||||
|
||||
// Forward to base class
|
||||
NS_FORWARD_TO_NSDOMEVENT
|
||||
|
||||
void RootData();
|
||||
void UnrootData();
|
||||
private:
|
||||
nsString mData;
|
||||
jsval mData;
|
||||
bool mDataRooted;
|
||||
nsString mOrigin;
|
||||
nsString mLastEventId;
|
||||
nsCOMPtr<nsIDOMWindow> mSource;
|
||||
|
@ -113,7 +113,6 @@
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsIMarkupDocumentViewer.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMMouseScrollEvent.h"
|
||||
#include "nsIDOMDragEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
@ -390,7 +389,8 @@ public:
|
||||
static PRUint32 GetTimeoutTime();
|
||||
static PRInt32 AccelerateWheelDelta(PRInt32 aScrollLines,
|
||||
PRBool aIsHorizontal, PRBool aAllowScrollSpeedOverride,
|
||||
nsIScrollableFrame::ScrollUnit *aScrollQuantity);
|
||||
nsIScrollableFrame::ScrollUnit *aScrollQuantity,
|
||||
PRBool aLimitToMaxOnePageScroll = PR_TRUE);
|
||||
static PRBool IsAccelerationEnabled();
|
||||
|
||||
enum {
|
||||
@ -518,8 +518,18 @@ nsMouseWheelTransaction::OnEvent(nsEvent* aEvent)
|
||||
return;
|
||||
}
|
||||
|
||||
switch (aEvent->message) {
|
||||
PRInt32 message = aEvent->message;
|
||||
// If the event is query scroll target info event, that causes modifying
|
||||
// wheel transaction because DoScrollText() needs to use them. Therefore,
|
||||
// we should handle the event as its mouse scroll event here.
|
||||
if (message == NS_QUERY_SCROLL_TARGET_INFO) {
|
||||
nsQueryContentEvent* queryEvent = static_cast<nsQueryContentEvent*>(aEvent);
|
||||
message = queryEvent->mInput.mMouseScrollEvent->message;
|
||||
}
|
||||
|
||||
switch (message) {
|
||||
case NS_MOUSE_SCROLL:
|
||||
case NS_MOUSE_PIXEL_SCROLL:
|
||||
if (sMouseMoved != 0 &&
|
||||
OutOfTime(sMouseMoved, GetIgnoreMoveDelayTime())) {
|
||||
// Terminate the current mousewheel transaction if the mouse moved more
|
||||
@ -662,7 +672,8 @@ PRInt32
|
||||
nsMouseWheelTransaction::AccelerateWheelDelta(PRInt32 aScrollLines,
|
||||
PRBool aIsHorizontal,
|
||||
PRBool aAllowScrollSpeedOverride,
|
||||
nsIScrollableFrame::ScrollUnit *aScrollQuantity)
|
||||
nsIScrollableFrame::ScrollUnit *aScrollQuantity,
|
||||
PRBool aLimitToMaxOnePageScroll)
|
||||
{
|
||||
if (aAllowScrollSpeedOverride) {
|
||||
aScrollLines = OverrideSystemScrollSpeed(aScrollLines, aIsHorizontal);
|
||||
@ -679,7 +690,8 @@ nsMouseWheelTransaction::AccelerateWheelDelta(PRInt32 aScrollLines,
|
||||
|
||||
// If the computed delta is larger than the page, we should limit
|
||||
// the delta value to the one page size.
|
||||
return LimitToOnePageScroll(aScrollLines, aIsHorizontal, aScrollQuantity);
|
||||
return !aLimitToMaxOnePageScroll ? aScrollLines :
|
||||
LimitToOnePageScroll(aScrollLines, aIsHorizontal, aScrollQuantity);
|
||||
}
|
||||
|
||||
PRInt32
|
||||
@ -2703,6 +2715,27 @@ nsEventStateManager::DoScrollText(nsIFrame* aTargetFrame,
|
||||
}
|
||||
|
||||
if (!passToParent && frameToScroll) {
|
||||
if (aScrollQuantity == nsIScrollableFrame::LINES) {
|
||||
// When this is called for querying the scroll target information,
|
||||
// we shouldn't limit the scrolling amount to less one page.
|
||||
// Otherwise, we shouldn't scroll more one page at once.
|
||||
numLines =
|
||||
nsMouseWheelTransaction::AccelerateWheelDelta(numLines, isHorizontal,
|
||||
aAllowScrollSpeedOverride,
|
||||
&aScrollQuantity,
|
||||
!aQueryEvent);
|
||||
}
|
||||
#ifdef DEBUG
|
||||
else {
|
||||
NS_ASSERTION(!aAllowScrollSpeedOverride,
|
||||
"aAllowScrollSpeedOverride is true but the quantity isn't by-line scrolling.");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (aScrollQuantity == nsIScrollableFrame::PAGES) {
|
||||
numLines = (numLines > 0) ? 1 : -1;
|
||||
}
|
||||
|
||||
if (aQueryEvent) {
|
||||
// If acceleration is enabled, pixel scroll shouldn't be used for
|
||||
// high resolution scrolling.
|
||||
@ -2718,34 +2751,23 @@ nsEventStateManager::DoScrollText(nsIFrame* aTargetFrame,
|
||||
frameToScroll->GetPageScrollAmount().height / appUnitsPerDevPixel;
|
||||
aQueryEvent->mReply.mPageWidth =
|
||||
frameToScroll->GetPageScrollAmount().width / appUnitsPerDevPixel;
|
||||
|
||||
// Returns computed numLines to widget which is needed to compute the
|
||||
// pixel scrolling amout for high resolution scrolling.
|
||||
aQueryEvent->mReply.mComputedScrollAmount = numLines;
|
||||
|
||||
aQueryEvent->mSucceeded = PR_TRUE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (aScrollQuantity == nsIScrollableFrame::LINES) {
|
||||
numLines =
|
||||
nsMouseWheelTransaction::AccelerateWheelDelta(numLines, isHorizontal,
|
||||
aAllowScrollSpeedOverride,
|
||||
&aScrollQuantity);
|
||||
}
|
||||
#ifdef DEBUG
|
||||
else {
|
||||
NS_ASSERTION(!aAllowScrollSpeedOverride,
|
||||
"aAllowScrollSpeedOverride is true but the quantity isn't by-line scrolling.");
|
||||
}
|
||||
#endif
|
||||
|
||||
PRInt32 scrollX = 0;
|
||||
PRInt32 scrollY = numLines;
|
||||
|
||||
if (aScrollQuantity == nsIScrollableFrame::PAGES)
|
||||
scrollY = (scrollY > 0) ? 1 : -1;
|
||||
|
||||
if (isHorizontal) {
|
||||
scrollX = scrollY;
|
||||
scrollY = 0;
|
||||
}
|
||||
|
||||
|
||||
nsIScrollableFrame::ScrollMode mode;
|
||||
if (aMouseEvent->scrollFlags & nsMouseScrollEvent::kNoDefer) {
|
||||
mode = nsIScrollableFrame::INSTANT;
|
||||
@ -2757,6 +2779,8 @@ nsEventStateManager::DoScrollText(nsIFrame* aTargetFrame,
|
||||
mode = nsIScrollableFrame::NORMAL;
|
||||
}
|
||||
|
||||
// XXX Why don't we limit the pixel scroll amount to less one page??
|
||||
|
||||
nsIntPoint overflow;
|
||||
frameToScroll->ScrollBy(nsIntPoint(scrollX, scrollY), aScrollQuantity,
|
||||
mode, &overflow);
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsEventDispatcher.h"
|
||||
|
@ -64,7 +64,6 @@
|
||||
#include "nsITimer.h"
|
||||
|
||||
#include "nsEventDispatcher.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMProgressEvent.h"
|
||||
|
||||
using namespace mozilla::dom;
|
||||
|
@ -52,7 +52,6 @@
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsParserUtils.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
@ -68,7 +68,6 @@
|
||||
#include "nsITimer.h"
|
||||
|
||||
#include "nsEventDispatcher.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsMediaError.h"
|
||||
#include "nsICategoryManager.h"
|
||||
#include "nsCharSeparatedTokenizer.h"
|
||||
@ -2250,13 +2249,13 @@ nsresult nsHTMLMediaElement::DispatchAudioAvailableEvent(float* aFrameBuffer,
|
||||
// which frees the memory when it's destroyed.
|
||||
nsAutoArrayPtr<float> frameBuffer(aFrameBuffer);
|
||||
|
||||
nsCOMPtr<nsIDOMDocumentEvent> docEvent(do_QueryInterface(GetOwnerDoc()));
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(GetOwnerDoc());
|
||||
nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(static_cast<nsIContent*>(this)));
|
||||
NS_ENSURE_TRUE(docEvent && target, NS_ERROR_INVALID_ARG);
|
||||
NS_ENSURE_TRUE(domDoc && target, NS_ERROR_INVALID_ARG);
|
||||
|
||||
nsCOMPtr<nsIDOMEvent> event;
|
||||
nsresult rv = docEvent->CreateEvent(NS_LITERAL_STRING("MozAudioAvailableEvent"),
|
||||
getter_AddRefs(event));
|
||||
nsresult rv = domDoc->CreateEvent(NS_LITERAL_STRING("MozAudioAvailableEvent"),
|
||||
getter_AddRefs(event));
|
||||
nsCOMPtr<nsIDOMNotifyAudioAvailableEvent> audioavailableEvent(do_QueryInterface(event));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
@ -57,7 +57,6 @@
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsIBoxObject.h"
|
||||
#include "nsIDOMNSDocument.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
|
||||
// Notify/query select frame for selectedIndex
|
||||
#include "nsIDocument.h"
|
||||
|
@ -61,7 +61,6 @@
|
||||
#include "nsITimer.h"
|
||||
|
||||
#include "nsEventDispatcher.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMProgressEvent.h"
|
||||
#include "nsMediaError.h"
|
||||
|
||||
|
@ -276,6 +276,7 @@ _TEST_FILES = \
|
||||
test_bug514437.html \
|
||||
test_bug560112.html \
|
||||
test_bug649134.html \
|
||||
test_bug658746.html \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_TEST_FILES)
|
||||
|
98
content/html/content/test/test_bug658746.html
Normal file
98
content/html/content/test/test_bug658746.html
Normal file
@ -0,0 +1,98 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=658746
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 658746</title>
|
||||
<script type="application/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=658746">Mozilla Bug 658746</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for Bug 658746 **/
|
||||
|
||||
/**
|
||||
* Sets property, gets property and deletes property.
|
||||
*/
|
||||
function SetGetDelete(prop)
|
||||
{
|
||||
var el = document.createElement('div');
|
||||
|
||||
el.dataset[prop] = 'aaaaaa';
|
||||
is(el.dataset[prop], 'aaaaaa', 'Dataset property "' + prop + '" should have been set.');
|
||||
|
||||
delete el.dataset[prop];
|
||||
is(el.dataset[prop], undefined, 'Dataset property"' + prop + '" should have been deleted.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets, deletes and sets property. Expects exception while trying to set property.
|
||||
*/
|
||||
function SetExpectException(prop)
|
||||
{
|
||||
var el = document.createElement('div');
|
||||
|
||||
is(el.dataset[prop], undefined, 'Dataset property "' + prop + '" should be undefined.');
|
||||
delete el.dataset[prop];
|
||||
|
||||
try {
|
||||
el.dataset[prop] = "xxxxxx";
|
||||
ok(false, 'Exception should have been thrown when setting "' + prop + '".');
|
||||
} catch (ex) {
|
||||
ok(true, 'Exception should have been thrown.');
|
||||
}
|
||||
}
|
||||
|
||||
// Numbers as properties.
|
||||
SetGetDelete(-12345678901234567980);
|
||||
SetGetDelete(-1);
|
||||
SetGetDelete(0);
|
||||
SetGetDelete(1);
|
||||
SetGetDelete(12345678901234567980);
|
||||
|
||||
// Floating point numbers as properties.
|
||||
SetGetDelete(-1.1);
|
||||
SetGetDelete(0.0);
|
||||
SetGetDelete(1.1);
|
||||
|
||||
// Hexadecimal numbers as properties.
|
||||
SetGetDelete(0x3);
|
||||
SetGetDelete(0xa);
|
||||
|
||||
// Octal numbers as properties.
|
||||
SetGetDelete(03);
|
||||
SetGetDelete(07);
|
||||
|
||||
// String numbers as properties.
|
||||
SetGetDelete('0');
|
||||
SetGetDelete('01');
|
||||
SetGetDelete('0x1');
|
||||
|
||||
// Undefined as property.
|
||||
SetGetDelete(undefined);
|
||||
|
||||
// Empty arrays as properties.
|
||||
SetGetDelete(new Array());
|
||||
SetGetDelete([]);
|
||||
|
||||
// Non-empty array and object as properties.
|
||||
SetExpectException(['a', 'b']);
|
||||
SetExpectException({'a':'b'});
|
||||
|
||||
// Objects as properties.
|
||||
SetExpectException(new Object());
|
||||
SetExpectException(document);
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -72,7 +72,7 @@ nsresult nsRawReader::ReadMetadata(nsVideoInfo* aInfo)
|
||||
{
|
||||
NS_ASSERTION(mDecoder->OnStateMachineThread(),
|
||||
"Should be on state machine thread.");
|
||||
mozilla::MonitorAutoEnter autoEnter(mMonitor);
|
||||
mozilla::ReentrantMonitorAutoEnter autoEnter(mReentrantMonitor);
|
||||
|
||||
nsMediaStream* stream = mDecoder->GetCurrentStream();
|
||||
NS_ASSERTION(stream, "Decoder has no media stream");
|
||||
@ -126,8 +126,8 @@ nsresult nsRawReader::ReadMetadata(nsVideoInfo* aInfo)
|
||||
|
||||
PRInt64 length = stream->GetLength();
|
||||
if (length != -1) {
|
||||
mozilla::MonitorAutoExit autoExitMonitor(mMonitor);
|
||||
mozilla::MonitorAutoEnter autoMonitor(mDecoder->GetMonitor());
|
||||
mozilla::ReentrantMonitorAutoExit autoExitMonitor(mReentrantMonitor);
|
||||
mozilla::ReentrantMonitorAutoEnter autoMonitor(mDecoder->GetReentrantMonitor());
|
||||
mDecoder->GetStateMachine()->SetDuration(USECS_PER_S *
|
||||
(length - sizeof(nsRawVideoHeader)) /
|
||||
(mFrameSize * mFrameRate));
|
||||
@ -171,7 +171,7 @@ PRBool nsRawReader::ReadFromStream(nsMediaStream *aStream, PRUint8* aBuf,
|
||||
PRBool nsRawReader::DecodeVideoFrame(PRBool &aKeyframeSkip,
|
||||
PRInt64 aTimeThreshold)
|
||||
{
|
||||
mozilla::MonitorAutoEnter autoEnter(mMonitor);
|
||||
mozilla::ReentrantMonitorAutoEnter autoEnter(mReentrantMonitor);
|
||||
NS_ASSERTION(mDecoder->OnStateMachineThread() || mDecoder->OnDecodeThread(),
|
||||
"Should be on state machine thread or decode thread.");
|
||||
|
||||
@ -253,7 +253,7 @@ PRBool nsRawReader::DecodeVideoFrame(PRBool &aKeyframeSkip,
|
||||
|
||||
nsresult nsRawReader::Seek(PRInt64 aTime, PRInt64 aStartTime, PRInt64 aEndTime, PRInt64 aCurrentTime)
|
||||
{
|
||||
mozilla::MonitorAutoEnter autoEnter(mMonitor);
|
||||
mozilla::ReentrantMonitorAutoEnter autoEnter(mReentrantMonitor);
|
||||
NS_ASSERTION(mDecoder->OnStateMachineThread(),
|
||||
"Should be on state machine thread.");
|
||||
|
||||
@ -284,8 +284,8 @@ nsresult nsRawReader::Seek(PRInt64 aTime, PRInt64 aStartTime, PRInt64 aEndTime,
|
||||
}
|
||||
|
||||
{
|
||||
mozilla::MonitorAutoExit autoMonitorExit(mMonitor);
|
||||
mozilla::MonitorAutoEnter autoMonitor(mDecoder->GetMonitor());
|
||||
mozilla::ReentrantMonitorAutoExit autoMonitorExit(mReentrantMonitor);
|
||||
mozilla::ReentrantMonitorAutoEnter autoMonitor(mDecoder->GetReentrantMonitor());
|
||||
if (mDecoder->GetDecodeState() ==
|
||||
nsBuiltinDecoderStateMachine::DECODER_STATE_SHUTDOWN) {
|
||||
mCurrentFrame = frame;
|
||||
|
@ -60,7 +60,6 @@
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsSVGUtils.h"
|
||||
#include "nsSVGSVGElement.h"
|
||||
#include "nsSVGEffects.h" // For nsSVGEffects::RemoveAllRenderingObservers
|
||||
#include "nsContentErrors.h" // For NS_PROPTABLE_PROP_OVERWRITTEN
|
||||
|
||||
#ifdef MOZ_SMIL
|
||||
@ -1289,15 +1288,6 @@ nsSVGSVGElement::GetPreserveAspectRatio()
|
||||
return &mPreserveAspectRatio;
|
||||
}
|
||||
|
||||
#ifndef MOZ_ENABLE_LIBXUL
|
||||
// XXXdholbert HACK -- see comment w/ this method's declaration in header file.
|
||||
void
|
||||
nsSVGSVGElement::RemoveAllRenderingObservers()
|
||||
{
|
||||
nsSVGEffects::RemoveAllRenderingObservers(this);
|
||||
}
|
||||
#endif // !MOZ_LIBXUL
|
||||
|
||||
PRBool
|
||||
nsSVGSVGElement::ShouldSynthesizeViewBox()
|
||||
{
|
||||
|
@ -226,13 +226,6 @@ public:
|
||||
|
||||
virtual nsXPCClassInfo* GetClassInfo();
|
||||
|
||||
#ifndef MOZ_ENABLE_LIBXUL
|
||||
// XXXdholbert HACK to call static method
|
||||
// nsSVGEffects::RemoveAllRenderingObservers() on myself, on behalf
|
||||
// of imagelib in non-libxul builds.
|
||||
virtual void RemoveAllRenderingObservers();
|
||||
#endif // !MOZ_LIBXUL
|
||||
|
||||
private:
|
||||
// Methods for <image> elements to override my "PreserveAspectRatio" value.
|
||||
// These are private so that only our friends (nsSVGImageFrame in
|
||||
|
@ -64,9 +64,8 @@ nsSVGDocument::~nsSVGDocument()
|
||||
DOMCI_NODE_DATA(SVGDocument, nsSVGDocument)
|
||||
|
||||
NS_INTERFACE_TABLE_HEAD(nsSVGDocument)
|
||||
NS_INTERFACE_TABLE_INHERITED2(nsSVGDocument,
|
||||
nsIDOMSVGDocument,
|
||||
nsIDOMDocumentEvent)
|
||||
NS_INTERFACE_TABLE_INHERITED1(nsSVGDocument,
|
||||
nsIDOMSVGDocument)
|
||||
NS_INTERFACE_TABLE_TO_MAP_SEGUE
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGDocument)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsXMLDocument)
|
||||
|
@ -54,7 +54,6 @@ public:
|
||||
NS_DECL_NSIDOMSVGDOCUMENT
|
||||
NS_FORWARD_NSIDOMDOCUMENT(nsXMLDocument::)
|
||||
NS_FORWARD_NSIDOMNODE(nsXMLDocument::)
|
||||
NS_FORWARD_NSIDOMDOCUMENTEVENT(nsXMLDocument::)
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
|
||||
virtual nsXPCClassInfo* GetClassInfo();
|
||||
|
@ -43,10 +43,7 @@ VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
ifdef MOZ_ENABLE_LIBXUL
|
||||
DIRS = external
|
||||
endif
|
||||
|
||||
MODULE = morkreader
|
||||
LIBRARY_NAME = morkreader_s
|
||||
LIBXUL_LIBRARY = 1
|
||||
|
@ -155,6 +155,7 @@ EXPORTS
|
||||
sqlite3_sql
|
||||
sqlite3_status
|
||||
sqlite3_step
|
||||
sqlite3_stmt_readonly
|
||||
sqlite3_stmt_status
|
||||
sqlite3_thread_cleanup
|
||||
sqlite3_total_changes
|
||||
|
@ -8300,8 +8300,10 @@ nsDocShell::InternalLoad(nsIURI * aURI,
|
||||
GetCurScrollPos(ScrollOrientation_X, &cx);
|
||||
GetCurScrollPos(ScrollOrientation_Y, &cy);
|
||||
|
||||
// We scroll the window precisely when we fire a hashchange event.
|
||||
if (doHashchange) {
|
||||
// We scroll whenever we're not doing a history load. Note that
|
||||
// sometimes we might scroll even if we don't fire a hashchange
|
||||
// event! See bug 653741.
|
||||
if (!aSHEntry) {
|
||||
// Take the '#' off the hashes before passing them to
|
||||
// ScrollToAnchor.
|
||||
nsDependentCSubstring curHashName(curHash, 1);
|
||||
|
@ -57,11 +57,6 @@ EXPORTS = \
|
||||
nsDocShellCID.h \
|
||||
$(NULL)
|
||||
|
||||
ifeq ($(OS_ARCH)$(MOZ_ENABLE_LIBXUL),WINNT)
|
||||
EXTRA_DSO_LIBS = gkgfx
|
||||
endif
|
||||
|
||||
|
||||
CPPSRCS = \
|
||||
nsDocShellModule.cpp \
|
||||
$(NULL)
|
||||
|
@ -101,6 +101,8 @@ _TEST_FILES = \
|
||||
test_bug640387_1.html \
|
||||
test_bug640387_2.html \
|
||||
file_bug640387.html \
|
||||
test_bug653741.html \
|
||||
file_bug653741.html \
|
||||
test_framedhistoryframes.html \
|
||||
test_windowedhistoryframes.html \
|
||||
historyframes.html \
|
||||
|
13
docshell/test/file_bug653741.html
Normal file
13
docshell/test/file_bug653741.html
Normal file
@ -0,0 +1,13 @@
|
||||
<html>
|
||||
<body onload='(parent || opener).childLoad()'>
|
||||
|
||||
<div style='height:500px; background:yellow'>
|
||||
<a id='#top'>Top of the page</a>
|
||||
</div>
|
||||
|
||||
<div id='bottom'>
|
||||
<a id='#bottom'>Bottom of the page</a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
50
docshell/test/test_bug653741.html
Normal file
50
docshell/test/test_bug653741.html
Normal file
@ -0,0 +1,50 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=653741
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 653741</title>
|
||||
<script type="application/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=653741">Mozilla Bug 653741</a>
|
||||
|
||||
<script type="application/javascript;version=1.7">
|
||||
|
||||
/** Test for Bug 653741 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function childLoad() {
|
||||
// Spin the event loop so we leave the onload handler.
|
||||
SimpleTest.executeSoon(childLoad2);
|
||||
}
|
||||
|
||||
function childLoad2() {
|
||||
let cw = $('iframe').contentWindow;
|
||||
|
||||
// Save the Y offset. For sanity's sake, make sure it's not 0, because we
|
||||
// should be at the bottom of the page!
|
||||
let origYOffset = cw.pageYOffset;
|
||||
ok(origYOffset != 0, 'Original Y offset is not 0.');
|
||||
|
||||
// Scroll the iframe to the top, then navigate to #bottom again.
|
||||
cw.scrollTo(0, 0);
|
||||
|
||||
// Our current location is #bottom, so this should scroll us down to the
|
||||
// bottom again.
|
||||
cw.location = cw.location + '';
|
||||
|
||||
is(cw.pageYOffset, origYOffset, 'Correct offset after reloading page.');
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<iframe height='100px' id='iframe' src='file_bug653741.html#bottom'></iframe>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -222,7 +222,6 @@
|
||||
#include "nsIDOMDocumentType.h"
|
||||
#include "nsIDOMDOMImplementation.h"
|
||||
#include "nsIDOMDocumentFragment.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsDOMAttribute.h"
|
||||
#include "nsIDOMText.h"
|
||||
#include "nsIDOM3Text.h"
|
||||
@ -2328,7 +2327,6 @@ nsDOMClassInfo::RegisterExternalClasses()
|
||||
|
||||
#define DOM_CLASSINFO_DOCUMENT_MAP_ENTRIES \
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSDocument) \
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentEvent) \
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentStyle) \
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSDocumentStyle) \
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentXBL) \
|
||||
@ -4039,8 +4037,8 @@ nsDOMClassInfo::Init()
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozURLProperty)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(MozBlobBuilder, nsIDOMBlobBuilder)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMBlobBuilder)
|
||||
DOM_CLASSINFO_MAP_BEGIN(MozBlobBuilder, nsIDOMMozBlobBuilder)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozBlobBuilder)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(DOMStringMap, nsIDOMDOMStringMap)
|
||||
@ -8592,7 +8590,8 @@ nsDOMStringMapSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
||||
nsCOMPtr<nsIDOMDOMStringMap> dataset(do_QueryWrappedNative(wrapper, obj));
|
||||
NS_ENSURE_TRUE(dataset, NS_ERROR_UNEXPECTED);
|
||||
|
||||
nsDependentJSString prop(id);
|
||||
nsAutoString prop;
|
||||
NS_ENSURE_TRUE(JSIDToProp(id, prop), NS_ERROR_UNEXPECTED);
|
||||
|
||||
if (dataset->HasDataAttr(prop)) {
|
||||
*_retval = JS_DefinePropertyById(cx, obj, id, JSVAL_VOID,
|
||||
@ -8660,9 +8659,10 @@ nsDOMStringMapSH::DelProperty(nsIXPConnectWrappedNative *wrapper,
|
||||
{
|
||||
nsCOMPtr<nsIDOMDOMStringMap> dataset(do_QueryWrappedNative(wrapper, obj));
|
||||
NS_ENSURE_TRUE(dataset, NS_ERROR_UNEXPECTED);
|
||||
*_retval = PR_TRUE;
|
||||
|
||||
nsDependentJSString prop(id);
|
||||
nsAutoString prop;
|
||||
NS_ENSURE_TRUE(JSIDToProp(id, prop), NS_ERROR_UNEXPECTED);
|
||||
|
||||
dataset->RemoveDataAttr(prop);
|
||||
|
||||
return NS_OK;
|
||||
@ -8676,21 +8676,22 @@ nsDOMStringMapSH::GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
||||
nsCOMPtr<nsIDOMDOMStringMap> dataset(do_QueryWrappedNative(wrapper, obj));
|
||||
NS_ENSURE_TRUE(dataset, NS_ERROR_UNEXPECTED);
|
||||
|
||||
nsDependentJSString propName(id);
|
||||
nsAutoString prop;
|
||||
|
||||
nsresult rv = dataset->GetDataAttr(propName, prop);
|
||||
nsAutoString propName;
|
||||
NS_ENSURE_TRUE(JSIDToProp(id, propName), NS_ERROR_UNEXPECTED);
|
||||
|
||||
nsAutoString propVal;
|
||||
nsresult rv = dataset->GetDataAttr(propName, propVal);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (prop.IsVoid()) {
|
||||
if (propVal.IsVoid()) {
|
||||
*vp = JSVAL_VOID;
|
||||
return NS_SUCCESS_I_DID_SOMETHING;
|
||||
}
|
||||
|
||||
nsStringBuffer* valBuf;
|
||||
*vp = XPCStringConvert::ReadableToJSVal(cx, prop, &valBuf);
|
||||
*vp = XPCStringConvert::ReadableToJSVal(cx, propVal, &valBuf);
|
||||
if (valBuf) {
|
||||
prop.ForgetSharedBuffer();
|
||||
propVal.ForgetSharedBuffer();
|
||||
}
|
||||
|
||||
return NS_SUCCESS_I_DID_SOMETHING;
|
||||
@ -8704,10 +8705,12 @@ nsDOMStringMapSH::SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
||||
nsCOMPtr<nsIDOMDOMStringMap> dataset(do_QueryWrappedNative(wrapper, obj));
|
||||
NS_ENSURE_TRUE(dataset, NS_ERROR_UNEXPECTED);
|
||||
|
||||
nsAutoString propName;
|
||||
NS_ENSURE_TRUE(JSIDToProp(id, propName), NS_ERROR_UNEXPECTED);
|
||||
|
||||
JSString *val = JS_ValueToString(cx, *vp);
|
||||
NS_ENSURE_TRUE(val, NS_ERROR_UNEXPECTED);
|
||||
|
||||
nsDependentJSString propName(id);
|
||||
nsDependentJSString propVal;
|
||||
NS_ENSURE_TRUE(propVal.init(cx, val), NS_ERROR_UNEXPECTED);
|
||||
|
||||
@ -8717,6 +8720,20 @@ nsDOMStringMapSH::SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
||||
return NS_SUCCESS_I_DID_SOMETHING;
|
||||
}
|
||||
|
||||
bool
|
||||
nsDOMStringMapSH::JSIDToProp(const jsid& aId, nsAString& aResult)
|
||||
{
|
||||
if (JSID_IS_INT(aId)) {
|
||||
aResult.AppendInt(JSID_TO_INT(aId));
|
||||
} else if (JSID_IS_STRING(aId)) {
|
||||
aResult = nsDependentJSString(aId);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocumentSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
||||
JSObject *obj, jsid id, PRUint32 flags,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user