Skip to content

Commit

Permalink
Merge last PGO-green changeset of mozilla-inbound to mozilla-central
Browse files Browse the repository at this point in the history
  • Loading branch information
Ed Morley committed Aug 4, 2012
2 parents e2378b7 + a195612 commit 4d834bc
Show file tree
Hide file tree
Showing 431 changed files with 6,054 additions and 10,440 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
4 changes: 3 additions & 1 deletion aclocal.m4
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
dnl
dnl Local autoconf macros used with mozilla
dnl The contents of this file are under the Public Domain.
dnl
dnl

builtin(include, build/autoconf/config.status.m4)dnl
builtin(include, build/autoconf/toolchain.m4)dnl
builtin(include, build/autoconf/ccache.m4)dnl
builtin(include, build/autoconf/nspr.m4)dnl
Expand All @@ -22,6 +23,7 @@ builtin(include, build/autoconf/expandlibs.m4)dnl
builtin(include, build/autoconf/arch.m4)dnl
builtin(include, build/autoconf/android.m4)dnl
builtin(include, build/autoconf/zlib.m4)dnl
builtin(include, build/autoconf/linux.m4)dnl

MOZ_PROG_CHECKMSYS()

Expand Down
2 changes: 1 addition & 1 deletion allmakefiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ fi

# Common makefiles used by everyone
add_makefiles "
mozilla-config.h
Makefile
build/Makefile
build/pgo/Makefile
Expand Down Expand Up @@ -121,7 +122,6 @@ fi

if [ "$ENABLE_TESTS" ]; then
add_makefiles "
build/autoconf/test/Makefile
config/makefiles/test/Makefile
config/tests/makefiles/autodeps/Makefile
config/tests/src-simple/Makefile
Expand Down
3 changes: 3 additions & 0 deletions b2g/app/b2g.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,3 +481,6 @@ pref("javascript.options.mem.log", true);

// Increase mark slice time from 10ms to 30ms
pref("javascript.options.mem.gc_incremental_slice_ms", 30);

// Show/Hide scrollbars when active/inactive
pref("ui.showHideScrollbars", 1);
30 changes: 11 additions & 19 deletions b2g/chrome/content/content.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,19 @@ xul|window xul|scrollbar {
}

html xul|scrollbar {
display: block;
}

xul|scrollbar[orient="vertical"] {
-moz-appearance: none !important;
position: relative;
margin-left: -8px;
min-width: 8px;
max-width: 8px;
background-color: transparent !important;
background-image: none !important;
border: 0px solid transparent !important;
z-index: 2147483647;
opacity: 1;
}

