Skip to content

Commit

Permalink
Revert inbound to 3d5d1daa2505 to stop OS X M5 failures (backout not …
Browse files Browse the repository at this point in the history
…clean/could have been a bad merge) on a CLOSED TREE
  • Loading branch information
Ed Morley committed Aug 4, 2012
1 parent 9891039 commit a195612
Show file tree
Hide file tree
Showing 278 changed files with 2,191 additions and 5,664 deletions.
18 changes: 14 additions & 4 deletions accessible/src/generic/RootAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,21 @@
#include "mozilla/dom/Element.h"

#include "nsIAccessibleRelation.h"
#include "nsIDocShell.h"
#include "nsIDocShellTreeItem.h"
#include "nsIDocShellTreeNode.h"
#include "nsIDocShellTreeOwner.h"
#include "nsIDOMElement.h"
#include "nsIDOMEventListener.h"
#include "nsIDOMEventTarget.h"
#include "nsIDOMHTMLAnchorElement.h"
#include "nsIDOMHTMLImageElement.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMHTMLSelectElement.h"
#include "nsIDOMDataContainerEvent.h"
#include "nsIDOMNSEvent.h"
#include "nsIDOMXULMultSelectCntrlEl.h"
#include "nsIDOMXULPopupElement.h"
#include "nsIDocument.h"
#include "nsEventListenerManager.h"
#include "nsIFrame.h"
Expand Down Expand Up @@ -252,9 +262,9 @@ RootAccessible::DocumentActivated(DocAccessible* aDocument)
NS_IMETHODIMP
RootAccessible::HandleEvent(nsIDOMEvent* aDOMEvent)
{
MOZ_ASSERT(aDOMEvent);
nsCOMPtr<nsIDOMNSEvent> DOMNSEvent(do_QueryInterface(aDOMEvent));
nsCOMPtr<nsIDOMEventTarget> DOMEventTarget;
aDOMEvent->GetOriginalTarget(getter_AddRefs(DOMEventTarget));
DOMNSEvent->GetOriginalTarget(getter_AddRefs(DOMEventTarget));
nsCOMPtr<nsINode> origTargetNode(do_QueryInterface(DOMEventTarget));
if (!origTargetNode)
return NS_OK;
Expand Down Expand Up @@ -289,9 +299,9 @@ RootAccessible::HandleEvent(nsIDOMEvent* aDOMEvent)
void
RootAccessible::ProcessDOMEvent(nsIDOMEvent* aDOMEvent)
{
MOZ_ASSERT(aDOMEvent);
nsCOMPtr<nsIDOMNSEvent> DOMNSEvent(do_QueryInterface(aDOMEvent));
nsCOMPtr<nsIDOMEventTarget> DOMEventTarget;
aDOMEvent->GetOriginalTarget(getter_AddRefs(DOMEventTarget));
DOMNSEvent->GetOriginalTarget(getter_AddRefs(DOMEventTarget));
nsCOMPtr<nsINode> origTargetNode(do_QueryInterface(DOMEventTarget));

nsAutoString eventType;
Expand Down
1 change: 1 addition & 0 deletions b2g/app/b2g.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ pref("mozilla.widget.force-24bpp", true);
pref("mozilla.widget.use-buffer-pixmap", true);
pref("mozilla.widget.disable-native-theme", true);
pref("layout.reflow.synthMouseMove", false);
pref("dom.send_after_paint_to_content", true);

/* download manager (don't show the window or alert) */
pref("browser.download.useDownloadDir", true);
Expand Down
16 changes: 8 additions & 8 deletions browser/base/content/test/browser_gestureSupport.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ function test_gestureListener(evt)
is(evt.delta, test_expectedDelta,
"evt.delta (" + evt.delta + ") does not match expected value");

is(evt.shiftKey, (test_expectedModifiers & Components.interfaces.nsIDOMEvent.SHIFT_MASK) != 0,
is(evt.shiftKey, (test_expectedModifiers & Components.interfaces.nsIDOMNSEvent.SHIFT_MASK) != 0,
"evt.shiftKey did not match expected value");
is(evt.ctrlKey, (test_expectedModifiers & Components.interfaces.nsIDOMEvent.CONTROL_MASK) != 0,
is(evt.ctrlKey, (test_expectedModifiers & Components.interfaces.nsIDOMNSEvent.CONTROL_MASK) != 0,
"evt.ctrlKey did not match expected value");
is(evt.altKey, (test_expectedModifiers & Components.interfaces.nsIDOMEvent.ALT_MASK) != 0,
is(evt.altKey, (test_expectedModifiers & Components.interfaces.nsIDOMNSEvent.ALT_MASK) != 0,
"evt.altKey did not match expected value");
is(evt.metaKey, (test_expectedModifiers & Components.interfaces.nsIDOMEvent.META_MASK) != 0,
is(evt.metaKey, (test_expectedModifiers & Components.interfaces.nsIDOMNSEvent.META_MASK) != 0,
"evt.metaKey did not match expected value");

if (evt.type == "MozTapGesture") {
Expand Down Expand Up @@ -158,19 +158,19 @@ function test_TestEventListeners()
e("MozEdgeUIGesture", 0, 0, 0);

// event.shiftKey
let modifier = Components.interfaces.nsIDOMEvent.SHIFT_MASK;
let modifier = Components.interfaces.nsIDOMNSEvent.SHIFT_MASK;
e("MozSwipeGesture", SimpleGestureEvent.DIRECTION_RIGHT, 0, modifier);

// event.metaKey
modifier = Components.interfaces.nsIDOMEvent.META_MASK;
modifier = Components.interfaces.nsIDOMNSEvent.META_MASK;
e("MozSwipeGesture", SimpleGestureEvent.DIRECTION_RIGHT, 0, modifier);

// event.altKey
modifier = Components.interfaces.nsIDOMEvent.ALT_MASK;
modifier = Components.interfaces.nsIDOMNSEvent.ALT_MASK;
e("MozSwipeGesture", SimpleGestureEvent.DIRECTION_RIGHT, 0, modifier);

// event.ctrlKey
modifier = Components.interfaces.nsIDOMEvent.CONTROL_MASK;
modifier = Components.interfaces.nsIDOMNSEvent.CONTROL_MASK;
e("MozSwipeGesture", SimpleGestureEvent.DIRECTION_RIGHT, 0, modifier);
}

Expand Down
25 changes: 16 additions & 9 deletions browser/components/sessionstore/src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ srcdir = @srcdir@
VPATH = @srcdir@

include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk

EXTRA_COMPONENTS = \
nsSessionStore.manifest \
Expand All @@ -19,16 +18,24 @@ EXTRA_PP_COMPONENTS = \
nsSessionStartup.js \
$(NULL)

JS_MODULES_PATH := $(FINAL_TARGET)/modules/sessionstore
libs::
$(NSINSTALL) $(srcdir)/*.jsm $(FINAL_TARGET)/modules/sessionstore

EXTRA_JS_MODULES := \
DocumentUtils.jsm \
SessionStorage.jsm \
XPathGenerator.jsm \
$(NULL)

EXTRA_PP_JS_MODULES := \
SS_EXTRA_PP_JS_MODULES = \
SessionStore.jsm \
$(NULL)

ifdef SS_EXTRA_PP_JS_MODULES
libs:: $(SS_EXTRA_PP_JS_MODULES)
ifndef NO_DIST_INSTALL
$(EXIT_ON_ERROR) \
$(NSINSTALL) -D $(FINAL_TARGET)/modules/sessionstore; \
for i in $^; do \
dest=$(FINAL_TARGET)/modules/sessionstore/`basename $$i`; \
$(RM) -f $$dest; \
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $$i > $$dest; \
done
endif
endif

include $(topsrcdir)/config/rules.mk
11 changes: 4 additions & 7 deletions config/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1384,14 +1384,11 @@ libs::
endif

################################################################################
# Copy each element of EXTRA_JS_MODULES to JS_MODULES_PATH, or
# $(FINAL_TARGET)/modules if that isn't defined.
JS_MODULES_PATH ?= $(FINAL_TARGET)/modules

# Copy each element of EXTRA_JS_MODULES to $(FINAL_TARGET)/modules
ifdef EXTRA_JS_MODULES
libs:: $(EXTRA_JS_MODULES)
ifndef NO_DIST_INSTALL
$(call install_cmd,$(IFLAGS1) $^ $(JS_MODULES_PATH))
$(call install_cmd,$(IFLAGS1) $^ $(FINAL_TARGET)/modules)
endif

endif
Expand All @@ -1400,9 +1397,9 @@ ifdef EXTRA_PP_JS_MODULES
libs:: $(EXTRA_PP_JS_MODULES)
ifndef NO_DIST_INSTALL
$(EXIT_ON_ERROR) \
$(NSINSTALL) -D $(JS_MODULES_PATH); \
$(NSINSTALL) -D $(FINAL_TARGET)/modules; \
for i in $^; do \
dest=$(JS_MODULES_PATH)/`basename $$i`; \
dest=$(FINAL_TARGET)/modules/`basename $$i`; \
$(RM) -f $$dest; \
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $$i > $$dest; \
done
Expand Down
38 changes: 0 additions & 38 deletions content/base/public/nsContentUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -2019,44 +2019,6 @@ class nsContentUtils
*/
static bool IsJavaScriptLanguage(const nsString& aName, PRUint32 *aVerFlags);

/**
* Returns the JSVersion for a string of the form '1.n', n = 0, ..., 8, and
* JSVERSION_UNKNOWN for other strings.
*/
static JSVersion ParseJavascriptVersion(const nsAString& aVersionStr);

static bool IsJavascriptMIMEType(const nsAString& aMIMEType)
{
// Table ordered from most to least likely JS MIME types.
static const char* jsTypes[] = {
"text/javascript",
"text/ecmascript",
"application/javascript",
"application/ecmascript",
"application/x-javascript",
"application/x-ecmascript",
"text/javascript1.0",
"text/javascript1.1",
"text/javascript1.2",
"text/javascript1.3",
"text/javascript1.4",
"text/javascript1.5",
"text/jscript",
"text/livescript",
"text/x-ecmascript",
"text/x-javascript",
nullptr
};

for (PRUint32 i = 0; jsTypes[i]; ++i) {
if (aMIMEType.LowerCaseEqualsASCII(jsTypes[i])) {
return true;
}
}

return false;
}

static void SplitMimeType(const nsAString& aValue, nsString& aType,
nsString& aParams);

Expand Down
46 changes: 33 additions & 13 deletions content/base/src/nsAttrAndChildArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,10 @@ nsAttrAndChildArray::RemoveAttrAt(PRUint32 aPos, nsAttrValue& aValue)
return NS_OK;
}

nsRefPtr<nsMappedAttributes> mapped =
GetModifiableMapped(nullptr, nullptr, false);
nsRefPtr<nsMappedAttributes> mapped;
nsresult rv = GetModifiableMapped(nullptr, nullptr, false,
getter_AddRefs(mapped));
NS_ENSURE_SUCCESS(rv, rv);

mapped->RemoveAttrAt(aPos, aValue);

Expand Down Expand Up @@ -556,15 +558,18 @@ nsAttrAndChildArray::SetAndTakeMappedAttr(nsIAtom* aLocalName,
nsMappedAttributeElement* aContent,
nsHTMLStyleSheet* aSheet)
{
nsRefPtr<nsMappedAttributes> mapped;

bool willAdd = true;
if (mImpl && mImpl->mMappedAttrs) {
willAdd = !mImpl->mMappedAttrs->GetAttr(aLocalName);
willAdd = mImpl->mMappedAttrs->GetAttr(aLocalName) == nullptr;
}

nsRefPtr<nsMappedAttributes> mapped =
GetModifiableMapped(aContent, aSheet, willAdd);
nsresult rv = GetModifiableMapped(aContent, aSheet, willAdd,
getter_AddRefs(mapped));
NS_ENSURE_SUCCESS(rv, rv);

nsresult rv = mapped->SetAndTakeAttr(aLocalName, aValue);
rv = mapped->SetAndTakeAttr(aLocalName, aValue);
NS_ENSURE_SUCCESS(rv, rv);

return MakeMappedUnique(mapped);
Expand All @@ -579,8 +584,10 @@ nsAttrAndChildArray::DoSetMappedAttrStyleSheet(nsHTMLStyleSheet* aSheet)
return NS_OK;
}

nsRefPtr<nsMappedAttributes> mapped =
GetModifiableMapped(nullptr, nullptr, false);
nsRefPtr<nsMappedAttributes> mapped;
nsresult rv = GetModifiableMapped(nullptr, nullptr, false,
getter_AddRefs(mapped));
NS_ENSURE_SUCCESS(rv, rv);

mapped->SetStyleSheet(aSheet);

Expand Down Expand Up @@ -690,20 +697,33 @@ nsAttrAndChildArray::MappedAttrCount() const
return mImpl && mImpl->mMappedAttrs ? (PRUint32)mImpl->mMappedAttrs->Count() : 0;
}

nsMappedAttributes*
nsresult
nsAttrAndChildArray::GetModifiableMapped(nsMappedAttributeElement* aContent,
nsHTMLStyleSheet* aSheet,
bool aWillAddAttr)
bool aWillAddAttr,
nsMappedAttributes** aModifiable)
{
*aModifiable = nullptr;

if (mImpl && mImpl->mMappedAttrs) {
return mImpl->mMappedAttrs->Clone(aWillAddAttr);
*aModifiable = mImpl->mMappedAttrs->Clone(aWillAddAttr);
NS_ENSURE_TRUE(*aModifiable, NS_ERROR_OUT_OF_MEMORY);

NS_ADDREF(*aModifiable);

return NS_OK;
}

MOZ_ASSERT(aContent, "Trying to create modifiable without content");
NS_ASSERTION(aContent, "Trying to create modifiable without content");

nsMapRuleToAttributesFunc mapRuleFunc =
aContent->GetAttributeMappingFunction();
return new nsMappedAttributes(aSheet, mapRuleFunc);
*aModifiable = new nsMappedAttributes(aSheet, mapRuleFunc);
NS_ENSURE_TRUE(*aModifiable, NS_ERROR_OUT_OF_MEMORY);

NS_ADDREF(*aModifiable);

return NS_OK;
}

nsresult
Expand Down
9 changes: 4 additions & 5 deletions content/base/src/nsAttrAndChildArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,10 @@ class nsAttrAndChildArray
PRUint32 NonMappedAttrCount() const;
PRUint32 MappedAttrCount() const;

// Returns a non-null zero-refcount object.
nsMappedAttributes*
GetModifiableMapped(nsMappedAttributeElement* aContent,
nsHTMLStyleSheet* aSheet,
bool aWillAddAttr);
nsresult GetModifiableMapped(nsMappedAttributeElement* aContent,
nsHTMLStyleSheet* aSheet,
bool aWillAddAttr,
nsMappedAttributes** aModifiable);
nsresult MakeMappedUnique(nsMappedAttributes* aAttributes);

PRUint32 AttrSlotsSize() const
Expand Down
13 changes: 8 additions & 5 deletions content/base/src/nsContentAreaDragDrop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "nsIDOMNode.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMEvent.h"
#include "nsIDOMNSEvent.h"
#include "nsIDOMDragEvent.h"
#include "nsPIDOMWindow.h"
#include "nsIDOMDocument.h"
Expand Down Expand Up @@ -56,7 +57,7 @@
class NS_STACK_CLASS DragDataProducer
{
public:
DragDataProducer(nsPIDOMWindow* aWindow,
DragDataProducer(nsIDOMWindow* aWindow,
nsIContent* aTarget,
nsIContent* aSelectionTargetNode,
bool aIsAltKeyPressed);
Expand Down Expand Up @@ -84,7 +85,7 @@ class NS_STACK_CLASS DragDataProducer
static void GetSelectedLink(nsISelection* inSelection,
nsIContent **outLinkNode);

nsCOMPtr<nsPIDOMWindow> mWindow;
nsCOMPtr<nsIDOMWindow> mWindow;
nsCOMPtr<nsIContent> mTarget;
nsCOMPtr<nsIContent> mSelectionTargetNode;
bool mIsAltKeyPressed;
Expand All @@ -104,7 +105,7 @@ class NS_STACK_CLASS DragDataProducer


nsresult
nsContentAreaDragDrop::GetDragData(nsPIDOMWindow* aWindow,
nsContentAreaDragDrop::GetDragData(nsIDOMWindow* aWindow,
nsIContent* aTarget,
nsIContent* aSelectionTargetNode,
bool aIsAltKeyPressed,
Expand Down Expand Up @@ -238,7 +239,7 @@ nsContentAreaDragDropDataProvider::GetFlavorData(nsITransferable *aTransferable,
return rv;
}

DragDataProducer::DragDataProducer(nsPIDOMWindow* aWindow,
DragDataProducer::DragDataProducer(nsIDOMWindow* aWindow,
nsIContent* aTarget,
nsIContent* aSelectionTargetNode,
bool aIsAltKeyPressed)
Expand Down Expand Up @@ -648,7 +649,9 @@ DragDataProducer::Produce(nsDOMDataTransfer* aDataTransfer,
mInfoString.Truncate();
mTitleString.Truncate();

nsCOMPtr<nsIDocument> doc = mWindow->GetDoc();
nsCOMPtr<nsIDOMDocument> domDoc;
mWindow->GetDocument(getter_AddRefs(domDoc));
nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDoc);
NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);

// if we have selected text, use it in preference to the node
Expand Down
4 changes: 2 additions & 2 deletions content/base/src/nsContentAreaDragDrop.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "nsITransferable.h"

class nsIDOMNode;
class nsPIDOMWindow;
class nsIDOMWindow;
class nsIDOMDragEvent;
class nsISelection;
class nsITransferable;
Expand Down Expand Up @@ -49,7 +49,7 @@ class nsContentAreaDragDrop
* aDragNode - [out] the link, image or area being dragged, or null if the
* drag occurred on another element.
*/
static nsresult GetDragData(nsPIDOMWindow* aWindow,
static nsresult GetDragData(nsIDOMWindow* aWindow,
nsIContent* aTarget,
nsIContent* aSelectionTargetNode,
bool aIsAltKeyPressed,
Expand Down
Loading

0 comments on commit a195612

Please sign in to comment.