Compare commits

...
294 Commits
Author SHA1 Message Date
Moonchild 6b18be917d [js] Avoid OOB array copy. 2026-10-26 10:17:14 +01:00
Moonchild 037cc5f614 [NSS] Remove emSign roots (eMudhra compromise)
This brings our certdata in line with NSS 3.131.1
2026-10-24 14:17:27 +02:00
Moonchild 4a68bbbd53 [NSS] Update certdata to Sept 2026 status. 2026-10-24 14:17:13 +02:00
Moonchild 5762097bc2 Update SQLite lib to 3.54.1 2026-10-24 14:16:54 +02:00
Moonchild e86caa48f5 [XPCOM] Lock during nsComponentManager memory reports 2026-10-24 14:15:59 +02:00
Moonchild 612a8991df Update executable extensions list 2026-10-24 14:15:54 +02:00
Moonchild 5c991eadc0 Clarify lowercase policy in extension list for possible future maintainers of the list.
This is added in light of common mixed-case spelling for some contemporary
file extensions. Withough explicitly mentioning the casing policy this could lead
to errors if new extensions get added by maintainers.
2026-10-24 14:15:49 +02:00
Moonchild 38e09d2368 Update executable extensions list 2026-10-24 14:15:43 +02:00
Moonchild 8fea2ad823 [layout] Ensure frame table is valid after adjusting selection. 2026-10-24 14:15:37 +02:00
Moonchild c4339b14dc Use strong ref for animation mutation observer batch targets.
We can control the scope of AnimationMutationBatch for each animation
function. However, this is tedious and prone to being overlooked, so we
use nsCOMPtr to hold the targets instead.

This is a devtool feature (ChromeOnly) so it shouldn't have much impact
on the performance for the common use case.
2026-10-24 14:15:31 +02:00
Moonchild bae7a6ec8f [gfx] Prevent feTile rect calculations from overflowing 2026-10-24 14:15:25 +02:00
Moonchild d42616bb12 Remove the URI_LOADABLE_BY_ANYONE flag from the jar: protocol. 2026-10-24 14:15:04 +02:00
Moonchild 5f290d1097 Disable :has() pseudo on release by default
Since we don't have a solution for the performance issues for this yet,
and the perf issues are a serious QoL problem for all users on many sites.
2026-10-04 02:23:25 +02:00
Moonchild a0b10f4375 Issue #3197 - Make strict subtree form element checking preffed.
Resolves #3197
2026-10-03 21:22:00 +02:00
Moonchild 1d7ba07673 Issue #3196 - Handle BigInt objects in js::Unbox()
Resolves #3196
2026-10-03 21:21:53 +02:00
Moonchild f51bc72a14 [DOM] Don't leak elements with animated classes. 2026-10-03 21:21:46 +02:00
Moonchild e8644b494f [network] Prevent NTLM login attempt with empty credentials. 2026-10-03 21:21:38 +02:00
Andrew McCreight 0acf5cb1a1 Bug 2068346 - Unwrap a copy in GetJSValFromKeyPathString. 2026-10-03 21:21:31 +02:00
Moonchild f2d027343a Backport an upstream libvpx VP8 fix 2026-10-03 21:21:26 +02:00
Moonchild eaf2a4ac4b Minor formatting cleanup. 2026-10-03 21:21:16 +02:00
Moonchild aa6a599aa4 [network] Modernize MIME header parsing module.
- Use nsCStrings instead of char*
- More thorough checking for NUL characters
- Use the more modern utility includes
2026-10-03 21:21:05 +02:00
Moonchild f385a5e06c No issue - Add sanity check to JSScript::traceChildren
This verifies if objects to be traced are still valid, to prevent
GC barriers on dead/released objects. This should avoid some crashes.
2026-10-03 21:20:50 +02:00
Moonchild 559e0dbdc5 Issue #3192 - Add null check on group_ for isSingleton()
The value being monitored is a valid object, but its associated
ObjectGroup might have become invalid.

Resolves #3192
2026-10-03 21:20:42 +02:00
Moonchild e59e88bfd5 [DOM] Fix XSLT children processing.
This was an off-by-1 placement resulting in XSLT children processing
not working.
2026-09-21 11:26:39 +02:00
Moonchild 7e3d96909f [js] Fix issues in WeakRef deref() leading to crashes.
On rare occasions, reloading busy sites with WeakRef API usage would cause
CTDs. Digging into this it seems because of early teardown and/or dangling
pointers on WeakRef objects, causing `deref()` to crash.

This adds some null checks and avoids barriers on potentially invalid
WeakRef objects in the `deref()` implementation.
2026-09-19 14:51:09 +02:00
Maurice Dauer d294c31da1 Bug 2058069 - Compare formats before adopting a managed surface in Image9. 2026-09-19 14:51:02 +02:00
Jan-Niklas Jaeschke d699633e82 Bug 2058417 - Use the normalized format consistently in DataTransfer::SetDataAtInternal. 2026-09-19 14:50:55 +02:00
Moonchild 7079db6476 [embedding] Fix ChromeTooltipListener. 2026-09-19 14:50:48 +02:00
Moonchild e938cb015b [widget] Hold a reference to nsDataObj in callbacks.
As the comment in `WaitForCompletion` explains, it does a SpinEventLoopUntil
as part of CStream callbacks, and the CStream can be unregistered during that,
which is fine, but we need to hold a strong reference first since we use
the object afterward.  The reference in `WaitForCompletion` is technically
redundant but makes future uses safer and admits a comment that future clients
may actually heed.

This also adds an unrelated missing null check while we're here.
2026-09-19 14:50:42 +02:00
Moonchild 15893d9ebc [DOM] Bail on unexpected structural errors. 2026-09-19 14:50:35 +02:00
Moonchild 0f45bf39af [network] NTLM should always prompt for credentials if the host is not in trusted-uris. 2026-09-19 14:50:29 +02:00
Moonchild 23398d176b [a11y] Uncache subtree of hidden accessible when it is coalesced. 2026-09-19 14:50:23 +02:00
Basilisk-Dev 7809ecf653 Issue #3176 - Fix excessive :has() restyles when typing
Avoid restyling entire parent subtrees for changes that only affect a
child or sibling selector. Skip unrelated class changes, cache selector
dependencies, and avoid searching sibling subtrees that cannot match.

This improves typing performance on Gitea.
2026-09-19 14:49:44 +02:00
Basilisk-Dev 43d19989d4 No Issue - Fix out-of-range float to int32 conversions
Check the range before casting to int32_t. The old code had undefined
behavior that caused incorrect JavaScript numbers on LoongArch and broke
Anubis challenges.
2026-09-19 14:49:37 +02:00
Moonchild 81fce269f5 Revert "Issue #3176 - Pref off :has() by default on release"
This reverts commit aa066876a0.
2026-09-12 15:38:01 +02:00
Basilisk-Dev 03bdba053e Issue #3176 - Avoid :has() restyles for unrelated attribute changes
Track attribute names and class tokens used by relative selectors. Check classes before and after attribute updates so removing a watched class still invalidates its anchors, while unrelated changes avoid broad subtree restyles.

Preserve conservative handling of implicit pseudo-class attribute dependencies and explicit attribute selectors. Validated with a full build, runtime restyle counts, and 22 correctness checks.
2026-09-12 15:37:42 +02:00
Basilisk-Dev 5088774087 Issue #3176 - Reduce :has() restyle and selector matching overhead
Track state dependencies inside relative selectors to avoid restyling for unrelated state changes. Restrict parent dependency markers to sibling selectors while preserving outer sibling invalidation, and limit simple child and sibling searches to their candidate elements.
2026-09-12 15:37:24 +02:00
Andy c4d42aaeff Drop Dangling Plus Sign from 4c097ec9 2026-09-11 08:19:20 +02:00
Andy 5b5d7841a6 Remove Georgian Special Casing Skip
Cherry-Picked from BZ 1716482 and BZ 2000225 part 12.
2026-09-11 08:19:11 +02:00
Andy b5e48c5458 Include Cleanup
Cherry-picked from BZ 1999722.
2026-09-11 08:19:05 +02:00
Andy 714c06d255 Update ICU Build Flags
Skip BREAK_ITERATION and MF2.
MF2 Cherry-picked from BZ 1927706 Part 3.
2026-09-11 08:19:00 +02:00
Andy 42c59e0781 Update Likely Subtags for UTS 35
Cherry-picked from BZ 1927706 Part 6.
2026-09-11 08:18:55 +02:00
Andy a877a69089 Add RW fallback for non Gnu-C Compilers or Solaris 2026-09-11 08:18:47 +02:00
Andy 98a7463135 Move ICU Data to ReadOnly Section
This is adapted from BZ 1970788 (for Windows) and... some prior bug for Lin/Mac.
2026-09-11 08:18:41 +02:00
Basilisk-Dev 6cdcc60623 Improve typing performance on complex pages
Avoid redundant line lookups and preserve cached inline background state while painting fragmented inline content. This prevents per-keystroke repaint work from growing badly on long pages.

Ported from aab43246c5 (Mozilla bug 1539366).
2026-09-11 08:17:27 +02:00
Amelia Hart c4e2909bdc Remove obsoleted NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED 2026-09-11 08:17:10 +02:00
Amelia Hart 8f1b4387b4 Prevent potential leak of IndexedDB mDatabaseActor 2026-09-11 08:17:03 +02:00
Amelia Hart a7bc4e7c97 Prevent Fetch Request/Response from leaking mSignal 2026-09-11 08:16:56 +02:00
Amelia Hart 62e29a58b0 Make cycle collector aware of Timeout's mTimer. 2026-09-11 08:16:50 +02:00
Amelia Hart 3ede95de79 Implement cycle collection support for the Visual Viewport API 2026-09-11 08:16:44 +02:00
Amelia Hart fce465d3a6 Avoid triggering read barrier in DumpHeap and when collecting stats 2026-09-11 08:16:38 +02:00
Amelia Hart 71edc1fbf5 Assert GCRuntime::enter/leaveUnsafe region is main-thread only 2026-09-11 08:16:25 +02:00
Amelia Hart 53e4ec00ef Allow incremental GC when keepAtoms is set
This is a port of BZ 1213977 that should improve performance when parsing
large web-sites by reducing the amount of non-incremental (large) GCing.
2026-09-11 08:16:19 +02:00
Moonchild aa066876a0 Issue #3176 - Pref off :has() by default on release 2026-09-11 08:14:52 +02:00
Moonchild ae54d6c3d2 Issue #2473 - Follow-up: Pref the :has() selector. 2026-09-11 08:13:29 +02:00
Moonchild f69237e99c Merge branch 'master' into release 2026-09-03 15:26:51 +02:00
Moonchild a8fdbd677e [editor] Hold a strong ref. 2026-09-03 11:12:41 +02:00
Moonchild 5316be7d85 [DOM] Hold a strong ref to the composed document in nsFocusManager. 2026-09-02 19:37:51 +02:00
Moonchild ea9d3699b0 [network] Reject NUL bytes in chunked trailer and chunk-size lines.
Compliance with RFC 9110 section 5.5 - NUL is illegal in a chunk-size or
trailer field line.
2026-09-02 13:29:36 +02:00
Moonchild d0c059a3fd [widget] Only resolve non-filesystem picker results as shell libraries.
A genuine shell library is a virtual item with no filesystem path.  A
.library-ms file is an ordinary file whose XML can name any local directory.

filedialog::GetFolderResults was passing whatever IFileDialog::GetResult
returned to IShellLibrary::LoadLibraryFromItem and, on success, replacing it
with the library's embedded default save folder.

