Browse Source

import changes from `dev' branch of rmottola/Arctic-Fox:

- Bug 870173 - Upgrade to clang 3.3. r=ehsan (f654c5710a)
- add missing and previous stuff (4d3e5dbf07)
- Bug 1155476 - Update sccache to 155c926 (c72624ae94)
- goanna->gecko and permissions (a6aa2bb828)
- Bug 1203857 - Allow to build standalone js against jemalloc4. r=gps (cfe96f97a6)
- Bug 1186424: Remove AsmJS min heap length optimization; r=luke (199d840dcf)
- Bug 1198224 - OdinMonkey: hash the signatures, not their addresses (r=bbouvier) (c66aa93445)
- Bug 1178793 - Make asm.js atomic primitives return Int, not Intish. r=luke (cb64cb1ff5)
- Bug 1159473 - Add Mac-specific debug logging code. r=spohl (180e51c1f7)
- fix mispatch (3bbd00e849)
- Bug 1186158 - Receive notifications of sandbox violations in the browser on OS X. r=spohl (e22b97dd79)
- Bug 1152585 - Implement GetClientOffset in nsChildView to fix child offset calculation when drawInTitlebar=false r=mstange (89d4ee9d52)
- [Adapted not to drop 10.5] Bug 1172664 - Use [NSApplication setPresentationOptions:] instead of SetSystemUIMode for hide os chrome. r=smichaud Bug 1188322 - Always hide menubar as well as dock for fullscreen on OS X whatever the screen is. r=mstange (872ef3e90f)
- Bug 1180564: Pref off NSTextInput protocol methods in anticipation of removing them. Also re-organize them so they're all in one spot and fix an unrelated warning. r=masayuki (aef2c0bb7e)
- add back some crash reporter stuff (75dfba90be)
- Bug 1188425 - Add a pref to allow insecure text input, thereby avoiding crashes at [ChildView keyDown:] in non-release builds. r=spohl (e089d0ccea)
- Bug 1193062 - Give synthesized NSEvents a timestamp that is in the right space. r=smichaud (452f7992ca)
- Bug 1193977 - Bind the texture unit we want to use when compositing the OSX titlebar. r=jrmuizel (063830bda1)
- Bug 976722 - Make -moz-appearance:toolbox influence the sheet attachment edge. r=roc (2e87d2e340)
- Bug 1154676 - Add a null-check for the presshell. r=mstange (a41d28effc)
- Bug 1154322 - Always use DrawTargetCG when painting directly into a window on OS X (unaccelerated drawRect rendering). r=jrmuizel (af405884eb)
- Bug 1148868 - Fix up nsChildView::ConfigureAPZControllerThread(). r=kats (497a262ad8)
- Bug 1141917 - Remove unused member function RectTextureImage::UpdateFromDrawTarget(). r=mstange (36182de410)
- Bug 1193062 - Make nsChildView send PanGestureInput events into APZ. r=kats, r=smichaud (696b0a9886)
- Bug 1110888 follow-up: Mark SetPluginFocused as override (26805abd52)
- Bug 1016035 - Move some code around. r=kats (c786056e9b)
pull/8/head
roytam1 5 months ago
parent
commit
abb8daa3fe
  1. 1
      aclocal.m4
  2. 0
      b2g/config/mozconfigs/ics_armv7a_gecko/debug
  3. 0
      b2g/config/mozconfigs/ics_armv7a_gecko/nightly
  4. 0
      b2g/config/mozconfigs/linux32_gecko/debug
  5. 0
      b2g/config/mozconfigs/linux32_gecko/nightly
  6. 0
      b2g/config/mozconfigs/linux64_gecko/debug
  7. 0
      b2g/config/mozconfigs/linux64_gecko/nightly
  8. 0
      b2g/config/mozconfigs/macosx64_gecko/debug
  9. 0
      b2g/config/mozconfigs/macosx64_gecko/nightly
  10. 0
      b2g/config/mozconfigs/win32_gecko/debug
  11. 0
      b2g/config/mozconfigs/win32_gecko/nightly
  12. 4
      b2g/config/tooltool-manifests/linux32/releng.manifest
  13. 4
      b2g/config/tooltool-manifests/linux64/releng.manifest
  14. 4
      b2g/config/tooltool-manifests/macosx64/releng.manifest
  15. 4
      b2g/dev/config/tooltool-manifests/linux64/releng.manifest
  16. 4
      b2g/dev/config/tooltool-manifests/macosx64/releng.manifest
  17. 4
      b2g/dev/config/tooltool-manifests/win32/releng.manifest
  18. 40
      browser/base/content/test/general/browser_bug647886.js
  19. 14
      browser/config/tooltool-manifests/linux32/clang.manifest
  20. 21
      browser/config/tooltool-manifests/linux32/releng.manifest
  21. 22
      browser/config/tooltool-manifests/linux64/clang.manifest
  22. 21
      browser/config/tooltool-manifests/linux64/releng.manifest
  23. 23
      browser/config/tooltool-manifests/macosx64/clang.manifest
  24. 20
      browser/config/tooltool-manifests/macosx64/releng.manifest
  25. 20
      browser/config/tooltool-manifests/win32/releng.manifest
  26. 20
      browser/config/tooltool-manifests/win64/releng.manifest
  27. 100
      build/autoconf/jemalloc.m4
  28. 89
      configure.in
  29. 4
      dom/plugins/ipc/PluginInterposeOSX.mm
  30. 1
      js/src/aclocal.m4
  31. 11
      js/src/asmjs/AsmJSValidate.cpp
  32. 5
      js/src/configure.in
  33. 267
      js/src/jit-test/tests/asm.js/testAtomics.js
  34. 8
      js/src/jit/MIRGenerator.h
  35. 1
      js/src/jit/MIRGraph.cpp
  36. 26
      js/src/jit/RangeAnalysis.cpp
  37. 13
      modules/libpref/init/all.js
  38. 1
      toolkit/library/moz.build
  39. 10
      widget/cocoa/moz.build
  40. 16
      widget/cocoa/nsAppShell.mm
  41. 7
      widget/cocoa/nsChildView.h
  42. 481
      widget/cocoa/nsChildView.mm
  43. 136
      widget/cocoa/nsCocoaDebugUtils.h
  44. 282
      widget/cocoa/nsCocoaDebugUtils.mm
  45. 3
      widget/cocoa/nsCocoaUtils.h
  46. 41
      widget/cocoa/nsCocoaUtils.mm
  47. 1
      widget/cocoa/nsCocoaWindow.h
  48. 14
      widget/cocoa/nsCocoaWindow.mm
  49. 1
      widget/cocoa/nsNativeThemeCocoa.h
  50. 10
      widget/cocoa/nsNativeThemeCocoa.mm
  51. 36
      widget/cocoa/nsSandboxViolationSink.h
  52. 114
      widget/cocoa/nsSandboxViolationSink.mm

1
aclocal.m4 vendored

@ -32,6 +32,7 @@ builtin(include, build/autoconf/icu.m4)dnl
builtin(include, build/autoconf/ffi.m4)dnl
builtin(include, build/autoconf/clang-plugin.m4)dnl
builtin(include, build/autoconf/alloc.m4)dnl
builtin(include, build/autoconf/jemalloc.m4)dnl
MOZ_PROG_CHECKMSYS()

0
b2g/config/mozconfigs/ics_armv7a_goanna/debug → b2g/config/mozconfigs/ics_armv7a_gecko/debug

0
b2g/config/mozconfigs/ics_armv7a_goanna/nightly → b2g/config/mozconfigs/ics_armv7a_gecko/nightly

0
b2g/config/mozconfigs/linux32_goanna/debug → b2g/config/mozconfigs/linux32_gecko/debug

0
b2g/config/mozconfigs/linux32_goanna/nightly → b2g/config/mozconfigs/linux32_gecko/nightly

0
b2g/config/mozconfigs/linux64_goanna/debug → b2g/config/mozconfigs/linux64_gecko/debug

0
b2g/config/mozconfigs/linux64_goanna/nightly → b2g/config/mozconfigs/linux64_gecko/nightly

0
b2g/config/mozconfigs/macosx64_goanna/debug → b2g/config/mozconfigs/macosx64_gecko/debug

0
b2g/config/mozconfigs/macosx64_goanna/nightly → b2g/config/mozconfigs/macosx64_gecko/nightly

0
b2g/config/mozconfigs/win32_goanna/debug → b2g/config/mozconfigs/win32_gecko/debug

0
b2g/config/mozconfigs/win32_goanna/nightly → b2g/config/mozconfigs/win32_gecko/nightly

4
b2g/config/tooltool-manifests/linux32/releng.manifest

@ -13,8 +13,8 @@
"unpack": "True"
},
{
"size": 166506,
"digest": "f3c214fd571f21d64937584645212f8d7c2d12c9016be613bd2bc9cecd80b3d52a741423cc1ca69bd85fb924c3d0572c85a1734d12db1616df37abcc397e9252",
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
},

4
b2g/config/tooltool-manifests/linux64/releng.manifest

@ -13,8 +13,8 @@
"unpack": "True"
},
{
"size": 166506,
"digest": "f3c214fd571f21d64937584645212f8d7c2d12c9016be613bd2bc9cecd80b3d52a741423cc1ca69bd85fb924c3d0572c85a1734d12db1616df37abcc397e9252",
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
},

4
b2g/config/tooltool-manifests/macosx64/releng.manifest

@ -15,8 +15,8 @@
"filename": "clang.tar.bz2"
},
{
"size": 166506,
"digest": "f3c214fd571f21d64937584645212f8d7c2d12c9016be613bd2bc9cecd80b3d52a741423cc1ca69bd85fb924c3d0572c85a1734d12db1616df37abcc397e9252",
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
},

4
b2g/dev/config/tooltool-manifests/linux64/releng.manifest

@ -12,8 +12,8 @@
"filename": "gcc.tar.xz"
},
{
"size": 166506,
"digest": "f3c214fd571f21d64937584645212f8d7c2d12c9016be613bd2bc9cecd80b3d52a741423cc1ca69bd85fb924c3d0572c85a1734d12db1616df37abcc397e9252",
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
},

4
b2g/dev/config/tooltool-manifests/macosx64/releng.manifest

@ -15,8 +15,8 @@
"filename": "clang.tar.bz2"
},
{
"size": 166506,
"digest": "f3c214fd571f21d64937584645212f8d7c2d12c9016be613bd2bc9cecd80b3d52a741423cc1ca69bd85fb924c3d0572c85a1734d12db1616df37abcc397e9252",
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
},

4
b2g/dev/config/tooltool-manifests/win32/releng.manifest

@ -12,8 +12,8 @@
"filename": "setup.sh"
},
{
"size": 166506,
"digest": "f3c214fd571f21d64937584645212f8d7c2d12c9016be613bd2bc9cecd80b3d52a741423cc1ca69bd85fb924c3d0572c85a1734d12db1616df37abcc397e9252",
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
},

40
browser/base/content/test/general/browser_bug647886.js

@ -0,0 +1,40 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
add_task(function* () {
yield BrowserTestUtils.openNewForegroundTab(gBrowser, "http://example.com");
yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function* () {
content.history.pushState({}, "2", "2.html");
});
var backButton = document.getElementById("back-button");
var rect = backButton.getBoundingClientRect();
info("waiting for the history menu to open");
let popupShownPromise = BrowserTestUtils.waitForEvent(backButton, "popupshown");
EventUtils.synthesizeMouseAtCenter(backButton, {type: "mousedown"});
EventUtils.synthesizeMouse(backButton, rect.width / 2, rect.height, {type: "mouseup"});
let event = yield popupShownPromise;
ok(true, "history menu opened");
// Wait for the session data to be flushed before continuing the test
yield new Promise(resolve => SessionStore.getSessionHistory(gBrowser.selectedTab, resolve));
is(event.target.children.length, 2, "Two history items");
let node = event.target.firstChild;
is(node.getAttribute("uri"), "http://example.com/2.html", "first item uri");
is(node.getAttribute("index"), "1", "first item index");
is(node.getAttribute("historyindex"), "0", "first item historyindex");
node = event.target.lastChild;
is(node.getAttribute("uri"), "http://example.com/", "second item uri");
is(node.getAttribute("index"), "0", "second item index");
is(node.getAttribute("historyindex"), "-1", "second item historyindex");
event.target.hidePopup();
gBrowser.removeTab(gBrowser.selectedTab);
});

14
browser/config/tooltool-manifests/linux32/clang.manifest

@ -1,17 +1,17 @@
[
{
"clang_version": "r170890"
"clang_version": "r183744"
},
{
"filename": "setup.sh",
"algorithm": "sha512",
"size": 47,
"digest": "2005a41fe97a5e00997063705f39d42b6a43b1cf7ba306cbc7b1513de34cdcd050fc6326efa2107f19ba0cc67914745dbf13154fa748010a93cf072481ef4aaa",
"size": 47
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"filename": "clang.tar.bz2",
"size": 70206124,
"digest": "a6b8046bd9485f9387dcb1c14b8d442822f02b1caa61b653e8b6cfd96906deadfb4b29809f2cd2b71f919b321d97dd2ebec6020c15f6d485f1641c0f710a762f",
"algorithm": "sha512",
"digest": "0bcfc19f05cc0f042befb3823c7ecce9ba411b152921aa29e97e7adc846e0258fd7da521b1620cb1e61a19d2fcac9b60e6d613c922b6c153e01b9b0766651d09",
"size": 62708281
"filename": "clang.tar.bz2"
}
]

21
browser/config/tooltool-manifests/linux32/releng.manifest

@ -1 +1,20 @@
[]
[
{
"size": 82,
"digest": "70a6126249e40aa1da32248bf6bfe45e0d8c87334579ec0cf69403e61b635e27c766d9bf08d530978286552f158ee24c74b0168a57cc6b734dcfed4fc5e09cff",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 80458572,
"digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad",
"algorithm": "sha512",
"filename": "gcc.tar.xz"
},
{
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
}
]

22
browser/config/tooltool-manifests/linux64/clang.manifest

@ -1,17 +1,17 @@
[
{
"clang_version": "r170890"
},
"clang_version": "r183744"
},
{
"filename": "setup.sh",
"algorithm": "sha512",
"digest": "2005a41fe97a5e00997063705f39d42b6a43b1cf7ba306cbc7b1513de34cdcd050fc6326efa2107f19ba0cc67914745dbf13154fa748010a93cf072481ef4aaa",
"size": 47
},
"size": 47,
"digest": "2005a41fe97a5e00997063705f39d42b6a43b1cf7ba306cbc7b1513de34cdcd050fc6326efa2107f19ba0cc67914745dbf13154fa748010a93cf072481ef4aaa",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"filename": "clang.tar.bz2",
"algorithm": "sha512",
"digest": "e14ccefd965372a57c540647b2b99e21a4aa82f81a8b9a9e18dac7cba4c3436181bef0dfab8c51bcb5c343f504a693fdcfbe7d609f10291b5dd65ab059979d29",
"size": 63034761
"size": 70350828,
"digest": "6cd04e8ec44c6fef159349c22bd0476891e4a2d46479f9586283eaf3305e42f79c720d40dfec0e78d8899c1651189b12e285de60862ffd0612b0dac7a0c336c6",
"algorithm": "sha512",
"filename": "clang.tar.bz2"
}
]

21
browser/config/tooltool-manifests/linux64/releng.manifest

@ -1 +1,20 @@
[]
[
{
"size": 82,
"digest": "70a6126249e40aa1da32248bf6bfe45e0d8c87334579ec0cf69403e61b635e27c766d9bf08d530978286552f158ee24c74b0168a57cc6b734dcfed4fc5e09cff",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 80458572,
"digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad",
"algorithm": "sha512",
"filename": "gcc.tar.xz"
},
{
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
}
]

23
browser/config/tooltool-manifests/macosx64/clang.manifest

@ -0,0 +1,23 @@
[
{
"clang_version": "r183744"
},
{
"size": 88,
"digest": "0d2ae9bcd7cea34ec0b768270725e98410dbb3bc150c7381e0dcf3eb5dbb3e69ac76dbb0f46b056151d6a6fa8681cab06da68173ae8598f3397b8f7628e67381",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 59602619,
"digest": "86662ebc0ef650490559005948c4f0cb015dad72c7cac43732c2bf2995247081e30c139cf8008d19670a0009fc302c4eee2676981ee3f9ff4a15c01af22b783b",
"algorithm": "sha512",
"filename": "clang.tar.bz2"
},
{
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
}
]

20
browser/config/tooltool-manifests/macosx64/releng.manifest

@ -1,17 +1,23 @@
[
{
"clang_version": "r170890"
},
"clang_version": "r183744"
},
{
"size": 47,
"digest": "2005a41fe97a5e00997063705f39d42b6a43b1cf7ba306cbc7b1513de34cdcd050fc6326efa2107f19ba0cc67914745dbf13154fa748010a93cf072481ef4aaa",
"size": 88,
"digest": "0d2ae9bcd7cea34ec0b768270725e98410dbb3bc150c7381e0dcf3eb5dbb3e69ac76dbb0f46b056151d6a6fa8681cab06da68173ae8598f3397b8f7628e67381",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 59602619,
"digest": "86662ebc0ef650490559005948c4f0cb015dad72c7cac43732c2bf2995247081e30c139cf8008d19670a0009fc302c4eee2676981ee3f9ff4a15c01af22b783b",
"algorithm": "sha512",
"filename": "clang.tar.bz2"
},
{
"size": 56126352,
"digest": "e156e2a39abd5bf272ee30748a6825f22ddd27565b097c66662a2a6f2e9892bc5b4bf30a3552dffbe867dbfc39e7ee086e0b2cd7935f6ea216c0cf936178a88f",
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "clang.tar.bz2"
"filename": "sccache.tar.bz2"
}
]

20
browser/config/tooltool-manifests/win32/releng.manifest

@ -0,0 +1,20 @@
[
{
"size": 266240,
"digest": "bb345b0e700ffab4d09436981f14b5de84da55a3f18a7f09ebc4364a4488acdeab8d46f447b12ac70f2da1444a68b8ce8b8675f0dae2ccf845e966d1df0f0869",
"algorithm": "sha512",
"filename": "mozmake.exe"
},
{
"size": 176,
"digest": "2809058907ac5eefdc394113d2e4fe76ba559ac61c2eca2f88e7a12a74bdf44a15d9039fa8aa229f7362a14b67d67395063f68147ae098beac5dfcc78aff98da",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
}
]

20
browser/config/tooltool-manifests/win64/releng.manifest

@ -0,0 +1,20 @@
[
{
"size": 266240,
"digest": "bb345b0e700ffab4d09436981f14b5de84da55a3f18a7f09ebc4364a4488acdeab8d46f447b12ac70f2da1444a68b8ce8b8675f0dae2ccf845e966d1df0f0869",
"algorithm": "sha512",
"filename": "mozmake.exe"
},
{
"size": 176,
"digest": "2809058907ac5eefdc394113d2e4fe76ba559ac61c2eca2f88e7a12a74bdf44a15d9039fa8aa229f7362a14b67d67395063f68147ae098beac5dfcc78aff98da",
"algorithm": "sha512",
"filename": "setup.sh"
},
{
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
"filename": "sccache.tar.bz2"
}
]

100
build/autoconf/jemalloc.m4

@ -0,0 +1,100 @@
dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
AC_DEFUN([MOZ_SUBCONFIGURE_JEMALLOC], [
if test -z "$BUILDING_JS" -o -n "$JS_STANDALONE"; then
# Run jemalloc configure script
if test -z "$MOZ_NATIVE_JEMALLOC" -a "$MOZ_MEMORY" && test -n "$MOZ_JEMALLOC4" -o -n "$MOZ_REPLACE_MALLOC"; then
ac_configure_args="--build=$build --host=$target --enable-stats --with-jemalloc-prefix=je_ --disable-valgrind"
# We're using memalign for _aligned_malloc in memory/build/mozmemory_wrap.c
# on Windows, so just export memalign on all platforms.
ac_configure_args="$ac_configure_args ac_cv_func_memalign=yes"
if test -n "$MOZ_REPLACE_MALLOC"; then
# When using replace_malloc, we always want valloc exported from jemalloc.
ac_configure_args="$ac_configure_args ac_cv_func_valloc=yes"
if test "${OS_ARCH}" = Darwin; then
# We also need to enable pointer validation on Mac because jemalloc's
# zone allocator is not used.
ac_configure_args="$ac_configure_args --enable-ivsalloc"
fi
fi
if test -n "$MOZ_JEMALLOC4"; then
case "${OS_ARCH}" in
WINNT|Darwin)
# We want jemalloc functions to be kept hidden on both Mac and Windows
# See memory/build/mozmemory_wrap.h for details.
ac_configure_args="$ac_configure_args --without-export"
;;
esac
if test "${OS_ARCH}" = WINNT; then
# Lazy lock initialization doesn't play well with lazy linking of
# mozglue.dll on Windows XP (leads to startup crash), so disable it.
ac_configure_args="$ac_configure_args --disable-lazy-lock"
fi
elif test "${OS_ARCH}" = Darwin; then
# When building as a replace-malloc lib, disabling the zone allocator
# forces to use pthread_atfork.
ac_configure_args="$ac_configure_args --disable-zone-allocator"
fi
_MANGLE="malloc posix_memalign aligned_alloc calloc realloc free memalign valloc malloc_usable_size"
JEMALLOC_WRAPPER=
if test -z "$MOZ_REPLACE_MALLOC"; then
case "$OS_ARCH" in
Linux|DragonFly|FreeBSD|NetBSD|OpenBSD)
MANGLE=$_MANGLE
;;
esac
elif test -z "$MOZ_JEMALLOC4"; then
MANGLE=$_MANGLE
JEMALLOC_WRAPPER=replace_
fi
if test -n "$MANGLE"; then
MANGLED=
for mangle in ${MANGLE}; do
if test -n "$MANGLED"; then
MANGLED="$mangle:$JEMALLOC_WRAPPER$mangle,$MANGLED"
else
MANGLED="$mangle:$JEMALLOC_WRAPPER$mangle"
fi
done
ac_configure_args="$ac_configure_args --with-mangling=$MANGLED"
fi
unset CONFIG_FILES
if test -z "$MOZ_TLS"; then
ac_configure_args="$ac_configure_args --disable-tls"
fi
EXTRA_CFLAGS="$CFLAGS"
for var in AS CC CXX CPP LD AR RANLIB STRIP CPPFLAGS EXTRA_CFLAGS LDFLAGS; do
ac_configure_args="$ac_configure_args $var='`eval echo \\${${var}}`'"
done
# Force disable DSS support in jemalloc.
ac_configure_args="$ac_configure_args ac_cv_func_sbrk=false"
# Make Linux builds munmap freed chunks instead of recycling them.
ac_configure_args="$ac_configure_args --enable-munmap"
# Disable cache oblivious behavior that appears to have a performance
# impact on Firefox.
ac_configure_args="$ac_configure_args --disable-cache-oblivious"
if ! test -e memory/jemalloc; then
mkdir -p memory/jemalloc
fi
# jemalloc's configure runs git to determine the version. But when building
# from a gecko git clone, the git commands it uses is going to pick gecko's
# information, not jemalloc's, which is useless. So pretend we don't have git
# at all. That will make jemalloc's configure pick the in-tree VERSION file.
(PATH="$srcdir/memory/jemalloc/helper:$PATH";
AC_OUTPUT_SUBDIRS(memory/jemalloc/src)
) || exit 1
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
fi
fi
])

89
configure.in

@ -8701,94 +8701,7 @@ if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then
MOZ_SUBCONFIGURE_FFI()
fi
# Run jemalloc configure script
if test -z "$MOZ_NATIVE_JEMALLOC" -a "$MOZ_MEMORY" && test -n "$MOZ_JEMALLOC4" -o -n "$MOZ_REPLACE_MALLOC"; then
ac_configure_args="--build=$build --host=$target --enable-stats --with-jemalloc-prefix=je_ --disable-valgrind"
# We're using memalign for _aligned_malloc in memory/build/mozmemory_wrap.c
# on Windows, so just export memalign on all platforms.
ac_configure_args="$ac_configure_args ac_cv_func_memalign=yes"
if test -n "$MOZ_REPLACE_MALLOC"; then
# When using replace_malloc, we always want valloc exported from jemalloc.
ac_configure_args="$ac_configure_args ac_cv_func_valloc=yes"
if test "${OS_ARCH}" = Darwin; then
# We also need to enable pointer validation on Mac because jemalloc's
# zone allocator is not used.
ac_configure_args="$ac_configure_args --enable-ivsalloc"
fi
fi
if test -n "$MOZ_JEMALLOC4"; then
case "${OS_ARCH}" in
WINNT|Darwin)
# We want jemalloc functions to be kept hidden on both Mac and Windows
# See memory/build/mozmemory_wrap.h for details.
ac_configure_args="$ac_configure_args --without-export"
;;
esac
if test "${OS_ARCH}" = WINNT; then
# Lazy lock initialization doesn't play well with lazy linking of
# mozglue.dll on Windows XP (leads to startup crash), so disable it.
ac_configure_args="$ac_configure_args --disable-lazy-lock"
fi
elif test "${OS_ARCH}" = Darwin; then
# When building as a replace-malloc lib, disabling the zone allocator
# forces to use pthread_atfork.
ac_configure_args="$ac_configure_args --disable-zone-allocator"
fi
_MANGLE="malloc posix_memalign aligned_alloc calloc realloc free memalign valloc malloc_usable_size"
JEMALLOC_WRAPPER=
if test -z "$MOZ_REPLACE_MALLOC"; then
case "$OS_ARCH" in
Linux|DragonFly|FreeBSD|NetBSD|OpenBSD)
MANGLE=$_MANGLE
;;
esac
elif test -z "$MOZ_JEMALLOC4"; then
MANGLE=$_MANGLE
JEMALLOC_WRAPPER=replace_
fi
if test -n "$MANGLE"; then
MANGLED=
for mangle in ${MANGLE}; do
if test -n "$MANGLED"; then
MANGLED="$mangle:$JEMALLOC_WRAPPER$mangle,$MANGLED"
else
MANGLED="$mangle:$JEMALLOC_WRAPPER$mangle"
fi
done
ac_configure_args="$ac_configure_args --with-mangling=$MANGLED"
fi
unset CONFIG_FILES
if test -z "$MOZ_TLS"; then
ac_configure_args="$ac_configure_args --disable-tls"
fi
EXTRA_CFLAGS="$CFLAGS"
for var in AS CC CXX CPP LD AR RANLIB STRIP CPPFLAGS EXTRA_CFLAGS LDFLAGS; do
ac_configure_args="$ac_configure_args $var='`eval echo \\${${var}}`'"
done
# Force disable DSS support in jemalloc.
ac_configure_args="$ac_configure_args ac_cv_func_sbrk=false"
# Make Linux builds munmap freed chunks instead of recycling them.
ac_configure_args="$ac_configure_args --enable-munmap"
# Disable cache oblivious behavior that appears to have a performance
# impact on Firefox.
ac_configure_args="$ac_configure_args --disable-cache-oblivious"
if ! test -e memory/jemalloc; then
mkdir -p memory/jemalloc
fi
# jemalloc's configure runs git to determine the version. But when building
# from a gecko git clone, the git commands it uses is going to pick gecko's
# information, not jemalloc's, which is useless. So pretend we don't have git
# at all. That will make jemalloc's configure pick the in-tree VERSION file.
(PATH="$srcdir/memory/jemalloc/helper:$PATH";
AC_OUTPUT_SUBDIRS(memory/jemalloc/src)
) || exit 1
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
fi
MOZ_SUBCONFIGURE_JEMALLOC()
# Run freetype configure script

4
dom/plugins/ipc/PluginInterposeOSX.mm

@ -584,7 +584,7 @@ void OnPluginShowWindow(uint32_t window_id,
plugin_fullscreen_windows_set_.end())) {
plugin_fullscreen_windows_set_.insert(window_id);
nsCocoaUtils::HideOSChromeOnScreen(TRUE, [[NSScreen screens] objectAtIndex:0]);
nsCocoaUtils::HideOSChromeOnScreen(true);
}
}
@ -607,7 +607,7 @@ static void ReleasePluginFullScreen(pid_t plugin_pid) {
// focus, but give it back to the plugin process if requested.
ActivateProcess(base::GetCurrentProcId());
nsCocoaUtils::HideOSChromeOnScreen(FALSE, [[NSScreen screens] objectAtIndex:0]);
nsCocoaUtils::HideOSChromeOnScreen(false);
if (plugin_pid != -1) {
ActivateProcess(plugin_pid);

1
js/src/aclocal.m4 vendored

@ -31,6 +31,7 @@ builtin(include, ../../build/autoconf/icu.m4)dnl
builtin(include, ../../build/autoconf/ffi.m4)dnl
builtin(include, ../../build/autoconf/clang-plugin.m4)dnl
builtin(include, ../../build/autoconf/alloc.m4)dnl
builtin(include, ../../build/autoconf/jemalloc.m4)dnl
define([__MOZ_AC_INIT_PREPARE], defn([AC_INIT_PREPARE]))
define([AC_INIT_PREPARE],

11
js/src/asmjs/AsmJSValidate.cpp

@ -1367,7 +1367,7 @@ class MOZ_STACK_CLASS ModuleCompiler
return hn;
}
static bool match(const ExitDescriptor& lhs, const ExitDescriptor& rhs) {
return lhs.name_ == rhs.name_ && lhs.sig_ == rhs.sig_;
return lhs.name_ == rhs.name_ && *lhs.sig_ == *rhs.sig_;
}
};
@ -6012,7 +6012,7 @@ CheckAtomicsLoad(FunctionBuilder& f, ParseNode* call, Type* type)
f.patchU8(needsBoundsCheckAt, uint8_t(needsBoundsCheck));
f.patchU8(viewTypeAt, uint8_t(viewType));
*type = Type::Intish;
*type = Type::Int;
return true;
}
@ -6109,7 +6109,7 @@ CheckAtomicsBinop(FunctionBuilder& f, ParseNode* call, Type* type, js::jit::Atom
f.patchU8(needsBoundsCheckAt, uint8_t(needsBoundsCheck));
f.patchU8(viewTypeAt, uint8_t(viewType));
*type = Type::Intish;
*type = Type::Int;
return true;
}
@ -6184,7 +6184,7 @@ CheckAtomicsCompareExchange(FunctionBuilder& f, ParseNode* call, Type* type)
f.patchU8(needsBoundsCheckAt, uint8_t(needsBoundsCheck));
f.patchU8(viewTypeAt, uint8_t(viewType));
*type = Type::Intish;
*type = Type::Int;
return true;
}
@ -6236,7 +6236,7 @@ CheckAtomicsExchange(FunctionBuilder& f, ParseNode* call, Type* type)
f.patchU8(needsBoundsCheckAt, uint8_t(needsBoundsCheck));
f.patchU8(viewTypeAt, uint8_t(viewType));
*type = Type::Intish;
*type = Type::Int;
return true;
}
@ -10320,7 +10320,6 @@ EmitMIR(ModuleCompiler& m, const AsmFunction& function, LifoAlloc& lifo,
}
MIRGenerator *mir = f.extractMIR();
mir->initMinAsmJSHeapLength(f.m().minHeapLength());
jit::SpewBeginFunction(mir, nullptr);

5
js/src/configure.in

@ -3030,6 +3030,10 @@ if test "$MOZ_MEMORY"; then
esac
fi
AC_SUBST(MOZ_MEMORY)
AC_SUBST(MOZ_JEMALLOC4)
if test -n "$MOZ_JEMALLOC4"; then
AC_DEFINE(MOZ_JEMALLOC4)
fi
AC_SUBST(MOZ_CRT)
AC_SUBST(MOZ_GLUE_IN_PROGRAM)
AC_SUBST_LIST(MOZ_GLUE_WRAP_LDFLAGS)
@ -3876,6 +3880,7 @@ if test -n "$MOZ_BUILD_NSPR"; then
MOZ_SUBCONFIGURE_NSPR()
fi
MOZ_SUBCONFIGURE_FFI()
MOZ_SUBCONFIGURE_JEMALLOC()
dnl Spit out some output
dnl ========================================================

267
js/src/jit-test/tests/asm.js/testAtomics.js

File diff suppressed because it is too large Load Diff

8
js/src/jit/MIRGenerator.h

@ -152,13 +152,6 @@ class MIRGenerator
// Traverses the graph to find if there's any SIMD instruction. Costful but
// the value is cached, so don't worry about calling it several times.
bool usesSimd();
void initMinAsmJSHeapLength(uint32_t len) {
MOZ_ASSERT(minAsmJSHeapLength_ == 0);
minAsmJSHeapLength_ = len;
}
uint32_t minAsmJSHeapLength() const {
return minAsmJSHeapLength_;
}
bool modifiesFrameArguments() const {
return modifiesFrameArguments_;
@ -193,7 +186,6 @@ class MIRGenerator
bool performsCall_;
bool usesSimd_;
bool usesSimdCached_;
uint32_t minAsmJSHeapLength_;
// Keep track of whether frame arguments are modified during execution.
// RegAlloc needs to know this as spilling values back to their register

1
js/src/jit/MIRGraph.cpp

@ -38,7 +38,6 @@ MIRGenerator::MIRGenerator(CompileCompartment* compartment, const JitCompileOpti
performsCall_(false),
usesSimd_(false),
usesSimdCached_(false),
minAsmJSHeapLength_(0),
modifiesFrameArguments_(false),
instrumentedProfiling_(false),
instrumentedProfilingIsCached_(false),

26
js/src/jit/RangeAnalysis.cpp

@ -2240,32 +2240,8 @@ RangeAnalysis::analyze()
// First pass at collecting range info - while the beta nodes are still
// around and before truncation.
for (MInstructionIterator iter(block->begin()); iter != block->end(); iter++) {
for (MInstructionIterator iter(block->begin()); iter != block->end(); iter++)
iter->collectRangeInfoPreTrunc();
// Would have been nice to implement this using collectRangeInfoPreTrunc()
// methods but it needs the minAsmJSHeapLength().
if (mir->compilingAsmJS()) {
uint32_t minHeapLength = mir->minAsmJSHeapLength();
if (iter->isAsmJSLoadHeap()) {
MAsmJSLoadHeap* ins = iter->toAsmJSLoadHeap();
Range* range = ins->ptr()->range();
uint32_t elemSize = TypedArrayElemSize(ins->accessType());
if (range && range->hasInt32LowerBound() && range->lower() >= 0 &&
range->hasInt32UpperBound() && uint32_t(range->upper()) + elemSize <= minHeapLength) {
ins->removeBoundsCheck();
}
} else if (iter->isAsmJSStoreHeap()) {
MAsmJSStoreHeap* ins = iter->toAsmJSStoreHeap();
Range* range = ins->ptr()->range();
uint32_t elemSize = TypedArrayElemSize(ins->accessType());
if (range && range->hasInt32LowerBound() && range->lower() >= 0 &&
range->hasInt32UpperBound() && uint32_t(range->upper()) + elemSize <= minHeapLength) {
ins->removeBoundsCheck();
}
}
}
}
}
return true;

13
modules/libpref/init/all.js

@ -5040,10 +5040,21 @@ pref("dom.beforeAfterKeyboardEvent.enabled", false);
// Presentation API
pref("dom.presentation.enabled", false);
// Use raw ICU instead of CoreServices API in Unicode collation
#ifdef XP_MACOSX
// Use raw ICU instead of CoreServices API in Unicode collation
pref("intl.collation.mac.use_icu", true);
// Enable NSTextInput protocol for use with IMEs that have not
// been updated to use the NSTextInputClient protocol.
pref("intl.ime.nstextinput.enable", false);
#if !defined(RELEASE_BUILD) || defined(DEBUG)
// In non-release builds we crash by default on insecure text input (when a
// password editor has focus but secure event input isn't enabled). The
// following pref, when turned on, disables this behavior. See bug 1188425.
pref("intl.allow-insecure-text-input", false);
#endif
#endif // XP_MACOSX
// Enable meta-viewport support in remote APZ-enabled frames.
pref("dom.meta-viewport.enabled", false);

1
toolkit/library/moz.build

@ -153,6 +153,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
'-framework IOKit',
'-F%s' % CONFIG['MACOS_PRIVATE_FRAMEWORKS_DIR'],
'-framework CoreUI',
'-framework CoreSymbolication',
'cups',
]

10
widget/cocoa/moz.build

@ -14,6 +14,7 @@ EXPORTS += [
'mozView.h',
'nsBidiKeyboard.h',
'nsChangeObserver.h',
'nsCocoaDebugUtils.h',
'nsCocoaFeatures.h',
'nsCocoaUtils.h',
]
@ -65,8 +66,14 @@ UNIFIED_SOURCES += [
SOURCES += [
'nsChildView.mm',
'nsClipboard.mm',
'nsCocoaDebugUtils.mm',
]
if not CONFIG['RELEASE_BUILD'] or CONFIG['DEBUG']:
SOURCES += [
'nsSandboxViolationSink.mm',
]
include('/ipc/chromium/chromium-config.mozbuild')
if CONFIG['GNU_CXX']:
@ -75,9 +82,6 @@ if CONFIG['GNU_CXX']:
# XXX: We should fix these warnings.
ALLOW_COMPILER_WARNINGS = True
# XXX: We should fix these warnings.
ALLOW_COMPILER_WARNINGS = True
FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'/layout/forms',

16
widget/cocoa/nsAppShell.mm

@ -34,6 +34,9 @@
#include "mozilla/HangMonitor.h"
#include "GeckoProfiler.h"
#include "pratom.h"
#if !defined(RELEASE_BUILD) || defined(DEBUG)
#include "nsSandboxViolationSink.h"
#endif
#include <IOKit/pwr_mgt/IOPMLib.h>
#include "nsIDOMWakeLockListener.h"
@ -320,6 +323,13 @@ nsAppShell::Init()
CGSSetDebugOptions(0x80000007);
}
#if !defined(RELEASE_BUILD) || defined(DEBUG)
if (nsCocoaFeatures::OnMavericksOrLater() &&
Preferences::GetBool("security.sandbox.mac.track.violations", false)) {
nsSandboxViolationSink::Start();
}
#endif
[localPool release];
return rv;
@ -674,6 +684,12 @@ nsAppShell::Exit(void)
mTerminated = true;
#if !defined(RELEASE_BUILD) || defined(DEBUG)
if (nsCocoaFeatures::OnMavericksOrLater()) {
nsSandboxViolationSink::Stop();
}
#endif
// Quoting from Apple's doc on the [NSApplication stop:] method (from their
// doc on the NSApplication class): "If this method is invoked during a
// modal event loop, it will break that loop but not the main event loop."

7
widget/cocoa/nsChildView.h

@ -43,6 +43,7 @@ class RectTextureImage;
namespace mozilla {
class VibrancyManager;
class InputData;
namespace layers {
class GLManager;
class APZCTreeManager;
@ -547,10 +548,14 @@ public:
int32_t aPanelX, int32_t aPanelY,
nsString& aCommitted) override;
NS_IMETHOD SetPluginFocused(bool& aFocused);
NS_IMETHOD SetPluginFocused(bool& aFocused) override;
bool IsPluginFocused() { return mPluginFocused; }
virtual nsIntPoint GetClientOffset() override;
mozilla::WidgetWheelEvent DispatchAPZWheelInputEvent(mozilla::InputData& aEvent);
protected:
virtual ~nsChildView();

481
widget/cocoa/nsChildView.mm

@ -73,6 +73,9 @@
#include "nsAccessibilityService.h"
#include "mozilla/a11y/Platform.h"
#endif
#ifdef MOZ_CRASHREPORTER
#include "nsExceptionHandler.h"
#endif
#include "mozilla/Preferences.h"
@ -292,10 +295,6 @@ public:
const nsIntRegion& aDirtyRegion,
CGContextRef aCGContext);
void UpdateFromDrawTarget(const nsIntSize& aNewSize,
const nsIntRegion& aDirtyRegion,
gfx::DrawTarget* aFromDrawTarget);
nsIntRegion GetUpdateRegion() {
MOZ_ASSERT(mInUpdate, "update region only valid during update");
return mUpdateRegion;
@ -1128,7 +1127,7 @@ nsresult nsChildView::SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint,
NSEvent* event = [NSEvent mouseEventWithType:(NSEventType)aNativeMessage
location:windowPoint
modifierFlags:aModifierFlags
timestamp:[NSDate timeIntervalSinceReferenceDate]
timestamp:[[NSProcessInfo processInfo] systemUptime]
windowNumber:[[mView window] windowNumber]
context:nil
eventNumber:0
@ -1498,6 +1497,17 @@ void nsChildView::ReportSizeEvent()
#pragma mark -
nsIntPoint nsChildView::GetClientOffset()
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
NSPoint origin = [mView convertPoint:NSMakePoint(0, 0) toView:nil];
origin.y = [[mView window] frame].size.height - origin.y;
return CocoaPointsToDevPixels(origin);
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(nsIntPoint(0, 0));
}
// Return the offset between this child view and the screen.
// @return -- widget origin in device-pixel coords
LayoutDeviceIntPoint nsChildView::WidgetToScreenOffset()
@ -1655,7 +1665,7 @@ nsChildView::StartPluginIME(const mozilla::WidgetKeyboardEvent& aKeyboardEvent,
// currently exists. So nested IME should never reach here, and so it should
// be fine to use the last key-down event received by -[ChildView keyDown:]
// (as we currently do).
ctiPanel->InterpretKeyEvent([mView lastKeyDownEvent], aCommitted);
ctiPanel->InterpretKeyEvent([(ChildView*)mView lastKeyDownEvent], aCommitted);
return NS_OK;
}
@ -1918,9 +1928,13 @@ nsChildView::ConfigureAPZCTreeManager()
void
nsChildView::ConfigureAPZControllerThread()
{
// On OS X the EventThreadRunner is the controller thread, but it doesn't
// have a MessageLoop.
APZThreadUtils::SetControllerThread(nullptr);
if (gfxPrefs::AsyncPanZoomSeparateEventThread()) {
// The EventThreadRunner is the controller thread, but it doesn't
// have a MessageLoop.
APZThreadUtils::SetControllerThread(nullptr);
} else {
nsBaseWidget::ConfigureAPZControllerThread();
}
}
nsIntRect
@ -2402,11 +2416,13 @@ nsChildView::UpdateThemeGeometries(const nsTArray<ThemeGeometry>& aThemeGeometri
if (![[mView window] isKindOfClass:[ToolbarWindow class]])
return;
// Update unified toolbar height.
// Update unified toolbar height and sheet attachment position.
int32_t windowWidth = mBounds.width;
int32_t titlebarBottom = FindTitlebarBottom(aThemeGeometries, windowWidth);
int32_t unifiedToolbarBottom =
FindUnifiedToolbarBottom(aThemeGeometries, windowWidth, titlebarBottom);
int32_t toolboxBottom =
FindFirstRectOfType(aThemeGeometries, nsNativeThemeCocoa::eThemeGeometryTypeToolbox).YMost();
ToolbarWindow* win = (ToolbarWindow*)[mView window];
bool drawsContentsIntoWindowFrame = [win drawsContentsIntoWindowFrame];
@ -2414,6 +2430,8 @@ nsChildView::UpdateThemeGeometries(const nsTArray<ThemeGeometry>& aThemeGeometri
int32_t contentOffset = drawsContentsIntoWindowFrame ? titlebarHeight : 0;
int32_t devUnifiedHeight = titlebarHeight + unifiedToolbarBottom - contentOffset;
[win setUnifiedToolbarHeight:DevPixelsToCocoaPoints(devUnifiedHeight)];
int32_t devSheetPosition = titlebarHeight + std::max(toolboxBottom, unifiedToolbarBottom) - contentOffset;
[win setSheetAttachmentPosition:DevPixelsToCocoaPoints(devSheetPosition)];
// Update titlebar control offsets.
nsIntRect windowButtonRect = FindFirstRectOfType(aThemeGeometries, nsNativeThemeCocoa::eThemeGeometryTypeWindowButtons);
@ -2640,6 +2658,60 @@ nsChildView::UpdateWindowDraggingRegion(const nsIntRegion& aRegion)
}
}
WidgetWheelEvent
nsChildView::DispatchAPZWheelInputEvent(InputData& aEvent)
{
WidgetWheelEvent event(true, NS_WHEEL_WHEEL, this);
if (mAPZC) {
uint64_t inputBlockId = 0;
ScrollableLayerGuid guid;
nsEventStatus result = mAPZC->ReceiveInputEvent(aEvent, &guid, &inputBlockId);
if (result == nsEventStatus_eConsumeNoDefault) {
return event;
}
switch(aEvent.mInputType) {
case PANGESTURE_INPUT: {
event = aEvent.AsPanGestureInput().ToWidgetWheelEvent(this);
break;
}
case SCROLLWHEEL_INPUT: {
event = aEvent.AsScrollWheelInput().ToWidgetWheelEvent(this);
break;
};
default:
MOZ_CRASH("unsupported event type");
return event;
}
if (event.mMessage == NS_WHEEL_WHEEL &&
(event.deltaX != 0 || event.deltaY != 0)) {
ProcessUntransformedAPZEvent(&event, guid, inputBlockId, result);
}
return event;
}
nsEventStatus status;
switch(aEvent.mInputType) {
case PANGESTURE_INPUT: {
event = aEvent.AsPanGestureInput().ToWidgetWheelEvent(this);
break;
}
case SCROLLWHEEL_INPUT: {
event = aEvent.AsScrollWheelInput().ToWidgetWheelEvent(this);
break;
}
default:
MOZ_CRASH("unexpected event type");
return event;
}
if (event.mMessage == NS_WHEEL_WHEEL &&
(event.deltaX != 0 || event.deltaY != 0)) {
DispatchEvent(&event, status);
}
return event;
}
#ifdef ACCESSIBILITY
already_AddRefed<a11y::Accessible>
nsChildView::GetDocumentAccessible()
@ -2784,29 +2856,6 @@ RectTextureImage::UpdateFromCGContext(const nsIntSize& aNewSize,
}
}
void
RectTextureImage::UpdateFromDrawTarget(const nsIntSize& aNewSize,
const nsIntRegion& aDirtyRegion,
gfx::DrawTarget* aFromDrawTarget)
{
mUpdateDrawTarget = aFromDrawTarget;
mBufferSize.SizeTo(aFromDrawTarget->GetSize().width, aFromDrawTarget->GetSize().height);
RefPtr<gfx::DrawTarget> drawTarget = BeginUpdate(aNewSize, aDirtyRegion);
if (drawTarget) {
if (drawTarget != aFromDrawTarget) {
RefPtr<gfx::SourceSurface> source = aFromDrawTarget->Snapshot();
gfx::Rect rect(0, 0, aFromDrawTarget->GetSize().width, aFromDrawTarget->GetSize().height);
gfxUtils::ClipToRegion(drawTarget, GetUpdateRegion());
drawTarget->DrawSurface(source, rect, rect,
gfx::DrawSurfaceOptions(),
gfx::DrawOptions(1.0, gfx::CompositionOp::OP_SOURCE));
drawTarget->PopClip();
}
EndUpdate();
}
mUpdateDrawTarget = nullptr;
}
void
RectTextureImage::Draw(GLManager* aManager,
const nsIntPoint& aLocation,
@ -2815,6 +2864,7 @@ RectTextureImage::Draw(GLManager* aManager,
ShaderProgramOGL* program = aManager->GetProgram(LOCAL_GL_TEXTURE_RECTANGLE_ARB,
gfx::SurfaceFormat::R8G8B8A8);
aManager->gl()->fActiveTexture(LOCAL_GL_TEXTURE0);
aManager->gl()->fBindTexture(LOCAL_GL_TEXTURE_RECTANGLE_ARB, mTexture);
aManager->ActivateProgram(program);
@ -3197,7 +3247,10 @@ NSEvent* gLastDragMouseDownEvent = nil;
if (mGeckoChild) {
nsIWidgetListener* listener = mGeckoChild->GetWidgetListener();
if (listener) {
listener->GetPresShell()->ReconstructFrames();
nsIPresShell* presShell = listener->GetPresShell();
if (presShell) {
presShell->ReconstructFrames();
}
}
}
}
@ -3504,29 +3557,13 @@ NSEvent* gLastDragMouseDownEvent = nil;
// Create Cairo objects.
nsRefPtr<gfxQuartzSurface> targetSurface;
nsRefPtr<gfxContext> targetContext;
if (gfxPlatform::GetPlatform()->SupportsAzureContentForType(gfx::BackendType::COREGRAPHICS)) {
RefPtr<gfx::DrawTarget> dt =
gfx::Factory::CreateDrawTargetForCairoCGContext(aContext,
gfx::IntSize(backingSize.width,
backingSize.height));
MOZ_ASSERT(dt); // see implementation
dt->AddUserData(&gfxContext::sDontUseAsSourceKey, dt, nullptr);
targetContext = new gfxContext(dt);
} else if (gfxPlatform::GetPlatform()->SupportsAzureContentForType(gfx::BackendType::CAIRO)) {
// This is dead code unless you mess with prefs, but keep it around for
// debugging.
targetSurface = new gfxQuartzSurface(aContext, backingSize);
targetSurface->SetAllowUseAsSource(false);
RefPtr<gfx::DrawTarget> dt =
gfxPlatform::GetPlatform()->CreateDrawTargetForSurface(targetSurface,
gfx::IntSize(backingSize.width,
backingSize.height));
dt->AddUserData(&gfxContext::sDontUseAsSourceKey, dt, nullptr);
targetContext = new gfxContext(dt);
} else {
MOZ_ASSERT_UNREACHABLE("COREGRAPHICS is the only supported backed");
}
RefPtr<gfx::DrawTarget> dt =
gfx::Factory::CreateDrawTargetForCairoCGContext(aContext,
gfx::IntSize(backingSize.width,
backingSize.height));
MOZ_ASSERT(dt); // see implementation
dt->AddUserData(&gfxContext::sDontUseAsSourceKey, dt, nullptr);
nsRefPtr<gfxContext> targetContext = new gfxContext(dt);
// Set up the clip region.
nsIntRegionRectIterator iter(region);
@ -4865,6 +4902,38 @@ static int32_t RoundUp(double aDouble)
[self sendWheelStartOrStop:second forEvent:theEvent];
}
static PanGestureInput::PanGestureType
PanGestureTypeForEvent(NSEvent* aEvent)
{
switch (nsCocoaUtils::EventPhase(aEvent)) {
case NSEventPhaseMayBegin:
return PanGestureInput::PANGESTURE_MAYSTART;
case NSEventPhaseCancelled:
return PanGestureInput::PANGESTURE_CANCELLED;
case NSEventPhaseBegan:
return PanGestureInput::PANGESTURE_START;
case NSEventPhaseChanged:
return PanGestureInput::PANGESTURE_PAN;
case NSEventPhaseEnded:
return PanGestureInput::PANGESTURE_END;
case NSEventPhaseNone:
switch (nsCocoaUtils::EventMomentumPhase(aEvent)) {
case NSEventPhaseBegan:
return PanGestureInput::PANGESTURE_MOMENTUMSTART;
case NSEventPhaseChanged:
return PanGestureInput::PANGESTURE_MOMENTUMPAN;
case NSEventPhaseEnded:
return PanGestureInput::PANGESTURE_MOMENTUMEND;
default:
NS_ERROR("unexpected event phase");
return PanGestureInput::PANGESTURE_PAN;
}
default:
NS_ERROR("unexpected event phase");
return PanGestureInput::PANGESTURE_PAN;
}
}
- (void)scrollWheel:(NSEvent*)theEvent
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
@ -4891,59 +4960,89 @@ static int32_t RoundUp(double aDouble)
// Fire NS_WHEEL_START/STOP events when 2 fingers touch/release the touchpad.
if (phase & NSEventPhaseMayBegin) {
[self sendWheelCondition:YES first:NS_WHEEL_STOP second:NS_WHEEL_START forEvent:theEvent];
return;
}
if (phase & (NSEventPhaseEnded | NSEventPhaseCancelled)) {
} else if (phase & (NSEventPhaseEnded | NSEventPhaseCancelled)) {
[self sendWheelCondition:NO first:NS_WHEEL_START second:NS_WHEEL_STOP forEvent:theEvent];
return;
}
WidgetWheelEvent wheelEvent(true, NS_WHEEL_WHEEL, mGeckoChild);
[self convertCocoaMouseWheelEvent:theEvent toGeckoEvent:&wheelEvent];
NSPoint locationInWindow = nsCocoaUtils::EventLocationForWindow(theEvent, [self window]);
wheelEvent.lineOrPageDeltaX = RoundUp(-[theEvent deltaX]);
wheelEvent.lineOrPageDeltaY = RoundUp(-[theEvent deltaY]);
ScreenPoint position = ScreenPoint::FromUntyped(
[self convertWindowCoordinates:locationInWindow]);
// wheelEvent.deltaMode was set by convertCocoaMouseWheelEvent:toGeckoEvent:
// and depends on whether the current scrolling device supports pixel deltas.
if (wheelEvent.deltaMode == nsIDOMWheelEvent::DOM_DELTA_PIXEL) {
double scale = mGeckoChild->BackingScaleFactor();
bool usePreciseDeltas = nsCocoaUtils::HasPreciseScrollingDeltas(theEvent) &&
Preferences::GetBool("mousewheel.enable_pixel_scrolling", true);
bool hasPhaseInformation = nsCocoaUtils::EventHasPhaseInformation(theEvent);
int32_t lineOrPageDeltaX = RoundUp(-[theEvent deltaX]);
int32_t lineOrPageDeltaY = RoundUp(-[theEvent deltaY]);
Modifiers modifiers = nsCocoaUtils::ModifiersForEvent(theEvent);
WidgetWheelEvent widgetWheelEvent(true, NS_WHEEL_WHEEL, mGeckoChild);
NSTimeInterval beforeNow = [[NSProcessInfo processInfo] systemUptime] - [theEvent timestamp];
PRIntervalTime eventIntervalTime = PR_IntervalNow() - PR_MillisecondsToInterval(beforeNow * 1000);
TimeStamp eventTimeStamp = TimeStamp::Now() - TimeDuration::FromSeconds(beforeNow);
ScreenPoint preciseDelta;
if (usePreciseDeltas) {
CGFloat pixelDeltaX = 0, pixelDeltaY = 0;
nsCocoaUtils::GetScrollingDeltas(theEvent, &pixelDeltaX, &pixelDeltaY);
wheelEvent.deltaX = -pixelDeltaX * scale;
wheelEvent.deltaY = -pixelDeltaY * scale;
} else {
wheelEvent.deltaX = -[theEvent deltaX];
wheelEvent.deltaY = -[theEvent deltaY];
double scale = mGeckoChild->BackingScaleFactor();
preciseDelta = ScreenPoint(-pixelDeltaX * scale, -pixelDeltaY * scale);
}
// TODO: We should not set deltaZ for now because we're not sure if we should
// revert the sign.
// wheelEvent.deltaZ = [theEvent deltaZ];
if (!wheelEvent.deltaX && !wheelEvent.deltaY && !wheelEvent.deltaZ) {
// No sense in firing off a Gecko event.
return;
}
if (usePreciseDeltas && hasPhaseInformation) {
PanGestureInput panEvent(PanGestureTypeForEvent(theEvent),
eventIntervalTime, eventTimeStamp,
position, preciseDelta, modifiers);
panEvent.mLineOrPageDeltaX = lineOrPageDeltaX;
panEvent.mLineOrPageDeltaY = lineOrPageDeltaY;
widgetWheelEvent = mGeckoChild->DispatchAPZWheelInputEvent(panEvent);
mGeckoChild->DispatchWindowEvent(wheelEvent);
if (!mGeckoChild) {
return;
}
if (!mGeckoChild) {
return;
}
#ifdef __LP64__
// overflowDeltaX and overflowDeltaY tell us when the user has tried to
// scroll past the edge of a page (in those cases it's non-zero).
if ((wheelEvent.deltaMode == nsIDOMWheelEvent::DOM_DELTA_PIXEL) &&
(wheelEvent.deltaX != 0.0 || wheelEvent.deltaY != 0.0)) {
[self maybeTrackScrollEventAsSwipe:theEvent
scrollOverflowX:wheelEvent.overflowDeltaX
scrollOverflowY:wheelEvent.overflowDeltaY
viewPortIsOverscrolled:wheelEvent.mViewPortIsOverscrolled];
}
if ((widgetWheelEvent.deltaX != 0.0 || widgetWheelEvent.deltaY != 0.0)) {
// overflowDeltaX and overflowDeltaY tell us when the user has tried to
// scroll past the edge of a page (in those cases it's non-zero).
[self maybeTrackScrollEventAsSwipe:theEvent
scrollOverflowX:widgetWheelEvent.overflowDeltaX
scrollOverflowY:widgetWheelEvent.overflowDeltaY
viewPortIsOverscrolled:widgetWheelEvent.mViewPortIsOverscrolled];
}
#endif // #ifdef __LP64__
} else if (usePreciseDeltas) {
// This is on 10.6 or old touchpads that don't have any phase information.
ScrollWheelInput wheelEvent(eventIntervalTime, eventTimeStamp, modifiers,
ScrollWheelInput::SCROLLMODE_INSTANT,
ScrollWheelInput::SCROLLDELTA_PIXEL,
position,
preciseDelta.x,
preciseDelta.y);
wheelEvent.mLineOrPageDeltaX = lineOrPageDeltaX;
wheelEvent.mLineOrPageDeltaY = lineOrPageDeltaY;
wheelEvent.mIsMomentum = nsCocoaUtils::IsMomentumScrollEvent(theEvent);
widgetWheelEvent = mGeckoChild->DispatchAPZWheelInputEvent(wheelEvent);
} else {
ScrollWheelInput::ScrollMode scrollMode = ScrollWheelInput::SCROLLMODE_INSTANT;
if (gfxPrefs::SmoothScrollEnabled() && gfxPrefs::WheelSmoothScrollEnabled()) {
scrollMode = ScrollWheelInput::SCROLLMODE_SMOOTH;
}
ScrollWheelInput wheelEvent(eventIntervalTime, eventTimeStamp, modifiers,
scrollMode,
ScrollWheelInput::SCROLLDELTA_LINE,
position,
lineOrPageDeltaX,
lineOrPageDeltaY);
wheelEvent.mLineOrPageDeltaX = lineOrPageDeltaX;
wheelEvent.mLineOrPageDeltaY = lineOrPageDeltaY;
widgetWheelEvent = mGeckoChild->DispatchAPZWheelInputEvent(wheelEvent);
}
NS_OBJC_END_TRY_ABORT_BLOCK;
}
@ -5168,6 +5267,25 @@ static int32_t RoundUp(double aDouble)
NS_OBJC_END_TRY_ABORT_BLOCK;
}
- (BOOL)shouldZoomOnDoubleClick
{
if ([NSWindow respondsToSelector:@selector(_shouldZoomOnDoubleClick)]) {
return [NSWindow _shouldZoomOnDoubleClick];
}
return nsCocoaFeatures::OnYosemiteOrLater();
}
- (BOOL)shouldMinimizeOnTitlebarDoubleClick
{
NSString *MDAppleMiniaturizeOnDoubleClickKey =
@"AppleMiniaturizeOnDoubleClick";
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
bool shouldMinimize = [[userDefaults
objectForKey:MDAppleMiniaturizeOnDoubleClickKey] boolValue];
return shouldMinimize;
}
#pragma mark -
// NSTextInput implementation
@ -5175,6 +5293,13 @@ static int32_t RoundUp(double aDouble)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
// We're considering not implementing NSTextInput. Start by just
// preffing its methods off.
if (!Preferences::GetBool("intl.ime.nstextinput.enable", false)) {
NSLog(@"Set intl.ime.nstextinput.enable to true in about:config to fix input.");
return;
}
NS_ENSURE_TRUE_VOID(mGeckoChild);
nsAutoRetainCocoaObject kungFuDeathGrip(self);
@ -5194,29 +5319,67 @@ static int32_t RoundUp(double aDouble)
- (void)insertNewline:(id)sender
{
// We're considering not implementing NSTextInput. Start by just
// preffing its methods off.
if (!Preferences::GetBool("intl.ime.nstextinput.enable", false)) {
NSLog(@"Set intl.ime.nstextinput.enable to true in about:config to fix input.");
return;
}
[self insertText:@"\n"];
}
- (void) doCommandBySelector:(SEL)aSelector
- (NSInteger)conversationIdentifier
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
// We're considering not implementing NSTextInput. Start by just
// preffing its methods off.
if (!Preferences::GetBool("intl.ime.nstextinput.enable", false)) {
NSLog(@"Set intl.ime.nstextinput.enable to true in about:config to fix input.");
return 0;
}
if (!mGeckoChild || !mTextInputHandler) {
return;
NS_ENSURE_TRUE(mTextInputHandler, reinterpret_cast<NSInteger>(self));
return mTextInputHandler->ConversationIdentifier();
}
- (NSRect)firstRectForCharacterRange:(NSRange)theRange
{
// We're considering not implementing NSTextInput. Start by just
// preffing its methods off.
if (!Preferences::GetBool("intl.ime.nstextinput.enable", false)) {
NSLog(@"Set intl.ime.nstextinput.enable to true in about:config to fix input.");