Compare commits

...
Author SHA1 Message Date
Moonchild f753d342aa [WebRTC] Apply port restrictions to peerconnections. 2021-03-25 21:34:32 +00:00
Moonchild e2484022ae [WebGL] Only allow texture uploads from pixelbuffer if bound.
Throw an error if it mismatches.
2021-03-25 21:34:18 +00:00
Moonchild 31a94d3003 [docshell] Stop loading of the document if network load is stopped.
After all, stop means stop.
2021-03-25 21:34:07 +00:00
Moonchild 7962989e81 Issue #1749 - Remove restriction of SVG width/height element attributes.
According to the original SVG spec, the SVG element in documents had to follow
special rules as to what was allowed for width/height attributes. This is no
longer the case, so we can decouple it from whatever internal units SVG/XML
language uses and allow all units like every other element.
2021-03-20 08:57:01 +00:00
Moonchild 1fdf9caeb7 [CSS] Enable scrollbar-width keyword by default.
I totally forgot this <.<
2021-03-20 08:56:53 +00:00
Matt A. Tobin 94b353bc9b [NSS hotpatch] Hard disable AVX2 in NSS Build System 2021-03-20 08:56:02 +00:00
Moonchild de4a2cc0f9 Force clobber 2021-03-20 08:55:52 +00:00
Moonchild 0c847a4637 Issue #1693 - Update NSS to 3.52.2-UXP
Update root certificates and port NSS sec patches from previous work.
2021-03-20 08:55:04 +00:00
Moonchild 0f1072adf2 [NSS] Update root certificates. 2021-03-20 08:54:43 +00:00
J.C. Jones ac5b704ce9 [NSS] Prevent slotLock race in NSC_GetTokenInfo
Basically, NSC_GetTokenInfo doesn't lock slot->slotLock before accessing slot
after obtaining it, even though slotLock is defined as its lock.
2021-03-20 08:54:35 +00:00
Sohaib ul Hassan 84c05b5af4 [NSS] Implement constant-time GCD and modular inversion
The implementation is based on the work by Bernstein and Yang
(https://eprint.iacr.org/2019/266)
"Fast constant-time gcd computation and modular inversion".

It fixes the old mp_gcd and s_mp_invmod_odd_m functions. The patch also fixes
mpl_significant_bits s_mp_div_2d and s_mp_mul_2d by having less control flow to
reduce side-channel leaks.

Co-authored by : Billy Bob Brumley
2021-03-20 08:54:24 +00:00
Moonchild 979c996104 Issue #1743 - Update CK_GCM_PARAMS use for PKCS11 v3.0 in WebCryptoTask
Re-apply now we have PKCS11 v3.0 again
2021-03-20 08:54:14 +00:00
Moonchild 5a74837b53 Issue #1693 - Update NSPR to 4.25-RTM 2021-03-20 08:54:04 +00:00
Moonchild 852c6cd024 Issue #1693 - Update NSS to 3.52.1-RTM 2021-03-20 08:53:53 +00:00
Moonchild bb989cf7a0 Revert "Issue #1743 - Update CK_GCM_PARAMS use for PKCS11 v3.0 in WebCryptoTask"
This reverts commit 2b6effbf29.
2021-03-20 08:53:42 +00:00
Moonchild 219c21b8d5 Issue #1746 - Revert "Update NSPR to 4.29"
This reverts commit 149d2ffa77.
2021-03-20 08:53:32 +00:00
Moonchild e47391b526 Issue #1746 - Revert "Update to NSS 3.59.1.1" 2021-03-20 08:53:19 +00:00
Moonchild 0822c5b946 Issue #1746 - Revert "Additional configuration for NSS lib update."
This reverts commit ae775e493b.
2021-03-20 08:53:09 +00:00
Moonchild e79563a0b4 Issue #1746 - Update pkix code with later NSS code. 2021-03-20 08:53:00 +00:00
Moonchild bb138fdc51 Merge branch 'master' into release 2021-02-26 17:42:34 +00:00
Moonchild 78444682d7 Merge pull request '[widget] MailNews Followup: Require user interaction when picking files or folders v2' (#1745) from g4jc/UXP:master into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1745
2021-02-26 17:41:20 +00:00
Gaming4JC 9b0d589d9f [widget] MailNews Followup: Require user interaction when picking files or folders v2
98f6ad61f4 introduced a boolean, this just passes it down and fixes build bustage of mailnews.
2021-02-26 11:57:24 -05:00
Moonchild ceadffab6b Merge branch 'master' into release 2021-02-25 01:03:57 +00:00
Moonchild ad5a13bd50 [OTS] Backport some upstream OTS commits. 2021-02-24 14:24:24 +00:00
Moonchild 5587b6bf1a [MFBT] Update lz4 to 1.9.3 2021-02-24 12:16:57 +00:00
Moonchild 85b0f705d9 Issue #457 - Remove duplicate PKCS11 definitions 2021-02-24 11:09:47 +00:00
Moonchild 29271977c9 [security] Hold mutex when accessing TSI fields. 2021-02-24 11:08:36 +00:00
Moonchild b2c0fda775 [DOM] Don't reveal error details for CORS-cross-origin decoding errors. 2021-02-24 10:13:37 +00:00
Moonchild 525961c261 [html parser] Check for integer overflow when computing new buffer sizes. 2021-02-24 09:57:24 +00:00
Moonchild 77d26e8bcd [dom] Update noscript serialization to the changed spec.
Make <noscript> escaping conditional on whether scripting is enabled.
2021-02-24 09:05:30 +00:00
Moonchild 5f1bc29870 Issue #1722 - Update about:license
Mostly making parts conditional and removing blocks that are no longer
applicable, and a few minor edits otherwise to update links and text.

Resolves #1722
2021-02-21 19:20:31 +00:00
Moonchild 98f6ad61f4 [widget] Require user interaction when picking files or folders v2
Now with extra sauce to make it work cross-platform and cross-versions and
for HTML input elements only.
2021-02-21 10:32:47 +00:00
Moonchild 2b6effbf29 Issue #1743 - Update CK_GCM_PARAMS use for PKCS11 v3.0 in WebCryptoTask 2021-02-17 22:30:39 +00:00
Moonchild 2103a2283b Issue #1688 - Add flood guard to state change logic. 2021-02-16 12:13:16 +00:00
Moonchild 8f663e3bcd [widget] Require user interaction when picking files or folders. 2021-02-15 21:09:05 +00:00
Moonchild 9fa7943937 Issue #1741 - Follow-up: Remove superfluous prefobserver
This one is no longer necessary (and incorrect) after the changes made in #1684
2021-02-15 06:26:33 +00:00
Moonchild 9832adb6f7 Issue #1741 - Add missing prefobserver for general.useragent.* prefs
Resolves #1741
2021-02-14 16:04:06 +00:00
Moonchild 4f06d20f8a [js] Add XMMRegName for invalid_xmm 2021-02-14 08:34:36 +00:00
Moonchild fc65e1f2fa Issue #1739 - Implement numeric separators.
Resolves #1739
2021-02-13 09:41:29 +00:00
Moonchild 458939c9d9 Issue #1738 - Follow-up: Update comment (no code changes) 2021-02-12 21:24:32 +00:00
Moonchild 9ca880e200 Issue #1738 - Part 2: Implement well-formed JSON stringify
This implements the ES2019 spec for JSON stringification, including
lower-casing, properly escaping lone surrogates, etc.
2021-02-11 13:55:24 +00:00
Moonchild 2c72b8859a Issue #1738 - Part 1: Improve performance of JSON stringify
- Use some pointer voodoo and instead of stringbuffer append()
- Use a lookup table instead of char comparisons for chr < 256
- Stop using a Hashtable/MovableCellHasher for JSON CycleDetector
2021-02-11 13:20:54 +00:00
Moonchild 006d2ca827 Update tzdata to 2021a
Because people are apparently never satisfied with the time zones on the planet!
2021-02-10 03:08:34 +00:00
Moonchild 5c1d1d37fb Merge pull request 'Support for latest stable FreeBSD (12.2)' (#1736) from OlCe1/UXP:FreeBSD-support-update into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1736
2021-02-08 20:36:20 +00:00
Moonchild 14fb2f966e Issue #1737 - Disable AV1 by default.
Our current implementation has consistent playback issues; this needs to be
addressed before the codec can be enabled by default.
2021-02-07 20:22:04 +00:00
Moonchild aa99e58876 Issue #1737 - Disable AV1 by default.
Our current implementation has consistent playback issues; this needs to be
addressed before the codec can be enabled by default.
2021-02-07 20:20:36 +00:00
Moonchild 08903c0c9c [angle] Cherry-pick compressed tex depth stride fix. 2021-02-05 18:43:01 +00:00
Moonchild cca738e986 Issue #1515 - Add null check to nsCSSFrameConstructor::IsValidSibling
With the changes to layout for WebComponents, it is now apparently possible to
pass in null for frame tree items to this function, which would cause a null
deref crash if not checked.
2021-02-05 18:42:30 +00:00
Moonchild aab1c211a6 [angle] Cherry-pick compressed tex depth stride fix. 2021-02-05 18:40:41 +00:00
Olivier Certner 9f2085b5e9 Issue #1699 - Follow-up: mozjemalloc: Fix build by excluding some irrelevant init_lock code
This had been initially dealt with in issue #1699's commits, but one of them
was in the end reverted, which caused this problem (this change should have
been done there).
2021-02-05 18:22:59 +01:00
Olivier Certner 1305a9187e Issue #1730 - Part 2: harfbuzz: Remove some useless define causing a build error
Defining _POSIX_C_SOURCE to 199309L on FreeBSD causes compile errors, because of
an obscure interaction between system wrappers and libc++ headers. The source
doesn't seem to need it at all, which tests confirm.

I bet that this is not needed either on other modern systems (even those based
on glibc), and that the define could probably be entirely removed. Not trying
it because I can't test it myself.
2021-02-05 18:22:53 +01:00
Olivier Certner 5f29c78f7c Issue #1730 - Part 1: Interpose malloc even on RTLD_DEEPBIND presence
New FreeBSD versions have introduced RTLD_DEEPBIND (see dlopen(3)), which
triggers a provoked build error to be on the "safe" side.

Indeed, improper use of RTLD_DEEPBIND could cause malloc interposing not to
work on specific libraries. This would happen for libraries that provide their
own malloc/free and exchange pointers with other libraries or the main program,
one allocating an area and another one deallocating it.

It seems it happened for glibc, which is not a concern on FreeBSD, and for the
Flash Player (not a concern either, there is no native Flash Player). Moreover,
there is only a single reference to RTLD_DEEPBIND in the whole platform
currently, namely in the WebRTC code, but the corresponding code chunk is
compiled-in only on Linux (and this library doesn't seem to redefine malloc
functions anyway). So I don't see how a problem could happen. Additionally,
Pale Moon, which is my focus, doesn't use WebRTC.

Corresponding Mozilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=493541
2021-02-05 18:22:46 +01:00
Olivier Certner f3405dbede Issue #1729 - Support building/linking against libc++ 9+
Including <cstdlib> must never trigger inclusion of "mozalloc.h", because the
first thing this one does is precisely to include <cstdlib>.

It is now the case that, in libc++ 9 and beyond, <cstdlib> includes <math.h>
which then tries to include <type_traits>, which the STL wrapper intercepts,
trying to load "mozalloc.h". Same problem happens with <limits>.

Fix pulled from: https://bugzilla.mozilla.org/show_bug.cgi?id=1594027.
2021-02-05 18:20:47 +01:00
Moonchild 66d028942c Issue #1732 - Implement JSON superset proposal.
This change makes unicode line and paragraph separators allowed in JS strings,
removing the only quirk of the JS string definition that made JSON not a valid
subset of JS.

Resolves #1732
2021-02-05 12:44:26 +00:00
Moonchild bd9fdeccc7 Issue #1726 - Add verification test for string.replaceAll() 2021-02-04 21:29:55 +00:00
Moonchild 9b401e7748 Merge pull request 'Implement String.replaceAll()' (#1728) from meatloaf/UXP:string_replaceAll into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1728
2021-02-04 21:27:26 +00:00
Moonchild 914368530b Issue #439 - Remove web-platform tests from the tree.
This removes a total of 23,936 files we would never use nor have the capacity
to properly maintain or keep up-to-date.
2021-02-04 19:41:06 +00:00
meatloaf 24c40b5836 Issue #1726 - Implement String.replaceAll()
This also implements IsRegExp, as this demands it.
Ported from https://bugzilla.mozilla.org/show_bug.cgi?id=1540021
2021-02-04 12:59:54 -06:00
Moonchild c5ad76a287 Issue #1515 - Add null check to nsCSSFrameConstructor::IsValidSibling
With the changes to layout for WebComponents, it is now apparently possible to
pass in null for frame tree items to this function, which would cause a null
deref crash if not checked.
2021-02-03 11:10:44 +00:00
Moonchild ce297b972b Fix CRLF line endings in npapi.h 2021-01-30 13:17:11 +00:00
Moonchild 4d6e9aec05 Issue #1720 - Remove explicit header inclusion from npapi.h
This should allow the header to be used outside of the UXP tree for compiling
plugins etc.
Resolves #1720
2021-01-30 13:16:33 +00:00
trav90 304496d4ab Issue #1723 - Fix Linux build bustage in HTMLMenuItemElement.cpp 2021-01-30 01:07:11 +00:00
Moonchild f394d6502c [js] Remove unused promise selfhosting functions.
These are leftovers from when promises were fully self-hosted and could cause
confusion if left in place.
2021-01-30 01:06:36 +00:00
Moonchild a4503737e1 Merge pull request 'Issue #1723 - Fix Linux build bustage in HTMLMenuItemElement.cpp' (#1724) from trav90/UXP:1723-fix into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1724
2021-01-30 01:02:59 +00:00
trav90 402881b4c2 Issue #1723 - Fix Linux build bustage in HTMLMenuItemElement.cpp 2021-01-29 16:28:26 -06:00
Moonchild 745254183c Merge branch 'master' into release 2021-01-29 14:55:20 +00:00
Moonchild e1daeef183 [network] Hold mutex when accessing mSecurityInfo. 2021-01-27 10:52:32 +00:00
Moonchild f77c7a36b7 [DOM] Store weak pointer to next parents. 2021-01-26 23:16:22 +00:00
Moonchild 8fd57ace20 [DOM] Try to avoid slow shrinking GC during sync calls 2021-01-26 22:42:46 +00:00
Moonchild 2836e51466 [webaudio] Fix up ReverbInputBuffer's writeIndex. 2021-01-26 14:55:48 +00:00
Moonchild 3661ecee11 [WebRTC] Improve SDP parser error handling. 2021-01-26 13:59:19 +00:00
Moonchild 2f9e27a306 [js] Add AutoEnterOOMUnsafeRegion to JS_TransplantObject.
Transplanting objects is inherently oom-unsafe, so add
`AutoEnterOOMUnsafeRegion` to `JS_TransplantObject()` and annotate crashes
accordingly if they do happen.
2021-01-26 12:28:25 +00:00
Moonchild 3a8b4ad00a Fix rooting hazard in ImageBitmap::CreateInternal by avoiding movable data. 2021-01-26 11:49:35 +00:00
Moonchild c1dd23bd83 [layout, XUL] Avoid accessing invalidated frame. 2021-01-26 09:56:37 +00:00
Matt A. Tobin dd932e0011 Merge branch 'presentation-cleanup' 2021-01-25 18:26:58 -05:00
Moonchild 874330d453 Issue #1719 - Make <menuitem> pref-controlled and disable by default.
Resolves #1719
2021-01-25 23:18:58 +00:00
Matt A. Tobin 7702d1f3fa Issue #1390 - Clean up presentation api leftovers 2021-01-25 17:38:49 -05:00
Moonchild 1126548dee Issue #1319 - Resolve RELEASE_OR_BETA questions in all.js
- Enabled SVG transform-box property. I've tested this extensively including the
bug that prevented Mozilla from shipping until 55 which does not seem to apply
to us (most likely a stylo issue). Should be good to go.
- Moved the getRootNode pref to a better place (no change)
- Enabled inputmode property for forms. This is n/a for physical keyboards but
should improve the experience for soft keyboards that can pop up various forms
of input (e.g. numeric) depending on the mode indicated. According to BZ this is
feature complete at our level but was problematic for Android which we don't
have support for anyway.
- Restricted crashing on insecure input of text to debug only.
- Enabled shutting down the async OSFile worker if not used for 30 seconds to
be more conscientious about resource use.
- Enabled blocking of autoplay of media in the background by default, since it
is a saner default to have for the OOBE and is commonly a desired setting by
users (see forum).
- Disabled the storage manager API by default. This fine-grained control over
stored website data is already handled by various extensions and we don't have
the front-end support for it. Assuming this was necessary for Mozilla due to
limited access of WebExtensions to this kind of data.
2021-01-23 12:42:53 +00:00
Moonchild 411ccb0e49 Issue #1630 - Enable W3C pointer events by default.
Resolves #1630
2021-01-19 10:04:24 +00:00
Moonchild c76214f0b5 Master merge
This merges master into release to replace Redwood.

# Conflicts:
#	CLOBBER
#	build/moz.configure/old.configure
#	config/milestone.txt
#	config/moz.build
#	config/system-headers
#	dom/abort/AbortController.cpp
#	dom/abort/AbortController.h
#	dom/abort/AbortSignal.cpp
#	dom/abort/AbortSignal.h
#	dom/abort/moz.build
#	dom/abort/tests/moz.build
#	dom/animation/KeyframeEffect.cpp
#	dom/base/CustomElementRegistry.cpp
#	dom/base/DocGroup.cpp
#	dom/base/ResizeObserverController.cpp
#	dom/base/ResizeObserverController.h
#	dom/base/nsContentUtils.cpp
#	dom/base/nsContentUtils.h
#	dom/base/nsDocument.cpp
#	dom/base/nsIDocument.h
#	dom/fetch/FetchObserver.cpp
#	dom/fetch/FetchObserver.h
#	dom/heapsnapshot/AutoMemMap.cpp
#	dom/heapsnapshot/AutoMemMap.h
#	dom/heapsnapshot/CoreDump.proto
#	dom/heapsnapshot/HeapSnapshot.cpp
#	dom/heapsnapshot/HeapSnapshotTempFileHelperChild.h
#	dom/heapsnapshot/HeapSnapshotTempFileHelperParent.cpp
#	dom/heapsnapshot/HeapSnapshotTempFileHelperParent.h
#	dom/heapsnapshot/PHeapSnapshotTempFileHelper.ipdl
#	dom/heapsnapshot/moz.build
#	dom/heapsnapshot/tests/gtest/moz.build
#	dom/html/nsGenericHTMLElement.h
#	dom/media/platforms/PlatformDecoderModule.h
#	dom/media/platforms/moz.build
#	dom/script/ModuleLoadRequest.cpp
#	dom/script/ModuleLoadRequest.h
#	dom/script/ModuleScript.cpp
#	dom/script/ModuleScript.h
#	dom/script/ScriptElement.cpp
#	dom/script/ScriptElement.h
#	dom/script/ScriptLoadHandler.cpp
#	dom/script/ScriptLoadHandler.h
#	dom/script/ScriptLoader.cpp
#	dom/script/ScriptLoader.h
#	dom/script/ScriptSettings.cpp
#	dom/script/ScriptSettings.h
#	dom/script/nsIScriptElement.h
#	dom/script/nsIScriptLoaderObserver.idl
#	dom/webidl/HTMLLinkElement.webidl
#	gfx/gl/moz.build
#	gfx/graphite2/src/moz.build
#	gfx/layers/moz.build
#	js/ductwork/inspector/moz.build
#	js/ductwork/moz.build
#	js/src/gc/Heap.h
#	js/src/moz.build
#	js/src/vm/UnboxedObject-inl.h
#	js/src/vm/UnboxedObject.cpp
#	js/src/vm/UnboxedObject.h
#	layout/base/crashtests/crashtests.list
#	layout/build/moz.build
#	layout/generic/AspectRatio.h
#	layout/generic/crashtests/crashtests.list
#	layout/reftests/bidi/reftest-stylo.list
#	layout/reftests/reftest-stylo.list
#	layout/reftests/table-bordercollapse/reftest.list
#	layout/reftests/writing-mode/reftest-stylo.list
#	layout/style/StyleSheet.cpp
#	layout/style/nsRuleNode.cpp
#	layout/style/nsStyleStruct.cpp
#	layout/style/nsStyleStruct.h
#	modules/libpref/init/all.js
#	nsprpub/pr/src/linking/prlink.c
#	parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/AttributeName.java
#	parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/ElementName.java
#	parser/html/nsHtml5AtomList.h
#	parser/html/nsHtml5AttributeName.cpp
#	parser/html/nsHtml5AttributeName.h
#	parser/html/nsHtml5ElementName.cpp
#	parser/html/nsHtml5ElementName.h
#	parser/html/nsHtml5TreeBuilderCppSupplement.h
#	parser/htmlparser/nsElementTable.cpp
#	parser/htmlparser/nsHTMLTagList.h
#	security/nss/lib/nss/nss.h
#	security/nss/lib/softoken/pkcs11.c
#	security/nss/lib/softoken/softkver.h
#	security/nss/lib/util/nssutil.h
#	testing/web-platform/tests/tools/html5lib/html5lib/html5parser.py
#	testing/web-platform/tests/tools/html5lib/html5lib/treebuilders/_base.py
#	toolkit/modules/AppConstants.jsm
2021-01-19 08:08:18 +00:00
Matt A. Tobin 75286e68d7 [Media] Enable AV1 by default if built 2021-01-18 14:56:32 -05:00
Moonchild 22e78108bd Issue #1715 - Handle errors when initializing print settings from the printer
fails due to a bad printer name or O.S. error.

Resolves #1715
2021-01-18 18:07:28 +00:00
Moonchild c77d06c0c4 Merge pull request 'Selectively enable and pref the DOM Web Animations API' (#1714) from 1689 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1714
2021-01-18 09:41:05 +00:00
Moonchild 82fb08c650 Bump platform version for added features. 2021-01-16 14:29:01 +00:00
Moonchild b3d380b4ea Issue #1689 - Part 5: Enable DOM Animations API except the preffed-off parts.
This enables the DOM Animations API core functions with the exception of those
parts that are either unimplemented or not ready for use, which have been
preffed off in this issue's previous parts.

Also tag #1319 for enabling a previous RELEASE_OR_BETA shielded API.
2021-01-14 19:04:25 +00:00
Moonchild abc58d2ed0 Issue #1689 - Part 4: Add a preference for {Document,Element}.getAnimations()
This is probably the last thing we will ship (if ever) since it needs the most
spec and implementation work for arbitrary use that is pretty far into a corner.
2021-01-14 17:43:44 +00:00
Moonchild 931314ef61 Issue #1689 - Part 3: Add a preference for animation composite modes.
This feature should not be shipped until the various definitions of addition for
each additive property are properly specified and then implemented accordingly.

Unlike other patches in this series, compositing is not frequently used
internally so there is no need to enable this by default for chrome callers.
2021-01-14 17:41:30 +00:00
Moonchild 407c86641a Issue #1689 - Part 2: Add a preference for implicit keyframes
This preference controls whether authors are allowed to specify animations
without a 0% or 100% keyframe.

We intend to ship this but it isn't implemented yet (needs a follow-up) but this
preference acts as a safeguard in case we discover we need to disable it once
it's implemented.
2021-01-14 16:05:53 +00:00
Moonchild b0fe759f03 Issue #1689 - Part 1: Add pref for DOM Animation timelines API
Default false, no intent to ship for web content. Always enabled for Chrome.
2021-01-14 14:46:52 +00:00
Moonchild 5158142779 Merge pull request 'Add scrollbar-width CSS spec' (#1707) from 1705 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1707
2021-01-13 00:25:23 +00:00
Moonchild 0939fde1a4 Issue #1705 - Part 9b: Revert overzealous changes on Mac (cocoa). 2021-01-12 13:07:40 +00:00
Matt A. Tobin 7023db88ca Issue #1624 - Fix slot access intrinsics for objects with > 16 reserved slots
Also flips ion inlining pref back on
2021-01-11 09:31:44 -05:00
Moonchild 59ef3f4eda Issue #1705 - Part 9: Implement scrollbar-width:thin on Mac (cocoa). 2021-01-09 23:21:36 +00:00
Moonchild ecc771848f Issue #1705 - Part 8: Implement scrollbar-width:thin on GTK. 2021-01-09 23:20:31 +00:00
Moonchild 382fe423e5 Issue #1705 - Part 7: Implement scrollbar-width:thin on Windows. 2021-01-09 23:19:35 +00:00
Moonchild c0db767c25 Issue #1710 - Check for triggering principal URI in FTP subresource check.
Resolves #1710
2021-01-09 19:19:39 +00:00
Moonchild 764e13c912 Issue #1705 - Part 6: Remove scrollbarbutton min-{width|height} rule from theme.
This would interfere with implementing thin scrollbars.

Almost all widgets provide a non-overridable size for scrollbar buttons, so it
makes no sense to specify min size for them. It is probably(?) a layout bug that
min size properties can override the value returned by GetMinimumWidgetSize
even if aIsOverridable is set to false, but removing this rule is simpler than
locating and fixing the issue in layout code ;)
2021-01-08 14:40:49 +00:00
Moonchild c05bca3168 Issue #1705 - Part 5: Implement scrollbar-width:none for all target platforms. 2021-01-08 14:15:50 +00:00
Moonchild c1825acab0 Merge pull request 'Add modern FreeBSD support' (#1706) from OlCe1/UXP:FreeBSD-support-reformatted into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1706
2021-01-07 21:26:47 +00:00
Olivier Certner 5d95844f49 Revert "Issue #1699 - Part 3a: mozjemalloc: Memory barriers on 'malloc_initialized'"
This reverts commit f76695c1ce.

SUSv4 specifies that 'pthread_create' acts as a (full) memory barrier, so
barriers here are not necessary.
2021-01-07 20:28:40 +01:00
Olivier Certner 3e2dcaf7f2 Issue #1699 - Part 3c: mozjemalloc: FreeBSD: Ensure early initialization
This guarantees that initialization is done in a single-thread context.
2021-01-07 17:49:14 +01:00
Olivier Certner 91f7c9d30e Issue #1699 - Part 3b: mozjemalloc: Bootstrap allocator, early diversion for FreeBSD
Coded a simple memory allocator meant to be used during jemalloc bootstrap
(malloc_init_hard()). Although protected by "#ifdef __FreeBSD__", it is not
FreeBSD-specific: Any POSIX platform could use it.

Hook it so that it is used in place of jemalloc's own routines while
malloc_init_hard() is executing or memory for mutexes is being
allocated. Currently, 'malloc', 'calloc', '*memalign' and 'free' are diverted
during init or lock initializations.

Details are quite complex, see the big comment block starting with "There are
several problematic interactions between FreeBSD's libthr and this jemalloc."
for more explanations.

Also replaced ad-hoc BSD code to determine the number of CPUs with 'sysconf',
which is POSIX-compliant (and supported on modern BSDs).
2021-01-07 17:49:14 +01:00
Olivier Certner f76695c1ce Issue #1699 - Part 3a: mozjemalloc: Memory barriers on 'malloc_initialized'
The barriers are here to make sure that setting 'malloc_initialized' at end of
init must be noticed later by any thread running on a different core. They are
in theory necessary in the absence of an explicit pthread lock.

What could happen is that the thread doing the initialization later spawns
other threads that could not have the updated 'malloc_initialized' value,
leading to a second initialization. This is dependent on whether OSes force a
full memory barrier before the new thread is run, which I don't know, and don't
want to bother.

This was done for FreeBSD only, for the sake of robustness. In theory, this
would be needed on Windows too.
2021-01-07 17:34:03 +01:00
Olivier Certner da217348d9 Issue #1699 - Part 2: libevent: Remove 'evutil_secure_rng_add_bytes'
In fact, this is a security threat.

This function calls 'arc4random_addrandom', which was removed from the
reference implementation 7 years go [1], on the ground that this was in fact an
internal interface which is almost impossible to use correctly. This update has
since then been propagated to other implementations (e.g., FreeBSD, IllumOS,
Android).

Do this for all platforms, since 'evutil_secure_rng_add_bytes' is not even used
in the current tree, and for the reason stated above, should never be.

Related bugs at Mozilla and libevent: Links [2] and [3] below.

[1] http://marc.info/?l=openbsd-cvs&m=138238762705209&w=2
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=931354
[3] https://sourceforge.net/p/levent/bugs/320/
2021-01-07 17:02:06 +01:00
Olivier Certner 87aa6b2300 Issue #1699 - Part 1: python/psutil: Support recent FreeBSD versions
'sysctl' interface to currently opened connections changed in FreeBSD 12.

Drop support for FreeBSD < 9, these are very old and unsupported versions.
2021-01-07 17:02:05 +01:00
Moonchild 65da2431f9 Issue #1705 - Part 4: Add scrollbar-width CSS keyword to CSS parser.
This should be all parts needed to add a brand new enum keyword including
getting the computed style from it...
2021-01-06 23:57:26 +00:00
Moonchild 0e6a9cc60a Issue #1705 - Part 3: Rename ScrollbarStyles to ScrollStyles.
ScrollbarStyles contains values of overflow, (over)scroll-behavior, etc.
The only one which is marginally related to scroll _bars_ is overflow, which can
be used to hide scrollbar (by making an element not scrollable) or enforce the
scrollbar to display.

It makes more sense to be called ScrollStyles as it's mainly concerning behavior
of scrolling, not scrollbars. Also, with the addition of scrollbar width
properties, the current name can be confusing.
2021-01-06 16:31:36 +00:00
Moonchild 4681e04dc5 Issue #1705 - Part 2: Add a ShowScrollbar enum to be used in ScrollReflowInput.
Overflow properties have two purposes:
1. controlling whether the scrollbar should be shown;
2. controlling whether the content is scrollable.

However, with the scrollbar-width property being added, scrollability and
presence of a scrollbar are no longer tied together.
This patch makes a separation between the value of overflow and the presence of
a scrollbar by making it clear that for ScrollReflowInput, we only care about
whether scrollbar should be shown.
This should make it easier to write the logic involving presence of the
scrollbar based on webdev choice.
2021-01-06 12:48:38 +00:00
Moonchild e16ed489a4 Issue #1705 - Part 1: Rename nsChangeHint_CSSOverflowChange to *ScrollbarChange.
Prepare for scrollbar-width which should trigger the same kind of change.
2021-01-06 10:35:21 +00:00
Moonchild 5af0c434b9 Merge branch '61' 2021-01-04 11:29:47 +00:00
Matt A. Tobin 1a4abb5d97 Issue #61 - Add missing external symbols for gkmedias when WebRTC is built 2021-01-04 03:43:58 -05:00
Matt A. Tobin 3f1ed03579 Issue #61 - Add missing external symbol cubeb_set_log_callback to gkmedias symbols.def 2021-01-03 23:41:17 -05:00
Matt A. Tobin 46ca396f8c Issue #61 - Add configure option for non-windows platforms
Windows will ALWAYS have this enabled but we eventually want all target operating systems to use this as well but that will require more work
2021-01-03 23:40:35 -05:00
Moonchild 39cebe99e2 Issue #61 - Place Skia in libxul
Skia does some nasty things that break with DLL calls like having virtual dtors
without a body definition (and it's honestly surprising that it even builds to
begin with the way it's done, but apparently they use some linking symbol voodoo
to work around that in dependent classes).
Not wanting to have to pull Google code apart to try and fix that for something
we're only using for canvas anyway, it's better to just let Skia reside in
libxul instead.
2021-01-03 21:45:04 +00:00
Moonchild b713575ca4 Issue #61 - Add missing #endif in symbols file 2021-01-03 21:41:19 +00:00
Matt A. Tobin a625decfc9 [NSS hotpatch] Hard disable AVX2 in NSS Build System
This should be ported to the NSS repo
2021-01-03 03:11:22 -05:00
Moonchild 84fa3f9f72 Redundant code path cleanup (#1702)
Remove various obsolete configure options.
Remove Adjust SDK install tracking filth.
Remove redundant code paths in old-configure
This also optimizes linker use
Remove redundant conditional blocks.
Rewrite span.h without constexpr use.
2021-01-02 19:27:13 +00:00
Moonchild babeb5c556 Issue #61 - Reinstate buildability with shared gkmedias dll
This fully works for splitting gkmedias.dll back out from xul with one exception
which is Skia throwing undefined externals when linking gkmedias.
2021-01-02 13:35:39 +00:00
Moonchild 0bb464bfc1 Issue #1053 - Part 2b: Remove android from /layout reftests
Also cleans up some other obsolete checks and stylo reftest lists.
2020-12-31 22:46:09 +00:00
Moonchild e011a048e4 Issue #1053 - Part 3b: Remove AndroidSurfaceTexture and Android media decoder
interface.
2020-12-27 13:11:19 +00:00
Moonchild 8d4456c797 Issue #1053 - Part 3a: Remove Android conditionals from /gfx 2020-12-27 06:58:56 +00:00
Moonchild ae2a160348 Issue #1053 - Part 2a: Remove android from /layout (partial)
This removes android code from base, build, forms, generic, inspector, style,
printing, tools and xul.
2020-12-26 10:16:55 +00:00
Moonchild 9f004841a2 Issue #1053 - Part 1c: Remove references to mobile/android targets and paths 2020-12-25 23:29:47 +00:00
Moonchild 62568d94d5 Issue #1681 - Hard-code FLAC media type association for .flac
We don't support AAC outside of OMX at the moment, so oops.
2020-12-24 13:35:26 +00:00
Moonchild 837432de64 Revert "Issue #1681 - Hard-code FLAC and AAC media type associations for .flac and .aac"
This reverts commit a8e90975d0.
2020-12-24 13:34:22 +00:00
Moonchild a8e90975d0 Issue #1681 - Hard-code FLAC and AAC media type associations for .flac and .aac 2020-12-24 13:30:53 +00:00
Moonchild 6ae313b51c Clobber for NSS update. 2020-12-23 22:24:08 +00:00
Moonchild ae775e493b Issue #1693 - Additional configuration for NSS lib update.
The Seed and RC2 components are completely obsolete, so we shouldn't build them.
AVX2 for Chacha20-Poly1305 would fall outside of our platform sysreqs, and has a
build system issue with non-MSVC flags being passed (needs more research, also a
recent change around NSS 3.53 when the makefile destruction happened)
2020-12-23 19:45:11 +00:00
Moonchild 029bcfe189 Issue #1693 - Update NSS to 3.59.1.1
This updates to MoonchildProductions/NSS@bd49b2b88 in the repo created for our
consumption of the library.
2020-12-23 19:02:52 +00:00
Moonchild 149d2ffa77 Issue #1693 - Update NSPR to 4.29 2020-12-23 19:01:09 +00:00
Moonchild 25b6703e95 Issue #1701 - Implement Intl.PluralRules API 2020-12-22 20:32:56 +00:00
Moonchild 911cbcd1af Issue #1700 - Apply background color instead of inset shadow for findbar input.
This changes the toolkit theme for Linux and Windows (Mac already did this) to
style the input textbox on the findbar with -moz-appearance:none so as to give
us styling control (as opposed to using a native widget style) and apply a
neutral style to it.
Also ensures Mac remains readable in case of poorly contrasting text.
2020-12-21 16:24:37 +00:00
Moonchild 05569cb6d1 Revert "Issue #1686 - Align a keybinding definition with the others"
This reverts commit 85dc118aac.
2020-12-20 19:48:50 +00:00
Moonchild 8500ebf532 Merge pull request 'Reinstate the performance timing code removed in error' (#1698) from adesh/UXP:fix-performace-api into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1698
2020-12-16 15:36:19 +00:00
adesh 0187d3e4e7 Issue #1697 - Reinstate the performance timing code removed in error.
This was a fallout from pull request #929.
2020-12-16 06:31:31 -05:00
Moonchild 810c2bf808 Merge branch 'redwood' into release 2020-12-16 07:42:37 +00:00
Moonchild 203be74ffe Revert "Issue #1695 - Add clamping to websocket polling timeouts."
As of [da0c073a7] we no longer need this workaround because the issue is avoided
with proper sleep/wake logic restored.

This reverts commit 2fa993b563.
2020-12-16 07:42:02 +00:00
Moonchild 0ea6dd009f Issue #1695 - Restore Sleep/Wake timer that was erroneously removed.
This was fallout from PR #929 for Issue #21
2020-12-16 07:41:43 +00:00
Moonchild 408477a87a Revert "Issue #1695 - Add clamping to websocket polling timeouts."
As of [da0c073a7] we no longer need this workaround because the issue is avoided
with proper sleep/wake logic restored.

This reverts commit 2fa993b563.
2020-12-16 06:42:42 +00:00
Moonchild da0c073a74 Issue #1695 - Restore Sleep/Wake timer that was erroneously removed.
This was fallout from PR #929 for Issue #21
2020-12-16 06:39:51 +00:00
Moonchild dabdec3b3a Merge branch 'redwood' into release 2020-12-15 15:09:30 +00:00
Moonchild cd17592001 [toolkit] Handle corner case confusion of downloaded files without extension.
See code comment for details.
2020-12-15 13:39:34 +00:00
Moonchild 62d550e22d Issue #1696 - Propagate flex sizes to the table wrapper
This avoids overlapping of table styled elements inside flexboxes as used on
some websites.

Resolves #1696
2020-12-15 13:39:19 +00:00
Moonchild 2f60cae35e [network] Update port blacklist.
See BZ bugs 1674735, 1677047, 1677940 and 1676868 for details.
2020-12-15 13:39:01 +00:00
Moonchild 78f114fc42 [toolkit] Handle corner case confusion of downloaded files without extension.
See code comment for details.
2020-12-15 11:33:29 +00:00
Moonchild ac4c22f096 Issue #1696 - Propagate flex sizes to the table wrapper
This avoids overlapping of table styled elements inside flexboxes as used on
some websites.

Resolves #1696
2020-12-15 10:30:06 +00:00
Moonchild 3c0236666e [network] Update port blacklist.
See BZ bugs 1674735, 1677047, 1677940 and 1676868 for details.
2020-12-15 09:04:21 +00:00
Moonchild 65bbd1acb6 Issue #1695 - Add clamping to websocket polling timeouts. 2020-12-13 18:14:40 +00:00
Moonchild 3edea8e9e0 Revert "Issue #1391 - Disable DOM Filesystem/dirpicker APIs by default."
This reverts commit 45a976a5f1.
2020-12-13 18:14:22 +00:00
Moonchild fc539ba189 Issue #1695 - Fix socket timeout logic. 2020-12-13 18:14:12 +00:00
Moonchild 68299c8613 Issue #1694 - Part 2: Use scriptabledateformat for Update History display. 2020-12-13 18:14:00 +00:00
Moonchild d0b7069d1c Issue #1694 - Part 1: Use scriptabledateformat for the Cookie Accept dialog. 2020-12-13 18:13:49 +00:00
Moonchild 55dbbe4d16 Issue #1624 - flip the inlining pref.
The default is now set to the more stable but slower global setting.
2020-12-13 18:13:39 +00:00
Moonchild a52529970f Nuke erroneously added vim line. 2020-12-13 18:13:28 +00:00
Moonchild bcb46bf65e Issue #1624 - Make ion inlining optimizations a pref.
This also adds it to JS_SetGlobalJitCompilerOption()
2020-12-13 18:13:03 +00:00
Moonchild 2fa993b563 Issue #1695 - Add clamping to websocket polling timeouts. 2020-12-12 12:41:26 +00:00
Moonchild 4281fcc163 Revert "Issue #1391 - Disable DOM Filesystem/dirpicker APIs by default."
This reverts commit 45a976a5f1.
2020-12-08 17:26:30 +00:00
Moonchild 6b45065f14 Issue #1695 - Fix socket timeout logic. 2020-12-08 17:19:01 +00:00
Moonchild 6cb00e2cfd Issue #1694 - Part 2: Use scriptabledateformat for Update History display. 2020-12-04 16:41:24 +00:00
Moonchild 16a1ff22a3 Issue #1694 - Part 1: Use scriptabledateformat for the Cookie Accept dialog. 2020-12-04 16:37:02 +00:00
Moonchild fd576c4270 Issue #1624 - flip the inlining pref.
The default is now set to the more stable but slower global setting.
2020-12-03 18:33:35 +00:00
Moonchild 7fda700f92 Nuke erroneously added vim line. 2020-12-03 17:52:32 +00:00
Moonchild 1a21b52692 Issue #1624 - Make ion inlining optimizations a pref.
This also adds it to JS_SetGlobalJitCompilerOption()
2020-12-03 13:56:36 +00:00
Moonchild 176f4fe206 Issue #1624 - Globally disable inlining optimizations in the JS JIT compiler. 2020-12-02 07:21:27 +00:00
Brian Smith aed41dc542 Issue #1690 - Part 2: Update MacOS Blocklist support from 10.13 to 11.0.
Changes based on Mozilla bug 1678061.
2020-12-02 07:21:03 +00:00
Brian Smith a7a521e378 Issue #1690 - Part 1: Fix MacOS version detection above 10.15.
Changes based on Mozilla bug 1616404 but supporting back to 10.7.
2020-12-02 07:20:45 +00:00
Moonchild e9b56e301c Clobber for NSS update. 2020-12-02 07:20:26 +00:00
Moonchild 57debb342a [NSS] Version and build bump 2020-12-02 07:20:16 +00:00
Moonchild 78219cdbf1 [NSS] Update root certificates. 2020-12-02 07:20:04 +00:00
Moonchild c68e97f01c Issue #1684 - Move global user-agent override to networking component.
Since this is a http protocol networking feature, it belongs in the networking
branch of our preferences.
2020-12-02 07:19:17 +00:00
Moonchild 7f619fa9bf Merge branch 'nss-patch-work' 2020-12-01 22:47:40 +00:00
Moonchild b668164260 Issue #1624 - Globally disable inlining optimizations in the JS JIT compiler. 2020-12-01 22:46:55 +00:00
Moonchild 433ed209ba Revert "Issue #1624 - Exclude function scopes from Ion compilation."
This reverts commit bb31c1c65e.
2020-12-01 22:39:36 +00:00
Moonchild b1bbc9286d Merge pull request 'Fix macOS version detection above 10.15 and update blocklist support to 11.0' (#1692) from dbsoft/UXP:Big_Sur_Version into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/1692
2020-12-01 22:27:41 +00:00
Brian Smith e43b01e58b Issue #1690 - Part 2: Update MacOS Blocklist support from 10.13 to 11.0.
Changes based on Mozilla bug 1678061.
2020-12-01 15:46:38 -06:00
Moonchild 1683d012e2 Clobber for NSS update. 2020-12-01 15:33:00 +00:00
Moonchild 958205f4da [NSS] Version and build bump 2020-12-01 14:20:15 +00:00
Moonchild cca3b9062d [NSS] Update root certificates. 2020-12-01 14:19:59 +00:00
Moonchild bb31c1c65e Issue #1624 - Exclude function scopes from Ion compilation.
This seems to work around the problem with the compiled code stack for in-line
declared JS module code. Not optimal, for sure, but better than having to kill
Ion compilation outright.
2020-11-30 16:53:49 +00:00
Moonchild 060e3eb0c8 Revert "Issue #1691 - Part 1: Provide a way of associating a private value with a script"
This reverts commit 15914ec578.
2020-11-28 10:18:10 +00:00
Moonchild 15914ec578 Issue #1691 - Part 1: Provide a way of associating a private value with a script
or module.

This is a prerequisite for dynamic import
2020-11-27 15:47:49 +00:00
Brian Smith b1ac886a98 Issue #1690 - Part 1: Fix MacOS version detection above 10.15.
Changes based on Mozilla bug 1616404 but supporting back to 10.7.
2020-11-23 08:18:34 -06:00
Moonchild 5165ed0228 Merge branch 'redwood' into release 2020-11-20 09:47:03 +00:00
Moonchild ca9abcdf17 [webrtc] Only init WebRtcAec callbacks once 2020-11-19 22:47:40 +00:00
Werner Lemberg 459c36b9df [sfnt] Fix heap buffer overflow.
This is CVE-2020-15999.

* src/sfnt/pngshim.c (Load_SBit_Png): Test bitmap size earlier.
2020-11-19 22:47:19 +00:00
Henri Sivonen c9508464d5 [dom] Remove attributes from descendants when setting sanitized style.
This avoids a number of problems with incomplete sanitation.
2020-11-19 22:47:05 +00:00
Moonchild 2219a336dd [http] Use a copy of nsHttpConnectionInfo.
The root cause in this bug is that the connection info used by
'SpdyConnectTransaction' is the same instance as the connection info in
'nsHttpTransaction', so we should clone it and let 'SpdyConnectTransaction' use
the cloned one.
2020-11-19 22:46:51 +00:00
Moonchild a6763e7451 [xpcom] Don't use realloc for shrinking nsTArrays when allowRealloc is false.
The original patch handled the grow case but not the shrink case. When the
current and new allocation sizes are in different size classes, jemalloc's
realloc will move the allocation when shrinking, not just truncate the existing
one.

Based on work by Jon Coppeard.
2020-11-19 22:46:22 +00:00
Henri Sivonen 727f4372a9 [parser] Make the refcount of nsHtml5OwningUTF16Buffer atomic. 2020-11-19 22:46:06 +00:00
David Major 556a15567d [xpcom] Fix GetWindowsFolder storage 2020-11-19 22:45:53 +00:00
Moonchild 95d93b55c9 [gfx][Skia] Hold mutex while accessing shared SkImage data. 2020-11-19 22:45:34 +00:00
Alessio Vanni 693dc6a5fc Issue #1686 - Align a keybinding definition with the others 2020-11-19 22:45:00 +00:00
Brian Smith 08cc9cd558 Issue #1667 - Part 3: Fix OpenGL load and runtime issues on Big Sur
This fix is included in NSPR 4.27 and Mozilla bug 1652330.
Also put a main thread check in the cocoa draw callback.
2020-11-19 22:44:41 +00:00
Brian Smith 4f0f4aa879 Issue #1667 - Part 2: Add MacOS 11.0 Big Sur widget compatibility
This involves refactoring the vibrancy and OpenGL/Pixel rendering changes contained
in the following Mozilla meta bugs: 1496823 and 1491445
Also add Big Sur to the features tests and update popup menu look and feel based
on Mozilla bug 1656301.
2020-11-19 22:44:22 +00:00
Brian Smith 53ca366d2b Issue #1667 - Part 1: Define _pthread_self if it is not already defined in jemalloc 2020-11-19 22:44:09 +00:00
Moonchild 14f7bec523 [UA] Change default compatibility mode version to 68.0
Since several entities have started to ban .9 versions, even if they are valid
ESR versions.
2020-11-18 10:59:33 +00:00
Matt A. Tobin 976ccaa922 Issue #251 - Move chrome packaging options to ac configure
Also adds options for new functionality in #1683
2020-11-18 10:59:16 +00:00
Moonchild 8b3375e2c2 [packager] Optimize archive accesses. 2020-11-18 10:58:48 +00:00
Moonchild 8fefeee3c3 Issue #1683 - Update libjar module. 2020-11-18 10:58:35 +00:00
Moonchild b645d59b1e Issue #1683 - Update Brotli lib to 1.0.9 2020-11-18 10:58:22 +00:00
Moonchild 71e0814af2 [libjar] Fix inflation logic.
This has been broken for 11 years. About time it's fixed.
Tag #1683
2020-11-18 10:58:08 +00:00
Moonchild 5744d59188 Issue #1682 - Remove vibrator DOM interface and support code. 2020-11-18 10:57:53 +00:00
Moonchild 45a976a5f1 Issue #1391 - Disable DOM Filesystem/dirpicker APIs by default.
There don't seem to be any drawbacks to this; tested for the past month disabled
and there have been no issues with any sites visited. Adoption seems very low.
2020-11-18 10:55:12 +00:00
adesh 06f9b815ce Issue #1280 - Follow-up: Get rid of HPKP pinning mode.
This was a leftover from HPKP removal.

Also remove a couple of unused variables from security/manager/ssl/nsSiteSecurityService.cpp.
2020-11-18 10:54:47 +00:00
Matt A. Tobin 0032e8313d Bug 1466909 - Use AddLvalueReference for UniquePtr's operator*().
This is required for UniquePtr to accept <void>,
which is required for PseudoHandle = mozilla::UniquePtr<T, JS::FreePolicy>;
in turn for mozilla::SegmentedVector<PseudoHandle<void>> uniquePtrArena_;

Tag #1679
2020-11-18 10:54:19 +00:00
Matt A. Tobin d7df9b336a Bug 1328948 - Add is(), as() to Cell.
Tag #1679
2020-11-18 10:54:04 +00:00
athenian200 6c1b1bd18f Issue #1673 - Part 5: Fix brace style and missed -moz-tab-size reference. 2020-11-18 10:51:58 +00:00
athenian200 770cb9a4b9 Issue #1673 - Part 4: Unprefix -moz-tab-size.
While we do fail a couple of tests, the other mainstream browsers also fail them and I think our implementation of tab-size is good enough to be unprefixed at this point. Having this patch also makes testing easier.
2020-11-18 10:51:45 +00:00
athenian200 90309c01a8 Issue #1673 - Part 3: Bring minimum tab advance up to spec.
This provides a clearer rule for the minimum tab advance that brings us to alignment with the spec and both major browsers.
2020-11-18 10:51:34 +00:00
athenian200 4de0e9c68d Issue #1673 - Part 2: Make tab-size animatable and fix typos.
There were a few typos in the previous patch and this patch also makes tab-size animatable which didn't really require much of a change at all.
2020-11-18 10:51:22 +00:00
athenian200 4dae04e594 Issue #1673 - Part 1: Allow tab-size to accept <length>.
Currently -moz-tab-size only accepts <number> values, and both Chrome and Firefox currently support <length> values and have for some time now. So with this you would be able to support sizes in px or em, for instance. This was implemented in Firefox 53 and was trivial to backport.
2020-11-18 10:51:09 +00:00
Moonchild b9c41e2624 [devtools] More gracefully (than a crash) handle stack capture failures. 2020-10-31 17:33:08 +01:00
Moonchild e1db27e199 Merge branch 'redwood' into release 2020-10-24 10:42:23 +00:00
Moonchild a5203631d8 Update docs for change of repository host.
Rename MCP back to MoonchildProductions.
2020-10-24 10:40:09 +00:00
Moonchild e2fe23c90b Update docs for change of repository host. 2020-10-24 10:39:57 +00:00
Moonchild fcc0241430 [layout] Re-order rowgroups if reflowing.
This logic was missing for tfoot. See existing code in second hunk.
2020-10-24 10:39:36 +00:00
Moonchild 24657db629 [layout] Avoid negative availSize.BSizes in paginated table reflow. 2020-10-24 10:39:16 +00:00
Moonchild 4939447eb7 Bump platform version for added features. 2020-10-24 10:39:03 +00:00
Moonchild f07d60c09f [netwerk] Make nsIncrementalStreamLoader's GetNumBytesRead threadsafe.
This prevents a potential race and simplifies the code a bit by keeping the
bytes read separate instead of using mData, which is modified from another
thread from OnDataAvailable.
Relaxed atomics are fine for these, since they don't guard any memory.
2020-10-24 10:38:50 +00:00
Moonchild d7a05ea9e5 [DOM] When failing to create a channel and an image request, make sure to set
the image blocking status appropriately.

This is the same status as we do for known no-data protocols and ensures we
treat these two cases the same.
2020-10-24 10:38:35 +00:00
Moonchild 10bf4a6d5b [DOM Fetch] Detect broken pipes and propagate that write error to the caller. 2020-10-24 10:38:21 +00:00
Moonchild c3778db14d [DOM Fetch] Improve stability of Fetch API. 2020-10-24 10:38:07 +00:00
Moonchild abcee4f85c Issue #1671 - Unprefix ::-moz-selection
This actually keeps both pseudo-elements for now, since the prefixed version is
still used internally, but we need the unprefixed version for web compat.
Note: while unprefixing a non-spec-compliant pseudo here, it's exactly in line
with what other browsers do. Nobody is following the spec here and at least
we'll be doing what everyone else is with our unprefixed version.
2020-10-24 10:37:53 +00:00
athenian200 67a7e4eabd Issue #1668 - Part 2: Visited color and auto support for caret-color property.
Mozilla's original implementation of this failed a couple of tests, but this seems to solve all the problems. Basically, the caret-color wasn't able to be set differently based on whether a link was visited, and the auto value implementation was incomplete. The only test we fail now is the one where you have grey text on a grey background and the caret is supposed to be visible, but I think that may have been removed from the spec. Even if it wasn't, no other browser supports it anyway.
2020-10-24 10:37:01 +00:00
athenian200 c1ef954679 Issue #1668 - Part 1: Implement support for caret-color property.
This CSS property allows input carets (that blinking input cursor you see in text fields), to be given a custom color. This was implemented in Firefox 53, and it was such a minor feature that no one ever missed it, but I don't see any harm in implementing this.

https://bugzilla.mozilla.org/show_bug.cgi?id=1063162
2020-10-24 10:36:47 +00:00
Moonchild eac19e3356 Issue #1643 - Follow-up: Ensure we properly clear our pointers when the
Presentation of a document is destroyed.
2020-10-24 10:36:20 +00:00
Moonchild a98d06380f Merge branch 'redwood' into release 2020-10-06 09:32:46 +00:00
Moonchild 1e8d07cac2 Issue #1606 - Add support for multi-monitor DPI awareness v2 (W10 1706+) 2020-10-06 09:32:13 +00:00
Moonchild e7a0013f81 [devtools] Teach devtools about overflow-wrap: anywhere
Tag #1666
2020-10-06 09:32:03 +00:00
Moonchild 17b4d049f4 Issue #1666 - Implement overflow-wrap: anywhere
This aligns with the current spec regarding overflow-wrap: break-word and
overflow-wrap: anywhere in if it affects intrinsic sized due to considering
soft-wrap opportunities or not.
See CSS Text Module Level 3, Editor’s Draft, 1 October 2020, Section 5.5
2020-10-06 09:31:51 +00:00
Moonchild abf1d5a099 Issue #1665 - Take overflow-wrap into account when calculating min-content intrinsic size. 2020-10-06 09:31:40 +00:00
New Tobin Paradigm b7dac18c0e Update CONTRIBUTING.md
Revise Commit message style and add Follow-up form
2020-10-06 09:31:28 +00:00
Moonchild 63a0006985 Merge branch 'redwood' into release 2020-10-01 11:37:38 +00:00
athenian200 e50094ab02 Issue #1647 - Followup: Remove excessive VARIANT_OPACITY statements.
I got very anxious about making sure I included VARIANT_OPACITY in all the places VARIANT_NUMBER was included to make sure it couldn't possibly break unexpectedly, and that led to me accidentally breaking a mechanism that prevented percentages from serializing as numbers in other parts of the code. It was a total accident, and these additions were unnecessary. Basically, the situation is that there was one part of the code where it determines what's allowed for the flex statement (and possibly other statements) by checking whether it got stored as a "number", and basically only disallows percentages if it attempted to store/serialize them as percentages.

However, it only got to that part of the code because I accidentally allowed VARIANT_OPACITY as a valid way for certain tokens to parse where it wasn't necessary. If it tries to parse it that way under very specific circumstances... percentages will be marked valid and fed through the system as numbers rather than being rejected and not serialized at all, because the check to disallow percentages there relied on them being stored as percentages.

It's a really weird thing to have a problem with in a lot of ways, because if percentages aren't allowed in a field, you would think people wouldn't try to use them there, much less depend on the broken behavior that results from them not parsing as a related value.
2020-10-01 09:55:37 +00:00
Moonchild d11196927a Issue #1643 - Follow-up: Make sure things aren't changed while iterating.
This fixes some crashing scenarios.
2020-09-30 16:03:36 +00:00
Moonchild af6a8637f5 Merge branch 'redwood' into release 2020-09-29 21:08:33 +00:00
Matt A. Tobin 5a9f8ae723 Issue #1643 - Follow up: Add a null check for mOwner in ResizeObserverNotificationHelper::Unregister
A race condition seemed to exist between tab destruction and un-registering a ResizeObserver resulting in a null deref crash.
The original reporter in Forum Topic 25311 experienced this on msn.com so that was the functional test reference.
2020-09-29 21:07:49 +00:00
Moonchild 9f5c27ba47 Merge branch 'redwood' into release 2020-09-23 23:45:46 +00:00
Moonchild f624bd1375 Output webidl filenames as they are processed, for real this time. 2020-09-23 08:29:31 +00:00
Moonchild 312f0b3a76 Issue #1655: Update MediaQueryList to the current draft spec.
This make MediaQueryList inherit from EventTarget and adds MediaQueryListEvent
as an interface as well as the onchange() method.
This should not affect compatibility with other code; the event object is a
MediaQueryListEvent instance, which is recognized as a MediaListQuery instance.
2020-09-23 08:29:21 +00:00
Moonchild 04479387a2 [webaudio] Keep track of whether the HRTF database has already been loaded.
This DiD measure ensures that our async HRTF database loading is completed
before we actually try to use it. If not done, database() simply returns null.
2020-09-23 08:29:06 +00:00
Moonchild b0c271c7f9 [dom/media] Use an atomic for mInputDeviceID to avoid potential race 2020-09-23 08:28:56 +00:00
Moonchild 37efb98518 [SVG] Only fire the SVG onload when scripting is enabled and allowed 2020-09-23 08:28:46 +00:00
Moonchild 3272147d97 Issue #1224 - Remove constant expressions from /dom
This excludes DOMProxy handlers in dom bindings because that's intertwined with
codegen and js that needs to be handled together.
2020-09-21 11:10:23 +00:00
athenian200 f2866a5420 Issue #1647 - Part 2: Implement VARIANT_OPACITY to correctly serialize.
Even though percentages are already treated as floats internally by the style system for computation purposes, you have to go out of your way to stop them from being read back out as percentages. What I do here amounts to storing the percentage token in the "wrong" container, the one normally used for floats. This allows a value that was read in as a percentage to be read back out as something else, which is normally prevented by the design of the style system.
2020-09-21 11:05:30 +00:00
athenian200 b862145e9c Issue #1647 - Part 1: Implement percentage for CSS opacity keywords
This preliminary step allows percentages to be computed and display correctly,
but unfortunately it fails a test after changing VARIANT_HN to VARIANT_HPN because that allows values to be serialized as percentages. However, not doing this means percentages are rejected as valid values for the user to input. The way the style system is setup makes it hard to change this for opacity without changing it for everything else, especially since some code-saving speed hacks in Bug 636029 and Bug 441367 that make a lot of assumptions about this stuff very rigid.
2020-09-21 11:05:19 +00:00
Moonchild e2e483ac47 Issue #1653 - Part 2: Stop indirectly loading DWM functions through WinUtils. 2020-09-21 11:05:03 +00:00
Moonchild 892a2d9655 Issue #1653 - Part 1: Remove WinUtils::SHGetKnownFolderPath
Instead of doing the whole dll-load, replace function dance, we can just use the
shlobj.h version of Windows.
2020-09-21 11:04:52 +00:00
Moonchild 075fa01286 Issue #1643 - Part 4: Hook up all the plumbing. 2020-09-21 11:04:31 +00:00
Moonchild 32e0d2ca23 Issue #1643 - Part 3: Implement ResizeObserverController 2020-09-21 11:04:19 +00:00
Moonchild 791d5f8a43 Issue #1643 - Part 2: Implement ResizeObserver API
Implements ResizeObserver, ResizeObserverEntry and ResizeObservation
2020-09-21 11:04:05 +00:00
Moonchild ed1f54ab73 Issue #1643 - Part 1: Add GetNodeDepth() to nsContentUtils. 2020-09-21 11:03:48 +00:00
Moonchild eb1315e093 [widget] Clean up Windows widget code some. 2020-09-21 11:00:01 +00:00
Gaming4JC fa9730a46c Issue #618 - Clear the module map - Debug Followup
An assertion was added to dom/script/ScriptLoader.cpp but fails to compile on debug builds due it not being included in the namespace.

Ref: BZ 1529203
2020-09-21 10:59:48 +00:00
adeshkp ba0518147f Fix usage of a macro in a cocoa widget (#1649)
* Issue #457 - Fix usage of a macro in a cocoa widget
2020-09-21 10:59:35 +00:00
Moonchild 7564818c79 Issue #1650 - Add null check.
There are situations where nsCSSClipPathinstance->CreateClipPath(dt)
returns null. We need to check for this before trying to use its
functions. If there is no clip path, then always return "no hit".
2020-09-21 10:59:24 +00:00
adeshkp 10866dd35c Issue #1280 - Remove hostname parameter to trust domain.
Host name was purely being used for HPKP and since HPKP is killed,
this can also go. Currently it doesn't do anything other than
generating build warnings.
2020-09-21 10:59:09 +00:00
athenian200 f43c37cabe Issue #1629 - Part 5: Remove pointless local variables.
Since the local variable is always initialized to false, we don't actually need to declare it and can just pass "false" directly as a parameter to the PrepareSheet function's bool. I was worried about code readability at first, but some well-placed comments took care of that.
2020-09-21 10:58:32 +00:00
athenian200 157f218c8d Issue #1629 - Part 4: Ensure isExplicitlyEnabled is false upon sheet creation.
This clarifies the assumptions the code is making and the order in which the variables pass through the loading process. The new variable is set after the sheet is created and prepared, and is assumed to be false in the beginning.
2020-09-21 10:58:18 +00:00
Moonchild d49fb8a691 Issue #618 - Clear the module map when changing a Document's global and add
release build assertions for mismatching compartments.
2020-09-08 11:05:05 +00:00
Moonchild 71b988d1b4 Issue #618 - Make ES6 modules work for resource: URIs 2020-09-08 11:04:54 +00:00
Moonchild ddc43bf9d7 Issue #618 - Implement preloading of module scripts.
This hooks up module scripts to the existing preload mechanism.
2020-09-08 11:04:36 +00:00
Moonchild 5819a1a525 Issue #1644 - Remove plugin checking code leftovers 2020-09-08 11:03:21 +00:00
Moonchild 351974555b Clobber for CSS flow-root implementation 2020-09-08 11:03:11 +00:00
athenian200 abaea77ccb Issue #1641 - Implement CSS flow-root keyword
This is just a clean port of 1322191 and follow-up 1325970. It really seems to add create a new way to access existing code relating to block formatting and floating elements rather than implementing new functionality, and it is mercifully straightforwards.
2020-09-08 11:02:57 +00:00
Moonchild 4698b4b3ca Issue #1639 - Implement object.fromEntries()
Adds a self-hosted implementation of this map->object conversion.
This resolves #1639.
2020-09-06 10:01:37 +00:00
Moonchild 798f0bd3ad Fix build error. 2020-09-05 20:36:39 +00:00
Gaming4JC 427d325d0c Regenerate the HTML Parser code for nomodule changes. 2020-09-05 18:46:32 +00:00
Gaming4JC 9c515323ff Issue #618 - Don't preload nomodule scripts when modules are enabled (uplift) 2020-09-05 18:45:45 +00:00
Gaming4JC c2b91aaf8c Regenerate Parser for Marquee Removal 2020-09-05 18:44:45 +00:00
Moonchild 1da42403ec Issue #1525 - Kill marquee element (uplift) 2020-09-05 18:44:16 +00:00
Matt A. Tobin 602fbdcb44 Update old.configure for --enable-phoenix-extensions 2020-09-01 05:46:57 +00:00
Matt A. Tobin 42f895f27f Update old.configure for --enable-phoenix-extensions 2020-09-01 05:44:49 +00:00
Moonchild a6f632714f Merge branch 'redwood' into release 2020-08-31 05:54:39 +00:00
Moonchild b28effe2ea Remove unsupported CE keyword from HTMLLinkElement.webidl 2020-08-30 12:04:46 +00:00
Moonchild afd6edd667 Clobber for NSS update 2020-08-30 11:59:23 +00:00
Moonchild 582a1ce72a [NSS] Version and build bump 2020-08-30 11:59:14 +00:00
J.C. Jones 71ac56ba40 [NSS] Prevent slotLock race in NSC_GetTokenInfo
Basically, NSC_GetTokenInfo doesn't lock slot->slotLock before accessing slot
after obtaining it, even though slotLock is defined as its lock.
2020-08-30 11:59:06 +00:00
Moonchild ae184d09e6 Issue #1587 followup - Improve resilience of AbortSignals. 2020-08-30 11:58:58 +00:00
Moonchild 868f0755ae [misc/mar] Don't use a signed type for a length parameter. 2020-08-30 11:58:49 +00:00
Kris Maglione 5ca8fbd41c [DOM] Only construct JS-implemented objects if inner window is current. 2020-08-30 11:58:40 +00:00
Moonchild 549c8b9283 [media] Only include source error details in debugging scenarios.
Unless a user is debugging media errors, this detail is unnecessary to report
and could include sensitive data which could be abused by third-party
requesters. This aligns it with the standard success/error paradigms in normal
browsing situations.
2020-08-30 11:58:32 +00:00
Moonchild 77e8ba7eaf Issue #618 - Implement async attribute for inline module scripts. (uplift)
This commit does several things:
- Moves the pref check from ScriptLoader to ns[I]Document so it can be called on
the document.
- Changes the atrribute freezing function to a better name that takes the
document as a parameter.
- Sets the proper async/defer attributes on HTML script elements based on
keywords and whether they are module scripts or not.
2020-08-30 09:51:18 +00:00
Moonchild e854d58633 Issue #618 - (async) Keep track of script modes in a single mode state.
This simplifies handling of combinations of async/defer by assigning one and
only one state to scripts.
If async then always async > if defer or module then defer > otherwise blocking.
2020-08-30 09:48:07 +00:00
Moonchild d58cb8e11b Issue #618 - (async, preload) Correctly pass info about async/defer to parser.
This makes sure we don't block body-referred sub-resources by head-referenced
defer and async scripts. This is important for all script loads, not just
modules, but is added here because it was run into while implementing modules.
2020-08-30 09:47:49 +00:00
Moonchild 429a7bdb93 Issue #618 - (async) Split out function to add async request. 2020-08-30 09:40:15 +00:00
Moonchild 3f14e9ec5f Issue #618 - Rename some script load request flags to be more descriptive. 2020-08-30 09:40:03 +00:00
Moonchild aefb293793 Issue #618 - Make document.currentScript null in modules.
Because the spec says so.
2020-08-30 09:39:55 +00:00
Jon Coppeard c583315558 Issue #618 - Fix processing of non-parser-generated module scripts. 2020-08-30 09:39:45 +00:00
Jon Coppeard 834ecdc59a Issue #618 - Handle errors for inline module scripts and ensure we update the
module map after fetch errors.
2020-08-30 09:39:23 +00:00
Moonchild 798c2ed4f8 Issue #618 - Split SRI verification out from OnStreamComplete. 2020-08-30 09:39:13 +00:00
Moonchild 767b637c83 Issue #618 - Split handling of load errors out from OnStreamComplete. 2020-08-30 09:39:03 +00:00
Moonchild 702ad218b0 Issue #618 - Integrity for descendant module scripts should be the empty string
Because the spec says so.
2020-08-30 09:38:54 +00:00
Jon Coppeard b9af9c0c51 Issue #618 - Don't mute errors for module scripts because they always use CORS 2020-08-30 09:38:44 +00:00
Moonchild 9d6e28d3d0 Issue #618: Pass down referrer and referrer policy when fetching modules.
Because the spec says so.
2020-08-30 09:38:29 +00:00
Moonchild c735355ae1 Issue #618: Ignore 'event' and 'for' attributes for module scripts.
Because the spec says so.
2020-08-30 09:38:17 +00:00
Moonchild 10a10fd375 Issue #618 - Simplify module resolve hook to be a function pointer
This is an ahead-of time port to try and address #1624.
This is based on BZ 1461751 and Jon Coppeard's work in it.
2020-08-30 09:37:12 +00:00
Moonchild 1012dbe9e5 [js] Add some utility functions to get the current JS runtime. 2020-08-30 09:37:03 +00:00
Gaming4JC 9982c1f5cb Issue #618 - Keep track of which modules in a graph have been fetched using a visited set
Ref: BZ 1365187
2020-08-30 09:36:51 +00:00
Gaming4JC fe912e94e4 Issue #618 - Simplify module map interface
Ref: BZ 1365187
2020-08-30 09:36:41 +00:00
Gaming4JC 770b1c9071 Issue #618 - Align error handling for module scripts with the spec - Debug follow up
MODULE_STATUS_ERRORED is no more. Replacing with newer API.

Ref: BZ 1420420
2020-08-30 09:35:19 +00:00
Gaming4JC daf56131a7 Issue #618 - Lazily initialise module binding maps - Debug follow up
The added debug assertion does not work due to missing API.
They were added in BZ 1337491, 1395366, and others, but were primarily used for multi-threading.
This uses our existing non-multithreaded syntax instead, resolving a `no member named` build error.
2020-08-30 09:35:07 +00:00
Jon Coppeard d8686de401 Issue #618 - Record module dependency before starting fetch so that error
handling works correctly

Ref BZ 1395896
2020-08-30 09:33:58 +00:00
Moonchild c8a38346c8 Issue #618 - Lazily initialise module binding maps
Make it so they are not allocated on a background thread in a different zone to
the final module.

Ref: BZ 1372258
2020-08-30 09:33:33 +00:00
Moonchild 70bafe4df5 Issue #618 - Use a single slot for the module's environment object.
According to the spec this isn't created until the module is instantiated, but
we create it when we compile the module.
We stored this previously in InitialEnvironmentSlot and copied it to
EnvironmentSlot when it was supposed to be created, but we can just store it in
the latter slot straight away and check the module's status and return null if
it shouldn't exist yet.

This reduces the number of slots needed on a moduleObject to 17.

Re: BZ 1420412 Part 1
We can't implement the second part to further reduce our number of slots,
because it relies on SetProxyReservedSlot which in turn relies on
rearchitecturing JS proxies to make reserved slots dynamic. That's a rabbit hole
we really don't want to fall into.
So, we'll end up being a bit slower because it can't be in-line allocated with
having more than 16 slots, but so be it. I sincerely doubt it will make any
practical difference.
2020-08-30 09:33:21 +00:00
Moonchild 498b1ab0c8 Issue #618 - Align error handling for module scripts with the spec (again)
This updates module implementation to match spec regarding handling of
instantiation errors, after it was changed yet again, this time to not remember
instantiation errors, but instead immediately rethrow applicable ones.

Ref: BZ 1420420
2020-08-30 09:33:06 +00:00
Moonchild 2f145b6eda Issue #618 - Fix error events fired when loading JS module dependencies fail
When module dependencies fail, don't spam with errors for each import; only fire
the error event once.

Ref: BZ 1421259
2020-08-30 09:32:52 +00:00
Matt A. Tobin 06a092d08e Follow up to eb28b1f32 - Correct inputmethod build file by putting Keyboard.jsm back in EXTRA_JS_MODULES
JSMs are NOT Components.
2020-08-30 09:31:24 +00:00
Moonchild d107016d37 [js] Reinstate precise floating point model for all js sources. 2020-08-30 09:31:10 +00:00
Moonchild 63371593c0 Issue #457 - Silence SQLite compiler warning
Our use of SQLite explicitly avoids using MSVC's _msize which the lib would
notrmally use. This was set up this way in BZ bug 719579 for legitimate reasons
(because _msize would end up using the system symbol, which would crash trying
to get the size information from jemalloc allocations). Since we build the
SQLite lib separately there is no easy way to avoid this warning as it's not
directly linked against mozglue.dll which has the jemalloc functions it wants
for _msize when not using the system allocator. It is implicitly assuming the
function is an extern returning an int (with the call specifically  casting to
int) which is correct (well, correct _enough_, anyway) so the warning can
safely be ignored for our specific use as it all lines up at link time.
2020-08-30 09:30:50 +00:00
Moonchild ce1dc7e6c6 [db] Update SQLite lib to 3.33.0 2020-08-30 09:30:28 +00:00
Moonchild a4780ebaeb Issue #1629 - Uplift implementation of <link disabled> behavior for stylesheets. 2020-08-30 09:29:45 +00:00
Gaming4JC c384fa6e25 Issue #1620 - Intrinsic Aspect Ratio: Debug Follow up.
Newly introduced aspect-ratio property did not have CSS_PROP_LIST_EXCLUDE_INTERNAL defines, resulting in the following assertion:
\!nsCSSProps::PropHasFlags(p, (1<<28)) (properties defined outside of #ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL sections must not have the CSS_PROPERTY_INTERNAL flag), at ...layout/style/nsCSSProps.cpp:289

This patch resolves the assertion by adding #ifndef around the aspect-ratio property.
2020-08-30 09:24:25 +00:00
Moonchild 5e8e0d05a6 [CSS] Alias -webkit-appearance for compatibility reasons
Since this is supported as an alias by Firefox and Edge for the same
reasons and we have websites using this to (attempt to) override the
system-provided styling with their own, leaving out the only supported
keyword we'd otherwise have (with -moz- prefix) but still stating
-webkit-.

TODO: unprefix this completely and make the vendor prefixes aliases.
2020-08-30 09:24:02 +00:00
Andy bf95a03189 Issue #1620 - Enable Intrinsic Ratio by Default
A simpler name feels so much cleaner.
2020-08-30 09:23:46 +00:00
Andy c75e412f17 Issue #1620 - Remove Development Comments 2020-08-30 09:23:37 +00:00
Andy 0bbe6ec105 Issue #1620 - Use Intrinsic Aspect Ratio for Images (uplift) 2020-08-30 09:23:18 +00:00
Moonchild 48d31ea5eb Pref and disable getRootNode()
This is apparently used for fallback selection and if available it is "assumed"
Shadow DOM is also available, while this is a utility function.

Webcompat is a nightmare sometimes.
2020-08-07 21:30:12 +00:00
Matt A. Tobin 3cf0843679 Issue #1628 - Remove redundant PREF_EM_UPDATE_BACKGROUND_URL 2020-08-07 21:30:03 +00:00
Gaming4JC ff21776616 Issue #1621 - Part 4: Check whether node can be splited.
At first, HTMLEditor::GetActiveEditingHost might return null in this situation, we should check whether nullptr is returned. At second, SplitNodeDeep returns error since curent is design mode and selection node has no parent. So we should check error.

Ref: Bug 1350772
2020-08-07 21:29:45 +00:00
Gaming4JC 2f022ab1fa Issue #1621 - Part 3: Use nsIAtom to change attirbute if possible.
We can replace old nsIEditor API with nsIAtom version.

Ref: Bug 1324996
2020-08-07 21:29:36 +00:00
Gaming4JC 14e7f881be Issue #1621 - Part 2: Implement nsIAtom version of SetAttribute/RemoveAttribute/CloneAttirubte.
Add nsIAtom version of the following.
 - CloneAttribute
 - RemoveAttribute
 - RemoveAttributeOrEquivalent
 - SetAttribute
 - SetAttributeOrEquivalent

Ref: Bug 1324996
2020-08-07 21:29:27 +00:00
Gaming4JC 4f03fb2798 Issue #1621 - Part 1: CSSEditUtils should use atom for CSS property if possible.
There is a lot of string compare when using CSS property name. We should use nsGkAtoms instead.

Ref: Bug 1323138
2020-08-07 21:29:16 +00:00
Matt A. Tobin 3dd316f739 Issue #1625 - Allow MailNews Oauth2 support to be configured in confvars.sh
Baby has his bottle, you ok now?
2020-08-07 21:28:54 +00:00
Moonchild 972ab6d437 [js] Try to catch bad pointers for GC and bail if not valid. 2020-08-07 21:28:14 +00:00
Andy 83ae5bd019 Issue #1619 - Nits Picked 2020-08-07 21:28:03 +00:00
Andy c237a54f23 Issue #1619 - Add Vertical Writing Testcase
Ensures aspect ratio numerator and denominator aren't swapped in vertical writing modes.
https://bugzilla.mozilla.org/show_bug.cgi?id=1548768
2020-08-07 21:27:54 +00:00
Andy 8f72a673ca Issue #1619 - Missing Dimension Computation
This existed in Firefox before this bug.
I don't know if it came from a previous bug or was removed post-fork.
2020-08-07 21:27:40 +00:00
Andy 3266e0976f Issue #1619 - Convert Intrinsic Ratio to Float
https://bugzilla.mozilla.org/show_bug.cgi?id=1547792

Aspect Ratio handling simplified by using floating point integers:
- Multiplication of value (or inverse value) to a known side for Scaling
- No unequal equal values such as "4/3" vs "8/6" vs "20/15"
- Truly "Empty" aspect ratios, even if one dimension is not 0
2020-08-07 21:27:29 +00:00
Matt A. Tobin 4433519ae8 Add license header to media/webrtc/trunk/build/mac/find_sdk_uxp.py 2020-08-07 21:27:17 +00:00
Matt A. Tobin d419fe2d52 Use an alt script to properly determine the OSX SDK version 2020-08-07 21:27:03 +00:00
Gaming4JC c77c6de9ce Bug 1318570 - Clean up GetTextNode into TextEditRules.
EditorBase parameter of GetTextNode is unnecessary because it uses static method only. Also, we should return nsINode to reduce QI.

Resolves #1617
2020-08-07 21:26:33 +00:00
Moonchild 2ed0607c74 Merge branch 'redwood' into release 2020-07-30 09:37:13 +00:00
athenian200 922a72766c Issue #1615 - SunOS LDAP cleanup.
I meant to do this a long time ago, but basically it accounts for the new XP_SOLARIS build flag that never made it into the MailNews code. Additionally, it enables a compatibility flag for Solaris 11.4 that allows us to use the three-argument implementation of ctime_r still used by Solaris 11.3 and illumos (which also appears equivalent to the NSLDAPI_CTIME implementation used by libldap internally). Also, the ctime_r function has been added to the time.h header library for a while now, not sure why Mozilla thought we didn't have a ctime_r implementation.
2020-07-30 09:36:55 +00:00
Moonchild 16d1313104 Merge branch 'redwood' into release 2020-07-29 19:32:26 +00:00
Matt A. Tobin 0387f52bd3 Issue #1614 - Update en-US Dictionary 2020-07-29 19:32:08 +00:00
Moonchild a1ca8ca9bd Merge branch 'redwood' into release 2020-07-29 14:30:24 +00:00
Moonchild 2ee2ca7dfb Improve dll loading on Windows. 2020-07-29 14:29:33 +00:00
Michael Tuexen 0d7b7b74c6 [WebRTC] Stop putting addresses in the cookie chunk.
When using AF_CONN addresses, don't put these in the COOKIE
chunk. For these addresses it is possible to reconstruct them
locally. Conceptually, addresses are something to be shared
with the peer, but in the case of AF_CONN this might not be
the case. Therefore, zero then out.

Thanks to Natalie Silvanovich of Google Project Zero for
finding and reporting the issue.
2020-07-29 14:29:23 +00:00
Moonchild 45db2388fe [dom] Fix a spec compliance issue with the HTML LS regarding script loading.
This fixes a spec compliance issue with section 8.1.4.2 Fetching scripts.
2020-07-29 14:29:10 +00:00
Moonchild 323288bc72 [js] Don't improve TypeSets containing the magic-args type.
JIT optimizations involving the Javascript 'arguments' object could
potentially confuse later optimizations, so we simply disable these
optimizations as a DiD measure.
2020-07-29 14:28:55 +00:00
Andrea Marchesini 3323a8eda3 [xpcom] Make Base64 compatible with ReadSegments() with small buffers. 2020-07-29 14:28:45 +00:00
Jan de Mooij 71293f0fe4 [js] Fix Sink to check for non-recoverable operands. 2020-07-29 14:28:36 +00:00
Moonchild a91722be27 [network/dom] Improve sanitization of download filenames. 2020-07-29 14:28:24 +00:00
Matt A. Tobin 1ef64f9ea3 Follow up to 39be34c06 - The check sound be if not ordered
FINE! I'll go to bed already...
2020-07-28 15:51:37 +00:00
Matt A. Tobin 4a960879c8 [MailNews] Allow setting "Local Folders" as always the first displayed account 2020-07-28 15:50:20 +00:00
Matt A. Tobin 4329ae3337 [MailNews] Allow ordering of accounts to respect mail.accountmanager.accounts 2020-07-28 15:50:09 +00:00
Moonchild ad453f0b28 Issue #1391 - Remove the DOM battery API 2020-07-28 15:46:41 +00:00
Moonchild d332d4a60d Fix line endings. 2020-07-28 10:38:28 +00:00
Moonchild ad5e9449d2 Issue #1587 Part 12 (followup 2): Allow clearing of signal by setting to null. 2020-07-28 10:38:16 +00:00
Moonchild 71848c23a4 Issue #1587 Part 11 (followup 1): Implement multithreaded signals for workers. 2020-07-28 10:38:04 +00:00
Moonchild 1d321e689e [css] Enable various arbitrarily-disabled CSS features in the platform.
These should all be spec-compliant and were (for release-trickling of features)
arbitrarily disabled by Mozilla at our fork point. There's no real reason to
keep them disabled since they are used in the wild.
2020-07-23 23:17:18 +00:00
Matt A. Tobin b9b9d5bfb9 Issue #1612 - Add-ons targeting Toolkit's ID (and not Firefox's) should be considered "native" by the Add-ons Manager when using the Dual-GUID system
A version bump triggering add-on compatibility check will re-evaluate the "native" status (among other things) so no extra or special work is required to fix erroneous warnings.

tl;dr instafix!
2020-07-23 23:17:09 +00:00
Matt A. Tobin b92abc83c2 Issue #1611 - Enable WASM by default but only enable jit when 64bit 2020-07-23 23:16:56 +00:00
Gaming4JC 4950c982e0 Issue #618 - Remove eager instantiation - Debug follow up
The added debug assertion did not take into account microtask refactoring done in BZ 1405821.
Resulting in error: no member named 'IsInMicroTask' in 'nsContentUtils'.

This resolves the error.
2020-07-12 19:40:18 +00:00
Moonchild 86b184b957 Revert "Revert "Issue #1445 - strings cleanup""
This reverts commit 554183b5dd.
2020-07-12 01:35:45 +02:00
Moonchild 33ba46c6bb Revert "Revert "Issue #1445 - Add a link to details on using Firefox extensions in Pale Moon""
This reverts commit 7ba07f4a17.
2020-07-12 01:35:30 +02:00
Moonchild 451980d51b Revert "Revert "Issue #1445 - remove redundant nativeIndicator""
This reverts commit 0fb23389f5.
2020-07-12 01:35:17 +02:00
Moonchild 4ddbe58171 Revert "Revert "Issue #1445 - Use the detailed string also in the list entries.""
This reverts commit 0c150945dc.
2020-07-12 01:35:04 +02:00
Moonchild 84caa4f3ad Revert "Revert "Issue #1446 - Only match extension add-on types for target applications.""
This reverts commit b089b365d6.
2020-07-12 01:34:51 +02:00
Moonchild 4f44e23c16 Revert "Revert "Issue #1446 - Only allow extension add-on types for Firefox compat mode.""
This reverts commit 55fa46d059.
2020-07-12 01:34:38 +02:00
Moonchild a69eda9b9c Revert "Revert "Issue #1445 - Clarify the status of extensions in the Add-On manager""
This reverts commit d21b46fc9c.
2020-07-12 01:34:17 +02:00
Moonchild f1b51be787 Merge branch 'redwood' into release 2020-07-10 18:46:10 +00:00
Moonchild 82faff19e1 [network] Use query and ref lengths if available in nsStandardURL. 2020-07-10 18:34:52 +00:00
Moonchild 1597b61148 [js] Get the class pointer from the ObjectGroup in NativeObject::slotSpan
This changes NativeObject::slotSpan() to get the class from the object group
rather than getting it from the base shape to avoid a race between
Shape::ensureOwnBaseShape and background sweeping.
2020-07-10 18:34:43 +00:00
Moonchild 694c5f889c Force clobber 2020-07-10 18:34:31 +00:00
Moonchild c1f8c0cb5d [NSS] Version and build bump 2020-07-10 18:33:22 +00:00
Sohaib ul Hassan dcab408a5f [NSS] Implement constant-time GCD and modular inversion
The implementation is based on the work by Bernstein and Yang
(https://eprint.iacr.org/2019/266)
"Fast constant-time gcd computation and modular inversion".

It fixes the old mp_gcd and s_mp_invmod_odd_m functions. The patch also fixes
mpl_significant_bits s_mp_div_2d and s_mp_mul_2d by having less control flow to
reduce side-channel leaks.

Co-authored by : Billy Bob Brumley
2020-07-10 18:33:11 +00:00
Moonchild 407c503fa4 [js] Improve readability and control flow of js date string parser. 2020-07-10 18:33:01 +00:00
Byron Campen [:bwc] 9130f12906 [WebRTC] Make candidate pair insertion code easier to read/understand.
Includes removing an error code for a function that never fails, and removing an
error return when the function successfully did what it said it would.

Ref: BZ 1644477
2020-07-10 18:32:51 +00:00
Moonchild 5e2b3d1d89 [AppCache] Add check for disallowed encoded path separators 2020-07-10 18:32:35 +00:00
Moonchild 0c5a41e894 [image] Add a sanity check to JPEG encoder buffer handling, just in case. 2020-07-10 18:32:26 +00:00
Moonchild e29a8bd113 Issue #618 - Fix typo and remove old function declarations. 2020-07-10 18:31:16 +00:00
Moonchild 83abc5af59 Issue #618 - Report source position information (line/column)
Report source position information for module export resolution failures.

Ref: BZ 1362098
2020-07-10 18:31:06 +00:00
Moonchild 47101f49c0 Issue #618 - Slightly improve module scripting tests.
Ref: BZ 1388728
2020-07-10 18:30:57 +00:00
Moonchild f6a6900a6b Issue #618 - Further align error handling for module scripts with the spec
Ref: BZ 1388728
2020-07-10 18:30:48 +00:00
Moonchild 40aad1a220 Issue #618 - Remove context and heap-idle check
For checking if a module is in an error state and what the error is, it
shouldn't matter if we are currently GC-ing or not. So we don't need to check
for it, which removes the requirement to pass in the JS context (needed for
AssertHeapIsIdle's runtime check); this unblocks progress where otherwise we'd
have to figure out what the context is at the module level just to satisfy this
check.
2020-07-10 18:30:39 +00:00
Moonchild 1e14031a59 Issue #618 - Remove eager instantiation
This backs out the stuff added in Bug 1295978.
Ref: BZ 1295978, 1388728
2020-07-10 18:30:30 +00:00
Moonchild 765c90318f Issue #618 - Fix JSAPI additions to pass the JS context. 2020-07-10 18:30:14 +00:00
Moonchild ef8d18da70 Issue #618 - Match JSAPI names with the changes in 9ca7414722
Ref: BZ 1388728
2020-07-10 18:30:03 +00:00
Moonchild 7bf3e4c464 Issue #618 - Add APIs to query module record errors
Ref: BZ 1388728
2020-07-10 18:29:52 +00:00
Moonchild 57523a0deb Issue #618 - Update code comments for ModuleInstantiate 2020-07-10 18:29:43 +00:00
Moonchild 3f25d0c8e4 Issue #618 - Align module instantiation/errors with the updated spec.
Store and re-throw module instantiation and evaluation errors.
Ref: BZ 1374239, 1394492
2020-07-10 18:29:33 +00:00
Moonchild ab05017026 Issue #618 - Add clarifying code comments. 2020-07-10 18:29:22 +00:00
Moonchild 255c7f6f3a Issue #618 - Check for failed instantiation when starting to fetch dependencies
If instantiation has failed, then also fail the load and don't fetch imports.
Ref BZ: 1358882
2020-07-10 18:29:13 +00:00
Moonchild 5ffe27bb03 Issue #1603 - Part 2: Split some classes out of ScriptLoader.cpp
This splits ScriptLoader up the same way Mozilla did with the exception of
ScriptRequest due to the fact that ScriptLoader and ScriptRequest are
interdependent and would create a circular dependency if split apart when not
using unified building.
2020-07-10 18:29:02 +00:00
Moonchild 0633844f46 Issue #1603 - Part 1: Reorganize ScriptLoader/ScriptElement
- Moves scripting parts of DOM into 'dom/script'
- Renames nsScript{Loader/Element} to Script{Loader/Element}
- Adjusts all callers
2020-07-10 18:28:50 +00:00
Gaming4JC d0126b96cd Bug 1316302 - Part 4: Refine HTMLEditRules::TryToJoinBlocks() and HTMLEditRules::MoveNodeSmart() with early return style for making scope of EditActionResult variable smaller
For now, let's make the scope of EditActionResult variable in them smaller without big change.

Tag #1563
2020-06-27 02:20:41 +02:00
Gaming4JC d4cd571021 Bug 1316302 - Part 3: Create EditActionResult class for making the methods which return nsresult, handled and canceled with out params
In a lot of places, edit action handlers and their helper methods return nsresult and aHandled and aCanceled with out params. However, the out params cause the code complicated since:

* it's not unclear if the method will overwrite aHandled and aCanceled value.
* callers need to create temporary variable event if some of them are not necessary.

This patch rewrites the helper methods of HTMLEditRules::WillDeleteSelection() with it.

Tag #1563
2020-06-27 02:20:28 +02:00
Gaming4JC 016c55f409 Bug 1316302 - Part 2: WillDeleteSelection() should retry to handle it when selection is collapsed and JoinBlocks() doesn't handle nor cancel the action
When selection is collapsed and JoinBlocks() doesn't handle nor cancel the action, WillDeleteSelection() should move selection to the start/end of leftmost/rightmost editable leaf node and retry to handle the action again.

For avoiding infinite loop, it checks if selected node is changed actually before calling itself again.

Tag #1563
2020-06-27 02:20:16 +02:00
Gaming4JC 016313d559 Bug 1316302 - Part 1: Helper methods for HTMLEditRules::WillDeleteSelection() should have an out argument to indicates if it actually handles the action
When HTMLEditRules::WillDeleteSelection() tries to remove something from the end/start of a block to its last/first text node but it's contained by block elements, it tries to join the container and the block. However, JoinBlocks() always fails to join them since it's impossible operation. In this case, HTMLEditRules::WillDeleteSelection() should retry to remove something in the leaf, however, it's impossible for now because JoinBlocks() and its helper methods don't return if it handles the action actually.

This patch renames |JoinBlocks()| to |TryToJoinBlocks()| for representing what it is. And this patch adds |bool* aHandled| to the helper methods. Then, *aHandled and *aCancel are now always returns the result of each method. Therefore, for merging the result of multiple helper methods, callers need to receive the result with temporary variables and merge them by themselves.

Note that when they modify DOM node actually or the action should do nothing (for example, selection is across tables), aHandled is set to true.

Tag #1563
2020-06-27 02:20:04 +02:00
wolfbeast 1fa428a789 Issue #1602 - Make sure we have a JSObject before trying to get global.
Dynamic script loading/unloading (thank you modules) can yank the script
out from under us before the JS API for it is initialized, leading to
null deref crashes.
This adds a simple check if the passed-in object is sane and present.
Resolves #1602
2020-06-27 02:19:50 +02:00
Lootyhoof d41fe2f55a Follow up to Issue #1578 - Remove unnecessary MOZ_ASSERT 2020-06-17 12:17:20 +00:00
Moonchild 4d9da86152 Issue #1594 - restore UAC elevation in the uninstaller.
Effectively backs out BZ 1333789 which was uplifted to
Firefox before we forked for UXP.
Resolves #1594
2020-06-17 12:13:15 +00:00
Gaming4JC aa19e3d8ba Bug 1613623 - For IMAP, no longer allow STARTTLS when server sends PREAUTH greeting.
Tag #1312
2020-06-17 12:12:36 +00:00
Moonchild f5b146a460 Issue #1587 - Part 10: Expose controlling pref and enable by default 2020-06-13 11:53:05 +02:00
Moonchild e2403eeb5a Issue #1587 - Part 9: Immediately reject an already-aborted signal 2020-06-13 11:52:53 +02:00
Moonchild 301ae8c2df Issue #1587 - Part 8: Remove controller follow/unfollow
Since it didn't end up being in the final spec after all.
2020-06-13 11:52:42 +02:00
Moonchild 21403c31e0 Issue #1587 - Part 7: Rename FetchController to AbortController
Also renames FetchSignal to AbortSignal. Includes renaming the various
controlling prefs to enable.
2020-06-13 11:52:30 +02:00
Moonchild 29bca891d5 Issue #1587 - Part 6: Move FetchController/Signal to its own dir
Since it is specced separately from fetch.
2020-06-13 11:52:17 +02:00
Moonchild bb70605829 Issue #1587 - Part 5: Hook FetchObserver up to the Fetch API 2020-06-13 11:52:04 +02:00
Moonchild 3f3d626434 Issue #1587 - Part 4: Implement FetchObserver 2020-06-13 11:51:53 +02:00
Moonchild a04d67dd12 Issue #1587 - Part 3: Hook FetchSignal up to the Fetch API 2020-06-13 11:51:41 +02:00
Moonchild 9e2da53a02 Issue #1587 - Part 2: Implement controller follow/unfollow 2020-06-13 11:51:30 +02:00
Moonchild 2b41c85019 Issue #1587 - Part 1: Implement FetchController/FetchSignal interface 2020-06-13 11:51:18 +02:00
adeshkp e9d41c9968 Issue #1542 - Fix a typo in wasm which was causing build failure on ARM 2020-06-13 11:50:21 +02:00
Moonchild 0e0feed5da Issue #1585 - Replace node.rootNode with node.getRootNode()
This removes the (default disabled) node.rootNode readonly attribute
and replaces it with a node.getRootNode() function per WhatWG
spec discussion.
Based on work by John Dai <jdai@mozilla.com>
2020-06-13 11:50:06 +02:00
Matt A. Tobin 7f238b1cf9 Follow up to Issue #1578 - Preprocess the popup binding 2020-06-13 11:49:53 +02:00
Lootyhoof 6235023c8b Issue MoonchildProductions/UXP#1578 - Add global menubar support for GTK 2020-06-13 11:49:36 +02:00
Moonchild f51beb3fda Issue #1560 - Always include speech synthesis IPDLs
This is entangled with the IPC messaging configuration so
we need these IPDLs even if sppech synthesis is otherwise
not being built.

This resolves #1560
2020-06-13 11:49:13 +02:00
Moonchild a934165b57 [NSS] Update exported symbols
Some symbols were missing from export which might lead to build bustage.
2020-06-13 11:47:25 +02:00
Gaming4JC 2516886ceb Issue #1580 - Add missing MP3Demuxer.h to MediaDecoderReader.h
Follow up for dom/media work on Issue #80. Fixes non-optimized build bustage.
2020-06-13 11:47:05 +02:00
Moonchild fbab1f4f9e [DOM] Hard-disable webcomponents and customelements prefs (redwood) 2020-06-07 18:09:13 +00:00
Moonchild 90c42b7afd Fix missing include 2020-06-03 11:45:28 +00:00
Moonchild 2deaddfca2 Fix missing include 2020-06-03 11:44:55 +00:00
Moonchild 0ccb51f2ae Merge branch 'release' of https://github.com/MoonchildProductions/UXP into release 2020-06-03 10:51:52 +00:00
Moonchild 5e5f2277f5 Merge branch 'redwood' into release 2020-06-03 10:50:44 +00:00
Moonchild 265d1b8019 [NSS] Bump NSS version 2020-06-03 10:49:54 +00:00
Moonchild 687f535b9c [NSS] Force a fixed length for DSA exponentiation 2020-06-03 10:49:43 +00:00
Moonchild 54b4fb0be6 Bug 1632717 2020-06-03 10:49:35 +00:00
adeshkp a054ece041 Issue #1566 - Lowercase link filename extension 2020-06-03 10:49:23 +00:00
Moonchild c6ca4380e9 Merge remote-tracking branch 'origin/redwood' into release 2020-06-01 21:58:35 +00:00
athenian200 744b044935 Issue #1571 - Remove JEMALLOC_USES_MAP_ALIGN and fix 48-bit addressing on SunOS AMD64.
The JEMALLOC_USES_MAP_ALIGN code has turned out to be worse than useless, and in fact it breaks 64-bit SunOS. It's very old and turned out not to be needed anymore because the way the memory allocator works has changed since it was implemented. It prevented a fix I tried for 48-bit addressing from working properly. However, without either this code or the 48-bit addressing fix, the 64-bit version won't even start, which is why I thought the code was still needed.

https://bugzilla.mozilla.org/show_bug.cgi?id=457189

https://hg.mozilla.org/mozilla-central/rev/a26c500b98ab

The 48-bit addressing fix is based on code found here:

https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/web/firefox/patches/patch-js_src_gc_Memory.cpp.patch

I already applied these changes to js/src/gc/Memory.cpp, but as I was looking through jemalloc.c I saw that there were very similar ifdefs for Linux on SPARC as the ones I'd had to enaable in Memory.cpp, but for whatever reason the patches I found didn't touch them. So I tried doing for jemalloc.c what was already done for Memory.cpp, and it worked (but only after I removed the map align code).
2020-06-01 11:48:25 +00:00
Moonchild b246f7b2f1 Update README.md
wiki -> site
2020-06-01 11:48:15 +00:00
wolfbeast 8618719921 Issue #1570 - Implement globalThis
This resolves #1570
2020-06-01 11:48:07 +00:00
Fedor b6db7da98a Issue #1558 - Prevent null deref crash in WebrtcVideoConduit DTOR 2020-06-01 11:47:44 +00:00
Ascrod 9805ddc483 Issue #361 - Remove dead Android code.
See Bug 1629030, part 3.
2020-06-01 11:47:09 +00:00
Trushita 83ac4391b6 Bug 1154295 - use normal formatting for plaintext documents in reader mode
Before this change the plain text document in reader mode was not formatted/styled properly.

Tag #361.
2020-06-01 11:47:01 +00:00
Cameron McCormack 027a4cac9c Bug 1621479 - Fix typo in reader mode CSS class preservation list.
Tag #361.
2020-06-01 11:46:53 +00:00
Ascrod 66470fa1d8 Issue #361 - Update Readability from upstream.
(git rev 52ab9b5c8916c306a47b2119270dcdabebf9d203)
2020-06-01 11:46:41 +00:00
athenian200 451509e2c0 Issue #1571 - Remove JEMALLOC_USES_MAP_ALIGN and fix 48-bit addressing on SunOS AMD64.
The JEMALLOC_USES_MAP_ALIGN code has turned out to be worse than useless, and in fact it breaks 64-bit SunOS. It's very old and turned out not to be needed anymore because the way the memory allocator works has changed since it was implemented. It prevented a fix I tried for 48-bit addressing from working properly. However, without either this code or the 48-bit addressing fix, the 64-bit version won't even start, which is why I thought the code was still needed.

https://bugzilla.mozilla.org/show_bug.cgi?id=457189

https://hg.mozilla.org/mozilla-central/rev/a26c500b98ab

The 48-bit addressing fix is based on code found here:

https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/web/firefox/patches/patch-js_src_gc_Memory.cpp.patch

I already applied these changes to js/src/gc/Memory.cpp, but as I was looking through jemalloc.c I saw that there were very similar ifdefs for Linux on SPARC as the ones I'd had to enaable in Memory.cpp, but for whatever reason the patches I found didn't touch them. So I tried doing for jemalloc.c what was already done for Memory.cpp, and it worked (but only after I removed the map align code).
2020-06-01 11:00:26 +02:00
wolfbeast 7895b8acd9 Issue #1570 - Implement globalThis
This resolves #1570
2020-06-01 10:59:51 +02:00
Fedor ccff4610c5 Issue #1558 - Prevent null deref crash in WebrtcVideoConduit DTOR 2020-06-01 10:59:15 +02:00
Moonchild 3045e1d5c9 [permissions] Fix build bustage with --disable-permissions 2020-05-23 16:13:26 +02:00
Moonchild 44de3c3023 [printing] Fix build bustage with --disable-printing 2020-05-23 16:13:14 +02:00
athenian200 a3124c55a1 Issue #1557 - Allow event dispatch on disabled form controls. (uplift) 2020-05-23 16:12:59 +02:00
athenian200 c4ed566602 Revert "Merge pull request #1357 from athenian200/form-disabled-issue"
This reverts commit ed88b99849, reversing
changes made to c4b0715baa.
2020-05-23 16:10:40 +02:00
athenian200 15a1f78f8b Issue #1557 - Allow event dispatch on disabled form controls. (uplift) 2020-05-21 13:16:17 +00:00
athenian200 8b44473fe6 Revert "Merge pull request #1357 from athenian200/form-disabled-issue"
This reverts commit ed88b99849, reversing
changes made to c4b0715baa.
2020-05-21 13:10:27 +00:00
athenian200 6e0aee959e Issue #1540 - Stop MP3 demuxer from choking on very small files. 2020-05-20 17:18:39 +02:00
Moonchild 99c2e698d2 Issue #1538 - remove speech recognition engine
This removes speech recognition, pocketsphinx, training models
and the speech automated test interface.
This also re-establishes proper use of MOZ_WEBSPEECH to work
for the speech API (synthesis part only) that was a broken mess
before, with some synth parts being always built, some parts
being built only with it enabled and recognition parts being
dependent on it. I'm pretty sure it'd be totally busted if you'd
ever have tried building without MOZ_WEBPEECH before.

Tested that synthesis still works as-intended.

This resolves #1538
2020-05-20 14:04:17 +00:00
Jiaxun Yang 15ac4021b0 Bug 1430745 - IPC: Fix unaligned accesses in DirReaderLinux
Tag: #1542
2020-05-20 14:04:01 +00:00
Jiaxun Yang 344b272991 Issue #1542 - [mtransport] Fix unaligned memory allocation in r_memory
Unaligend memory access can't work on RISC.
2020-05-20 14:03:54 +00:00
Jiaxun Yang fb8fcffe1d Bug 1426323 - Media: WebRTC: Fix build config for MIPS64
Tag: #1542
2020-05-20 14:03:46 +00:00
Jiaxun Yang b67a630966 Issue #1542 - [WebRTC] Set CPU speed to -1 on MIPS
CPU is pretty slow due to lack of SIMD optmization.
2020-05-20 14:03:38 +00:00
Jiaxun Yang a148bd40d8 Issue #1542 - [WebRTC] Don't use post proc on MIPS 2020-05-20 14:03:28 +00:00
Jiaxun Yang e59757fddf Bug 1384826 - Media: WebRTC: Fix build config for MIPS
Tag: #1542
2020-05-20 14:03:20 +00:00
Jiaxun Yang be954fca72 Bug 1412030 - [MIPS] Emit wasm memory access information
Tag: #1542
2020-05-20 14:03:12 +00:00
Jiaxun Yang f411e02716 Bug 1330942 - move MemoryAccessDesc::isUnaligned to the ARM/MIPS platform layer
Tag: #1542
2020-05-20 14:03:04 +00:00
Jiaxun Yang a34d02924c Bug 1441521 : [MIPS] Optimize comparation with small constants
Tag: #1542
2020-05-20 14:02:56 +00:00
Jiaxun Yang 084ea153c1 Bug 1430693 - IonMonkey: MIPS: Fix generic NaN for legacy mips (IEEE 754-1985)
Tag: #1542
2020-05-20 14:02:49 +00:00
Jiaxun Yang c40bda67bb Bug 1424978 - IonMonkey: MIPS64: Fix unboxNonDouble for Int32
Tag: #1542
2020-05-20 14:02:42 +00:00
Jiaxun Yang 0c2de12ffd Bug 1424978 - IonMonkey: MIPS64: Fix tagValue function
Tag: #1542
2020-05-20 14:02:35 +00:00
Jiaxun Yang e44709892b Bug 1424978 - IonMonkey: MIPS64: Fix boxValue function
Tag: #1542
2020-05-20 14:02:28 +00:00
Jiaxun Yang 237f8d7ebd Bug 1390802 - IonMonkey: MIPS64: Fix storeValue function
Tag: #1542
2020-05-20 14:02:21 +00:00
Jiaxun Yang 5001007287 Bug 1424978 - IonMonkey: MIPS: Fix ma_store_unaligned
Tag: #1542
2020-05-20 14:02:13 +00:00
Jiaxun Yang f83a88907a Bug 1424978 - IonMonkey: MIPS: Fix ma_addTestCarry
Tag: #1542
2020-05-20 14:02:06 +00:00
Jiaxun Yang ff8603d7a2 Bug 1390459 - mulby3 function implement error on mips platform
Tag: #1542
2020-05-20 14:02:00 +00:00
Jiaxun Yang 31ad2d12db Bug 1271968 - IonMonkey: MIPS: Refactor addMixedJump.
Tag: #1542
2020-05-20 14:01:52 +00:00
Jiaxun Yang 494cfe32c9 Bug 1271968 - wasm: MIPS: Port mixed jump for wasm.
Tag: #1542
2020-05-20 14:01:45 +00:00
Jiaxun Yang b4f0be5e95 Bug 1271968 - IonMonkey: MIPS: Refactor PatchWrite_NearCall.
Tag: #1542
2020-05-20 14:01:38 +00:00
Jiaxun Yang ac62e4cfdd Bug 1271968 - IonMonkey: MIPS: Handle conditional branch in out of line code of mixed jump.
Tag: #1542
2020-05-20 14:01:30 +00:00
Jiaxun Yang 0fa41e2adc Bug 1271968 - IonMonkey: MIPS: Merge MacroAssembler::branchWithCode.
Tag: #1542
2020-05-20 14:01:22 +00:00
Jiaxun Yang 61af6cc299 Bug 1271968 - IonMonkey: MIPS: Merge MacroAssembler::ma_jal.
Tag: #1542
2020-05-20 14:01:14 +00:00
Jiaxun Yang c3a21acaee Bug 1271968 - IonMonkey: MIPS: Merge Assembler::bind.
Tag: #1542
2020-05-20 14:01:06 +00:00
Jiaxun Yang 3fb8648bed Bug 1271968 - IonMonkey: MIPS: Replace long jumps by mixed jumps.
Tag: #1542
2020-05-20 14:00:59 +00:00
Jiaxun Yang f18d78dea0 Bug 1271968 - IonMonkey: MIPS: Make jit code in same 256 MB-aligned region
Tag: #1542
2020-05-20 14:00:49 +00:00
Jiaxun Yang 16ae8db806 [IonMonkey] MIPS: Import small optimizations from load & store 2020-05-20 14:00:40 +00:00
Jiaxun Yang 43f57fe642 Issue #1542 - IonMonkey: MIPS32: Fix build error on O32 platform. 2020-05-20 14:00:30 +00:00
Jiaxun Yang f50410bd79 Bug 1323646 - IonMonkey: MIPS64: Fix range checking in ma_addTestOverflow
Tag: #1542
2020-05-20 14:00:23 +00:00
Jiaxun Yang 609d904cc1 Bug 1323642 - IonMonkey: MIPS64: Fix load unsigned 48-bit immediate
Issue:
In ma_li(Register, ImmWord):
	Load unsigned 48-bit immediate: 0x0000_8000_0000_0000
	Wrong instructions stream:
		lui	reg, 0x8000
		dsll	reg, reg, 16 # reg = 0xffff_8000_0000_0000
	Fixed instructions stream:
		lui	reg, 0x8000
		dinsu	reg, zero, 32, 32
		dsll	reg, reg, 16

Tag: #1542
2020-05-20 14:00:15 +00:00
Jiaxun Yang fa1628f767 Bug 1323136 - wasm: MIPS: Do bounds check in 32-bit
Tag: #1542
2020-05-20 14:00:08 +00:00
Jiaxun Yang 0136960ec0 Bug 1344597 - Baldr: MIPS: Fix trap type of unsigned divide by zero
Tag: #1542
2020-05-20 14:00:01 +00:00
Jiaxun Yang d9e0b4be85 Bug 1394286 - mips64: fix error correction about stackpointer within function _NS_InvokeByIndex
Tag: #1542
2020-05-20 13:59:53 +00:00
Jiaxun Yang a17ab79b88 Issue #1542 - nsprpub: _PR_SI_ARCHITECTURE add missing mips64 2020-05-20 13:59:46 +00:00
Jiaxun Yang f11fff32fa Issue #1542 - IonMonkey: MIPS: Define JS_CODEGEN_MIPSXX by HAVE_64BIT_BUILD.
MIPSXX is required for 64bit build.
2020-05-20 13:59:39 +00:00
adeshkp 912e37d202 Issue #80 - Include MDNSResponderOperator.h in libmdns/nsDNSServiceDiscovery.h for Mac
This is needed for forward declaration of `BrowseOperator` and `RegisterOperator`.
2020-05-20 13:59:08 +00:00
Gaming4JC e15b6906c5 Issue #80 - Add nsSocketTransportService2.h to ThrottleQueue.cpp 2020-05-20 13:59:00 +00:00
Moonchild b048f3d473 Issue #80 - De-unify netwerk/wifi 2020-05-20 13:58:52 +00:00
Moonchild 6cdd6c6286 Issue #80 - De-unify netwerk/streamconv 2020-05-20 13:58:44 +00:00
Moonchild 25c1a5cbe3 Issue #80 - De-unify netwerk/srtp 2020-05-20 13:58:37 +00:00
Moonchild 83a71d9c9d Issue #80 - De-unify netwerk/socket 2020-05-20 13:58:30 +00:00
Moonchild d8a0849b7f Issue #80 - De-unify netwerk/protocol/http 2020-05-20 13:58:23 +00:00
Moonchild 02923a3648 Issue #80 - De-unify netwerk/protocol/res 2020-05-20 13:58:17 +00:00
Moonchild a5da610b87 Issue #80 - De-unify netwerk/protocol/ftp 2020-05-20 13:58:08 +00:00
Moonchild aedf5c0169 Issue #80 - De-unify smaller netwerk/protocol components
- data
- device
- file
- viewsource
- wyciwyg
2020-05-20 13:57:59 +00:00
Moonchild 1c16924e08 Issue #80 - De-unify netwerk/protocol/about 2020-05-20 13:57:52 +00:00
Moonchild 9c21ed1804 Issue #80 - De-unify netwerk/ipc 2020-05-20 13:57:44 +00:00
Moonchild 41b982b9bb Issue #80 - De-unify netwerk/dns 2020-05-20 13:57:37 +00:00
Moonchild 4c76b52e09 Issue #80 - De-unify netwerk/cookie 2020-05-20 13:57:30 +00:00
Moonchild e50cfc7b63 Issue #80 - De-unify netwerk/cache2 2020-05-20 13:57:24 +00:00
Moonchild 8bbc95988a Issue #80 - De-unify netwerk/cache 2020-05-20 13:57:16 +00:00
Moonchild ed9eb8f722 Issue #80 - De-unify netwerk/base 2020-05-20 13:57:09 +00:00
Moonchild 1cd91bc155 Issue #80 - De-unify editor/txmgr and editor/txtsvc 2020-05-20 13:56:50 +00:00
Moonchild 8c8e5fba69 Issue #80 - De-unify editor/libeditor 2020-05-20 13:56:43 +00:00
Moonchild ed1ea719dd Issue #80 - De-unify editor/composer 2020-05-20 13:56:35 +00:00
adeshkp d38d5414fc Issue #80 - Include gfx/Logging.h in NativeFontResourceMac.cpp 2020-05-20 13:56:20 +00:00
Gaming4JC 1182ecd0b4 Issue #80 - Include gfxEnv.h in gfx/gl/GLLibraryEGL.cpp 2020-05-20 13:56:12 +00:00
Moonchild 3220b7dc56 Issue #80 - Fix up gfx/ipc and gfx/src for Linux.
This removes an unused Telemetry enum
2020-05-20 13:56:02 +00:00
Moonchild 3e82ac05b1 Issue #80- De-unify gfx/layers
Excludes layers/ipc/CompositorBridgeParent and CrossProcessCompositorBridgeParent
because the latter purposely uses functions implemented in the former.
See also code comment in CrossProcessCompositorBridgeParent.cpp

Note: likely dead code for us anyway; likely not worth investing in to solve.
2020-05-20 13:55:50 +00:00
Moonchild 3ab7bd811f Issue #80 - De-unify gfx/ycbcr 2020-05-20 13:55:43 +00:00
Moonchild 8c4892fb45 Issue #80 - De-unify gfx/src 2020-05-20 13:55:36 +00:00
Moonchild 11749de754 Issue #80 - De-unify gfx/skia and stop using dangerous opts 2020-05-20 13:55:28 +00:00
Moonchild 5186d78330 Issue #80 - De-unify gfx/ots 2020-05-20 13:55:22 +00:00
Moonchild 0538c32e32 Issue #80 - De-unify gfx/ipc 2020-05-20 13:55:14 +00:00
Moonchild 46040d136d Issue #80 - De-unify gfx/harfbuzz 2020-05-20 13:55:08 +00:00
Moonchild 35c731cf08 Issue # 80 - Fix up gfx/2d/DataSurfaceHelpers
De-unified build requires <string.h> instead of <cstring> to
prevent stdlib confusion.
2020-05-20 13:55:01 +00:00
Moonchild b1851a4ad0 Issue #80 - de-unify and fix up gfx/graphite2
With de-unified building we have to re-apply the fix-up
for <cstdio>, and additionally the same for <cstring>
to prevent the compiler picking the wrong versions of
standard functions.
2020-05-20 13:54:54 +00:00
Moonchild 935ce8fa8e Issue #80 - Fix deps in gfxFont-Impl.h 2020-05-20 13:54:18 +00:00
Moonchild 85b89ee754 Issue #80 - Split out GetShapedWord template function 2020-05-20 13:54:11 +00:00
Moonchild 9c006089e1 Issue #80 - Fix gfx/thebes Windows conditional 2020-05-20 13:54:04 +00:00
Moonchild c3fc87a904 Issue #80 - De-unify gfx/gl 2020-05-20 13:53:57 +00:00
Moonchild 5f04717b00 Issue #80 - De-unify gfx/config 2020-05-20 13:53:49 +00:00
Moonchild e74b4ad8f8 Issue #80 - De-unify gfx/cairo 2020-05-20 13:53:41 +00:00
Moonchild fa68aa6fd5 Issue #80 - De-unify gfx/2d 2020-05-20 13:53:34 +00:00
Moonchild 9f37161ec5 Issue #80 - De-unify gfx/thebes 2020-05-20 13:53:25 +00:00
win7-7 21348b56d9 issue #1547 - Correct z-ordering for some table parts and add reftests 2020-05-20 13:52:54 +00:00
win7-7 ad69c023a9 Issue #1545 - Fix border-radius on table row groups, rows, column groups, or columns
Before issue #146, border-radius on row groups, rows, column groups, or columns don't apply to the background of each cell, yet the border-radius on the cell itself does.

After issue #146, the behaviors changed. In this patch, I tried to revert the behaviors of border-radius on table row groups, rows, column groups, or columns back to what happened before issue #146.

Also: Don't override GetBorderRadii in nsBCTableCellFrame.
2020-05-20 13:52:15 +00:00
Moonchild 206b1af429 Issue #457 - Silence some superfluous compiler warnings in cairo 2020-05-20 13:52:01 +00:00
Moonchild 2bdbc482e7 Bump platform version 2020-05-20 13:51:22 +00:00
Moonchild a444b5cc39 Issue #1543 - Follow-up: avoid displaying the Alt text if an image is loading.
This prevents the Alt text from briefly being shown before being replaced
with the image.
2020-05-20 13:50:04 +00:00
Moonchild d050188cd5 Issue #1543 - Align <img> with no src to the updated spec. 2020-05-20 13:49:55 +00:00
win7-7 3a1bebfb87 Issue #1355 - Fix the nit, remove nsPoint offset in nsFrame.cpp and change PresShellState member order 2020-05-20 13:49:35 +00:00
win7-7 d3d3aad6e5 Issue #1355 - Better way to create display items for column backgrounds
Part 1: Remove current table item, as it's never set.

Part 2: Get rid of generic table painting code, and handle each class separately.

Part 4: Hoist outline skipping into col(group) frame code.

Part 5: Skip box-shadow for table column and column groups.

Part 6: Store column and column group backgrounds separately, and then append them before the rest of the table contents.

Part 7: Pass rects in display list coordinates to AppendBackgroundItemsToTop.

Part 8: Create column and column group background display items as part of the cell's BuildDisplayList.

Part 9: Used cached values instead of calling nsDisplayListBuilder::ToReferenceFrame when possible, since it can be expensive when the requested frame isn't the builder's current frame.

Part 10: Make sure we build display items for table parts where only the normal position is visible, since we may need to create background items for ancestors at that position.

Part 11: Create an AutoBuildingDisplayList when we create background items for table columns and column groups, so that we initialize the invalidation state correctly.
2020-05-20 13:49:25 +00:00
win7-7 d8d0538162 Issue #1355 - SetNeedToCalcHasBCBorders to true when initialize nsTableFrame
In the printing preview, we create continuous table frame if table is too long to containing in a page. But the default value of NeedToCalcHasBCBorders is false which means we don't calculate HasBCBorders for continuous table frame. Thus, the border collapse is not shown when printing preview.
2020-05-20 13:49:16 +00:00
win7-7 36369e0fef Issue #1355 - Avoid unnecessary work in nsIFrame::BuildDisplayListForStackingContext() and nsIFrame::BuildDisplayListForChild() and Cleanup DescendIntoChild
Bug 1441796 - Part 1: Optimize the (pseudo)-stacking context conditions

Bug 1441796 - Part 3: Reuse the results in nsIFrame::BuildDisplayListForStackingContext() for ChildrenHavePerspective(), IsTransformed(), and Combines3DTransformWithAncestors()

Bug 1512244 - Part 1: Cleanup DescendIntoChild
2020-05-20 13:49:09 +00:00
win7-7 3c1e71f0b1 Issue #1355 - Preemptively fix build bustage for 1409114 2020-05-20 13:49:01 +00:00
win7-7 71137783ac Issue #1355 - Store the dirty rect on the display list builder rather than passing it as a parameter to BuildDisplayList
Also fix build bustage for De-unified layout/xul in nsRootBoxFrame.cpp
2020-05-20 13:48:52 +00:00
athenian200 fe0963002f Issue #1540 - Stop MP3 demuxer from choking on very small files. 2020-05-20 13:48:10 +00:00
wolfbeast aeef4240d5 Issue #1589 - Ensure computed length and data is always available 2020-05-20 13:47:45 +00:00
Gaming4JC 938e6204ef Issue #21 - Remove TelemertyVFS
This reverts m-c Bug 668378 and completely removes Telemetry SQLite IO. As a bonus this fixes a potential crash in newer SQLite versions without the need for updating this useless telemetry shim.
2020-05-20 13:47:24 +00:00
Moonchild 16aaa21930 Issue #1536 - Part 3: Parse content to decide whether it's an init segment. 2020-05-20 13:47:10 +00:00
wolfbeast 6b7997abbe Issue #1536 - Part 2: Parse content to decide whether it's a media segment. 2020-05-20 13:47:02 +00:00
wolfbeast f358c4dfa9 Issue #1536 - Part 1: Add timecode checking for the WebM parser 2020-05-20 13:46:53 +00:00
Moonchild ad5cb04d71 Issue #80 - Fix additional deprot in /layout (redwood) 2020-05-20 13:45:06 +00:00
Matt A. Tobin ba5930cc8e Issue #1449 - Implement URLSearchParams's sort() 2020-05-10 16:06:19 +02:00
wolfbeast 6376255c0c Issue #1589 - Ensure computed length and data is always available 2020-05-10 14:51:23 +02:00
Matt A. Tobin 9be6582ec3 Hyperbola IceDove should use the toolkit SearchService 2020-05-06 19:17:04 +02:00
Moonchild 883fa80f7d [XPFE] Properly anchor XUL windows when tearing down 2020-05-06 19:16:51 +02:00
Moonchild 82b6d2cf9d [WebRTC] Port some upstream sctp fixes
- add SCTP auth token boundary check.
- turn off SCTP auth and address reconfiguration.
2020-05-06 19:16:40 +02:00
Moonchild 09b4a7828e [dom] Reorder some calls to improve memory safety 2020-05-06 19:16:20 +02:00
Moonchild ed58b7905e [devtools] Port various upstream fixes 2020-05-06 19:16:06 +02:00
Moonchild 31f47a2ba4 [js] Record load in MCreateThis alias set. 2020-05-06 19:15:54 +02:00
Bas Schouten 8b3b858546 Prevent the existance of dangling pointers upon failure of FindDataStart. 2020-05-06 19:15:42 +02:00
Moonchild dd506c896f Issue #1451 - Split out ICU data file on Windows
This reduces the xul.dll size by 11 MB
2020-05-06 19:15:12 +02:00
adeshkp f8588a2e86 Issue #457 - Fix warning about inline nsINode::GetFlattenedTreeParentNodeForStyle being undefined 2020-05-06 19:14:56 +02:00
adeshkp 0aa1b02b2b Issue #1259 - Remove a leftover GMP migration function 2020-05-06 19:14:42 +02:00
Moonchild e008deb88b Issue #1450 - Remove NVidia 3D-Vision utils
Legacy, unmaintained and untested D3D9 stereo
output behind a hidden pref that nobody ever uses... :P
'nuf said. Resolves #1450
2020-05-06 19:14:17 +02:00
Moonchild 56cb90a482 Issue #1517 - Remove dom.event.highrestimestamp.enabled pref
This resolves #1517
2020-05-06 19:14:05 +02:00
Matt A. Tobin 812574875b Issue #1449 - Implement URLSearchParams's sort() 2020-05-06 19:13:52 +02:00
Matt A. Tobin cd196a77d4 Issue #1531 - Work around GCC 10 defaulting to -fno-common in media/ffvpx/libavcodec/
Build Reference:
26:39.53 ../../../build/unix/gold/ld: error: /home/mattatobin/development/.obj/trunk-f1f9fdabf/navigator-x86_64-pc-linux-gnu-gtk2/media/ffvpx/libavcodec/flac_parser.o: multiple definition of 'ff_flac_parser'
26:39.53 ../../../build/unix/gold/ld: /home/mattatobin/development/.obj/trunk-f1f9fdabf/navigator-x86_64-pc-linux-gnu-gtk2/media/ffvpx/libavcodec/dummy_funcs.o: previous definition here
26:39.53 collect2: error: ld returned 1 exit status
26:39.53 gmake[4]: *** [/home/mattatobin/development/binoc-central/platform/config/rules.mk:773: libmozavcodec.so] Error 1

See also: https://gcc.gnu.org/gcc-10/porting_to.html
2020-05-06 19:13:31 +02:00
adeshkp e175224b88 Issue #80 - Include nsIContentInlines.h in layout/base/PositionedEventTargeting.cpp 2020-05-06 19:13:11 +02:00
Moonchild 0afb9e2d75 Issue #80 - Resolve issues with compiling on insane gcc configurations with no optimizations in layout/
(and fix a typo for cs fs)
2020-05-06 19:12:59 +02:00
Moonchild e733c3681b Issue #80 - De-unify layout/xul and tree, grid 2020-05-06 19:12:48 +02:00
Moonchild 157cd64a8e Issue #80 - De-unify layout/tables 2020-05-06 19:12:37 +02:00
Moonchild 5c3c92da90 Issue #80 - De-unify layout/svg 2020-05-06 19:12:26 +02:00
Moonchild aa21f96cf5 Issue #80 - De-unify layout/style (redwood) 2020-05-06 19:12:11 +02:00
Moonchild 537c63d600 Issue #80 - De-unify layout/printing 2020-05-06 19:06:17 +02:00
Moonchild 975db4c7f0 Issue #80 - De-unify layout/PITA... I mean layout/generic 2020-05-06 19:06:06 +02:00
Moonchild 528abd534e Issue #80 - De-unify layout/base 2020-05-06 19:05:49 +02:00
Moonchild 320682148b [XPFE] Properly anchor XUL windows when tearing down 2020-05-06 19:03:37 +02:00
Moonchild 1ed84ac1f8 [WebRTC] Port some upstream sctp fixes
- add SCTP auth token boundary check.
- turn off SCTP auth and address reconfiguration.
2020-05-06 19:03:23 +02:00
Moonchild 9c9d04e3e0 [dom] Reorder some calls to improve memory safety 2020-05-06 19:03:08 +02:00
Moonchild 19504d5263 [devtools] Port various upstream fixes 2020-05-06 19:02:56 +02:00
Moonchild 533b346f4e [js] Record load in MCreateThis alias set. 2020-05-06 19:02:42 +02:00
Bas Schouten 6afd96c460 Prevent the existance of dangling pointers upon failure of FindDataStart. 2020-05-06 19:02:28 +02:00
Matt A. Tobin 9858dc03cb Hyperbola IceDove should use the toolkit SearchService 2020-05-06 19:00:16 +02:00
wolfbeast d21b46fc9c Revert "Issue #1445 - Clarify the status of extensions in the Add-On manager"
This reverts commit f107de8a90.
2020-04-27 11:58:42 +02:00
wolfbeast 55fa46d059 Revert "Issue #1446 - Only allow extension add-on types for Firefox compat mode."
This reverts commit e8417acbff.
2020-04-27 11:57:28 +02:00
wolfbeast b089b365d6 Revert "Issue #1446 - Only match extension add-on types for target applications."
This reverts commit 4889e6dbbd.
2020-04-27 11:57:14 +02:00
wolfbeast 0c150945dc Revert "Issue #1445 - Use the detailed string also in the list entries."
This reverts commit ac68f8cf6c.
2020-04-27 11:57:01 +02:00
wolfbeast 0fb23389f5 Revert "Issue #1445 - remove redundant nativeIndicator"
This reverts commit 2073a7f1c9.
2020-04-27 11:56:47 +02:00
wolfbeast 7ba07f4a17 Revert "Issue #1445 - Add a link to details on using Firefox extensions in Pale Moon"
This reverts commit c220c30bbb.
2020-04-27 11:56:33 +02:00
wolfbeast 554183b5dd Revert "Issue #1445 - strings cleanup"
This reverts commit 461a9e86b2.
2020-04-27 11:56:19 +02:00
wolfbeast 98fe8b0ccb Merge branch 'redwood' into 28.9-platform 2020-04-26 12:56:46 +02:00
Matt A. Tobin 519030e688 Issue #80 - Resolve issues with compiling on insane gcc configurations with no optimizations in dom/ 2020-04-26 10:27:18 +02:00
adeshkp b9531d8e11 Issue #80 - Add Unused.h to dom/gamepad for Mac build 2020-04-26 10:26:57 +02:00
adeshkp 7605f4b0f8 Issue #80 - Fix include in PlatformDecoderModule.h 2020-04-26 10:26:07 +02:00
wolfbeast ab0e18135f Issue #80 - Fix include in dom/quota
Reported by Luke.
2020-04-26 10:23:13 +02:00
wolfbeast e883ac54e9 Issue #80 - Fix include in dom/media for Pale Moon builds. 2020-04-26 10:22:59 +02:00
New Tobin Paradigm 9cb65e8a77 Add Unused.h to dom/media/webrtc/MediaTrackConstraints.cpp 2020-04-26 10:22:46 +02:00
adeshkp 3a3152d54b Issue #80 - Include D3DMessageUtils.h in dom/plugins/ipc for Mac build
This should ideally not be needed on Mac but compilation fails due to
sizeof `DxgiAdapterDesc` not known.

Didn't face this issue on Linux though, probably due to a different include
chain which already has this file included somewhere along the way.
2020-04-26 10:22:32 +02:00
adeshkp f174801b64 Issue #80 - Fix includes in dom/media/platforms for Mac build 2020-04-26 10:22:20 +02:00
New Tobin Paradigm 3caceeb539 Issue #80 - Include nsIContentInlines.h in dom/svg/SVGTests.cpp to fix linux bustage 2020-04-26 10:21:59 +02:00
Moonchild 216189e6f7 Issue #80 - De-unify dom/xul 2020-04-26 10:21:48 +02:00
Moonchild bbae11cdd9 Issue #80 - De-unify dom/xslt 2020-04-26 10:21:37 +02:00
Moonchild 917447df6e Issue #80 - De-unify dom/xml 2020-04-26 10:21:27 +02:00
Moonchild 244c8ef1f7 Issue #80 - De-unify dom/xhr 2020-04-26 10:21:10 +02:00
Moonchild e1b6493747 Issue #80 - De-unify dom/xbl 2020-04-26 10:20:59 +02:00
Moonchild 4e225fc7d1 Issue #80 - De-unify dom/workers 2020-04-26 10:20:48 +02:00
Moonchild 683b1bedea Issue #80 - De-unify dom/system 2020-04-26 10:20:38 +02:00
Moonchild 11519ee6d2 Issue #80 - De-unify dom/svg 2020-04-26 10:20:27 +02:00
Moonchild 8a343284d9 Issue #80 - De-unify dom/smil 2020-04-26 10:20:16 +02:00
Moonchild 5a34fb5e1d Issue #80 - De-unify dom/security
Exception: CSPUtils relies on something in CSPContext, but on
Windows it throws in an MSVC include which provides no hints.
2020-04-26 10:20:05 +02:00
Moonchild 16c8dff724 Issue #80 - De-unify dom/quota 2020-04-26 10:19:55 +02:00
Moonchild 3595b9eecf Issue #80 - De-unify dom/push 2020-04-26 10:19:44 +02:00
Moonchild 594cbca6d1 Issue #80 - De-unify dom/plugins/ipc 2020-04-26 10:19:33 +02:00
Moonchild a4ba260904 Issue #80 - De-unify dom/plugins/base 2020-04-26 10:19:22 +02:00
Moonchild 4a8c186eea Issue #80 - De-unify dom/performance 2020-04-26 10:19:11 +02:00
Moonchild 8ff6e8c8a2 Issue #80 - De-unify dom/media part 3
Excluding /dom/media/webrtc for bad template use:
MediaTrackConstraints.cpp/h
MediaEngineCameraVideoSource.cpp and
MediaEngineRemoteVideoSource.cpp
2020-04-26 10:18:59 +02:00
Moonchild 3652cd0f99 Issue #80 - De-unify dom/media part 2 2020-04-26 10:18:45 +02:00
Moonchild b738ccc61b Issue #80 - De-unify dom/media part 1 (updated reland)
This de-unifies up to and including dom/media/platforms with the exception of
dom/media/platforms/wmf, because that one throws weird errors in the Win
SDK which don't have a clear cause (yet)
2020-04-26 10:18:28 +02:00
Moonchild 1c3a9a40e5 Issue #80 - De-unify dom/ipc 2020-04-24 10:37:30 +02:00
Moonchild 0a33733505 Issue #80 - De-unify dom/indexedDB 2020-04-24 10:37:19 +02:00
wolfbeast 691878e20f Issue #80 - De-unify dom/html 2020-04-24 10:37:08 +02:00
wolfbeast bf1fa93b91 [AM] Clean up addon-signing build leftovers. 2020-04-24 10:36:55 +02:00
wolfbeast 0ac7481d2e Issue #80 - De-unify dom/network 2020-04-24 10:36:44 +02:00
wolfbeast 168bb31e4f Issue #80 - De-unify dom/grid 2020-04-24 10:36:33 +02:00
wolfbeast ca04b37910 Issue #80 - De-unify dom/geolocation 2020-04-24 10:36:23 +02:00
wolfbeast f3b26f64fc Issue #80 - De-unify dom/gamepad 2020-04-24 10:36:11 +02:00
wolfbeast 99d23484bb Issue #80 - De-unify dom/filesystem 2020-04-24 10:36:01 +02:00
wolfbeast 376bc050a6 Issue #80 - De-unify dom/filehandle 2020-04-24 10:35:49 +02:00
Matt A. Tobin 9258382b0d Issue #576 - Remove IdentityService and ContextualIdentityService 2020-04-24 10:35:38 +02:00
Matt A. Tobin b6a703907e Issue #65 - Remove AppConstants from toolkit/prompts/content/tabprompts.xml
This file not only somehow escaped my pass through here but was also mocking me by using AppConstants in a preprocessed file BUT ALSO right AFTER a preprocessor directive.
2020-04-24 10:35:09 +02:00
Matt A. Tobin da42871b0e Put Request.cpp and Response.cpp back into UNIFIED in dom/fetch due to linux linker errors
Reference:

15:03.06 ../../build/unix/gold/ld: error: /home/mattatobin/development/.obj/trunk-master/navigator-x64-gtk3/toolkit/library/../../dom/fetch/Request.o: requires dynamic R_X86_64_PC32 reloc against '_ZN7mozilla3dom9FetchBodyINS0_7RequestEED2Ev' which may overflow at runtime; recompile with -fPIC
15:03.06 ../../build/unix/gold/ld: error: /home/mattatobin/development/.obj/trunk-master/navigator-x64-gtk3/toolkit/library/../../dom/fetch/Response.o: requires dynamic R_X86_64_PC32 reloc against '_ZN7mozilla3dom9FetchBodyINS0_8ResponseEED2Ev' which may overflow at runtime; recompile with -fPIC
15:03.06 ../../build/unix/gold/ld: error: read-only segment has dynamic relocations
15:03.07 /home/mattatobin/development/.obj/trunk-master/navigator-x64-gtk3/toolkit/library/../../dom/fetch/Request.o:Request.cpp:function mozilla::dom::Request::~Request(): error: undefined reference to 'mozilla::dom::FetchBody<mozilla::dom::Request>::~FetchBody()'
15:03.07 /home/mattatobin/development/.obj/trunk-master/navigator-x64-gtk3/toolkit/library/../../dom/fetch/Response.o:Response.cpp:function mozilla::dom::Response::~Response(): error: undefined reference to 'mozilla::dom::FetchBody<mozilla::dom::Response>::~FetchBody()'
2020-04-24 10:34:46 +02:00
wolfbeast c55433ee03 Issue #80 - De-unify dom/fetch
Running into the same problem as with dom/canvas: derived template
classes not being happy about being non-unified. Kept unified for now
to prevent linking errors.
2020-04-24 10:34:33 +02:00
wolfbeast d0a2389b43 Issue #80 - De-unify dom/events 2020-04-24 10:34:20 +02:00
wolfbeast 796a14e116 Issue #80 - De-unify dom/crypto 2020-04-24 10:34:08 +02:00
Matt A. Tobin ba6e4753b7 Fix typo in dom/animation/CSSPseudoElement.cpp
Linux filesystems tend to be case sensitive
2020-04-24 10:33:56 +02:00
wolfbeast 6d3d69f644 Issue #80 - De-unify dom/canvas 2020-04-24 10:33:20 +02:00
Matt A. Tobin fce3132fe8 Make application moz.configure file optional and set application/xulrunner as the default platform build_app 2020-04-24 10:33:08 +02:00
Matt A. Tobin a7da3cf52b Issue #80 - De-unify layout/mathml 2020-04-24 10:32:48 +02:00
Matt A. Tobin f5316668a3 Issue #80 - De-unify layout/forms 2020-04-24 10:32:36 +02:00
wolfbeast dc687dbc0b Issue #80 - De-unify dom/cache 2020-04-24 10:32:24 +02:00
wolfbeast 216aa2cada Issue #80 - De-unify dom/archivereader 2020-04-24 10:32:14 +02:00
wolfbeast 9d96ad90dd Issue #80 - De-unify dom/animation
KeyFrameEffect and KeyFrameEffectReadOnly are still built unified as
buddies because they have some complex interdependency that couldn't
easily be resolved without linking failures.
2020-04-24 10:32:03 +02:00
Matt A. Tobin b064c95231 Issue #80 - De-unify dom/messagechannel 2020-04-24 10:31:52 +02:00
Matt A. Tobin 11eb1f57f4 Issue #80 - De-unify dom/audiochannel 2020-04-24 10:31:42 +02:00
Matt A. Tobin 052cb18fff Issue #80 - De-unify dom/notification 2020-04-24 10:31:31 +02:00
Matt A. Tobin d306fe61c5 Issue #80 - De-unify dom/url 2020-04-24 10:31:19 +02:00
Matt A. Tobin 7859a0d693 Issue #80 - De-unify dom/encoding 2020-04-24 10:31:08 +02:00
Matt A. Tobin c5d9e1f973 Issue #80 - De-unify dom/json 2020-04-24 10:30:52 +02:00
Matt A. Tobin 2e12bda342 Issue #80 - De-unify dom/u2f 2020-04-24 10:30:40 +02:00
Matt A. Tobin 9755cd617d Issue #80 - De-unify dom/power 2020-04-24 10:30:29 +02:00
Matt A. Tobin abaf4d9fb4 Issue #80 - De-unify dom/mathml 2020-04-24 10:30:18 +02:00
Matt A. Tobin ae6f407177 Issue #80 - De-unify dom/jsurl 2020-04-24 10:30:08 +02:00
Matt A. Tobin 2a44476795 Issue #80 - De-unify dom/worklet 2020-04-24 10:29:56 +02:00
Matt A. Tobin 755cf4c7d0 Issue #80 - De-unify dom/console 2020-04-24 10:29:45 +02:00
Matt A. Tobin 47f26a67f4 Issue #80 - De-unify dom/media/webm 2020-04-24 10:29:34 +02:00
Matt A. Tobin e8aa76713a Issue #80 - De-unify dom/media/flac 2020-04-24 10:29:23 +02:00
Matt A. Tobin e6ffc4bdb7 Issue #80 - De-unify dom/media/mp3 2020-04-24 10:29:13 +02:00
Matt A. Tobin 90bbe7536d Issue #80 - De-unify dom/media/ogg 2020-04-24 10:29:01 +02:00
Matt A. Tobin 140750e4e8 Issue #80 - De-unify dom/media/encoder 2020-04-24 10:28:50 +02:00
Matt A. Tobin f2e089d51b Issue #80 - De-unify dom/media/mediasink 2020-04-24 10:28:38 +02:00
Matt A. Tobin e1d0ac30ac Issue #80 - De-unify dom/media/wave 2020-04-24 10:28:28 +02:00
Matt A. Tobin 9e8adc25a4 Issue #80 - De-unify dom/storage 2020-04-24 10:28:16 +02:00
Matt A. Tobin 7f66e8946a Issue #80 - De-unify dom/time 2020-04-24 10:28:05 +02:00
Matt A. Tobin c75b8ec714 Issue #80 - De-unify dom/permission 2020-04-24 10:27:54 +02:00
Matt A. Tobin 4250d93166 Issue #80 - De-unify dom/broadcastchannel 2020-04-24 10:27:42 +02:00
Matt A. Tobin 37250226d5 Issue #80 - De-unify dom/offline 2020-04-24 10:27:30 +02:00
Matt A. Tobin 802a4cfefe Issue #80 - De-unify /layout/inspector 2020-04-24 10:27:18 +02:00
Matt A. Tobin 5641a6d574 Issue #80 - De-unify /layout/tools/layout-debug/src 2020-04-24 10:27:06 +02:00
Matt A. Tobin 88d2480356 Issue #80 - De-unify /layout/ipc 2020-04-24 10:26:52 +02:00
Matt A. Tobin fcb4b997d0 Issue #80 - De-unify /layout/build 2020-04-24 10:26:40 +02:00
wolfbeast 79964767f5 [docs] Update coding style cf. discussion with Tobin. 2020-04-24 10:26:16 +02:00
wolfbeast a4a8d082a3 Issue #251 - Move MOZ_AV1 back to ac configure for everyone to use. 2020-04-24 10:25:57 +02:00
Matt A. Tobin adce88de95 Issue #1516 - Part 1: Add a global build define to determine if the client can draw in the titlebar and update consumers of the local define 2020-04-24 10:24:52 +02:00
wolfbeast 974d6ca889 Issue #1517 - Enable high-resolution DOM timestamps on trunk
At the very least we should enable these short term, with the potential
removal of it pending.
2020-04-16 13:58:36 +02:00
wolfbeast e08a4ad1c8 Issue #1517 - Enable high-resolution DOM timestamps on release 2020-04-16 04:20:42 +02:00
wolfbeast 39dac57259 Merge branch 'redwood' into 28.9-platform 2020-04-14 21:49:04 +02:00
wolfbeast c2d9ab62f3 Fix additional deprot in dom/base 2020-04-14 21:37:53 +02:00
wolfbeast b9e692af05 Revert 1320408 part 15: Make addDataProperty static 2020-04-14 21:10:50 +02:00
wolfbeast 871e57fdd6 Issue #80 - De-unify dom/base and fix deprot. 2020-04-14 14:19:58 +02:00
wolfbeast 03530de64f Fix deprot in /layout 2020-04-14 14:02:50 +02:00
Moonchild 4730da5b27 Create SECURITY.md
Provide basic instructions how to report security vulnerabilities.
2020-04-14 13:28:43 +02:00
wolfbeast 3cb245b749 Issue #1514 - Perform validity check before trying to use the content.
Resolves #1514
2020-04-14 13:28:28 +02:00
wolfbeast 9f5529d1e7 Issue #1513 - Bail on orphan node
This was refactored by Mozilla into doing effectively the same thing so
it aligns with them re: behavior.
Resolves #1513
2020-04-14 13:28:10 +02:00
wolfbeast 26c888208a Issue #1512 - Improve handling of multiple selections.
IsSelectionEditable should check whether the focus node and anchor node
aren't null before trying to use them.
This also changes the initialization of selections' aOutIndex to the
last range in the selection as a fallback in case we don't add a range
later (in AddItem) which could also end up with a null selection
otherwise if the additional selection nodes are removed.
2020-04-14 13:27:57 +02:00
wolfbeast 9a52b3b852 [layout] Always move descendants of layout frames if moved.
If we move the frame then we always need to move any descendant views,
not just in case the frame itself has a view.
2020-04-14 13:27:34 +02:00
wolfbeast 96afb5250d Issue #1511 - Bail on orphan situation.
This resolves #1511
2020-04-14 13:27:12 +02:00
Jan de Mooij b93afb1ba7 [js] Handle functions with rest parameters in isObservableArgumentSlot. 2020-04-14 13:26:57 +02:00
Matt A. Tobin 277f2116b6 Move aom source to a sub-directory under media/libaom
There is no damned reason to treat this differently than any other media lib given its license and there never was.
2020-04-14 13:26:42 +02:00
Matt A. Tobin d270404436 Silence removing dist/bin 2020-04-14 13:26:26 +02:00
Matt A. Tobin 3bec218684 Take files out of preprocessing that no longer require it 2020-04-14 13:26:13 +02:00
Matt A. Tobin 6daff43b61 Follow up to d0eee8f01 - Run precomplete cmd during package staging 2020-04-14 13:25:58 +02:00
Matt A. Tobin eedf9f5ebf Align mar generation on Windows with other platforms
This makes mar generation dependent on packaging not installer
2020-04-14 13:25:44 +02:00
Matt A. Tobin 049dae86d2 Alter config.guess to properly detect host and target bitness on SunOS 2020-04-14 13:25:29 +02:00
wolfbeast 65ba3cac58 [Docshell] Ensure nsDocShell::mContentViewer is released properly. 2020-04-14 13:25:13 +02:00
wolfbeast 1b8788aecb Issue #1505 - Part 3: Make native mode actually native again. 2020-04-14 13:24:59 +02:00
wolfbeast 747632bd64 Issue #1505 - Part 2: Store application build ID in nsHttpHandler
Since we're needing to reuse this several times, it makes it simpler to
just get it once in init and storing it.
2020-04-14 13:24:46 +02:00
wolfbeast 02327fa745 Issue #1505 - Rebuild application version string
To respond dynamically to the pref change, the mAppVersion string needs
to be rebuilt.
Includes some minor improvements for corner cases and removes leftover
b2g junk.
2020-04-14 13:24:32 +02:00
New Tobin Paradigm b470422d5a Issue #1497 - Re-implement an un-preprocessed file check 2020-04-14 13:24:17 +02:00
wolfbeast 449d530a30 Issue #1508 - Redirect moz://a to http://thereisonlyxul.org/ 2020-04-14 13:24:03 +02:00
wolfbeast 8bd941d4e3 Issue #1507 - Remove nsRefreshDriver's use of high res system timers.
Since we are using vsync for timing anyway in the layout refresh driver,
there is no need to bump the system timer resolution down to 1 ms.

This resolves #1507.
2020-04-14 13:23:48 +02:00
JustOff 7172fc72a3 Issue #65 - Fix unprocessed directives in WebRequest.jsm 2020-04-14 13:23:21 +02:00
Matt A. Tobin b977981df6 Make the reference to Handle unambiguous in ipc/testshell/XPCShellEnvironment.cpp
.. correctly
2020-04-14 13:23:06 +02:00
Matt A. Tobin 9dc65422ba Revert "Make the reference to Handle unambiguous in ipc/testshell/XPCShellEnvironment.cpp"
This reverts commit d4afddfada.
2020-04-14 13:22:51 +02:00
Matt A. Tobin 45e8e98031 Make the reference to Handle unambiguous in ipc/testshell/XPCShellEnvironment.cpp 2020-04-14 13:22:34 +02:00
Matt A. Tobin 965232ab2f Output webidl filenames as they are processed 2020-04-14 13:22:13 +02:00
athenian200 980ca14602 Issue #1501 - Un-bust building of NSS after update to 3.48 on Solaris. 2020-04-14 13:21:54 +02:00
Matt A. Tobin 02519e8575 Explicitly remove dist/bin before mozbuild's install_manifests get a hold of it 2020-04-14 13:21:33 +02:00
Matt A. Tobin e003547dc5 Properly fix crash in nsDownloadManager when repeatedly pausing and resuming a download
This applies only to applications that do not use JSDownloads and is based on Bug 1224326
2020-04-14 13:21:07 +02:00
Matt A. Tobin 56f8375338 Revert "Only state the stop notification for JSDownloads in nsWebBrowserPersist::EndDownload"
This reverts commit aa28523a55.
2020-04-14 13:20:54 +02:00
wolfbeast 2407845ec1 Issue #1280 - Un-bust certerror pages and ForgetAboutSite 2020-04-14 13:20:35 +02:00
wolfbeast 3f09b298b0 Issue #1280 - Stop requesting HPKP state from within devtools. 2020-04-14 13:20:22 +02:00
wolfbeast c27830f35c Issue #1280 - Part 2: Remove HPKP tests. 2020-04-14 13:19:54 +02:00
wolfbeast 99bad1726e Issue #1280 - Part 1: Remove HPKP components.
This also removes leftover plumbing for storing preload information
in SiteSecurityService since no service still uses it.
2020-04-14 13:19:41 +02:00
JustOff d86349716a Issue #1473 - Fix building %OS_SLICE% on non-Windows platforms 2020-04-14 13:19:20 +02:00
JMadgwick 64a7c9e2d2 Issue #1471 - Fix building on sparc64 Linux
Correct various pre-processor defines for sparc64 and in mozjemalloc use the JS arm64 allocator on Linux/sparc64.
This corrects build problems opn Linux sparc64 and is in line with bugzilla bug #1275204.
2020-04-14 13:18:48 +02:00
New Tobin Paradigm 514ff21cba Update README.md 2020-04-14 13:18:16 +02:00
wolfbeast edb5796d58 Issue #1497 Revert "Check if there are any unpreprocessed files"
This reverts PR #429
2020-04-14 13:18:02 +02:00
wolfbeast c23e3b25f8 Issue #1497 Revert "MoonchildProductions#1251 - Part 19"
"Make the unpreprocessed file script work on Solaris."

This reverts commit e51afbcc2f.
2020-04-14 13:17:47 +02:00
Matt A. Tobin e360caa1a2 Teach config.guess to know if we want to build 32 or 64 bit builds on Windows 2020-04-14 13:17:20 +02:00
Matt A. Tobin 9eeaeff77b Issue #1499 - Re-import ExtensionStorage.jsm 2020-04-14 13:16:54 +02:00
wolfbeast a435374873 Issue #1498 - Part 6: Remove STS preloadlist pref. 2020-04-14 13:16:38 +02:00
wolfbeast 04cfc091da Issue #1498 - Part 5: Update SSService CID and correct mismatch. 2020-04-14 13:16:24 +02:00
wolfbeast b23e7b61c6 Issue #1498 - Part 4: Remove clearPreloads.
Also tag #1280
2020-04-14 13:16:11 +02:00
wolfbeast 69b4e77751 Issue #1498 - Part 3: Remove support for storing "knockout" values. 2020-04-14 13:15:58 +02:00
wolfbeast 5657b5c53b Issue #1498 - Part 2: Stop persisting preload states.
Since we don't use preloading anymore for either HPKP or HSTS, we no
longer need persistent storage in the profile for preload states.
Tag #1280 also
2020-04-14 13:14:43 +02:00
wolfbeast 1037746d00 Issue #1498 - Part 1: Stop using HSTS preload lists. 2020-04-14 13:14:03 +02:00
Matt A. Tobin a060401264 Take nsSiteSecurityService out of UNIFIED_SOURCES
It exceeded the obj file sections limit because of the HSTS preload list so it cannot be built in UNIFIED mode.
2020-04-14 13:13:44 +02:00
wolfbeast 4e26fc1844 Issue #447 - Update HSTS preload list 2020-04-14 13:13:06 +02:00
Brian Smith 2645f9b944 Issue #1491 - Part 2: Disable a workaround on macOS 10.14+ for an Apple bug described in Mozilla bug 378645 involving popup windows that was fixed by Apple. 2020-04-14 13:12:48 +02:00
Brian Smith 88ce149033 Issue #1491 - Part 1: Update nsCocoaFeatures for newer versions of MacOS X. 2020-04-14 13:12:25 +02:00
wolfbeast 09655ad6d8 Issue #1467 - Part 4: Rename NSS_SQLSTORE to MOZ_SECURITY_SQLSTORE.
Rename the build config option accordingly.
2020-04-14 13:12:08 +02:00
wolfbeast 4fd0b98c2c Issue #1467 - Part 3: Use UTF-8 file paths for NSS-SQL database. 2020-04-14 13:11:51 +02:00
wolfbeast 894b33e53a Issue #1467 - Part 2: Make the PBKDF rounds adaptive to choice of NSS db 2020-04-14 13:11:37 +02:00
wolfbeast 236d425993 Issue #1467 - Part 1b: Fix type and make moz.configure happy. 2020-04-14 13:11:22 +02:00
wolfbeast 899e14e945 Issue #1467 - Part 1: Set up conditional NSS-SQL builds.
- Adds buildconfig option --enable-nss-sqlstore
- Prefixes NSS dbinit with either sql: or dbm: depending on config
- Pre-initializes mozStorage when NSS-SQL storage is used to prevent
  an sqlite3_config race in NSS Init
2020-04-14 13:11:05 +02:00
wolfbeast 03fda9f0f3 [devtools] Properly escape method arguments for curl. 2020-04-14 13:10:45 +02:00
wolfbeast 3aae828871 [DOM] Make sure to exit fullscreen mode if popups are opened or focused. 2020-04-14 13:10:23 +02:00
wolfbeast e7514afc7c [js] Remove pointless MakeMRegExpHoistable optimization.
It's a lot of code with no measurable effect.
2020-04-14 13:10:09 +02:00
wolfbeast 4adf0d09f7 [network] Cherry-pick various sctp lib upstream fixes. 2020-04-14 13:09:51 +02:00
wolfbeast 22d0b88e37 Issue #1355 - Make addition of cell border display items depend on
whether they should be drawn.

This reduces the size of display lists for tables by only adding display
list items that are actually going to be visibly drawn, which will help
overall performance of table drawing.
2020-04-14 13:06:54 +02:00
JustOff f7388678bd Issue #1482 - Give dynamic SSUAO rules priority over static ones 2020-04-14 13:06:30 +02:00
wolfbeast b45f5c435e Issue #1485 - Fix incorrect grid cell sizing to min/max space.
There were actually two separate logical errors in this method:

The first part is that "origSizes.isSome()" is simply a bogus
requirement for applying min/max-sizes here. I'm still keeping
the optimization of not needlessly copying the mSizes array
(as originally intended) since it's a quite common case.

The second bug is that min/max-sizes were only applied under
the "if (fr != 0.0f)" block. This is bogus since the calculated
'fr' value depends on 'aAvailableSize' which might change by
applying min/max-sizes and thus 'fr' could become non-zero in
the second round.
To fix, this patch just moves "applyMinMax" block out one level.
2020-04-14 13:06:11 +02:00
Matt A. Tobin 3c73c0805c Issue #1477 - Fix finding config.guess on builds not using MOZ_OBJDIR
* So far this seems to only affect Macintosh builds but other unix builds may be affected. Windows doesn't seem to be.
* This maintains consistency with other one-off file invocations and backwards compatibility with older comm setups
2020-04-14 13:05:58 +02:00
wolfbeast db93b005f5 Issue #1480 - Skip abspos, fixed, float and placeholders for outline. 2020-04-14 13:05:43 +02:00
JustOff d2aaa74f31 Issue #1053 - Remove no longer used function and modules from UserAgentUpdates.jsm 2020-04-14 13:05:25 +02:00
JustOff 702cf42544 Issue #1473 - Add %OS_SLICE% macro to SSUAO to refine OS info 2020-04-14 13:05:07 +02:00
wolfbeast 79a9dc2479 Minor update to UXP coding style guideline. 2020-04-14 13:04:46 +02:00
New Tobin Paradigm ddcc3deddd Update README.md 2020-04-14 13:04:19 +02:00
wolfbeast f3b148844a Issue #1474 - Prevent the cp detection from starting if preffed off.
When setting up connectivity, e.g. with new network detection, the pref
wouldn't be checked (or honored), resulting in spurious startup calls
despite being preffed off. This fixes that.

Resolves #1474
2020-04-14 13:04:05 +02:00
wolfbeast 51d5d162b7 Update UXP coding style guide JS guide. 2020-04-14 13:03:47 +02:00
wolfbeast 94494805da Update UXP coding style guide JS guide. 2020-04-14 13:03:34 +02:00
Matt A. Tobin 5c7109182c Issue #1470 - Part 3: Remove now unused update.locale
This requires changes to package-manifest in all applications
2020-04-14 13:03:21 +02:00
Matt A. Tobin 68e873ada7 Issue #1470 - Part 2: Change calls from UpdateUtils.getUpdateChannel() to UpdateUtils.UpdateChannel in telemetry modules 2020-04-14 13:03:07 +02:00
Matt A. Tobin a5b05528fe Issue #1470 - Part 1: Refactor UpdateUtils.jsm 2020-04-14 13:02:53 +02:00
wolfbeast ce88d82f4a Update UXP coding style guide with JS guide. 2020-04-14 13:02:39 +02:00
New Tobin Paradigm 61d3aa9be2 Remove exposed bug from UpdateUtils.jsm 2020-04-14 13:02:22 +02:00
Matt A. Tobin a078d9f976 Issue #1053 - Remove android-only skia-npapi 2020-04-14 13:01:51 +02:00
Matt A. Tobin 3ed2b7a7cc Issue #1053 - Remove android support from nsNSSComponent.cpp 2020-04-14 13:01:34 +02:00
Matt A. Tobin 9816a810e6 Issue #251 - Move --disable-dbm to ac configure
Also Tag #1467
2020-04-14 13:01:21 +02:00
Matt A. Tobin 9a8068ea3f Remove unused mailnews.mozbuild 2020-04-14 13:01:07 +02:00
Matt A. Tobin dcd9bbb717 Mork is not dependent on dbm and never was. 2020-04-14 13:00:55 +02:00
Matt A. Tobin ecc0a40688 Correct typo in mailnews/base/src/moz.build 2020-04-14 13:00:41 +02:00
Matt A. Tobin 8f40737fc7 Issue #1319 - Remove EARLY_BETA_OR_EARLIER condition 2020-04-14 13:00:26 +02:00
wolfbeast e7841ab5d7 Issue #1465 - Implement optional catch binding. 2020-04-14 13:00:11 +02:00
wolfbeast dba09fa5c4 Revert "Issue #1355 - Better way to create display items for column backgrounds"
This reverts commit 44c47c5038.
2020-04-14 12:59:57 +02:00
wolfbeast afe2b7fa5a Revert "Layout\reftests\table-background\reftest.list should have only additions to the end of it."
This reverts commit efdc2af8ab.
2020-04-14 12:59:43 +02:00
wolfbeast acaec3f389 [DOM] Add a null check 2020-04-14 12:59:26 +02:00
Matt A. Tobin d2083edba2 No Issue - Always build marionette until it can be tracked down and killed 2020-04-14 12:58:54 +02:00
win7-7 1ebcc1d7e5 Layout\reftests\table-background\reftest.list should have only additions to the end of it.
Layout\reftests\table-background\reftest.list should have only additions to the end of it. Revert incorrect additions.
2020-04-14 12:58:33 +02:00
win7-7 cbb61ab832 Issue #1355 - Better way to create display items for column backgrounds
Part 1: Remove current table item, as it's never set.

Part 2: Get rid of generic table painting code, and handle each class separately.

Part 4: Hoist outline skipping into col(group) frame code.

Part 5: Skip box-shadow for table column and column groups.

Part 6: Store column and column group backgrounds separately, and then append them before the rest of the table contents.

Part 7: Pass rects in display list coordinates to AppendBackgroundItemsToTop.

Part 8: Create column and column group background display items as part of the cell's BuildDisplayList.

Part 9: Used cached values instead of calling nsDisplayListBuilder::ToReferenceFrame when possible, since it can be expensive when the requested frame isn't the builder's current frame.

Part 10: Make sure we build display items for table parts where only the normal position is visible, since we may need to create background items for ancestors at that position.

Part 11: Create an AutoBuildingDisplayList when we create background items for table columns and column groups, so that we initialize the invalidation state correctly.
2020-04-14 12:58:11 +02:00
Matt A. Tobin cf288a1847 Issue #1053 - Remove android preprocessor directive from toolkit/locales/jar.mn 2020-04-14 12:57:54 +02:00
wolfbeast 0d1eea2ebf Revert #1091 Remove unboxed object code phase 1 + extras.
This should be the last code backout for this. merging this branch
should get us back to the way we were (+ additional code changes for
later changes) as fasr as the unused unboxed code is concerned.
2020-04-14 12:57:32 +02:00
wolfbeast af69cb07db Revert #1137 - Remove unboxed arrays
- accounting for removal of watch()/unwatch()
- updated for intermediate code changes.
2020-04-14 12:57:13 +02:00
wolfbeast dc4695406f Revert "Issue #1382 - Remove invalid assertion."
This reverts commit 9c6a8450b3.
2020-04-14 12:56:56 +02:00
wolfbeast c22a493144 Revert #1142 - Remove unboxed objects
- accounting for removal of watch()/unwatch()
2020-04-14 12:56:40 +02:00
Matt A. Tobin d20ca24a07 Issue #1053 - Remove android support from toolkit
Note: Does not remove support completely from toolkit/mozapps/installer or from telemetry or AppConstants.jsm
2020-04-14 12:56:02 +02:00
Matt A. Tobin b2ca17a298 Bug 1339444 - Remove unused resource://gre/modules/sqlite/sqlite_internal.js 2020-04-14 12:55:48 +02:00
Matt A. Tobin eb70e6e3d0 Issue #439 - Remove tests from toolkit/ 2020-04-14 12:55:19 +02:00
Matt A. Tobin 32ead79529 Issue #1053 - Remove android support from db 2020-04-14 12:55:00 +02:00
Matt A. Tobin 3e59235162 Issue #1053 - Remove android support from docshell 2020-04-14 12:54:47 +02:00
Matt A. Tobin 7494866cb5 Issue #1053 - Remove android support from hal 2020-04-14 12:54:30 +02:00
Matt A. Tobin 19bf63b0ee Issue #1053 - Remove android support from image 2020-04-14 12:54:15 +02:00
Matt A. Tobin 8b539ec9e7 Issue #1053 - Remove android support from intl/locale/nsLocaleService.cpp
This is the only non-icu file with android code in it. Not going to remove android in icu its self because it remains a 3rd party lib.
2020-04-14 12:54:01 +02:00
Matt A. Tobin ba0011606d Follow-up to 4e2e9be6a - Move HeapSnapshot DevTools-only Modules back to DevTools
I am so done with this.

Resolves #316
2020-04-14 12:53:46 +02:00
Matt A. Tobin ec2daa8dc9 Issue #1053 - Remove android support from memory 2020-04-14 12:53:27 +02:00
Matt A. Tobin 44c169c9be Issue #1053 - Remove android support from mfbt 2020-04-14 12:53:13 +02:00
Matt A. Tobin 57383be95d Issue #1053 - Remove android support from ipc except for ipc/chromium
This does not include android in the imported chromium code as specific research needs done on defines and logic.
2020-04-14 12:52:59 +02:00
Matt A. Tobin 6ef03f136b Issue #1053 - Remove android support from mozglue
Yes, I checked for unsaved files this time...
2020-04-14 12:52:45 +02:00
Matt A. Tobin d6bcaa6491 Issue #1053 - Remove android support from netwerk/protocol/http/nsHttpHandler.cpp 2020-04-14 12:52:32 +02:00
Matt A. Tobin 92edec6f58 Issue #1053 - Remove android support from netwerk 2020-04-14 12:52:18 +02:00
Matt A. Tobin 2dea4edfd7 Issue #1053 - Remove android support from storage/mozStorageConnection.cpp 2020-04-14 12:52:05 +02:00
Matt A. Tobin 54cb1b965e Issue #1053 - Remove android support from uriloader 2020-04-14 12:51:52 +02:00
Matt A. Tobin a6d1dd183d Issue #1053 - Remove android support from xpcom/threads/nsThread.cpp
Forgot to save..
2020-04-14 12:51:38 +02:00
Matt A. Tobin da15aa0fdf Issue #1053 - Remove android support from XPCOM 2020-04-14 12:51:25 +02:00
Matt A. Tobin 867737dd4b Remove redundant moz.build from db/ 2020-04-14 12:51:11 +02:00
Matt A. Tobin 36fc5f674e Reclassify heapsnapshot and nsJSInspector as not part of devtools
This resolves Issue #316
2020-04-14 12:50:57 +02:00
wolfbeast 7b30664f59 Set module default identification properly. 2020-04-14 12:50:42 +02:00
wolfbeast ef71f96a8d Remove gtest reference to non-existing path of removed component 2020-04-14 12:50:25 +02:00
wolfbeast 2b99226680 [gfx] Put Skia-specific CTOR init behind Skia-conditional. 2020-04-14 12:50:12 +02:00
wolfbeast 2794f0c48c Issue #316 - Make sure MOZ_DEVTOOLS_SERVER is passed down to js. 2020-04-14 12:49:36 +02:00
Matt A. Tobin 2f23073a3a Issue #1053 - Remove android support from NPAPI 2020-04-14 12:49:22 +02:00
Matt A. Tobin 496fbaf738 Issue #1053 - Remove conditional android code from widget/ 2020-04-14 12:49:08 +02:00
Matt A. Tobin 85621ee9b3 Issue #1053 - Remove Android Widget Toolkit specific files 2020-04-14 12:48:53 +02:00
Matt A. Tobin ee6595e6de Issue #439 - Remove tests from widget/ 2020-04-14 12:48:40 +02:00
wolfbeast 201be4d8fc Issue #316 - Be more gentle with the CC and nursery. 2020-04-14 12:48:23 +02:00
wolfbeast 9e586a1d0e Issue #316 - Pre-process Performance.webidl 2020-04-14 12:48:09 +02:00
wolfbeast 009c9dd2f8 Issue #316 - Make the memory GC performance object conditional (WIP)
This was only added for GCubench and likely interfering with building
without devtools-server.
2020-04-14 12:47:56 +02:00
Matt A. Tobin 6407f1abd4 Issue #1457 - Unfold sqlite3 from nss 2020-04-14 12:47:38 +02:00
wolfbeast 28f0155307 Issue #1383 - Remove "Copy raw data to clipboard" button
This resolves #1383
2020-04-14 12:47:23 +02:00
JustOff 11ede87242 Issue #1445 - Add a link to details on using Firefox extensions in Pale Moon 2020-04-14 12:47:05 +02:00
Matt A. Tobin 3630fec559 Issue #1454 - Add MOZ_PKG_SPECIAL to UpdateUtils 2020-04-14 12:46:46 +02:00
JustOff d062e7311c Issue #1445 - strings cleanup 2020-04-14 12:46:29 +02:00
wolfbeast 0313ac74fd Issue #1445 - remove redundant nativeIndicator
This resolves #1445
2020-04-14 12:46:14 +02:00
Matt A. Tobin 9612c64265 Issue #1320 - Stop appending cpu arch to the end of %BUILD_TARGET% on Windows in UpdateUtils.jsm 2020-04-14 12:45:59 +02:00
wolfbeast c5d570792d Issue #1445 - Use the detailed string also in the list entries. 2020-04-14 12:45:44 +02:00
wolfbeast 10c4e73e56 Issue #1446 - Only match extension add-on types for target applications.
This resolves #1446
2020-04-14 12:45:31 +02:00
win7-7 c9fd86cb78 Issue #1355 - Make nsTableCellFrame::GetColIndex/GetRowIndex faster
We can devirtualize it, remove some branches.
2020-04-14 12:45:15 +02:00
wolfbeast 550d634ff5 Issue #1446 - Only allow extension add-on types for Firefox compat mode. 2020-04-14 12:44:56 +02:00
wolfbeast bbee80fa1c Issue #1445 - Clarify the status of extensions in the Add-On manager
This resolves #1445.
2020-04-14 12:44:41 +02:00
wolfbeast 8ffe533b3d [CSS] Only emit non-GC chrome wrapped XUL box warnings in debug builds. 2020-04-14 12:44:16 +02:00
wolfbeast 9670bdb685 Issue #1441 - Guard appomni/greomni with UXP_CUSTOM_OMNI env var.
This adds an addition to the environment set up for child processes
(plugin container) so that it may still be able to pass the omni
parameters there as-needed.
2020-04-14 12:44:02 +02:00
wolfbeast 8fa80e2c8d Revert "Issue #1441 - Guard appomni/greomni with UXP_CUSTOM_OMNI env var."
This reverts commit 2bdbca39b2.
2020-04-14 12:43:49 +02:00
Simon Giesecke a377d1ecd4 [IndexedDB] Ensure that strong references to newly created cursors are
kept until the DOM Binding is created.

This fixes random crashes on websites that use IndexedDB cursors.
See also BZ bug 1599420
2020-04-14 12:43:34 +02:00
Henri Sivonen 1ebbb0af03 [Parser] Move setting context to null to the correct location. 2020-04-14 12:43:22 +02:00
wolfbeast 29b13d3523 Issue #1441 - Guard appomni/greomni with UXP_CUSTOM_OMNI env var. 2020-04-14 12:43:06 +02:00
sotaro 76476ed75b [Layers] Clear WrappingTextureSourceYCbCrBasic::mTexture correctly 2020-04-14 12:42:53 +02:00
wolfbeast 84fc500ff2 [Network] Bump http channel default Firefox CompatMode init value. 2020-04-14 12:42:38 +02:00
wolfbeast 2560dd2514 Fix a whitespace issue in nsComputedDOMStyle.cpp 2020-04-14 12:42:23 +02:00
wolfbeast 0e2b0db4d7 [CSS] Add stub for font-variation-settings
This stub is added because websites insist on considering this
very hardware-dependent and O.S.-variable low-level font-control
as a "critical feature" which it isn't as there is 0 guarantee
that font variation settings are supported or honored by any
operating system used by the client.

On top this is a WD status feature that sites shouldn't be using, and
the feature itself is strongly discouraged for use in favor of standard
CSS font manipulation keywords like `font-weight`.
2020-04-14 12:42:10 +02:00
wolfbeast c4f65de9b2 [CSP] Allow not having a Port for RessourceURI if the Scheme has no
Default Port
2020-04-14 12:41:57 +02:00
Matt A. Tobin e3148b0a25 Issue #65 - Correct nsHelperAppDlg.js for bad preprocessing conversion 2020-04-14 12:41:44 +02:00
Matt A. Tobin fe6730c219 Issue #80 - Stop building non-generated dom/binding files as UNIFIED_SOURCES
Also fix deprot
2020-04-14 12:41:31 +02:00
Matt A. Tobin 2e44ddb15e Directly assign PrimitiveConversions.h to the generated binding of KeyframeAnimationOptions.
This is a hack to deal UnifiedBindings trying to deal with an incomplete codegen implementation so it was worked around with a hack back in Firefox 30-something. If we have anymore of this non-sense crop up as stuff is added or removed from DOM then extend this conditional.

Least until something better comes along.
2020-04-14 12:41:12 +02:00
win7-7 da74d1f3f3 Issue #1355 - Do less work for columns not in the desired set in PaintRowGroupBackgroundByColIdx
Do less work in PaintRowGroupBackgroundByColIdx for cells that are not in our desired set of columns.

crash fix:

Guard against empty column groups when building a display list for a table.
2020-04-14 12:40:47 +02:00
Matt A. Tobin 91be118376 Issue #65 - Don't split in the middle of assignment statements in createProfileWizard.js 2020-04-14 12:40:06 +02:00
Matt A. Tobin 2258e09d59 Issue #65 - Correct fallthough case in profileSelection.js 2020-04-14 12:39:51 +02:00
Matt A. Tobin 30ec922d7e Issue #65 - Remove AppConstants from toolkit/components/passwordmgr 2020-04-14 12:39:35 +02:00
Matt A. Tobin 1000488a5b Issue #65 - Remove AppConstants from toolkit/components/alerts 2020-04-14 12:39:21 +02:00
Matt A. Tobin ffe75592e3 Issue #65 - Remove AppConstants from toolkit/components/places 2020-04-14 12:39:08 +02:00
Matt A. Tobin 0084e71953 Issue #65 - Remove AppConstants from toolkit/components/apppicker 2020-04-14 12:38:54 +02:00
Matt A. Tobin dbeceecde2 Issue #65 - Remove AppConstants from toolkit/components/thumbnails 2020-04-14 12:38:41 +02:00
Matt A. Tobin 9fc28c55c3 Issue #65 - Remove AppConstants from toolkit/components/printing 2020-04-14 12:38:27 +02:00
Matt A. Tobin 113a825c1f Issue #65 - Remove AppConstants from toolkit/components/satchel 2020-04-14 12:38:14 +02:00
Matt A. Tobin 419abfb09f Issue #65 - Remove AppConstants from toolkit/components/jsdownloads 2020-04-14 12:37:58 +02:00
Matt A. Tobin 4e58dab0a1 Issue #65 - Remove AppConstants from toolkit/mozapps/downloads 2020-04-14 12:37:44 +02:00
Matt A. Tobin 9e42d9ea2f Issue #65 - Remove AppConstants from toolkit/mozapps/extensions 2020-04-14 12:37:29 +02:00
Matt A. Tobin 377f54f3fe Issue #65 - Remove AppConstants from toolkit/mozapps/update 2020-04-14 12:37:16 +02:00
Matt A. Tobin 62f39d829d Issue #65 - Remove AppConstants from toolkit/profile 2020-04-14 12:37:02 +02:00
win7-7 28971524e4 fix whitespace
fix whitespace.
2020-04-14 12:36:29 +02:00
win7-7 be37269123 Issue #1386 - Devirtualize GetRowSpan/GetColSpan
It's at ~1.5% on the perf log for the Netflix use case, which seems a bit too much.
2020-04-14 12:36:12 +02:00
Matt A. Tobin 8acff5cdbe Issue #1395 - Part 2: Remove the rest of FlyWeb 2020-04-14 12:35:06 +02:00
Matt A. Tobin 11a4ab0982 Issue #1395 - Remove FlyWeb Service 2020-04-14 12:31:31 +02:00
Matt A. Tobin 8c41fcd240 Issue #1390 - Get rid of the Presentation API 2020-04-14 12:31:16 +02:00
Matt A. Tobin 27f4e60be8 Issue #1390 - Remove secondscreen modules from toolkit 2020-04-14 12:31:03 +02:00
wolfbeast aae1baabe9 [AM] Remove shared theme leftovers for webextensions 2020-04-14 12:30:49 +02:00
Matt A. Tobin f620afc446 Issue #1392 - Change --enable-eme to MOZ_ARG_ENABLE_BOOL and remove MOZ_EME_MODULES 2020-04-14 12:30:34 +02:00
Moonchild 456f4a5891 Update UXP Coding Style.md
Be more explicit about paranthesis spacing
2020-04-14 12:30:16 +02:00
Moonchild 84d99e2996 Update UXP Coding Style.md
Minor typo
2020-04-14 12:30:03 +02:00
wolfbeast e29301f5d0 Issue #26 - Part 2c: Remove dependence on gmp/widevine-adapter/* 2020-04-14 12:29:44 +02:00
wolfbeast 369ad75fc8 Issue #26 - Part 2b: Stub out GMPDecryptorProxy functions.
If EME isn't built, these functions would have no use and the callback
structures are unavailable. Stubbing these out will still allow the
callers to work unchanged, but in effect simply always return without
dispatching a promised task.
This fixes the dependency issue from part 2a.
2020-04-14 12:29:29 +02:00
wolfbeast 37e3135bc5 Issue #26 Part 2a: make more EME code conditional.
- Exclude missed MediaKey functions and CDMProxy code.
- Exclude EME APIs frm being built (webidl change)
- Fix tests in --disable-eme state
2020-04-14 12:29:16 +02:00
wolfbeast 259bd2e977 [Installer] Updated the 7-zip stub binary to make sure it doesn't hang
on older versions of Windows but instead provides a usable error message
2020-04-14 12:28:34 +02:00
win7-7 0ebdc99757 Issue #1384 - Match standard for colSpan/rowSpan
HTML standardizes proper behavior of colSpan and rowSpan:

The main thing is that getting the .rowSpan and .colSpan IDL properties will now return the actual clamped value that we use.
2020-04-14 12:28:14 +02:00
wolfbeast 68d3bc54fb Issue #1382 - Remove invalid assertion.
There is flexibility in exactly the value the initialized length must
hold, i.e. if an array is completely empty, it is valid for the
initialized length to be any value between zero and the length of the
array, as long as the in-memory values below the initialized length have
been initialized with a hole value.
In the case of 0, the array is packed and the move operation would be a
nop, so simply convert the assert to a condition to save some cycles.
2020-04-14 12:28:00 +02:00
win7-7 2109f36dd4 Issue #1355 - Hit testing in large tables has become extremely slow
Add dirty rect intersection checks so that we don't build unnecessary table part display items.
2020-04-14 12:27:45 +02:00
wolfbeast 58f10adc97 Revert "Issue #1355 - Hit testing in large tables has become extremely slow"
This reverts commit f7b2f0a665.
2020-04-14 12:27:31 +02:00
win7-7 05c68a17a0 Issue #1355 - Hit testing in large tables has become extremely slow
Add dirty rect intersection checks so that we don't build unnecessary table part display items.
2020-04-14 12:27:14 +02:00
New Tobin Paradigm f78958a020 Fix preprocessor directive in UserAgentUpdates.jsm 2020-04-14 12:26:58 +02:00
wolfbeast bcd6c96aec Issue #1378 - Follow-up: make sure background items remain table-aligned. 2020-04-14 12:26:44 +02:00
Matt A. Tobin 73289f5389 Issue #65 - Remove AppConstants from toolkit/modules
Except for secondscreen
2020-04-14 12:26:25 +02:00
Matt A. Tobin 4acc0d58cb Issue #65 - Remove AppConstants from toolkit/content 2020-04-14 12:26:11 +02:00
Matt A. Tobin a1c9dd468d Issue #65 - Remove AppConstants from netwerk/ 2020-04-14 12:25:58 +02:00
Matt A. Tobin 0a5acb852a Issue #65 - Remove AppConstants from mailnews/ 2020-04-14 12:25:45 +02:00
Matt A. Tobin c8bbebe59d Issue #65 - Remove AppConstants from dom/ 2020-04-14 12:25:32 +02:00
wolfbeast fddc35e438 Issue #1378 - Align the drawing of table cell backgrounds with the spec. 2020-04-14 12:22:44 +02:00
Matt A. Tobin 7e4efa4e1f Issue #1377 - Fix porting typo in mailnews/base/search/content/searchWidgets.xml
MailNews Core being historically comm tended to avoid defining shorthand for Components.interfaces
2020-04-14 12:21:51 +02:00
wolfbeast 84b5515a8d Issue #447 - Update HSTS preload list & reduce debug spew
Commented out spewing dump() statements in loops. With the ever growing
HSTS list it takes too much time and is pointless to display.
2020-04-14 12:21:27 +02:00
wolfbeast 6b7fa183dd Issue #1342 - Remove support for system libvpx 2020-04-14 12:21:10 +02:00
wolfbeast a43d59bcbf Issue #1342 - Remove support for system sqlite 2020-04-14 12:20:23 +02:00
wolfbeast ac6896b599 Issue #1342 - Update old.configure for removed build options 2020-04-14 12:20:08 +02:00
wolfbeast 171053d0b2 Issue #1342 - Remove support for system linbpng 2020-04-14 12:19:55 +02:00
win7-7 efd88ee999 Issue #1355 - Speed up the traversal of a table row frame's child cells
Speed up getting the first cellframe in a row and the next cellframe after the given one
2020-04-14 12:19:39 +02:00
wolfbeast 9a74d53315 Issue #1342 - Remove support for system NSPR/NSS 2020-04-14 12:18:35 +02:00
wolfbeast e2a478072a Issue #1342 - Remove support for system ICU 2020-04-14 12:18:21 +02:00
wolfbeast cb06cac81d [WebRequest] Remove AddonManagerPermissions leftovers
This was added as part of the WebExtension sec issue CVE-2017-5389.
Since we no longer have this interface, it needed to be removed to
prevent errors in the WebRequest channel callback.
2020-04-14 12:17:58 +02:00
athenian200 c3d92cd338 Issue #1356 - Add tests.
Forgot to include these before.
2020-04-14 12:17:34 +02:00
athenian200 8ae2267eac Issue #1356 - Restore older syntax.
Some newer Firefox syntax snuck into my last bug. Just to be on the safe side I'm restoring the older syntax here.
2020-04-14 12:16:48 +02:00
athenian200 563dc95cdb Issue #1356 - Remove -moz-user-input disabled to improve event handling. 2020-04-14 12:16:31 +02:00
wolfbeast 7e59ac9036 Issue #1360 - Enable acceleration by default on all known-good platforms. 2020-04-14 12:15:53 +02:00
wolfbeast f1e40aaa5b Issue #1360 - Part 2: Update tests for changed preferences. 2020-04-14 12:14:27 +02:00
wolfbeast 068372c618 Issue #1360 - Part 1: Simplify layers acceleration prefs.
This gets rid of platform-dependent hard-coded defaults, but keeps
build-time blocking if there is no GL provider (in which case layers
acceleration almost certainly won't work because it needs a GL
compositor and would likely crash without)

New prefs are
- layers.acceleration.enabled to enable HWA
- layers.acceleration.force to force it enabled (requires .enabled to be
  set as well)

This is the platform part of this issue. The rest will be front-end work
(Preference UI integration and pref migration)
2020-04-14 12:14:11 +02:00
25342 changed files with 408816 additions and 1531739 deletions

No files matched your search

-22
View File
@@ -187,28 +187,6 @@ devtools/client/framework/test/code_ugly*
devtools/server/tests/unit/babel_and_browserify_script_with_source_map.js
devtools/server/tests/unit/setBreakpoint*
# mobile/android/ exclusions
mobile/android/tests/
# Uses `#filter substitution`
mobile/android/b2gdroid/app/b2gdroid.js
mobile/android/app/mobile.js
mobile/android/chrome/content/healthreport-prefs.js
# Uses `#expand`
mobile/android/chrome/content/about.js
# Not much JS to lint and non-standard at that
mobile/android/installer/
mobile/android/locales/
# Non-standard `(catch ex if ...)`
mobile/android/chrome/content/browser.js
mobile/android/components/Snippets.js
# Bug 1178739: Ignore this file as a quick fix for "Illegal yield expression"
mobile/android/modules/HomeProvider.jsm
# services/ exclusions
# Uses `#filter substitution`
-3
View File
@@ -91,9 +91,6 @@ GPATH
# Git clone directory for updating web-platform-tests
testing/web-platform/sync/
# Android Gradle artifacts.
mobile/android/gradle/.gradle
# XCode project cruft
embedding/ios/GoannaEmbed/GoannaEmbed.xcodeproj/project.xcworkspace/xcuserdata
embedding/ios/GoannaEmbed/GoannaEmbed.xcodeproj/xcuserdata
+1 -1
View File
@@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
Clobber for CSS flow-root implementation
Clobber for NSS update
+5 -26
View File
@@ -64,9 +64,7 @@ this.AccessFu = { // jshint ignore:line
if (this._enabled) {
this._disable();
}
if (Utils.MozBuildApp === 'mobile/android') {
Services.obs.removeObserver(this, 'Accessibility:Settings');
} else if (Utils.win.navigator.mozSettings) {
if (Utils.win.navigator.mozSettings) {
Utils.win.navigator.mozSettings.removeObserver(
SCREENREADER_SETTING, this.handleEvent);
}
@@ -585,11 +583,7 @@ var Output = {
get androidBridge() {
delete this.androidBridge;
if (Utils.MozBuildApp === 'mobile/android') {
this.androidBridge = Services.androidBridge;
} else {
this.androidBridge = null;
}
this.androidBridge = null;
return this.androidBridge;
},
@@ -815,12 +809,6 @@ var Input = {
target.blur();
}
}
if (Utils.MozBuildApp == 'mobile/android') {
// Return focus to native Android browser chrome.
Services.androidBridge.handleGeckoMessage(
{ type: 'ToggleChrome:Focus' });
}
break;
case aEvent.DOM_VK_RETURN:
if (this.editState.editing) {
@@ -837,18 +825,9 @@ var Input = {
},
moveToPoint: function moveToPoint(aRule, aX, aY) {
// XXX: Bug 1013408 - There is no alignment between the chrome window's
// viewport size and the content viewport size in Android. This makes
// sending mouse events beyond its bounds impossible.
if (Utils.MozBuildApp === 'mobile/android') {
let mm = Utils.getMessageManager(Utils.CurrentBrowser);
mm.sendAsyncMessage('AccessFu:MoveToPoint',
{rule: aRule, x: aX, y: aY, origin: 'top'});
} else {
let win = Utils.win;
Utils.winUtils.sendMouseEvent('mousemove',
aX - win.mozInnerScreenX, aY - win.mozInnerScreenY, 0, 0, 0);
}
let win = Utils.win;
Utils.winUtils.sendMouseEvent('mousemove',
aX - win.mozInnerScreenX, aY - win.mozInnerScreenY, 0, 0, 0);
},
moveCursor: function moveCursor(aAction, aRule, aInputType, aAdjustRange) {
+1 -3
View File
@@ -76,8 +76,6 @@ const EDGE = 0.1;
const TIMEOUT_MULTIPLIER = 1;
// A single pointer down/up sequence periodically precedes the tripple swipe
// gesture on Android. This delay acounts for that.
const IS_ANDROID = Utils.MozBuildApp === 'mobile/android' &&
Utils.AndroidSdkVersion >= 14;
/**
* A point object containing distance travelled data.
@@ -206,7 +204,7 @@ this.GestureTracker = { // jshint ignore:line
if (aDetail.type !== 'pointerdown') {
return;
}
let GestureConstructor = aGesture || (IS_ANDROID ? DoubleTap : Tap);
let GestureConstructor = aGesture || Tap;
this._create(GestureConstructor);
this._update(aDetail, aTimeStamp);
},
-1
View File
@@ -680,7 +680,6 @@ this.Presentation = { // jshint ignore:line
get presenters() {
delete this.presenters;
let presenterMap = {
'mobile/android': [VisualPresenter, AndroidPresenter],
'b2g': [VisualPresenter, B2GPresenter],
'browser': [VisualPresenter, B2GPresenter, AndroidPresenter]
};
+1 -3
View File
@@ -33,9 +33,7 @@ this.Utils = { // jshint ignore:line
_buildAppMap: {
'{3c2e2abc-06d4-11e1-ac3b-374f68613e61}': 'b2g',
'{d1bfe7d9-c01e-4237-998b-7b5f960a4314}': 'graphene',
'{ec8030f7-c20a-464f-9b0e-13a3a9e97384}': 'browser',
'{aa3c5121-dab2-40e2-81ca-7ea25febc110}': 'mobile/android',
'{a23983c0-fd0e-11dc-95ff-0800200c9a66}': 'mobile/xul'
'{ec8030f7-c20a-464f-9b0e-13a3a9e97384}': 'browser'
},
init: function Utils_init(aWindow) {
@@ -67,7 +67,7 @@
* Change scrollbar styles from hidden to auto. That makes us to create an
* accessible for scroll area.
*/
function changeScrollbarStyles(aContainerID, aScrollAreaID)
function changeScrollStyles(aContainerID, aScrollAreaID)
{
this.container = getAccessible(aContainerID);
this.scrollAreaNode = getNode(aScrollAreaID);
@@ -77,7 +77,7 @@
new invokerChecker(EVENT_REORDER, this.container)
];
this.invoke = function changeScrollbarStyles_invoke()
this.invoke = function changeScrollStyles_invoke()
{
var accTree =
{ SECTION: [] };
@@ -86,7 +86,7 @@
this.scrollAreaNode.style.overflow = "auto";
}
this.finalCheck = function changeScrollbarStyles_finalCheck()
this.finalCheck = function changeScrollStyles_finalCheck()
{
var accTree =
{ SECTION: [ // container
@@ -95,7 +95,7 @@
testAccessibleTree(this.container, accTree);
}
this.getID = function changeScrollbarStyles_getID()
this.getID = function changeScrollStyles_getID()
{
return "change scrollbar styles " + prettyName(aScrollAreaID);
}
@@ -114,7 +114,7 @@
gQueue = new eventQueue();
gQueue.push(new changeScrollRange("container", "scrollarea"));
gQueue.push(new changeScrollbarStyles("container2", "scrollarea2"));
gQueue.push(new changeScrollStyles("container2", "scrollarea2"));
gQueue.invoke(); // Will call SimpleTest.finish();
}
-6
View File
@@ -210,12 +210,6 @@ fi
AC_DEFUN([MOZ_ANDROID_INSTALL_TRACKING],
[
if test -n "$MOZ_INSTALL_TRACKING"; then
AC_SUBST(MOZ_INSTALL_TRACKING)
MOZ_ANDROID_AAR(play-services-ads, $ANDROID_GOOGLE_PLAY_SERVICES_VERSION, google, com/google/android/gms)
MOZ_ANDROID_AAR(play-services-basement, $ANDROID_GOOGLE_PLAY_SERVICES_VERSION, google, com/google/android/gms)
fi
])
dnl Configure an Android SDK.
+5
View File
@@ -63,6 +63,11 @@ def GeckoBinary(linkage='dependent', msvcrt='dynamic', mozglue=None):
LDFLAGS += ['-rdynamic']
if CONFIG['MOZ_MEMORY']:
USE_LIBS += ['memory']
if CONFIG['OS_ARCH'] == 'FreeBSD':
# Make sure this function is linked in, so that it is
# executed at executable load (it has the 'constructor'
# flag).
LDFLAGS += ['-u', 'jemalloc_FreeBSD_init']
elif mozglue == 'library':
LIBRARY_DEFINES['MOZ_HAS_MOZGLUE'] = True
if not CONFIG['MOZ_GLUE_IN_PROGRAM']:
-4
View File
@@ -90,9 +90,6 @@ SEARCH_PATHS = [
'testing/mozbase/manifestparser',
'testing/taskcluster',
'testing/tools/autotry',
'testing/web-platform',
'testing/web-platform/harness',
'testing/web-platform/tests/tools/wptserve',
'testing/xpcshell',
'xpcom/idl-parser',
]
@@ -121,7 +118,6 @@ MACH_MODULES = [
'testing/mochitest/mach_commands.py',
'testing/mozharness/mach_commands.py',
'testing/talos/mach_commands.py',
'testing/web-platform/mach_commands.py',
'testing/xpcshell/mach_commands.py',
'tools/docs/mach_commands.py',
'tools/lint/mach_commands.py',
-4
View File
@@ -36,10 +36,6 @@ def keyfile(desc, help=None, callback=lambda x: x):
def simple_keyfile(desc):
value = keyfile(desc)
set_config('MOZ_%s_KEY' % desc.upper().replace(' ', '_'), value)
# Only really required for MOZ_ADJUST_SDK_KEY currently still used in
# old-configure.
add_old_configure_assignment('MOZ_%s_KEY' % desc.upper().replace(' ', '_'),
value)
@template
+1
View File
@@ -226,6 +226,7 @@ def old_configure_options(*options):
'--enable-safe-browsing',
'--enable-sandbox',
'--enable-security-sqlstore',
'--enable-shared-media',
'--enable-signmar',
'--enable-simulator',
'--enable-small-chunk-size',
+2
View File
@@ -79,6 +79,7 @@ included_inclnames_to_ignore = set([
'prtypes.h', # NSPR
'selfhosted.out.h', # generated in $OBJDIR
'shellmoduleloader.out.h', # generated in $OBJDIR
'unicode/plurrule.h', # ICU
'unicode/timezone.h', # ICU
'unicode/ucal.h', # ICU
'unicode/uclean.h', # ICU
@@ -90,6 +91,7 @@ included_inclnames_to_ignore = set([
'unicode/unorm.h', # ICU
'unicode/unum.h', # ICU
'unicode/unumsys.h', # ICU
'unicode/upluralrules.h', # ICU
'unicode/ustring.h', # ICU
'unicode/utypes.h', # ICU
'vtune/VTuneWrapper.h' # VTune
Binary file not shown.
+8
View File
@@ -32,6 +32,14 @@
# define moz_dont_include_mozalloc_for_cstdlib
#endif
#ifndef moz_dont_include_mozalloc_for_type_traits
# define moz_dont_include_mozalloc_for_type_traits
#endif
#ifndef moz_dont_include_mozalloc_for_limits
# define moz_dont_include_mozalloc_for_limits
#endif
// Include mozalloc after the STL header and all other headers it includes
// have been preprocessed.
#if !defined(MOZ_INCLUDE_MOZALLOC_H) && \
+1 -1
View File
@@ -10,4 +10,4 @@
# hardcoded milestones in the tree from these two files.
#--------------------------------------------------------
4.7.0
4.8.0
+3
View File
@@ -28,6 +28,9 @@ if CONFIG['HOST_OS_ARCH'] != 'WINNT':
# while the program here is in C.
HostProgram('nsinstall_real', c_only=True)
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
DEFINES['GKMEDIAS_SHARED_LIBRARY'] = True
PYTHON_UNIT_TESTS += [
'tests/test_mozbuild_reading.py',
'tests/unit-expandlibs.py',
+16
View File
@@ -1287,6 +1287,22 @@ QtSparql/qsparqlresult.h
#if MOZ_TREE_PIXMAN!=1
pixman.h
#endif
#ifdef GKMEDIAS_SHARED_LIBRARY
vpx/vpx_codec.h
vpx/vpx_decoder.h
vpx/vpx_encoder.h
vpx/vp8cx.h
vpx/vp8dx.h
vpx_mem/vpx_mem.h
vorbis/codec.h
theora/theoradec.h
tremor/ivorbiscodec.h
speex/speex_resampler.h
ogg/ogg.h
ogg/os_types.h
nestegg/nestegg.h
cubeb/cubeb.h
#endif
gst/gst.h
gst/app/gstappsink.h
gst/app/gstappsrc.h
+1 -1
View File
@@ -94,7 +94,7 @@ exports.menuitems = [
},
key: {
id: "browserToolbox",
modifiers: isMac ? "accel,alt" : "accel,shift",
modifiers: "accel,alt,shift",
keytext: true
}
},
@@ -3038,6 +3038,7 @@ exports.CSS_PROPERTIES = {
"scroll-snap-points-y",
"scroll-snap-type-x",
"scroll-snap-type-y",
"scrollbar-width",
"shape-outside",
"shape-rendering",
"-moz-stack-sizing",
+50 -1
View File
@@ -820,6 +820,8 @@ nsDocShell::nsDocShell()
, mParentCharsetSource(0)
, mJSRunToCompletionDepth(0)
, mTouchEventsOverride(nsIDocShell::TOUCHEVENTS_OVERRIDE_NONE)
, mStateFloodGuardCount(0)
, mStateFloodGuardReported(false)
{
AssertOriginAttributesMatchPrivateBrowsing();
mHistoryID = ++gDocshellIDCounter;
@@ -5447,11 +5449,19 @@ nsDocShell::Stop(uint32_t aStopFlags)
}
if (nsIWebNavigation::STOP_CONTENT & aStopFlags) {
// Stop the document loading
// Stop the document loading and animations
if (mContentViewer) {
nsCOMPtr<nsIContentViewer> cv = mContentViewer;
cv->Stop();
}
} else if (nsIWebNavigation::STOP_NETWORK & aStopFlags) {
// Stop the document loading only
if (mContentViewer) {
RefPtr<nsIDocument> doc = mContentViewer->GetDocument();
if (doc) {
doc->StopDocumentLoad();
}
}
}
if (nsIWebNavigation::STOP_NETWORK & aStopFlags) {
@@ -11833,6 +11843,27 @@ nsDocShell::SetReferrerPolicy(uint32_t aReferrerPolicy)
// nsDocShell: Session History
//*****************************************************************************
bool
nsDocShell::IsStateChangeFlooding()
{
// Issue #1688: Let's copy Firefox's strategy for state flooding here, so
// that our implementations are interoperable.
if (mStateFloodGuardCount > kStateUpdateLimit) {
TimeStamp now = TimeStamp::Now();
if (now - mStateFloodGuardUpdated > TimeDuration::FromSeconds(kRefreshTimeSecs)) {
mStateFloodGuardCount = 0;
mStateFloodGuardUpdated = now;
mStateFloodGuardReported = false;
return false;
}
return true;
}
mStateFloodGuardCount++;
return false;
}
NS_IMETHODIMP
nsDocShell::AddState(JS::Handle<JS::Value> aData, const nsAString& aTitle,
const nsAString& aURL, bool aReplace, JSContext* aCx)
@@ -11897,6 +11928,24 @@ nsDocShell::AddState(JS::Handle<JS::Value> aData, const nsAString& aTitle,
nsCOMPtr<nsIDocument> document = GetDocument();
NS_ENSURE_TRUE(document, NS_ERROR_FAILURE);
// If we're being flooded with state change requests, we should abort early
// from the state change logic.
if (IsStateChangeFlooding()) {
// Report a warning to the console to tell developers why their navigations
// failed.
// Do this only if not yet marked reported so we only report it once per
// flood interval.
if (!mStateFloodGuardReported) {
nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
NS_LITERAL_CSTRING("PushState"),
document,
nsContentUtils::eDOM_PROPERTIES,
"PushStateFloodingPrevented");
mStateFloodGuardReported = true;
}
return NS_OK;
}
// Step A: Serialize aData using structured clone.
// https://html.spec.whatwg.org/multipage/history.html#dom-history-pushstate
// step 5.
+13
View File
@@ -1049,6 +1049,15 @@ private:
// as constants in the nsIDocShell.idl file.
uint32_t mTouchEventsOverride;
// Keep track how how many history state changes we're getting, to catch &
// prevent flooding.
int32_t mStateFloodGuardCount;
mozilla::TimeStamp mStateFloodGuardUpdated;
bool mStateFloodGuardReported;
// We have a limit of pushing 50 states to history every 10 seconds.
const int32_t kStateUpdateLimit = 50;
const double kRefreshTimeSecs = 10.0;
// Separate function to do the actual name (i.e. not _top, _self etc.)
// searching for FindItemWithName.
nsresult DoFindItemWithName(const nsAString& aName,
@@ -1064,6 +1073,10 @@ private:
void MaybeNotifyKeywordSearchLoading(const nsString& aProvider,
const nsString& aKeyword);
// Helper method for AddState which checks for excessive calls to PushState or
// ReplaceState.
bool IsStateChangeFlooding();
#ifdef DEBUG
// We're counting the number of |nsDocShells| to help find leaks
static unsigned long gNumberOfDocShells;
+3 -2
View File
@@ -10,6 +10,7 @@
#include "mozilla/dom/AnimationEffectTiming.h"
#include "mozilla/dom/KeyframeEffectBinding.h"
#include "mozilla/KeyframeUtils.h"
#include "mozilla/Preferences.h"
#include "nsContentUtils.h"
#include "nsDOMMutationObserver.h" // For nsAutoAnimationMutationBatch
#include "nsIScriptError.h"
@@ -135,9 +136,9 @@ void
KeyframeEffect::SetIterationComposite(
const IterationCompositeOperation& aIterationComposite)
{
// Ignore iterationComposite if the Web Animations API is not enabled,
// Ignore iterationComposite if the API is not enabled,
// then the default value 'Replace' will be used.
if (!AnimationUtils::IsCoreAPIEnabledForCaller()) {
if (!Preferences::GetBool("dom.animations-api.compositing.enabled")) {
return;
}
+1 -1
View File
@@ -1089,7 +1089,7 @@ KeyframeEffectReadOnly::CanThrottleTransformChanges(nsIFrame& aFrame) const
return true;
}
ScrollbarStyles ss = scrollable->GetScrollbarStyles();
ScrollStyles ss = scrollable->GetScrollStyles();
if (ss.mVertical == NS_STYLE_OVERFLOW_HIDDEN &&
ss.mHorizontal == NS_STYLE_OVERFLOW_HIDDEN &&
scrollable->GetLogicalScrollPosition() == nsPoint(0, 0)) {
+20 -10
View File
@@ -7,6 +7,7 @@
#include "mozilla/AnimationUtils.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/Move.h"
#include "mozilla/Preferences.h"
#include "mozilla/RangedArray.h"
#include "mozilla/ServoBindings.h"
#include "mozilla/StyleAnimationValue.h"
@@ -21,6 +22,7 @@
#include "nsCSSPropertyIDSet.h"
#include "nsCSSProps.h"
#include "nsCSSPseudoElements.h" // For CSSPseudoElementType
#include "nsDocument.h"
#include "nsTArray.h"
#include <algorithm> // For std::stable_sort
@@ -400,7 +402,7 @@ GetKeyframeListFromPropertyIndexedKeyframe(JSContext* aCx,
ErrorResult& aRv);
static bool
RequiresAdditiveAnimation(const nsTArray<Keyframe>& aKeyframes,
HasImplicitKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
nsIDocument* aDocument);
static void
@@ -467,11 +469,13 @@ KeyframeUtils::GetKeyframesFromObject(JSContext* aCx,
// says that if you don't have a keyframe at offset 0 or 1, then you should
// synthesize one using an additive zero value when you go to compose style.
// Until we implement additive animations we just throw if we encounter any
// set of keyframes that would put us in that situation.
// set of keyframes that would put us in that situation and keyframes aren't
// explicitly force-enabled.
if (RequiresAdditiveAnimation(keyframes, aDocument)) {
aRv.Throw(NS_ERROR_DOM_ANIM_MISSING_PROPS_ERR);
if (!nsDocument::AreWebAnimationsImplicitKeyframesEnabled(aCx, nullptr) &&
HasImplicitKeyframeValues(keyframes, aDocument)) {
keyframes.Clear();
aRv.Throw(NS_ERROR_DOM_ANIM_MISSING_PROPS_ERR);
}
return keyframes;
@@ -1330,10 +1334,16 @@ GetKeyframeListFromPropertyIndexedKeyframe(JSContext* aCx,
// No animation values for this property.
continue;
}
if (count == 1) {
// We don't support additive values and so can't support an
// animation that goes from the underlying value to this
// specified value. Throw an exception until we do support this.
if (!Preferences::GetBool("dom.animations-api.implicit-keyframes.enabled") &&
count == 1) {
// We don't support implicit keyframes by preference.
aRv.Throw(NS_ERROR_DOM_ANIM_MISSING_PROPS_ERR);
return;
} else if (count == 1) {
// Implicit keyframes isn't implemented yet and so we can't
// support an animation that goes from the underlying value
// to this specified value.
// Throw an exception until we do support this.
aRv.Throw(NS_ERROR_DOM_ANIM_MISSING_PROPS_ERR);
return;
}
@@ -1374,7 +1384,7 @@ GetKeyframeListFromPropertyIndexedKeyframe(JSContext* aCx,
* try to detect where we have an invalid value at 0%/100%.
*/
static bool
RequiresAdditiveAnimation(const nsTArray<Keyframe>& aKeyframes,
HasImplicitKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
nsIDocument* aDocument)
{
// We are looking to see if that every property referenced in |aKeyframes|
@@ -1385,7 +1395,7 @@ RequiresAdditiveAnimation(const nsTArray<Keyframe>& aKeyframes,
// a document which we might not always have at the point where we want to
// perform this check.
//
// This is only a temporary measure until we implement additive animation.
// This is only a temporary measure until we implement implicit keyframes.
// So as long as this check catches most cases, and we don't do anything
// horrible in one of the cases we can't detect, it should be sufficient.
@@ -1,13 +1,13 @@
pref(dom.animations-api.core.enabled,true) load 1239889-1.html
pref(dom.animations-api.core.enabled,true) load 1244595-1.html
pref(dom.animations-api.core.enabled,true) load 1216842-1.html
pref(dom.animations-api.core.enabled,true) load 1216842-2.html
pref(dom.animations-api.core.enabled,true) load 1216842-3.html
pref(dom.animations-api.core.enabled,true) load 1216842-4.html
pref(dom.animations-api.core.enabled,true) load 1216842-5.html
pref(dom.animations-api.core.enabled,true) load 1216842-6.html
pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.timelines.enabled,true) load 1216842-1.html
pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.timelines.enabled,true) load 1216842-2.html
pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.timelines.enabled,true) load 1216842-3.html
pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.timelines.enabled,true) load 1216842-4.html
pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.timelines.enabled,true) load 1216842-5.html
pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.timelines.enabled,true) load 1216842-6.html
pref(dom.animations-api.core.enabled,true) load 1272475-1.html
pref(dom.animations-api.core.enabled,true) load 1272475-2.html
pref(dom.animations-api.core.enabled,true) load 1278485-1.html
pref(dom.animations-api.core.enabled,true) load 1277272-1.html
pref(dom.animations-api.core.enabled,true) pref(dom.animations-api.timelines.enabled,true) load 1277272-1.html
pref(dom.animations-api.core.enabled,true) load 1290535-1.html
+6
View File
@@ -1,4 +1,10 @@
[DEFAULT]
prefs =
dom.animations-api.compositing.enabled=true
dom.animations-api.core.enabled=true
dom.animations-api.getAnimations.enabled=true
dom.animations-api.implicit-keyframes.enabled=true
dom.animations-api.timelines.enabled=true
# Support files for chrome tests that we want to load over HTTP need
# to go in here, not chrome.ini.
support-files =
+10 -10
View File
@@ -745,7 +745,7 @@ Element::Scroll(const CSSIntPoint& aScroll, const ScrollOptions& aOptions)
if (aOptions.mBehavior == ScrollBehavior::Smooth) {
scrollMode = nsIScrollableFrame::SMOOTH_MSD;
} else if (aOptions.mBehavior == ScrollBehavior::Auto) {
ScrollbarStyles styles = sf->GetScrollbarStyles();
ScrollStyles styles = sf->GetScrollStyles();
if (styles.mScrollBehavior == NS_STYLE_SCROLL_BEHAVIOR_SMOOTH) {
scrollMode = nsIScrollableFrame::SMOOTH_MSD;
}
@@ -834,7 +834,7 @@ Element::SetScrollTop(int32_t aScrollTop)
nsIScrollableFrame* sf = GetScrollFrame();
if (sf) {
nsIScrollableFrame::ScrollMode scrollMode = nsIScrollableFrame::INSTANT;
if (sf->GetScrollbarStyles().mScrollBehavior == NS_STYLE_SCROLL_BEHAVIOR_SMOOTH) {
if (sf->GetScrollStyles().mScrollBehavior == NS_STYLE_SCROLL_BEHAVIOR_SMOOTH) {
scrollMode = nsIScrollableFrame::SMOOTH_MSD;
}
sf->ScrollToCSSPixels(CSSIntPoint(sf->GetScrollPositionCSSPixels().x,
@@ -856,7 +856,7 @@ Element::SetScrollLeft(int32_t aScrollLeft)
nsIScrollableFrame* sf = GetScrollFrame();
if (sf) {
nsIScrollableFrame::ScrollMode scrollMode = nsIScrollableFrame::INSTANT;
if (sf->GetScrollbarStyles().mScrollBehavior == NS_STYLE_SCROLL_BEHAVIOR_SMOOTH) {
if (sf->GetScrollStyles().mScrollBehavior == NS_STYLE_SCROLL_BEHAVIOR_SMOOTH) {
scrollMode = nsIScrollableFrame::SMOOTH_MSD;
}
@@ -1069,7 +1069,7 @@ ShadowRoot*
Element::GetShadowRootByMode() const
{
/**
* 1. Let shadow be context object’s shadow root.
* 1. Let shadow be context object???s shadow root.
* 2. If shadow is null or its mode is "closed", then return null.
*/
ShadowRoot* shadowRoot = GetShadowRoot();
@@ -1088,7 +1088,7 @@ already_AddRefed<ShadowRoot>
Element::AttachShadow(const ShadowRootInit& aInit, ErrorResult& aError)
{
/**
* 1. If context object’s namespace is not the HTML namespace,
* 1. If context object???s namespace is not the HTML namespace,
* then throw a "NotSupportedError" DOMException.
*/
if (!IsHTMLElement()) {
@@ -1097,7 +1097,7 @@ Element::AttachShadow(const ShadowRootInit& aInit, ErrorResult& aError)
}
/**
* 2. If context object’s local name is not
* 2. If context object???s local name is not
* a valid custom element name, "article", "aside", "blockquote",
* "body", "div", "footer", "h1", "h2", "h3", "h4", "h5", "h6",
* "header", "main" "nav", "p", "section", or "span",
@@ -1181,8 +1181,8 @@ Element::AttachShadowInternal(bool aClosed, ErrorResult& aError)
/**
* 4. Let shadow be a new shadow root whose node document is
* context object’s node document, host is context object,
* and mode is init’s mode.
* context object???s node document, host is context object,
* and mode is init???s mode.
*/
RefPtr<ShadowRoot> shadowRoot =
new ShadowRoot(this, aClosed, nodeInfo.forget(), protoBinding);
@@ -1190,7 +1190,7 @@ Element::AttachShadowInternal(bool aClosed, ErrorResult& aError)
shadowRoot->SetIsComposedDocParticipant(IsInComposedDoc());
/**
* 5. Set context object’s shadow root to shadow.
* 5. Set context object???s shadow root to shadow.
*/
SetShadowRoot(shadowRoot);
@@ -1890,7 +1890,7 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent)
nsPresContext* presContext = presShell->GetPresContext();
if (presContext) {
MOZ_ASSERT(this !=
presContext->GetViewportScrollbarStylesOverrideNode(),
presContext->GetViewportScrollStylesOverrideNode(),
"Leaving behind a raw pointer to this node (as having "
"propagated scrollbar styles) - that's dangerous...");
}
-2
View File
@@ -16,8 +16,6 @@ namespace mozilla {
namespace dom {
class Promise;
// Make sure that any change to ScreenOrientationInternal values are
// also made in mobile/android/base/GeckoScreenOrientation.java
typedef uint32_t ScreenOrientationInternal;
static const ScreenOrientationInternal eScreenOrientation_None = 0;
+4 -60
View File
@@ -9140,10 +9140,6 @@ ShouldEscape(nsIContent* aParent)
nsGkAtoms::style, nsGkAtoms::script, nsGkAtoms::xmp,
nsGkAtoms::iframe, nsGkAtoms::noembed, nsGkAtoms::noframes,
nsGkAtoms::plaintext,
// Per the current spec noscript should be escaped in case
// scripts are disabled or if document doesn't have
// browsing context. However the latter seems to be a spec bug
// and Gecko hasn't traditionally done the former.
nsGkAtoms::noscript
};
static mozilla::BloomFilter<12, nsIAtom> sFilter;
@@ -9159,6 +9155,10 @@ ShouldEscape(nsIContent* aParent)
if (sFilter.mightContain(tag)) {
for (uint32_t i = 0; i < ArrayLength(nonEscapingElements); ++i) {
if (tag == nonEscapingElements[i]) {
if (MOZ_UNLIKELY(tag == nsGkAtoms::noscript) &&
MOZ_UNLIKELY(!aParent->OwnerDoc()->IsScriptEnabled())) {
return true;
}
return false;
}
}
@@ -9341,62 +9341,6 @@ nsContentUtils::SetScrollbarsVisibility(nsIDocShell* aDocShell, bool aVisible)
}
}
/* static */ void
nsContentUtils::GetPresentationURL(nsIDocShell* aDocShell, nsAString& aPresentationUrl)
{
MOZ_ASSERT(aDocShell);
// Simulate receiver context for web platform test
if (Preferences::GetBool("dom.presentation.testing.simulate-receiver")) {
nsCOMPtr<nsIDocument> doc;
nsCOMPtr<nsPIDOMWindowOuter> docShellWin =
do_QueryInterface(aDocShell->GetScriptGlobalObject());
if (docShellWin) {
doc = docShellWin->GetExtantDoc();
}
if (NS_WARN_IF(!doc)) {
return;
}
nsCOMPtr<nsIURI> uri = doc->GetDocumentURI();
if (NS_WARN_IF(!uri)) {
return;
}
nsAutoCString uriStr;
uri->GetSpec(uriStr);
aPresentationUrl = NS_ConvertUTF8toUTF16(uriStr);
return;
}
if (XRE_IsContentProcess()) {
nsCOMPtr<nsIDocShellTreeItem> sameTypeRoot;
aDocShell->GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
nsCOMPtr<nsIDocShellTreeItem> root;
aDocShell->GetRootTreeItem(getter_AddRefs(root));
if (sameTypeRoot.get() == root.get()) {
// presentation URL is stored in TabChild for the top most
// <iframe mozbrowser> in content process.
TabChild* tabChild = TabChild::GetFrom(aDocShell);
if (tabChild) {
aPresentationUrl = tabChild->PresentationURL();
}
return;
}
}
nsCOMPtr<nsILoadContext> loadContext(do_QueryInterface(aDocShell));
nsCOMPtr<nsIDOMElement> topFrameElement;
loadContext->GetTopFrameElement(getter_AddRefs(topFrameElement));
if (!topFrameElement) {
return;
}
topFrameElement->GetAttribute(NS_LITERAL_STRING("mozpresentation"), aPresentationUrl);
}
/* static */ nsIDocShell*
nsContentUtils::GetDocShellForEventTarget(EventTarget* aTarget)
{
-6
View File
@@ -2679,12 +2679,6 @@ public:
static void SetScrollbarsVisibility(nsIDocShell* aDocShell, bool aVisible);
/*
* Return the associated presentation URL of the presented content.
* Will return empty string if the docshell is not in a presented content.
*/
static void GetPresentationURL(nsIDocShell* aDocShell, nsAString& aPresentationUrl);
/*
* Try to find the docshell corresponding to the given event target.
*/
+28 -1
View File
@@ -2923,6 +2923,33 @@ nsDocument::IsWebAnimationsEnabled(JSContext* /*unused*/, JSObject* /*unused*/)
Preferences::GetBool("dom.animations-api.core.enabled");
}
bool
nsDocument::AreWebAnimationsTimelinesEnabled(JSContext* /*unused*/, JSObject* /*unused*/)
{
MOZ_ASSERT(NS_IsMainThread());
return nsContentUtils::IsCallerChrome() ||
Preferences::GetBool("dom.animations-api.timelines.enabled");
}
bool
nsDocument::AreWebAnimationsImplicitKeyframesEnabled(JSContext* /*unused*/, JSObject* /*unused*/)
{
MOZ_ASSERT(NS_IsMainThread());
return nsContentUtils::IsCallerChrome() ||
Preferences::GetBool("dom.animations-api.implicit-keyframes.enabled");
}
bool
nsDocument::IsWebAnimationsGetAnimationsEnabled(JSContext* /*unused*/, JSObject* /*unused*/)
{
MOZ_ASSERT(NS_IsMainThread());
return nsContentUtils::IsCallerChrome() ||
Preferences::GetBool("dom.animations-api.getAnimations.enabled");
}
DocumentTimeline*
nsDocument::Timeline()
{
@@ -10568,7 +10595,7 @@ UpdateViewportScrollbarOverrideForFullscreen(nsIDocument* aDoc)
{
if (nsIPresShell* presShell = aDoc->GetShell()) {
if (nsPresContext* presContext = presShell->GetPresContext()) {
presContext->UpdateViewportScrollbarStylesOverride();
presContext->UpdateViewportScrollStylesOverride();
}
}
}
+4
View File
@@ -433,6 +433,10 @@ public:
static bool IsElementAnimateEnabled(JSContext* aCx, JSObject* aObject);
static bool IsWebAnimationsEnabled(JSContext* aCx, JSObject* aObject);
static bool AreWebAnimationsImplicitKeyframesEnabled(JSContext* aCx, JSObject* aObject);
static bool AreWebAnimationsTimelinesEnabled(JSContext* aCx, JSObject* aObject);
static bool IsWebAnimationsGetAnimationsEnabled(JSContext* aCx, JSObject* aObject);
virtual mozilla::dom::DocumentTimeline* Timeline() override;
virtual void GetAnimations(
nsTArray<RefPtr<mozilla::dom::Animation>>& aAnimations) override;
+1 -15
View File
@@ -3102,14 +3102,6 @@ nsFrameLoader::ApplySandboxFlags(uint32_t sandboxFlags)
// The child can only add restrictions, never remove them.
sandboxFlags |= parentSandboxFlags;
// If this frame is a receiving browsing context, we should add
// sandboxed auxiliary navigation flag to sandboxFlags. See
// https://w3c.github.io/presentation-api/#creating-a-receiving-browsing-context
nsAutoString presentationURL;
nsContentUtils::GetPresentationURL(mDocShell, presentationURL);
if (!presentationURL.IsEmpty()) {
sandboxFlags |= SANDBOXED_AUXILIARY_NAVIGATION;
}
mDocShell->SetSandboxFlags(sandboxFlags);
}
}
@@ -3427,11 +3419,6 @@ nsFrameLoader::GetNewTabContext(MutableTabContext* aTabContext,
rv = PopulateUserContextIdFromAttribute(attrs);
NS_ENSURE_SUCCESS(rv, rv);
nsAutoString presentationURLStr;
mOwnerContent->GetAttr(kNameSpaceID_None,
nsGkAtoms::mozpresentation,
presentationURLStr);
nsCOMPtr<nsIDocShell> docShell = mOwnerContent->OwnerDoc()->GetDocShell();
nsCOMPtr<nsILoadContext> parentContext = do_QueryInterface(docShell);
NS_ENSURE_STATE(parentContext);
@@ -3459,8 +3446,7 @@ nsFrameLoader::GetNewTabContext(MutableTabContext* aTabContext,
containingApp,
showAccelerators,
showFocusRings,
attrs,
presentationURLStr);
attrs);
NS_ENSURE_STATE(tabContextUpdated);
return NS_OK;
-1
View File
@@ -1038,7 +1038,6 @@ GK_ATOM(predicate, "predicate")
GK_ATOM(prefix, "prefix")
GK_ATOM(preload, "preload")
GK_ATOM(prerendered, "prerendered")
GK_ATOM(mozpresentation, "mozpresentation")
GK_ATOM(preserve, "preserve")
GK_ATOM(preserveSpace, "preserve-space")
GK_ATOM(preventdefault, "preventdefault")
+3 -3
View File
@@ -8264,7 +8264,7 @@ nsGlobalWindow::ScrollTo(const CSSIntPoint& aScroll,
scroll.y = maxpx;
}
bool smoothScroll = sf->GetScrollbarStyles().IsSmoothScroll(aOptions.mBehavior);
bool smoothScroll = sf->GetScrollStyles().IsSmoothScroll(aOptions.mBehavior);
sf->ScrollToCSSPixels(scroll, smoothScroll
? nsIScrollableFrame::SMOOTH_MSD
@@ -8320,7 +8320,7 @@ nsGlobalWindow::ScrollByLines(int32_t numLines,
// It seems like it would make more sense for ScrollByLines to use
// SMOOTH mode, but tests seem to depend on the synchronous behaviour.
// Perhaps Web content does too.
bool smoothScroll = sf->GetScrollbarStyles().IsSmoothScroll(aOptions.mBehavior);
bool smoothScroll = sf->GetScrollStyles().IsSmoothScroll(aOptions.mBehavior);
sf->ScrollBy(nsIntPoint(0, numLines), nsIScrollableFrame::LINES,
smoothScroll
@@ -8341,7 +8341,7 @@ nsGlobalWindow::ScrollByPages(int32_t numPages,
// It seems like it would make more sense for ScrollByPages to use
// SMOOTH mode, but tests seem to depend on the synchronous behaviour.
// Perhaps Web content does too.
bool smoothScroll = sf->GetScrollbarStyles().IsSmoothScroll(aOptions.mBehavior);
bool smoothScroll = sf->GetScrollStyles().IsSmoothScroll(aOptions.mBehavior);
sf->ScrollBy(nsIntPoint(0, numPages), nsIScrollableFrame::PAGES,
smoothScroll
+3 -2
View File
@@ -299,10 +299,11 @@ nsJSUtils::CompileModule(JSContext* aCx,
NS_ENSURE_TRUE(xpc::Scriptability::Get(aEvaluationGlobal).Allowed(), NS_OK);
if (!JS::CompileModule(aCx, aCompileOptions, aSrcBuf, aModule)) {
bool compileResult = JS::CompileModule(aCx, aCompileOptions, aSrcBuf, aModule);
if (!compileResult) {
return NS_ERROR_FAILURE;
}
return NS_OK;
}
+7 -3
View File
@@ -930,7 +930,7 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, ImageData& aImageData,
const Maybe<IntRect>& aCropRect, ErrorResult& aRv)
{
// Copy data into SourceSurface.
dom::Uint8ClampedArray array;
RootedTypedArray<Uint8ClampedArray> array(RootingCx());
DebugOnly<bool> inited = array.Init(aImageData.GetDataObject());
MOZ_ASSERT(inited);
@@ -952,13 +952,17 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, ImageData& aImageData,
// Create and Crop the raw data into a layers::Image
RefPtr<layers::Image> data;
// The data could move during a GC; copy it out into a local buffer.
uint8_t* fixedData = array.Data();
if (NS_IsMainThread()) {
data = CreateImageFromRawData(imageSize, imageStride, FORMAT,
array.Data(), dataLength,
fixedData, dataLength,
aCropRect);
} else {
RefPtr<CreateImageFromRawDataInMainThreadSyncTask> task
= new CreateImageFromRawDataInMainThreadSyncTask(array.Data(),
= new CreateImageFromRawDataInMainThreadSyncTask(fixedData,
dataLength,
imageStride,
FORMAT,
+20
View File
@@ -390,6 +390,16 @@ WebGLContext::TexImage(const char* funcName, uint8_t funcDims, GLenum rawTarget,
if (!ValidateTexImageTarget(this, funcName, funcDims, rawTarget, &target, &tex))
return;
const bool isUploadFromPbo = bool(src.mPboOffset);
const bool isPboBound = bool(mBoundPixelUnpackBuffer);
if (isUploadFromPbo != isPboBound) {
SynthesizeGLError(LOCAL_GL_INVALID_OPERATION,
"Tex upload from %s but PIXEL_UNPACK_BUFFER %s bound.",
isUploadFromPbo ? "PBO" : "non-PBO",
isPboBound ? "was" : "was not");
return;
}
const webgl::PackingInfo pi = {unpackFormat, unpackType};
tex->TexImage(funcName, target, level, internalFormat, width, height, depth, border,
pi, src);
@@ -407,6 +417,16 @@ WebGLContext::TexSubImage(const char* funcName, uint8_t funcDims, GLenum rawTarg
if (!ValidateTexImageTarget(this, funcName, funcDims, rawTarget, &target, &tex))
return;
const bool isUploadFromPbo = bool(src.mPboOffset);
const bool isPboBound = bool(mBoundPixelUnpackBuffer);
if (isUploadFromPbo != isPboBound) {
SynthesizeGLError(LOCAL_GL_INVALID_OPERATION,
"Tex upload from %s but PIXEL_UNPACK_BUFFER %s bound.",
isUploadFromPbo ? "PBO" : "non-PBO",
isPboBound ? "was" : "was not");
return;
}
const webgl::PackingInfo pi = {unpackFormat, unpackType};
tex->TexSubImage(funcName, target, level, xOffset, yOffset, zOffset, width, height,
depth, pi, src);
+1
View File
@@ -690,6 +690,7 @@ private:
case CKM_AES_GCM:
gcmParams.pIv = mIv.Elements();
gcmParams.ulIvLen = mIv.Length();
gcmParams.ulIvBits = gcmParams.ulIvLen * 8;
gcmParams.pAAD = mAad.Elements();
gcmParams.ulAADLen = mAad.Length();
gcmParams.ulTagBits = mTagLength;
+2 -2
View File
@@ -2516,7 +2516,7 @@ EventStateManager::ComputeScrollTarget(nsIFrame* aTargetFrame,
return frameToScroll;
}
ScrollbarStyles ss = scrollableFrame->GetScrollbarStyles();
ScrollStyles ss = scrollableFrame->GetScrollStyles();
bool hiddenForV = (NS_STYLE_OVERFLOW_HIDDEN == ss.mVertical);
bool hiddenForH = (NS_STYLE_OVERFLOW_HIDDEN == ss.mHorizontal);
if ((hiddenForV && hiddenForH) ||
@@ -2609,7 +2609,7 @@ EventStateManager::DoScrollText(nsIScrollableFrame* aScrollableFrame,
ComputeScrollAmountForDefaultAction(aEvent, scrollAmountInDevPixels);
// Don't scroll around the axis whose overflow style is hidden.
ScrollbarStyles overflowStyle = aScrollableFrame->GetScrollbarStyles();
ScrollStyles overflowStyle = aScrollableFrame->GetScrollStyles();
if (overflowStyle.mHorizontal == NS_STYLE_OVERFLOW_HIDDEN) {
actualDevPixelScrollAmount.x = 0;
}
+1 -1
View File
@@ -866,7 +866,7 @@ HTMLInputElement::InitFilePicker(FilePickerType aType)
mode = static_cast<int16_t>(nsIFilePicker::modeOpen);
}
nsresult rv = filePicker->Init(win, title, mode);
nsresult rv = filePicker->Init(win, title, mode, /*aRequireInteraction = */ true);
NS_ENSURE_SUCCESS(rv, rv);
if (!okButtonLabel.IsEmpty()) {
+5 -1
View File
@@ -4614,8 +4614,12 @@ void HTMLMediaElement::DecodeError(const MediaResult& aError)
}
} else if (mReadyState == nsIDOMHTMLMediaElement::HAVE_NOTHING) {
NoSupportedMediaSourceError(aError.Description());
} else {
} else if (IsCORSSameOrigin()) {
Error(MEDIA_ERR_DECODE, aError.Description());
} else {
nsAutoCString eMessage;
eMessage.AssignLiteral("Failed to decode media");
Error(MEDIA_ERR_DECODE, eMessage);
}
}
+3 -3
View File
@@ -137,9 +137,9 @@ HTMLMenuElement::ParseAttribute(int32_t aNamespaceID,
const nsAString& aValue,
nsAttrValue& aResult)
{
if (aNamespaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::type) {
bool success = aResult.ParseEnumValue(aValue, kMenuTypeTable,
false);
if (aNamespaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::type &&
Preferences::GetBool("dom.menuitem.enabled")) {
bool success = aResult.ParseEnumValue(aValue, kMenuTypeTable, false);
if (success) {
mType = aResult.GetEnumValue();
} else {
+11 -2
View File
@@ -7,12 +7,21 @@
#include "mozilla/BasicEvents.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/HTMLMenuItemElementBinding.h"
#include "mozilla/dom/HTMLUnknownElement.h"
#include "nsAttrValueInlines.h"
#include "nsContentUtils.h"
NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(MenuItem)
nsGenericHTMLElement*
NS_NewHTMLMenuItemElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
mozilla::dom::FromParser aFromParser) {
if (mozilla::Preferences::GetBool("dom.menuitem.enabled")) {
return new mozilla::dom::HTMLMenuItemElement(aNodeInfo, aFromParser);
} else {
return new mozilla::dom::HTMLUnknownElement(aNodeInfo);
}
}
namespace mozilla {
namespace dom {
@@ -4,6 +4,9 @@ const kPage = "http://example.org/browser/" +
"dom/html/test/file_content_contextmenu.html";
add_task(function* () {
yield SpecialPowers.pushPrefEnv({
set: [["dom.menuitem.enabled", true]],
});
yield BrowserTestUtils.withNewTab({
gBrowser,
url: kPage
+2
View File
@@ -1,4 +1,6 @@
[DEFAULT]
prefs =
dom.menuitem.enabled=true # only for test_bug617528.html
support-files =
347174transform.xsl
347174transformable.xml
+2 -1
View File
@@ -248,7 +248,8 @@ FilePickerParent::CreateFilePicker()
return false;
}
return NS_SUCCEEDED(mFilePicker->Init(window, mTitle, mMode));
return NS_SUCCEEDED(mFilePicker->Init(window, mTitle, mMode,
element->IsNodeOfType(nsINode::eHTML_FORM_CONTROL)));
}
bool
-5
View File
@@ -48,11 +48,6 @@ struct FrameIPCTabContext
// Whether this TabContext should work in prerender mode.
bool isPrerendered;
// The requested presentation URL.
// This value would be empty if the TabContext isn't created for
// presented content.
nsString presentationURL;
// Keyboard indicator state inherited from the parent.
UIStateChangeType showAccelerators;
UIStateChangeType showFocusRings;
-5
View File
@@ -770,11 +770,6 @@ TabChild::NotifyTabContextUpdated(bool aIsPreallocated)
if (aIsPreallocated) {
nsDocShell::Cast(docShell)->SetOriginAttributes(OriginAttributesRef());
}
// Set SANDBOXED_AUXILIARY_NAVIGATION flag if this is a receiver page.
if (!PresentationURL().IsEmpty()) {
docShell->SetSandboxFlags(SANDBOXED_AUXILIARY_NAVIGATION);
}
}
void
+2 -14
View File
@@ -190,12 +190,6 @@ TabContext::OriginAttributesRef() const
return mOriginAttributes;
}
const nsAString&
TabContext::PresentationURL() const
{
return mPresentationURL;
}
UIStateChangeType
TabContext::ShowAccelerators() const
{
@@ -215,8 +209,7 @@ TabContext::SetTabContext(bool aIsMozBrowserElement,
mozIApplication* aAppFrameOwnerApp,
UIStateChangeType aShowAccelerators,
UIStateChangeType aShowFocusRings,
const DocShellOriginAttributes& aOriginAttributes,
const nsAString& aPresentationURL)
const DocShellOriginAttributes& aOriginAttributes)
{
NS_ENSURE_FALSE(mInitialized, false);
@@ -248,7 +241,6 @@ TabContext::SetTabContext(bool aIsMozBrowserElement,
mContainingAppId = containingAppId;
mOwnApp = aOwnApp;
mContainingApp = aAppFrameOwnerApp;
mPresentationURL = aPresentationURL;
mShowAccelerators = aShowAccelerators;
mShowFocusRings = aShowFocusRings;
return true;
@@ -261,7 +253,6 @@ TabContext::AsIPCTabContext() const
mContainingAppId,
mIsMozBrowserElement,
mIsPrerendered,
mPresentationURL,
mShowAccelerators,
mShowFocusRings));
}
@@ -285,7 +276,6 @@ MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams)
bool isPrerendered = false;
uint32_t containingAppId = NO_APP_ID;
DocShellOriginAttributes originAttributes;
nsAutoString presentationURL;
UIStateChangeType showAccelerators = UIStateChangeType_NoChange;
UIStateChangeType showFocusRings = UIStateChangeType_NoChange;
@@ -348,7 +338,6 @@ MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams)
isMozBrowserElement = ipcContext.isMozBrowserElement();
isPrerendered = ipcContext.isPrerendered();
containingAppId = ipcContext.frameOwnerAppId();
presentationURL = ipcContext.presentationURL();
showAccelerators = ipcContext.showAccelerators();
showFocusRings = ipcContext.showFocusRings();
originAttributes = ipcContext.originAttributes();
@@ -395,8 +384,7 @@ MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams)
containingApp,
showAccelerators,
showFocusRings,
originAttributes,
presentationURL);
originAttributes);
if (!rv) {
mInvalidReason = "Couldn't initialize TabContext.";
}
+3 -17
View File
@@ -125,12 +125,6 @@ public:
*/
const DocShellOriginAttributes& OriginAttributesRef() const;
/**
* Returns the presentation URL associated with the tab if this tab is
* created for presented content
*/
const nsAString& PresentationURL() const;
UIStateChangeType ShowAccelerators() const;
UIStateChangeType ShowFocusRings() const;
@@ -169,8 +163,7 @@ protected:
mozIApplication* aAppFrameOwnerApp,
UIStateChangeType aShowAccelerators,
UIStateChangeType aShowFocusRings,
const DocShellOriginAttributes& aOriginAttributes,
const nsAString& aPresentationURL);
const DocShellOriginAttributes& aOriginAttributes);
/**
* Modify this TabContext to match the given TabContext. This is a special
@@ -225,11 +218,6 @@ private:
*/
DocShellOriginAttributes mOriginAttributes;
/**
* The requested presentation URL.
*/
nsString mPresentationURL;
/**
* Keyboard indicator state (focus rings, accelerators).
*/
@@ -257,8 +245,7 @@ public:
mozIApplication* aAppFrameOwnerApp,
UIStateChangeType aShowAccelerators,
UIStateChangeType aShowFocusRings,
const DocShellOriginAttributes& aOriginAttributes,
const nsAString& aPresentationURL = EmptyString())
const DocShellOriginAttributes& aOriginAttributes)
{
return TabContext::SetTabContext(aIsMozBrowserElement,
aIsPrerendered,
@@ -266,8 +253,7 @@ public:
aAppFrameOwnerApp,
aShowAccelerators,
aShowFocusRings,
aOriginAttributes,
aPresentationURL);
aOriginAttributes);
}
};
@@ -316,3 +316,5 @@ LargeAllocationRelatedBrowsingContexts=A Large-Allocation header was ignored due
LargeAllocationInIFrame=A Large-Allocation header was ignored due to the load occuring within an iframe.
# LOCALIZATION NOTE: Do not translate "Large-Allocation", as it is a literal header name
LargeAllocationNonE10S=A Large-Allocation header was ignored due to the document not being loaded out of process.
# LOCALIZATION NOTE: Do not translate "pushState" and "replaceState"
PushStateFloodingPrevented=Call to pushState or replaceState ignored due to excessive calls within a short timeframe.
+3
View File
@@ -145,6 +145,9 @@ IPDL_SOURCES += [
'PGMPVideoEncoder.ipdl',
]
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
NO_VISIBILITY_FLAGS = True
# comment this out to use Unsafe Shmem for more performance
DEFINES['GMP_SAFE_SHMEM'] = True
@@ -1,227 +0,0 @@
/* 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 "AndroidDecoderModule.h"
#include "AndroidBridge.h"
#include "MediaCodecDataDecoder.h"
#include "RemoteDataDecoder.h"
#include "MediaInfo.h"
#include "VPXDecoder.h"
#include "MediaPrefs.h"
#include "OpusDecoder.h"
#include "VorbisDecoder.h"
#include "nsPromiseFlatString.h"
#include "nsIGfxInfo.h"
#include "prlog.h"
#include <jni.h>
#undef LOG
#define LOG(arg, ...) MOZ_LOG(sAndroidDecoderModuleLog, \
mozilla::LogLevel::Debug, ("AndroidDecoderModule(%p)::%s: " arg, \
this, __func__, ##__VA_ARGS__))
using namespace mozilla;
using namespace mozilla::gl;
using namespace mozilla::java::sdk;
using media::TimeUnit;
namespace mozilla {
mozilla::LazyLogModule sAndroidDecoderModuleLog("AndroidDecoderModule");
static const char*
TranslateMimeType(const nsACString& aMimeType)
{
if (VPXDecoder::IsVPX(aMimeType, VPXDecoder::VP8)) {
return "video/x-vnd.on2.vp8";
} else if (VPXDecoder::IsVPX(aMimeType, VPXDecoder::VP9)) {
return "video/x-vnd.on2.vp9";
}
return PromiseFlatCString(aMimeType).get();
}
static bool
GetFeatureStatus(int32_t aFeature)
{
nsCOMPtr<nsIGfxInfo> gfxInfo = services::GetGfxInfo();
int32_t status = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
nsCString discardFailureId;
if (!gfxInfo || NS_FAILED(gfxInfo->GetFeatureStatus(aFeature, discardFailureId, &status))) {
return false;
}
return status == nsIGfxInfo::FEATURE_STATUS_OK;
};
CryptoInfo::LocalRef
GetCryptoInfoFromSample(const MediaRawData* aSample)
{
auto& cryptoObj = aSample->mCrypto;
if (!cryptoObj.mValid) {
return nullptr;
}
CryptoInfo::LocalRef cryptoInfo;
nsresult rv = CryptoInfo::New(&cryptoInfo);
NS_ENSURE_SUCCESS(rv, nullptr);
uint32_t numSubSamples =
std::min<uint32_t>(cryptoObj.mPlainSizes.Length(), cryptoObj.mEncryptedSizes.Length());
uint32_t totalSubSamplesSize = 0;
for (auto& size : cryptoObj.mEncryptedSizes) {
totalSubSamplesSize += size;
}
// mPlainSizes is uint16_t, need to transform to uint32_t first.
nsTArray<uint32_t> plainSizes;
for (auto& size : cryptoObj.mPlainSizes) {
totalSubSamplesSize += size;
plainSizes.AppendElement(size);
}
uint32_t codecSpecificDataSize = aSample->Size() - totalSubSamplesSize;
// Size of codec specific data("CSD") for Android MediaCodec usage should be
// included in the 1st plain size.
plainSizes[0] += codecSpecificDataSize;
static const int kExpectedIVLength = 16;
auto tempIV(cryptoObj.mIV);
auto tempIVLength = tempIV.Length();
MOZ_ASSERT(tempIVLength <= kExpectedIVLength);
for (size_t i = tempIVLength; i < kExpectedIVLength; i++) {
// Padding with 0
tempIV.AppendElement(0);
}
auto numBytesOfPlainData = mozilla::jni::IntArray::New(
reinterpret_cast<int32_t*>(&plainSizes[0]),
plainSizes.Length());
auto numBytesOfEncryptedData =
mozilla::jni::IntArray::New(reinterpret_cast<const int32_t*>(&cryptoObj.mEncryptedSizes[0]),
cryptoObj.mEncryptedSizes.Length());
auto iv = mozilla::jni::ByteArray::New(reinterpret_cast<int8_t*>(&tempIV[0]),
tempIV.Length());
auto keyId = mozilla::jni::ByteArray::New(reinterpret_cast<const int8_t*>(&cryptoObj.mKeyId[0]),
cryptoObj.mKeyId.Length());
cryptoInfo->Set(numSubSamples,
numBytesOfPlainData,
numBytesOfEncryptedData,
keyId,
iv,
MediaCodec::CRYPTO_MODE_AES_CTR);
return cryptoInfo;
}
bool
AndroidDecoderModule::SupportsMimeType(const nsACString& aMimeType,
DecoderDoctorDiagnostics* aDiagnostics) const
{
if (!AndroidBridge::Bridge() ||
AndroidBridge::Bridge()->GetAPIVersion() < 16) {
return false;
}
if (aMimeType.EqualsLiteral("video/mp4") ||
aMimeType.EqualsLiteral("video/avc")) {
return true;
}
// When checking "audio/x-wav", CreateDecoder can cause a JNI ERROR by
// Accessing a stale local reference leading to a SIGSEGV crash.
// To avoid this we check for wav types here.
if (aMimeType.EqualsLiteral("audio/x-wav") ||
aMimeType.EqualsLiteral("audio/wave; codecs=1") ||
aMimeType.EqualsLiteral("audio/wave; codecs=6") ||
aMimeType.EqualsLiteral("audio/wave; codecs=7") ||
aMimeType.EqualsLiteral("audio/wave; codecs=65534")) {
return false;
}
if ((VPXDecoder::IsVPX(aMimeType, VPXDecoder::VP8) &&
!GetFeatureStatus(nsIGfxInfo::FEATURE_VP8_HW_DECODE)) ||
(VPXDecoder::IsVPX(aMimeType, VPXDecoder::VP9) &&
!GetFeatureStatus(nsIGfxInfo::FEATURE_VP9_HW_DECODE))) {
return false;
}
// Prefer the gecko decoder for opus and vorbis; stagefright crashes
// on content demuxed from mp4.
if (OpusDataDecoder::IsOpus(aMimeType) ||
VorbisDataDecoder::IsVorbis(aMimeType)) {
LOG("Rejecting audio of type %s", aMimeType.Data());
return false;
}
return java::HardwareCodecCapabilityUtils::FindDecoderCodecInfoForMimeType(
nsCString(TranslateMimeType(aMimeType)));
}
already_AddRefed<MediaDataDecoder>
AndroidDecoderModule::CreateVideoDecoder(const CreateDecoderParams& aParams)
{
MediaFormat::LocalRef format;
const VideoInfo& config = aParams.VideoConfig();
NS_ENSURE_SUCCESS(MediaFormat::CreateVideoFormat(
TranslateMimeType(config.mMimeType),
config.mDisplay.width,
config.mDisplay.height,
&format), nullptr);
RefPtr<MediaDataDecoder> decoder = MediaPrefs::PDMAndroidRemoteCodecEnabled() ?
RemoteDataDecoder::CreateVideoDecoder(config,
format,
aParams.mCallback,
aParams.mImageContainer) :
MediaCodecDataDecoder::CreateVideoDecoder(config,
format,
aParams.mCallback,
aParams.mImageContainer);
return decoder.forget();
}
already_AddRefed<MediaDataDecoder>
AndroidDecoderModule::CreateAudioDecoder(const CreateDecoderParams& aParams)
{
const AudioInfo& config = aParams.AudioConfig();
MOZ_ASSERT(config.mBitDepth == 16, "We only handle 16-bit audio!");
MediaFormat::LocalRef format;
LOG("CreateAudioFormat with mimeType=%s, mRate=%d, channels=%d",
config.mMimeType.Data(), config.mRate, config.mChannels);
NS_ENSURE_SUCCESS(MediaFormat::CreateAudioFormat(
config.mMimeType,
config.mRate,
config.mChannels,
&format), nullptr);
RefPtr<MediaDataDecoder> decoder = MediaPrefs::PDMAndroidRemoteCodecEnabled() ?
RemoteDataDecoder::CreateAudioDecoder(config, format, aParams.mCallback) :
MediaCodecDataDecoder::CreateAudioDecoder(config, format, aParams.mCallback);
return decoder.forget();
}
PlatformDecoderModule::ConversionRequired
AndroidDecoderModule::DecoderNeedsConversion(const TrackInfo& aConfig) const
{
if (aConfig.IsVideo()) {
return ConversionRequired::kNeedAnnexB;
}
return ConversionRequired::kNeedNone;
}
} // mozilla
@@ -1,34 +0,0 @@
/* 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/. */
#ifndef AndroidDecoderModule_h_
#define AndroidDecoderModule_h_
#include "PlatformDecoderModule.h"
namespace mozilla {
class AndroidDecoderModule : public PlatformDecoderModule {
public:
already_AddRefed<MediaDataDecoder>
CreateVideoDecoder(const CreateDecoderParams& aParams) override;
already_AddRefed<MediaDataDecoder>
CreateAudioDecoder(const CreateDecoderParams& aParams) override;
AndroidDecoderModule() {}
virtual ~AndroidDecoderModule() {}
bool SupportsMimeType(const nsACString& aMimeType,
DecoderDoctorDiagnostics* aDiagnostics) const override;
ConversionRequired
DecoderNeedsConversion(const TrackInfo& aConfig) const override;
};
extern LazyLogModule sAndroidDecoderModuleLog;
} // namespace mozilla
#endif
@@ -1,698 +0,0 @@
/* 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 "MediaCodecDataDecoder.h"
#include "AndroidBridge.h"
#include "AndroidSurfaceTexture.h"
#include "GeneratedJNINatives.h"
#include "GLImages.h"
#include "MediaData.h"
#include "MediaInfo.h"
#include "VPXDecoder.h"
#include "nsThreadUtils.h"
#include "nsPromiseFlatString.h"
#include "nsIGfxInfo.h"
#include "prlog.h"
#include <jni.h>
#undef LOG
#define LOG(arg, ...) MOZ_LOG(sAndroidDecoderModuleLog, \
mozilla::LogLevel::Debug, ("MediaCodecDataDecoder(%p)::%s: " arg, \
this, __func__, ##__VA_ARGS__))
using namespace mozilla;
using namespace mozilla::gl;
using namespace mozilla::java;
using namespace mozilla::java::sdk;
using media::TimeUnit;
namespace mozilla {
#define INVOKE_CALLBACK(Func, ...) \
if (mCallback) { \
mCallback->Func(__VA_ARGS__); \
} else { \
NS_WARNING("Callback not set"); \
}
static MediaCodec::LocalRef
CreateDecoder(const nsACString& aMimeType)
{
MediaCodec::LocalRef codec;
NS_ENSURE_SUCCESS(MediaCodec::CreateDecoderByType(TranslateMimeType(aMimeType),
&codec), nullptr);
return codec;
}
class VideoDataDecoder : public MediaCodecDataDecoder
{
public:
VideoDataDecoder(const VideoInfo& aConfig,
MediaFormat::Param aFormat,
MediaDataDecoderCallback* aCallback,
layers::ImageContainer* aImageContainer)
: MediaCodecDataDecoder(MediaData::Type::VIDEO_DATA, aConfig.mMimeType,
aFormat, aCallback)
, mImageContainer(aImageContainer)
, mConfig(aConfig)
{
}
const char* GetDescriptionName() const override
{
return "Android MediaCodec video decoder";
}
RefPtr<InitPromise> Init() override
{
mSurfaceTexture = AndroidSurfaceTexture::Create();
if (!mSurfaceTexture) {
NS_WARNING("Failed to create SurfaceTexture for video decode\n");
return InitPromise::CreateAndReject(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__);
}
if (NS_FAILED(InitDecoder(mSurfaceTexture->JavaSurface()))) {
return InitPromise::CreateAndReject(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__);
}
return InitPromise::CreateAndResolve(TrackInfo::kVideoTrack, __func__);
}
void Cleanup() override
{
}
nsresult PostOutput(BufferInfo::Param aInfo, MediaFormat::Param aFormat,
const TimeUnit& aDuration) override
{
RefPtr<layers::Image> img =
new SurfaceTextureImage(mSurfaceTexture.get(), mConfig.mDisplay,
gl::OriginPos::BottomLeft);
nsresult rv;
int32_t flags;
NS_ENSURE_SUCCESS(rv = aInfo->Flags(&flags), rv);
bool isSync = !!(flags & MediaCodec::BUFFER_FLAG_SYNC_FRAME);
int32_t offset;
NS_ENSURE_SUCCESS(rv = aInfo->Offset(&offset), rv);
int64_t presentationTimeUs;
NS_ENSURE_SUCCESS(rv = aInfo->PresentationTimeUs(&presentationTimeUs), rv);
RefPtr<VideoData> v =
VideoData::CreateFromImage(mConfig,
offset,
presentationTimeUs,
aDuration.ToMicroseconds(),
img,
isSync,
presentationTimeUs,
gfx::IntRect(0, 0,
mConfig.mDisplay.width,
mConfig.mDisplay.height));
INVOKE_CALLBACK(Output, v);
return NS_OK;
}
protected:
layers::ImageContainer* mImageContainer;
const VideoInfo& mConfig;
RefPtr<AndroidSurfaceTexture> mSurfaceTexture;
};
class AudioDataDecoder : public MediaCodecDataDecoder
{
public:
AudioDataDecoder(const AudioInfo& aConfig, MediaFormat::Param aFormat,
MediaDataDecoderCallback* aCallback)
: MediaCodecDataDecoder(MediaData::Type::AUDIO_DATA, aConfig.mMimeType,
aFormat, aCallback)
{
JNIEnv* const env = jni::GetEnvForThread();
jni::ByteBuffer::LocalRef buffer(env);
NS_ENSURE_SUCCESS_VOID(aFormat->GetByteBuffer(NS_LITERAL_STRING("csd-0"),
&buffer));
if (!buffer && aConfig.mCodecSpecificConfig->Length() >= 2) {
buffer = jni::ByteBuffer::New(
aConfig.mCodecSpecificConfig->Elements(),
aConfig.mCodecSpecificConfig->Length());
NS_ENSURE_SUCCESS_VOID(aFormat->SetByteBuffer(NS_LITERAL_STRING("csd-0"),
buffer));
}
}
const char* GetDescriptionName() const override
{
return "android audio decoder";
}
nsresult Output(BufferInfo::Param aInfo, void* aBuffer,
MediaFormat::Param aFormat, const TimeUnit& aDuration)
{
// The output on Android is always 16-bit signed
nsresult rv;
int32_t numChannels;
NS_ENSURE_SUCCESS(rv =
aFormat->GetInteger(NS_LITERAL_STRING("channel-count"), &numChannels), rv);
AudioConfig::ChannelLayout layout(numChannels);
if (!layout.IsValid()) {
return NS_ERROR_FAILURE;
}
int32_t sampleRate;
NS_ENSURE_SUCCESS(rv =
aFormat->GetInteger(NS_LITERAL_STRING("sample-rate"), &sampleRate), rv);
int32_t size;
NS_ENSURE_SUCCESS(rv = aInfo->Size(&size), rv);
int32_t offset;
NS_ENSURE_SUCCESS(rv = aInfo->Offset(&offset), rv);
#ifdef MOZ_SAMPLE_TYPE_S16
const int32_t numSamples = size / 2;
#else
#error We only support 16-bit integer PCM
#endif
const int32_t numFrames = numSamples / numChannels;
AlignedAudioBuffer audio(numSamples);
if (!audio) {
return NS_ERROR_OUT_OF_MEMORY;
}
const uint8_t* bufferStart = static_cast<uint8_t*>(aBuffer) + offset;
PodCopy(audio.get(), reinterpret_cast<const AudioDataValue*>(bufferStart),
numSamples);
int64_t presentationTimeUs;
NS_ENSURE_SUCCESS(rv = aInfo->PresentationTimeUs(&presentationTimeUs), rv);
RefPtr<AudioData> data = new AudioData(0, presentationTimeUs,
aDuration.ToMicroseconds(),
numFrames,
Move(audio),
numChannels,
sampleRate);
INVOKE_CALLBACK(Output, data);
return NS_OK;
}
};
MediaDataDecoder*
MediaCodecDataDecoder::CreateAudioDecoder(const AudioInfo& aConfig,
MediaFormat::Param aFormat,
MediaDataDecoderCallback* aCallback)
{
return new AudioDataDecoder(aConfig, aFormat, aCallback);
}
MediaDataDecoder*
MediaCodecDataDecoder::CreateVideoDecoder(const VideoInfo& aConfig,
MediaFormat::Param aFormat,
MediaDataDecoderCallback* aCallback,
layers::ImageContainer* aImageContainer)
{
return new VideoDataDecoder(aConfig, aFormat, aCallback, aImageContainer);
}
MediaCodecDataDecoder::MediaCodecDataDecoder(MediaData::Type aType,
const nsACString& aMimeType,
MediaFormat::Param aFormat,
MediaDataDecoderCallback* aCallback)
: mType(aType)
, mMimeType(aMimeType)
, mFormat(aFormat)
, mCallback(aCallback)
, mInputBuffers(nullptr)
, mOutputBuffers(nullptr)
, mMonitor("MediaCodecDataDecoder::mMonitor")
, mState(ModuleState::kDecoding)
{
}
MediaCodecDataDecoder::~MediaCodecDataDecoder()
{
Shutdown();
}
RefPtr<MediaDataDecoder::InitPromise>
MediaCodecDataDecoder::Init()
{
nsresult rv = InitDecoder(nullptr);
TrackInfo::TrackType type =
(mType == MediaData::AUDIO_DATA ? TrackInfo::TrackType::kAudioTrack
: TrackInfo::TrackType::kVideoTrack);
return NS_SUCCEEDED(rv) ?
InitPromise::CreateAndResolve(type, __func__) :
InitPromise::CreateAndReject(
NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__);
}
nsresult
MediaCodecDataDecoder::InitDecoder(Surface::Param aSurface)
{
mDecoder = CreateDecoder(mMimeType);
if (!mDecoder) {
INVOKE_CALLBACK(Error,
MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__));
return NS_ERROR_FAILURE;
}
nsresult rv;
NS_ENSURE_SUCCESS(rv = mDecoder->Configure(mFormat, aSurface, nullptr, 0), rv);
NS_ENSURE_SUCCESS(rv = mDecoder->Start(), rv);
NS_ENSURE_SUCCESS(rv = ResetInputBuffers(), rv);
NS_ENSURE_SUCCESS(rv = ResetOutputBuffers(), rv);
nsCOMPtr<nsIRunnable> r = NewRunnableMethod(this, &MediaCodecDataDecoder::DecoderLoop);
rv = NS_NewNamedThread("MC Decoder", getter_AddRefs(mThread), r);
return rv;
}
// This is in usec, so that's 10ms.
static const int64_t kDecoderTimeout = 10000;
#define BREAK_ON_DECODER_ERROR() \
if (NS_FAILED(res)) { \
NS_WARNING("Exiting decoder loop due to exception"); \
if (mState == ModuleState::kDrainDecoder) { \
INVOKE_CALLBACK(DrainComplete); \
SetState(ModuleState::kDecoding); \
} \
INVOKE_CALLBACK(Error, MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__)); \
break; \
}
nsresult
MediaCodecDataDecoder::GetInputBuffer(
JNIEnv* aEnv, int aIndex, jni::Object::LocalRef* aBuffer)
{
MOZ_ASSERT(aEnv);
MOZ_ASSERT(!*aBuffer);
int numTries = 2;
while (numTries--) {
*aBuffer = jni::Object::LocalRef::Adopt(
aEnv->GetObjectArrayElement(mInputBuffers.Get(), aIndex));
if (*aBuffer) {
return NS_OK;
}
nsresult res = ResetInputBuffers();
if (NS_FAILED(res)) {
return res;
}
}
return NS_ERROR_FAILURE;
}
bool
MediaCodecDataDecoder::WaitForInput()
{
MonitorAutoLock lock(mMonitor);
while (mState == ModuleState::kDecoding && mQueue.empty()) {
// Signal that we require more input.
INVOKE_CALLBACK(InputExhausted);
lock.Wait();
}
return mState != ModuleState::kStopping;
}
already_AddRefed<MediaRawData>
MediaCodecDataDecoder::PeekNextSample()
{
MonitorAutoLock lock(mMonitor);
if (mState == ModuleState::kFlushing) {
mDecoder->Flush();
ClearQueue();
SetState(ModuleState::kDecoding);
lock.Notify();
return nullptr;
}
if (mQueue.empty()) {
if (mState == ModuleState::kDrainQueue) {
SetState(ModuleState::kDrainDecoder);
}
return nullptr;
}
// We're not stopping or flushing, so try to get a sample.
return RefPtr<MediaRawData>(mQueue.front()).forget();
}
nsresult
MediaCodecDataDecoder::QueueSample(const MediaRawData* aSample)
{
MOZ_ASSERT(aSample);
AutoLocalJNIFrame frame(jni::GetEnvForThread(), 1);
// We have a sample, try to feed it to the decoder.
int32_t inputIndex = -1;
nsresult res = mDecoder->DequeueInputBuffer(kDecoderTimeout, &inputIndex);
if (NS_FAILED(res)) {
return res;
}
if (inputIndex < 0) {
// There is no valid input buffer available.
return NS_ERROR_FAILURE;
}
jni::Object::LocalRef buffer(frame.GetEnv());
res = GetInputBuffer(frame.GetEnv(), inputIndex, &buffer);
if (NS_FAILED(res)) {
return res;
}
void* directBuffer = frame.GetEnv()->GetDirectBufferAddress(buffer.Get());
MOZ_ASSERT(frame.GetEnv()->GetDirectBufferCapacity(buffer.Get()) >=
aSample->Size(),
"Decoder buffer is not large enough for sample");
PodCopy(static_cast<uint8_t*>(directBuffer), aSample->Data(), aSample->Size());
CryptoInfo::LocalRef cryptoInfo = GetCryptoInfoFromSample(aSample);
if (cryptoInfo) {
res = mDecoder->QueueSecureInputBuffer(inputIndex, 0, cryptoInfo,
aSample->mTime, 0);
} else {
res = mDecoder->QueueInputBuffer(inputIndex, 0, aSample->Size(),
aSample->mTime, 0);
}
if (NS_FAILED(res)) {
return res;
}
mDurations.push_back(TimeUnit::FromMicroseconds(aSample->mDuration));
return NS_OK;
}
nsresult
MediaCodecDataDecoder::QueueEOS()
{
mMonitor.AssertCurrentThreadOwns();
nsresult res = NS_OK;
int32_t inputIndex = -1;
res = mDecoder->DequeueInputBuffer(kDecoderTimeout, &inputIndex);
if (NS_FAILED(res) || inputIndex < 0) {
return res;
}
res = mDecoder->QueueInputBuffer(inputIndex, 0, 0, 0,
MediaCodec::BUFFER_FLAG_END_OF_STREAM);
if (NS_SUCCEEDED(res)) {
SetState(ModuleState::kDrainWaitEOS);
mMonitor.Notify();
}
return res;
}
void
MediaCodecDataDecoder::HandleEOS(int32_t aOutputStatus)
{
MonitorAutoLock lock(mMonitor);
if (mState == ModuleState::kDrainWaitEOS) {
SetState(ModuleState::kDecoding);
mMonitor.Notify();
INVOKE_CALLBACK(DrainComplete);
}
mDecoder->ReleaseOutputBuffer(aOutputStatus, false);
}
Maybe<TimeUnit>
MediaCodecDataDecoder::GetOutputDuration()
{
if (mDurations.empty()) {
return Nothing();
}
const Maybe<TimeUnit> duration = Some(mDurations.front());
mDurations.pop_front();
return duration;
}
nsresult
MediaCodecDataDecoder::ProcessOutput(
BufferInfo::Param aInfo, MediaFormat::Param aFormat, int32_t aStatus)
{
AutoLocalJNIFrame frame(jni::GetEnvForThread(), 1);
const Maybe<TimeUnit> duration = GetOutputDuration();
if (!duration) {
// Some devices report failure in QueueSample while actually succeeding at
// it, in which case we get an output buffer without having a cached duration
// (bug 1273523).
return NS_OK;
}
const auto buffer = jni::Object::LocalRef::Adopt(
frame.GetEnv()->GetObjectArrayElement(mOutputBuffers.Get(), aStatus));
if (buffer) {
// The buffer will be null on Android L if we are decoding to a Surface.
void* directBuffer = frame.GetEnv()->GetDirectBufferAddress(buffer.Get());
Output(aInfo, directBuffer, aFormat, duration.value());
}
// The Surface will be updated at this point (for video).
mDecoder->ReleaseOutputBuffer(aStatus, true);
PostOutput(aInfo, aFormat, duration.value());
return NS_OK;
}
void
MediaCodecDataDecoder::DecoderLoop()
{
bool isOutputDone = false;
AutoLocalJNIFrame frame(jni::GetEnvForThread(), 1);
MediaFormat::LocalRef outputFormat(frame.GetEnv());
nsresult res = NS_OK;
while (WaitForInput()) {
RefPtr<MediaRawData> sample = PeekNextSample();
{
MonitorAutoLock lock(mMonitor);
if (mState == ModuleState::kDrainDecoder) {
MOZ_ASSERT(!sample, "Shouldn't have a sample when pushing EOF frame");
res = QueueEOS();
BREAK_ON_DECODER_ERROR();
}
}
if (sample) {
res = QueueSample(sample);
if (NS_SUCCEEDED(res)) {
// We've fed this into the decoder, so remove it from the queue.
MonitorAutoLock lock(mMonitor);
MOZ_RELEASE_ASSERT(mQueue.size(), "Queue may not be empty");
mQueue.pop_front();
isOutputDone = false;
}
}
if (isOutputDone) {
continue;
}
BufferInfo::LocalRef bufferInfo;
nsresult res = BufferInfo::New(&bufferInfo);
BREAK_ON_DECODER_ERROR();
int32_t outputStatus = -1;
res = mDecoder->DequeueOutputBuffer(bufferInfo, kDecoderTimeout,
&outputStatus);
BREAK_ON_DECODER_ERROR();
if (outputStatus == MediaCodec::INFO_TRY_AGAIN_LATER) {
// We might want to call mCallback->InputExhausted() here, but there seems
// to be some possible bad interactions here with the threading.
} else if (outputStatus == MediaCodec::INFO_OUTPUT_BUFFERS_CHANGED) {
res = ResetOutputBuffers();
BREAK_ON_DECODER_ERROR();
} else if (outputStatus == MediaCodec::INFO_OUTPUT_FORMAT_CHANGED) {
res = mDecoder->GetOutputFormat(ReturnTo(&outputFormat));
BREAK_ON_DECODER_ERROR();
} else if (outputStatus < 0) {
NS_WARNING("Unknown error from decoder!");
INVOKE_CALLBACK(Error,
MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR,
__func__));
// Don't break here just in case it's recoverable. If it's not, other
// stuff will fail later and we'll bail out.
} else {
// We have a valid buffer index >= 0 here.
int32_t flags;
nsresult res = bufferInfo->Flags(&flags);
BREAK_ON_DECODER_ERROR();
if (flags & MediaCodec::BUFFER_FLAG_END_OF_STREAM) {
HandleEOS(outputStatus);
isOutputDone = true;
// We only queue empty EOF frames, so we're done for now.
continue;
}
res = ProcessOutput(bufferInfo, outputFormat, outputStatus);
BREAK_ON_DECODER_ERROR();
}
}
Cleanup();
// We're done.
MonitorAutoLock lock(mMonitor);
SetState(ModuleState::kShutdown);
mMonitor.Notify();
}
const char*
MediaCodecDataDecoder::ModuleStateStr(ModuleState aState) {
switch (aState) {
case ModuleState::kDecoding: return "Decoding";
case ModuleState::kFlushing: return "Flushing";
case ModuleState::kDrainQueue: return "DrainQueue";
case ModuleState::kDrainDecoder: return "DrainDecoder";
case ModuleState::kDrainWaitEOS: return "DrainWaitEOS";
case ModuleState::kStopping: return "Stopping";
case ModuleState::kShutdown: return "Shutdown";
default: MOZ_ASSERT_UNREACHABLE("Invalid state.");
}
return "Unknown";
}
bool
MediaCodecDataDecoder::SetState(ModuleState aState)
{
bool ok = true;
if (mState == ModuleState::kShutdown) {
ok = false;
} else if (mState == ModuleState::kStopping) {
ok = aState == ModuleState::kShutdown;
} else if (aState == ModuleState::kDrainDecoder) {
ok = mState == ModuleState::kDrainQueue;
} else if (aState == ModuleState::kDrainWaitEOS) {
ok = mState == ModuleState::kDrainDecoder;
}
if (ok) {
LOG("%s -> %s", ModuleStateStr(mState), ModuleStateStr(aState));
mState = aState;
} else {
LOG("Fail to transit from %s to %s state", ModuleStateStr(mState), ModuleStateStr(aState));
}
return ok;
}
void
MediaCodecDataDecoder::ClearQueue()
{
mMonitor.AssertCurrentThreadOwns();
mQueue.clear();
mDurations.clear();
}
void
MediaCodecDataDecoder::Input(MediaRawData* aSample)
{
MonitorAutoLock lock(mMonitor);
mQueue.push_back(aSample);
lock.NotifyAll();
}
nsresult
MediaCodecDataDecoder::ResetInputBuffers()
{
return mDecoder->GetInputBuffers(ReturnTo(&mInputBuffers));
}
nsresult
MediaCodecDataDecoder::ResetOutputBuffers()
{
return mDecoder->GetOutputBuffers(ReturnTo(&mOutputBuffers));
}
void
MediaCodecDataDecoder::Flush()
{
MonitorAutoLock lock(mMonitor);
if (!SetState(ModuleState::kFlushing)) {
return;
}
lock.Notify();
while (mState == ModuleState::kFlushing) {
lock.Wait();
}
}
void
MediaCodecDataDecoder::Drain()
{
MonitorAutoLock lock(mMonitor);
if (mState == ModuleState::kDrainDecoder ||
mState == ModuleState::kDrainQueue) {
return;
}
SetState(ModuleState::kDrainQueue);
lock.Notify();
}
void
MediaCodecDataDecoder::Shutdown()
{
MonitorAutoLock lock(mMonitor);
SetState(ModuleState::kStopping);
lock.Notify();
while (mThread && mState != ModuleState::kShutdown) {
lock.Wait();
}
if (mThread) {
mThread->Shutdown();
mThread = nullptr;
}
if (mDecoder) {
mDecoder->Stop();
mDecoder->Release();
mDecoder = nullptr;
}
}
} // mozilla
@@ -1,126 +0,0 @@
/* 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/. */
#ifndef MediaCodecDataDecoder_h_
#define MediaCodecDataDecoder_h_
#include "AndroidDecoderModule.h"
#include "MediaCodec.h"
#include "SurfaceTexture.h"
#include "TimeUnits.h"
#include "mozilla/Monitor.h"
#include "mozilla/Maybe.h"
#include <deque>
namespace mozilla {
typedef std::deque<RefPtr<MediaRawData>> SampleQueue;
class MediaCodecDataDecoder : public MediaDataDecoder {
public:
static MediaDataDecoder* CreateAudioDecoder(const AudioInfo& aConfig,
java::sdk::MediaFormat::Param aFormat,
MediaDataDecoderCallback* aCallback);
static MediaDataDecoder* CreateVideoDecoder(const VideoInfo& aConfig,
java::sdk::MediaFormat::Param aFormat,
MediaDataDecoderCallback* aCallback,
layers::ImageContainer* aImageContainer);
virtual ~MediaCodecDataDecoder();
RefPtr<MediaDataDecoder::InitPromise> Init() override;
void Flush() override;
void Drain() override;
void Shutdown() override;
void Input(MediaRawData* aSample) override;
const char* GetDescriptionName() const override
{
return "Android MediaCodec decoder";
}
protected:
enum class ModuleState : uint8_t {
kDecoding = 0,
kFlushing,
kDrainQueue,
kDrainDecoder,
kDrainWaitEOS,
kStopping,
kShutdown
};
friend class AndroidDecoderModule;
MediaCodecDataDecoder(MediaData::Type aType,
const nsACString& aMimeType,
java::sdk::MediaFormat::Param aFormat,
MediaDataDecoderCallback* aCallback);
static const char* ModuleStateStr(ModuleState aState);
virtual nsresult InitDecoder(java::sdk::Surface::Param aSurface);
virtual nsresult Output(java::sdk::BufferInfo::Param aInfo, void* aBuffer,
java::sdk::MediaFormat::Param aFormat, const media::TimeUnit& aDuration)
{
return NS_OK;
}
virtual nsresult PostOutput(java::sdk::BufferInfo::Param aInfo,
java::sdk::MediaFormat::Param aFormat, const media::TimeUnit& aDuration)
{
return NS_OK;
}
virtual void Cleanup() {};
nsresult ResetInputBuffers();
nsresult ResetOutputBuffers();
nsresult GetInputBuffer(JNIEnv* env, int index, jni::Object::LocalRef* buffer);
bool WaitForInput();
already_AddRefed<MediaRawData> PeekNextSample();
nsresult QueueSample(const MediaRawData* aSample);
nsresult QueueEOS();
void HandleEOS(int32_t aOutputStatus);
Maybe<media::TimeUnit> GetOutputDuration();
nsresult ProcessOutput(java::sdk::BufferInfo::Param aInfo,
java::sdk::MediaFormat::Param aFormat,
int32_t aStatus);
// Sets decoder state and returns whether the new state has become effective.
bool SetState(ModuleState aState);
void DecoderLoop();
virtual void ClearQueue();
MediaData::Type mType;
nsAutoCString mMimeType;
java::sdk::MediaFormat::GlobalRef mFormat;
MediaDataDecoderCallback* mCallback;
java::sdk::MediaCodec::GlobalRef mDecoder;
jni::ObjectArray::GlobalRef mInputBuffers;
jni::ObjectArray::GlobalRef mOutputBuffers;
nsCOMPtr<nsIThread> mThread;
// Only these members are protected by mMonitor.
Monitor mMonitor;
ModuleState mState;
SampleQueue mQueue;
// Durations are stored in microseconds.
std::deque<media::TimeUnit> mDurations;
};
} // namespace mozilla
#endif
@@ -1,489 +0,0 @@
/* 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 "AndroidDecoderModule.h"
#include "AndroidBridge.h"
#include "AndroidSurfaceTexture.h"
#include "FennecJNINatives.h"
#include "GLImages.h"
#include "MediaData.h"
#include "MediaInfo.h"
#include "VideoUtils.h"
#include "VPXDecoder.h"
#include "nsThreadUtils.h"
#include "nsPromiseFlatString.h"
#include "nsIGfxInfo.h"
#include "prlog.h"
#include <jni.h>
#include <deque>
#undef LOG
#define LOG(arg, ...) MOZ_LOG(sAndroidDecoderModuleLog, \
mozilla::LogLevel::Debug, ("RemoteDataDecoder(%p)::%s: " arg, \
this, __func__, ##__VA_ARGS__))
using namespace mozilla;
using namespace mozilla::gl;
using namespace mozilla::java;
using namespace mozilla::java::sdk;
using media::TimeUnit;
namespace mozilla {
class JavaCallbacksSupport
: public CodecProxy::NativeCallbacks::Natives<JavaCallbacksSupport>
{
public:
typedef CodecProxy::NativeCallbacks::Natives<JavaCallbacksSupport> Base;
using Base::AttachNative;
JavaCallbacksSupport(MediaDataDecoderCallback* aDecoderCallback)
: mDecoderCallback(aDecoderCallback)
{
MOZ_ASSERT(aDecoderCallback);
}
virtual ~JavaCallbacksSupport() {}
void OnInputExhausted()
{
if (mDecoderCallback) {
mDecoderCallback->InputExhausted();
}
}
virtual void HandleOutput(Sample::Param aSample) = 0;
void OnOutput(jni::Object::Param aSample)
{
if (mDecoderCallback) {
HandleOutput(Sample::Ref::From(aSample));
}
}
virtual void HandleOutputFormatChanged(MediaFormat::Param aFormat) {};
void OnOutputFormatChanged(jni::Object::Param aFormat)
{
if (mDecoderCallback) {
HandleOutputFormatChanged(MediaFormat::Ref::From(aFormat));
}
}
void OnError(bool aIsFatal)
{
if (mDecoderCallback) {
mDecoderCallback->Error(aIsFatal ?
MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__) :
MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, __func__));
}
}
void DisposeNative()
{
// TODO
}
void Cancel()
{
mDecoderCallback = nullptr;
}
protected:
MediaDataDecoderCallback* mDecoderCallback;
};
struct SampleTime final
{
SampleTime(int64_t aStart, int64_t aDuration)
: mStart(aStart)
, mDuration(aDuration)
{}
int64_t mStart;
int64_t mDuration;
};
class RemoteVideoDecoder final : public RemoteDataDecoder
{
public:
class CallbacksSupport final : public JavaCallbacksSupport
{
public:
CallbacksSupport(RemoteVideoDecoder* aDecoder, MediaDataDecoderCallback* aCallback)
: JavaCallbacksSupport(aCallback)
, mDecoder(aDecoder)
{}
virtual ~CallbacksSupport() {}
void HandleOutput(Sample::Param aSample) override
{
Maybe<int64_t> durationUs = mDecoder->mInputDurations.Get();
if (!durationUs) {
return;
}
BufferInfo::LocalRef info = aSample->Info();
int32_t flags;
bool ok = NS_SUCCEEDED(info->Flags(&flags));
MOZ_ASSERT(ok);
int32_t offset;
ok |= NS_SUCCEEDED(info->Offset(&offset));
MOZ_ASSERT(ok);
int64_t presentationTimeUs;
ok |= NS_SUCCEEDED(info->PresentationTimeUs(&presentationTimeUs));
MOZ_ASSERT(ok);
int32_t size;
ok |= NS_SUCCEEDED(info->Size(&size));
MOZ_ASSERT(ok);
NS_ENSURE_TRUE_VOID(ok);
if (size > 0) {
RefPtr<layers::Image> img =
new SurfaceTextureImage(mDecoder->mSurfaceTexture.get(), mDecoder->mConfig.mDisplay,
gl::OriginPos::BottomLeft);
RefPtr<VideoData> v =
VideoData::CreateFromImage(mDecoder->mConfig,
offset,
presentationTimeUs,
durationUs.value(),
img,
!!(flags & MediaCodec::BUFFER_FLAG_SYNC_FRAME),
presentationTimeUs,
gfx::IntRect(0, 0,
mDecoder->mConfig.mDisplay.width,
mDecoder->mConfig.mDisplay.height));
mDecoderCallback->Output(v);
}
if ((flags & MediaCodec::BUFFER_FLAG_END_OF_STREAM) != 0) {
mDecoderCallback->DrainComplete();
}
}
friend class RemoteDataDecoder;
private:
RemoteVideoDecoder* mDecoder;
};
RemoteVideoDecoder(const VideoInfo& aConfig,
MediaFormat::Param aFormat,
MediaDataDecoderCallback* aCallback,
layers::ImageContainer* aImageContainer)
: RemoteDataDecoder(MediaData::Type::VIDEO_DATA, aConfig.mMimeType,
aFormat, aCallback)
, mImageContainer(aImageContainer)
, mConfig(aConfig)
{
}
RefPtr<InitPromise> Init() override
{
mSurfaceTexture = AndroidSurfaceTexture::Create();
if (!mSurfaceTexture) {
NS_WARNING("Failed to create SurfaceTexture for video decode\n");
return InitPromise::CreateAndReject(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__);
}
if (!jni::IsFennec()) {
NS_WARNING("Remote decoding not supported in non-Fennec environment\n");
return InitPromise::CreateAndReject(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__);
}
// Register native methods.
JavaCallbacksSupport::Init();
mJavaCallbacks = CodecProxy::NativeCallbacks::New();
JavaCallbacksSupport::AttachNative(mJavaCallbacks,
mozilla::MakeUnique<CallbacksSupport>(this, mCallback));
mJavaDecoder = CodecProxy::Create(mFormat, mSurfaceTexture->JavaSurface(), mJavaCallbacks);
if (mJavaDecoder == nullptr) {
return InitPromise::CreateAndReject(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__);
}
mInputDurations.Clear();
return InitPromise::CreateAndResolve(TrackInfo::kVideoTrack, __func__);
}
void Flush() override
{
mInputDurations.Clear();
RemoteDataDecoder::Flush();
}
void Drain() override
{
RemoteDataDecoder::Drain();
mInputDurations.Put(0);
}
void Input(MediaRawData* aSample) override
{
RemoteDataDecoder::Input(aSample);
mInputDurations.Put(aSample->mDuration);
}
private:
class DurationQueue {
public:
void Clear()
{
mValues.clear();
}
void Put(int64_t aDurationUs)
{
mValues.emplace_back(aDurationUs);
}
Maybe<int64_t> Get()
{
if (mValues.empty()) {
return Nothing();
}
auto value = Some(mValues.front());
mValues.pop_front();
return value;
}
private:
std::deque<int64_t> mValues;
};
layers::ImageContainer* mImageContainer;
const VideoInfo& mConfig;
RefPtr<AndroidSurfaceTexture> mSurfaceTexture;
DurationQueue mInputDurations;
};
class RemoteAudioDecoder final : public RemoteDataDecoder
{
public:
RemoteAudioDecoder(const AudioInfo& aConfig,
MediaFormat::Param aFormat,
MediaDataDecoderCallback* aCallback)
: RemoteDataDecoder(MediaData::Type::AUDIO_DATA, aConfig.mMimeType,
aFormat, aCallback)
, mConfig(aConfig)
{
JNIEnv* const env = jni::GetEnvForThread();
bool formatHasCSD = false;
NS_ENSURE_SUCCESS_VOID(aFormat->ContainsKey(NS_LITERAL_STRING("csd-0"), &formatHasCSD));
if (!formatHasCSD && aConfig.mCodecSpecificConfig->Length() >= 2) {
jni::ByteBuffer::LocalRef buffer(env);
buffer = jni::ByteBuffer::New(
aConfig.mCodecSpecificConfig->Elements(),
aConfig.mCodecSpecificConfig->Length());
NS_ENSURE_SUCCESS_VOID(aFormat->SetByteBuffer(NS_LITERAL_STRING("csd-0"),
buffer));
}
}
RefPtr<InitPromise> Init() override
{
// Register native methods.
JavaCallbacksSupport::Init();
mJavaCallbacks = CodecProxy::NativeCallbacks::New();
JavaCallbacksSupport::AttachNative(mJavaCallbacks,
mozilla::MakeUnique<CallbacksSupport>(this, mCallback));
mJavaDecoder = CodecProxy::Create(mFormat, nullptr, mJavaCallbacks);
if (mJavaDecoder == nullptr) {
return InitPromise::CreateAndReject(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__);
}
return InitPromise::CreateAndResolve(TrackInfo::kAudioTrack, __func__);
}
private:
class CallbacksSupport final : public JavaCallbacksSupport
{
public:
CallbacksSupport(RemoteAudioDecoder* aDecoder, MediaDataDecoderCallback* aCallback)
: JavaCallbacksSupport(aCallback)
, mDecoder(aDecoder)
{}
virtual ~CallbacksSupport() {}
void HandleOutput(Sample::Param aSample) override
{
BufferInfo::LocalRef info = aSample->Info();
int32_t flags;
bool ok = NS_SUCCEEDED(info->Flags(&flags));
MOZ_ASSERT(ok);
int32_t offset;
ok |= NS_SUCCEEDED(info->Offset(&offset));
MOZ_ASSERT(ok);
int64_t presentationTimeUs;
ok |= NS_SUCCEEDED(info->PresentationTimeUs(&presentationTimeUs));
MOZ_ASSERT(ok);
int32_t size;
ok |= NS_SUCCEEDED(info->Size(&size));
MOZ_ASSERT(ok);
NS_ENSURE_TRUE_VOID(ok);
if (size > 0) {
#ifdef MOZ_SAMPLE_TYPE_S16
const int32_t numSamples = size / 2;
#else
#error We only support 16-bit integer PCM
#endif
const int32_t numFrames = numSamples / mOutputChannels;
AlignedAudioBuffer audio(numSamples);
if (!audio) {
return;
}
jni::ByteBuffer::LocalRef dest = jni::ByteBuffer::New(audio.get(), size);
aSample->WriteToByteBuffer(dest);
RefPtr<AudioData> data = new AudioData(0, presentationTimeUs,
FramesToUsecs(numFrames, mOutputSampleRate).value(),
numFrames,
Move(audio),
mOutputChannels,
mOutputSampleRate);
mDecoderCallback->Output(data);
}
if ((flags & MediaCodec::BUFFER_FLAG_END_OF_STREAM) != 0) {
mDecoderCallback->DrainComplete();
return;
}
}
void HandleOutputFormatChanged(MediaFormat::Param aFormat) override
{
aFormat->GetInteger(NS_LITERAL_STRING("channel-count"), &mOutputChannels);
AudioConfig::ChannelLayout layout(mOutputChannels);
if (!layout.IsValid()) {
mDecoderCallback->Error(MediaResult(
NS_ERROR_DOM_MEDIA_FATAL_ERR,
RESULT_DETAIL("Invalid channel layout:%d", mOutputChannels)));
return;
}
aFormat->GetInteger(NS_LITERAL_STRING("sample-rate"), &mOutputSampleRate);
LOG("Audio output format changed: channels:%d sample rate:%d", mOutputChannels, mOutputSampleRate);
}
private:
RemoteAudioDecoder* mDecoder;
int32_t mOutputChannels;
int32_t mOutputSampleRate;
};
const AudioInfo& mConfig;
};
MediaDataDecoder*
RemoteDataDecoder::CreateAudioDecoder(const AudioInfo& aConfig,
MediaFormat::Param aFormat,
MediaDataDecoderCallback* aCallback)
{
return new RemoteAudioDecoder(aConfig, aFormat, aCallback);
}
MediaDataDecoder*
RemoteDataDecoder::CreateVideoDecoder(const VideoInfo& aConfig,
MediaFormat::Param aFormat,
MediaDataDecoderCallback* aCallback,
layers::ImageContainer* aImageContainer)
{
return new RemoteVideoDecoder(aConfig, aFormat, aCallback, aImageContainer);
}
RemoteDataDecoder::RemoteDataDecoder(MediaData::Type aType,
const nsACString& aMimeType,
MediaFormat::Param aFormat,
MediaDataDecoderCallback* aCallback)
: mType(aType)
, mMimeType(aMimeType)
, mFormat(aFormat)
, mCallback(aCallback)
{
}
void
RemoteDataDecoder::Flush()
{
mJavaDecoder->Flush();
}
void
RemoteDataDecoder::Drain()
{
BufferInfo::LocalRef bufferInfo;
nsresult rv = BufferInfo::New(&bufferInfo);
NS_ENSURE_SUCCESS_VOID(rv);
bufferInfo->Set(0, 0, -1, MediaCodec::BUFFER_FLAG_END_OF_STREAM);
mJavaDecoder->Input(nullptr, bufferInfo, nullptr);
}
void
RemoteDataDecoder::Shutdown()
{
LOG("");
MOZ_ASSERT(mJavaDecoder && mJavaCallbacks);
mJavaDecoder->Release();
mJavaDecoder = nullptr;
JavaCallbacksSupport::GetNative(mJavaCallbacks)->Cancel();
mJavaCallbacks = nullptr;
mFormat = nullptr;
}
void
RemoteDataDecoder::Input(MediaRawData* aSample)
{
MOZ_ASSERT(aSample != nullptr);
jni::ByteBuffer::LocalRef bytes = jni::ByteBuffer::New(const_cast<uint8_t*>(aSample->Data()),
aSample->Size());
BufferInfo::LocalRef bufferInfo;
nsresult rv = BufferInfo::New(&bufferInfo);
if (NS_FAILED(rv)) {
mCallback->Error(MediaResult(NS_ERROR_OUT_OF_MEMORY, __func__));
return;
}
bufferInfo->Set(0, aSample->Size(), aSample->mTime, 0);
mJavaDecoder->Input(bytes, bufferInfo, GetCryptoInfoFromSample(aSample));
}
} // mozilla
@@ -1,62 +0,0 @@
/* 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/. */
#ifndef RemoteDataDecoder_h_
#define RemoteDataDecoder_h_
#include "AndroidDecoderModule.h"
#include "FennecJNIWrappers.h"
#include "SurfaceTexture.h"
#include "TimeUnits.h"
#include "mozilla/Monitor.h"
#include "mozilla/Maybe.h"
#include <deque>
namespace mozilla {
class RemoteDataDecoder : public MediaDataDecoder {
public:
static MediaDataDecoder* CreateAudioDecoder(const AudioInfo& aConfig,
java::sdk::MediaFormat::Param aFormat,
MediaDataDecoderCallback* aCallback);
static MediaDataDecoder* CreateVideoDecoder(const VideoInfo& aConfig,
java::sdk::MediaFormat::Param aFormat,
MediaDataDecoderCallback* aCallback,
layers::ImageContainer* aImageContainer);
virtual ~RemoteDataDecoder() {}
void Flush() override;
void Drain() override;
void Shutdown() override;
void Input(MediaRawData* aSample) override;
const char* GetDescriptionName() const override
{
return "android remote decoder";
}
protected:
RemoteDataDecoder(MediaData::Type aType,
const nsACString& aMimeType,
java::sdk::MediaFormat::Param aFormat,
MediaDataDecoderCallback* aCallback);
MediaData::Type mType;
nsAutoCString mMimeType;
java::sdk::MediaFormat::GlobalRef mFormat;
MediaDataDecoderCallback* mCallback;
java::CodecProxy::GlobalRef mJavaDecoder;
java::CodecProxy::NativeCallbacks::GlobalRef mJavaCallbacks;
};
} // namespace mozilla
#endif
-10
View File
@@ -80,16 +80,6 @@ if CONFIG['MOZ_APPLEMEDIA']:
include('/ipc/chromium/chromium-config.mozbuild')
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
EXPORTS += [
'android/AndroidDecoderModule.h',
]
SOURCES += [
'android/AndroidDecoderModule.cpp',
'android/MediaCodecDataDecoder.cpp',
'android/RemoteDataDecoder.cpp',
]
FINAL_LIBRARY = 'xul'
if CONFIG['GNU_CXX']:
+11 -10
View File
@@ -42,19 +42,20 @@ ReverbInputBuffer::ReverbInputBuffer(size_t length)
void ReverbInputBuffer::write(const float* sourceP, size_t numberOfFrames)
{
size_t bufferLength = m_buffer.Length();
bool isCopySafe = m_writeIndex + numberOfFrames <= bufferLength;
MOZ_ASSERT(isCopySafe);
if (!isCopySafe)
return;
// m_writeIndex is atomic and checked by other threads, so only touch
// it at the start and end.
size_t index = m_writeIndex;
memcpy(m_buffer.Elements() + m_writeIndex, sourceP, sizeof(float) * numberOfFrames);
size_t bufferLength = m_buffer.Length();
size_t newIndex = index + numberOfFrames;
m_writeIndex += numberOfFrames;
MOZ_ASSERT(m_writeIndex <= bufferLength);
MOZ_RELEASE_ASSERT(newIndex <= bufferLength);
if (m_writeIndex >= bufferLength)
m_writeIndex = 0;
memcpy(m_buffer.Elements() + index, sourceP, sizeof(float) * numberOfFrames);
if (newIndex >= bufferLength) {
m_writeIndex = 0;
}
}
float* ReverbInputBuffer::directReadFrom(int* readIndex, size_t numberOfFrames)
+2 -1
View File
@@ -30,6 +30,7 @@
#define ReverbInputBuffer_h
#include "nsTArray.h"
#include "mozilla/Atomics.h"
#include "mozilla/MemoryReporting.h"
namespace WebCore {
@@ -63,7 +64,7 @@ public:
private:
nsTArray<float> m_buffer;
size_t m_writeIndex;
mozilla::Atomic<size_t, mozilla::ReleaseAcquire> m_writeIndex;
};
} // namespace WebCore
+5 -1
View File
@@ -5,6 +5,7 @@
#ifndef mozilla_dom_MessagePortParent_h
#define mozilla_dom_MessagePortParent_h
#include "mozilla/WeakPtr.h"
#include "mozilla/dom/PMessagePortParent.h"
namespace mozilla {
@@ -12,7 +13,8 @@ namespace dom {
class MessagePortService;
class MessagePortParent final : public PMessagePortParent
class MessagePortParent final : public PMessagePortParent,
public SupportsWeakPtr<MessagePortParent>
{
public:
explicit MessagePortParent(const nsID& aUUID);
@@ -40,6 +42,8 @@ public:
const nsID& aDestinationUUID,
const uint32_t& aSequenceID);
MOZ_DECLARE_WEAKREFERENCE_TYPENAME(MessagePortParent)
private:
virtual bool RecvPostMessages(nsTArray<MessagePortMessage>&& aMessages)
override;
+8 -3
View File
@@ -9,6 +9,7 @@
#include "mozilla/ipc/BackgroundParent.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/Unused.h"
#include "mozilla/WeakPtr.h"
#include "nsTArray.h"
using mozilla::ipc::AssertIsOnBackgroundThread;
@@ -59,7 +60,7 @@ public:
{
uint32_t mSequenceID;
// MessagePortParent keeps the service alive, and we don't want a cycle.
MessagePortParent* mParent;
WeakPtr<MessagePortParent> mParent;
};
FallibleTArray<NextParent> mNextParents;
@@ -275,9 +276,13 @@ MessagePortService::CloseAll(const nsID& aUUID, bool aForced)
data->mParent->Close();
}
for (const MessagePortServiceData::NextParent& parent : data->mNextParents) {
parent.mParent->CloseAndDelete();
for (const MessagePortServiceData::NextParent& nextParent : data->mNextParents) {
MessagePortParent* const parent = nextParent.mParent;
if (parent) {
parent->CloseAndDelete();
}
}
data->mNextParents.Clear();
nsID destinationUUID = data->mDestinationUUID;
+6 -7
View File
@@ -46,7 +46,6 @@
#if defined(MOZ_X11)
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "X11UndefineNone.h"
#endif
#endif
@@ -269,12 +268,12 @@ typedef struct
* the parameters to the Windows API IMMNotificationClient object.
* This is the value of the NPNVaudioDeviceChangeDetails variable.
*/
typedef struct _NPAudioDeviceChangeDetails
{
int32_t flow;
int32_t role;
const wchar_t* defaultDevice; // this pointer is only valid during the call
// to NPPSetValue.
typedef struct _NPAudioDeviceChangeDetails
{
int32_t flow;
int32_t role;
const wchar_t* defaultDevice; // this pointer is only valid during the call
// to NPPSetValue.
} NPAudioDeviceChangeDetails;
#endif /* XP_WIN */
@@ -149,8 +149,16 @@ nsContentSecurityManager::CheckFTPSubresourceLoad(nsIChannel* aChannel)
nsIPrincipal* triggeringPrincipal = loadInfo->TriggeringPrincipal();
nsCOMPtr<nsIURI> tURI;
triggeringPrincipal->GetURI(getter_AddRefs(tURI));
if (!tURI) {
// We don't have a triggering principal URI, meaning this isn't actually
// a subresource, but rather a top-level document, i.e. something we can
// display in-browser and might be saving as-is. Allow the load.
return NS_OK;
}
bool isTrigFtpURI = (NS_SUCCEEDED(tURI->SchemeIs("ftp", &isTrigFtpURI)) && isTrigFtpURI);
if (isTrigFtpURI) {
// The document loading this resource is also on FTP, satisfying the SOP.
// Allow the load.
return NS_OK;
}
-18
View File
@@ -1292,24 +1292,6 @@ nsSVGElement::UpdateContentStyleRule()
continue; // xml:lang has precedence
}
if (IsSVGElement(nsGkAtoms::svg)) {
// Special case: we don't want <svg> 'width'/'height' mapped into style
// if the attribute value isn't a valid <length> according to SVG (which
// only supports a subset of the CSS <length> values). We don't enforce
// this by checking the attribute value in SVGSVGElement::
// IsAttributeMapped since we don't want that method to depend on the
// value of the attribute that is being checked. Rather we just prevent
// the actual mapping here, as necessary.
if (attrName->Atom() == nsGkAtoms::width &&
!GetAnimatedLength(nsGkAtoms::width)->HasBaseVal()) {
continue;
}
if (attrName->Atom() == nsGkAtoms::height &&
!GetAnimatedLength(nsGkAtoms::height)->HasBaseVal()) {
continue;
}
}
nsAutoString value;
mAttrsAndChildren.AttrAt(i)->ToString(value);
mappedAttrParser.ParseMappedAttrValue(attrName->Atom(), value);
@@ -496,8 +496,6 @@ var interfaceNamesInGlobalScope =
"HTMLMediaElement",
// IMPORTANT: Do not change this list without review from a DOM peer!
"HTMLMenuElement",
// IMPORTANT: Do not change this list without review from a DOM peer!
"HTMLMenuItemElement",
// IMPORTANT: Do not change this list without review from a DOM peer!
"HTMLMetaElement",
// IMPORTANT: Do not change this list without review from a DOM peer!
@@ -71,7 +71,6 @@
['map', 'Map'],
['mark', ''],
['menu', 'Menu'],
['menuitem', 'MenuItem'],
['meta', 'Meta'],
['meter', 'Meter'],
['nav', ''],
+1 -1
View File
@@ -23,6 +23,6 @@ interface Animatable {
[Func="nsDocument::IsElementAnimateEnabled", Throws]
Animation animate(object? keyframes,
optional UnrestrictedDoubleOrKeyframeAnimationOptions options);
[Func="nsDocument::IsWebAnimationsEnabled"]
[Func="nsDocument::IsWebAnimationsGetAnimationsEnabled"]
sequence<Animation> getAnimations(optional AnimationFilter filter);
};
+1 -1
View File
@@ -19,7 +19,7 @@ interface Animation : EventTarget {
attribute DOMString id;
[Func="nsDocument::IsWebAnimationsEnabled", Pure]
attribute AnimationEffectReadOnly? effect;
[Func="nsDocument::IsWebAnimationsEnabled"]
[Func="nsDocument::AreWebAnimationsTimelinesEnabled"]
attribute AnimationTimeline? timeline;
[BinaryName="startTimeAsDouble"]
attribute double? startTime;
+1 -1
View File
@@ -10,7 +10,7 @@
* liability, trademark and document use rules apply.
*/
[Func="nsDocument::IsWebAnimationsEnabled"]
[Func="nsDocument::AreWebAnimationsTimelinesEnabled"]
interface AnimationTimeline {
[BinaryName="currentTimeAsDouble"]
readonly attribute double? currentTime;
+1 -1
View File
@@ -15,7 +15,7 @@
// this interface.
// What we implement here is a minimal subset of the two definitions which we
// ship behind a pref until the specification issues have been resolved.
[Func="nsDocument::IsWebAnimationsEnabled"]
[Func="nsDocument::IsWebAnimationsGetAnimationsEnabled"]
interface CSSPseudoElement {
readonly attribute DOMString type;
readonly attribute Element parentElement;
+2 -2
View File
@@ -312,9 +312,9 @@ partial interface Document {
// http://w3c.github.io/web-animations/#extensions-to-the-document-interface
partial interface Document {
[Func="nsDocument::IsWebAnimationsEnabled"]
[Func="nsDocument::AreWebAnimationsTimelinesEnabled"]
readonly attribute DocumentTimeline timeline;
[Func="nsDocument::IsWebAnimationsEnabled"]
[Func="nsDocument::IsWebAnimationsGetAnimationsEnabled"]
sequence<Animation> getAnimations();
};
+1 -1
View File
@@ -14,7 +14,7 @@ dictionary DocumentTimelineOptions {
DOMHighResTimeStamp originTime = 0;
};
[Func="nsDocument::IsWebAnimationsEnabled",
[Func="nsDocument::AreWebAnimationsTimelinesEnabled",
Constructor (optional DocumentTimelineOptions options)]
interface DocumentTimeline : AnimationTimeline {
};
+1
View File
@@ -82,6 +82,7 @@ interface GlobalEventHandlers {
attribute EventHandler onseeked;
attribute EventHandler onseeking;
attribute EventHandler onselect;
[Pref="dom.menuitem.enabled"]
attribute EventHandler onshow;
//(Not implemented)attribute EventHandler onsort;
attribute EventHandler onstalled;
+1 -3
View File
@@ -49,10 +49,8 @@ interface HTMLElement : Element {
attribute DOMString contentEditable;
[Pure]
readonly attribute boolean isContentEditable;
[Pure]
[Pure, Pref="dom.menuitem.enabled"]
readonly attribute HTMLMenuElement? contextMenu;
//[SetterThrows]
// attribute HTMLMenuElement? contextMenu;
[CEReactions, SetterThrows, Pure]
attribute boolean spellcheck;
+2 -2
View File
@@ -17,9 +17,9 @@ interface MenuBuilder;
// http://www.whatwg.org/specs/web-apps/current-work/#the-menu-element
[HTMLConstructor]
interface HTMLMenuElement : HTMLElement {
[CEReactions, SetterThrows]
[CEReactions, SetterThrows, Pref="dom.menuitem.enabled"]
attribute DOMString type;
[CEReactions, SetterThrows]
[CEReactions, SetterThrows, Pref="dom.menuitem.enabled"]
attribute DOMString label;
};
+1 -1
View File
@@ -12,7 +12,7 @@
*/
// http://www.whatwg.org/specs/web-apps/current-work/#the-menuitem-element
[HTMLConstructor]
[HTMLConstructor, Pref="dom.menuitem.enabled"]
interface HTMLMenuItemElement : HTMLElement {
[CEReactions, SetterThrows]
attribute DOMString type;
+1 -1
View File
@@ -6392,7 +6392,7 @@ WorkerPrivate::GarbageCollectInternal(JSContext* aCx, bool aShrinking,
if (aShrinking || aCollectChildren) {
JS::PrepareForFullGC(aCx);
if (aShrinking) {
if (aShrinking && mSyncLoopStack.IsEmpty()) {
JS::GCForReason(aCx, GC_SHRINK, JS::gcreason::DOM_WORKER);
if (!aCollectChildren) {
@@ -27,7 +27,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1135764
}
addLoadEvent(function() {
SpecialPowers.pushPrefEnv(
{ "set": [[ "dom.animations-api.core.enabled", true]] },
{ "set": [[ "dom.animations-api.timelines.enabled", true]] },
function() {
var ifr = document.querySelector("iframe");
ifr.onload = function() {
-11
View File
@@ -16,9 +16,6 @@
#endif
#include "mozilla/Tuple.h"
#if defined(MOZ_WIDGET_ANDROID)
#include "nsDebug.h"
#endif
#include "Point.h"
#include "BaseRect.h"
#include "Matrix.h"
@@ -141,9 +138,6 @@ struct BasicLogger
// in the appropriate places in that method.
static bool ShouldOutputMessage(int aLevel) {
if (LoggingPrefs::sGfxLogLevel >= aLevel) {
#if defined(MOZ_WIDGET_ANDROID)
return true;
#else
#if defined(MOZ_LOGGING)
if (MOZ_LOG_TEST(GetGFX2DLog(), PRLogLevelForLevel(aLevel))) {
return true;
@@ -153,7 +147,6 @@ struct BasicLogger
(aLevel < LOG_DEBUG)) {
return true;
}
#endif
}
return false;
}
@@ -174,9 +167,6 @@ struct BasicLogger
// make the corresponding change in the ShouldOutputMessage method
// above.
if (LoggingPrefs::sGfxLogLevel >= aLevel) {
#if defined(MOZ_WIDGET_ANDROID)
printf_stderr("%s%s", aString.c_str(), aNoNewline ? "" : "\n");
#else
#if defined(MOZ_LOGGING)
if (MOZ_LOG_TEST(GetGFX2DLog(), PRLogLevelForLevel(aLevel))) {
PR_LogPrint("%s%s", aString.c_str(), aNoNewline ? "" : "\n");
@@ -186,7 +176,6 @@ struct BasicLogger
(aLevel < LOG_DEBUG)) {
printf("%s%s", aString.c_str(), aNoNewline ? "" : "\n");
}
#endif
}
}
};
+1 -1
View File
@@ -303,7 +303,7 @@ SkBitmap ImageOperations::ResizeSubpixel(const SkBitmap& source,
return result;
#else
return SkBitmap();
#endif // OS_POSIX && !OS_MACOSX && !defined(OS_ANDROID)
#endif // OS_POSIX && !OS_MACOSX
}
// static
+2 -2
View File
@@ -201,12 +201,12 @@ FINAL_LIBRARY = 'xul'
for var in ('USE_CAIRO', 'MOZ2D_HAS_MOZ_CAIRO'):
DEFINES[var] = True
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk2', 'gtk3'):
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'):
DEFINES['MOZ_ENABLE_FREETYPE'] = True
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk2', 'gtk3'):
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'):
CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES']
+8
View File
@@ -172,6 +172,14 @@ EXPORTS.angle.KHR += [ 'include/KHR/khrplatform.h' ]
LOCAL_INCLUDES += [ 'include', 'src', 'src/common/third_party/numerics' ]
if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
NO_VISIBILITY_FLAGS = True
# This tells ANGLE to build the translator with declspec(dllexport) on Windows
# which we need to get these symbols exported from gkmedias
DEFINES['COMPONENT_BUILD'] = True
DEFINES['ANGLE_TRANSLATOR_IMPLEMENTATION'] = True
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
+12 -3
View File
@@ -863,13 +863,22 @@ gl::ErrorOrResult<GLuint> InternalFormat::computeDepthPitch(GLenum formatType,
GLint rowLength,
GLint imageHeight) const
{
GLuint rows =
(imageHeight > 0 ? static_cast<GLuint>(imageHeight) : static_cast<GLuint>(height));
CheckedNumeric<GLuint> pixelsHeight(imageHeight > 0 ? static_cast<GLuint>(imageHeight)
: static_cast<GLuint>(height));
CheckedNumeric<GLuint> rowCount;
if (compressed) {
CheckedNumeric<GLuint> checkedBlockHeight(compressedBlockHeight);
rowCount = (pixelsHeight + checkedBlockHeight - 1u) / checkedBlockHeight;
} else {
rowCount = pixelsHeight;
}
GLuint rowPitch = 0;
ANGLE_TRY_RESULT(computeRowPitch(formatType, width, alignment, rowLength), rowPitch);
CheckedNumeric<GLuint> checkedRowPitch(rowPitch);
auto depthPitch = checkedRowPitch * rows;
auto depthPitch = checkedRowPitch * rowCount;
ANGLE_TRY_CHECKED_MATH(depthPitch);
return depthPitch.ValueOrDie();
}
-5
View File
@@ -242,11 +242,6 @@ if CONFIG['CLANG_CL']:
'-Wno-unused-variable',
]
# See bug 386897.
if CONFIG['GNU_CC'] and CONFIG['OS_TARGET'] == 'Android' and CONFIG['MOZ_OPTIMIZE']:
CFLAGS += ['-O2']
CXXFLAGS += ['-O2']
if CONFIG['MOZ_X11']:
CFLAGS += CONFIG['XCFLAGS']
-4
View File
@@ -156,7 +156,3 @@ if CONFIG['CLANG_CL']:
CFLAGS += [
'-Wno-unused-variable',
]
# See bug 386897.
if CONFIG['OS_TARGET'] == 'Android' and CONFIG['MOZ_OPTIMIZE']:
CFLAGS += ['-O2']
-10
View File
@@ -94,16 +94,6 @@ PIXMAN_BEGIN_DECLS
#if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || defined (_sgi) || defined (__sun) || defined (sun) || defined (__digital__) || defined (__HP_cc)
# include <inttypes.h>
/* VS 2010 (_MSC_VER 1600) has stdint.h */
#elif defined (_MSC_VER) && _MSC_VER < 1600
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
# include <stdint.h>
#endif
-260
View File
@@ -1,260 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
// vim:set ts=2 sts=2 sw=2 et cin:
/* 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/. */
#ifdef MOZ_WIDGET_ANDROID
#include <map>
#include <android/native_window_jni.h>
#include <android/log.h>
#include "AndroidSurfaceTexture.h"
#include "gfxImageSurface.h"
#include "gfxPrefs.h"
#include "AndroidBridge.h"
#include "nsThreadUtils.h"
#include "mozilla/gfx/Matrix.h"
#include "GeneratedJNINatives.h"
#include "GLContext.h"
using namespace mozilla;
namespace mozilla {
namespace gl {
class AndroidSurfaceTexture::Listener
: public java::SurfaceTextureListener::Natives<Listener>
{
using Base = java::SurfaceTextureListener::Natives<Listener>;
const nsCOMPtr<nsIRunnable> mCallback;
public:
using Base::AttachNative;
using Base::DisposeNative;
Listener(nsIRunnable* aCallback) : mCallback(aCallback) {}
void OnFrameAvailable()
{
if (NS_IsMainThread()) {
mCallback->Run();
return;
}
NS_DispatchToMainThread(mCallback);
}
};
already_AddRefed<AndroidSurfaceTexture>
AndroidSurfaceTexture::Create()
{
return Create(nullptr, 0);
}
already_AddRefed<AndroidSurfaceTexture>
AndroidSurfaceTexture::Create(GLContext* aContext, GLuint aTexture)
{
RefPtr<AndroidSurfaceTexture> st = new AndroidSurfaceTexture();
if (!st->Init(aContext, aTexture)) {
printf_stderr("Failed to initialize AndroidSurfaceTexture");
st = nullptr;
}
return st.forget();
}
nsresult
AndroidSurfaceTexture::Attach(GLContext* aContext, PRIntervalTime aTimeout)
{
MonitorAutoLock lock(mMonitor);
if (mAttachedContext == aContext) {
NS_WARNING("Tried to attach same GLContext to AndroidSurfaceTexture");
return NS_OK;
}
if (!CanDetach()) {
return NS_ERROR_NOT_AVAILABLE;
}
while (mAttachedContext) {
// Wait until it's detached (or we time out)
if (NS_FAILED(lock.Wait(aTimeout))) {
return NS_ERROR_NOT_AVAILABLE;
}
}
MOZ_ASSERT(aContext->IsOwningThreadCurrent(), "Trying to attach GLContext from different thread");
aContext->fGenTextures(1, &mTexture);
if (NS_FAILED(mSurfaceTexture->AttachToGLContext(mTexture))) {
return NS_ERROR_NOT_AVAILABLE;
}
mAttachedContext = aContext;
mAttachedContext->MakeCurrent();
return NS_OK;
}
nsresult
AndroidSurfaceTexture::Detach()
{
MonitorAutoLock lock(mMonitor);
if (!CanDetach() ||
!mAttachedContext ||
!mAttachedContext->IsOwningThreadCurrent())
{
return NS_ERROR_FAILURE;
}
mAttachedContext->MakeCurrent();
mSurfaceTexture->DetachFromGLContext();
mTexture = 0;
mAttachedContext = nullptr;
lock.NotifyAll();
return NS_OK;
}
bool
AndroidSurfaceTexture::CanDetach() const
{
// The API for attach/detach only exists on 16+, and PowerVR has some sort of
// fencing issue. Additionally, attach/detach seems to be busted on at least
// some Mali adapters (400MP2 for sure, bug 1131793)
return AndroidBridge::Bridge()->GetAPIVersion() >= 16 &&
(!mAttachedContext || mAttachedContext->Vendor() != GLVendor::Imagination) &&
(!mAttachedContext || mAttachedContext->Vendor() != GLVendor::ARM /* Mali */) &&
gfxPrefs::SurfaceTextureDetachEnabled();
}
bool
AndroidSurfaceTexture::Init(GLContext* aContext, GLuint aTexture)
{
if (!aTexture && !CanDetach()) {
// We have no texture and cannot initialize detached, bail out
return false;
}
if (NS_WARN_IF(NS_FAILED(
java::sdk::SurfaceTexture::New(aTexture, ReturnTo(&mSurfaceTexture))))) {
return false;
}
if (!aTexture) {
mSurfaceTexture->DetachFromGLContext();
}
mAttachedContext = aContext;
if (NS_WARN_IF(NS_FAILED(
java::sdk::Surface::New(mSurfaceTexture, ReturnTo(&mSurface))))) {
return false;
}
mNativeWindow = ANativeWindow_fromSurface(jni::GetEnvForThread(),
mSurface.Get());
MOZ_ASSERT(mNativeWindow, "Failed to create native window from surface");
return true;
}
AndroidSurfaceTexture::AndroidSurfaceTexture()
: mTexture(0)
, mSurfaceTexture()
, mSurface()
, mAttachedContext(nullptr)
, mMonitor("AndroidSurfaceTexture")
{
}
AndroidSurfaceTexture::~AndroidSurfaceTexture()
{
if (mSurfaceTexture) {
SetFrameAvailableCallback(nullptr);
mSurfaceTexture = nullptr;
}
if (mNativeWindow) {
ANativeWindow_release(mNativeWindow);
mNativeWindow = nullptr;
}
}
void
AndroidSurfaceTexture::UpdateTexImage()
{
mSurfaceTexture->UpdateTexImage();
}
void
AndroidSurfaceTexture::GetTransformMatrix(gfx::Matrix4x4& aMatrix) const
{
JNIEnv* const env = jni::GetEnvForThread();
auto jarray = jni::FloatArray::LocalRef::Adopt(env, env->NewFloatArray(16));
mSurfaceTexture->GetTransformMatrix(jarray);
jfloat* array = env->GetFloatArrayElements(jarray.Get(), nullptr);
aMatrix._11 = array[0];
aMatrix._12 = array[1];
aMatrix._13 = array[2];
aMatrix._14 = array[3];
aMatrix._21 = array[4];
aMatrix._22 = array[5];
aMatrix._23 = array[6];
aMatrix._24 = array[7];
aMatrix._31 = array[8];
aMatrix._32 = array[9];
aMatrix._33 = array[10];
aMatrix._34 = array[11];
aMatrix._41 = array[12];
aMatrix._42 = array[13];
aMatrix._43 = array[14];
aMatrix._44 = array[15];
env->ReleaseFloatArrayElements(jarray.Get(), array, 0);
}
void
AndroidSurfaceTexture::SetFrameAvailableCallback(nsIRunnable* aRunnable)
{
java::SurfaceTextureListener::LocalRef newListener;
if (aRunnable) {
newListener = java::SurfaceTextureListener::New();
Listener::AttachNative(newListener, MakeUnique<Listener>(aRunnable));
}
if (aRunnable || mListener) {
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(
mSurfaceTexture->SetOnFrameAvailableListener(newListener)));
}
if (mListener) {
Listener::DisposeNative(java::SurfaceTextureListener::LocalRef(
newListener.Env(), mListener));
}
mListener = newListener;
}
void
AndroidSurfaceTexture::SetDefaultSize(mozilla::gfx::IntSize size)
{
mSurfaceTexture->SetDefaultBufferSize(size.width, size.height);
}
} // gl
} // mozilla
#endif // MOZ_WIDGET_ANDROID
-107
View File
@@ -1,107 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
// vim:set ts=2 sts=2 sw=2 et cin:
/* 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/. */
#ifndef AndroidSurfaceTexture_h__
#define AndroidSurfaceTexture_h__
#ifdef MOZ_WIDGET_ANDROID
#include <jni.h>
#include <android/native_window.h>
#include "nsIRunnable.h"
#include "gfxPlatform.h"
#include "GLDefs.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/gfx/MatrixFwd.h"
#include "mozilla/Monitor.h"
#include "GeneratedJNIWrappers.h"
#include "SurfaceTexture.h"
namespace mozilla {
namespace gl {
class GLContext;
/**
* This class is a wrapper around Android's SurfaceTexture class.
* Usage is pretty much exactly like the Java class, so see
* the Android documentation for details.
*/
class AndroidSurfaceTexture {
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(AndroidSurfaceTexture)
public:
// The SurfaceTexture is created in an attached state. This method requires
// Android Ice Cream Sandwich.
static already_AddRefed<AndroidSurfaceTexture> Create(GLContext* aGLContext, GLuint aTexture);
// Here the SurfaceTexture will be created in a detached state. You must call
// Attach() with the GLContext you wish to composite with. It must be done
// on the thread where that GLContext is current. This method requires
// Android Jelly Bean.
static already_AddRefed<AndroidSurfaceTexture> Create();
// If we are on Jelly Bean, the SurfaceTexture can be detached and reattached
// to allow consumption from different GLContexts. It is recommended to only
// attach while you are consuming in order to allow this.
//
// Only one GLContext may be attached at any given time. If another is already
// attached, we try to wait for it to become detached.
nsresult Attach(GLContext* aContext, PRIntervalTime aTiemout = PR_INTERVAL_NO_TIMEOUT);
nsresult Detach();
// Ability to detach is based on API version (16+), and we also block PowerVR
// since it has some type of fencing problem. Bug 1100126.
bool CanDetach() const;
GLContext* AttachedContext() const { return mAttachedContext; }
ANativeWindow* NativeWindow() const {
return mNativeWindow;
}
// This attaches the updated data to the TEXTURE_EXTERNAL target
void UpdateTexImage();
void GetTransformMatrix(mozilla::gfx::Matrix4x4& aMatrix) const;
void SetDefaultSize(mozilla::gfx::IntSize size);
// The callback is guaranteed to be called on the main thread even
// if the upstream callback is received on a different thread
void SetFrameAvailableCallback(nsIRunnable* aRunnable);
GLuint Texture() const { return mTexture; }
const java::sdk::Surface::Ref& JavaSurface() const { return mSurface; }
private:
class Listener;
AndroidSurfaceTexture();
~AndroidSurfaceTexture();
bool Init(GLContext* aContext, GLuint aTexture);
GLuint mTexture;
java::sdk::SurfaceTexture::GlobalRef mSurfaceTexture;
java::sdk::Surface::GlobalRef mSurface;
java::SurfaceTextureListener::GlobalRef mListener;
GLContext* mAttachedContext;
ANativeWindow* mNativeWindow;
Monitor mMonitor;
};
}
}
#endif
#endif
+1 -119
View File
@@ -14,12 +14,6 @@
#include "mozilla/gfx/Matrix.h"
#include "mozilla/UniquePtr.h"
#ifdef MOZ_WIDGET_ANDROID
#include "AndroidSurfaceTexture.h"
#include "GLImages.h"
#include "GLLibraryEGL.h"
#endif
#ifdef XP_MACOSX
#include "MacIOSurfaceImage.h"
#include "GLContextCGL.h"
@@ -146,26 +140,6 @@ GLBlitHelper::InitTexQuadProgram(BlitType target)
vTexCoord * uTexCoordMult); \n\
} \n\
";
#ifdef ANDROID /* MOZ_WIDGET_ANDROID */
const char kTexExternalBlit_FragShaderSource[] = "\
#version 100 \n\
#extension GL_OES_EGL_image_external : require \n\
#ifdef GL_FRAGMENT_PRECISION_HIGH \n\
precision highp float; \n\
#else \n\
precision mediump float; \n\
#endif \n\
varying vec2 vTexCoord; \n\
uniform mat4 uTextureTransform; \n\
uniform samplerExternalOES uTexUnit; \n\
\n\
void main() \n\
{ \n\
gl_FragColor = texture2D(uTexUnit, \n\
(uTextureTransform * vec4(vTexCoord, 0.0, 1.0)).xy); \n\
} \n\
";
#endif
/* From Rec601:
[R] [1.1643835616438356, 0.0, 1.5960267857142858] [ Y - 16]
[G] = [1.1643835616438358, -0.3917622900949137, -0.8129676472377708] x [Cb - 128]
@@ -257,14 +231,6 @@ GLBlitHelper::InitTexQuadProgram(BlitType target)
fragShaderPtr = &mTex2DRectBlit_FragShader;
fragShaderSource = kTex2DRectBlit_FragShaderSource;
break;
#ifdef ANDROID
case ConvertSurfaceTexture:
case ConvertGralloc:
programPtr = &mTexExternalBlit_Program;
fragShaderPtr = &mTexExternalBlit_FragShader;
fragShaderSource = kTexExternalBlit_FragShaderSource;
break;
#endif
case ConvertPlanarYCbCr:
programPtr = &mTexYUVPlanarBlit_Program;
fragShaderPtr = &mTexYUVPlanarBlit_FragShader;
@@ -398,10 +364,6 @@ GLBlitHelper::InitTexQuadProgram(BlitType target)
// Cache and set attribute and uniform
mGL->fUseProgram(program);
switch (target) {
#ifdef ANDROID
case ConvertSurfaceTexture:
case ConvertGralloc:
#endif
case BlitTex2D:
case BlitTexRect:
case ConvertEGLImage: {
@@ -678,67 +640,6 @@ GLBlitHelper::BindAndUploadEGLImage(EGLImage image, GLuint target)
mGL->fEGLImageTargetTexture2D(target, image);
}
#ifdef MOZ_WIDGET_ANDROID
#define ATTACH_WAIT_MS 50
bool
GLBlitHelper::BlitSurfaceTextureImage(layers::SurfaceTextureImage* stImage)
{
AndroidSurfaceTexture* surfaceTexture = stImage->GetSurfaceTexture();
ScopedBindTextureUnit boundTU(mGL, LOCAL_GL_TEXTURE0);
if (NS_FAILED(surfaceTexture->Attach(mGL, PR_MillisecondsToInterval(ATTACH_WAIT_MS))))
return false;
// UpdateTexImage() changes the EXTERNAL binding, so save it here
// so we can restore it after.
int oldBinding = 0;
mGL->fGetIntegerv(LOCAL_GL_TEXTURE_BINDING_EXTERNAL, &oldBinding);
surfaceTexture->UpdateTexImage();
gfx::Matrix4x4 transform;
surfaceTexture->GetTransformMatrix(transform);
mGL->fUniformMatrix4fv(mTextureTransformLoc, 1, false, &transform._11);
mGL->fDrawArrays(LOCAL_GL_TRIANGLE_STRIP, 0, 4);
surfaceTexture->Detach();
mGL->fBindTexture(LOCAL_GL_TEXTURE_EXTERNAL, oldBinding);
return true;
}
bool
GLBlitHelper::BlitEGLImageImage(layers::EGLImageImage* image)
{
EGLImage eglImage = image->GetImage();
EGLSync eglSync = image->GetSync();
if (eglSync) {
EGLint status = sEGLLibrary.fClientWaitSync(EGL_DISPLAY(), eglSync, 0, LOCAL_EGL_FOREVER);
if (status != LOCAL_EGL_CONDITION_SATISFIED) {
return false;
}
}
ScopedBindTextureUnit boundTU(mGL, LOCAL_GL_TEXTURE0);
int oldBinding = 0;
mGL->fGetIntegerv(LOCAL_GL_TEXTURE_BINDING_2D, &oldBinding);
BindAndUploadEGLImage(eglImage, LOCAL_GL_TEXTURE_2D);
mGL->fDrawArrays(LOCAL_GL_TRIANGLE_STRIP, 0, 4);
mGL->fBindTexture(LOCAL_GL_TEXTURE_2D, oldBinding);
return true;
}
#endif
bool
GLBlitHelper::BlitPlanarYCbCrImage(layers::PlanarYCbCrImage* yuvImage)
{
@@ -835,16 +736,6 @@ GLBlitHelper::BlitImageToFramebuffer(layers::Image* srcImage,
srcOrigin = OriginPos::BottomLeft;
break;
#ifdef MOZ_WIDGET_ANDROID
case ImageFormat::SURFACE_TEXTURE:
type = ConvertSurfaceTexture;
srcOrigin = srcImage->AsSurfaceTextureImage()->GetOriginPos();
break;
case ImageFormat::EGLIMAGE:
type = ConvertEGLImage;
srcOrigin = srcImage->AsEGLImageImage()->GetOriginPos();
break;
#endif
#ifdef XP_MACOSX
case ImageFormat::MAC_IOSURFACE:
type = ConvertMacIOSurfaceImage;
@@ -877,14 +768,6 @@ GLBlitHelper::BlitImageToFramebuffer(layers::Image* srcImage,
return ret;
}
#ifdef MOZ_WIDGET_ANDROID
case ConvertSurfaceTexture:
return BlitSurfaceTextureImage(static_cast<layers::SurfaceTextureImage*>(srcImage));
case ConvertEGLImage:
return BlitEGLImageImage(static_cast<layers::EGLImageImage*>(srcImage));
#endif
#ifdef XP_MACOSX
case ConvertMacIOSurfaceImage:
return BlitMacIOSurfaceImage(srcImage->AsMacIOSurfaceImage());
@@ -983,8 +866,7 @@ GLBlitHelper::BlitFramebufferToTexture(GLuint srcFB, GLuint destTex,
GLenum destTarget,
bool internalFBs)
{
// On the Android 4.3 emulator, IsFramebuffer may return false incorrectly.
MOZ_ASSERT_IF(mGL->Renderer() != GLRenderer::AndroidEmulator, !srcFB || mGL->fIsFramebuffer(srcFB));
MOZ_ASSERT(!srcFB || mGL->fIsFramebuffer(srcFB));
MOZ_ASSERT(mGL->fIsTexture(destTex));
if (mGL->IsSupported(GLFeature::framebuffer_blit)) {
-5
View File
@@ -107,11 +107,6 @@ class GLBlitHelper final
void BindAndUploadEGLImage(EGLImage image, GLuint target);
bool BlitPlanarYCbCrImage(layers::PlanarYCbCrImage* yuvImage);
#ifdef MOZ_WIDGET_ANDROID
// Blit onto the current FB.
bool BlitSurfaceTextureImage(layers::SurfaceTextureImage* stImage);
bool BlitEGLImageImage(layers::EGLImageImage* eglImage);
#endif
#ifdef XP_MACOSX
bool BlitMacIOSurfaceImage(layers::MacIOSurfaceImage* ioImage);
#endif
+6 -91
View File
@@ -10,9 +10,6 @@
#include <string.h>
#include <ctype.h>
#include <vector>
#ifdef MOZ_WIDGET_ANDROID
#include <sys/mman.h>
#endif
#include "GLBlitHelper.h"
#include "GLReadTexImageHelper.h"
@@ -47,10 +44,6 @@
#include "nsCocoaFeatures.h"
#endif
#ifdef MOZ_WIDGET_ANDROID
#include "AndroidBridge.h"
#endif
namespace mozilla {
namespace gl {
@@ -234,7 +227,7 @@ ParseGLSLVersion(GLContext* gl, uint32_t* out_version)
}
if (!versionString) {
// This happens on the Android emulators. We'll just return 100
MOZ_ASSERT(false, "LOCAL_GL_SHADING_LANGUAGE_VERSION undefined, returning 100");
*out_version = 100;
return true;
}
@@ -1056,28 +1049,6 @@ GLContext::InitWithPrefixImpl(const char* prefix, bool trygl)
// prevents occasional driver crash.
mNeedsFlushBeforeDeleteFB = true;
}
#ifdef MOZ_WIDGET_ANDROID
if (mWorkAroundDriverBugs &&
(Renderer() == GLRenderer::AdrenoTM305 ||
Renderer() == GLRenderer::AdrenoTM320 ||
Renderer() == GLRenderer::AdrenoTM330) &&
AndroidBridge::Bridge()->GetAPIVersion() < 21) {
// Bug 1164027. Driver crashes when functions such as
// glTexImage2D fail due to virtual memory exhaustion.
mTextureAllocCrashesOnMapFailure = true;
}
#endif
#if MOZ_WIDGET_ANDROID
if (mWorkAroundDriverBugs &&
Renderer() == GLRenderer::SGX540 &&
AndroidBridge::Bridge()->GetAPIVersion() <= 15) {
// Bug 1288446. Driver sometimes crashes when uploading data to a
// texture if the render target has changed since the texture was
// rendered from. Calling glCheckFramebufferStatus after
// glFramebufferTexture2D prevents the crash.
mNeedsCheckAfterAttachTextureToFb = true;
}
#endif
mMaxTextureImageSize = mMaxTextureSize;
@@ -1810,17 +1781,6 @@ GLContext::InitExtensions()
MarkExtensionUnsupported(OES_EGL_sync);
}
#ifdef MOZ_WIDGET_ANDROID
if (Vendor() == GLVendor::Imagination &&
Renderer() == GLRenderer::SGX544MP &&
AndroidBridge::Bridge()->GetAPIVersion() < 21)
{
// Bug 1026404
MarkExtensionUnsupported(OES_EGL_image);
MarkExtensionUnsupported(OES_EGL_image_external);
}
#endif
if (Vendor() == GLVendor::ARM &&
(Renderer() == GLRenderer::Mali400MP ||
Renderer() == GLRenderer::Mali450MP))
@@ -1829,16 +1789,6 @@ GLContext::InitExtensions()
MarkExtensionUnsupported(OES_EGL_image_external);
}
if (Renderer() == GLRenderer::AndroidEmulator) {
// the Android emulator, which we use to run B2G reftests on,
// doesn't expose the OES_rgb8_rgba8 extension, but it seems to
// support it (tautologically, as it only runs on desktop GL).
MarkExtensionSupported(OES_rgb8_rgba8);
// there seems to be a similar issue for EXT_texture_format_BGRA8888
// on the Android 4.3 emulator
MarkExtensionSupported(EXT_texture_format_BGRA8888);
}
if (Vendor() == GLVendor::VMware &&
Renderer() == GLRenderer::GalliumLlvmpipe)
{
@@ -1857,8 +1807,8 @@ GLContext::InitExtensions()
// textures with glCompressedTexSubImage2D. Works on Intel HD 4000
// and Intel HD 5000/Iris that I tested.
// Bug 1124996: Appears to be the same on OSX Yosemite (10.10)
if (nsCocoaFeatures::OSXVersionMajor() == 10 &&
nsCocoaFeatures::OSXVersionMinor() >= 9 &&
if (nsCocoaFeatures::macOSVersionMajor() == 10 &&
nsCocoaFeatures::macOSVersionMinor() >= 9 &&
Renderer() == GLRenderer::IntelHD3000)
{
MarkExtensionUnsupported(EXT_texture_compression_s3tc);
@@ -2037,8 +1987,7 @@ GLContext::AttachBuffersToFB(GLuint colorTex, GLuint colorRB,
colorTex,
0);
} else if (colorRB) {
// On the Android 4.3 emulator, IsRenderbuffer may return false incorrectly.
MOZ_ASSERT_IF(Renderer() != GLRenderer::AndroidEmulator, fIsRenderbuffer(colorRB));
MOZ_ASSERT(fIsRenderbuffer(colorRB));
fFramebufferRenderbuffer(LOCAL_GL_FRAMEBUFFER,
LOCAL_GL_COLOR_ATTACHMENT0,
LOCAL_GL_RENDERBUFFER,
@@ -2046,7 +1995,7 @@ GLContext::AttachBuffersToFB(GLuint colorTex, GLuint colorRB,
}
if (depthRB) {
MOZ_ASSERT_IF(Renderer() != GLRenderer::AndroidEmulator, fIsRenderbuffer(depthRB));
MOZ_ASSERT(fIsRenderbuffer(depthRB));
fFramebufferRenderbuffer(LOCAL_GL_FRAMEBUFFER,
LOCAL_GL_DEPTH_ATTACHMENT,
LOCAL_GL_RENDERBUFFER,
@@ -2054,7 +2003,7 @@ GLContext::AttachBuffersToFB(GLuint colorTex, GLuint colorRB,
}
if (stencilRB) {
MOZ_ASSERT_IF(Renderer() != GLRenderer::AndroidEmulator, fIsRenderbuffer(stencilRB));
MOZ_ASSERT(fIsRenderbuffer(stencilRB));
fFramebufferRenderbuffer(LOCAL_GL_FRAMEBUFFER,
LOCAL_GL_STENCIL_ATTACHMENT,
LOCAL_GL_RENDERBUFFER,
@@ -2934,29 +2883,6 @@ GLContext::fDeleteFramebuffers(GLsizei n, const GLuint* names)
TRACKING_CONTEXT(DeletedFramebuffers(this, n, names));
}
#ifdef MOZ_WIDGET_ANDROID
/**
* Conservatively estimate whether there is enough available
* contiguous virtual address space to map a newly allocated texture.
*/
static bool
WillTextureMapSucceed(GLsizei width, GLsizei height, GLenum format, GLenum type)
{
bool willSucceed = false;
// Some drivers leave large gaps between textures, so require
// there to be double the actual size of the texture available.
size_t size = width * height * GetBytesPerTexel(format, type) * 2;
void *p = mmap(nullptr, size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (p != MAP_FAILED) {
willSucceed = true;
munmap(p, size);
}
return willSucceed;
}
#endif // MOZ_WIDGET_ANDROID
void
GLContext::fTexImage2D(GLenum target, GLint level, GLint internalformat,
GLsizei width, GLsizei height, GLint border,
@@ -2969,17 +2895,6 @@ GLContext::fTexImage2D(GLenum target, GLint level, GLint internalformat,
height = -1;
border = -1;
}
#if MOZ_WIDGET_ANDROID
if (mTextureAllocCrashesOnMapFailure) {
// We have no way of knowing whether this texture already has
// storage allocated for it, and therefore whether this check
// is necessary. We must therefore assume it does not and
// always perform the check.
if (!WillTextureMapSucceed(width, height, internalformat, type)) {
return;
}
}
#endif
raw_fTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
}
-13
View File
@@ -788,18 +788,10 @@ private:
static void AssertNotPassingStackBufferToTheGL(const void* ptr);
#ifdef MOZ_WIDGET_ANDROID
// Record the name of the GL call for better hang stacks on Android.
#define BEFORE_GL_CALL \
PROFILER_LABEL_FUNC( \
js::ProfileEntry::Category::GRAPHICS);\
BeforeGLCall(MOZ_FUNCTION_NAME)
#else
#define BEFORE_GL_CALL \
do { \
BeforeGLCall(MOZ_FUNCTION_NAME); \
} while (0)
#endif
#define AFTER_GL_CALL \
do { \
@@ -815,12 +807,7 @@ private:
#else // ifdef MOZ_GL_DEBUG
#ifdef MOZ_WIDGET_ANDROID
// Record the name of the GL call for better hang stacks on Android.
#define BEFORE_GL_CALL PROFILER_LABEL_FUNC(js::ProfileEntry::Category::GRAPHICS)
#else
#define BEFORE_GL_CALL do { } while (0)
#endif
#define AFTER_GL_CALL do { } while (0)
#define TRACKING_CONTEXT(a) do {} while (0)
#define ASSERT_NOT_PASSING_STACK_BUFFER_TO_GL(ptr) do {} while (0)
-83
View File
@@ -11,20 +11,7 @@
#define GET_NATIVE_WINDOW(aWidget) ((EGLNativeWindowType)aWidget->GetNativeData(NS_NATIVE_WINDOW))
#endif
#ifdef MOZ_WIDGET_ANDROID
#define GET_JAVA_SURFACE(aWidget) (aWidget->GetNativeData(NS_JAVA_SURFACE))
#endif
#if defined(XP_UNIX)
#ifdef MOZ_WIDGET_ANDROID
#include <android/native_window.h>
#include <android/native_window_jni.h>
#endif
#ifdef ANDROID
#include <android/log.h>
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "Android" , ## args)
#endif
#define GLES2_LIB "libGLESv2.so"
#define GLES2_LIB2 "libGLESv2.so.2"
@@ -164,22 +151,8 @@ CreateSurfaceForWindow(nsIWidget* widget, const EGLConfig& config) {
EGLSurface newSurface = nullptr;
MOZ_ASSERT(widget);
#ifdef MOZ_WIDGET_ANDROID
void* javaSurface = GET_JAVA_SURFACE(widget);
if (!javaSurface) {
MOZ_CRASH("GFX: Failed to get Java surface.\n");
}
JNIEnv* const env = jni::GetEnvForThread();
ANativeWindow* const nativeWindow = ANativeWindow_fromSurface(
env, reinterpret_cast<jobject>(javaSurface));
newSurface = sEGLLibrary.fCreateWindowSurface(
sEGLLibrary.fGetDisplay(EGL_DEFAULT_DISPLAY),
config, nativeWindow, 0);
ANativeWindow_release(nativeWindow);
#else
newSurface = sEGLLibrary.fCreateWindowSurface(EGL_DISPLAY(), config,
GET_NATIVE_WINDOW(widget), 0);
#endif
return newSurface;
}
@@ -229,11 +202,6 @@ GLContextEGL::~GLContextEGL()
bool
GLContextEGL::Init()
{
#if defined(ANDROID)
// We can't use LoadApitraceLibrary here because the GLContext
// expects its own handle to the GL library
if (!OpenLibrary(APITRACE_LIB))
#endif
if (!OpenLibrary(GLES2_LIB)) {
#if defined(XP_UNIX)
if (!OpenLibrary(GLES2_LIB2)) {
@@ -432,10 +400,8 @@ GLContextEGL::GetWSIInfo(nsCString* const out) const
out->AppendLiteral("\nEGL_EXTENSIONS: ");
out->Append((const char*)sEGLLibrary.fQueryString(EGL_DISPLAY(), LOCAL_EGL_EXTENSIONS));
#ifndef ANDROID // This query will crash some old android.
out->AppendLiteral("\nEGL_EXTENSIONS(nullptr): ");
out->Append((const char*)sEGLLibrary.fQueryString(nullptr, LOCAL_EGL_EXTENSIONS));
#endif
}
// hold a reference to the given surface
@@ -685,18 +651,6 @@ CreateConfig(EGLConfig* aConfig, nsIWidget* aWidget)
{
int32_t depth = gfxPlatform::GetPlatform()->GetScreenDepth();
if (!CreateConfig(aConfig, depth, aWidget)) {
#ifdef MOZ_WIDGET_ANDROID
// Bug 736005
// Android doesn't always support 16 bit so also try 24 bit
if (depth == 16) {
return CreateConfig(aConfig, 24, aWidget);
}
// Bug 970096
// Some devices that have 24 bit screens only support 16 bit OpenGL?
if (depth == 24) {
return CreateConfig(aConfig, 16, aWidget);
}
#endif
return false;
} else {
return true;
@@ -771,43 +725,6 @@ GLContextProviderEGL::CreateForWindow(nsIWidget* aWidget, bool aForceAccelerated
return gl.forget();
}
#if defined(ANDROID)
EGLSurface
GLContextProviderEGL::CreateEGLSurface(void* aWindow)
{
nsCString discardFailureId;
if (!sEGLLibrary.EnsureInitialized(false, &discardFailureId)) {
MOZ_CRASH("GFX: Failed to load EGL library 4!\n");
}
EGLConfig config;
if (!CreateConfig(&config, static_cast<nsIWidget*>(aWindow))) {
MOZ_CRASH("GFX: Failed to create EGLConfig 2!\n");
}
MOZ_ASSERT(aWindow);
EGLSurface surface = sEGLLibrary.fCreateWindowSurface(EGL_DISPLAY(), config, aWindow,
0);
if (surface == EGL_NO_SURFACE) {
MOZ_CRASH("GFX: Failed to create EGLSurface 2!\n");
}
return surface;
}
void
GLContextProviderEGL::DestroyEGLSurface(EGLSurface surface)
{
nsCString discardFailureId;
if (!sEGLLibrary.EnsureInitialized(false, &discardFailureId)) {
MOZ_CRASH("GFX: Failed to load EGL library 5!\n");
}
sEGLLibrary.fDestroySurface(EGL_DISPLAY(), surface);
}
#endif // defined(ANDROID)
static void
FillContextAttribs(bool alpha, bool depth, bool stencil, bool bpp16,
bool es3, nsTArray<EGLint>* out)
-8
View File
@@ -10,9 +10,6 @@
#ifndef GL_CONTEXT_PROVIDER_NAME
#error GL_CONTEXT_PROVIDER_NAME not defined
#endif
#if defined(ANDROID)
typedef void* EGLSurface;
#endif // defined(ANDROID)
class GL_CONTEXT_PROVIDER_NAME
{
@@ -111,11 +108,6 @@ public:
static already_AddRefed<GLContext>
CreateWrappingExisting(void* aContext, void* aSurface);
#if defined(ANDROID)
static EGLSurface CreateEGLSurface(void* aWindow);
static void DestroyEGLSurface(EGLSurface surface);
#endif // defined(ANDROID)
/**
* Get a pointer to the global context, creating it if it doesn't exist.
*/
+2 -70
View File
@@ -54,46 +54,6 @@ static const char* sEGLExtensionNames[] = {
"EGL_ANGLE_platform_angle_d3d"
};
#if defined(ANDROID)
static PRLibrary* LoadApitraceLibrary()
{
// Initialization of gfx prefs here is only needed during the unit tests...
gfxPrefs::GetSingleton();
if (!gfxPrefs::UseApitrace()) {
return nullptr;
}
static PRLibrary* sApitraceLibrary = nullptr;
if (sApitraceLibrary)
return sApitraceLibrary;
nsCString logFile = Preferences::GetCString("gfx.apitrace.logfile");
if (logFile.IsEmpty()) {
logFile = "firefox.trace";
}
// The firefox process can't write to /data/local, but it can write
// to $GRE_HOME/
nsAutoCString logPath;
logPath.AppendPrintf("%s/%s", getenv("GRE_HOME"), logFile.get());
// apitrace uses the TRACE_FILE environment variable to determine where
// to log trace output to
printf_stderr("Logging GL tracing output to %s", logPath.get());
setenv("TRACE_FILE", logPath.get(), false);
printf_stderr("Attempting load of %s\n", APITRACE_LIB);
sApitraceLibrary = PR_LoadLibrary(APITRACE_LIB);
return sApitraceLibrary;
}
#endif // ANDROID
#ifdef XP_WIN
// see the comment in GLLibraryEGL::EnsureInitialized() for the rationale here.
static PRLibrary*
@@ -348,13 +308,8 @@ GLLibraryEGL::EnsureInitialized(bool forceAccel, nsACString* const out_failureId
#else // !Windows
// On non-Windows (Android) we use system copies of libEGL. We look for
// the APITrace lib, libEGL.so, and libEGL.so.1 in that order.
#if defined(ANDROID)
if (!mEGLLibrary)
mEGLLibrary = LoadApitraceLibrary();
#endif
// On non-Windows we use system copies of libEGL. We look for
// libEGL.so and libEGL.so.1 in that order.
if (!mEGLLibrary) {
printf_stderr("Attempting load of libEGL.so\n");
@@ -593,24 +548,6 @@ GLLibraryEGL::EnsureInitialized(bool forceAccel, nsACString* const out_failureId
MarkExtensionUnsupported(KHR_image_pixmap);
}
if (IsExtensionSupported(ANDROID_native_fence_sync)) {
GLLibraryLoader::SymLoadStruct nativeFenceSymbols[] = {
{ (PRFuncPtr*) &mSymbols.fDupNativeFenceFDANDROID, { "eglDupNativeFenceFDANDROID", nullptr } },
{ nullptr, { nullptr } }
};
bool success = GLLibraryLoader::LoadSymbols(mEGLLibrary,
&nativeFenceSymbols[0],
lookupFunction);
if (!success) {
NS_ERROR("EGL supports ANDROID_native_fence_sync without exposing its functions!");
MarkExtensionUnsupported(ANDROID_native_fence_sync);
mSymbols.fDupNativeFenceFDANDROID = nullptr;
}
}
mInitialized = true;
return true;
}
@@ -642,12 +579,7 @@ GLLibraryEGL::InitClientExtensions()
const char* rawExtString = nullptr;
#ifndef ANDROID
// Bug 1209612: Crashes on a number of android drivers.
// Ideally we would only blocklist this there, but for now we don't need the client
// extension list on ANDROID (we mostly need it on ANGLE), and we'd rather not crash.
rawExtString = (const char*)fQueryString(nullptr, LOCAL_EGL_EXTENSIONS);
#endif
if (!rawExtString) {
if (shouldDumpExts) {
Loaded 100 of 25342 files, more files were not shown because too many files have changed in this diff. Show more