Gating the resolution on the item being affirmatively not a filesystem object
keeps real libraries selectable and resolving as before, while a .library-ms
file "resolves" to itself -- the .library-ms file, not its target.
2026-09-02 12:04:07 +02:00
Moonchild 3a285b8da5 Issue #3172 - Correct the issue reference in code.
See commit 0f0cbed455 for the code changes.
2026-09-02 11:03:37 +02:00
Moonchild d823df1bbb [DOM media] Reset CORS mode as-appropriate. 2026-09-02 00:35:43 +02:00
Moonchild a45c04623e Merge branch 'master' into release
# Conflicts:
#	devtools/client/jsonview/converter-child.js
#	js/src/jsprf.cpp
#	security/nss/coreconf/coreconf.dep
#	security/nss/lib/nss/nss.h
#	security/nss/lib/softoken/softkver.h
#	security/nss/lib/util/nssutil.h
2026-09-01 16:46:52 +02:00
Moonchild 0f0cbed455 Issue #3050 - Reduce parsing contention by limiting JS parser threads to 2. 2026-09-01 16:21:58 +02:00
Moonchild a7a133659a [widget] Set file picker default response to cancel.
While this apparently doesn't work in all flavors of GTK+, it's beneficial
if it does work, so it can't hurt to attempt, just to try and do what
we can about some wetware failure cases.
2026-09-01 16:18:26 +02:00
Moonchild 3a5a5501b9 Merge branch 'nss-3.126-port' 2026-08-27 13:55:59 +02:00
Moonchild 6b6b1828b9 NSS version bump to 3.90.14.0 (UXP) 2026-08-27 13:55:37 +02:00
John Schanck c42c56f40e Bug 2027388 - add defensive check on pk11_HandUnwrap key size. 2026-08-27 13:53:08 +02:00
Moonchild bada47c3e0 Bug 2029794 - handle NSSCertificate identity changing in __CERT_AddTempCertToPerm 2026-08-27 13:47:05 +02:00
Benjamin Beurdouche 896bdd4e87 Bug 2029750 - Reject undersized IV and key SECItems in PBES2 cipher dispatchers. 2026-08-27 12:43:11 +02:00
Benjamin Beurdouche 5faff628ca Bug 2029289 - fix off-by-one offset in pk11_buildNickname cert_id branch. 2026-08-27 12:37:01 +02:00
Moonchild 331f1d1716 Bug 2027380 - pass offset-adjusted pointer to SEC_ASN1GetSubtemplate in QuickDER call sites. 2026-08-27 09:40:51 +02:00
Moonchild 4c19b0c79b [DOM] Clear mDocumentChildren after XSLT branch consumes it in DidBuildModel. 2026-08-26 23:02:13 +02:00
Moonchild bb777d838d [DOM] Remove content from parent node before appending.
SetDocElement needs to do the same.
2026-08-26 22:57:42 +02:00
Moonchild cfd6c45250 [DOM] Remove content from parent node before appending. 2026-08-26 18:52:13 +02:00
Moonchild 04cc0dbd19 No issue - remove duplicate HTMLWin32ObjectAccessible from build.
This removes the make warnings when building. We shouldn't need this if
the plugin system is disabled.
Verified this builds correctly when NPAPI is disabled in mozconfig.
2026-08-26 15:18:00 +02:00
Olli Pettay 8e1b937e5f Bug 2058622 - Validate selected options entries. 2026-08-26 12:03:27 +02:00
Moonchild 51e966f1c1 [parser] Only check for high surrogates when intending to avoid split pair. 2026-08-26 10:45:06 +02:00
Moonchild f69570b516 [gfx] Skia: Port grey mode pixelspace fix. 2026-08-25 20:54:32 +02:00
Moonchild fb39488301 Merge pull request 'Resolve various assertions in debug builds' (#3171) from Jazzzny/UXP:assertions into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3171
2026-08-25 14:27:53 +00:00
Moonchild 5a3c14e2d3 [DOM] Improve MediaInfo/Data a little.
Only use ImageRect if explicitly set.
Reset the picture region when the decoder adopts a new image size from the stream.
Constrain the picture rectangle to the image buffer when building a video frame.
2026-08-24 15:02:06 +02:00
Moonchild a203222136 Merge pull request 'Prevent recursion of callbacks in PressShell.' (#3169) from restyle-recursion-fix into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3169
2026-08-24 01:51:42 +00:00
Moonchild f77b3dad07 Merge pull request 'Improve LoongArch64 Ion JIT and add SIMD groundwork' (#3170) from Basilisk-Dev/UXP-contrib:loongarch-jit-simd into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3170
2026-08-23 22:28:46 +00:00
Jazzzny 7d622afa70 Resolve various assertions in debug builds 2026-08-22 13:32:31 -04:00
Moonchild c22826727d [image] Simplify and further improve handling of destroying raster images.
Follow-up to [1842de878f]
2026-08-22 12:23:46 +02:00
Moonchild 8beee33f4c Bug 2057204 - use the right AddSystemEventListener variant with nsFileControlFrame::mMouseListener 2026-08-22 11:32:02 +02:00
Basilisk-Dev 0f0aeca2d5 Issue #3049 - Pass LoongArch64 SIMD args in vector registers 2026-08-21 22:41:08 -04:00
Basilisk-Dev 7e68ab76c8 Issue #3049 - Enable LoongArch64 SIMD codegen support 2026-08-21 22:41:08 -04:00
Basilisk-Dev 3984aba71e Issue #3049 - Add LoongArch64 LSX float vector helpers 2026-08-21 22:41:08 -04:00
Basilisk-Dev 81b9be16b3 Issue #3049 - Add LoongArch64 LSX compare and shift helpers 2026-08-21 22:41:08 -04:00
Basilisk-Dev cc636f5606 Issue #3049 - Add LoongArch64 LSX lane helpers 2026-08-21 22:41:08 -04:00
Basilisk-Dev 67716d3e77 Issue #3049 - Add LoongArch64 LSX arithmetic helpers 2026-08-21 22:41:08 -04:00
Basilisk-Dev 47671c9622 Issue #3049 - Add LoongArch64 SIMD constant loads 2026-08-21 22:41:07 -04:00
Basilisk-Dev 5f19acf3dc Issue #3049 - Track LoongArch64 SIMD return registers 2026-08-21 22:41:07 -04:00
Basilisk-Dev 271789ceff Issue #3049 - Handle LoongArch64 SIMD moves 2026-08-21 22:41:07 -04:00
Basilisk-Dev 124c914f35 Issue #3049 - Add LoongArch64 LSX vector move helpers 2026-08-21 22:41:07 -04:00
Basilisk-Dev 8499ba651d Issue #3049 - Add LoongArch64 LSX vector load stores 2026-08-21 22:41:07 -04:00
Basilisk-Dev 4a825adf7d Issue #3049 - Account for LoongArch64 SIMD FP aliases 2026-08-21 22:41:07 -04:00
Basilisk-Dev e6ff828ac7 Issue #3049 - Represent LoongArch64 SIMD register aliases 2026-08-21 22:41:07 -04:00
Basilisk-Dev 90031251c1 Issue #3049 - Make LoongArch64 FP saves SIMD-ready 2026-08-21 22:41:07 -04:00
Basilisk-Dev 059e6407d3 Issue #3049 - Prepare LoongArch64 ABI for SIMD arguments 2026-08-21 22:41:06 -04:00
Basilisk-Dev 46d37a2d26 Issue #3049 - Honor LoongArch64 FP ABI register fallback 2026-08-21 22:41:06 -04:00
Basilisk-Dev 3b5f764740 Issue #3049 - Improve LoongArch64 branch and trap handling 2026-08-21 18:07:08 -04:00
Basilisk-Dev 934d61ba05 Issue #3049 - Handle LoongArch64 subtract overflow edge case 2026-08-21 17:49:20 -04:00
Basilisk-Dev d609be5e04 Issue #3049 - Implement LoongArch64 int64 high-word wrapping 2026-08-21 17:48:07 -04:00
Moonchild a9b7af2c28 [layout] Prevent recursion of callbacks in PressShell. 2026-08-21 21:18:20 +02:00
Moonchild 501212e324 [gfx] Clean up cairo-win32-printing-surface.c
- Reformat code for readability.
- Check allocations in _cairo_win32_printing_surface_paint_linear_pattern.
2026-08-21 15:46:36 +02:00
Moonchild 7158edf5c8 [gfx fonts] Check format 4 subtable length and Zero newly-allocated range. 2026-08-20 15:45:42 +02:00
Moonchild fcc96573dd [gfx] Add buffer integer limit check to NVImage::GetAsSourceSurface. 2026-08-20 15:13:25 +02:00
Moonchild 79c57f2dab Merge pull request 'Restore the ability to compile on MIPS targets' (#3166) from Basilisk-Dev/UXP-contrib:mips-fix into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3166
2026-08-19 15:31:24 +00:00
Moonchild ed63bc8a89 [gfx] Hold a strong ref to platform font entry. 2026-08-19 15:24:35 +02:00
Moonchild 1de3a27f36 [DOM] Keep resized windows within reasonable bounds.
The size is now clamped to twice the available area of the screen the
window is on. Twice rather than exactly the screen, because the size we
get for a screen is not always accurate, on Wayland in particular... (¬_¬)
2026-08-19 11:18:02 +02:00
Moonchild e9d47c2c07 Merge pull request 'K.I.S.S.: Spot-fix jsprf for OS X 10.5 and 10.6' (#3164) from strnlen-kiss into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3164
2026-08-19 08:36:02 +00:00
Basilisk-Dev 1ba68a43cd Issue #3062 - Fix sspidermonkey and JIT issues when compiling on MIPS 2026-08-18 10:24:05 -04:00
Basilisk-Dev e60dbff022 Issue #3062 - Fix GNU assembler issues in libvpx on MIPS 2026-08-18 10:24:05 -04:00
Basilisk-Dev b3aad357ab Issue #3062 - Fix MIPS compilation in ffvpx 2026-08-18 10:24:00 -04:00
Moonchild 4c346cc711 Replace strnlen with memchr. See code comment. 2026-08-15 10:22:56 +02:00
Moonchild ca36b1f452 Merge pull request 'Implement support for adoptedStyleSheets' (#3161) from Basilisk-Dev/UXP-contrib:adoptedstylesheets into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3161
2026-08-13 13:05:05 +00:00
Basilisk-Dev 27195b1e7a Issue #3157 - Implement support for adoptedStyleSheets 2026-08-12 08:58:52 -04:00
Moonchild 948559c22c Revert "[parser] Restrict subtree root check to DOM image elements only."
As it turns out, the reported regression was actually noncompliant HTML
and the initial implementation was correct.

This reverts commit fc25f50e5f.
2026-08-11 17:39:55 +02:00
Moonchild 8e2a07c696 Revert "[parser] Restrict subtree root check to DOM image elements only."
As it turns out, the reported regression was actually noncompliant HTML
and the initial implementation was correct.

This reverts commit 9aa9d182c7.
2026-08-11 17:38:31 +02:00
Moonchild 9aa9d182c7 [parser] Restrict subtree root check to DOM image elements only.
This was too broadly applied, resulting in named form elements not being
accessible through the DOM tree if not in the same subtree root.
2026-08-11 07:43:56 +02:00
Moonchild b4bb6051e9 Revert "Bug 2033848 - Use non-default response ID for GTK file picker accept button. r=stransky"
This reverts commit 789e976ace.
2026-08-11 07:37:29 +02:00
Moonchild 5d7a1ca5a9 Merge pull request 'Several Python 3-related fixes to the build system' (#3160) from FranklinDM/UXP-contrib:work_python3-fixes-build1 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3160
2026-08-10 12:40:05 +00:00
Francis Dominic Fajardo 613443c5eb No issue - Remove old Python 2 workaround that encodes environment vars in bytes
This should fix installer packaging.
2026-08-10 19:10:18 +08:00
Basilisk-Dev d7884bb96c No issue - Fix faster build packaging on Python 3 2026-08-10 19:10:11 +08:00
Moonchild fc25f50e5f [parser] Restrict subtree root check to DOM image elements only.
This was too broadly applied, resulting in named form elements not being
accessible through the DOM tree if not in the same subtree root.
2026-08-09 18:50:50 +02:00
Moonchild b70b3a5aa1 Merge pull request 'Clean up NSIS scripting.' (#3121) from nsis-cleanup into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3121
2026-08-06 13:50:39 +00:00
Moonchild 88ae39ed04 Merge pull request 'Implement :has() CSS pseudo class' (#3152) from Basilisk-Dev/UXP-contrib:css-has into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3152
2026-08-06 06:34:14 +00:00
Basilisk-Dev d893526f82 Issue #2473 - Inline functions in CSS :has() implementation 2026-07-29 16:48:12 -04:00
Moonchild 4d5b1cc5d8 Merge branch 'nss-3.125-port' 2026-07-28 10:50:50 +02:00
Moonchild 0e521f6302 Bump NSS (UXP) patch level. 2026-07-28 10:10:27 +02:00
Moonchild 9cacfcff57 Merge remote-tracking branch 'dbsoft/flex-button-fix2' 2026-07-28 10:08:00 +02:00
John Schanck 21ad7adc90 Bug 2043887 - guard against integer overflow in CERT_Hexify. 2026-07-28 10:03:44 +02:00
Benjamin Beurdouche 9a29430751 Bug 2027353 - clamp input.len to testString size in pk11_mergeSecretKey. 2026-07-28 09:59:51 +02:00
Benjamin Beurdouche 481d4868b0 Bug 2029433 - Bounds-check wrap index in PK11_GetWrapKey to match PK11_SetWrapKey. 2026-07-28 09:57:10 +02:00
Anna Weine d148c11717 Bug 2028954 - CERT_DecodeAVAValue — Integer Overflow in Output Buffer Sizing. 2026-07-28 09:53:26 +02:00
Moonchild bc322e58f8 Bug 2027364 - Set tail pointer to null in static slot lists when deallocating. 2026-07-28 09:22:56 +02:00
John Schanck e48a6f26a5 Bug 2032110 - fix two integer overflows on LLP64 systems. 2026-07-27 23:58:14 +02:00
John Schanck d85edd01df Bug 2030102 - avoid leaving a dangling ss->sec.ci.sid on allocation failure. 2026-07-27 23:49:55 +02:00
Maurice Dauer 296379d751 Bug 2027325 - Reject empty nickname in PK11_TraverseCertsForNicknameInSlot. 2026-07-27 23:46:32 +02:00
Moonchild 7ba9fc2801 Bug 2030563 - Validate CKA_CERTIFICATE_TYPE ulValueLen in nss_cert_type_from_ck_attrib. 2026-07-27 23:22:58 +02:00
Brian Smith a9ac8b390f Issue #3153 - Make sure buttons report a definite size for flex containers.
Second try, this time ONLY do it for flex container or grids.
This should prevent layout problems in non-flex scenarios.
2026-07-27 12:36:24 -05:00
Benjamin Beurdouche 71c0f8246c Bug 2029807 - Guard padding read against empty output in SEC_PKCS7DecryptContents. 2026-07-27 19:12:42 +02:00
Benjamin Beurdouche 6cda35442f Bug 2027346 - validate encoded EC params length and tag in SECKEY_ECParamsToKeySize/BasePointOrderLen. 2026-07-27 19:05:33 +02:00
Benjamin Beurdouche 1dba423327 Bug 2027371 - rewrite labelLen bound in tls13_HkdfExpandLabelGeneral to avoid unsigned overflow. 2026-07-27 18:56:08 +02:00
Benjamin Beurdouche e2af0b28bf Bug 2027373 - guard space subtraction in ssl_CallCustomExtensionSenders. 2026-07-27 18:51:32 +02:00
Benjamin Beurdouche 5ea9b7b80a Bug 2029901 - Guard against keySize overflow in IKE PRF/PRF+ output sizing. 2026-07-27 18:44:55 +02:00
Benjamin Beurdouche b799e100ad Bug 2027362 - bound usageCount in PK11_UnwrapPrivKey to keyTemplate capacity. 2026-07-27 18:39:10 +02:00
Benjamin Beurdouche 1c500a6abb Bug 2027349 - reject empty nickname in PK11_TraverseCertsForNicknameInSlot. 2026-07-27 18:27:47 +02:00
Moonchild b909fccc92 Revert "Issue #3153 - Make sure buttons report a definite size for flex containers."
This reverts commit 3e223cbfb4.
2026-07-27 17:59:43 +02:00
Moonchild abddee43b4 Merge remote-tracking branch 'dbsoft/flex-button-fix' 2026-07-27 14:41:27 +02:00
Moonchild 49d184e550 [network] Fix CacheEntry::mDoomCallback data race. 2026-07-27 14:32:51 +02:00
Brian Smith 3e223cbfb4 Issue #3153 - Make sure buttons report a definite size for flex containers. 2026-07-27 05:38:09 -05:00
Basilisk-Dev 7341809f67 Issue #2473 - implement :has() CSS pseudo class 2026-07-26 14:35:40 -04:00
Moonchild dd9099a7d3 [layout] Fix nsFrameSetFrame primary frame handling of replicated children. 2026-07-26 19:55:49 +02:00
Moonchild 31558a1521 Merge pull request 'Issue #3061 Follow-up: Remove network tickler prefs' (#3151) from Shadow/UXP-contrib:contrib into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3151
2026-07-26 15:45:08 +00:00
Shadow 0e683bf699 Issue #3061 Follow-up: Remove network tickler prefs 2026-07-26 15:39:39 +00:00
Moonchild 6459dec5bb [DOM media] Perform more thorough checks on video regions. 2026-07-26 15:04:18 +02:00
az 0e930fba3f Bug 2045742 2026-07-26 10:08:13 +02:00
Moonchild 3b683bbe59 Merge pull request 'Align aspect-ratio to spec' (#3150) from Basilisk-Dev/UXP-contrib:css-aspect-ratio into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3150
2026-07-26 07:06:00 +00:00
Basilisk-Dev 0042e54c38 Issue #2404 - Split aspect ratio enum types into a separate header to fix compilation issues 2026-07-25 12:24:15 -04:00
Andrew McCreight e75201f7d1 Bug 2049523 - Make ToJSValue for float consistent with double. 2026-07-25 17:04:14 +02:00
Moonchild 28c47723b2 Fix comment (nit) 2026-07-25 16:12:08 +02:00
Randell Jesup 3d872ff7b0 Bug 2029734: Flush before calling sctp_process_init() 2026-07-25 14:52:29 +02:00
Moonchild beb684c29e No issue - Use strnlen instead of strnlen_s.
Apparently, GCC doesn't like the _s variants.
2026-07-25 13:08:15 +02:00
Moonchild 775588b75d [image] Make sure the image was fully and cleanly decoded before finalizing its animation state as complete. 2026-07-25 10:01:55 +02:00
Basilisk-Dev 8a2a5d837c Issue #2404 - Fix aspect ratio sizing for grid items 2026-07-25 00:58:20 -04:00
Basilisk-Dev 8add755c81 Issue #2404 - Improvements to CSS aspect-ratio spec compliance 2026-07-25 00:57:58 -04:00
Moonchild 257c64567e [parser] Associate image elements with form only if the form and the intended parent are in the same tree. 2026-07-24 21:12:04 +02:00
Moonchild d0b61d4a68 No issue - CallUpdateWindow is [[nodiscard]], but we don't need to use
the result here.
2026-07-24 19:29:00 +02:00
Moonchild 3b5f50cc35 Merge pull request 'No Issue - Remove the half-life experiment in HTTP cache' (#3149) from Shadow/UXP-contrib:master into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3149
2026-07-24 14:32:21 +00:00
Moonchild 27c6a7f477 [DOM media] Stop accepting audio samples with too low sample rates.
This sets the floor to 8kHz audio, which is generally considered to be
the lowest acceptable "phone quality"/"walkie-talkie" audio rate.
Audio outside the range will refuse to decode after this commit and give
a console error.
This avoids a whole class of potential bugs.
2026-07-24 14:52:40 +02:00
Moonchild c65f84214e [layout] Add corner-case correctness check in DottedCornerFinder::FindBestOverlap. 2026-07-24 13:17:54 +02:00
Moonchild a317c65fd7 [network] Add usrsctp TSN gap check. 2026-07-24 12:58:20 +02:00
Shadow 0ec35ce534 No Issue - Remove the half-life experiment in HTTP cache
Reviewed-on: https://repo.palemoon.org/Shadow/UXP-contrib/pulls/1
2026-07-24 09:49:48 +00:00
Moonchild bf0c040722 [js] Clamp length of regexp captures array for dollar substitution. 2026-07-22 22:37:50 +02:00
Moonchild ebadd51401 [js] Initialize BaselineFrame return value slot in OnLeaveBaselineFrame. 2026-07-22 20:26:07 +02:00
Moonchild 5ed0bf8b44 [DOM] Make parser update form owner properly 2026-07-22 17:12:32 +02:00
Moonchild f877c1dba5 [gfx] Hold a strong ref during GetFontAt lookup. 2026-07-22 10:27:53 +02:00
Moonchild 4c14f8f89b [gfx] Add bounds checks and limit reverse scanning of ligature data. 2026-07-22 09:43:54 +02:00
Moonchild c119728965 Merge pull request 'Implement CSSStyleSheet replaceSync' (#3145) from Basilisk-Dev/UXP-contrib:replacesync into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3145
2026-07-22 06:02:21 +00:00
Moonchild fa55b9c2e8 [js] Guard against OOB string sizes in internal Printf 2026-07-22 01:39:03 +02:00
Basilisk-Dev 16aba76fc5 Issue #3144 - Implement CSSStyleSheet replaceSync 2026-07-21 04:23:19 -04:00
Moonchild 995def99cd No issue - Exclude some files from the preprocessor that don't have directives in them. 2026-07-19 15:57:10 +02:00
Moonchild 923e52789c Merge pull request 'Convert std::*<T>::value/::type to _v and _t suffixes.' (#3143) from 1803 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3143
2026-07-19 07:40:35 +00:00
Moonchild 22d945430b Issue #3061 - Remove network tickler.
Resolves #3061
2026-07-19 08:17:05 +02:00
Moonchild 65d7d93760 Issue #1803 - Convert std::*<T>::value/::type to _v and _t suffixes.
This excludes uses in third-party libs in our tree.
2026-07-15 11:20:06 +02:00
Moonchild dfd0ea4e8a Merge pull request 'implement URL.parse()' (#3141) from Basilisk-Dev/UXP-contrib:urlparse into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3141
2026-07-14 21:05:40 +00:00
Basilisk-Dev 12a49709cb Issue #3140 - implement URL.parse() 2026-07-14 16:07:45 -04:00
Moonchild 2a70c8a6f0 Merge pull request 'Implement CSS4 revert-layer keyword' (#3139) from Basilisk-Dev/UXP-contrib:revert-layer into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3139
2026-07-13 12:44:06 +00:00
Moonchild 1f639d78ca Merge pull request 'Allow Skia on Mac OS X 10.5 Leopard / big endian PPC' (#3138) from Jazzzny/UXP:skia-leopard-ppc into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3138
2026-07-13 12:43:15 +00:00
Basilisk-Dev 65e8245153 Issue #2829 - Regenerate devtools CSS database for revert-layer 2026-07-11 10:41:52 -04:00
Basilisk-Dev bce5dbad0b Issue #2829 - Use layer index naming for revert-layer metadata 2026-07-11 10:41:46 -04:00
Basilisk-Dev 0b25b5f8db Issue #2829 - Handle revert-layer variable fallbacks 2026-07-10 09:59:20 -04:00
Basilisk-Dev 7345874098 Issue #2829 - Implement CSS revert-layer cascade rollback 2026-07-10 09:59:14 -04:00
Basilisk-Dev edb82fd1c9 Issue #2829 - Support revert-layer in CSS-wide parsing 2026-07-10 09:59:03 -04:00
Jazzzny 35ebdcac66 Fix build issues in Skia code 2026-07-09 12:32:44 -04:00
Jazzzny a095661e86 Use Skia macros where appropriate 2026-07-08 13:43:07 -04:00
Jazzzny 205a0d66bb Add support for big endian in Skia 2026-07-08 04:38:00 -04:00
Jazzzny 54945a0808 Unblock Skia for big endian 2026-07-08 04:38:00 -04:00
Jazzzny 84c1eedac6 Fixes for Skia on 10.5 2026-07-08 04:38:00 -04:00
Moonchild ddf5d6256e Whitespace fix 2026-07-03 09:24:24 +02:00
Moonchild 0eae777fd0 Issue #3132 Follow-up: only include gtk2xtbin.h on GTK targets.
PR #3133 caused build breakage on non-gtk platforms by unconditionally
including the header (because the def defaults to true in configure)

This also reorganizes the configure script to add a check for
MOZ_WIDGET_GTK (hoisted up a little) so the new configure entry is
simply ignored on non-GTK targets.
2026-07-03 09:19:54 +02:00
Moonchild b2594a4ace Merge pull request 'Revert gtk file dialog change and set default to cancel' (#3137) from 3136 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3137
2026-06-30 13:54:19 +00:00
Moonchild ce61835a81 revert 8a2a9ead92
revert [gtk] Default the file dialog operation to cancelling the operation.

While this could be an annoying default for users expecting fast-track
dialog operations with hitting enter, it avoids potential social
engineering attacks and unintended file operations.
2026-06-30 13:53:18 +00:00
Moonchild 30e29845c4 Merge pull request 'Decouple NPAPI from GTK2' (#3133) from Basilisk-Dev/UXP-contrib:npapi-no-gtk2 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3133
2026-06-30 13:51:11 +00:00
Basilisk-Dev d8662c5dd9 Issue #3132 - use ENABLE check for npapi gtk2 builds instead of a dedicated DISABLE check to match other config options 2026-06-30 09:15:45 -04:00
Moonchild 8a2a9ead92 [gtk] Default the file dialog operation to cancelling the operation.
While this could be an annoying default for users expecting fast-track
dialog operations with hitting enter, it avoids potential social
engineering attacks and unintended file operations.
2026-06-28 12:09:07 +02:00
Moonchild efdbd34b0b Revert "Bug 2033848 - Use non-default response ID for GTK file picker accept button. r=stransky"
This reverts commit 789e976ace.
2026-06-28 12:08:59 +02:00
Moonchild d2fa69f593 Merge pull request 'Import missing libpng files for loongarch and plug them into moz.build' (#3135) from Basilisk-Dev/UXP-contrib:png-loongarch-fix into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3135
2026-06-27 07:25:51 +00:00
Basilisk-Dev 18d0a1a525 Issue #3134 - Import missing libpng files for loongarch and plug them into moz.build 2026-06-26 14:48:51 -04:00
Basilisk-Dev 0a5e50a9fe Issue #3132 - Resolve GTK3 ATK bridge dynamically 2026-06-26 13:49:15 -04:00
Basilisk-Dev 3f5b7ed020 Issue #3132 - Add GTK2 NPAPI build toggle 2026-06-26 13:09:49 -04:00
Moonchild 9d9802c660 Issue #3129 - Follow-up: Add aarch64 to platforms enabling Neon in libpng. 2026-06-26 16:58:21 +02:00
Moonchild 27c579652a Issue #3122 - Stop using <base> element in json viewer.
Resolves #3122
2026-06-23 21:09:02 +02:00
Moonchild 8ffa6b3c13 Issue #3129 - Add palette_neon_intrinsics.c to moz.build 2026-06-23 10:23:17 +02:00
Moonchild 83f6efc33d Issue #3122 - Put base paths in the json viewer client deps.
The dependency modules are requested early. Seems CSP can block baseURL
on these networking requests, so add the base manually to the resource
paths to prevent network requests before the html base element is
resolved and active.
2026-06-22 17:58:21 +02:00
Moonchild 47f1928610 Merge pull request 'Libpng update 1.6.58' (#3125) from libpng-update-1.6.58 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3125
2026-06-21 12:14:42 +00:00
Moonchild 7b3d961465 Bump NSS version for adopted changes. 2026-06-19 14:19:43 +02:00
Moonchild 22b2e18d91 [DOM] Clean up WebGL transform feedback validation. 2026-06-19 13:30:35 +02:00
John Schanck f6c9c0c59f Bug 2030564 - add defensive input validation to sftk_compute_ANSI_X9_63_kdf. 2026-06-19 12:56:26 +02:00
John Schanck d8c9d24a9c Bug 2030366 - avoid race with module unloading in NSSTrustDomain_FindTokensByURI. 2026-06-19 12:04:23 +02:00
John Schanck a466b73267 Bug 2029403 - avoid PORT_Strdup in ssl_DecodeResumptionToken. 2026-06-19 10:51:37 +02:00
Julian Descottes 1ce14fb014 [devtools] Consistently show filepicker on first save action from StyleEditor.
Bug 2038133
2026-06-19 10:45:33 +02:00
Moonchild 8bbf60fb38 Issue #3127 - Add trademark notice to the tree.
Resolves #3127
2026-06-19 08:37:27 +02:00
Moonchild f2d7c02290 Apply (hopefully for the last time before 2.0.x) APNG support code.
This commit also removes MOZCHANGES (old and irrelevant information)
This commit also adds a new readme.
2026-06-18 22:57:29 +02:00
Moonchild 65ddfc21b6 Fresh import of libpng 1.6.58 2026-06-18 21:50:35 +02:00
Moonchild 163619de60 [network] Make HttpBaseChannel::mLoadFlags atomic. 2026-06-18 20:32:03 +02:00
Moonchild 29c4d554a0 [gfx] Check more offsets during CFF subsetting.
Also fixes a bunch of whitespace (TAB -> spaces)
2026-06-18 19:35:49 +02:00
Moonchild 3e59569d0b [DOM] Avoid over-optimizing some getter/function calls. 2026-06-18 13:45:20 +02:00
Moonchild fb8483407b [parser] Better align with spec definition of adding nodes. 2026-06-18 13:32:16 +02:00
Moonchild ec8b7f86d0 No issue - Use ImmGCPtr for module meta data visits.
This should make module GCs less touchy.
2026-06-17 23:46:18 +02:00
Moonchild 9899d59010 [DOM media] Zero-initialize ThreadSharedFloatArrayBufferList. 2026-06-17 18:13:15 +02:00
Kui-Feng Lee 789e976ace Bug 2033848 - Use non-default response ID for GTK file picker accept button. r=stransky
Replace GTK_RESPONSE_ACCEPT (-3) with a non-negative application-defined
response ID (kFilePickerAccept = 0) for the accept button in the GTK file
chooser dialog, and remove the gtk_dialog_set_default_response() call.

GTK treats buttons with negative built-in response IDs as candidates for
the dialog's default widget, which activates on Enter key press. By using
a non-negative ID and not calling set_default_response(), the accept button
is no longer pre-selected, preventing a page from tricking the user into
confirming a file upload by holding Enter before the dialog appears.

GTK's file chooser internally emits GTK_RESPONSE_ACCEPT via file_activated_cb
when the user double-clicks a file, so we keep that case in DoneNonPortal()
alongside kFilePickerAccept.
2026-06-17 12:47:03 +02:00
John Schanck d5bf2555a3 Bug 2023478 - improve handling of escape sequences in pk11uri_ParseAttributes. 2026-06-17 12:17:06 +02:00
Moonchild be672813f6 [DOM] Reject too large mLength in MutableBlobStorage::WriteRunnable. 2026-06-16 20:06:25 +02:00
John Schanck 746a7be08c Bug 2030570 - use correct data for ID comparison in transfer_uri_certs_to_collection. 2026-06-16 19:54:44 +02:00
Moonchild c222ee80fa [network] Make keep-alive pref Atomic. 2026-06-16 19:50:55 +02:00
John Schanck 4950bd038d Bug 2029765 - avoid refcount over-release in nssTokenObjectCache error path [@ nssToken_Destroy]. 2026-06-16 18:52:25 +02:00
Nicolas B. Pierron 058336a071 Bug 2029066 - Remove Sinking of Live instructions.
Instruction sinking was made possible by the introduction of recover
instructions, which are moving instructions to be executed on bailout, but this
is only possible for instructions which are not used.

This feature, which is now removed, was made to sink instructions which are
live, but only in a small set of branches, by moving the computation of these
instructions to bailout paths, and to the concerned if branches.

The current implementation never delivered and remained as dead-code for
multiple years, without having a firm benefit on performance oriented
benchmarks.

Thus, this change removes the part of the Sink optimization which deals with
live instructions but keeps the part of the Sink optimization which deals with
instructions which are only used on bailout paths.
2026-06-16 13:37:21 +02:00
John Schanck 6823388a85 Bug 2029803 - add defensive info->len check in PK11_HPKE_SetupS and PK11_HPKE_SetupR. 2026-06-16 09:27:28 +02:00
Moonchild b68d097eb6 Issue #3122 - Exclude local resources from <base> CSP checks.
This avoids local-resource <base> URLs being restricted/nullified by
remote CSP. This aligns the CSP handling with direct requests.

Resolves #3122
2026-06-14 10:08:17 +02:00
Moonchild 21743e0b7c Issue #3120 - Clean up NSIS scripting.
Removes Quicklaunch shortcut code, UAC guards (always supported on target
OSes) and LSP guards (ditto).

Resolves #3120
2026-06-13 12:19:53 +02:00
Moonchild c97a22776d Merge pull request 'Re-introduce pref for WeakRef API spec.' (#3117) from weakref-finreg-pref into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3117
2026-06-12 15:46:16 +00:00
Moonchild c484dbcca5 Issue #888 - Follow-up: Update about:license with AV1 codec licensing.
LibAOM was actually omitted before (oops); added both.
2026-06-11 20:07:10 +02:00
Moonchild 54f15d7afe Issue #3111 - Clean up logic in SweepFinalizationRegistries.
Resolves #3111
2026-06-09 18:06:00 +02:00
Moonchild 05441188be Issue #2306 - Enable full weakref by default in platform. 2026-06-07 23:54:52 +02:00
Moonchild 25a2d31be7 Issue #2306 - Re-introduce pref for WeakRef API spec.
Effectively avoids doing any GC work if preffed off, and adopts the same
for FinalizationRegistry which internally does similar work as WeakRefs.
2026-06-07 21:36:39 +02:00
Moonchild 58a4e0d545 [DOM] Provide more silent audio processing frames. 2026-06-05 12:29:30 +02:00
Moonchild ad06b4ce5e Revert "Bug 2027433 Treat null input channels as zero in InterleaveAndConvertBuffer()"
This reverts commit e76fc5637a.
2026-06-05 11:28:55 +02:00
Moonchild be3827b088 Revert "Bug 2027433 Treat null input channels as zero in AudioChannelsDownMix()"
This reverts commit ddd016a6f8.
2026-06-05 11:28:42 +02:00
Moonchild a136aaf502 Revert "Bug 2027433 use nullptr for silent up-mix channels"
This reverts commit 5309640d6c.
2026-06-05 11:28:35 +02:00
Moonchild 40d91a8eae Merge pull request 'Always Uppercase Eszett' (#3114) from RealityRipple/UXP:capital-eszett into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3114
2026-06-04 08:15:36 +00:00
Moonchild 5b81a81ac4 Merge pull request 'Fix LoongArch64 debug build assertions' (#3115) from Basilisk-Dev/UXP-contrib:loongarch-asserts into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3115
2026-06-04 04:08:45 +00:00
Basilisk-Dev 328ddb2927 Issue #3095 followup - Fix LoongArch64 debug build assertions 2026-06-03 18:13:31 -04:00
Andy 06b9622302 Issue #2964 - Part 3: JS Override for ToUpperCase 2026-06-02 15:25:47 -07:00
Andy 1218649202 Issue #2964 - Part 2b: Improve ToUpperCaseLength
Adds a method to force 16-bit characters, regardless of the type of the `chars` argument.
2026-06-02 15:21:44 -07:00
Andy cbea8f5a53 Issue #2964 - Part 2a: Correctly Detect End of Buffer in ToUpperCaseImpl
This code made two assumptions:
- That the `SrcChar` type should determine the output type, as used in `CanUpperCaseSpecialCasing`.
- That `AppendUpperCaseSpecialCasing` would always return a value larger than the previous value.

The new code uses `DestChar`'s type for `CanUpperCaseSpecialCasing` and for a more accurate End of Buffer check.
2026-06-02 15:21:26 -07:00
Andy f42e644486 Issue #2964 - Part 1: CSS Override for uppercase and capitalize 2026-06-02 15:20:45 -07:00
Moonchild a40490b946 Merge pull request 'Fix a build failure for WebRTC on Python 3.14 on MacOS' (#3113) from Basilisk-Dev/UXP-contrib:webrtc-fix-mac into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3113
2026-06-01 09:09:29 +00:00
Basilisk-Dev ad98693f3d Issue #3105 followup - Fix a build failure for WebRTC on Python 3.14 2026-05-31 09:54:46 -04:00
Moonchild 7b4aaca975 Merge pull request 'Clamp border-radius value to Int32.MaxValue' (#3112) from border-radius-clamp into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3112
2026-05-30 08:42:57 +00:00
Moonchild 400e59a96d Issue #3109 - Use CSS' internal length clamp value instead. 2026-05-29 23:53:22 +02:00
Moonchild 09276b72a6 Issue #3109 - Clamp border-radius value to Int32.MaxValue
This avoids artifacts from out-of-bounds values.
Resolves #3109
2026-05-29 22:53:43 +02:00
Moonchild ec18304362 Merge pull request 'Cleanup references to IA64/HP-UX' (#3106) from Basilisk-Dev/UXP-contrib:ia64-cleanup into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3106
2026-05-27 10:46:31 +00:00
Moonchild 4cf411f393 Merge pull request 'Remove gonk/Android/iOS/NACL code in WebRTC' (#3105) from Basilisk-Dev/UXP-contrib:webrtc-cleanup-mobile into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/3105
2026-05-27 10:45:37 +00:00
Basilisk-Dev 2b0935adf4 Issue #3007 - Remove HP-UX LDAP compatibility code 2026-05-23 17:08:16 -04:00
Basilisk-Dev cbdc5fa85f Issue #3007 - Remove HP-UX launcher setup 2026-05-23 17:06:16 -04:00
Basilisk-Dev 2a06c40a09 Issue #3007 - Remove IA64 runtime support paths 2026-05-23 17:04:19 -04:00
Basilisk-Dev f499e3dd36 Issue #3007 - Remove IA64 from build configuration 2026-05-23 17:04:18 -04:00
Basilisk-Dev 48d21fa2bf Issue #3008 - Prefer Windows memory barrier in WebRTC FIFO 2026-05-23 16:31:36 -04:00
Basilisk-Dev c91c69272b Issue #3008 - Remove stale B2G WebRTC camera comment 2026-05-23 16:25:35 -04:00
Basilisk-Dev 91f4fa744e Issue #3008 - Remove mobile leftovers from DOM WebRTC 2026-05-23 16:25:35 -04:00
Basilisk-Dev c2abd4aaa6 Issue #3008 - Remove stale Android WebView GYP guards 2026-05-23 16:25:34 -04:00
Basilisk-Dev 617ad84f96 Issue #3008 - Keep WebRTC audio FIFO after OpenSL removal 2026-05-23 16:25:33 -04:00
Basilisk-Dev 33b6bfa1b9 Issue #3008 - Fix GYP defaults after mobile cleanup 2026-05-23 16:25:33 -04:00
Basilisk-Dev 4e03afd191 Issue #3008 - Remove remaining mobile WebRTC build references 2026-05-23 16:25:32 -04:00
Basilisk-Dev 3512b73bc3 Issue #3008 - Remove stale iOS comments from WebRTC 2026-05-23 16:25:31 -04:00
Basilisk-Dev d0ac45cb08 Issue #3008 - Remove iOS support from bundled GYP generators 2026-05-23 16:25:31 -04:00
Basilisk-Dev ab3d950bd3 Issue #3008 - Remove mobile and NaCl defaults from WebRTC common gyp 2026-05-23 16:25:30 -04:00
Basilisk-Dev 44ddd79356 Issue #3008 - Remove stale iOS labels from WebRTC assembly 2026-05-23 16:25:29 -04:00
Basilisk-Dev 054ddf661f Issue #3008 - Remove stale mobile notes from WebRTC metadata 2026-05-23 16:25:29 -04:00
Basilisk-Dev da466a3bdd Issue #3008 - Remove stale mobile references from WebRTC headers 2026-05-23 16:25:28 -04:00
Basilisk-Dev 42f0c2d78f Issue #3008 - Remove mobile support from bundled WebRTC tools 2026-05-23 16:25:27 -04:00
Basilisk-Dev 5853784a31 Issue #3008 - Remove stale WebRTC mobile build metadata 2026-05-23 16:25:27 -04:00
Basilisk-Dev 5b20295620 Issue #3008 - Remove mobile guards from WebRTC voice tests 2026-05-23 16:25:26 -04:00
Basilisk-Dev 68e151c2a3 Issue #3008 - Remove mobile guards from WebRTC audio device tests 2026-05-23 16:25:25 -04:00
Basilisk-Dev dd764a70a2 Issue #3008 - Remove mobile guards from WebRTC module tests 2026-05-23 16:25:24 -04:00
Basilisk-Dev 12defe0d12 Issue #3008 - Remove mobile guards from WebRTC audio tests 2026-05-23 16:25:24 -04:00
Basilisk-Dev 8868dd5785 Issue #3008 - Remove mobile guards from WebRTC tests 2026-05-23 16:25:23 -04:00
Basilisk-Dev e787d585a4 Issue #3008 - Remove stale WebRTC mobile metadata 2026-05-23 16:25:22 -04:00
Basilisk-Dev 5eb7518ce2 Issue #3008 - Remove mobile WebRTC runtime conditionals 2026-05-23 16:25:21 -04:00
Basilisk-Dev 5be93da111 Issue #3008 - Remove obsolete mobile WebRTC source trees 2026-05-23 16:25:21 -04:00
916 changed files with 30426 additions and 60646 deletions

No files matched your search

+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 Idle GC backout
Clobber for removal of network tickler
+48 -7
View File
@@ -18,10 +18,6 @@
#endif
#include <gtk/gtk.h>
#if (MOZ_WIDGET_GTK == 3)
extern "C" __attribute__((weak,visibility("default"))) int atk_bridge_adaptor_init(int*, char **[]);
#endif
using namespace mozilla;
using namespace mozilla::a11y;
@@ -33,12 +29,20 @@ extern "C" {
typedef GType (* AtkGetTypeType) (void);
typedef void (*GnomeAccessibilityInit) (void);
typedef void (*GnomeAccessibilityShutdown) (void);
#if (MOZ_WIDGET_GTK == 3)
typedef int (*AtkBridgeAdaptorInit) (int*, char***);
#endif
}
static PRLibrary* sATKLib = nullptr;
static const char sATKLibName[] = "libatk-1.0.so.0";
static const char sATKHyperlinkImplGetTypeSymbol[] =
"atk_hyperlink_impl_get_type";
#if (MOZ_WIDGET_GTK == 3)
static PRLibrary* sAtkBridgeAdaptorLib = nullptr;
static const char sAtkBridgeAdaptorLibName[] = "libatk-bridge-2.0.so.0";
static const char sAtkBridgeAdaptorInitSymbol[] = "atk_bridge_adaptor_init";
#endif
gboolean toplevel_event_watcher(GSignalInvocationHint*, guint, const GValue*,
gpointer);
@@ -127,6 +131,38 @@ LoadGtkModule(GnomeAccessibilityModule& aModule)
return NS_OK;
}
#if (MOZ_WIDGET_GTK == 3)
static bool
InitAtkBridgeAdaptor()
{
AtkBridgeAdaptorInit initBridge =
reinterpret_cast<AtkBridgeAdaptorInit>(
PR_FindFunctionSymbolAndLibrary(sAtkBridgeAdaptorInitSymbol,
&sAtkBridgeAdaptorLib));
if (!initBridge) {
sAtkBridgeAdaptorLib = PR_LoadLibrary(sAtkBridgeAdaptorLibName);
if (sAtkBridgeAdaptorLib) {
initBridge =
reinterpret_cast<AtkBridgeAdaptorInit>(
PR_FindFunctionSymbol(sAtkBridgeAdaptorLib,
sAtkBridgeAdaptorInitSymbol));
if (!initBridge) {
PR_UnloadLibrary(sAtkBridgeAdaptorLib);
sAtkBridgeAdaptorLib = nullptr;
}
}
}
if (!initBridge) {
return false;
}
initBridge(nullptr, nullptr);
return true;
}
#endif
void
a11y::PlatformInit()
{
@@ -181,9 +217,7 @@ a11y::PlatformInit()
// Init atk-bridge now
PR_SetEnv("NO_AT_BRIDGE=0");
#if (MOZ_WIDGET_GTK == 3)
if (atk_bridge_adaptor_init) {
atk_bridge_adaptor_init(nullptr, nullptr);
} else
if (!InitAtkBridgeAdaptor())
#endif
{
nsresult rv = LoadGtkModule(sAtkBridge);
@@ -228,6 +262,13 @@ a11y::PlatformShutdown()
sAtkBridge.init = nullptr;
sAtkBridge.shutdown = nullptr;
}
#if (MOZ_WIDGET_GTK == 3)
if (sAtkBridgeAdaptorLib) {
// Do not shutdown/unload atk-bridge; an exit function registered by
// the bridge will take care of it.
sAtkBridgeAdaptorLib = nullptr;
}
#endif
#if (MOZ_WIDGET_GTK == 2)
if (sGail.lib) {
// Do not shutdown gail because
@@ -276,6 +276,7 @@ NotificationController::DropMutationEvent(AccTreeMutationEvent* aEvent)
MOZ_ASSERT(hideEvent);
if (hideEvent->NeedsShutdown()) {
mDocument->UncacheChildrenInSubtree(aEvent->GetAccessible());
mDocument->ShutdownChildrenInSubtree(aEvent->GetAccessible());
}
}
+2
View File
@@ -1307,6 +1307,8 @@ DocAccessible::UnbindFromDocument(Accessible* aAccessible)
{
NS_ASSERTION(mAccessibleCache.GetWeak(aAccessible->UniqueID()),
"Unbinding the unbound accessible!");
MOZ_ASSERT(!mARIAOwnsHash.Contains(aAccessible),
"Container still lingering in mARIAOwnsHash");
// Fire focus event on accessible having DOM focus if active item was removed
// from the tree.
-1
View File
@@ -23,7 +23,6 @@ SOURCES += [
'DocAccessibleWrap.cpp',
'EnumVariant.cpp',
'HTMLTableAccessibleWrap.cpp',
'HTMLWin32ObjectAccessible.cpp',
'HyperTextAccessibleWrap.cpp',
'ImageAccessibleWrap.cpp',
'IUnknownImpl.cpp',
-2
View File
@@ -43,8 +43,6 @@ gyp_vars.update({
'arm_neon': 0,
'arm_neon_optional': 1,
'moz_webrtc_omx': 0,
'moz_webrtc_mediacodec': 0,
# Turn off multi monitor screen share
'multi_monitor_screenshare%' : 0,
+1 -1
View File
@@ -344,7 +344,7 @@ def split_triplet(triplet):
if cpu.endswith('86') or (cpu.startswith('i') and '86' in cpu):
canonical_cpu = 'x86'
endianness = 'little'
elif cpu in ('x86_64', 'ia64'):
elif cpu == 'x86_64':
canonical_cpu = cpu
endianness = 'little'
elif cpu in ('s390', 's390x'):
+1
View File
@@ -164,6 +164,7 @@ def old_configure_options(*options):
'--enable-negotiateauth',
'--enable-nfc',
'--enable-npapi',
'--enable-npapi-gtk2',
'--enable-nspr-build',
'--enable-official-branding',
'--enable-official-vendor',
+1 -7
View File
@@ -290,11 +290,6 @@ fi
if [ -n "$LD_LIBRARY_PATH_64" ]; then
LD_LIBRARY_PATH_64=${MOZ_DIST_BIN}:${MOZ_DIST_BIN}/plugins:${MRE_HOME}${LD_LIBRARY_PATH_64:+":$LD_LIBRARY_PATH_64"}
fi
#
#
## Set SHLIB_PATH for HPUX
SHLIB_PATH=${MOZ_DIST_BIN}:${MRE_HOME}${SHLIB_PATH:+":$SHLIB_PATH"}
#
## Set LIBPATH for AIX
LIBPATH=${MOZ_DIST_BIN}:${MRE_HOME}${LIBPATH:+":$LIBPATH"}
#
@@ -339,7 +334,6 @@ then
fi
echo "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH"
echo " LIBRARY_PATH=$LIBRARY_PATH"
echo " SHLIB_PATH=$SHLIB_PATH"
echo " LIBPATH=$LIBPATH"
echo " ADDON_PATH=$ADDON_PATH"
echo " MOZ_PROGRAM=$MOZ_PROGRAM"
@@ -350,7 +344,7 @@ then
fi
#
export MOZILLA_FIVE_HOME LD_LIBRARY_PATH
export SHLIB_PATH LIBPATH LIBRARY_PATH ADDON_PATH DYLD_LIBRARY_PATH
export LIBPATH LIBRARY_PATH ADDON_PATH DYLD_LIBRARY_PATH
if [ $moz_debug -eq 1 ]
then
+1 -1
View File
@@ -26,6 +26,6 @@
global DATA_SYMBOL
%endif
SECTION .rodata align=16
SECTION .rodata data readable align=16
DATA_SYMBOL:
incbin ICU_DATA_FILE
+6
View File
@@ -6,7 +6,13 @@
.section .note.GNU-stack,"",%progbits
#endif
.global ICU_DATA_SYMBOL
#if defined(__APPLE__)
.const
#elif defined(__GNUC__) && !defined(XP_SOLARIS)
.section .rodata
#else
.data
#endif
.balign 16
ICU_DATA_SYMBOL:
.incbin ICU_DATA_FILE
+2
View File
@@ -17,6 +17,8 @@ DEFINES.update(
UCONFIG_NO_LEGACY_CONVERSION = True,
UCONFIG_NO_TRANSLITERATION = True,
UCONFIG_NO_REGULAR_EXPRESSIONS = True,
UCONFIG_NO_BREAK_ITERATION = True,
UCONFIG_NO_MF2 = True,
# We don't need to pass data to and from legacy char* APIs.
U_CHARSET_IS_UTF8 = True,
+1 -1
View File
@@ -81,7 +81,7 @@ $(addprefix install-,$(INSTALL_MANIFESTS)): install-%: $(addprefix $(TOPOBJDIR)/
--track install_$(subst /,_,$*).track \
$(TOPOBJDIR)/$* \
-DAB_CD=en-US \
-DBOOKMARKS_INCLUDE_DIR=$(TOPSRCDIR)/browser/locales/en-US/profile \
-DBOOKMARKS_INCLUDE_DIR=$(TOPSRCDIR)/$(MOZ_BUILD_APP)/locales/en-US/profile \
$(ACDEFINES) \
install_$(subst /,_,$*)
-1
View File
@@ -448,7 +448,6 @@ gtk/gtkx.h
gtk/gtkunixprint.h
HIToolbox/HIToolbox.h
hlink.h
ia64/sys/inline.h
Icons.h
iconv.h
ieeefp.h
+17230 -8908
View File
File diff suppressed because it is too large. Load diff
+969 -295
View File
File diff suppressed because it is too large. Load diff
@@ -143,7 +143,8 @@ TooltipsOverlay.prototype = {
// Font preview tooltip
if (type === VIEW_NODE_VALUE_TYPE && prop.property === "font-family") {
let value = prop.value.toLowerCase();
if (value !== "inherit" && value !== "unset" && value !== "initial" && value !== "revert") {
if (value !== "inherit" && value !== "unset" && value !== "initial" &&
value !== "revert" && value !== "revert-layer") {
tooltipType = TOOLTIP_FONTFAMILY_TYPE;
}
}
+7 -6
View File
@@ -204,21 +204,22 @@ function initialHTML(doc) {
os = "linux";
}
let base = doc.createElement("base");
base.href = "resource://devtools/client/jsonview/";
// The appRoot URI is prepended to all URIs instead of using a <base> element
// because the latter can cause spurious network requests (UXP Issue #3122)
let appRoot = "resource://devtools/client/jsonview/";
let style = doc.createElement("link");
style.rel = "stylesheet";
style.type = "text/css";
style.href = base.href +"css/main.css";
style.href = appRoot +"css/main.css";
let script = doc.createElement("script");
script.src = base.href + "lib/require.js";
script.dataset.main = "viewer-config";
script.src = appRoot + "lib/require.js";
script.dataset.main = appRoot + "viewer-config.js";
script.defer = true;
let head = doc.createElement("head");
head.append(base, style, script);
head.append(style, script);
return "<!DOCTYPE html>\n" +
startTag("html", {
@@ -4,6 +4,8 @@ subsuite = devtools
support-files =
array_json.json
array_json.json^headers^
csp_json.json
csp_json.json^headers^
doc_frame_script.js
head.js
invalid_json.json
@@ -22,6 +24,7 @@ subsuite = clipboard
subsuite = clipboard
[browser_jsonview_copy_rawdata.js]
subsuite = clipboard
[browser_jsonview_csp_json.js]
[browser_jsonview_filter.js]
[browser_jsonview_invalid_json.js]
[browser_jsonview_valid_json.js]
@@ -0,0 +1,17 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const TEST_JSON_URL = URL_ROOT + "csp_json.json";
add_task(function* () {
info("Test CSP JSON started");
yield addJsonViewTab(TEST_JSON_URL);
let count = yield getElementCount(".jsonPanelBox .treeTable .treeRow");
is(count, 1, "There must be one row");
});
@@ -0,0 +1 @@
{"csp": true}
@@ -0,0 +1,2 @@
Content-Type: application/json
Content-Security-Policy: default-src 'none'; base-uri 'none';
+1 -1
View File
@@ -23,7 +23,7 @@
* of the code base, so it's consistent and modules can be easily reused.
*/
require.config({
baseUrl: ".",
baseUrl: "resource://devtools/client/jsonview/",
paths: {
"devtools/client/shared": "resource://devtools/client/shared",
"devtools/shared": "resource://devtools/shared",
+1 -1
View File
@@ -3,6 +3,6 @@
# 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/.
JS_PREFERENCE_PP_FILES += [
JS_PREFERENCE_FILES += [
'devtools.js',
]
+2 -1
View File
@@ -10,7 +10,8 @@ const SPECIALVALUES = new Set([
"initial",
"inherit",
"unset",
"revert"
"revert",
"revert-layer"
]);
const {getCSSLexer} = require("devtools/shared/css/lexer");
@@ -99,7 +99,14 @@ const filterList = [
];
// Valid values that shouldn't be parsed for filters.
const SPECIAL_VALUES = new Set(["none", "unset", "initial", "inherit", "revert"]);
const SPECIAL_VALUES = new Set([
"none",
"unset",
"initial",
"inherit",
"revert",
"revert-layer"
]);
/**
* A CSS Filter editor widget used to add/remove/modify
+2 -1
View File
@@ -20,7 +20,8 @@ const SPECIALVALUES = new Set([
"inherit",
"transparent",
"unset",
"revert"
"revert",
"revert-layer"
]);
/**
@@ -43,7 +43,7 @@ class MachCommands(MachCommandBase):
if not os.path.exists(generated_dir):
generated_dir = mozpath.join(self.topsrcdir, 'platform',
'devtools/shared/css/generated')
else:
if not os.path.exists(generated_dir):
raise Exception('Directory expected at %s does not exist.' % generated_dir)
self.generated_dir = generated_dir
@@ -75,6 +75,9 @@ class MachCommands(MachCommandBase):
contents = subprocess.check_output([xpcshell_path, '-g', gre_path,
'-a', browser_path, script_path],
env = sub_env)
if not isinstance(contents, str):
contents = contents.decode('utf-8')
# Extract just the output between the delimiters as the xpcshell output can
# have extra output that we don't want.
contents = contents.split('DEVTOOLS_CSS_DB_DELIMITER')[1]
@@ -88,13 +91,13 @@ class MachCommands(MachCommandBase):
destination_path = mozpath.join(self.generated_dir,
'properties-db.js')
with open(js_template_path, 'rb') as handle:
with open(js_template_path, 'r') as handle:
js_template = handle.read()
preamble = '/* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT */\n\n'
contents = string.Template(js_template).substitute(substitutions)
with open(destination_path, 'wb') as destination:
with open(destination_path, 'w') as destination:
destination.write(preamble + contents)
print(('The database was successfully generated at ' + destination_path))
File diff suppressed because it is too large. Load diff
+1
View File
@@ -31,6 +31,7 @@ public:
void
Unfollow();
/* Should this be WeakRef? */
RefPtr<AbortSignal> mFollowingSignal;
};
+99
View File
@@ -5,13 +5,19 @@
#include "DocumentOrShadowRoot.h"
#include "mozilla/EventStateManager.h"
#include "mozilla/CSSStyleSheet.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/CSSStyleSheetBinding.h"
#include "mozilla/dom/StyleSheetList.h"
#include "mozilla/dom/ToJSValue.h"
#include "nsDocument.h"
#include "nsFocusManager.h"
#include "ShadowRoot.h"
#include "XULDocument.h"
#include "nsLayoutUtils.h"
#include "nsSVGUtils.h"
#include "jsapi.h"
class nsINode;
class nsIDocument;
@@ -43,6 +49,99 @@ DocumentOrShadowRoot::EnsureDOMStyleSheets()
return *mDOMStyleSheets;
}
void
DocumentOrShadowRoot::GetAdoptedStyleSheets(
JSContext* aCx,
JS::MutableHandle<JSObject*> aResult,
ErrorResult& aRv) const
{
JS::Rooted<JS::Value> value(aCx);
if (!ToJSValue(aCx, mAdoptedStyleSheets, &value)) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return;
}
MOZ_ASSERT(value.isObject());
aResult.set(&value.toObject());
}
void
DocumentOrShadowRoot::SetAdoptedStyleSheets(
JSContext* aCx,
JS::Handle<JSObject*> aSheets,
ErrorResult& aRv)
{
bool isArray = false;
if (!JS_IsArrayObject(aCx, aSheets, &isArray)) {
aRv.Throw(NS_ERROR_FAILURE);
return;
}
if (!isArray) {
aRv.ThrowTypeError<MSG_NOT_SEQUENCE>(
NS_LITERAL_STRING("DocumentOrShadowRoot.adoptedStyleSheets"));
return;
}
uint32_t length = 0;
if (!JS_GetArrayLength(aCx, aSheets, &length)) {
aRv.Throw(NS_ERROR_FAILURE);
return;
}
nsIDocument* document = AsNode().OwnerDoc();
nsTArray<RefPtr<CSSStyleSheet>> newSheets;
if (!newSheets.SetCapacity(length, fallible)) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return;
}
JS::Rooted<JS::Value> value(aCx);
for (uint32_t i = 0; i < length; ++i) {
if (!JS_GetElement(aCx, aSheets, i, &value)) {
aRv.Throw(NS_ERROR_FAILURE);
return;
}
if (!value.isObject()) {
aRv.ThrowTypeError<MSG_DOES_NOT_IMPLEMENT_INTERFACE>(
NS_LITERAL_STRING("Element of DocumentOrShadowRoot.adoptedStyleSheets"),
NS_LITERAL_STRING("CSSStyleSheet"));
return;
}
RefPtr<CSSStyleSheet> sheet;
nsresult rv = UnwrapObject<prototypes::id::CSSStyleSheet,
CSSStyleSheet>(&value.toObject(), sheet);
if (NS_FAILED(rv)) {
aRv.ThrowTypeError<MSG_DOES_NOT_IMPLEMENT_INTERFACE>(
NS_LITERAL_STRING("Element of DocumentOrShadowRoot.adoptedStyleSheets"),
NS_LITERAL_STRING("CSSStyleSheet"));
return;
}
if (!sheet->IsConstructed() || sheet->ConstructorDocument() != document) {
aRv.Throw(NS_ERROR_DOM_NOT_ALLOWED_ERR);
return;
}
newSheets.AppendElement(sheet);
}
nsTArray<RefPtr<CSSStyleSheet>> oldSheets;
oldSheets.SwapElements(mAdoptedStyleSheets);
mAdoptedStyleSheets.SwapElements(newSheets);
if (mKind == Kind::Document) {
static_cast<nsDocument&>(AsNode()).AdoptedStyleSheetsChanged(oldSheets,
mAdoptedStyleSheets);
return;
}
static_cast<ShadowRoot&>(AsNode()).AdoptedStyleSheetsChanged(oldSheets,
mAdoptedStyleSheets);
}
Element*
DocumentOrShadowRoot::GetElementById(const nsAString& aElementId)
{
+16
View File
@@ -11,11 +11,14 @@
#include "nsContentListDeclarations.h"
#include "nsNameSpaceManager.h"
#include "mozilla/dom/NameSpaceConstants.h"
#include "js/RootingAPI.h"
class nsContentList;
class nsINode;
namespace mozilla {
class CSSStyleSheet;
class ErrorResult;
class StyleSheet;
namespace dom {
@@ -83,6 +86,18 @@ public:
StyleSheetList& EnsureDOMStyleSheets();
void GetAdoptedStyleSheets(JSContext* aCx,
JS::MutableHandle<JSObject*> aResult,
mozilla::ErrorResult& aRv) const;
void SetAdoptedStyleSheets(JSContext* aCx,
JS::Handle<JSObject*> aSheets,
mozilla::ErrorResult& aRv);
const nsTArray<RefPtr<mozilla::CSSStyleSheet>>& AdoptedStyleSheets() const
{
return mAdoptedStyleSheets;
}
Element* GetElementById(const nsAString& aElementId);
/**
@@ -151,6 +166,7 @@ protected:
Element* GetRetargetedFocusedElement();
nsTArray<RefPtr<mozilla::StyleSheet>> mStyleSheets;
nsTArray<RefPtr<mozilla::CSSStyleSheet>> mAdoptedStyleSheets;
RefPtr<mozilla::dom::StyleSheetList> mDOMStyleSheets;
/*
+53 -4
View File
@@ -18,6 +18,7 @@
#include "mozilla/dom/StyleSheetList.h"
#include "nsXBLPrototypeBinding.h"
#include "mozilla/BasicEvents.h"
#include "mozilla/CSSStyleSheet.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
@@ -30,6 +31,7 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(ShadowRoot)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(ShadowRoot,
DocumentFragment)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDOMStyleSheets)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAdoptedStyleSheets)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAssociatedBinding)
for (auto iter = tmp->mIdentifierMap.ConstIter(); !iter.Done();
iter.Next()) {
@@ -42,6 +44,10 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ShadowRoot)
tmp->GetHost()->RemoveMutationObserver(tmp);
}
NS_IMPL_CYCLE_COLLECTION_UNLINK(mDOMStyleSheets)
for (CSSStyleSheet* sheet : tmp->mAdoptedStyleSheets) {
sheet->RemoveAdopter(tmp);
}
tmp->mAdoptedStyleSheets.Clear();
NS_IMPL_CYCLE_COLLECTION_UNLINK(mAssociatedBinding)
tmp->mIdentifierMap.Clear();
NS_IMPL_CYCLE_COLLECTION_UNLINK_END_INHERITED(DocumentFragment)
@@ -90,6 +96,11 @@ ShadowRoot::~ShadowRoot()
host->RemoveMutationObserver(this);
}
for (CSSStyleSheet* sheet : mAdoptedStyleSheets) {
sheet->RemoveAdopter(this);
}
mAdoptedStyleSheets.Clear();
UnsetFlags(NODE_IS_IN_SHADOW_TREE);
// nsINode destructor expects mSubtreeRoot == this.
@@ -270,15 +281,20 @@ ShadowRoot::InsertSheet(StyleSheet* aSheet,
linkingElement->SetStyleSheet(aSheet); // This sets the ownerNode on the sheet
MOZ_DIAGNOSTIC_ASSERT(mProtoBinding->SheetCount() == DocumentOrShadowRoot::SheetCount());
MOZ_DIAGNOSTIC_ASSERT(mProtoBinding->SheetCount() ==
DocumentOrShadowRoot::SheetCount() +
mAdoptedStyleSheets.Length());
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
// FIXME(emilio, bug 1425759): For now we keep them duplicated, the proto
// binding will disappear soon (tm).
// FIXME(emilio, bug 1425759): For now we keep regular sheets duplicated;
// adopted sheets are stored as a suffix on the proto binding only.
{
size_t i = 0;
for (RefPtr<StyleSheet>& sheet : mStyleSheets) {
MOZ_DIAGNOSTIC_ASSERT(sheet.get() == mProtoBinding->StyleSheetAt(i++));
}
for (RefPtr<CSSStyleSheet>& sheet : mAdoptedStyleSheets) {
MOZ_DIAGNOSTIC_ASSERT(sheet.get() == mProtoBinding->StyleSheetAt(i++));
}
}
#endif
@@ -287,7 +303,7 @@ ShadowRoot::InsertSheet(StyleSheet* aSheet,
for (size_t i = 0; i <= SheetCount(); i++) {
if (i == SheetCount()) {
AppendStyleSheet(*aSheet);
mProtoBinding->AppendStyleSheet(aSheet);
mProtoBinding->InsertStyleSheetAt(i, aSheet);
break;
}
@@ -322,6 +338,39 @@ ShadowRoot::RemoveSheet(StyleSheet* aSheet)
}
}
void
ShadowRoot::AdoptedStyleSheetsChanged(
const nsTArray<RefPtr<CSSStyleSheet>>& aOldSheets,
const nsTArray<RefPtr<CSSStyleSheet>>& aNewSheets)
{
OwnerDoc()->BeginUpdate(UPDATE_STYLE);
bool applicableChange = false;
for (size_t i = 0; i < aOldSheets.Length(); ++i) {
CSSStyleSheet* sheet = aOldSheets[i];
if (aOldSheets.IndexOf(sheet) == i) {
mProtoBinding->RemoveStyleSheet(sheet);
}
applicableChange = applicableChange || sheet->IsApplicable();
sheet->RemoveAdopter(this);
}
for (size_t i = 0; i < aNewSheets.Length(); ++i) {
CSSStyleSheet* sheet = aNewSheets[i];
sheet->AddAdopter(this);
if (aNewSheets.IndexOf(sheet) == i) {
mProtoBinding->AppendStyleSheet(sheet);
}
applicableChange = applicableChange || sheet->IsApplicable();
}
if (applicableChange) {
StyleSheetChanged();
}
OwnerDoc()->EndUpdate(UPDATE_STYLE);
}
void
ShadowRoot::AddToIdTable(Element* aElement, nsIAtom* aId)
{
+4 -1
View File
@@ -21,6 +21,7 @@ class nsXBLPrototypeBinding;
namespace mozilla {
class CSSStyleSheet;
class EventChainPreVisitor;
namespace dom {
@@ -59,6 +60,9 @@ public:
// [deprecated] Shadow DOM v0
void InsertSheet(StyleSheet* aSheet, nsIContent* aLinkingContent);
void RemoveSheet(StyleSheet* aSheet);
void AdoptedStyleSheetsChanged(
const nsTArray<RefPtr<mozilla::CSSStyleSheet>>& aOldSheets,
const nsTArray<RefPtr<mozilla::CSSStyleSheet>>& aNewSheets);
StyleSheetList* StyleSheets()
{
return &DocumentOrShadowRoot::EnsureDOMStyleSheets();
@@ -173,4 +177,3 @@ protected:
} // namespace mozilla
#endif // mozilla_dom_shadowroot_h__
+2
View File
@@ -40,12 +40,14 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(Timeout)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Timeout)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mWindow)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mTimer)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mPrincipal)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mScriptHandler)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Timeout)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindow)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTimer)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPrincipal)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mScriptHandler)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
+16
View File
@@ -25,6 +25,22 @@ VisualViewport::~VisualViewport()
{
}
NS_IMPL_CYCLE_COLLECTION_CLASS(VisualViewport)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(VisualViewport,
DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(VisualViewport,
DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(VisualViewport)
NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
NS_IMPL_ADDREF_INHERITED(VisualViewport, DOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(VisualViewport, DOMEventTargetHelper)
/* virtual */
JSObject*
VisualViewport::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
+3
View File
@@ -21,6 +21,9 @@ class VisualViewport final: public mozilla::DOMEventTargetHelper
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(VisualViewport, DOMEventTargetHelper)
explicit VisualViewport(nsPIDOMWindowInner* aWindow);
explicit VisualViewport(nsIGlobalObject* aGlobal);
+1 -1
View File
@@ -274,7 +274,7 @@ public:
}
template<typename T,
typename = typename std::enable_if<std::is_enum<T>::value>::type>
typename = typename std::enable_if_t<std::is_enum_v<T>>>
EnumTable(const char* aTag, T aValue)
: tag(aTag)
, value(static_cast<int16_t>(aValue))
+19 -6
View File
@@ -695,7 +695,7 @@ nsContentList::ContentAppended(nsIDocument* aDocument, nsIContent* aContainer,
!MayContainRelevantNodes(aContainer) ||
(!aFirstNewContent->HasChildren() &&
!aFirstNewContent->GetNextSibling() &&
!MatchSelf(aFirstNewContent))) {
!MatchSelf<MatchSelfMode::Insertion>(aFirstNewContent))) {
return;
}
@@ -731,7 +731,7 @@ nsContentList::ContentAppended(nsIDocument* aDocument, nsIContent* aContainer,
// The new stuff is somewhere in the middle of our list; check
// whether we need to invalidate
for (nsIContent* cur = aFirstNewContent; cur; cur = cur->GetNextSibling()) {
if (MatchSelf(cur)) {
if (MatchSelf<MatchSelfMode::Insertion>(cur)) {
// Uh-oh. We're gonna have to add elements into the middle
// of our list. That's not worth the effort.
SetDirty();
@@ -788,7 +788,7 @@ nsContentList::ContentInserted(nsIDocument *aDocument,
if (mState != LIST_DIRTY &&
MayContainRelevantNodes(NODE_FROM(aContainer, aDocument)) &&
nsContentUtils::IsInSameAnonymousTree(mRootNode, aChild) &&
MatchSelf(aChild)) {
MatchSelf<MatchSelfMode::Insertion>(aChild)) {
SetDirty();
}
@@ -808,7 +808,7 @@ nsContentList::ContentRemoved(nsIDocument *aDocument,
if (mState != LIST_DIRTY &&
MayContainRelevantNodes(NODE_FROM(aContainer, aDocument)) &&
nsContentUtils::IsInSameAnonymousTree(mRootNode, aChild) &&
MatchSelf(aChild)) {
MatchSelf<MatchSelfMode::Removal>(aChild)) {
SetDirty();
}
@@ -853,6 +853,7 @@ nsContentList::Match(Element *aElement)
ni->Equals(mXMLMatchAtom, mMatchNameSpaceId);
}
template <nsContentList::MatchSelfMode Mode>
bool
nsContentList::MatchSelf(nsIContent *aContent)
{
@@ -864,8 +865,20 @@ nsContentList::MatchSelf(nsIContent *aContent)
return false;
}
if (Match(aContent->AsElement()))
auto matches = [&](Element* aElement) {
if (Match(aElement)) {
return true;
}
if constexpr (Mode == MatchSelfMode::Removal) {
return mFunc == nsContentUtils::MatchClassNames &&
aElement->IsSVGElement() && aElement->MayHaveClass();
}
return false;
};
if (matches(aContent->AsElement())) {
return true;
}
if (!mDeep)
return false;
@@ -873,7 +886,7 @@ nsContentList::MatchSelf(nsIContent *aContent)
for (nsIContent* cur = aContent->GetFirstChild();
cur;
cur = cur->GetNextNode(aContent)) {
if (cur->IsElement() && Match(cur->AsElement())) {
if (cur->IsElement() && matches(cur->AsElement())) {
return true;
}
}
+10
View File
@@ -367,6 +367,15 @@ protected:
* @return whether we match
*/
bool Match(mozilla::dom::Element *aElement);
enum class MatchSelfMode : uint8_t {
Insertion,
// Also accept SVG elements that may have a class. SMIL can change their
// class without notification, so they can be in the list without
// matching now. Needed when aContent leaves the subtree.
Removal,
};
/**
* See if anything in the subtree rooted at aContent, including
* aContent itself, matches our criterion.
@@ -374,6 +383,7 @@ protected:
* @param aContent the root of the subtree to match against
* @return whether we match something in the tree rooted at aContent
*/
template <MatchSelfMode Mode>
bool MatchSelf(nsIContent *aContent);
/**
+4 -3
View File
@@ -2073,6 +2073,10 @@ public:
aClasses);
}
static bool MatchClassNames(mozilla::dom::Element* aElement,
int32_t aNamespaceID,
nsIAtom* aAtom, void* aData);
/**
* Returns a presshell for this document, if there is one. This will be
* aDoc's direct presshell if there is one, otherwise we'll look at all
@@ -3012,9 +3016,6 @@ private:
static void DropFragmentParsers();
static bool MatchClassNames(mozilla::dom::Element* aElement,
int32_t aNamespaceID,
nsIAtom* aAtom, void* aData);
static void DestroyClassNameArray(void* aData);
static void* AllocClassMatchingInfo(nsINode* aRootNode,
const nsString* aClasses);
+1 -1
View File
@@ -921,7 +921,7 @@ private:
// List of nodes referred to by mEntryTable so we can sort them
// For a specific pseudo element, we use its parent element as the
// batch target, so they will be put in the same EntryArray.
nsTArray<nsINode*> mBatchTargets;
nsTArray<nsCOMPtr<nsINode>> mBatchTargets;
};
inline
+60
View File
@@ -13,6 +13,7 @@
#include "mozilla/ArrayUtils.h"
#include "mozilla/AutoRestore.h"
#include "mozilla/BinarySearch.h"
#include "mozilla/CSSStyleSheet.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/EffectSet.h"
#include "mozilla/IntegerRange.h"
@@ -1402,6 +1403,10 @@ nsDocument::~nsDocument()
for (StyleSheet* sheet : mStyleSheets) {
sheet->ClearAssociatedDocument();
}
for (CSSStyleSheet* sheet : mAdoptedStyleSheets) {
sheet->RemoveAdopter(this);
}
mAdoptedStyleSheets.Clear();
for (auto& sheets : mAdditionalSheets) {
for (StyleSheet* sheet : sheets) {
sheet->ClearAssociatedDocument();
@@ -1635,6 +1640,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsDocument)
// Traverse all our nsCOMArrays.
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mStyleSheets)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAdoptedStyleSheets)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOnDemandBuiltInUASheets)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPreloadingImages)
@@ -1740,6 +1746,11 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mDOMStyleSheets)
for (CSSStyleSheet* sheet : tmp->mAdoptedStyleSheets) {
sheet->RemoveAdopter(tmp);
}
tmp->mAdoptedStyleSheets.Clear();
if (tmp->mStyleSheetSetList) {
tmp->mStyleSheetSetList->Disconnect();
tmp->mStyleSheetSetList = nullptr;
@@ -2205,6 +2216,12 @@ nsDocument::FillStyleSet(nsStyleSet* aStyleSet)
AppendSheetsToStyleSet(aStyleSet, mAdditionalSheets[eAuthorSheet],
SheetType::Doc);
for (CSSStyleSheet* sheet : mAdoptedStyleSheets) {
if (sheet->IsApplicable()) {
aStyleSet->AppendStyleSheet(SheetType::Doc, sheet);
}
}
mStyleSetFilled = true;
}
@@ -3872,6 +3889,37 @@ nsDocument::RemoveStyleSheetFromStyleSets(StyleSheet* aSheet)
}
}
void
nsDocument::AdoptedStyleSheetsChanged(
const nsTArray<RefPtr<CSSStyleSheet>>& aOldSheets,
const nsTArray<RefPtr<CSSStyleSheet>>& aNewSheets)
{
BeginUpdate(UPDATE_STYLE);
nsCOMPtr<nsIPresShell> shell = GetShell();
nsStyleSet* styleSet = shell ? shell->StyleSet() : nullptr;
for (size_t i = 0; i < aOldSheets.Length(); ++i) {
CSSStyleSheet* sheet = aOldSheets[i];
if (styleSet && sheet->IsApplicable() &&
aOldSheets.IndexOf(sheet) == i) {
styleSet->RemoveStyleSheet(SheetType::Doc, sheet);
}
sheet->RemoveAdopter(this);
}
for (size_t i = 0; i < aNewSheets.Length(); ++i) {
CSSStyleSheet* sheet = aNewSheets[i];
sheet->AddAdopter(this);
if (styleSet && sheet->IsApplicable() &&
aNewSheets.IndexOf(sheet) == i) {
styleSet->AppendStyleSheet(SheetType::Doc, sheet);
}
}
EndUpdate(UPDATE_STYLE);
}
void
nsDocument::RemoveStyleSheet(StyleSheet* aSheet)
{
@@ -3961,6 +4009,18 @@ nsDocument::SetStyleSheetApplicableState(StyleSheet* aSheet,
} else {
RemoveStyleSheetFromStyleSets(aSheet);
}
} else if (mAdoptedStyleSheets.IndexOf(aSheet->AsConcrete()) !=
mAdoptedStyleSheets.NoIndex) {
nsCOMPtr<nsIPresShell> shell = GetShell();
if (shell) {
if (aApplicable) {
shell->StyleSet()->AppendStyleSheet(SheetType::Doc,
aSheet->AsConcrete());
} else {
shell->StyleSet()->RemoveStyleSheet(SheetType::Doc,
aSheet->AsConcrete());
}
}
}
// We have to always notify, since this will be called for sheets
+4
View File
@@ -95,6 +95,7 @@ class nsISecurityConsoleMessage;
class nsPIBoxObject;
namespace mozilla {
class CSSStyleSheet;
class EventChainPreVisitor;
namespace dom {
class BoxObject;
@@ -471,6 +472,9 @@ public:
nsTArray<RefPtr<mozilla::StyleSheet>>& aNewSheets) override;
virtual void AddStyleSheetToStyleSets(mozilla::StyleSheet* aSheet);
virtual void RemoveStyleSheetFromStyleSets(mozilla::StyleSheet* aSheet);
void AdoptedStyleSheetsChanged(
const nsTArray<RefPtr<mozilla::CSSStyleSheet>>& aOldSheets,
const nsTArray<RefPtr<mozilla::CSSStyleSheet>>& aNewSheets);
virtual void InsertStyleSheetAt(mozilla::StyleSheet* aSheet,
size_t aIndex) override;
+2 -1
View File
@@ -1738,8 +1738,9 @@ nsFocusManager::Blur(nsPIDOMWindowOuter* aWindowToClear,
if (mActiveWindow)
window->UpdateCommands(NS_LITERAL_STRING("focus"), nullptr, 0);
nsCOMPtr<nsIDocument> doc = content->GetComposedDoc();
SendFocusOrBlurEvent(eBlur, presShell,
content->GetComposedDoc(), content, 1,
doc, content, 1,
false, false, aContentToFocus);
}
+1
View File
@@ -444,6 +444,7 @@ GK_ATOM(handheldFriendly, "HandheldFriendly")
GK_ATOM(handler, "handler")
GK_ATOM(handlers, "handlers")
GK_ATOM(HARD, "HARD")
GK_ATOM(hasSelectorDependency, "has-selector-dependency")
GK_ATOM(hasSameNode, "has-same-node")
GK_ATOM(hbox, "hbox")
GK_ATOM(head, "head")
+21 -3
View File
@@ -2176,6 +2176,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsGlobalWindow)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLocation)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mHistory)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCustomElements)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mVisualViewport)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLocalStorage)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSessionStorage)
@@ -2254,6 +2255,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGlobalWindow)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mLocation)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mHistory)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mCustomElements)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mVisualViewport)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mLocalStorage)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mSessionStorage)
if (tmp->mApplicationCache) {
@@ -6162,7 +6164,6 @@ nsGlobalWindow::CheckSecurityWidthAndHeight(int32_t* aWidth, int32_t* aHeight, b
// This one is easy. Just ensure the variable is greater than 100;
if ((aWidth && *aWidth < 100) || (aHeight && *aHeight < 100)) {
// Check security state for use in determing window dimensions
if (!nsContentUtils::IsCallerChrome()) {
//sec check failed
if (aWidth && *aWidth < 100) {
@@ -6173,6 +6174,21 @@ nsGlobalWindow::CheckSecurityWidthAndHeight(int32_t* aWidth, int32_t* aHeight, b
}
}
}
// Check for the screen dimensions and keep the size in the range of the
// screen size the window is on. We allow twice the screen size because the
// size we get for a screen is not always accurate, on Wayland in particular,
// and all we need is to keep the size in a reasonable range.
nsCOMPtr<nsIDOMScreen> screen = GetScreen();
int32_t screenWidth, screenHeight;
screen->GetAvailWidth(&screenWidth);
screen->GetAvailHeight(&screenHeight);
if (aWidth && *aWidth > 2 * screenWidth) {
*aWidth = 2 * screenWidth;
}
if (aHeight && *aHeight > 2 * screenHeight) {
*aHeight = 2 * screenHeight;
}
}
// NOTE: Arguments to this function should have values in device pixels
@@ -8091,8 +8107,10 @@ nsGlobalWindow::ResizeByOuter(int32_t aWidthDif, int32_t aHeightDif,
nsIntSize cssSize(DevToCSSIntPixels(nsIntSize(width, height)));
cssSize.width += aWidthDif;
cssSize.height += aHeightDif;
// The deltas come from content and can be large enough to overflow a 32-bit
// add, so do the arithmetic in 64 bits and keep the result in range.
cssSize.width = int32_t(std::clamp<int64_t>(int64_t(cssSize.width) + aWidthDif, 0, INT32_MAX));
cssSize.height = int32_t(std::clamp<int64_t>(int64_t(cssSize.height) + aHeightDif, 0, INT32_MAX));
CheckSecurityWidthAndHeight(&cssSize.width, &cssSize.height, aCallerIsChrome);
+3
View File
@@ -46,6 +46,9 @@ nsIDocument::FindDocStyleSheetInsertionPoint(
break;
}
}
if (sheet->IsConstructed()) {
break;
}
if (sheet == GetFirstAdditionalAuthorSheet()) {
break;
}
+6 -3
View File
@@ -682,16 +682,19 @@ DataTransfer::SetDataAtInternal(const nsAString& aFormat, nsIVariant* aData,
return NS_ERROR_DOM_INDEX_SIZE_ERR;
}
nsAutoString format;
GetRealFormat(aFormat, format);
// Don't allow the custom type to be assigned.
if (aFormat.EqualsLiteral(kCustomTypesMime)) {
if (format.EqualsLiteral(kCustomTypesMime)) {
return NS_ERROR_TYPE_ERR;
}
if (!PrincipalMaySetData(aFormat, aData, aSubjectPrincipal)) {
if (!PrincipalMaySetData(format, aData, aSubjectPrincipal)) {
return NS_ERROR_DOM_SECURITY_ERR;
}
return SetDataWithPrincipal(aFormat, aData, aIndex, aSubjectPrincipal);
return SetDataWithPrincipal(format, aData, aIndex, aSubjectPrincipal);
}
void
+2 -1
View File
@@ -29,18 +29,19 @@ using namespace workers;
NS_IMPL_CYCLE_COLLECTING_ADDREF(Request)
NS_IMPL_CYCLE_COLLECTING_RELEASE(Request)
NS_IMPL_CYCLE_COLLECTION_CLASS(Request)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Request)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mOwner)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mHeaders)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mSignal)
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Request)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOwner)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mHeaders)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSignal)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(Request)
+2 -1
View File
@@ -30,12 +30,12 @@ namespace dom {
NS_IMPL_CYCLE_COLLECTING_ADDREF(Response)
NS_IMPL_CYCLE_COLLECTING_RELEASE(Response)
NS_IMPL_CYCLE_COLLECTION_CLASS(Response)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Response)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mOwner)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mHeaders)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mSignal)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mFetchStreamReader)
tmp->mReadableStreamBody = nullptr;
@@ -47,6 +47,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Response)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOwner)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mHeaders)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSignal)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mFetchStreamReader)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
+4
View File
@@ -1132,6 +1132,7 @@ void HTMLMediaElement::AbortExistingLoads()
RemoveMediaElementFromURITable();
mLoadingSrc = nullptr;
mCORSMode = CORS_NONE;
mMediaSource = nullptr;
if (mNetworkState == nsIDOMHTMLMediaElement::NETWORK_LOADING ||
@@ -1370,6 +1371,9 @@ void HTMLMediaElement::SelectResource()
// If we have a 'src' attribute, use that exclusively.
nsAutoString src;
if (mSrcAttrStream) {
// Media provider objects use local mode, so a previous URL load's CORS
// mode does not apply.
mCORSMode = CORS_NONE;
SetupSrcMediaStreamPlayback(mSrcAttrStream);
} else if (GetAttr(kNameSpaceID_None, nsGkAtoms::src, src)) {
nsCOMPtr<nsIURI> uri;
+5 -5
View File
@@ -117,11 +117,6 @@ public:
int32_t Index();
protected:
virtual ~HTMLOptionElement();
virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
/**
* Get the select content element that contains this option, this
* intentionally does not return nsresult, all we care about is if
@@ -129,6 +124,11 @@ protected:
*/
HTMLSelectElement* GetSelect();
protected:
virtual ~HTMLOptionElement();
virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
bool mSelectedChanged;
bool mIsSelected;
+3 -3
View File
@@ -732,10 +732,10 @@ bool
HTMLSelectElement::MatchSelectedOptions(Element* aElement,
int32_t /* unused */,
nsIAtom* /* unused */,
void* /* unused*/)
void* aData)
{
HTMLOptionElement* option = HTMLOptionElement::FromContent(aElement);
return option && option->Selected();
return option && option->Selected() && option->GetSelect() == static_cast<HTMLSelectElement*>(aData);
}
nsIHTMLCollection*
@@ -743,7 +743,7 @@ HTMLSelectElement::SelectedOptions()
{
if (!mSelectedOptions) {
mSelectedOptions = new nsContentList(this, MatchSelectedOptions, nullptr,
nullptr, /* deep */ true);
this, /* deep */ true);
}
return mSelectedOptions;
}
+9 -2
View File
@@ -1487,8 +1487,15 @@ nsGenericHTMLElement::MapImageSizeAttributesInto(const nsMappedAttributes* aAttr
}
if (w && h && *w != 0 && *h != 0) {
nsCSSValue* aspect_ratio = aData->ValueForAspectRatio();
aspect_ratio->SetFloatValue((float(*w) / float(*h)), eCSSUnit_Number);
nsCSSValue width;
width.SetFloatValue(float(*w), eCSSUnit_Number);
nsCSSValue height;
height.SetFloatValue(float(*h), eCSSUnit_Number);
nsCSSValue ratio;
ratio.SetPairValue(width, height);
nsCSSValue autoValue;
autoValue.SetAutoValue();
aData->ValueForAspectRatio()->SetPairValue(autoValue, ratio);
}
}
}
+25
View File
@@ -1415,6 +1415,7 @@ BackgroundFactoryRequestChild::BackgroundFactoryRequestChild(
uint64_t aRequestedVersion)
: BackgroundRequestChildBase(aOpenRequest)
, mFactory(aFactory)
, mDatabaseActor(nullptr)
, mRequestedVersion(aRequestedVersion)
, mIsDeleteOp(aIsDeleteOp)
{
@@ -1439,6 +1440,15 @@ BackgroundFactoryRequestChild::GetOpenDBRequest() const
return static_cast<IDBOpenDBRequest*>(mRequest.get());
}
void
BackgroundFactoryRequestChild::SetDatabaseActor(BackgroundDatabaseChild* aActor)
{
AssertIsOnOwningThread();
MOZ_ASSERT(!aActor || !mDatabaseActor);
mDatabaseActor = aActor;
}
bool
BackgroundFactoryRequestChild::HandleResponse(nsresult aResponse)
{
@@ -1450,6 +1460,11 @@ BackgroundFactoryRequestChild::HandleResponse(nsresult aResponse)
DispatchErrorEvent(mRequest, aResponse);
if (mDatabaseActor) {
mDatabaseActor->ReleaseDOMObject();
MOZ_ASSERT(!mDatabaseActor);
}
return true;
}
@@ -1468,6 +1483,7 @@ BackgroundFactoryRequestChild::HandleResponse(
IDBDatabase* database = databaseActor->GetDOMObject();
if (!database) {
databaseActor->EnsureDOMObject();
MOZ_ASSERT(mDatabaseActor);
database = databaseActor->GetDOMObject();
MOZ_ASSERT(database);
@@ -1475,6 +1491,8 @@ BackgroundFactoryRequestChild::HandleResponse(
MOZ_ASSERT(!database->IsClosed());
}
MOZ_ASSERT(mDatabaseActor == databaseActor);
if (database->IsClosed()) {
// If the database was closed already, which is only possible if we fired an
// "upgradeneeded" event, then we shouldn't fire a "success" event here.
@@ -1487,6 +1505,7 @@ BackgroundFactoryRequestChild::HandleResponse(
}
databaseActor->ReleaseDOMObject();
MOZ_ASSERT(!mDatabaseActor);
return true;
}
@@ -1507,6 +1526,8 @@ BackgroundFactoryRequestChild::HandleResponse(
DispatchSuccessEvent(&helper, successEvent);
MOZ_ASSERT(!mDatabaseActor);
return true;
}
@@ -1737,6 +1758,8 @@ BackgroundDatabaseChild::EnsureDOMObject()
mDatabase = mTemporaryStrongDatabase;
mSpec.forget();
mOpenRequestActor->SetDatabaseActor(this);
}
void
@@ -1748,6 +1771,8 @@ BackgroundDatabaseChild::ReleaseDOMObject()
MOZ_ASSERT(mOpenRequestActor);
MOZ_ASSERT(mDatabase == mTemporaryStrongDatabase);
mOpenRequestActor->SetDatabaseActor(nullptr);
mOpenRequestActor = nullptr;
// This may be the final reference to the IDBDatabase object so we may end up
+17
View File
@@ -254,6 +254,20 @@ class BackgroundFactoryRequestChild final
friend class PermissionRequestParent;
RefPtr<IDBFactory> mFactory;
// Normally when opening of a database is successful, we receive a database
// actor in request response, so we can use it to call ReleaseDOMObject()
// which clears temporary strong reference to IDBDatabase.
// However, when there's an error, we don't receive a database actor and
// IDBRequest::mTransaction is already cleared (must be). So the only way how
// to call ReleaseDOMObject() is to have a back-reference to database actor.
// This creates a weak ref cycle between
// BackgroundFactoryRequestChild (using mDatabaseActor member) and
// BackgroundDatabaseChild actor (using mOpenRequestActor member).
// mDatabaseActor is set in EnsureDOMObject() and cleared in
// ReleaseDOMObject().
BackgroundDatabaseChild* mDatabaseActor;
const uint64_t mRequestedVersion;
const bool mIsDeleteOp;
@@ -271,6 +285,9 @@ private:
// Only destroyed by BackgroundFactoryChild.
~BackgroundFactoryRequestChild();
void
SetDatabaseActor(BackgroundDatabaseChild* aActor);
bool
HandleResponse(nsresult aResponse);
+3 -1
View File
@@ -138,7 +138,9 @@ GetJSValFromKeyPathString(JSContext* aCx,
// only through getters but we still want to support them for key
// extraction. So they need to be handled manually.
Blob* blob;
if (NS_SUCCEEDED(UNWRAP_OBJECT(Blob, &obj, blob))) {
// UNWRAP_OBJECT calls might mutate this.
JS::Rooted<JSObject*> blobObj(aCx, obj);
if (NS_SUCCEEDED(UNWRAP_OBJECT(Blob, &blobObj, blob))) {
if (token.EqualsLiteral("size")) {
ErrorResult rv;
uint64_t size = blob->GetSize(rv);
+1 -1
View File
@@ -2455,7 +2455,7 @@ ContentChild::RecvUpdateWindow(const uintptr_t& aChildId)
if (parentInstance) {
// sync! update call to the plugin instance that forces the
// plugin to paint its child window.
parentInstance->CallUpdateWindow();
Unused << parentInstance->CallUpdateWindow();
}
return true;
#else
+4
View File
@@ -265,6 +265,10 @@ VideoData::SetVideoDataToImage(PlanarYCbCrImage* aVideoImage,
return false;
}
if (!ValidateBufferAndPicture(aBuffer, aPicture)) {
return false;
}
PlanarYCbCrData data = ConstructPlanarYCbCrData(aInfo, aBuffer, aPicture);
aVideoImage->SetDelayedConversion(true);
+21 -7
View File
@@ -187,7 +187,7 @@ public:
{
}
explicit VideoInfo(int32_t aWidth, int32_t aHeight)
VideoInfo(int32_t aWidth, int32_t aHeight)
: VideoInfo(nsIntSize(aWidth, aHeight))
{
}
@@ -201,7 +201,6 @@ public:
, mCodecSpecificConfig(new MediaByteBuffer)
, mExtraData(new MediaByteBuffer)
, mRotation(kDegree_0)
, mImageRect(nsIntRect(nsIntPoint(), aSize))
{
}
@@ -263,15 +262,28 @@ public:
nsIntRect ImageRect() const
{
if (mImageRect.width < 0 || mImageRect.height < 0) {
if (!mImageRect) {
return nsIntRect(0, 0, mImage.width, mImage.height);
}
return mImageRect;
return *mImageRect;
}
void SetImageRect(const nsIntRect& aRect)
{
mImageRect = aRect;
mImageRect = Some(aRect);
}
void ResetImageRect() {
mImageRect.reset();
}
// Adopts an image size decoded from the bitstream. The picture rectangle is
// expressed relative to the image size, so a change in size invalidates it
// and it is discarded; an unchanged size keeps the existing rectangle.
void AdoptImageSize(const gfx::IntSize& aImage) {
if (mImage != aImage) {
ResetImageRect();
}
mImage = aImage;
}
// Returned the crop rectangle scaled to aWidth/aHeight size relative to
@@ -332,9 +344,11 @@ public:
uint8_t mBitDepth = 8;
private:
friend struct IPC::ParamTraits<VideoInfo>;
// mImage may be cropped; currently only used with the WebM container.
// A negative width or height indicate that no cropping is to occur.
nsIntRect mImageRect;
// If unset, no cropping is to occur.
Maybe<nsIntRect> mImageRect;
// Indicates whether or not frames may contain alpha information.
bool mAlphaPresent = false;
+2 -3
View File
@@ -25,7 +25,7 @@ namespace IPC {
WriteParam(aMsg, aParam.mDisplay);
WriteParam(aMsg, aParam.mStereoMode);
WriteParam(aMsg, aParam.mImage);
WriteParam(aMsg, aParam.ImageRect());
WriteParam(aMsg, aParam.mImageRect);
}
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
@@ -35,8 +35,7 @@ namespace IPC {
ReadParam(aMsg, aIter, &aResult->mDisplay) &&
ReadParam(aMsg, aIter, &aResult->mStereoMode) &&
ReadParam(aMsg, aIter, &aResult->mImage) &&
ReadParam(aMsg, aIter, &imageRect)) {
aResult->SetImageRect(imageRect);
ReadParam(aMsg, aIter, &aResult->mImageRect)) {
return true;
}
return false;
@@ -847,12 +847,15 @@ WMFVideoMFTManager::CreateBasicVideoFrame(IMFSample* aSample,
RefPtr<layers::PlanarYCbCrImage> image =
new IMFYCbCrImage(buffer, twoDBuffer);
VideoData::SetVideoDataToImage(image,
mVideoInfo,
b,
pictureRegion,
false);
if (!VideoData::SetVideoDataToImage(image,
mVideoInfo,
b,
pictureRegion,
false)) {
LOG("CreateBasicVideoFrame: failed to set video data to image (shmem path)");
return E_FAIL;
}
RefPtr<VideoData> v =
VideoData::CreateFromImage(mVideoInfo,
aStreamOffset,
@@ -307,8 +307,7 @@ H264Converter::UpdateConfigFromExtraData(MediaByteBuffer* aExtraData)
if (mp4_demuxer::H264::DecodeSPSFromExtraData(aExtraData, spsdata) &&
spsdata.pic_width > 0 && spsdata.pic_height > 0) {
mp4_demuxer::H264::EnsureSPSIsSane(spsdata);
mCurrentConfig.mImage.width = spsdata.pic_width;
mCurrentConfig.mImage.height = spsdata.pic_height;
mCurrentConfig.AdoptImageSize(gfx::IntSize(spsdata.pic_width, spsdata.pic_height));
mCurrentConfig.mDisplay.width = spsdata.display_width;
mCurrentConfig.mDisplay.height = spsdata.display_height;
}
+1 -3
View File
@@ -29,8 +29,7 @@ enum {
* Abstract interface for managing audio and video devices. Each platform
* must implement a concrete class that will map these classes and methods
* to the appropriate backend. For example, on Desktop platforms, these will
* correspond to equivalent webrtc (GIPS) calls, and on B2G they will map to
* a Gonk interface.
* correspond to equivalent webrtc (GIPS) calls.
*/
class MediaEngineVideoSource;
class MediaEngineAudioSource;
@@ -302,7 +301,6 @@ public:
/* If implementation of MediaEngineSource supports TakePhoto(), the picture
* should be return via aCallback object. Otherwise, it returns NS_ERROR_NOT_IMPLEMENTED.
* Currently, only Gonk MediaEngineSource implementation supports it.
*/
virtual nsresult TakePhoto(MediaEnginePhotoCallback* aCallback) = 0;
@@ -36,8 +36,8 @@ bool MediaEngineCameraVideoSource::AppendToTrack(SourceMediaStream* aSource,
return aSource->AppendToTrack(aID, &(segment));
}
// Sub-classes (B2G or desktop) should overload one of both of these two methods
// to provide capabilities
// Subclasses should overload one or both of these methods to provide
// capabilities.
size_t
MediaEngineCameraVideoSource::NumCapabilities() const
{
@@ -324,21 +324,6 @@ MediaEngineCameraVideoSource::SetName(nsString aName)
bool hasFacingMode = false;
VideoFacingModeEnum facingMode = VideoFacingModeEnum::User;
// Set facing mode based on device name.
#if defined(ANDROID)
// Names are generated. Example: "Camera 0, Facing back, Orientation 90"
//
// See media/webrtc/trunk/webrtc/modules/video_capture/android/java/src/org/
// webrtc/videoengine/VideoCaptureDeviceInfoAndroid.java
if (aName.Find(NS_LITERAL_STRING("Facing back")) != kNotFound) {
hasFacingMode = true;
facingMode = VideoFacingModeEnum::Environment;
} else if (aName.Find(NS_LITERAL_STRING("Facing front")) != kNotFound) {
hasFacingMode = true;
facingMode = VideoFacingModeEnum::User;
}
#endif // ANDROID
#ifdef XP_MACOSX
// Kludge to test user-facing cameras on OSX.
if (aName.Find(NS_LITERAL_STRING("Face")) != -1) {
@@ -108,7 +108,7 @@ protected:
nsTArray<PrincipalHandle> mPrincipalHandles; // Directly mapped to mSources.
RefPtr<layers::Image> mImage;
RefPtr<layers::ImageContainer> mImageContainer;
int mWidth, mHeight; // protected with mMonitor on Gonk due to different threading
int mWidth, mHeight; // protected with mMonitor
// end of data protected by mMonitor
+1 -1
View File
@@ -15,7 +15,7 @@
#ifdef FF
#undef FF
#endif
#include "webrtc/modules/audio_device/opensl/single_rw_fifo.h"
#include "SingleRwFifo.h"
#define CHANNELS 1
#define ENCODING "L16"
+99
View File
@@ -0,0 +1,99 @@
/*
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "SingleRwFifo.h"
#include <assert.h>
#if defined(_MSC_VER)
#include <windows.h>
#endif
static int
UpdatePos(int pos, int capacity)
{
return (pos + 1) % capacity;
}
namespace webrtc {
namespace subtle {
#if defined(_MSC_VER)
inline void
MemoryBarrier()
{
::MemoryBarrier();
}
#elif defined(__GNUC__) || defined(__clang__)
inline void
MemoryBarrier()
{
__sync_synchronize();
}
#else
#error Add an implementation of MemoryBarrier() for this platform!
#endif
} // namespace subtle
SingleRwFifo::SingleRwFifo(int capacity)
: capacity_(capacity)
, size_(0)
, read_pos_(0)
, write_pos_(0)
{
queue_.reset(new int8_t*[capacity_]);
}
SingleRwFifo::~SingleRwFifo()
{
}
void
SingleRwFifo::Push(int8_t* mem)
{
assert(mem);
// Ensure that there is space for the new data in the FIFO. There is only one
// writer, so the other thread is guaranteed only to decrease the size.
const int free_slots = capacity() - size();
if (free_slots <= 0) {
// Size can be queried outside of Push. The caller is expected to ensure
// that Push will be successful before calling it.
assert(false);
return;
}
queue_[write_pos_] = mem;
// Ensure that |size_| is updated after the stored pointer is visible.
subtle::MemoryBarrier();
++size_;
write_pos_ = UpdatePos(write_pos_, capacity());
}
int8_t*
SingleRwFifo::Pop()
{
int8_t* ret_val = nullptr;
if (size() <= 0) {
// Size can be queried outside of Pop. The caller is expected to ensure
// that Pop will be successful before calling it.
assert(false);
return ret_val;
}
ret_val = queue_[read_pos_];
// Ensure that |size_| is updated after the stored pointer is read.
subtle::MemoryBarrier();
--size_;
read_pos_ = UpdatePos(read_pos_, capacity());
return ret_val;
}
} // namespace webrtc
@@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_SINGLE_RW_FIFO_H_
#define WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_SINGLE_RW_FIFO_H_
#ifndef DOM_MEDIA_WEBRTC_SINGLE_RW_FIFO_H_
#define DOM_MEDIA_WEBRTC_SINGLE_RW_FIFO_H_
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/system_wrappers/interface/atomic32.h"
@@ -17,10 +17,9 @@
namespace webrtc {
// Implements a lock-free FIFO losely based on
// Implements a lock-free FIFO loosely based on
// http://src.chromium.org/viewvc/chrome/trunk/src/media/base/audio_fifo.cc
// Note that this class assumes there is one producer (writer) and one
// consumer (reader) thread.
// This class assumes there is one producer and one consumer thread.
class SingleRwFifo {
public:
explicit SingleRwFifo(int capacity);
@@ -29,8 +28,6 @@ class SingleRwFifo {
void Push(int8_t* mem);
int8_t* Pop();
void Clear();
int size() { return size_.Value(); }
int capacity() const { return capacity_; }
@@ -46,4 +43,4 @@ class SingleRwFifo {
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_SINGLE_RW_FIFO_H_
#endif // DOM_MEDIA_WEBRTC_SINGLE_RW_FIFO_H_
+2 -2
View File
@@ -38,6 +38,7 @@ if CONFIG['MOZ_WEBRTC']:
# MediaEngineWebRTC.cpp needs to be built separately.
SOURCES += [
'MediaEngineWebRTC.cpp',
'SingleRwFifo.cpp',
]
LOCAL_INCLUDES += [
'/dom/base',
@@ -68,8 +69,7 @@ include('/ipc/chromium/chromium-config.mozbuild')
# Suppress some GCC/clang warnings being treated as errors:
# - about attributes on forward declarations for types that are already
# defined, which complains about important MOZ_EXPORT attributes for
# android API types
# defined, which complains about important MOZ_EXPORT attributes.
if CONFIG['GNU_CC'] or CONFIG['CLANG_CL']:
CXXFLAGS += [
'-Wno-error=attributes',
+1 -3
View File
@@ -194,7 +194,7 @@ static void FreeStringArray(uint32_t variants, char ** array)
static bool CanLoadPlugin(char16ptr_t aBinaryPath)
{
#if defined(_M_IX86) || defined(_M_X64) || defined(_M_IA64)
#if defined(_M_IX86) || defined(_M_X64)
bool canLoad = false;
HANDLE file = CreateFileW(aBinaryPath, GENERIC_READ,
@@ -214,8 +214,6 @@ static bool CanLoadPlugin(char16ptr_t aBinaryPath)
canLoad = (arch == IMAGE_FILE_MACHINE_I386);
#elif defined(_M_X64)
canLoad = (arch == IMAGE_FILE_MACHINE_AMD64);
#elif defined(_M_IA64)
canLoad = (arch == IMAGE_FILE_MACHINE_IA64);
#endif
}
}
+37 -14
View File
@@ -55,7 +55,12 @@ using namespace std;
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include <gdk/gdk.h>
#if (GTK_MAJOR_VERSION == 3)
#include <gtk/gtkx.h>
#endif
#ifdef MOZ_ENABLE_NPAPI_GTK2
#include "gtk2xtbin.h"
#endif
#elif defined(OS_WIN)
@@ -208,7 +213,9 @@ PluginInstanceChild::PluginInstanceChild(const NPPluginFuncs* aPluginIface,
memset(&mWsInfo, 0, sizeof(mWsInfo));
#ifdef MOZ_WIDGET_GTK
mWsInfo.display = nullptr;
#ifdef MOZ_ENABLE_NPAPI_GTK2
mXtClient.top_widget = nullptr;
#endif
#else
mWsInfo.display = DefaultXDisplay();
#endif
@@ -620,15 +627,17 @@ PluginInstanceChild::NPN_SetValue(NPPVariable aVar, void* aValue)
NPWindowType newWindowType = windowed ? NPWindowTypeWindow : NPWindowTypeDrawable;
#ifdef MOZ_WIDGET_GTK
if (mWindow.type != newWindowType && mWsInfo.display) {
// plugin type has been changed but we already have a valid display
// so update it for the recent plugin mode
if (mXEmbed || !windowed) {
// Use default GTK display for XEmbed and windowless plugins
mWsInfo.display = DefaultXDisplay();
}
else {
mWsInfo.display = xt_client_get_display();
}
// plugin type has been changed but we already have a valid display
// so update it for the recent plugin mode
#ifdef MOZ_ENABLE_NPAPI_GTK2
if (!mXEmbed && windowed) {
mWsInfo.display = xt_client_get_display();
} else
#endif
{
// Use default GTK display for XEmbed and windowless plugins.
mWsInfo.display = DefaultXDisplay();
}
}
#endif
mWindow.type = newWindowType;
@@ -1214,12 +1223,18 @@ bool PluginInstanceChild::CreateWindow(const NPRemoteWindow& aWindow)
if (mXEmbed) {
mWindow.window = reinterpret_cast<void*>(aWindow.window);
}
#ifdef MOZ_ENABLE_NPAPI_GTK2
else {
Window browserSocket = (Window)(aWindow.window);
xt_client_init(&mXtClient, mWsInfo.visual, mWsInfo.colormap, mWsInfo.depth);
xt_client_create(&mXtClient, browserSocket, mWindow.width, mWindow.height);
mWindow.window = (void *)XtWindow(mXtClient.child_widget);
}
}
#else
else {
mWindow.window = reinterpret_cast<void*>(aWindow.window);
}
#endif
#else
mWindow.window = reinterpret_cast<void*>(aWindow.window);
#endif
@@ -1239,7 +1254,7 @@ void PluginInstanceChild::DeleteWindow()
if (!mWindow.window)
return;
#ifdef MOZ_WIDGET_GTK
#ifdef MOZ_ENABLE_NPAPI_GTK2
if (mXtClient.top_widget) {
xt_client_unrealize(&mXtClient);
xt_client_destroy(&mXtClient);
@@ -1321,7 +1336,7 @@ PluginInstanceChild::AnswerNPP_SetWindow(const NPRemoteWindow& aWindow)
CreateWindow(aWindow);
}
#ifdef MOZ_WIDGET_GTK
#ifdef MOZ_ENABLE_NPAPI_GTK2
if (mXEmbed && gtk_check_version(2,18,7) != nullptr) { // older
if (aWindow.type == NPWindowTypeWindow) {
GdkWindow* socket_window = gdk_window_lookup(static_cast<GdkNativeWindow>(aWindow.window));
@@ -1456,19 +1471,27 @@ PluginInstanceChild::Initialize()
if (mWindow.type == NPWindowTypeWindow) {
AnswerNPP_GetValue_NPPVpluginNeedsXEmbed(&mXEmbed, &rv);
#ifdef MOZ_ENABLE_NPAPI_GTK2
// Set up Xt loop for windowed plugins without XEmbed support
if (!mXEmbed) {
xt_client_xloop_create();
}
#endif
}
// Use default GTK display for XEmbed and windowless plugins
// Use default GTK display for XEmbed and windowless plugins.
if (mXEmbed || mWindow.type != NPWindowTypeWindow) {
mWsInfo.display = DefaultXDisplay();
}
#ifdef MOZ_ENABLE_NPAPI_GTK2
else {
mWsInfo.display = xt_client_get_display();
}
#else
else {
mWsInfo.display = DefaultXDisplay();
}
#endif
#endif
return true;
@@ -4656,7 +4679,7 @@ PluginInstanceChild::Destroy()
mPendingAsyncCalls.Clear();
#ifdef MOZ_WIDGET_GTK
#if defined(MOZ_WIDGET_GTK) && defined(MOZ_ENABLE_NPAPI_GTK2)
if (mWindow.type == NPWindowTypeWindow && !mXEmbed) {
xt_client_xloop_destroy();
}
+3 -1
View File
@@ -36,7 +36,7 @@
#include <map>
#ifdef MOZ_WIDGET_GTK
#if defined(MOZ_WIDGET_GTK) && defined(MOZ_ENABLE_NPAPI_GTK2)
#include "gtk2xtbin.h"
#endif
@@ -462,6 +462,8 @@ private:
NPSetWindowCallbackStruct mWsInfo;
#ifdef MOZ_WIDGET_GTK
bool mXEmbed;
#endif
#ifdef MOZ_ENABLE_NPAPI_GTK2
XtClient mXtClient;
#endif
#elif defined(OS_WIN)
+7
View File
@@ -12,6 +12,9 @@
#ifdef MOZ_WIDGET_GTK
#include <gtk/gtk.h>
#if (GTK_MAJOR_VERSION == 3)
#include <gtk/gtkx.h>
#endif
#endif
#include "nsIFile.h"
@@ -1101,7 +1104,11 @@ _getvalue(NPP aNPP,
return InstCast(aNPP)->NPN_GetValue(aVariable, aValue);
}
else {
#ifdef MOZ_ENABLE_NPAPI_GTK2
*(void **)aValue = xt_client_get_display();
#else
*(void **)aValue = DefaultXDisplay();
#endif
}
return NPERR_NO_ERROR;
}
+5 -3
View File
@@ -143,11 +143,13 @@ LOCAL_INCLUDES += [
DEFINES['FORCE_PR_LOG'] = True
if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gtk3':
CXXFLAGS += CONFIG['TK_CFLAGS']
else:
if (CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3' and
CONFIG['MOZ_ENABLE_NPAPI'] and
CONFIG['MOZ_ENABLE_NPAPI_GTK2']):
# Force build against gtk+2 for struct offsets and such.
CXXFLAGS += CONFIG['MOZ_GTK2_CFLAGS']
else:
CXXFLAGS += CONFIG['TK_CFLAGS']
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
+2
View File
@@ -25,6 +25,8 @@ interface CSSStyleSheet : StyleSheet {
unsigned long insertRule(DOMString rule, optional unsigned long index = 0);
[Throws, NeedsSubjectPrincipal]
void deleteRule(unsigned long index);
[Throws]
void replaceSync(DOMString text);
// Non-standard WebKit things, see https://github.com/w3c/csswg-drafts/pull/3900.
[Throws, NeedsSubjectPrincipal, BinaryName="cssRules"]
+2
View File
@@ -18,6 +18,8 @@ interface mixin DocumentOrShadowRoot {
readonly attribute Element? activeElement;
readonly attribute StyleSheetList styleSheets;
[Throws]
attribute object adoptedStyleSheets;
readonly attribute Element? pointerLockElement;
[LenientSetter, Func="nsDocument::IsUnprefixedFullscreenEnabled"]
+1
View File
@@ -301,6 +301,7 @@ LoadContextOptions(const char* aPrefName, void* /* aClosure */)
.setAsyncStack(GetWorkerPref<bool>(NS_LITERAL_CSTRING("asyncstack")))
.setWerror(GetWorkerPref<bool>(NS_LITERAL_CSTRING("werror")))
.setStreams(GetWorkerPref<bool>(NS_LITERAL_CSTRING("streams")))
.setWeakRefs(GetWorkerPref<bool>(NS_LITERAL_CSTRING("weakrefs")))
.setExtraWarnings(GetWorkerPref<bool>(NS_LITERAL_CSTRING("strict")))
.setArrayProtoValues(GetWorkerPref<bool>(
NS_LITERAL_CSTRING("array_prototype_values")));
+1
View File
@@ -35,6 +35,7 @@ WORKER_SIMPLE_PREF("dom.serviceWorkers.openWindow.enabled", OpenWindowEnabled, O
WORKER_SIMPLE_PREF("dom.storageManager.enabled", StorageManagerEnabled, STORAGEMANAGER_ENABLED)
WORKER_SIMPLE_PREF("dom.push.enabled", PushEnabled, PUSH_ENABLED)
WORKER_SIMPLE_PREF("dom.streams.enabled", StreamsEnabled, STREAMS_ENABLED)
WORKER_SIMPLE_PREF("javascript.options.weakrefs", WeakRefsEnabled, WEAKREFS_ENABLED)
WORKER_SIMPLE_PREF("dom.requestcontext.enabled", RequestContextEnabled, REQUESTCONTEXT_ENABLED)
WORKER_SIMPLE_PREF("gfx.offscreencanvas.enabled", OffscreenCanvasEnabled, OFFSCREENCANVAS_ENABLED)
WORKER_SIMPLE_PREF("dom.webkitBlink.dirPicker.enabled", WebkitBlinkDirectoryPickerEnabled, DOM_WEBKITBLINK_DIRPICKER_WEBKITBLINK)
+14 -2
View File
@@ -295,11 +295,11 @@ nsXMLContentSink::DidBuildModel(bool aTerminated)
}
mXSLTProcessor->SetSourceContentModel(mDocument, mDocumentChildren);
mDocumentChildren.Clear();
// Since the processor now holds a reference to us we drop our reference
// to it to avoid owning cycles
mXSLTProcessor = nullptr;
}
else {
} else {
// Kick off layout for non-XSLT transformed documents.
// Check if we want to prettyprint
@@ -881,6 +881,12 @@ nsXMLContentSink::SetDocElement(int32_t aNameSpaceID,
if (!mDocumentChildren.IsEmpty()) {
for (nsIContent* child : mDocumentChildren) {
if (MOZ_UNLIKELY(child->GetParentNode())) {
child->Remove();
if (MOZ_UNLIKELY(child->GetParentNode())) {
return false;
}
}
mDocument->AppendChildTo(child, false);
}
mDocumentChildren.Clear();
@@ -991,6 +997,12 @@ nsXMLContentSink::HandleStartElement(const char16_t *aName,
if (!SetDocElement(nameSpaceID, localName, content) && appendContent) {
NS_ENSURE_TRUE(parent, NS_ERROR_UNEXPECTED);
if (MOZ_UNLIKELY(content->GetParentNode())) {
content->Remove();
if (MOZ_UNLIKELY(content->GetParentNode())) {
return NS_ERROR_UNEXPECTED;
}
}
parent->AppendChildTo(content, false);
}
}
+1 -1
View File
@@ -5159,7 +5159,7 @@ HTMLEditor::IsAcceptableInputEvent(WidgetGUIEvent* aGUIEvent)
// If the event is a mouse event, we need to check if the target content is
// the focused editing host or its descendant.
if (aGUIEvent->AsMouseEventBase()) {
nsIContent* editingHost = GetActiveEditingHost();
RefPtr<nsIContent> editingHost = GetActiveEditingHost();
// If there is no active editing host, we cannot handle the mouse event
// correctly.
if (!editingHost) {
+5 -2
View File
@@ -1082,6 +1082,9 @@ ChromeTooltipListener::ChromeTooltipListener(nsWebBrowser* aInBrowser,
ChromeTooltipListener::~ChromeTooltipListener()
{
if (mTooltipTimer) {
mTooltipTimer->Cancel();
}
}
// Hook up things to the chrome like context menus and tooltips, if the chrome
@@ -1329,7 +1332,7 @@ void
ChromeTooltipListener::sTooltipCallback(nsITimer* aTimer,
void* aChromeTooltipListener)
{
auto self = static_cast<ChromeTooltipListener*>(aChromeTooltipListener);
RefPtr<ChromeTooltipListener> self = static_cast<ChromeTooltipListener*>(aChromeTooltipListener);
if (self && self->mPossibleTooltipNode) {
// The actual coordinates we want to put the tooltip at are relative to the
// toplevel docshell of our mWebBrowser. We know what the screen
@@ -1374,7 +1377,7 @@ ChromeTooltipListener::sTooltipCallback(nsITimer* aTimer,
self->mPossibleTooltipNode, getter_Copies(tooltipText),
getter_Copies(directionText), &textFound);
if (textFound) {
if (self->mPossibleTooltipNode && textFound) {
nsString tipText(tooltipText);
nsString dirText(directionText);
LayoutDeviceIntPoint screenDot = widget->WidgetToScreenOffset();
+10
View File
@@ -1117,6 +1117,7 @@ DrawTargetSkia::BorrowCGContext(const DrawOptions &aOptions)
kCGImageAlphaOnly :
kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host;
#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
mCG = CGBitmapContextCreateWithData(mCanvasData,
mCGSize.width,
mCGSize.height,
@@ -1126,6 +1127,15 @@ DrawTargetSkia::BorrowCGContext(const DrawOptions &aOptions)
bitmapInfo,
NULL, /* Callback when released */
NULL);
#else
mCG = CGBitmapContextCreate(mCanvasData,
mCGSize.width,
mCGSize.height,
8, /* bits per component */
stride,
mColorSpace,
bitmapInfo);
#endif
if (!mCG) {
ReleaseBits(mCanvasData);
NS_WARNING("Could not create bitmap around skia data\n");
+15 -6
View File
@@ -1554,8 +1554,7 @@ FilterNodeTileSoftware::SetAttribute(uint32_t aIndex,
const IntRect &aSourceRect)
{
MOZ_ASSERT(aIndex == ATT_TILE_SOURCE_RECT);
mSourceRect = IntRect(int32_t(aSourceRect.x), int32_t(aSourceRect.y),
int32_t(aSourceRect.width), int32_t(aSourceRect.height));
mSourceRect = aSourceRect;
Invalidate();
}
@@ -1595,14 +1594,24 @@ FilterNodeTileSoftware::Render(const IntRect& aRect)
typedef std::map<IntRect, RefPtr<DataSourceSurface>, CompareIntRects> InputMap;
InputMap inputs;
auto IntRectToInt64Rect = [](const IntRect& aRect) {
return RectTyped<UnknownUnits, int64_t>(aRect.X(), aRect.Y(), aRect.Width(),
aRect.Height());
};
IntPoint startIndex = TileIndex(mSourceRect, aRect.TopLeft());
IntPoint endIndex = TileIndex(mSourceRect, aRect.BottomRight());
for (int32_t ix = startIndex.x; ix <= endIndex.x; ix++) {
for (int32_t iy = startIndex.y; iy <= endIndex.y; iy++) {
IntPoint sourceToDestOffset(ix * mSourceRect.width,
iy * mSourceRect.height);
IntRect destRect = aRect.Intersect(mSourceRect + sourceToDestOffset);
IntRect srcRect = destRect - sourceToDestOffset;
auto sourceToDestOffset = PointTyped<UnknownUnits, int64_t>(
ix * mSourceRect.Width(), iy * mSourceRect.Height());
auto destRect64 = IntRectToInt64Rect(aRect).Intersect(
IntRectToInt64Rect(mSourceRect) + sourceToDestOffset);
auto srcRect64 = destRect64 - sourceToDestOffset;
IntRect destRect, srcRect;
if (!destRect64.ToIntRect(&destRect) || !srcRect64.ToIntRect(&srcRect)) {
return nullptr;
}
if (srcRect.IsEmpty()) {
continue;
}
+1 -1
View File
@@ -115,7 +115,7 @@ ScaledFontMac::GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aT
return ScaledFontBase::GetPathForGlyphs(aBuffer, aTarget);
}
#if !defined(MAC_OS_X_VERSION_10_7) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7)
#ifndef USE_SKIA
void
ScaledFontMac::CopyGlyphsToBuilder(const GlyphBuffer &aBuffer, PathBuilder *aBuilder, const Matrix *aTransformHint)
{
+1 -1
View File
@@ -32,7 +32,7 @@ public:
virtual SkTypeface* GetSkTypeface();
#endif
virtual already_AddRefed<Path> GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aTarget);
#if !defined(MAC_OS_X_VERSION_10_7) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7)
#ifndef USE_SKIA
virtual void CopyGlyphsToBuilder(const GlyphBuffer &aBuffer, PathBuilder *aBuilder, const Matrix *aTransformHint);
#endif
virtual bool GetFontFileData(FontFileDataOutput aDataCallback, void *aBaton);
@@ -358,7 +358,8 @@ gl::Error Image9::setManagedSurface(IDirect3DSurface9 *surface)
surface->GetDesc(&desc);
ASSERT(desc.Pool == D3DPOOL_MANAGED);
if ((GLsizei)desc.Width == mWidth && (GLsizei)desc.Height == mHeight)
if ((GLsizei)desc.Width == mWidth && (GLsizei)desc.Height == mHeight &&
desc.Format == mD3DFormat)
{
if (mSurface)
{
File diff suppressed because it is too large. Load diff
+7 -3
View File
@@ -632,9 +632,13 @@ NVImage::GetAsSourceSurface()
// Convert the current NV12 or NV21 data to YUV420P so that we can follow the
// logics in PlanarYCbCrImage::GetAsSourceSurface().
const int bufferLength = mData.mYSize.height * mData.mYStride +
mData.mCbCrSize.height * mData.mCbCrSize.width * 2;
uint8_t* buffer = new uint8_t[bufferLength];
auto bufferLength = CheckedInt<uint32_t>(mData.mYSize.height) * mData.mYStride +
CheckedInt<uint32_t>(mData.mCbCrSize.height) * mData.mCbCrSize.width * 2;
if (!bufferLength.isValid()) {
NS_ERROR("Image buffer length exceeds integer limits.");
return nullptr;
}
uint8_t* buffer = new uint8_t[bufferLength.value()];
Data aData = mData;
aData.mCbCrStride = aData.mCbCrSize.width;
+58 -15
View File
@@ -24,15 +24,21 @@
* Skia's 32bit backend only supports 1 sizzle order at a time (compile-time).
* This is specified by 4 defines SK_A32_SHIFT, SK_R32_SHIFT, ... for G and B.
*
* For easier compatibility with Skia's GPU backend, we further restrict these
* to either (in memory-byte-order) RGBA or BGRA. Note that this "order" does
* not directly correspond to the same shift-order, since we have to take endianess
* into account.
* For easier compatibility with Skia's GPU backend, Skia normally restricts
* these to either (in memory-byte-order) RGBA or BGRA. Mozilla's big-endian
* PowerPC port uses CoreGraphics' native ARGB pixels, so we also accept ARGB.
* Note that this "order" does not directly correspond to the same shift-order,
* since we have to take endianess into account.
*
* Here we enforce this constraint.
*/
#ifdef SK_CPU_BENDIAN
#define SK_ARGB_A32_SHIFT 24
#define SK_ARGB_R32_SHIFT 16
#define SK_ARGB_G32_SHIFT 8
#define SK_ARGB_B32_SHIFT 0
#define SK_RGBA_R32_SHIFT 24
#define SK_RGBA_G32_SHIFT 16
#define SK_RGBA_B32_SHIFT 8
@@ -43,6 +49,11 @@
#define SK_BGRA_R32_SHIFT 8
#define SK_BGRA_A32_SHIFT 0
#else
#define SK_ARGB_A32_SHIFT 0
#define SK_ARGB_R32_SHIFT 8
#define SK_ARGB_G32_SHIFT 16
#define SK_ARGB_B32_SHIFT 24
#define SK_RGBA_R32_SHIFT 0
#define SK_RGBA_G32_SHIFT 8
#define SK_RGBA_B32_SHIFT 16
@@ -54,10 +65,18 @@
#define SK_BGRA_A32_SHIFT 24
#endif
#if defined(SK_PMCOLOR_IS_RGBA) && defined(SK_PMCOLOR_IS_BGRA)
#error "can't define PMCOLOR to be RGBA and BGRA"
#if (defined(SK_PMCOLOR_IS_RGBA) && defined(SK_PMCOLOR_IS_BGRA)) || \
(defined(SK_PMCOLOR_IS_RGBA) && defined(SK_PMCOLOR_IS_ARGB)) || \
(defined(SK_PMCOLOR_IS_BGRA) && defined(SK_PMCOLOR_IS_ARGB))
#error "can't define PMCOLOR to more than one byte order"
#endif
#define LOCAL_PMCOLOR_SHIFTS_EQUIVALENT_TO_ARGB \
(SK_A32_SHIFT == SK_ARGB_A32_SHIFT && \
SK_R32_SHIFT == SK_ARGB_R32_SHIFT && \
SK_G32_SHIFT == SK_ARGB_G32_SHIFT && \
SK_B32_SHIFT == SK_ARGB_B32_SHIFT)
#define LOCAL_PMCOLOR_SHIFTS_EQUIVALENT_TO_RGBA \
(SK_A32_SHIFT == SK_RGBA_A32_SHIFT && \
SK_R32_SHIFT == SK_RGBA_R32_SHIFT && \
@@ -76,6 +95,10 @@
#define SK_G_INDEX (SK_G32_SHIFT/8)
#define SK_B_INDEX (SK_B32_SHIFT/8)
#if defined(SK_PMCOLOR_IS_ARGB) && !LOCAL_PMCOLOR_SHIFTS_EQUIVALENT_TO_ARGB
#error "SK_PMCOLOR_IS_ARGB does not match SK_*32_SHIFT values"
#endif
#if defined(SK_PMCOLOR_IS_RGBA) && !LOCAL_PMCOLOR_SHIFTS_EQUIVALENT_TO_RGBA
#error "SK_PMCOLOR_IS_RGBA does not match SK_*32_SHIFT values"
#endif
@@ -84,19 +107,22 @@
#error "SK_PMCOLOR_IS_BGRA does not match SK_*32_SHIFT values"
#endif
#if !defined(SK_PMCOLOR_IS_RGBA) && !defined(SK_PMCOLOR_IS_BGRA)
#if !defined(SK_PMCOLOR_IS_ARGB) && !defined(SK_PMCOLOR_IS_RGBA) && !defined(SK_PMCOLOR_IS_BGRA)
// deduce which to define from the _SHIFT defines
#if LOCAL_PMCOLOR_SHIFTS_EQUIVALENT_TO_RGBA
#if LOCAL_PMCOLOR_SHIFTS_EQUIVALENT_TO_ARGB
#define SK_PMCOLOR_IS_ARGB
#elif LOCAL_PMCOLOR_SHIFTS_EQUIVALENT_TO_RGBA
#define SK_PMCOLOR_IS_RGBA
#elif LOCAL_PMCOLOR_SHIFTS_EQUIVALENT_TO_BGRA
#define SK_PMCOLOR_IS_BGRA
#else
#error "need 32bit packing to be either RGBA or BGRA"
#error "need 32bit packing to be either ARGB, RGBA, or BGRA"
#endif
#endif
// hide these now that we're done
#undef LOCAL_PMCOLOR_SHIFTS_EQUIVALENT_TO_ARGB
#undef LOCAL_PMCOLOR_SHIFTS_EQUIVALENT_TO_RGBA
#undef LOCAL_PMCOLOR_SHIFTS_EQUIVALENT_TO_BGRA
@@ -131,19 +157,38 @@ static inline uint32_t SkPackARGB_as_BGRA(U8CPU a, U8CPU r, U8CPU g, U8CPU b) {
(g << SK_BGRA_G32_SHIFT) | (b << SK_BGRA_B32_SHIFT);
}
static inline SkPMColor SkPackARGB_as_PMColor(U8CPU a, U8CPU r, U8CPU g, U8CPU b) {
SkASSERT_IS_BYTE(a);
SkASSERT_IS_BYTE(r);
SkASSERT_IS_BYTE(g);
SkASSERT_IS_BYTE(b);
return (a << SK_A32_SHIFT) | (r << SK_R32_SHIFT) |
(g << SK_G32_SHIFT) | (b << SK_B32_SHIFT);
}
static inline SkPMColor SkSwizzle_RGBA_to_PMColor(uint32_t c) {
#ifdef SK_PMCOLOR_IS_RGBA
return c;
#else
#elif defined(SK_PMCOLOR_IS_BGRA)
return SkSwizzle_RB(c);
#else
return SkPackARGB_as_PMColor((c >> SK_RGBA_A32_SHIFT) & 0xFF,
(c >> SK_RGBA_R32_SHIFT) & 0xFF,
(c >> SK_RGBA_G32_SHIFT) & 0xFF,
(c >> SK_RGBA_B32_SHIFT) & 0xFF);
#endif
}
static inline SkPMColor SkSwizzle_BGRA_to_PMColor(uint32_t c) {
#ifdef SK_PMCOLOR_IS_BGRA
return c;
#else
#elif defined(SK_PMCOLOR_IS_RGBA)
return SkSwizzle_RB(c);
#else
return SkPackARGB_as_PMColor((c >> SK_BGRA_A32_SHIFT) & 0xFF,
(c >> SK_BGRA_R32_SHIFT) & 0xFF,
(c >> SK_BGRA_G32_SHIFT) & 0xFF,
(c >> SK_BGRA_B32_SHIFT) & 0xFF);
#endif
}
@@ -412,8 +457,7 @@ static inline SkPMColor SkPackARGB32(U8CPU a, U8CPU r, U8CPU g, U8CPU b) {
SkASSERT(g <= a);
SkASSERT(b <= a);
return (a << SK_A32_SHIFT) | (r << SK_R32_SHIFT) |
(g << SK_G32_SHIFT) | (b << SK_B32_SHIFT);
return SkPackARGB_as_PMColor(a, r, g, b);
}
static inline uint32_t SkPackPMColor_as_RGBA(SkPMColor c) {
@@ -547,8 +591,7 @@ static inline SkPMColor SkFastFourByteInterp(SkPMColor src,
* values are premultiplied in the debug version.
*/
static inline SkPMColor SkPackARGB32NoCheck(U8CPU a, U8CPU r, U8CPU g, U8CPU b) {
return (a << SK_A32_SHIFT) | (r << SK_R32_SHIFT) |
(g << SK_G32_SHIFT) | (b << SK_B32_SHIFT);
return SkPackARGB_as_PMColor(a, r, g, b);
}
static inline
+6 -1
View File
@@ -82,8 +82,13 @@ enum SkColorType {
kN32_SkColorType = kBGRA_8888_SkColorType,
#elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
kN32_SkColorType = kRGBA_8888_SkColorType,
#elif defined(MOZ_SKIA) && SK_PMCOLOR_BYTE_ORDER(A,R,G,B)
// Big-endian PowerPC Mozilla surfaces use native uint32 ARGB memory.
// Moz2D's legacy A8R8G8B8_UINT32 format aliases to B8G8R8A8, so keep
// kN32 on Skia's BGRA path while the channel shifts above describe ARGB.
kN32_SkColorType = kBGRA_8888_SkColorType,
#else
#error "SK_*32_SHFIT values must correspond to BGRA or RGBA byte order"
#error "SK_*32_SHIFT values must correspond to BGRA, RGBA, or Mozilla ARGB byte order"
#endif
};
+6 -4
View File
@@ -275,17 +275,19 @@ enum GrPixelConfig {
static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1;
// Aliases for pixel configs that match skia's byte order.
#ifndef SK_CPU_LENDIAN
#error "Skia gpu currently assumes little endian"
#endif
#if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfig;
static const GrPixelConfig kSkiaGamma8888_GrPixelConfig = kSBGRA_8888_GrPixelConfig;
#elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
static const GrPixelConfig kSkia8888_GrPixelConfig = kRGBA_8888_GrPixelConfig;
static const GrPixelConfig kSkiaGamma8888_GrPixelConfig = kSRGBA_8888_GrPixelConfig;
#elif defined(MOZ_SKIA) && SK_PMCOLOR_BYTE_ORDER(A,R,G,B)
// Mozilla's big-endian PowerPC path stores native 32-bit pixels as ARGB,
// while Moz2D routes those surfaces through Skia's BGRA color type.
static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfig;
static const GrPixelConfig kSkiaGamma8888_GrPixelConfig = kSBGRA_8888_GrPixelConfig;
#else
#error "SK_*32_SHIFT values must correspond to GL_BGRA or GL_RGBA format."
#error "SK_*32_SHIFT values must correspond to GL_BGRA, GL_RGBA, or Mozilla ARGB format."
#endif
// Returns true if the pixel config is a GPU-specific compressed format
+4
View File
@@ -306,7 +306,11 @@ static inline SkPMColor premultiply_argb_as_bgra(U8CPU a, U8CPU r, U8CPU g, U8CP
b = SkMulDiv255Round(b, a);
}
#ifdef SK_PMCOLOR_IS_ARGB
return SkPackARGB_as_PMColor(a, r, g, b);
#else
return SkPackARGB_as_BGRA(a, r, g, b);
#endif
}
static inline bool is_rgba(SkColorType colorType) {
@@ -40,7 +40,7 @@ static void SK_BLITBWMASK_NAME(const SkPixmap& dst, const SkMask& srcMask,
const uint8_t* bits = srcMask.getAddr1(cx, cy);
SK_BLITBWMASK_DEVTYPE* device = dst.SK_BLITBWMASK_GETADDR(cx, cy);
if (cx == maskLeft && clip.fRight == srcMask.fBounds.fRight)
if (cx == maskLeft && clip.fRight == srcMask.fBounds.fRight && (clip.width() & 7) == 0)
{
do {
SK_BLITBWMASK_DEVTYPE* dst = device;
+6
View File
@@ -51,10 +51,16 @@ struct SkPM4f {
Sk4f to4f_pmorder() const { return swizzle_rb_if_bgra(this->to4f()); }
SkPMColor toPMColor() const {
#ifdef SK_PMCOLOR_IS_ARGB
Sk4f value = this->to4f();
Sk4b bytes = SkNx_cast<uint8_t>(value * Sk4f(255) + Sk4f(0.5f));
return SkPackARGB_as_PMColor(bytes[3], bytes[0], bytes[1], bytes[2]);
#else
Sk4f value = swizzle_rb_if_bgra(this->to4f());
SkPMColor result;
SkNx_cast<uint8_t>(value * Sk4f(255) + Sk4f(0.5f)).store(&result);
return result;
#endif
}
void toF16(uint16_t[4]) const;
+21
View File
@@ -22,29 +22,50 @@ static inline float get_alpha(const Sk4f& px) {
static inline Sk4f Sk4f_fromL32(uint32_t px) {
#ifdef SK_PMCOLOR_IS_ARGB
return Sk4f(SkGetPackedR32(px), SkGetPackedG32(px),
SkGetPackedB32(px), SkGetPackedA32(px)) * (1/255.0f);
#else
return SkNx_cast<float>(Sk4b::Load(&px)) * (1/255.0f);
#endif
}
static inline Sk4f Sk4f_fromS32(uint32_t px) {
#ifdef SK_PMCOLOR_IS_ARGB
return { sk_linear_from_srgb[SkGetPackedR32(px)],
sk_linear_from_srgb[SkGetPackedG32(px)],
sk_linear_from_srgb[SkGetPackedB32(px)],
(1/255.0f) * SkGetPackedA32(px) };
#else
return { sk_linear_from_srgb[(px >> 0) & 0xff],
sk_linear_from_srgb[(px >> 8) & 0xff],
sk_linear_from_srgb[(px >> 16) & 0xff],
(1/255.0f) * (px >> 24) };
#endif
}
static inline uint32_t Sk4f_toL32(const Sk4f& px) {
#ifdef SK_PMCOLOR_IS_ARGB
Sk4b bytes = SkNx_cast<uint8_t>(Sk4f_round(px * 255.0f));
return SkPackARGB_as_PMColor(bytes[3], bytes[0], bytes[1], bytes[2]);
#else
uint32_t l32;
SkNx_cast<uint8_t>(Sk4f_round(px * 255.0f)).store(&l32);
return l32;
#endif
}
static inline uint32_t Sk4f_toS32(const Sk4f& px) {
Sk4i rgb = sk_linear_to_srgb(px),
srgb = { rgb[0], rgb[1], rgb[2], (int)(255.0f * px[3] + 0.5f) };
#ifdef SK_PMCOLOR_IS_ARGB
return SkPackARGB_as_PMColor(srgb[3], srgb[0], srgb[1], srgb[2]);
#else
uint32_t s32;
SkNx_cast<uint8_t>(srgb).store(&s32);
return s32;
#endif
}
+3 -2
View File
@@ -121,9 +121,10 @@ SkDEBUGCODE(static const unsigned kRunRecordMagic = 0xb10bcafe;)
namespace {
struct RunRecordStorageEquivalent {
RunFont fFont;
SkPoint fOffset;
uint32_t fCount;
uint32_t fFlags;
SkPoint fOffset;
SkTextBlob::GlyphPositioning fPositioning;
bool fExtended;
SkDEBUGCODE(unsigned fMagic;)
};
}
+33 -1
View File
@@ -44,6 +44,25 @@ static Sk4x4f load_4_srgb(const void* vptr) {
Sk4x4f rgba;
#ifdef SK_PMCOLOR_IS_ARGB
rgba.r = { sk_linear_from_srgb[SkGetPackedR32(ptr[0])],
sk_linear_from_srgb[SkGetPackedR32(ptr[1])],
sk_linear_from_srgb[SkGetPackedR32(ptr[2])],
sk_linear_from_srgb[SkGetPackedR32(ptr[3])] };
rgba.g = { sk_linear_from_srgb[SkGetPackedG32(ptr[0])],
sk_linear_from_srgb[SkGetPackedG32(ptr[1])],
sk_linear_from_srgb[SkGetPackedG32(ptr[2])],
sk_linear_from_srgb[SkGetPackedG32(ptr[3])] };
rgba.b = { sk_linear_from_srgb[SkGetPackedB32(ptr[0])],
sk_linear_from_srgb[SkGetPackedB32(ptr[1])],
sk_linear_from_srgb[SkGetPackedB32(ptr[2])],
sk_linear_from_srgb[SkGetPackedB32(ptr[3])] };
rgba.a = SkNx_cast<float>(Sk4i(SkGetPackedA32(ptr[0]), SkGetPackedA32(ptr[1]),
SkGetPackedA32(ptr[2]), SkGetPackedA32(ptr[3]))) * (1/255.0f);
#else
rgba.r = { sk_linear_from_srgb[(ptr[0] >> 0) & 0xff],
sk_linear_from_srgb[(ptr[1] >> 0) & 0xff],
sk_linear_from_srgb[(ptr[2] >> 0) & 0xff],
@@ -60,15 +79,28 @@ static Sk4x4f load_4_srgb(const void* vptr) {
sk_linear_from_srgb[(ptr[3] >> 16) & 0xff] };
rgba.a = SkNx_cast<float>((Sk4i::Load(ptr) >> 24) & 0xff) * (1/255.0f);
#endif
return rgba;
}
static void store_4_srgb(void* ptr, const Sk4x4f& p) {
#ifdef SK_PMCOLOR_IS_ARGB
uint32_t* dst = (uint32_t*)ptr;
Sk4i r = sk_linear_to_srgb(p.r);
Sk4i g = sk_linear_to_srgb(p.g);
Sk4i b = sk_linear_to_srgb(p.b);
Sk4i a = Sk4f_round(255.0f*p.a);
dst[0] = SkPackARGB_as_PMColor(a[0], r[0], g[0], b[0]);
dst[1] = SkPackARGB_as_PMColor(a[1], r[1], g[1], b[1]);
dst[2] = SkPackARGB_as_PMColor(a[2], r[2], g[2], b[2]);
dst[3] = SkPackARGB_as_PMColor(a[3], r[3], g[3], b[3]);
#else
( sk_linear_to_srgb(p.r) << 0
| sk_linear_to_srgb(p.g) << 8
| sk_linear_to_srgb(p.b) << 16
| Sk4f_round(255.0f*p.a) << 24).store(ptr);
#endif
}
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -391,7 +423,7 @@ SkXfermode::D32Proc SkXfermode::GetD32Proc(SkXfermode* xfer, uint32_t flags) {
#include "SkColorPriv.h"
static Sk4f lcd16_to_unit_4f(uint16_t rgb) {
#ifdef SK_PMCOLOR_IS_RGBA
#if defined(SK_PMCOLOR_IS_RGBA) || defined(SK_PMCOLOR_IS_ARGB)
Sk4i rgbi = Sk4i(SkGetPackedR16(rgb), SkGetPackedG16(rgb), SkGetPackedB16(rgb), 0);
#else
Sk4i rgbi = Sk4i(SkGetPackedB16(rgb), SkGetPackedG16(rgb), SkGetPackedR16(rgb), 0);
+1 -1
View File
@@ -251,7 +251,7 @@ bool GrDrawTarget::drawBatches(GrBatchFlushState* flushState) {
if (currentRT) {
static const GrGpuCommandBuffer::LoadAndStoreInfo kBasicLoadStoreInfo
{ GrGpuCommandBuffer::LoadOp::kLoad,GrGpuCommandBuffer::StoreOp::kStore,
GrColor_ILLEGAL };
static_cast<GrColor>(GrColor_ILLEGAL) };
commandBuffer.reset(fGpu->createCommandBuffer(currentRT,
kBasicLoadStoreInfo, // Color
kBasicLoadStoreInfo)); // Stencil
Loaded 100 of 916 files, more files were not shown because too many files have changed in this diff. Show more