xul|scrollbar[orient="vertical"]:-moz-locale-dir(rtl) {
margin-left: 2px;
margin-right: -10px;
xul|scrollbar[orient="vertical"] {
-moz-margin-start: -8px;
min-width: 8px;
max-width: 8px;
}

xul|scrollbar[orient="vertical"] xul|thumb {
Expand All @@ -36,24 +32,20 @@ xul|scrollbar[orient="vertical"] xul|thumb {
}

xul|scrollbar[orient="horizontal"] {
-moz-appearance: none !important;
position: relative;
margin-top: -8px;
min-height: 8px;
max-height: 8px;
margin-top: -8px;
background-color: transparent !important;
background-image: none !important;
border: 0px solid transparent !important;
}

xul|scrollbar[orient="horizontal"] xul|thumb {
max-height: 6px !important;
min-height: 6px !important;
}

xul|scrollbox {
overflow-y: scroll;
overflow-x: scroll;
xul|scrollbar:not([active="true"]),
xul|scrollbar[disabled] {
opacity: 0;
-moz-transition: opacity 1s ease;
}

xul|scrollbarbutton {
Expand Down
4 changes: 4 additions & 0 deletions b2g/installer/package-manifest.in
Original file line number Diff line number Diff line change
Expand Up @@ -686,3 +686,7 @@ bin/components/@DLL_PREFIX@nkgnomevfs@DLL_SUFFIX@
@BINPATH@/components/ActivitiesGlue.js
@BINPATH@/components/ProcessGlobal.js
@BINPATH@/components/ContentHandler.js

#ifdef XP_MACOSX
@BINPATH@/@DLL_PREFIX@plugin_child_interpose@DLL_SUFFIX@
#endif
39 changes: 29 additions & 10 deletions browser/base/content/browser-social.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,13 @@ var SocialSidebar = {
return Services.prefs.getBoolPref("social.sidebar.open");
},

dispatchEvent: function(aType, aDetail) {
let sbrowser = document.getElementById("social-sidebar-browser");
let evt = sbrowser.contentDocument.createEvent("CustomEvent");
evt.initCustomEvent(aType, true, true, aDetail ? aDetail : {});
sbrowser.contentDocument.documentElement.dispatchEvent(evt);
},

updateSidebar: function SocialSidebar_updateSidebar() {
// Hide the toggle menu item if the sidebar cannot appear
let command = document.getElementById("Social:ToggleSidebar");
Expand All @@ -418,17 +425,29 @@ var SocialSidebar = {
broadcaster.hidden = hideSidebar;
command.setAttribute("checked", !hideSidebar);

// If the sidebar is hidden, unload its document
// XXX this results in a poor UX, we should revisit
let sbrowser = document.getElementById("social-sidebar-browser");
if (broadcaster.hidden) {
sbrowser.removeAttribute("origin");
sbrowser.setAttribute("src", "about:blank");
return;
if (hideSidebar) {
this.dispatchEvent("sidebarhide");
// If we're disabled, unload the sidebar content
if (!this.canShow) {
sbrowser.removeAttribute("origin");
sbrowser.setAttribute("src", "about:blank");
}
} else {
// Make sure the right sidebar URL is loaded
if (sbrowser.getAttribute("origin") != Social.provider.origin) {
sbrowser.setAttribute("origin", Social.provider.origin);
sbrowser.setAttribute("src", Social.provider.sidebarURL);
sbrowser.addEventListener("load", function sidebarOnShow() {
sbrowser.removeEventListener("load", sidebarOnShow);
// let load finish, then fire our event
setTimeout(function () {
SocialSidebar.dispatchEvent("sidebarshow");
}, 0);
});
} else {
this.dispatchEvent("sidebarshow");
}
}

// Load the sidebar document
sbrowser.setAttribute("origin", Social.provider.origin);
sbrowser.setAttribute("src", Social.provider.sidebarURL);
}
}
1 change: 1 addition & 0 deletions browser/base/content/browser.xul
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@
<toolbaritem id="social-toolbar-button"
class="toolbarbutton-1 chromeclass-toolbar-additional"
removable="false"
pack="center"
title="&socialToolbar.title;"
hidden="true">
<hbox id="social-toolbar-button-box" class="social-statusarea-container">
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
57 changes: 39 additions & 18 deletions browser/base/content/test/browser_social_sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ function test() {

let manifest = { // normal provider
name: "provider 1",
origin: "https://example1.com",
sidebarURL: "https://example1.com/sidebar.html",
workerURL: "https://example1.com/worker.js",
origin: "https://example.com",
sidebarURL: "https://example.com/browser/browser/base/content/test/social_sidebar.html",
workerURL: "https://example.com/browser/browser/base/content/test/social_worker.js",
iconURL: "chrome://branding/content/icon48.png"
};
runSocialTestWithProvider(manifest, doTest);
Expand All @@ -29,24 +29,45 @@ function doTest() {

let command = document.getElementById("Social:ToggleSidebar");
let sidebar = document.getElementById("social-sidebar-box");
let browser = sidebar.firstChild;

// Check the the sidebar is initially visible, and loaded
ok(!command.hidden, "sidebar toggle command should be visible");
is(command.getAttribute("checked"), "true", "sidebar toggle command should be checked");
ok(!sidebar.hidden, "sidebar itself should be visible");
ok(Services.prefs.getBoolPref("social.sidebar.open"), "sidebar open pref should be true");
is(sidebar.firstChild.getAttribute('src'), "https://example1.com/sidebar.html", "sidebar url should be set");
function checkShown(shouldBeShown) {
is(command.getAttribute("checked"), shouldBeShown ? "true" : "false",
"toggle command should be " + (shouldBeShown ? "checked" : "unchecked"));
is(sidebar.hidden, !shouldBeShown,
"sidebar should be " + (shouldBeShown ? "visible" : "hidden"));
is(Services.prefs.getBoolPref("social.sidebar.open"), shouldBeShown,
"sidebar open pref should be " + shouldBeShown);
if (shouldBeShown)
is(browser.getAttribute('src'), Social.provider.sidebarURL, "sidebar url should be set");
}

// Now toggle it!
info("Toggling sidebar");
Social.toggleSidebar();
is(command.getAttribute("checked"), "false", "sidebar toggle command should not be checked");
ok(sidebar.hidden, "sidebar itself should not be visible");
ok(!Services.prefs.getBoolPref("social.sidebar.open"), "sidebar open pref should be false");
is(sidebar.firstChild.getAttribute('src'), "about:blank", "sidebar url should not be set");
// First check the the sidebar is initially visible, and loaded
ok(!command.hidden, "toggle command should be visible");
checkShown(true);

browser.addEventListener("sidebarhide", function sidebarhide() {
browser.removeEventListener("sidebarhide", sidebarhide);

checkShown(false);

browser.addEventListener("sidebarshow", function sidebarshow() {
browser.removeEventListener("sidebarshow", sidebarshow);

// Remove the test provider
SocialService.removeProvider(Social.provider.origin, finish);
checkShown(true);

// Remove the test provider
SocialService.removeProvider(Social.provider.origin, finish);
});

// Toggle it back on
info("Toggling sidebar back on");
Social.toggleSidebar();
});

// Now toggle it off
info("Toggling sidebar off");
Social.toggleSidebar();
}

// XXX test sidebar in popup
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
4 changes: 0 additions & 4 deletions browser/modules/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,4 @@ EXTRA_JS_MODULES += \
$(NULL)
endif

EXTRA_PP_JS_MODULES = \
WebappsInstaller.jsm \
$(NULL)

include $(topsrcdir)/config/rules.mk
2 changes: 1 addition & 1 deletion browser/modules/webappsUI.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let Cu = Components.utils;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Webapps.jsm");
Cu.import("resource:///modules/WebappsInstaller.jsm");
Cu.import("resource://gre/modules/WebappsInstaller.jsm");
Cu.import("resource://gre/modules/WebappOSUtils.jsm");

let webappsUI = {
Expand Down
Loading

0 comments on commit 4d834bc

Please sign in to comment.