diff --git a/b2g/app/Makefile.in b/b2g/app/Makefile.in index c7b26e6a55a6..c565c0654536 100644 --- a/b2g/app/Makefile.in +++ b/b2g/app/Makefile.in @@ -11,6 +11,10 @@ include $(DEPTH)/config/autoconf.mk PREF_JS_EXPORTS = $(srcdir)/b2g.js +ifdef ENABLE_MARIONETTE +DEFINES += -DENABLE_MARIONETTE=1 +endif + ifndef LIBXUL_SDK PROGRAM=$(MOZ_APP_NAME)$(BIN_SUFFIX) diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index f4605c0ee9b5..f3b39ccf46a6 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -432,9 +432,11 @@ pref("full-screen-api.ignore-widgets", true); pref("media.volume.steps", 10); +#ifdef ENABLE_MARIONETTE //Enable/disable marionette server, set listening port pref("marionette.defaultPrefs.enabled", true); pref("marionette.defaultPrefs.port", 2828); +#endif #ifdef MOZ_UPDATER pref("app.update.enabled", true); diff --git a/b2g/config/mozconfigs/gb_armv7a_gecko/debug b/b2g/config/mozconfigs/gb_armv7a_gecko/debug index 2f2fc761a52f..5f14adf3c180 100644 --- a/b2g/config/mozconfigs/gb_armv7a_gecko/debug +++ b/b2g/config/mozconfigs/gb_armv7a_gecko/debug @@ -11,7 +11,7 @@ ac_add_options --disable-elf-hack ac_add_options --enable-debug-symbols ac_add_options --enable-debug ac_add_options --with-ccache -ac_add_options --enable-marionette +ENABLE_MARIONETTE=1 # Enable dump() from JS. export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP diff --git a/b2g/config/mozconfigs/gb_armv7a_gecko/nightly b/b2g/config/mozconfigs/gb_armv7a_gecko/nightly index 5ae933314dd4..31cd349250b2 100644 --- a/b2g/config/mozconfigs/gb_armv7a_gecko/nightly +++ b/b2g/config/mozconfigs/gb_armv7a_gecko/nightly @@ -11,7 +11,7 @@ ac_add_options --disable-elf-hack ac_add_options --enable-debug-symbols ac_add_options --enable-profiling ac_add_options --with-ccache -ac_add_options --enable-marionette +ENABLE_MARIONETTE=1 # Enable dump() from JS. export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP diff --git a/b2g/config/mozconfigs/ics_armv7a_gecko/debug b/b2g/config/mozconfigs/ics_armv7a_gecko/debug index 73e866a12023..64e0fa88a3f2 100644 --- a/b2g/config/mozconfigs/ics_armv7a_gecko/debug +++ b/b2g/config/mozconfigs/ics_armv7a_gecko/debug @@ -14,7 +14,7 @@ ac_add_options --disable-elf-hack ac_add_options --enable-debug-symbols ac_add_options --enable-debug #ac_add_options --with-ccache -ac_add_options --enable-marionette +ENABLE_MARIONETTE=1 # Enable dump() from JS. export CXXFLAGS="-DMOZ_ENABLE_JS_DUMP -include $topsrcdir/gonk-toolchain/gonk-misc/Unicode.h -include $topsrcdir/gonk-toolchain/system/vold/ResponseCode.h" diff --git a/b2g/config/mozconfigs/ics_armv7a_gecko/nightly b/b2g/config/mozconfigs/ics_armv7a_gecko/nightly index 6bf1ba700afe..583b3a94d36a 100644 --- a/b2g/config/mozconfigs/ics_armv7a_gecko/nightly +++ b/b2g/config/mozconfigs/ics_armv7a_gecko/nightly @@ -14,7 +14,7 @@ ac_add_options --disable-elf-hack ac_add_options --enable-debug-symbols ac_add_options --enable-profiling #ac_add_options --with-ccache -ac_add_options --enable-marionette +ENABLE_MARIONETTE=1 # Enable dump() from JS. export CXXFLAGS="-DMOZ_ENABLE_JS_DUMP -include $topsrcdir/gonk-toolchain/gonk-misc/Unicode.h -include $topsrcdir/gonk-toolchain/system/vold/ResponseCode.h" diff --git a/b2g/config/mozconfigs/linux32_gecko/nightly b/b2g/config/mozconfigs/linux32_gecko/nightly index aaa7464b1667..3b7a2e833d5d 100644 --- a/b2g/config/mozconfigs/linux32_gecko/nightly +++ b/b2g/config/mozconfigs/linux32_gecko/nightly @@ -33,6 +33,6 @@ ac_add_options --with-ccache=/usr/bin/ccache #B2G options ac_add_options --enable-application=b2g -ac_add_options --enable-marionette +ENABLE_MARIONETTE=1 ac_add_options --disable-elf-hack export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP diff --git a/b2g/config/mozconfigs/linux64_gecko/nightly b/b2g/config/mozconfigs/linux64_gecko/nightly index 305d4087634c..fd23729b96df 100644 --- a/b2g/config/mozconfigs/linux64_gecko/nightly +++ b/b2g/config/mozconfigs/linux64_gecko/nightly @@ -35,6 +35,6 @@ ac_add_options --with-ccache=/usr/bin/ccache #B2G options ac_add_options --enable-application=b2g -ac_add_options --enable-marionette +ENABLE_MARIONETTE=1 ac_add_options --disable-elf-hack export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP diff --git a/b2g/config/mozconfigs/macosx64_gecko/nightly b/b2g/config/mozconfigs/macosx64_gecko/nightly index 62aabf060740..348edf231803 100644 --- a/b2g/config/mozconfigs/macosx64_gecko/nightly +++ b/b2g/config/mozconfigs/macosx64_gecko/nightly @@ -23,6 +23,6 @@ ac_add_options --enable-warnings-as-errors ac_add_options --enable-application=b2g ac_add_options --enable-debug-symbols ac_add_options --with-ccache -ac_add_options --enable-marionette +ENABLE_MARIONETTE=1 export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP diff --git a/b2g/config/mozconfigs/win32_gecko/nightly b/b2g/config/mozconfigs/win32_gecko/nightly index 56d8dc7c9a83..affb7f1b1984 100644 --- a/b2g/config/mozconfigs/win32_gecko/nightly +++ b/b2g/config/mozconfigs/win32_gecko/nightly @@ -24,6 +24,6 @@ fi # B2G Options ac_add_options --enable-application=b2g -ac_add_options --enable-marionette +ENABLE_MARIONETTE=1 export CXXFLAGS=-DMOZ_ENABLE_JS_DUMP diff --git a/b2g/confvars.sh b/b2g/confvars.sh index aa9c25e98d36..82d209858424 100755 --- a/b2g/confvars.sh +++ b/b2g/confvars.sh @@ -38,6 +38,5 @@ fi MOZ_APP_ID={3c2e2abc-06d4-11e1-ac3b-374f68613e61} MOZ_EXTENSION_MANAGER=1 -ENABLE_MARIONETTE=1 MOZ_SYS_MSG=1 diff --git a/b2g/installer/Makefile.in b/b2g/installer/Makefile.in index 9bb1de88f527..ecd50bc58d4b 100644 --- a/b2g/installer/Makefile.in +++ b/b2g/installer/Makefile.in @@ -38,6 +38,10 @@ DEFINES += -DJAREXT=$(JAREXT) include $(topsrcdir)/ipc/app/defs.mk DEFINES += -DMOZ_CHILD_PROCESS_NAME=$(MOZ_CHILD_PROCESS_NAME) +ifdef ENABLE_MARIONETTE +DEFINES += -DENABLE_MARIONETTE=1 +endif + ifdef MOZ_PKG_MANIFEST_P MOZ_PKG_MANIFEST = package-manifest endif diff --git a/b2g/installer/package-manifest.in b/b2g/installer/package-manifest.in index b9f21164ac4b..5de776e9f370 100644 --- a/b2g/installer/package-manifest.in +++ b/b2g/installer/package-manifest.in @@ -675,10 +675,12 @@ bin/components/@DLL_PREFIX@nkgnomevfs@DLL_SUFFIX@ @BINPATH@/components/B2GComponents.xpt @BINPATH@/components/CameraContent.js @BINPATH@/@DLL_PREFIX@omxplugin@DLL_SUFFIX@ +#ifdef ENABLE_MARIONETTE @BINPATH@/chrome/marionette@JAREXT@ @BINPATH@/chrome/marionette.manifest @BINPATH@/components/MarionetteComponents.manifest @BINPATH@/components/marionettecomponent.js +#endif @BINPATH@/components/AlertsService.js @BINPATH@/components/ContentPermissionPrompt.js #ifdef MOZ_UPDATER diff --git a/browser/app/Makefile.in b/browser/app/Makefile.in index 0d3ab5e4af25..5f891caa3596 100644 --- a/browser/app/Makefile.in +++ b/browser/app/Makefile.in @@ -12,6 +12,10 @@ include $(DEPTH)/config/autoconf.mk DIRS = profile/extensions dist_dest = $(DIST)/$(MOZ_MACBUNDLE_NAME) +ifdef ENABLE_MARIONETTE +DEFINES += -DENABLE_MARIONETTE=1 +endif + PREF_JS_EXPORTS = $(srcdir)/profile/firefox.js \ $(NULL) diff --git a/browser/base/content/browser-social.js b/browser/base/content/browser-social.js index 2f204f6d8e19..686095d7b741 100644 --- a/browser/base/content/browser-social.js +++ b/browser/base/content/browser-social.js @@ -282,14 +282,6 @@ var SocialToolbar = { init: function SocialToolbar_init() { document.getElementById("social-provider-image").setAttribute("image", Social.provider.iconURL); - let removeItem = document.getElementById("social-remove-menuitem"); - let brandShortName = document.getElementById("bundle_brand").getString("brandShortName"); - let label = gNavigatorBundle.getFormattedString("social.remove.label", - [brandShortName]); - let accesskey = gNavigatorBundle.getString("social.remove.accesskey"); - removeItem.setAttribute("label", label); - removeItem.setAttribute("accesskey", accesskey); - let statusAreaPopup = document.getElementById("social-statusarea-popup"); statusAreaPopup.addEventListener("popupshown", function(e) { this.button.setAttribute("open", "true"); @@ -344,23 +336,24 @@ var SocialToolbar = { let iconNames = Object.keys(provider.ambientNotificationIcons); let iconBox = document.getElementById("social-status-iconbox"); let notifBox = document.getElementById("social-notification-box"); - let notifBrowsers = document.createDocumentFragment(); + let notificationFrames = document.createDocumentFragment(); let iconContainers = document.createDocumentFragment(); for each(let name in iconNames) { let icon = provider.ambientNotificationIcons[name]; - let notifBrowserId = "social-status-" + icon.name; - let notifBrowser = document.getElementById(notifBrowserId); - if (!notifBrowser) { - notifBrowser = document.createElement("iframe"); - notifBrowser.setAttribute("type", "content"); - notifBrowser.setAttribute("id", notifBrowserId); - notifBrowsers.appendChild(notifBrowser); + let notificationFrameId = "social-status-" + icon.name; + let notificationFrame = document.getElementById(notificationFrameId); + if (!notificationFrame) { + notificationFrame = document.createElement("iframe"); + notificationFrame.setAttribute("type", "content"); + notificationFrame.setAttribute("id", notificationFrameId); + notificationFrame.setAttribute("mozbrowser", "true"); + notificationFrames.appendChild(notificationFrame); } - notifBrowser.setAttribute("origin", provider.origin); - if (notifBrowser.getAttribute("src") != icon.contentPanel) - notifBrowser.setAttribute("src", icon.contentPanel); + notificationFrame.setAttribute("origin", provider.origin); + if (notificationFrame.getAttribute("src") != icon.contentPanel) + notificationFrame.setAttribute("src", icon.contentPanel); let iconId = "social-notification-icon-" + icon.name; let iconContainer = document.getElementById(iconId); @@ -387,33 +380,27 @@ var SocialToolbar = { } if (iconImage.getAttribute("src") != icon.iconURL) iconImage.setAttribute("src", icon.iconURL); - iconImage.setAttribute("notifBrowserId", notifBrowserId); + iconImage.setAttribute("notificationFrameId", notificationFrameId); iconCounter.collapsed = !icon.counter; iconCounter.firstChild.textContent = icon.counter || ""; } - notifBox.appendChild(notifBrowsers); + notifBox.appendChild(notificationFrames); iconBox.appendChild(iconContainers); - - let browserIter = notifBox.firstElementChild; - while (browserIter) { - browserIter.docShell.isAppTab = true; - browserIter = browserIter.nextElementSibling; - } }, showAmbientPopup: function SocialToolbar_showAmbientPopup(iconContainer) { let iconImage = iconContainer.firstChild; let panel = document.getElementById("social-notification-panel"); let notifBox = document.getElementById("social-notification-box"); - let notifBrowser = document.getElementById(iconImage.getAttribute("notifBrowserId")); + let notificationFrame = document.getElementById(iconImage.getAttribute("notificationFrameId")); panel.hidden = false; function sizePanelToContent() { // FIXME: bug 764787: Maybe we can use nsIDOMWindowUtils.getRootBounds() here? // Need to handle dynamic sizing - let doc = notifBrowser.contentDocument; + let doc = notificationFrame.contentDocument; if (!doc) { return; } @@ -426,23 +413,23 @@ var SocialToolbar = { // Clear dimensions on all browsers so the panel size will // only use the selected browser. - let browserIter = notifBox.firstElementChild; - while (browserIter) { - browserIter.hidden = (browserIter != notifBrowser); - browserIter = browserIter.nextElementSibling; + let frameIter = notifBox.firstElementChild; + while (frameIter) { + frameIter.hidden = (frameIter != notificationFrame); + frameIter = frameIter.nextElementSibling; } let [height, width] = [body.firstChild.offsetHeight || 300, 330]; - notifBrowser.style.width = width + "px"; - notifBrowser.style.height = height + "px"; + notificationFrame.style.width = width + "px"; + notificationFrame.style.height = height + "px"; } sizePanelToContent(); function dispatchPanelEvent(name) { - let evt = notifBrowser.contentDocument.createEvent("CustomEvent"); + let evt = notificationFrame.contentDocument.createEvent("CustomEvent"); evt.initCustomEvent(name, true, true, {}); - notifBrowser.contentDocument.documentElement.dispatchEvent(evt); + notificationFrame.contentDocument.documentElement.dispatchEvent(evt); } panel.addEventListener("popuphiding", function onpopuphiding() { @@ -454,12 +441,13 @@ var SocialToolbar = { panel.addEventListener("popupshown", function onpopupshown() { panel.removeEventListener("popupshown", onpopupshown); SocialToolbar.button.setAttribute("open", "true"); - if (notifBrowser.contentDocument.readyState == "complete") { + notificationFrame.docShell.isAppTab = true; + if (notificationFrame.contentDocument.readyState == "complete") { dispatchPanelEvent("socialFrameShow"); } else { // first time load, wait for load and dispatch after load - notifBrowser.addEventListener("load", function panelBrowserOnload(e) { - notifBrowser.removeEventListener("load", panelBrowserOnload, true); + notificationFrame.addEventListener("load", function panelBrowserOnload(e) { + notificationFrame.removeEventListener("load", panelBrowserOnload, true); setTimeout(function() { dispatchPanelEvent("socialFrameShow"); }, 0); diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 3d018dc07f47..f14f649baa94 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -1286,9 +1286,7 @@ var gBrowserInit = { UpdateUrlbarSearchSplitterState(); - if (isLoadingBlank && gURLBar) - gURLBar.focus(); - if (!isLoadingBlank || !gURLBar || !gURLBar.focused) + if (!isLoadingBlank || !focusAndSelectUrlBar()) gBrowser.selectedBrowser.focus(); gNavToolbox.customizeDone = BrowserToolboxCustomizeDone; @@ -1990,7 +1988,7 @@ function focusAndSelectUrlBar() { FullScreen.mouseoverToggle(true); gURLBar.focus(); - if (gURLBar.focused) { + if (document.activeElement == gURLBar.inputField) { gURLBar.select(); return true; } @@ -3350,7 +3348,7 @@ const BrowserSearch = { FullScreen.mouseoverToggle(true); if (searchBar) searchBar.focus(); - if (searchBar && searchBar.textbox.focused) { + if (searchBar && document.activeElement == searchBar.textbox.inputField) { searchBar.select(); } else { openUILinkIn(Services.search.defaultEngine.searchForm, "current"); diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index 9573c0867801..764543abc9e4 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -674,8 +674,6 @@ oncommand="SocialUI.showProfile(); document.getElementById('social-statusarea-popup').hidePopup();"/> - row { + margin-bottom: 8px; +} + +#editBMPanel_rows > row:last-of-type { + margin-bottom: 0; +} + +/**** Input elements ****/ + +#editBMPanel_rows > row > textbox, +#editBMPanel_rows > row > hbox > textbox { + -moz-appearance: none; + background: linear-gradient(#fafafa, #fff); + background-clip: padding-box; + border-radius: 3px; + border: 1px solid rgba(0,0,0,.3) !important; + box-shadow: inset 0 1px 1px 1px rgba(0,0,0,.05), + 0 1px rgba(255,255,255,.3); + margin: 0; + padding: 3px 6px; +} + +#editBMPanel_rows > row > textbox[focused="true"], +#editBMPanel_rows > row > hbox > textbox[focused="true"] { + border-color: -moz-mac-focusring !important; + box-shadow: @focusRingShadow@; +} + /**** HUD style buttons ****/ .editBookmarkPanelHeaderButton, .editBookmarkPanelBottomButton { @hudButton@ - margin: 6px; - min-width: 79px; + margin: 0; + min-width: 82px; min-height: 22px; } @@ -1355,47 +1384,45 @@ window[tabsontop="false"] richlistitem[type~="action"][actiontype="switchtab"][s margin-bottom: 6px; } +.editBookmarkPanelBottomButton:last-child { + -moz-margin-start: 8px; +} + /* The following elements come from editBookmarkOverlay.xul. Styling that's specific to the editBookmarkPanel should be in browser.css. Styling that should be shared by all editBookmarkOverlay.xul consumers should be in editBookmarkOverlay.css. */ #editBMPanel_newFolderBox { - background-image: -moz-linear-gradient(rgb(90,90,90), rgb(40,40,40)); + background: linear-gradient(#fff, #f2f2f2); background-origin: padding-box; background-clip: padding-box; border-radius: 0 0 3px 3px; - border: 1px solid rgba(0,0,0,.3); - border-top: none; - box-shadow: inset 0 -1px 2px rgba(0,0,0,.2), - inset 0 1px 0 rgba(255,255,255,.15), - 0 1px 0 rgba(255,255,255,.15); + border: 1px solid #a5a5a5; + box-shadow: inset 0 1px rgba(255,255,255,.8), + inset 0 0 1px rgba(255,255, 255,.25), + 0 1px rgba(255,255,255,.3); + margin: 0; padding: 0; - margin-left: 4px; - margin-right: 4px; - margin-bottom: 8px; height: 20px; } #editBMPanel_newFolderButton { -moz-appearance: none; - border: 0; - -moz-border-end-width: 3px; - border-style: solid; - -moz-border-right-colors: rgba(255,255,255,.1) rgba(0,0,0,.5) rgba(255,255,255,.1); - -moz-border-left-colors: rgba(255,255,255,.1) rgba(0,0,0,.5) rgba(255,255,255,.1); + border: 0 solid #a5a5a5; + -moz-border-end-width: 1px; padding: 0 9px; margin: 0; min-width: 21px; min-height: 20px; height: 20px; color: #fff; - list-style-image: url("chrome://browser/skin/hud-style-new-folder-plus-sign.png"); + list-style-image: url("chrome://browser/skin/panel-plus-sign.png"); position: relative; } #editBMPanel_newFolderButton:hover:active { - background: -moz-linear-gradient(rgba(40,40,40,.9), rgba(70,70,70,.9)); + background: linear-gradient(rgba(40,40,40,.9), rgba(70,70,70,.9)); box-shadow: inset 0 0 3px rgba(0,0,0,.2), inset 0 1px 7px rgba(0,0,0,.4); } @@ -1409,10 +1436,13 @@ window[tabsontop="false"] richlistitem[type~="action"][actiontype="switchtab"][s #editBMPanel_folderMenuList { @hudButton@ - border-radius: 3px; + background-clip: padding-box; + margin: 0; min-height: 22px; - -moz-padding-start: 4px; - -moz-padding-end: 0; + padding-top: 2px; + padding-bottom: 1px; + -moz-padding-start: 8px; + -moz-padding-end: 4px; } #editBMPanel_folderMenuList:-moz-focusring { @@ -1431,101 +1461,42 @@ window[tabsontop="false"] richlistitem[type~="action"][actiontype="switchtab"][s border: 0; margin: 0; padding: 0; + -moz-padding-end: 4px; + width: 7px; } #editBMPanel_folderMenuList > .menulist-dropmarker > .dropmarker-icon { - list-style-image: url("chrome://browser/skin/hud-style-dropmarker-double-arrows.png"); + list-style-image: url("chrome://global/skin/icons/panel-dropmarker.png"); } -/**** folder tree ****/ - -#editBMPanel_folderTree { - -moz-appearance: none; - border-radius: 2px 2px 0 0; - background-color: rgba(50,50,50,.9); - border: 1px solid rgba(0,0,0,.3); - border-bottom: none; - box-shadow: inset 0 1px 2px rgba(0,0,0,.15); - color: #fff; - /* Implements editBookmarkPanel resizing on folderTree un-collapse. */ - min-width: 27em; - position: relative; -} - -#editBMPanel_folderTree:-moz-focusring { - box-shadow: 0 0 4px 1px -moz-mac-focusring, - 0 0 2px 1px -moz-mac-focusring; -} - -#editBMPanel_folderTree > treechildren::-moz-tree-twisty { - -moz-appearance: none; - list-style-image: url("chrome://browser/skin/hud-style-twisties.png"); - -moz-image-region: rect(0px, 10px, 10px, 0px); - margin-top: 1px; - -moz-margin-end: 1px; -} - -#editBMPanel_folderTree > treechildren::-moz-tree-twisty(open) { - -moz-image-region: rect(0px, 20px, 10px, 10px); -} - -#editBMPanel_folderTree > treechildren::-moz-tree-twisty(selected) { - -moz-image-region: rect(0px, 30px, 10px, 20px); -} - -#editBMPanel_folderTree > treechildren::-moz-tree-twisty(selected, open) { - -moz-image-region: rect(0px, 40px, 10px, 30px); -} +/**** folder tree and tag selector ****/ +#editBMPanel_folderTree, #editBMPanel_tagsSelector { -moz-appearance: none; - border-radius: 2px; - background-color: rgba(50,50,50,1); + background: linear-gradient(#fafafa, #fff); + background-clip: padding-box; + border-radius: 3px; border: 1px solid rgba(0,0,0,.3); - border-bottom: none; - box-shadow: inset 0 1px 2px rgba(0,0,0,.15), - 0 1px 0 rgba(255,255,255,.15); - color: #fff; + box-shadow: inset 0 1px 1px 1px rgba(0,0,0,.05), + 0 1px rgba(255,255,255,.3); + margin: 0; } +#editBMPanel_folderTree:-moz-focusring, #editBMPanel_tagsSelector:-moz-focusring { - @hudButtonFocused@ + border-color: -moz-mac-focusring; + box-shadow: @focusRingShadow@; } -#editBMPanel_tagsSelector .listcell-check { - -moz-appearance: none; - border: 0; - background: url("chrome://browser/skin/hud-style-check-box-empty.png") no-repeat 50% 50%; - min-height: 14px; - min-width: 14px; -} - -#editBMPanel_tagsSelector .listcell-check[checked="true"] { - background-image: url("chrome://browser/skin/hud-style-check-box-checked.png"); -} - -#editBMPanel_folderTree > treechildren::-moz-tree-row { - color: #fff; - background-color: transparent; - border: none; -} - -#editBMPanel_folderTree > treechildren::-moz-tree-row(selected) { - background-color: #b3b3b3; -} - -#editBMPanel_folderTree > treechildren::-moz-tree-cell-text(selected), -#editBMPanel_folderTree > treechildren::-moz-tree-cell-text(selected, focus) { - color: #222222; -} - -#editBMPanel_folderTree > treechildren::-moz-tree-row(selected, focus) { - background-color: #b3b3b3; -} - -#editBMPanel_tagsSelector > listitem[selected="true"] { - color: #222222; - background-color: #b3b3b3; +#editBMPanel_folderTree { + border-bottom: none; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + /* Implements editBookmarkPanel resizing on folderTree un-collapse. */ + margin: 0 !important; + min-width: 27em; + position: relative; } /**** expanders ****/ @@ -1533,13 +1504,10 @@ window[tabsontop="false"] richlistitem[type~="action"][actiontype="switchtab"][s #editBookmarkPanel .expander-up, #editBookmarkPanel .expander-down { @hudButton@ - border-radius: 3px; + margin: 0; -moz-margin-start: 4px; - -moz-margin-end: 2px; - padding: 0; - -moz-padding-start: 4px; - min-width: 10px; - min-height: 20px; + min-width: 27px; + min-height: 22px; } #editBookmarkPanel .expander-up:-moz-focusring, @@ -1553,36 +1521,27 @@ window[tabsontop="false"] richlistitem[type~="action"][actiontype="switchtab"][s } #editBookmarkPanel .expander-up { - list-style-image: url("chrome://browser/skin/hud-style-expander-open.png"); + list-style-image: url("chrome://browser/skin/panel-expander-open.png"); } #editBookmarkPanel .expander-down { - list-style-image: url("chrome://browser/skin/hud-style-expander-closed.png"); + list-style-image: url("chrome://browser/skin/panel-expander-closed.png"); } -#editBMPanel_tagsField { - -moz-appearance: none !important; - -moz-padding-start: 3px !important; - margin: 2px !important; - border: 1px solid rgba(0,0,0,.5) !important; - box-shadow: inset 0 1px 0 rgba(0,0,0,.3); - background-color: #666 !important; - background-clip: padding-box; - background-origin: padding-box; - color: #fff !important; - min-height: 20px; +#editBookmarkPanel .expander-up .button-icon, +#editBookmarkPanel .expander-down .button-icon { + margin: 1px 0 0; +} + +#editBookmarkPanel .expander-up .button-text, +#editBookmarkPanel .expander-down .button-text { + display: none; } #editBMPanel_tagsField > .autocomplete-textbox-container > .textbox-input-box > html|*.textbox-input:-moz-placeholder { color: #bbb; } -#editBMPanel_tagsField[focused="true"] { - @hudButtonFocused@ - background-color: #eee !important; - color: #000 !important; -} - .editBMPanel_rowLabel { text-align: end; } @@ -1590,16 +1549,11 @@ window[tabsontop="false"] richlistitem[type~="action"][actiontype="switchtab"][s .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; - color: hsl(0,0%,60%); -} - -.panel-promo-message > .text-link { - color: hsl(210,100%,75%); + background: #e5e5e5; + border-top: 1px solid hsla(0,0%,0%,.1); + border-radius: 0 0 5px 5px; + box-shadow: 0 -1px hsla(0,0%,100%,.5) inset, 0 1px 1px hsla(0,0%,0%,.03) inset; + color: #808080; } .panel-promo-icon { @@ -1609,7 +1563,7 @@ window[tabsontop="false"] richlistitem[type~="action"][actiontype="switchtab"][s } .panel-promo-closebutton { - list-style-image: url("chrome://global/skin/notification/close.png"); + list-style-image: url("chrome://global/skin/icons/close.png"); -moz-image-region: rect(0, 16px, 16px, 0); border: none; -moz-margin-end: -14px; @@ -2330,7 +2284,7 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker { #identity-popup-content-box.verifiedIdentity > #identity-popup-encryption > vbox > #identity-popup-encryption-icon , #identity-popup-content-box.verifiedDomain > #identity-popup-encryption > vbox > #identity-popup-encryption-icon { margin-top: 5px; - list-style-image: url("chrome://browser/skin/Secure-Glyph-White.png"); + list-style-image: url("chrome://browser/skin/Secure-Glyph.png"); } #notification-popup-box { @@ -2377,18 +2331,15 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker { list-style-image: url(chrome://browser/skin/Geolocation-16.png); } -#notification-popup .text-link { - color: #fff; +#notification-popup .text-link, .panel-arrowcontent .text-link { + color: #0073e6; + text-decoration: none; } .geolocation-text-link { -moz-margin-start: 0; /* override default label margin to match description margin */ } -.telemetry-text-link { - color: #fff; -} - #addons-notification-icon { list-style-image: url(chrome://mozapps/skin/extensions/extensionGeneric-16.png); } diff --git a/browser/themes/pinstripe/downloads/buttons.png b/browser/themes/pinstripe/downloads/buttons.png index 0fdb1b4c138e..0b5161ff01e3 100644 Binary files a/browser/themes/pinstripe/downloads/buttons.png and b/browser/themes/pinstripe/downloads/buttons.png differ diff --git a/browser/themes/pinstripe/downloads/downloads.css b/browser/themes/pinstripe/downloads/downloads.css index a9d5e8edb6bd..146f89c8aeaa 100644 --- a/browser/themes/pinstripe/downloads/downloads.css +++ b/browser/themes/pinstripe/downloads/downloads.css @@ -32,12 +32,13 @@ } #downloadsPanel[hasdownloads] > #downloadsHistory { - border-top: 1px solid hsla(0,0%,100%,.1); - background-color: hsla(0,0%,7%,.3); - box-shadow: 0 1px 1px hsla(0,0%,0%,.25) inset; + background: #e5e5e5; + border-top: 1px solid hsla(0,0%,0%,.1); + box-shadow: 0 -1px hsla(0,0%,100%,.5) inset, 0 1px 1px hsla(0,0%,0%,.03) inset; } #downloadsHistory > .button-box { + color: #808080; margin: 1em; } @@ -78,7 +79,6 @@ richlistitem[type="download"]:last-child { } .downloadInfo { - color: white; padding: 8px; -moz-padding-end: 0; } diff --git a/browser/themes/pinstripe/hud-style-check-box-checked.png b/browser/themes/pinstripe/hud-style-check-box-checked.png deleted file mode 100644 index 3328a5bf0b9e..000000000000 Binary files a/browser/themes/pinstripe/hud-style-check-box-checked.png and /dev/null differ diff --git a/browser/themes/pinstripe/hud-style-check-box-empty.png b/browser/themes/pinstripe/hud-style-check-box-empty.png deleted file mode 100644 index d8a55bd3fe4f..000000000000 Binary files a/browser/themes/pinstripe/hud-style-check-box-empty.png and /dev/null differ diff --git a/browser/themes/pinstripe/hud-style-dropmarker-double-arrows.png b/browser/themes/pinstripe/hud-style-dropmarker-double-arrows.png deleted file mode 100644 index ecf5ee24eb6e..000000000000 Binary files a/browser/themes/pinstripe/hud-style-dropmarker-double-arrows.png and /dev/null differ diff --git a/browser/themes/pinstripe/hud-style-expander-closed.png b/browser/themes/pinstripe/hud-style-expander-closed.png deleted file mode 100644 index 25219fea2257..000000000000 Binary files a/browser/themes/pinstripe/hud-style-expander-closed.png and /dev/null differ diff --git a/browser/themes/pinstripe/hud-style-expander-open.png b/browser/themes/pinstripe/hud-style-expander-open.png deleted file mode 100644 index 168b53a5e8b9..000000000000 Binary files a/browser/themes/pinstripe/hud-style-expander-open.png and /dev/null differ diff --git a/browser/themes/pinstripe/hud-style-new-folder-plus-sign.png b/browser/themes/pinstripe/hud-style-new-folder-plus-sign.png deleted file mode 100644 index 5d3e60d3e840..000000000000 Binary files a/browser/themes/pinstripe/hud-style-new-folder-plus-sign.png and /dev/null differ diff --git a/browser/themes/pinstripe/hud-style-twisties.png b/browser/themes/pinstripe/hud-style-twisties.png deleted file mode 100644 index 6d668c2b8e9e..000000000000 Binary files a/browser/themes/pinstripe/hud-style-twisties.png and /dev/null differ diff --git a/browser/themes/pinstripe/jar.mn b/browser/themes/pinstripe/jar.mn index 0e3b645a1fd9..04167bc0723a 100644 --- a/browser/themes/pinstripe/jar.mn +++ b/browser/themes/pinstripe/jar.mn @@ -21,13 +21,6 @@ browser.jar: skin/classic/browser/Geolocation-16.png skin/classic/browser/Geolocation-64.png skin/classic/browser/home.png - skin/classic/browser/hud-style-check-box-checked.png - skin/classic/browser/hud-style-check-box-empty.png - skin/classic/browser/hud-style-dropmarker-double-arrows.png - skin/classic/browser/hud-style-expander-closed.png - skin/classic/browser/hud-style-expander-open.png - skin/classic/browser/hud-style-new-folder-plus-sign.png - skin/classic/browser/hud-style-twisties.png skin/classic/browser/identity.png skin/classic/browser/identity-icons-generic.png skin/classic/browser/identity-icons-https.png @@ -37,6 +30,9 @@ browser.jar: skin/classic/browser/KUI-close.png skin/classic/browser/menu-back.png skin/classic/browser/menu-forward.png + skin/classic/browser/panel-expander-closed.png + skin/classic/browser/panel-expander-open.png + skin/classic/browser/panel-plus-sign.png skin/classic/browser/page-livemarks.png skin/classic/browser/pageInfo.css skin/classic/browser/Privacy-16.png @@ -45,7 +41,7 @@ browser.jar: skin/classic/browser/searchbar-dropmarker.png skin/classic/browser/searchbar.css skin/classic/browser/Search.png - skin/classic/browser/Secure-Glyph-White.png + skin/classic/browser/Secure-Glyph.png skin/classic/browser/keyhole-circle.png skin/classic/browser/Toolbar.png skin/classic/browser/toolbarbutton-dropmarker.png diff --git a/browser/themes/pinstripe/panel-expander-closed.png b/browser/themes/pinstripe/panel-expander-closed.png new file mode 100644 index 000000000000..f0e97b22e161 Binary files /dev/null and b/browser/themes/pinstripe/panel-expander-closed.png differ diff --git a/browser/themes/pinstripe/panel-expander-open.png b/browser/themes/pinstripe/panel-expander-open.png new file mode 100644 index 000000000000..e3febf4ffb85 Binary files /dev/null and b/browser/themes/pinstripe/panel-expander-open.png differ diff --git a/browser/themes/pinstripe/panel-plus-sign.png b/browser/themes/pinstripe/panel-plus-sign.png new file mode 100644 index 000000000000..375601e680c3 Binary files /dev/null and b/browser/themes/pinstripe/panel-plus-sign.png differ diff --git a/browser/themes/pinstripe/shared.inc b/browser/themes/pinstripe/shared.inc index f42d6838d245..490c1c7756af 100644 --- a/browser/themes/pinstripe/shared.inc +++ b/browser/themes/pinstripe/shared.inc @@ -1,6 +1,6 @@ %include ../../../toolkit/themes/pinstripe/global/shared.inc %include ../browserShared.inc -%define hudButton -moz-appearance: none; color: #fff; text-shadow: 0 -1px 0 rgba(0,0,0,.5); border-radius: 12px; border: 1px solid rgba(0,0,0,.65); background: -moz-linear-gradient(rgba(110,110,110,.9), rgba(70,70,70,.9) 49%, rgba(50,50,50,.9) 51%, rgba(40,40,40,.9)); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 0 1px rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1); background-clip: padding-box; background-origin: padding-box; padding: 2px 9px; -%define hudButtonPressed background: -moz-linear-gradient(rgba(40,40,40,.9), rgba(70,70,70,.9)); box-shadow: inset 0 0 3px rgba(0,0,0,.2), inset 0 1px 7px rgba(0,0,0,.4), 0 1px 0 rgba(255,255,255,.1); +%define hudButton -moz-appearance: none; color: #434343; border-radius: 4px; border: 1px solid #b5b5b5; background: -moz-linear-gradient(#fff, #f2f2f2); box-shadow: inset 0 1px rgba(255,255,255,.8), inset 0 0 1px rgba(255,255, 255,.25), 0 1px rgba(255,255,255,.3); background-clip: padding-box; background-origin: padding-box; padding: 2px 6px; +%define hudButtonPressed box-shadow: inset 0 1px 4px -3px #000, 0 1px rgba(255,255,255,.3); %define hudButtonFocused box-shadow: 0 0 1px -moz-mac-focusring inset, 0 0 4px 1px -moz-mac-focusring, 0 0 2px 1px -moz-mac-focusring; diff --git a/browser/themes/pinstripe/sync-notification-24.png b/browser/themes/pinstripe/sync-notification-24.png index 77f973f91f18..8d2ec8fa8ebd 100644 Binary files a/browser/themes/pinstripe/sync-notification-24.png and b/browser/themes/pinstripe/sync-notification-24.png differ diff --git a/configure.in b/configure.in index 2cd8e3e7deb8..4f86389c9f54 100644 --- a/configure.in +++ b/configure.in @@ -5774,6 +5774,10 @@ if test -n "$MOZ_ANGLE_RENDERER"; then MOZ_D3DX9_CAB=`find "$MOZ_DIRECTX_SDK_PATH"/Redist -name *d3dx9_${MOZ_D3DX9_VERSION}_${MOZ_DIRECTX_SDK_CPU_SUFFIX}.cab | head -n1` MOZ_D3DCOMPILER_CAB=`find "$MOZ_DIRECTX_SDK_PATH"/Redist -name *D3DCompiler_${MOZ_D3DX9_VERSION}_${MOZ_DIRECTX_SDK_CPU_SUFFIX}.cab | head -n1` + if test -z "$MOZ_D3DX9_CAB" -o -z "$MOZ_D3DCOMPILER_CAB"; then + AC_MSG_ERROR([Couldn't find the DirectX redistributable files. Either reinstall the DirectX SDK (making sure the "DirectX Redistributable Files" option is selected), or reconfigure with --disable-webgl.]) + fi + MOZ_D3DX9_DLL=d3dx9_$MOZ_D3DX9_VERSION.dll MOZ_D3DCOMPILER_DLL=D3DCompiler_$MOZ_D3DX9_VERSION.dll fi diff --git a/content/base/public/nsContentUtils.h b/content/base/public/nsContentUtils.h index c24c6c06adb0..3beee8ed00e7 100644 --- a/content/base/public/nsContentUtils.h +++ b/content/base/public/nsContentUtils.h @@ -174,14 +174,6 @@ struct ViewportInfo // Whether or not the user can zoom in and out on the page. Default is true. bool allowZoom; - - // This is a holdover from e10s fennec, and might be removed in the future. - // It's a hack to work around bugs that didn't allow zooming of documents - // from within the parent process. It is still used in native Fennec for XUL - // documents, but it should probably be removed. - // Currently, from, within GetViewportInfo(), This is only set to false - // if the document is a XUL document. - bool autoScale; }; struct EventNameMapping diff --git a/content/base/src/nsContentUtils.cpp b/content/base/src/nsContentUtils.cpp index 28cf0595ac0e..241c1a89cc94 100644 --- a/content/base/src/nsContentUtils.cpp +++ b/content/base/src/nsContentUtils.cpp @@ -5055,42 +5055,37 @@ nsContentUtils::GetViewportInfo(nsIDocument *aDocument) ret.defaultZoom = 1.0; ret.autoSize = true; ret.allowZoom = true; - ret.autoScale = true; - // If the docType specifies that we are on a site optimized for mobile, - // then we want to return specially crafted defaults for the viewport info. - nsCOMPtr - domDoc(do_QueryInterface(aDocument)); - - nsCOMPtr docType; - nsresult rv = domDoc->GetDoctype(getter_AddRefs(docType)); - if (NS_SUCCEEDED(rv) && docType) { - nsAutoString docId; - rv = docType->GetPublicId(docId); - if (NS_SUCCEEDED(rv)) { - if ((docId.Find("WAP") != -1) || - (docId.Find("Mobile") != -1) || - (docId.Find("WML") != -1)) - { - return ret; + nsAutoString viewport; + aDocument->GetHeaderData(nsGkAtoms::viewport, viewport); + if (viewport.IsEmpty()) { + // If the docType specifies that we are on a site optimized for mobile, + // then we want to return specially crafted defaults for the viewport info. + nsCOMPtr domDoc(do_QueryInterface(aDocument)); + nsCOMPtr docType; + nsresult rv = domDoc->GetDoctype(getter_AddRefs(docType)); + if (NS_SUCCEEDED(rv) && docType) { + nsAutoString docId; + rv = docType->GetPublicId(docId); + if (NS_SUCCEEDED(rv)) { + if ((docId.Find("WAP") != -1) || + (docId.Find("Mobile") != -1) || + (docId.Find("WML") != -1)) + { + return ret; + } } } + + nsAutoString handheldFriendly; + aDocument->GetHeaderData(nsGkAtoms::handheldFriendly, handheldFriendly); + if (handheldFriendly.EqualsLiteral("true")) { + return ret; + } } - if (aDocument->IsXUL()) { - ret.autoScale = false; - return ret; - } - - nsAutoString handheldFriendly; - aDocument->GetHeaderData(nsGkAtoms::handheldFriendly, handheldFriendly); - - if (handheldFriendly.EqualsLiteral("true")) { - return ret; - } - nsAutoString minScaleStr; - aDocument->GetHeaderData(nsGkAtoms::minimum_scale, minScaleStr); + aDocument->GetHeaderData(nsGkAtoms::viewport_minimum_scale, minScaleStr); nsresult errorCode; float scaleMinFloat = minScaleStr.ToFloat(&errorCode); @@ -5103,7 +5098,7 @@ nsContentUtils::GetViewportInfo(nsIDocument *aDocument) scaleMinFloat = NS_MAX(scaleMinFloat, kViewportMinScale); nsAutoString maxScaleStr; - aDocument->GetHeaderData(nsGkAtoms::maximum_scale, maxScaleStr); + aDocument->GetHeaderData(nsGkAtoms::viewport_maximum_scale, maxScaleStr); // We define a special error code variable for the scale and max scale, // because they are used later (see the width calculations). @@ -5239,6 +5234,8 @@ nsContentUtils::ProcessViewportInfo(nsIDocument *aDocument, /* We never fail. */ nsresult rv = NS_OK; + aDocument->SetHeaderData(nsGkAtoms::viewport, viewportInfo); + /* Iterators. */ nsAString::const_iterator tip, tail, end; viewportInfo.BeginReading(tip); diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 6f9b3ea8bbce..54e72f14cc46 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -8599,9 +8599,7 @@ HasCrossProcessParent(nsIDocument* aDocument) if (!docShell) { return false; } - bool isBrowserElement = false; - docShell->GetIsBrowserElement(&isBrowserElement); - return isBrowserElement; + return docShell->GetIsBrowserElement(); } static bool diff --git a/content/base/src/nsFrameLoader.cpp b/content/base/src/nsFrameLoader.cpp index 4897b2a9356f..cc7c52021fe9 100644 --- a/content/base/src/nsFrameLoader.cpp +++ b/content/base/src/nsFrameLoader.cpp @@ -1142,27 +1142,10 @@ nsFrameLoader::SwapWithOtherLoader(nsFrameLoader* aOther, return NS_ERROR_NOT_IMPLEMENTED; } - bool ourContentBoundary, otherContentBoundary; - ourDocshell->GetIsContentBoundary(&ourContentBoundary); - otherDocshell->GetIsContentBoundary(&otherContentBoundary); - if (ourContentBoundary != otherContentBoundary) { - return NS_ERROR_NOT_IMPLEMENTED; - } - - if (ourContentBoundary) { - bool ourIsBrowser, otherIsBrowser; - ourDocshell->GetIsBrowserElement(&ourIsBrowser); - otherDocshell->GetIsBrowserElement(&otherIsBrowser); - if (ourIsBrowser != otherIsBrowser) { + if (ourDocshell->GetIsBrowserElement() != + otherDocshell->GetIsBrowserElement() || + ourDocshell->GetIsApp() != otherDocshell->GetIsApp()) { return NS_ERROR_NOT_IMPLEMENTED; - } - - bool ourIsApp, otherIsApp; - ourDocshell->GetIsApp(&ourIsApp); - otherDocshell->GetIsApp(&otherIsApp); - if (ourIsApp != otherIsApp) { - return NS_ERROR_NOT_IMPLEMENTED; - } } if (mInSwap || aOther->mInSwap) { diff --git a/docshell/base/nsDSURIContentListener.cpp b/docshell/base/nsDSURIContentListener.cpp index fcea8befd23f..450464f739d1 100644 --- a/docshell/base/nsDSURIContentListener.cpp +++ b/docshell/base/nsDSURIContentListener.cpp @@ -311,9 +311,7 @@ bool nsDSURIContentListener::CheckOneFrameOptionsPolicy(nsIRequest *request, parentDocShellItem) { nsCOMPtr curDocShell = do_QueryInterface(curDocShellItem); - bool isContentBoundary; - curDocShell->GetIsContentBoundary(&isContentBoundary); - if (isContentBoundary) { + if (curDocShell && curDocShell->GetIsContentBoundary()) { break; } diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 25ca55c14646..0fb6bab4a626 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -5135,9 +5135,7 @@ nsDocShell::SetIsActive(bool aIsActive) continue; } - bool isContentBoundary = false; - docshell->GetIsContentBoundary(&isContentBoundary); - if (!isContentBoundary) { + if (!docshell->GetIsContentBoundary()) { docshell->SetIsActive(aIsActive); } } @@ -12268,22 +12266,21 @@ nsDocShell::GetFrameType() return mIsBrowserFrame ? eFrameTypeBrowser : eFrameTypeRegular; } -NS_IMETHODIMP +/* [infallible] */ NS_IMETHODIMP nsDocShell::GetIsBrowserElement(bool* aIsBrowser) { *aIsBrowser = (GetFrameType() == eFrameTypeBrowser); - return NS_OK; } -NS_IMETHODIMP +/* [infallible] */ NS_IMETHODIMP nsDocShell::GetIsApp(bool* aIsApp) { *aIsApp = (GetFrameType() == eFrameTypeApp); return NS_OK; } -NS_IMETHODIMP +/* [infallible] */ NS_IMETHODIMP nsDocShell::GetIsContentBoundary(bool* aIsContentBoundary) { switch (GetFrameType()) { @@ -12299,21 +12296,21 @@ nsDocShell::GetIsContentBoundary(bool* aIsContentBoundary) return NS_OK; } -NS_IMETHODIMP +/* [infallible] */ NS_IMETHODIMP nsDocShell::GetIsInBrowserElement(bool* aIsInBrowserElement) { *aIsInBrowserElement = (GetInheritedFrameType() == eFrameTypeBrowser); return NS_OK; } -NS_IMETHODIMP +/* [infallible] */ NS_IMETHODIMP nsDocShell::GetIsInApp(bool* aIsInApp) { *aIsInApp = (GetInheritedFrameType() == eFrameTypeApp); return NS_OK; } -NS_IMETHODIMP +/* [infallible] */ NS_IMETHODIMP nsDocShell::GetIsBelowContentBoundary(bool* aIsInContentBoundary) { switch (GetInheritedFrameType()) { @@ -12339,7 +12336,7 @@ nsDocShell::SetAppId(uint32_t aAppId) return NS_OK; } -NS_IMETHODIMP +/* [infallible] */ NS_IMETHODIMP nsDocShell::GetAppId(uint32_t* aAppId) { if (mAppId != nsIScriptSecurityManager::NO_APP_ID) { diff --git a/docshell/base/nsIDocShell.idl b/docshell/base/nsIDocShell.idl index 0f309a07b0c5..986f4b4f0d82 100644 --- a/docshell/base/nsIDocShell.idl +++ b/docshell/base/nsIDocShell.idl @@ -589,23 +589,23 @@ interface nsIDocShell : nsISupports /** * Returns true iff the docshell is marked as a browser frame. */ - readonly attribute boolean isBrowserElement; + [infallible] readonly attribute boolean isBrowserElement; /** * Returns true iif the docshell is marked as an app frame. */ - readonly attribute boolean isApp; + [infallible] readonly attribute boolean isApp; /** * Returns true iif the docshell is marked as a type that behaves like a * content boundary. */ - readonly attribute boolean isContentBoundary; + [infallible] readonly attribute boolean isContentBoundary; /** * Returns true iif the docshell is inside a browser element. */ - readonly attribute boolean isInBrowserElement; + [infallible] readonly attribute boolean isInBrowserElement; /** * Returns true iif the docshell is inside an application. However, it will @@ -625,13 +625,13 @@ interface nsIDocShell : nsISupports * If you're doing a security check, use the content's principal instead of * this method. */ - readonly attribute boolean isInApp; + [infallible] readonly attribute boolean isInApp; /** * Returns if the docshell has a docshell that behaves as a content boundary * in his parent hierarchy. */ - readonly attribute boolean isBelowContentBoundary; + [infallible] readonly attribute boolean isBelowContentBoundary; /** * Set the app id this docshell is associated with. The id has to be a valid @@ -650,7 +650,7 @@ interface nsIDocShell : nsISupports * Returns the app id of the app the docshell is in. Returns * nsIScriptSecurityManager::NO_APP_ID if the docshell is not in an app. */ - readonly attribute unsigned long appId; + [infallible] readonly attribute unsigned long appId; /** * True iff asynchronous panning and zooming is enabled for this diff --git a/dom/activities/src/ActivityRequestHandler.js b/dom/activities/src/ActivityRequestHandler.js index de6da1c3ac46..337badaf8c62 100644 --- a/dom/activities/src/ActivityRequestHandler.js +++ b/dom/activities/src/ActivityRequestHandler.js @@ -7,7 +7,7 @@ const Cc = Components.classes; const Ci = Components.interfaces; const Cu = Components.utils; - + Cu.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyGetter(this, "cpmm", function() { @@ -31,7 +31,7 @@ function ActivityRequestHandler() { // When a system message of type 'activity' is emitted, it forces the // creation of an ActivityWrapper which in turns replace the default // system message callback. The newly created wrapper then create a - // nsIDOMActivityRequestHandler object and fills up the properties of + // nsIDOMActivityRequestHandler object and fills up the properties of // this object as well as the properties of the nsIDOMActivityOptions // object contains by the request handler. this._id = null; @@ -40,6 +40,12 @@ function ActivityRequestHandler() { } ActivityRequestHandler.prototype = { + __exposedProps__: { + source: "r", + postResult: "r", + postError: "r" + }, + get source() { return this._options; }, diff --git a/dom/alarm/AlarmService.jsm b/dom/alarm/AlarmService.jsm index 6ef17ca80045..2c873c6ad4d8 100644 --- a/dom/alarm/AlarmService.jsm +++ b/dom/alarm/AlarmService.jsm @@ -305,12 +305,16 @@ let AlarmService = { let alarmQueue = this._alarmQueue; alarmQueue.length = 0; this._currentAlarm = null; - - // only add the alarm that is valid - let nowTime = Date.now(); + + // Only restore the alarm that's not yet expired; otherwise, + // fire a system message for it and remove it from database. aAlarms.forEach(function addAlarm(aAlarm) { - if (this._getAlarmTime(aAlarm) > nowTime) + if (this._getAlarmTime(aAlarm) > Date.now()) { alarmQueue.push(aAlarm); + } else { + this._fireSystemMessage(aAlarm); + this._removeAlarmFromDb(aAlarm.id, null); + } }.bind(this)); // set the next alarm from queue @@ -329,7 +333,7 @@ let AlarmService = { _getAlarmTime: function _getAlarmTime(aAlarm) { let alarmTime = (new Date(aAlarm.date)).getTime(); - + // For an alarm specified with "ignoreTimezone", // it must be fired respect to the user's timezone. // Supposing an alarm was set at 7:00pm at Tokyo, diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index 9d6eadda1486..45a46305cc00 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -56,6 +56,7 @@ #include "nsIDOMGlobalPropertyInitializer.h" using namespace mozilla::dom::power; +using namespace mozilla::dom::sms; // This should not be in the namespace. DOMCI_DATA(Navigator, mozilla::dom::Navigator) @@ -1064,61 +1065,6 @@ Navigator::RequestWakeLock(const nsAString &aTopic, nsIDOMMozWakeLock **aWakeLoc // Navigator::nsIDOMNavigatorSms //***************************************************************************** -bool -Navigator::IsSmsAllowed() const -{ - static const bool defaultSmsPermission = false; - - // First of all, the general pref has to be turned on. - if (!Preferences::GetBool("dom.sms.enabled", defaultSmsPermission)) { - return false; - } - - // In addition of having 'dom.sms.enabled' set to true, we require the - // website to be whitelisted. This is a temporary 'security model'. - // 'dom.sms.whitelist' has to contain comma-separated values of URI prepath. - // For local files, "file://" must be listed. - // For data-urls: "moz-nullprincipal:". - // Chrome files also have to be whitelisted for the moment. - nsCOMPtr win(do_QueryReferent(mWindow)); - - if (!win || !win->GetDocShell()) { - return defaultSmsPermission; - } - - nsCOMPtr doc = do_QueryInterface(win->GetExtantDocument()); - if (!doc) { - return defaultSmsPermission; - } - - nsCOMPtr uri; - doc->NodePrincipal()->GetURI(getter_AddRefs(uri)); - - if (!uri) { - return defaultSmsPermission; - } - - nsCAutoString uriPrePath; - uri->GetPrePath(uriPrePath); - - const nsAdoptingString& whitelist = - Preferences::GetString("dom.sms.whitelist"); - - nsCharSeparatedTokenizer tokenizer(whitelist, ',', - nsCharSeparatedTokenizerTemplate<>::SEPARATOR_OPTIONAL); - - while (tokenizer.hasMoreTokens()) { - const nsSubstring& whitelistItem = tokenizer.nextToken(); - - if (NS_ConvertUTF16toUTF8(whitelistItem).Equals(uriPrePath)) { - return true; - } - } - - // The current page hasn't been whitelisted. - return false; -} - bool Navigator::IsSmsSupported() const { @@ -1141,15 +1087,15 @@ Navigator::GetMozSms(nsIDOMMozSmsManager** aSmsManager) *aSmsManager = nullptr; if (!mSmsManager) { - if (!IsSmsSupported() || !IsSmsAllowed()) { + if (!IsSmsSupported()) { return NS_OK; } nsCOMPtr window = do_QueryReferent(mWindow); NS_ENSURE_TRUE(window && window->GetDocShell(), NS_OK); - mSmsManager = new sms::SmsManager(); - mSmsManager->Init(window); + mSmsManager = SmsManager::CheckPermissionAndCreateInstance(window); + NS_ENSURE_TRUE(mSmsManager, NS_OK); } NS_ADDREF(*aSmsManager = mSmsManager); diff --git a/dom/base/Navigator.h b/dom/base/Navigator.h index df12a3c021f0..ef3a8e1a387f 100644 --- a/dom/base/Navigator.h +++ b/dom/base/Navigator.h @@ -142,7 +142,6 @@ public: NS_DECL_NSIDOMNAVIGATORCAMERA private: - bool IsSmsAllowed() const; bool IsSmsSupported() const; nsRefPtr mMimeTypes; diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index 92cb1fc01dea..a449ca419c21 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -518,7 +518,6 @@ using mozilla::dom::indexedDB::IDBWrapperCache; #include "BluetoothAdapter.h" #include "BluetoothDevice.h" #include "BluetoothPropertyEvent.h" -#include "BluetoothPairingEvent.h" #endif #include "nsIDOMNavigatorSystemMessages.h" @@ -1679,8 +1678,6 @@ static nsDOMClassInfoData sClassInfoData[] = { EVENTTARGET_SCRIPTABLE_FLAGS) NS_DEFINE_CLASSINFO_DATA(BluetoothPropertyEvent, nsDOMGenericSH, DOM_DEFAULT_SCRIPTABLE_FLAGS) - NS_DEFINE_CLASSINFO_DATA(BluetoothPairingEvent, nsDOMGenericSH, - DOM_DEFAULT_SCRIPTABLE_FLAGS) #endif NS_DEFINE_CLASSINFO_DATA(CameraManager, nsDOMGenericSH, @@ -4475,12 +4472,6 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_ENTRY(nsIDOMBluetoothPropertyEvent) DOM_CLASSINFO_MAP_ENTRY(nsIDOMEvent) DOM_CLASSINFO_MAP_END - - DOM_CLASSINFO_MAP_BEGIN(BluetoothPairingEvent, nsIDOMBluetoothPairingEvent) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMBluetoothPairingEvent) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMEvent) - DOM_CLASSINFO_MAP_END - #endif DOM_CLASSINFO_MAP_BEGIN(CameraManager, nsIDOMCameraManager) diff --git a/dom/base/nsDOMClassInfoClasses.h b/dom/base/nsDOMClassInfoClasses.h index a131fc23d053..604f30d855e3 100644 --- a/dom/base/nsDOMClassInfoClasses.h +++ b/dom/base/nsDOMClassInfoClasses.h @@ -524,7 +524,6 @@ DOMCI_CLASS(BluetoothManager) DOMCI_CLASS(BluetoothAdapter) DOMCI_CLASS(BluetoothDevice) DOMCI_CLASS(BluetoothPropertyEvent) -DOMCI_CLASS(BluetoothPairingEvent) #endif DOMCI_CLASS(CameraManager) diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index d5298bccf931..ceeb4dd2dc2c 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -328,12 +328,6 @@ nsDOMWindowUtils::SetDisplayPortForElement(float aXPx, float aYPx, return NS_ERROR_INVALID_ARG; } - nsRect lastDisplayPort; - if (nsLayoutUtils::GetDisplayPort(content, &lastDisplayPort) && - displayport.IsEqualInterior(lastDisplayPort)) { - return NS_OK; - } - content->SetProperty(nsGkAtoms::DisplayPort, new nsRect(displayport), DestroyNsRect); diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index aca141ffae0d..a7670e18186a 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -2973,9 +2973,7 @@ nsGlobalWindow::GetScriptableParent(nsIDOMWindow** aParent) return NS_OK; } - bool isContentBoundary = false; - mDocShell->GetIsContentBoundary(&isContentBoundary); - if (isContentBoundary) { + if (mDocShell->GetIsContentBoundary()) { nsCOMPtr parent = static_cast(this); parent.swap(*aParent); return NS_OK; @@ -3082,12 +3080,8 @@ nsGlobalWindow::GetContent(nsIDOMWindow** aContent) // If we're contained in + +
+
+
+ + diff --git a/dom/bluetooth/BluetoothAdapter.cpp b/dom/bluetooth/BluetoothAdapter.cpp index 94533fff92e2..d8fe48a39f10 100644 --- a/dom/bluetooth/BluetoothAdapter.cpp +++ b/dom/bluetooth/BluetoothAdapter.cpp @@ -8,21 +8,22 @@ #include "BluetoothAdapter.h" #include "BluetoothDevice.h" #include "BluetoothPropertyEvent.h" -#include "BluetoothPairingEvent.h" #include "BluetoothService.h" #include "BluetoothTypes.h" #include "BluetoothReplyRunnable.h" #include "BluetoothUtils.h" #include "GeneratedEvents.h" +#include "nsContentUtils.h" #include "nsDOMClassInfo.h" #include "nsDOMEvent.h" -#include "nsThreadUtils.h" -#include "nsXPCOMCIDInternal.h" -#include "nsIDOMDOMRequest.h" +#include "nsIDOMBluetoothAuthorizeEvent.h" #include "nsIDOMBluetoothDeviceEvent.h" #include "nsIDOMBluetoothDeviceAddressEvent.h" -#include "nsContentUtils.h" +#include "nsIDOMBluetoothPairingEvent.h" +#include "nsIDOMDOMRequest.h" +#include "nsThreadUtils.h" +#include "nsXPCOMCIDInternal.h" #include "mozilla/LazyIdleThread.h" #include "mozilla/Util.h" @@ -322,66 +323,100 @@ BluetoothAdapter::Notify(const BluetoothSignal& aData) } else if (aData.name().EqualsLiteral("PropertyChanged")) { // Get BluetoothNamedValue, make sure array length is 1 arr = aData.value().get_ArrayOfBluetoothNamedValue(); - if(arr.Length() != 1) { - // This really should not happen - NS_ERROR("Got more than one property in a change message!"); - return; - } + + NS_ASSERTION(arr.Length() == 1, "Got more than one property in a change message!"); + NS_ASSERTION(arr[0].value().type() == BluetoothValue::TArrayOfBluetoothNamedValue, + "PropertyChanged: Invalid value type"); + BluetoothNamedValue v = arr[0]; SetPropertyByValue(v); nsRefPtr e = BluetoothPropertyEvent::Create(v.name()); e->Dispatch(ToIDOMEventTarget(), NS_LITERAL_STRING("propertychanged")); } else if (aData.name().EqualsLiteral("RequestConfirmation")) { arr = aData.value().get_ArrayOfBluetoothNamedValue(); - if(arr.Length() != 2) { - NS_ERROR("RequestConfirmation: Length of parameters is wrong"); - return; - } - nsString deviceAddress = arr[0].value().get_nsString(); - uint32_t passkey = arr[1].value().get_uint32_t(); + NS_ASSERTION(arr.Length() == 2, "RequestConfirmation: Wrong length of parameters"); + NS_ASSERTION(arr[0].value().type() == BluetoothValue::TnsString, + "RequestConfirmation: Invalid value type"); + NS_ASSERTION(arr[1].value().type() == BluetoothValue::Tuint32_t, + "RequestConfirmation: Invalid value type"); - nsRefPtr e = BluetoothPairingEvent::Create(deviceAddress, passkey); - e->Dispatch(ToIDOMEventTarget(), NS_LITERAL_STRING("requestconfirmation")); + nsCOMPtr event; + NS_NewDOMBluetoothPairingEvent(getter_AddRefs(event), nullptr, nullptr); + + nsCOMPtr e = do_QueryInterface(event); + e->InitBluetoothPairingEvent(NS_LITERAL_STRING("requestconfirmation"), + false, + false, + arr[0].value().get_nsString(), + arr[1].value().get_uint32_t()); + e->SetTrusted(true); + bool dummy; + DispatchEvent(event, &dummy); } else if (aData.name().EqualsLiteral("RequestPinCode")) { arr = aData.value().get_ArrayOfBluetoothNamedValue(); - if(arr.Length() != 1) { - NS_ERROR("RequestPinCode: Length of parameters is wrong"); - return; - } - nsString deviceAddress = arr[0].value().get_nsString(); + NS_ASSERTION(arr.Length() == 1, "RequestPinCode: Wrong length of parameters"); + NS_ASSERTION(arr[0].value().type() == BluetoothValue::TnsString, + "RequestPinCode: Invalid value type"); - nsRefPtr e = BluetoothPairingEvent::Create(deviceAddress, 0); - e->Dispatch(ToIDOMEventTarget(), NS_LITERAL_STRING("requestpincode")); + nsCOMPtr event; + NS_NewDOMBluetoothDeviceAddressEvent(getter_AddRefs(event), nullptr, nullptr); + + nsCOMPtr e = do_QueryInterface(event); + e->InitBluetoothDeviceAddressEvent(NS_LITERAL_STRING("requestpincode"), + false, false, arr[0].value().get_nsString()); + e->SetTrusted(true); + bool dummy; + DispatchEvent(event, &dummy); } else if (aData.name().EqualsLiteral("RequestPasskey")) { arr = aData.value().get_ArrayOfBluetoothNamedValue(); - if(arr.Length() != 1) { - NS_ERROR("RequestPasskey: Length of parameters is wrong"); - return; - } - nsString deviceAddress = arr[0].value().get_nsString(); + NS_ASSERTION(arr.Length() == 1, "RequestPasskey: Wrong length of parameters"); + NS_ASSERTION(arr[0].value().type() == BluetoothValue::TnsString, + "RequestPasskey: Invalid value type"); - nsRefPtr e = BluetoothPairingEvent::Create(deviceAddress, 0); - e->Dispatch(ToIDOMEventTarget(), NS_LITERAL_STRING("requestpasskey")); + nsCOMPtr event; + NS_NewDOMBluetoothDeviceAddressEvent(getter_AddRefs(event), nullptr, nullptr); + + nsCOMPtr e = do_QueryInterface(event); + e->InitBluetoothDeviceAddressEvent(NS_LITERAL_STRING("requestpasskey"), + false, false, arr[0].value().get_nsString()); + e->SetTrusted(true); + bool dummy; + DispatchEvent(event, &dummy); } else if (aData.name().EqualsLiteral("Authorize")) { arr = aData.value().get_ArrayOfBluetoothNamedValue(); - if(arr.Length() != 2) { - NS_ERROR("Authorize: Length of parameters is wrong"); - return; - } - nsString deviceAddress = arr[0].value().get_nsString(); - nsString serviceUuid = arr[1].value().get_nsString(); + NS_ASSERTION(arr.Length() == 2, "Authorize: Wrong length of parameters"); + NS_ASSERTION(arr[0].value().type() == BluetoothValue::TnsString, + "Authorize: Invalid value type"); + NS_ASSERTION(arr[1].value().type() == BluetoothValue::TnsString, + "Authorize: Invalid value type"); - nsRefPtr e = BluetoothPairingEvent::Create(deviceAddress, serviceUuid); - e->Dispatch(ToIDOMEventTarget(), NS_LITERAL_STRING("authorize")); + nsCOMPtr event; + NS_NewDOMBluetoothAuthorizeEvent(getter_AddRefs(event), nullptr, nullptr); + + nsCOMPtr e = do_QueryInterface(event); + e->InitBluetoothAuthorizeEvent(NS_LITERAL_STRING("authorize"), + false, + false, + arr[0].value().get_nsString(), + arr[1].value().get_nsString()); + e->SetTrusted(true); + bool dummy; + DispatchEvent(event, &dummy); } else if (aData.name().EqualsLiteral("Cancel")) { + nsCOMPtr event; + NS_NewDOMBluetoothDeviceAddressEvent(getter_AddRefs(event), nullptr, nullptr); + + nsCOMPtr e = do_QueryInterface(event); // Just send a null nsString, won't be used - nsString deviceObjectPath = EmptyString(); - nsRefPtr e = BluetoothPairingEvent::Create(deviceObjectPath, 0); - e->Dispatch(ToIDOMEventTarget(), NS_LITERAL_STRING("cancel")); + e->InitBluetoothDeviceAddressEvent(NS_LITERAL_STRING("cancel"), + false, false, EmptyString()); + e->SetTrusted(true); + bool dummy; + DispatchEvent(event, &dummy); } else { #ifdef DEBUG nsCString warningMsg; diff --git a/dom/bluetooth/Makefile.in b/dom/bluetooth/Makefile.in index b8c4b12717ef..6350f9be5228 100644 --- a/dom/bluetooth/Makefile.in +++ b/dom/bluetooth/Makefile.in @@ -33,7 +33,6 @@ CPPSRCS += \ BluetoothAdapter.cpp \ BluetoothDevice.cpp \ BluetoothPropertyEvent.cpp \ - BluetoothPairingEvent.cpp \ BluetoothReplyRunnable.cpp \ BluetoothPropertyContainer.cpp \ BluetoothUtils.cpp \ @@ -48,6 +47,7 @@ XPIDLSRCS = \ nsIDOMBluetoothDeviceAddressEvent.idl \ nsIDOMBluetoothPropertyEvent.idl \ nsIDOMBluetoothPairingEvent.idl \ + nsIDOMBluetoothAuthorizeEvent.idl \ $(NULL) ifeq (gonk,$(MOZ_WIDGET_TOOLKIT)) diff --git a/dom/bluetooth/nsIDOMBluetoothAuthorizeEvent.idl b/dom/bluetooth/nsIDOMBluetoothAuthorizeEvent.idl new file mode 100644 index 000000000000..771e071a4353 --- /dev/null +++ b/dom/bluetooth/nsIDOMBluetoothAuthorizeEvent.idl @@ -0,0 +1,26 @@ +/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */ +/* vim: set ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsIDOMEvent.idl" + +[scriptable, builtinclass, uuid(1cfe7854-31a6-4a41-add6-b4ed35869a6d)] +interface nsIDOMBluetoothAuthorizeEvent : nsIDOMEvent +{ + readonly attribute DOMString deviceAddress; + readonly attribute DOMString uuid; + + [noscript] void initBluetoothAuthorizeEvent(in DOMString aType, + in boolean aCanBubble, + in boolean aCancelable, + in DOMString aDeviceAddress, + in DOMString aUuid); +}; + +dictionary BluetoothAuthorizeEventInit : EventInit +{ + DOMString deviceAddress; + DOMString uuid; +}; diff --git a/dom/bluetooth/nsIDOMBluetoothPairingEvent.idl b/dom/bluetooth/nsIDOMBluetoothPairingEvent.idl index aad93f753050..c48502bb29f2 100644 --- a/dom/bluetooth/nsIDOMBluetoothPairingEvent.idl +++ b/dom/bluetooth/nsIDOMBluetoothPairingEvent.idl @@ -6,10 +6,21 @@ #include "nsIDOMEvent.idl" -[scriptable, builtinclass, uuid(b905b05e-2141-444c-a90d-525b6c0daff1)] +[scriptable, builtinclass, uuid(333022b8-a7e5-4fff-8588-36f2eedff17e)] interface nsIDOMBluetoothPairingEvent : nsIDOMEvent { readonly attribute DOMString deviceAddress; - readonly attribute DOMString uuid; readonly attribute unsigned long passkey; + + [noscript] void initBluetoothPairingEvent(in DOMString aType, + in boolean aCanBubble, + in boolean aCancelable, + in DOMString aDeviceAddress, + in unsigned long aPasskey); +}; + +dictionary BluetoothPairingEventInit : EventInit +{ + DOMString deviceAddress; + unsigned long passkey; }; diff --git a/dom/contacts/ContactManager.js b/dom/contacts/ContactManager.js index 0b89db471039..4396f6214e8b 100644 --- a/dom/contacts/ContactManager.js +++ b/dom/contacts/ContactManager.js @@ -4,12 +4,8 @@ "use strict"; -/* static functions */ -let DEBUG = 0; -if (DEBUG) - debug = function (s) { dump("-*- ContactManager: " + s + "\n"); } -else - debug = function (s) {} +const DEBUG = false; +function debug(s) { dump("-*- ContactManager: " + s + "\n"); } const Cc = Components.classes; const Ci = Components.interfaces; @@ -37,7 +33,7 @@ const nsIDOMContactProperties = Ci.nsIDOMContactProperties; // ContactProperties is not directly instantiated. It is used as interface. -function ContactProperties(aProp) { debug("ContactProperties Constructor"); } +function ContactProperties(aProp) { if (DEBUG) debug("ContactProperties Constructor"); } ContactProperties.prototype = { @@ -67,6 +63,14 @@ function ContactAddress(aType, aStreetAddress, aLocality, aRegion, aPostalCode, }; ContactAddress.prototype = { + __exposedProps__: { + type: 'rw', + streetAddress: 'rw', + locality: 'rw', + region: 'rw', + postalCode: 'rw', + countryName: 'rw' + }, classID : CONTACTADDRESS_CID, classInfo : XPCOMUtils.generateCI({classID: CONTACTADDRESS_CID, @@ -90,6 +94,10 @@ function ContactField(aType, aValue) { }; ContactField.prototype = { + __exposedProps__: { + type: 'rw', + value: 'rw' + }, classID : CONTACTFIELD_CID, classInfo : XPCOMUtils.generateCI({classID: CONTACTFIELD_CID, @@ -114,6 +122,11 @@ function ContactTelField(aType, aValue, aCarrier) { }; ContactTelField.prototype = { + __exposedProps__: { + type: 'rw', + value: 'rw', + carrier: 'rw' + }, classID : CONTACTTELFIELD_CID, classInfo : XPCOMUtils.generateCI({classID: CONTACTTELFIELD_CID, @@ -151,13 +164,38 @@ const CONTACT_CONTRACTID = "@mozilla.org/contact;1"; const CONTACT_CID = Components.ID("{da0f7040-388b-11e1-b86c-0800200c9a66}"); const nsIDOMContact = Components.interfaces.nsIDOMContact; -// The wrappedJSObject magic here allows callers to get at the underlying JS object -// of the XPCOM component. We use this below to modify properties that are read-only -// per-idl. See https://developer.mozilla.org/en-US/docs/wrappedJSObject. -function Contact() { debug("Contact constr: "); this.wrappedJSObject = this; }; +function Contact() { + if (DEBUG) debug("Contact constr: "); +}; Contact.prototype = { - + __exposedProps__: { + id: 'rw', + updated: 'rw', + published: 'rw', + name: 'rw', + honorificPrefix: 'rw', + givenName: 'rw', + additionalName: 'rw', + familyName: 'rw', + honorificSuffix: 'rw', + nickname: 'rw', + email: 'rw', + photo: 'rw', + url: 'rw', + category: 'rw', + adr: 'rw', + tel: 'rw', + org: 'rw', + jobTitle: 'rw', + bday: 'rw', + note: 'rw', + impp: 'rw', + anniversary: 'rw', + sex: 'rw', + genderIdentity: 'rw' + }, + init: function init(aProp) { // Accept non-array strings for DOMString[] properties and convert them. function _create(aField) { @@ -290,7 +328,7 @@ const nsIDOMContactManager = Components.interfaces.nsIDOMContactManager; function ContactManager() { - debug("Constructor"); + if (DEBUG) debug("Constructor"); } ContactManager.prototype = { @@ -298,7 +336,7 @@ ContactManager.prototype = { _oncontactchange: null, set oncontactchange(aCallback) { - debug("set oncontactchange"); + if (DEBUG) debug("set oncontactchange"); let allowCallback = function() { this._oncontactchange = aCallback; }.bind(this); @@ -321,16 +359,16 @@ ContactManager.prototype = { _convertContactsArray: function(aContacts) { let contacts = new Array(); for (let i in aContacts) { - let newContact = Components.classes['@mozilla.org/contact;1'].createInstance(); + let newContact = new Contact(); newContact.init(aContacts[i].properties); - this._setMetaData(newContact.wrappedJSObject, aContacts[i]); + this._setMetaData(newContact, aContacts[i]); contacts.push(newContact); } return contacts; }, receiveMessage: function(aMessage) { - debug("Contactmanager::receiveMessage: " + aMessage.name); + if (DEBUG) debug("Contactmanager::receiveMessage: " + aMessage.name); let msg = aMessage.json; let contacts = msg.contacts; @@ -339,10 +377,9 @@ ContactManager.prototype = { let req = this.getRequest(msg.requestID); if (req) { let result = this._convertContactsArray(contacts); - debug("result: " + JSON.stringify(result)); Services.DOMRequest.fireSuccess(req.request, result); } else { - debug("no request stored!" + msg.requestID); + if (DEBUG) debug("no request stored!" + msg.requestID); } break; case "Contact:Save:Return:OK": @@ -370,7 +407,7 @@ ContactManager.prototype = { Services.DOMRequest.fireError(req.request, msg.errorMsg); break; case "PermissionPromptHelper:AskPermission:OK": - debug("id: " + msg.requestID); + if (DEBUG) debug("id: " + msg.requestID); req = this.getRequest(msg.requestID); if (!req) { break; @@ -383,13 +420,13 @@ ContactManager.prototype = { } break; default: - debug("Wrong message: " + aMessage.name); + if (DEBUG) debug("Wrong message: " + aMessage.name); } this.removeRequest(msg.requestID); }, askPermission: function (aAccess, aReqeust, aAllowCallback, aCancelCallback) { - debug("askPermission for contacts"); + if (DEBUG) debug("askPermission for contacts"); let requestID = this.getRequestId({ request: aReqeust, allow: function() { @@ -417,7 +454,7 @@ ContactManager.prototype = { save: function save(aContact) { let request; - debug("save: " + JSON.stringify(aContact) + " :" + aContact.id); + if (DEBUG) debug("save: " + JSON.stringify(aContact) + " :" + aContact.id); let newContact = {}; newContact.properties = { name: [], @@ -457,7 +494,7 @@ ContactManager.prototype = { } this._setMetaData(newContact, aContact); - debug("send: " + JSON.stringify(newContact)); + if (DEBUG) debug("send: " + JSON.stringify(newContact)); request = this.createRequest(); let options = { contact: newContact }; let allowCallback = function() { @@ -468,7 +505,7 @@ ContactManager.prototype = { }, find: function(aOptions) { - debug("find! " + JSON.stringify(aOptions)); + if (DEBUG) debug("find! " + JSON.stringify(aOptions)); let request; request = this.createRequest(); let options = { findOptions: aOptions }; @@ -491,7 +528,7 @@ ContactManager.prototype = { }, clear: function() { - debug("clear"); + if (DEBUG) debug("clear"); let request; request = this.createRequest(); let options = {}; @@ -508,16 +545,16 @@ ContactManager.prototype = { let allowCallback = function() { let callback = function(aType, aContacts) { - debug("got SIM contacts: " + aType + " " + JSON.stringify(aContacts)); + if (DEBUG) debug("got SIM contacts: " + aType + " " + JSON.stringify(aContacts)); let result = aContacts.map(function(c) { var contact = new Contact(); contact.init( { name: [c.alphaId], tel: [ { number: c.number } ] } ); return contact; }); - debug("result: " + JSON.stringify(result)); + if (DEBUG) debug("result: " + JSON.stringify(result)); Services.DOMRequest.fireSuccess(request, result); }; - debug("getSimContacts " + aType); + if (DEBUG) debug("getSimContacts " + aType); mRIL.getICCContacts(aType, callback); }.bind(this); @@ -543,7 +580,7 @@ ContactManager.prototype = { // Called from DOMRequestIpcHelper uninit: function uninit() { - debug("uninit call"); + if (DEBUG) debug("uninit call"); if (this._oncontactchange) this._oncontactchange = null; }, diff --git a/dom/contacts/fallback/ContactDB.jsm b/dom/contacts/fallback/ContactDB.jsm index 5acabfe75628..c13065557141 100644 --- a/dom/contacts/fallback/ContactDB.jsm +++ b/dom/contacts/fallback/ContactDB.jsm @@ -6,13 +6,8 @@ const EXPORTED_SYMBOLS = ['ContactDB']; -let DEBUG = 0; -/* static functions */ -if (DEBUG) { - debug = function (s) { dump("-*- ContactDB component: " + s + "\n"); } -} else { - debug = function (s) {} -} +const DEBUG = false; +function debug(s) { dump("-*- ContactDB component: " + s + "\n"); } const Cu = Components.utils; const Cc = Components.classes; @@ -26,7 +21,7 @@ const DB_VERSION = 4; const STORE_NAME = "contacts"; function ContactDB(aGlobal) { - debug("Constructor"); + if (DEBUG) debug("Constructor"); this._global = aGlobal; } @@ -34,7 +29,7 @@ ContactDB.prototype = { __proto__: IndexedDBHelper.prototype, upgradeSchema: function upgradeSchema(aTransaction, aDb, aOldVersion, aNewVersion) { - debug("upgrade schema from: " + aOldVersion + " to " + aNewVersion + " called!"); + if (DEBUG) debug("upgrade schema from: " + aOldVersion + " to " + aNewVersion + " called!"); let db = aDb; let objectStore; for (let currVersion = aOldVersion; currVersion < aNewVersion; currVersion++) { @@ -50,7 +45,7 @@ ContactDB.prototype = { * properties: {...} // Object holding the ContactProperties * } */ - debug("create schema"); + if (DEBUG) debug("create schema"); objectStore = db.createObjectStore(this.dbStoreName, {keyPath: "id"}); // Metadata indexes @@ -74,7 +69,7 @@ ContactDB.prototype = { objectStore.createIndex("emailLowerCase", "search.email", { unique: false, multiEntry: true }); objectStore.createIndex("noteLowerCase", "search.note", { unique: false, multiEntry: true }); } else if (currVersion == 1) { - debug("upgrade 1"); + if (DEBUG) debug("upgrade 1"); // Create a new scheme for the tel field. We move from an array of tel-numbers to an array of // ContactTelephone. @@ -88,12 +83,12 @@ ContactDB.prototype = { objectStore.openCursor().onsuccess = function(event) { let cursor = event.target.result; if (cursor) { - debug("upgrade tel1: " + JSON.stringify(cursor.value)); + if (DEBUG) debug("upgrade tel1: " + JSON.stringify(cursor.value)); for (let number in cursor.value.properties.tel) { cursor.value.properties.tel[number] = {number: number}; } cursor.update(cursor.value); - debug("upgrade tel2: " + JSON.stringify(cursor.value)); + if (DEBUG) debug("upgrade tel2: " + JSON.stringify(cursor.value)); cursor.continue(); } }; @@ -102,7 +97,7 @@ ContactDB.prototype = { objectStore.createIndex("tel", "search.tel", { unique: false, multiEntry: true }); objectStore.createIndex("category", "properties.category", { unique: false, multiEntry: true }); } else if (currVersion == 2) { - debug("upgrade 2"); + if (DEBUG) debug("upgrade 2"); // Create a new scheme for the email field. We move from an array of emailaddresses to an array of // ContactEmail. if (!objectStore) { @@ -115,11 +110,11 @@ ContactDB.prototype = { objectStore.openCursor().onsuccess = function(event) { let cursor = event.target.result; if (cursor) { - debug("upgrade email1: " + JSON.stringify(cursor.value)); + if (DEBUG) debug("upgrade email1: " + JSON.stringify(cursor.value)); cursor.value.properties.email = cursor.value.properties.email.map(function(address) { return { address: address }; }); cursor.update(cursor.value); - debug("upgrade email2: " + JSON.stringify(cursor.value)); + if (DEBUG) debug("upgrade email2: " + JSON.stringify(cursor.value)); cursor.continue(); } }; @@ -127,7 +122,7 @@ ContactDB.prototype = { // Create new searchable indexes. objectStore.createIndex("email", "search.email", { unique: false, multiEntry: true }); } else if (currVersion == 3) { - debug("upgrade 3"); + if (DEBUG) debug("upgrade 3"); if (!objectStore) { objectStore = aTransaction.objectStore(STORE_NAME); @@ -137,11 +132,11 @@ ContactDB.prototype = { objectStore.openCursor().onsuccess = function(event) { let cursor = event.target.result; if (cursor) { - debug("upgrade impp1: " + JSON.stringify(cursor.value)); + if (DEBUG) debug("upgrade impp1: " + JSON.stringify(cursor.value)); cursor.value.properties.impp = cursor.value.properties.impp.map(function(value) { return { value: value }; }); cursor.update(cursor.value); - debug("upgrade impp2: " + JSON.stringify(cursor.value)); + if (DEBUG) debug("upgrade impp2: " + JSON.stringify(cursor.value)); cursor.continue(); } }; @@ -149,11 +144,11 @@ ContactDB.prototype = { objectStore.openCursor().onsuccess = function(event) { let cursor = event.target.result; if (cursor) { - debug("upgrade url1: " + JSON.stringify(cursor.value)); + if (DEBUG) debug("upgrade url1: " + JSON.stringify(cursor.value)); cursor.value.properties.url = cursor.value.properties.url.map(function(value) { return { value: value }; }); cursor.update(cursor.value); - debug("upgrade impp2: " + JSON.stringify(cursor.value)); + if (DEBUG) debug("upgrade impp2: " + JSON.stringify(cursor.value)); cursor.continue(); } }; @@ -228,7 +223,7 @@ ContactDB.prototype = { contact.search[field].push(digits.substring(i, digits.length)); } } - debug("lookup: " + JSON.stringify(contact.search[field])); + if (DEBUG) debug("lookup: " + JSON.stringify(contact.search[field])); } } else if (field == "email") { let address = aContact.properties[field][i].value; @@ -250,7 +245,7 @@ ContactDB.prototype = { } } } - debug("contact:" + JSON.stringify(contact)); + if (DEBUG) debug("contact:" + JSON.stringify(contact)); contact.updated = aContact.updated; contact.published = aContact.published; @@ -285,24 +280,24 @@ ContactDB.prototype = { saveContact: function saveContact(aContact, successCb, errorCb) { let contact = this.makeImport(aContact); this.newTxn("readwrite", function (txn, store) { - debug("Going to update" + JSON.stringify(contact)); + if (DEBUG) debug("Going to update" + JSON.stringify(contact)); // Look up the existing record and compare the update timestamp. // If no record exists, just add the new entry. let newRequest = store.get(contact.id); newRequest.onsuccess = function (event) { if (!event.target.result) { - debug("new record!") + if (DEBUG) debug("new record!") this.updateRecordMetadata(contact); store.put(contact); } else { - debug("old record!") + if (DEBUG) debug("old record!") if (new Date(typeof contact.updated === "undefined" ? 0 : contact.updated) < new Date(event.target.result.updated)) { - debug("rev check fail!"); + if (DEBUG) debug("rev check fail!"); txn.abort(); return; } else { - debug("rev check OK"); + if (DEBUG) debug("rev check OK"); contact.published = event.target.result.published; contact.updated = new Date(); store.put(contact); @@ -314,14 +309,14 @@ ContactDB.prototype = { removeContact: function removeContact(aId, aSuccessCb, aErrorCb) { this.newTxn("readwrite", function (txn, store) { - debug("Going to delete" + aId); + if (DEBUG) debug("Going to delete" + aId); store.delete(aId); }, aSuccessCb, aErrorCb); }, clear: function clear(aSuccessCb, aErrorCb) { this.newTxn("readwrite", function (txn, store) { - debug("Going to clear all!"); + if (DEBUG) debug("Going to clear all!"); store.clear(); }, aSuccessCb, aErrorCb); }, @@ -339,7 +334,7 @@ ContactDB.prototype = { * - count */ find: function find(aSuccessCb, aFailureCb, aOptions) { - debug("ContactDB:find val:" + aOptions.filterValue + " by: " + aOptions.filterBy + " op: " + aOptions.filterOp + "\n"); + if (DEBUG) debug("ContactDB:find val:" + aOptions.filterValue + " by: " + aOptions.filterBy + " op: " + aOptions.filterOp + "\n"); let self = this; this.newTxn("readonly", function (txn, store) { if (aOptions && (aOptions.filterOp == "equals" || aOptions.filterOp == "contains")) { @@ -351,12 +346,12 @@ ContactDB.prototype = { }, _findWithIndex: function _findWithIndex(txn, store, options) { - debug("_findWithIndex: " + options.filterValue +" " + options.filterOp + " " + options.filterBy + " "); + if (DEBUG) debug("_findWithIndex: " + options.filterValue +" " + options.filterOp + " " + options.filterBy + " "); let fields = options.filterBy; for (let key in fields) { - debug("key: " + fields[key]); + if (DEBUG) debug("key: " + fields[key]); if (!store.indexNames.contains(fields[key]) && !fields[key] == "id") { - debug("Key not valid!" + fields[key] + ", " + store.indexNames); + if (DEBUG) debug("Key not valid!" + fields[key] + ", " + store.indexNames); txn.abort(); return; } @@ -364,7 +359,7 @@ ContactDB.prototype = { // lookup for all keys if (options.filterBy.length == 0) { - debug("search in all fields!" + JSON.stringify(store.indexNames)); + if (DEBUG) debug("search in all fields!" + JSON.stringify(store.indexNames)); for(let myIndex = 0; myIndex < store.indexNames.length; myIndex++) { fields = Array.concat(fields, store.indexNames[myIndex]) } @@ -383,7 +378,7 @@ ContactDB.prototype = { let index = store.index(key); request = index.mozGetAll(options.filterValue, limit); } else if (options.filterOp == "equals") { - debug("Getting index: " + key); + if (DEBUG) debug("Getting index: " + key); // case sensitive let index = store.index(key); request = index.mozGetAll(options.filterValue, limit); @@ -400,7 +395,7 @@ ContactDB.prototype = { txn.result = {}; request.onsuccess = function (event) { - debug("Request successful. Record count:" + event.target.result.length); + if (DEBUG) debug("Request successful. Record count:" + event.target.result.length); for (let i in event.target.result) txn.result[event.target.result[i].id] = this.makeExport(event.target.result[i]); }.bind(this); @@ -408,13 +403,13 @@ ContactDB.prototype = { }, _findAll: function _findAll(txn, store, options) { - debug("ContactDB:_findAll: " + JSON.stringify(options)); + if (DEBUG) debug("ContactDB:_findAll: " + JSON.stringify(options)); if (!txn.result) txn.result = {}; // Sorting functions takes care of limit if set. let limit = options.sortBy === 'undefined' ? options.filterLimit : null; store.mozGetAll(null, limit).onsuccess = function (event) { - debug("Request successful. Record count:", event.target.result.length); + if (DEBUG) debug("Request successful. Record count:", event.target.result.length); for (let i in event.target.result) txn.result[event.target.result[i].id] = this.makeExport(event.target.result[i]); }.bind(this); diff --git a/dom/contacts/fallback/ContactService.jsm b/dom/contacts/fallback/ContactService.jsm index c4f2450c31f4..c8615958647a 100644 --- a/dom/contacts/fallback/ContactService.jsm +++ b/dom/contacts/fallback/ContactService.jsm @@ -4,11 +4,8 @@ "use strict"; -let DEBUG = 0; -if (DEBUG) - debug = function (s) { dump("-*- Fallback ContactService component: " + s + "\n"); } -else - debug = function (s) {} +const DEBUG = false; +function debug(s) { dump("-*- Fallback ContactService component: " + s + "\n"); } const Cu = Components.utils; const Cc = Components.classes; @@ -28,7 +25,7 @@ let myGlobal = this; let DOMContactManager = { init: function() { - debug("Init"); + if (DEBUG) debug("Init"); this._messages = ["Contacts:Find", "Contacts:Clear", "Contact:Save", "Contact:Remove"]; this._messages.forEach((function(msgName) { ppmm.addMessageListener(msgName, this); @@ -56,7 +53,7 @@ let DOMContactManager = { }, receiveMessage: function(aMessage) { - debug("Fallback DOMContactManager::receiveMessage " + aMessage.name); + if (DEBUG) debug("Fallback DOMContactManager::receiveMessage " + aMessage.name); let mm = aMessage.target.QueryInterface(Ci.nsIFrameMessageManager); let msg = aMessage.data; @@ -112,14 +109,14 @@ let DOMContactManager = { if (msg.options && msg.options.findOptions) { let findOptions = msg.options.findOptions; if (findOptions.sortOrder !== 'undefined' && findOptions.sortBy !== 'undefined') { - debug('sortBy: ' + findOptions.sortBy + ', sortOrder: ' + findOptions.sortOrder ); + if (DEBUG) debug('sortBy: ' + findOptions.sortBy + ', sortOrder: ' + findOptions.sortOrder ); result.sort(sortfunction); if (findOptions.filterLimit) result = result.slice(0, findOptions.filterLimit); } } - debug("result:" + JSON.stringify(result)); + if (DEBUG) debug("result:" + JSON.stringify(result)); mm.sendAsyncMessage("Contacts:Find:Return:OK", {requestID: msg.requestID, contacts: result}); }.bind(this), function(aErrorMsg) { mm.sendAsyncMessage("Contacts:Find:Return:KO", { requestID: msg.requestID, errorMsg: aErrorMsg }) }.bind(this), @@ -145,7 +142,7 @@ let DOMContactManager = { function(aErrorMsg) { mm.sendAsyncMessage("Contacts:Clear:Return:KO", { requestID: msg.requestID, errorMsg: aErrorMsg }); }.bind(this) ); default: - debug("WRONG MESSAGE NAME: " + aMessage.name); + if (DEBUG) debug("WRONG MESSAGE NAME: " + aMessage.name); } } } diff --git a/dom/contacts/tests/test_contacts_basics.html b/dom/contacts/tests/test_contacts_basics.html index ea41a4e3b20b..3bda1254727c 100644 --- a/dom/contacts/tests/test_contacts_basics.html +++ b/dom/contacts/tests/test_contacts_basics.html @@ -92,7 +92,7 @@ var properties2 = { honorificSuffix: "dummyHonorificSuffix", additionalName: "dummyadditionalName", nickname: "dummyNickname", - tel: [{type: ["test"], value: "123456789"},{type: ["home", "custom"], value: "234567890"}], + tel: [{type: ["test"], value: "123456789", carrier: "myCarrier"},{type: ["home", "custom"], value: "234567890"}], email: [{type: ["test"], value: "a@b.c"}, {value: "b@c.d"}], adr: [adr1, adr2], impp: [{type: ["aim"], value:"im1"}, {value: "im2"}], @@ -154,8 +154,8 @@ function checkTel(tel1, tel2) { } function checkField(field1, field2) { - checkStr(field1.type, field1.type, "Same type"); - checkStr(field1.value, field1.value, "Same value"); + checkStr(field1.type, field2.type, "Same type"); + checkStr(field1.value, field2.value, "Same value"); } function checkContacts(contact1, contact2) { @@ -312,6 +312,20 @@ var steps = [ findResult1 = req.result[0]; ok(findResult1.id == sample_id1, "Same ID"); checkContacts(createResult1, properties1); + dump("findResult: " + JSON.stringify(findResult1) + "\n"); + // Some manual testing. Testint the testfunctions + // tel: [{type: ["work"], value: "123456", carrier: "testCarrier"} , {type: ["home", "fax"], value: "+9-876-5432"}], + is(findResult1.tel[0].carrier, "testCarrier", "Same Carrier"); + is(findResult1.tel[0].type, "work", "Same type"); + is(findResult1.tel[0].value, "123456", "Same Value"); + is(findResult1.tel[1].type[1], "fax", "Same type"); + is(findResult1.tel[1].value, "+9-876-5432", "Same Value"); + + is(findResult1.adr[0].countryName, "country 1", "Same country"); + + // email: [{type: ["work"], value: "x@y.com"}] + is(findResult1.email[0].type, "work", "Same Type"); + is(findResult1.email[0].value, "x@y.com", "Same Value"); next(); }; req.onerror = onFailure; diff --git a/dom/interfaces/base/nsIDOMWindowUtils.idl b/dom/interfaces/base/nsIDOMWindowUtils.idl index bb33d348a37b..616e3a4a6485 100644 --- a/dom/interfaces/base/nsIDOMWindowUtils.idl +++ b/dom/interfaces/base/nsIDOMWindowUtils.idl @@ -121,12 +121,17 @@ interface nsIDOMWindowUtils : nsISupports { * * It's legal to set a displayport that extends beyond the overflow * area in any direction (left/right/top/bottom). - * + * * It's also legal to set a displayport that extends beyond the * area's bounds. No pixels are rendered outside the area bounds. * * The caller of this method must have UniversalXPConnect * privileges. + * + * Calling this will always force a recomposite, so it should be + * avoided if at all possible. Client code should do checks before + * calling this so that duplicate sets are not made with the same + * displayport. */ void setDisplayPortForElement(in float aXPx, in float aYPx, in float aWidthPx, in float aHeightPx, diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index 5e33abe36b45..db30f9c54979 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -757,16 +757,9 @@ ContentChild::AddRemoteAlertObserver(const nsString& aData, } bool -ContentChild::RecvPreferenceUpdate(const PrefTuple& aPref) +ContentChild::RecvPreferenceUpdate(const PrefSetting& aPref) { - Preferences::SetPreference(&aPref); - return true; -} - -bool -ContentChild::RecvClearUserPreference(const nsCString& aPrefName) -{ - Preferences::ClearContentPref(aPrefName.get()); + Preferences::SetPreference(aPref); return true; } diff --git a/dom/ipc/ContentChild.h b/dom/ipc/ContentChild.h index 7435fb310483..8d74ae474736 100644 --- a/dom/ipc/ContentChild.h +++ b/dom/ipc/ContentChild.h @@ -136,8 +136,7 @@ public: // auto remove when alertfinished is received. nsresult AddRemoteAlertObserver(const nsString& aData, nsIObserver* aObserver); - virtual bool RecvPreferenceUpdate(const PrefTuple& aPref); - virtual bool RecvClearUserPreference(const nsCString& aPrefName); + virtual bool RecvPreferenceUpdate(const PrefSetting& aPref); virtual bool RecvNotifyAlertsObserver(const nsCString& aType, const nsString& aData); diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index c636f5a7a925..02293abe3286 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -732,9 +732,9 @@ ContentParent::IsForApp() } bool -ContentParent::RecvReadPrefsArray(InfallibleTArray *prefs) +ContentParent::RecvReadPrefsArray(InfallibleTArray* aPrefs) { - Preferences::MirrorPreferences(prefs); + Preferences::GetPreferences(aPrefs); return true; } @@ -954,17 +954,10 @@ ContentParent::Observe(nsISupports* aSubject, // We know prefs are ASCII here. NS_LossyConvertUTF16toASCII strData(aData); - PrefTuple pref; - bool prefNeedUpdate = Preferences::MirrorPreference(strData.get(), &pref); - if (prefNeedUpdate) { - if (!SendPreferenceUpdate(pref)) { - return NS_ERROR_NOT_AVAILABLE; - } - } else { - // Pref wasn't found. It was probably removed. - if (!SendClearUserPreference(strData)) { - return NS_ERROR_NOT_AVAILABLE; - } + PrefSetting pref(strData, null_t(), null_t()); + Preferences::GetPreference(&pref); + if (!SendPreferenceUpdate(pref)) { + return NS_ERROR_NOT_AVAILABLE; } } else if (!strcmp(aTopic, NS_IPC_IOSERVICE_SET_OFFLINE_TOPIC)) { diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h index 55af5d0dcef0..15578f926d57 100644 --- a/dom/ipc/ContentParent.h +++ b/dom/ipc/ContentParent.h @@ -212,7 +212,7 @@ private: virtual PStorageParent* AllocPStorage(const StorageConstructData& aData); virtual bool DeallocPStorage(PStorageParent* aActor); - virtual bool RecvReadPrefsArray(InfallibleTArray *retValue); + virtual bool RecvReadPrefsArray(InfallibleTArray* aPrefs); virtual bool RecvReadFontList(InfallibleTArray* retValue); virtual bool RecvReadPermissions(InfallibleTArray* aPermissions); diff --git a/dom/ipc/PBrowser.ipdl b/dom/ipc/PBrowser.ipdl index 1fe4b94b711a..5c36c6eff3d4 100644 --- a/dom/ipc/PBrowser.ipdl +++ b/dom/ipc/PBrowser.ipdl @@ -251,14 +251,21 @@ parent: nsString aName, nsString aFeatures) returns (bool windowOpened); - NotifyDOMTouchListenerAdded(); - /** * Instructs the TabParent to forward a request to zoom to a rect given in * CSS pixels. This rect is relative to the document. */ ZoomToRect(gfxRect aRect); + /** + * We know for sure that content has either preventDefaulted or not + * preventDefaulted. This applies to an entire batch of touch events. It is + * expected that, if there are any DOM touch listeners, touch events will be + * batched and only processed for panning and zooming if content does not + * preventDefault. + */ + ContentReceivedTouch(bool aPreventDefault); + __delete__(); child: diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl index 0a0379f29a31..e5499ef86c86 100644 --- a/dom/ipc/PContent.ipdl +++ b/dom/ipc/PContent.ipdl @@ -24,7 +24,6 @@ include "mozilla/net/NeckoMessageUtils.h"; include "mozilla/dom/TabMessageUtils.h"; include "nsGeoPositionIPCSerialiser.h"; -include "PPrefTuple.h"; include DOMTypes; @@ -135,6 +134,23 @@ union AppId { nullable PBrowser; }; +union PrefValue { + nsCString; + int32_t; + bool; +}; + +union MaybePrefValue { + PrefValue; + null_t; +}; + +struct PrefSetting { + nsCString name; + MaybePrefValue defaultValue; + MaybePrefValue userValue; +}; + rpc protocol PContent { parent opens PCompositor; @@ -183,8 +199,7 @@ child: async NotifyVisited(URI uri); - PreferenceUpdate(PrefTuple pref); - ClearUserPreference(nsCString prefName); + PreferenceUpdate(PrefSetting pref); NotifyAlertsObserver(nsCString topic, nsString data); @@ -248,7 +263,7 @@ parent: async LoadURIExternal(URI uri); // PrefService message - sync ReadPrefsArray() returns (PrefTuple[] retValue); + sync ReadPrefsArray() returns (PrefSetting[] prefs); sync ReadFontList() returns (FontListEntry[] retValue); diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index 6faf2efb726e..10f260852b6a 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -114,15 +114,7 @@ TabChild::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData) { - if (!strcmp(aTopic, "dom-touch-listener-added")) { - nsCOMPtr subject(do_QueryInterface(aSubject)); - nsCOMPtr win(do_GetInterface(mWebNav)); - nsCOMPtr topSubject; - subject->GetTop(getter_AddRefs(topSubject)); - if (win == topSubject) { - SendNotifyDOMTouchListenerAdded(); - } - } else if (!strcmp(aTopic, "cancel-default-pan-zoom")) { + if (!strcmp(aTopic, "cancel-default-pan-zoom")) { nsCOMPtr docShell(do_QueryInterface(aSubject)); nsCOMPtr tabChild(GetTabChildFrom(docShell)); if (tabChild == this) { @@ -163,9 +155,6 @@ TabChild::Init() do_GetService(NS_OBSERVERSERVICE_CONTRACTID); if (observerService) { - observerService->AddObserver(this, - "dom-touch-listener-added", - false); observerService->AddObserver(this, "cancel-default-pan-zoom", false); @@ -397,12 +386,7 @@ TabChild::ProvideWindow(nsIDOMWindow* aParent, uint32_t aChromeFlags, // open a modal-type window, we're going to create a new