Compare commits

..
Author SHA1 Message Date
Moonchild e71937e76a Bug 1719872 - Align dialog submission triggered by form.submit() with the spec.
Submission in click handler of submit button should not be deferred
per https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#submit-dialog
2024-06-15 16:21:54 +02:00
Moonchild 4a44bfe8fa Prevent unwanted text selection when backdrop is clicked. 2024-06-15 13:37:07 +02:00
Moonchild adb58c5761 Bug 1649278 - Don't do PreventDefault for escape key if <select> dropdown is not shown
We always use PreventDefault for <select> element, which is problematic if modal
dialog is on as it prevents cancelling the dialog. We fix it by not blocking the
default action if <select> is not shown.
2024-06-15 12:33:06 +02:00
Moonchild 8f7e7bfbdc Bug 1652699 - Fix a null pointer crash while doing dialog form submission 2024-06-15 12:29:50 +02:00
Moonchild 96ad821193 Default pref check to true 2024-06-15 11:42:00 +02:00
Moonchild 0742779ec4 Port 1557303 2024-06-15 10:11:00 +02:00
Daniel Holbert e6199f8a32 [layout] Initialize PerSpanData members mBaseline and mReflowInput.
We null-initialize all of the other pointer members in NewPerSpanData; we should
do the same for these ones, for consistency & robustness.

(In practice, the callers end up initializing these members before reading them
anyway, so it's been benign that we weren't initializing them. But better for
safety & futureproofing to have them reliably initialized.)
2024-06-12 22:31:23 +02:00
Moonchild ae87e5c8ca [uri] Implement additional filename checks. 2024-06-12 21:34:12 +02:00
Moonchild 130720d927 [js gc] Suppress GC during JSObject::swap
We already suppressed GC for part of this, but we may sweep before the pre-write
barrier is established.
The simplest and safest thing is to suppress GC for the whole method.
2024-06-12 20:04:44 +02:00
Moonchild 0f0d36de2d [toolkit] Close autocomplete popup when window is resized. 2024-06-12 19:42:16 +02:00
Moonchild 2879b5abf6 [DOM] Clone video info properly. 2024-06-12 12:58:55 +02:00
Moonchild 84a29728aa [uri] Fix issues with external protocol handlers.
Remove early return in nsExternalProtocolHandler::NewChannel when handler doesn't exist.
Fix devtools expectation that newChannel throws for unsupported external handlers
2024-06-12 00:42:33 +02:00
Moonchild 38e63a2457 [network] Avoid accessing raw pointers in nsTransportEventSinkProxy. 2024-06-11 19:01:24 +02:00
Moonchild 809bb089c1 [network] Perform a case-insensitive match on special cookie prefixes. 2024-06-11 18:10:22 +02:00
Moonchild 7cc6e4f072 Merge pull request 'Implement small, large, dynamic, and logical viewport units' (#2525) from FranklinDM/UXP-contrib:work_css-viewport-units-sld-logical into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2525
2024-06-09 13:29:50 +00:00
FranklinDM 9605315718 Issue #2522 - Part 2: Implement support for logical viewport units 2024-06-09 19:53:56 +08:00
FranklinDM c2362f7f61 Issue #2522 - Part 1: Alias small, large, and dynamic viewport units to base viewport 2024-06-09 19:53:56 +08:00
Moonchild 6e2a713c37 Issue #2524 - Implement smart granularity for canvas poisoning.
User-configurable time interval between 1s and 8h. Default 5 minutes.
Resolves #2524
2024-06-07 16:25:36 +02:00
Moonchild c617548958 Merge pull request 'Remove DBM configuration and platform considerations.' (#2521) from 2516 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2521
2024-06-06 08:42:05 +00:00
Moonchild d8acf27de1 Issue #2516 - Part 3: Reconfigure platform to no longer build NSS DBM back-end. 2024-06-03 19:27:37 +02:00
Moonchild de2bd6aa57 Issue #2516 - Part 2: Remove MOZ_SECURITY_SQLSTORE and always use SQLite db back-end. 2024-06-03 18:49:41 +02:00
Moonchild 666b1f2db8 Issue #2516 - Part 1: Remove configure options for NSS db back-end selection. 2024-06-03 17:39:33 +02:00
Moonchild 17e3f40c2e Merge pull request 'Fix crash when reporting export error in modules' (#2520) from martok/UXP-contrib:mr/2519-module-error into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2520
2024-06-03 11:33:50 +00:00
Martok be0dc5dd26 Issue #2519 - Use parser error reporter to report missing module exports 2024-06-02 21:15:57 +02:00
Moonchild 43862ee764 Issue #2518 - Make various arguments optional in XPathEvaluator/XPathExpression.
Resolves #2518
2024-06-01 19:30:47 +02:00
Moonchild fe6af19126 [gfx] Use calloc for cairo font-creation functions. 2024-05-21 15:04:22 +02:00
Moonchild f982245af3 [gfx] Ensure font entry's unitsPerEm and font extents are initialized when gfxFont is created. 2024-05-21 14:10:27 +02:00
Moonchild 1fe46b057e [DOM] Clean up ReportLoadError and normalize error messages. 2024-05-21 13:24:45 +02:00
Moonchild 197e21f6de [gfx] Clear mSharedBlobData if blob creation failed. 2024-05-21 13:19:48 +02:00
Moonchild 58a3105a0e [network] Make http digest auth cnonce length configurable. 2024-05-21 12:30:47 +02:00
Moonchild c1703a6928 Merge pull request 'Emoji Sequence Clusters' (#2514) from RealityRipple/UXP:emoji-nowrap into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2514
2024-05-12 20:40:07 +00:00
Moonchild 786c16fd45 Merge pull request 'Import autoconf 2.13 and fix issues with GCC 14 and Clang 16.' (#2513) from dbsoft/UXP:autoconf2512 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2513
2024-05-11 16:57:34 +00:00
Andy 49b7816286 Don't split up happy emoji sequences
Loosely based on https://phabricator.services.mozilla.com/D25101
Includes changes to `GetEmojiPresentation`, added in e38b57ca.
The `EmojiComponent` response includes hair color, skin tone, ZWJ, VS16, Combining Enclosing Keycap, and the Tag unicode characters used for subdivision flag emojis.
This means that `IsClusterExtender` should support all these characters, and be forward compatible with any future Unicode changes.
This also lets us restructure `ClusterIterator::Next` to check for EmojiComponents after a TextDefault character, without any stupid constants.
2024-05-09 15:44:02 -07:00
Brian Smith 3aec8d2838 Issue #2512 - Part 5 - Fix Python 2.7 issue with unicode environment on Windows. 2024-05-07 22:49:35 -05:00
Brian Smith e4829019cd Issue #2512 - Part 4 - Look for gm4 in addition to m4.
https://bugzilla.mozilla.org/show_bug.cgi?id=1670807
2024-05-07 22:40:39 -05:00
Brian Smith acb34c35db Issue #2512 - Part 3 - Fix new failures with GCC 14. 2024-05-07 22:40:39 -05:00
Brian Smith e484c9d311 Issue #2512 - Part 2 - Fix autoconf basic compiler test.
GCC 14 and Clang 16 changed implicit-int from warning to error.
Causing the compiler test from 1996 to fail in C99 mode.
2024-05-07 22:40:38 -05:00
Brian Smith 6cbb2c372b Issue #2512 - Part 1 - Imported minimal autoconf 2.13.
https://bugzilla.mozilla.org/show_bug.cgi?id=1663863
2024-05-07 22:40:38 -05:00
Moonchild 5470407781 Merge pull request 'Implement missing parts of <dialog>' (#2511) from 2472-htmldialog-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2511
2024-05-07 09:34:36 +00:00
Brian Smith f9eaedbe2d Issue #2472 - Part 8: Fix conflicting defines on Mac. 2024-05-07 11:30:59 +02:00
Moonchild 5152b9b64a Merge branch 'master' into 2472-htmldialog-work
# Conflicts:
#	layout/style/res/html.css
2024-05-06 22:16:16 +02:00
Moonchild 46feb81dd3 Issue #2472 - Part 7: Unprefix fit-content in dialog style. 2024-05-06 22:11:36 +02:00
Moonchild 59796f3e9d Issue #2510 - Unprefix -moz-fit-content
No aliasing since this has been out for a while.
Devtools db regenerated with `mach devtools-css-db`

Resolves #2510
2024-05-06 22:09:18 +02:00
Moonchild 83b16ecc7f No issue - Regenerate devtools css database
We were missing ::slotted, apparently.
2024-05-06 21:21:53 +02:00
Moonchild 2baeb2083b Issue #2472 - Part 6: Fire cancel event and close modal <dialog> on [ESC]
This implementation is different than Mozilla, not indirectly queueing cancel
tasks to be arbitrarily ordered, but rather synchronously close in reverse
top layer order.
2024-05-06 12:33:09 +02:00
Moonchild 3ac7635150 Issue #2472 - Part 5: Make modal versions of <dialog> work, and tune styles.
This adds a pseudo-class `:-moz-modal-dialog` to be able to track whether the
dialog is in the top layer in CSS.
This implements default styling for modal dialogs following the HTML standard.
Slightly off-extreme color scheme chosen for unstyled <dialog> elements.
2024-05-04 18:32:41 +02:00
Moonchild a7e19fc7ae Issue #2472 - Part 4: Make TopLayer{Push|Pop} part of nsIDocument. 2024-05-04 18:16:28 +02:00
Moonchild 229517f9cd Merge branch 'master' into 2472-htmldialog-work 2024-05-02 11:49:28 +02:00
Moonchild d90a4ea28c Merge pull request 'FIPS cleanup' (#2509) from FIPS-cleanup-2 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2509
2024-05-01 20:46:56 +00:00
Moonchild 70b1711085 Issue #2505 - Part 4: Restore PK11_IsFips symbol for Mac building secutil. 2024-05-01 14:15:22 +02:00
Moonchild 49aa1346da Issue #2505 - Part 3: Remove FIPS interfaces and controls. 2024-05-01 13:38:01 +02:00
Moonchild aba23a13a3 Issue #2505 - Part 2: Update NSS to 3.90.2
This re-lands the NSS update that was backed out previously for RC bustage.
2024-05-01 13:37:30 +02:00
Moonchild e4254a9555 Issue #2505 - Part 1: Stop signing NSS libraries. 2024-04-23 23:16:13 +02:00
Moonchild cafaac1939 [dom media] Avoid a potential issue when assigning a media data buffer. 2024-04-17 22:30:57 +02:00
Moonchild 803f821d5b [gfx] Pull several OTS fixes from upstream to improve data safety.
- Don't check STAT designAxisSize if the designAxisCount is zero.
- Avoid potential arithmetic overflow during Buffer read operations.
- Use more careful range checks in STAT parsing.
2024-04-17 22:14:38 +02:00
Moonchild f3fb26a44f [js] Simplify tracing of arguments in MarkThisAndArguments. 2024-04-17 21:25:30 +02:00
Moonchild 27f64dc348 [network] Keep track of and check HTTP/2 header sizes. 2024-04-17 19:10:44 +02:00
Moonchild ac36221d70 [XPCOM] Warn about .xrm-ms files on Windows (treat as executable) 2024-04-17 16:30:00 +02:00
Moonchild 0f8e267fd1 Merge pull request 'Add exposed CPU flags' (#2504) from CPUflags-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2504
2024-04-15 07:41:53 +00:00
Moonchild c4665f5f6c Issue #2503 - Part 3: Add CPU capabilities to about:support. 2024-04-14 21:58:20 +02:00
Moonchild 983be16f8a Issue #2503 - Part 2b: Fix missing navigator in UpdateUtils. 2024-04-14 21:57:48 +02:00
Moonchild 6ebd47222a Issue #2503 - Part 2: Add CPU IS support flags to UpdateUtils URL substitutions. 2024-04-14 21:01:31 +02:00
Moonchild 68a4b8e3d4 Issue #2503 - Part 1: add CPU IS support flags to Navigator interface 2024-04-14 20:47:17 +02:00
Moonchild 3d76969fa8 [DOM] Add nullcheck on mDoc in GetEventTargetParent 2024-04-14 17:48:12 +02:00
Moonchild 791fd0300e Issue #2472 - Enable dialog element by default.
While work is still on-going to get layering/modal right, this should be enabled
by default for web compatibility reasons.
2024-04-13 12:07:46 +02:00
Moonchild 0635ffcca3 Merge pull request 'Add checks for IDXGIKeyedMutex failure.' (#2502) from 2470 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2502
2024-04-12 17:48:35 +00:00
Moonchild b96a2237e0 [devtools] fix issue with ctrl+c handling
See https://repo.palemoon.org/MoonchildProductions/Pale-Moon/issues/1961
2024-04-10 15:06:49 +02:00
Moonchild 59c863a900 Merge pull request 'Implement CSS shorthand properties for logical box margin and padding' (#2500) from FranklinDM/UXP-contrib:work_css-shorthand-block-inline-margin-padding into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2500
2024-04-10 12:56:20 +00:00
FranklinDM 8bfe1f3a7d Issue #2477 - Part 4: Regenerate developer tools' static CSS properties database 2024-04-09 11:08:27 +08:00
FranklinDM 878709cd23 Issue #2477 - Part 3: Logical box properties should accept auto values 2024-04-09 11:08:26 +08:00
FranklinDM ea87895dd9 Issue #2477 - Part 2: Implement shorthand properties for [margin/padding][block/inline] 2024-04-09 11:08:26 +08:00
FranklinDM 6b25fb2b3a Issue #2477 - Part 1: Implement a separate function for parsing pair box properties
This reuses existing logic from ParseGap.
2024-04-09 11:08:25 +08:00
Martok 02a1efa9fa [DOM] Simplify WorkerRunnable sanity checks and make them more readable. 2024-04-08 13:19:46 +02:00
Moonchild d65a4c0628 Issue #2470 - Check for failure of getting IDXGIKeyedMutex. 2024-04-07 23:29:39 +02:00
Moonchild c991295c93 Merge pull request 'Move CSS rules to WebIDL interfaces' (#2496) from css-webidl-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2496
2024-04-07 16:05:04 +00:00
Moonchild 763bcea405 Issue #2495 - Implement webkitURL legacy window alias for URL
Resolves #2495
2024-04-06 14:08:41 +02:00
Moonchild c87d9f3cff Merge branch 'master' into css-webidl-work
# Conflicts:
#	layout/style/StyleRule.cpp
2024-04-05 18:05:54 +02:00
Moonchild 8bc18ff5d4 Issue #2490 - Part 20: Remove the stuff that was added temporarily to deal with
a mix of WebIDL and non-WebIDL rules.
2024-04-04 20:07:33 +02:00
Moonchild f9508fa3cc Issue #2490 - Part 19: Convert CSSCounterStyleRule to WebIDL. 2024-04-04 19:52:36 +02:00
Moonchild 28836a35ed Issue #2490 - Part 18: Convert CSSKeyframesRule to WebIDL. 2024-04-04 14:13:43 +02:00
Moonchild a7d460c060 Issue #2490 - Part 17: Convert CSSKeyframeRule to WebIDL. 2024-04-04 14:00:59 +02:00
Moonchild 3434ea57c1 Issue #2490 - Part 16: Convert CSSFontFeatureValuesRule to WebIDL. 2024-04-04 10:20:43 +02:00
Moonchild 631e3a73e3 Issue #2490 - Part 15: Convert CSSFontFaceRule to WebIDL.
The .style PutForwards bit is coming along for the ride here as a new feature.
2024-04-04 10:02:17 +02:00
Moonchild b4a3d59128 Issue #2490 - Part 14: Convert CSSPageRule to WebIDL.
The .style PutForwards bit is coming along for the ride here as a new feature.
2024-04-03 16:47:23 +02:00
Moonchild cd8b0b38e8 Issue #2490 - Part 13: Convert media, supports, and moz-document rules to WebIDL.
This also converts the internal ConditionRule and GroupingRule classes.
2024-04-03 15:52:32 +02:00
Moonchild 35311d664a Issue #2490 - Part 12: Convert CSSStyleRule to WebIDL.
The .style PutForwards bit is coming along for the ride here, aligning us with
the behavior of Blink and Gecko.
2024-04-03 13:59:06 +02:00
Moonchild 9a5fe6f542 Issue #2490 - Part 11: Convert CSSImportRule to WebIDL.
Note that the .media PutForwards is a new feature coming along for the ride, now
that we're using the spec IDL.
2024-04-03 13:22:41 +02:00
Moonchild 28ba2fb374 Issue #2490 - Part 10b: Fix line endings (no code change). 2024-04-03 12:40:33 +02:00
Moonchild d423c54d9c Issue #2490 - Part 10: Convert CSSNamespaceRule to WebIDL. 2024-04-03 12:29:31 +02:00
Moonchild b3a016ac20 Merge pull request 'Emoji 15.1 Support' (#2492) from RealityRipple/UXP:emoji-15.1 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2492
2024-04-01 14:26:17 +00:00
Moonchild 536af00ab2 Issue #2490 - Part 9b: Add a CSSRule Web IDL interface.
Fix Paris bindings by providing a temporary IID for nsIDOMCSSRule
(thanks FranklinDM!)
2024-04-01 14:42:27 +02:00
Moonchild 041f0bd4f4 Merge pull request 'Remove style system magic pointer classes' (#2491) from FranklinDM/UXP-contrib:work_ss-remove-magic-pointer-classes into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2491
2024-04-01 11:30:43 +00:00
Andy dc6a8eea09 Transparent Keycap Patch 2024-03-31 23:26:34 -07:00
Andy ea4c79e18d Keycap Bug Fixes
Adds 0-9, #, and * as simple pictographs.
Duplicates (C), (R), (TM), and (M) with the Keycap suffix.
Turns Combining Enclosing Keycap into a zero-width character.
2024-03-31 12:37:56 -07:00
Moonchild f8861235ed Issue #2490 - WIP: part 9. Add a CSSRule Web IDL interface. 2024-03-31 00:47:10 +01:00
Moonchild 55bee27c30 Issue #2490 - Part 8: Get rid of css::Rule::GetDOMRule. 2024-03-30 22:32:33 +01:00
Moonchild d5add46c05 Issue #2490 - Part 7: Push the nsIDOMCSSRule implementation up to css::Rule. 2024-03-30 19:31:09 +01:00
Moonchild 13cfa63316 Issue #2490 - Part 6: Make css::Rule inherit from nsIDOMCSSRule. 2024-03-30 17:30:24 +01:00
Moonchild bbb66a5500 Issue #2490 - Part 5: Get rid of DOMCSSStyleRule. 2024-03-30 13:34:31 +01:00
Andy 90b015560d Don't Assume System Font for Emojis with Suffixes
A few dozen Emojis use otherwise general font characters in the lower codepages.
Luckily, the Emoji codepages always include either a VS16 or KeyCap suffix.
2024-03-30 04:57:34 -07:00
Andy e38b57caa7 Standardized use of Emoji Character Properties
Detection of Emoji Components, for use as suffixes of TextDefault.
Detection of Non-Presentation Emojis as TextDefault.
Detection of all Extended Pictographics as EmojiDefault.
2024-03-30 04:57:12 -07:00
Andy d003a2fba9 Update TwemojiMozilla.ttf to E15.1
Includes partially qualified and unqualified codepoints for all Emojis except (C), (R), (TM), and (M).
Updates Martinique flag.
Uses True South flag for Antarctica.
2024-03-30 04:56:20 -07:00
Moonchild b22e7e4350 Issue #2490 - Part 4: Make css::Rule wrappercached. 2024-03-30 12:39:15 +01:00
Moonchild 1c8d691c2a Issue #2490 - Part 3: Give CSS rules a PreCreate hook so we can safely wrappercache them. 2024-03-30 11:38:44 +01:00
Moonchild 5f39ff87a0 Issue #2490 - Part 2: Remove the now-unused GetExistingDOMRule() function. 2024-03-30 11:27:48 +01:00
FranklinDM 3ec13cbb4e Issue #2488 - Part 6: Define and declare CSSStyleSheet cast functions directly in StyleSheet
This renames AsGecko calls to AsConcrete and removes the header containing leftover Stylo macros.
2024-03-30 08:46:35 +08:00
FranklinDM 8dd55ce170 Issue #2488 - Part 5: Remove HandleRefPtr (exclusively used by smart pointer classes) 2024-03-30 08:46:34 +08:00
FranklinDM 1ed0fa9f83 Issue #2488 - Part 4: Remove the RestyleManagerHandle smart pointer class 2024-03-30 08:46:33 +08:00
FranklinDM 9eb661a899 Issue #2488 - Part 3: Remove the StyleSetHandle smart pointer class 2024-03-30 08:46:32 +08:00
FranklinDM b3bde74dce Issue #2488 - Part 2: Remove the DeclarationBlock class and use Declaration directly 2024-03-30 08:46:31 +08:00
FranklinDM b4224e3aff Issue #2488 - Part 1b: Move PseudoElementType getter/setter implementation of Element away from header 2024-03-30 08:46:30 +08:00
FranklinDM dbeb9a8d4f Issue #2488 - Part 1a: nsCSSPseudoClassList should not include any header 2024-03-30 08:46:30 +08:00
FranklinDM 0555400605 Issue #2111 - Follow-up: Add missing include and fix namespace conflict when building layout deunified 2024-03-30 08:46:29 +08:00
Moonchild fb88b2cc90 Merge branch 'master' into css-webidl-work 2024-03-30 00:19:21 +01:00
Moonchild 7f48de6549 Merge branch 'master' of https://repo.palemoon.org/MoonchildProductions/UXP 2024-03-30 00:15:04 +01:00
Moonchild f16c8418aa Merge pull request 'Remove Stylo from the platform' (#2487) from FranklinDM/UXP-contrib:work_stylo-removal-take3 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2487
2024-03-29 23:13:37 +00:00
Moonchild 4d90060dd8 Merge pull request 'Issue #2483 - Support DOMMatrix2DInit for addPath' (#2484) from craniumcadoo/UXP:issue-2483 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2484
2024-03-29 23:07:20 +00:00
Moonchild c0c6b38c18 Issue #2490 - Part 1: Make all CSS rules cycle-collected. 2024-03-29 18:18:36 +01:00
FranklinDM fb6a751759 Issue #2112 - Follow-up: Fix broken rule node assertion 2024-03-28 20:11:31 +08:00
FranklinDM e8e43b846c Issue #58 - Follow-up: Remove Rust binding leftovers 2024-03-26 02:21:52 +08:00
FranklinDM 3e33eda290 Issue #2112 - Part 15: Remove leftover comment 2024-03-26 02:21:51 +08:00
FranklinDM 2e8852cbf0 Issue #2112 - Part 14: Remove style context source and use rule node directly
Based on reverting bug 1260310.
2024-03-26 02:21:51 +08:00
FranklinDM df9a143414 Issue #2112 - Part 13: Remove construction context for style structs
Partial reversion of bug 1261552. This keeps the behavior of always passing the presentation context to the style structs, unlike pre-stylo where it is conditional.
2024-03-26 01:27:52 +08:00
FranklinDM 9dbaf7f6f8 Issue #2112 - Part 12: Remove reserved Servo bits from node/element flags and event states 2024-03-26 01:27:52 +08:00
FranklinDM c3fa38f0d7 Issue #2112 - Part 11: Remove dead off-thread Stylo functions in nsStyleStruct 2024-03-26 01:27:51 +08:00
FranklinDM da4399a912 Issue #2112 - Part 10: Remove remaining Stylo/Servo includes and code
Some classes have been marked for removal/merging, macros used for forwarding/casting were moved to DeprecatedUtils.h.
2024-03-26 01:25:59 +08:00
FranklinDM 425dc7f02b Issue #2112 - Part 9: Remove handling for multiple style backends 2024-03-26 01:25:53 +08:00
FranklinDM 456e1a5860 Issue #2112 - Part 8: Remove Stylo Stylesheet Cache 2024-03-26 01:25:31 +08:00
FranklinDM f82f5aaf29 Issue #2112 - Part 7: Remove Servo CSS Loader support 2024-03-26 01:25:14 +08:00
FranklinDM e18de3ac2b Issue #2112 - Part 6: Remove IsStyledByServo function and callers 2024-03-26 01:24:54 +08:00
FranklinDM 1ecde083b1 Issue #2112 - Part 5: Remove Servo from forwarding code used by magic pointer classes 2024-03-26 01:24:49 +08:00
FranklinDM 71101dc40c Issue #2112 - Part 4: Remove Stylo support for mask-image 2024-03-26 01:24:40 +08:00
FranklinDM a00ca6d871 Issue #2112 - Part 3: Remove --enable-stylo config and conditionals 2024-03-26 01:24:34 +08:00
FranklinDM 182b567fa8 Issue #2112 - Part 2: Stub out Servo functions 2024-03-26 01:24:29 +08:00
FranklinDM 7d330b89c8 Issue #2112 - Part 1: Remove Stylo tests 2024-03-26 01:24:23 +08:00
Moonchild 21c13fc9cd Revert "Update NSS to 3.90.2"
This reverts commit a79400a939.
2024-03-23 07:47:14 +01:00
Moonchild 889e3e3805 Revert "Undo build system change from NSS update to fix missing command-line utils."
This reverts commit 999640b68c.
2024-03-23 07:46:55 +01:00
Moonchild 7ad5cc471d Merge pull request 'No Issue - Only explicitly enforce GCC SSE2 optimizations when building on Intel 32-bit architectures' (#2485) from trav90/UXP-contrib:gcc-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2485
2024-03-22 23:51:42 +00:00
trav90 7ef3048c5e No Issue - Only explicitly enforce GCC SSE2 optimizations when building on Intel 32-bit architectures
SSE2 optimizations are used by default on 64-bit platforms. By no longer explicitly enabling SSE2 on 64-bit GCC, we can more easily enable other optimizations (e.g. AVX) without worrying about them being overridden by the SSE2 flags.
2024-03-22 10:28:06 -05:00
Moonchild 999640b68c Undo build system change from NSS update to fix missing command-line utils. 2024-03-21 21:54:22 +01:00
Daniel Jacobs 1abfd0f004 Issue #2483 - Slight adjustments for allowing addPath with DOMMatrix 2024-03-20 14:31:42 -04:00
Daniel Jacobs 37a033304d Issue #2483 - Support DOMMatrix2DInit for addPath 2024-03-20 18:29:30 +00:00
Moonchild 8df70dabe6 [MFBT] Make move assignment of RefPtr have the same behavior as nsCOMPtr 2024-03-20 15:55:46 +01:00
Moonchild 2c50617e64 [parser] Specialize AddAttributes for <html>/<body>. 2024-03-20 15:25:19 +01:00
Moonchild 87d7489bc3 Merge branch 'nss-update' 2024-03-20 14:35:13 +01:00
Moonchild a79400a939 Update NSS to 3.90.2 2024-03-20 14:23:51 +01:00
Moonchild 4b51e3ecc9 Merge pull request 'Colump picker should work even if there are no rows in the tree' (#2481) from yup/UXP:master into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2481
2024-03-17 15:47:41 +00:00
yup 9dbe31a41e Minor performance improvement by elimination of an unnecessary intermediate array 2024-03-17 15:41:22 +00:00
yup a5366670aa Merge branch 'master' into master 2024-03-09 18:23:08 +00:00
yup abb1298631 Colump picker should work even if there are no rows in the tree 2024-03-09 12:03:08 +00:00
Moonchild 56f255859c Merge pull request 'Return early when "this.view" does not exist (empty tree)' (#2479) from yup/UXP:master into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2479
2024-03-08 18:35:31 +00:00
yup 7a1e01c0f3 Eliminated exceptions in event handlers that happen when "this.view" does not exists (empty tree) 2024-03-08 14:04:02 +00:00
Moonchild 83857453b1 Issue #2472 - Part 3: Refactor Fullscreen stack to Top Layer stack
Fullscreen stack isn't part of the spec anymore; it's been changed to a more
generic version called Top Layer stack, which is being used by both full-screen
APIs and dialog elements.

This patch refactors it to Top Layer stack so that it can be reused for dialog
elements.

Top Layer stack spec: https://fullscreen.spec.whatwg.org/#new-stacking-layer
2024-03-07 12:24:06 +01:00
Moonchild 046c7e92a4 Issue #2472 - Part 2: Add FunctionRef callable type
Prerequisite for top layer refactor.

FunctionRef is a generic callable type that can be initialized from any
compatible callable, suitable for use as a function argument for the duration of
the function call (and no longer).
2024-03-07 11:14:20 +01:00
Moonchild 3e7fbd39df Issue #2472 - Part 1: Add helper method to directly dispatch events to widgets. 2024-03-01 13:08:06 +01:00
Moonchild 56d1a62f5d [network] Block set-cookie from multipart/x-mixed-replace 2024-02-22 22:08:23 +01:00
Eitan Isaacson 8e609c4594 [layout] Process pairs in coord list in PolyArea.
Range -1 assures the array is even with a step size of 2, avoiding lone
value processing.
2024-02-22 20:36:30 +01:00
Jens Stutte 238226ce46 [DOM] Check if WorkerRunnable::Run runs on top of WorkerThreadPrimaryRunnable::Run in a worker thread. 2024-02-22 19:53:24 +01:00
Moonchild 0d2e285caa Merge pull request 'Fix error when destroying the developer tools window and remove remaining doorhanger code' (#2476) from FranklinDM/UXP-contrib:work_fix-devtools-destroy-and-remove-doorhanger into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2476
2024-02-22 11:04:43 +00:00
FranklinDM 91309c6d9d No issue - Replacing location might throw NS_ERROR_UNEXPECTED while the developer tools window is being destroyed 2024-02-22 09:35:43 +08:00
FranklinDM 268c95d95f No issue - Remove leftover doorhanger code from the developer tools
Partially based on reverting https://bugzilla.mozilla.org/show_bug.cgi?id=1078539
2024-02-22 09:35:43 +08:00
Moonchild f0cce53b37 Merge pull request 'Use hard-coded minimum timer interval in workers' (#2474) from martok/UXP-contrib:mr/worker-timer into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2474
2024-02-10 17:13:25 +00:00
Martok 8f11d64255 Issue #2453 - Follow-Up: Use hard-coded minimum timer interval in workers.
From the spec: "If nesting level is greater than 5, and timeout is less than 4, then set timeout to 4.",
therefore not having it user-configurable doesn't really break anything.
2024-02-10 16:29:23 +01:00
Moonchild 7c32e33769 Merge pull request 'Implement new csp -src-elem and -src-attr directives' (#2469) from csp-elem-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2469
2024-02-07 12:17:21 +00:00
Moonchild 99f208ad22 Merge pull request 'Fix scrolling with mouse wheel when NPAPI is disabled.' (#2468) from athenian200/UXP:scroll_wheel_npapi_disabled into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2468
2024-02-04 22:27:15 +00:00
Moonchild 06eca091f7 Issue #2466 - Part 3: Implement style-src-elem and style-src-attr 2024-02-04 23:24:50 +01:00
Moonchild 8fc5e4bd24 Issue #2466 - Part 2: Implement script-src-elem and script-src-attr 2024-02-04 20:15:14 +01:00
Jeremy Andrews 110e4f1ca2 Issue #2467 - Fix scrolling with mouse wheel when NPAPI is disabled.
Refactors an else if statement into an else inside an if block.
2024-02-04 08:51:25 -06:00
Moonchild 73e94dd628 Issue #2466 - Part 1: Reduce nsContentPolicy type usage.
Use CSPDirective instead, since it directly deals with CSP anyway.
This cleanup prepares for the following changes.
2024-02-04 13:33:32 +01:00
Moonchild 783b48a083 Disable URL-paste content loading by default.
See https://repo.palemoon.org/MoonchildProductions/Pale-Moon/issues/1957
2024-02-02 13:28:43 +01:00
Moonchild 9279b01433 Issue #2465 - Do not use our in-tree metrics hints if using system-cairo
Use a somewhat equivalent font-options instance when using the
system-supplied cairo lib, instead of our in-tree extension.

Resolves #2465
2024-02-01 11:20:25 +01:00
Moonchild afc9a8cafa Merge pull request 'Implement support for <link rel=preload> meta' (#2463) from FranklinDM/UXP-contrib:work_dom-preload-link-ns into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2463
2024-01-28 17:20:48 +00:00
FranklinDM 476fc70de9 Issue #2158 - Follow-up: Add missing include 2024-01-29 00:53:36 +08:00
Moonchild ea7435c05e Issue #618 - Follow-up: Fix missed constant refactor preventing ExportEntries from working. 2024-01-28 15:08:57 +01:00
FranklinDM 01d0962f62 Issue #2158 - Part 5: Guard preload links support with a preference
This is enabled by default.
2024-01-27 23:10:49 +08:00
FranklinDM 16aeb39791 Issue #2158 - Part 4: Dispatch load/error events upon parsing preload links 2024-01-27 23:10:48 +08:00
FranklinDM ba97710cdf Issue #2158 - Part 3: Parse preload links as part of the HTML5 parser's speculative load queue 2024-01-27 23:10:48 +08:00
FranklinDM 56157c149a Issue #2158 - Part 2: Handle and expose preload link destination to DOM
This also defines known preload destinations and ensures it is reflected in JS.
2024-01-27 23:10:47 +08:00
FranklinDM 02c4302711 Issue #2158 - Part 1: Add the 'as' attribute to the HTML Parser 2024-01-27 23:10:47 +08:00
Moonchild 0616807ac3 Merge pull request 'Remove leftover reference to focus handler for dev edition doorhanger' (#2462) from FranklinDM/UXP-contrib:work_remove-leftover-ff-ref-devtools into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2462
2024-01-25 14:44:13 +00:00
FranklinDM 2d7a4f2655 No issue - Remove leftover reference to focus handler for dev edition doorhanger
Follow-up to 038774e52b
2024-01-25 20:50:41 +08:00
Moonchild 7182490961 [HSTS] Let parent hosts determine whether HSTS subs should be applied.
This aligns with the wording in RFC 6797.
2024-01-24 19:35:02 +01:00
Moonchild a054bcc23b Bug 1863083 2024-01-24 17:26:44 +01:00
John Schanck 2fdc4c71ce [NSS] add a defensive check for large ssl_DefSend return values. 2024-01-24 17:19:35 +01:00
Geoff Lang 6689328efe [gfx] Cherry-pick chromium:1864587 2024-01-24 16:38:28 +01:00
Daniel Holbert c757d71379 [gtk] Let printer enumeration run to completion, to avoid a GTK bug. 2024-01-24 16:21:26 +01:00
Moonchild 690127c618 No issue - Clean up some devtools comments and prefs. 2024-01-23 10:31:25 +01:00
Moonchild 038774e52b No issue - Remove leftover beta-only dev edition promo in devtools. 2024-01-23 10:22:20 +01:00
Moonchild c38a8256f3 Merge pull request 'Collected Microtask timing updates' (#2459) from martok/UXP-contrib:mr/2452-mt-updates into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2459
2024-01-18 13:15:16 +00:00
Moonchild c6a60994b7 Merge pull request 'Align selection and focus behavior more with mainstream' (#2461) from 2388-select-and-focus into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2461
2024-01-18 13:14:13 +00:00
Moonchild 38411ba78a Merge pull request 'Intersection Observer update to fix failures on sites using Document as root.' (#2460) from dbsoft/UXP:int-obs-2456 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2460
2024-01-17 17:44:06 +00:00
Moonchild c03d2c2cc5 Issue #2388 - Part 5: Make Selection::ToString flush frames 2024-01-17 13:55:23 +01:00
Moonchild 3c46488a8c No issue - Update build status messages 2024-01-17 10:42:52 +01:00
Moonchild 60f1eab6c2 Issue #2388 - Part 4: Align focus behavior more with Blink/Gecko 2024-01-16 21:54:52 +01:00
Moonchild 9851eee94a Issue #2388 - Part 3: Update tests 2024-01-16 21:28:36 +01:00
Moonchild 09b3e1deeb Issue #2388 - Part 2: move focus at every selection change when it's called by JS 2024-01-16 21:28:04 +01:00
Moonchild 993e1b50e2 Issue #2388 - Part 1: Mark Selection as "called by JS" when caused by a JS call to the selection API 2024-01-16 19:28:24 +01:00
Moonchild cf06215a9d Merge pull request 'Don't try to directly access pref on worker thread.' (#2457) from 2453-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2457
2024-01-16 12:14:31 +00:00
Martok 252c4bdc74 Issue #2452 - Handle re-entrant Microtask checkpoints from Events dispatched by StableState callbacks 2024-01-16 11:04:58 +01:00
Martok b2319aff7f Issue #2452 - Don't use WebVTTListener, JS wrapper, MediaShutdownManager in stable state
https://bugzilla.mozilla.org/show_bug.cgi?id=1443429
https://bugzilla.mozilla.org/show_bug.cgi?id=1515021
2024-01-16 11:02:51 +01:00
Martok a9f263c081 Issue #2452 - Fix getter constness
https://bugzilla.mozilla.org/show_bug.cgi?id=1443429 Pt. 2
2024-01-16 11:02:51 +01:00
Martok 9db0c6779a Issue #2452 - Prevent nsDocShell access when it is already being destroyed
https://bugzilla.mozilla.org/show_bug.cgi?id=1432396
2024-01-16 11:02:51 +01:00
Martok 16d0e3694c Issue #2452 - Bail out from PresShell::Initialize if the pres shell is being destroyed in XBLConstructorRunner
https://bugzilla.mozilla.org/show_bug.cgi?id=1428694
2024-01-16 11:02:50 +01:00
Martok fc170a373c Issue #2452 - Fire events after iterating ServiceWorkerManager::mControlledDocuments is done.
https://bugzilla.mozilla.org/show_bug.cgi?id=1413466
2024-01-16 11:02:50 +01:00
Martok 6cd9f36c28 Issue #2452 - Ensure DOM events aren't dispatched at unexpected time
https://bugzilla.mozilla.org/show_bug.cgi?id=1409985
https://bugzilla.mozilla.org/show_bug.cgi?id=1443746
2024-01-16 11:02:50 +01:00
Martok d4070c7554 Issue #2452 - Declare the NS_ERROR_DOCSHELL_DYING error
From https://bugzilla.mozilla.org/show_bug.cgi?id=1337537
2024-01-16 11:02:50 +01:00
Moonchild ac32a184f1 Merge pull request 'Guard the classic email account wizard with its own configure option' (#2455) from FranklinDM/UXP-contrib:work_config-classic-email-account-wizard into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2455
2024-01-15 20:36:46 +00:00
Moonchild 6bb1b66457 Issue #2453 - Simplify CalculateTargetTime() code and fix typo.
We should always be on a worker thread so the MainThread call isn't
needed.
Also: DOMMinTimoutValue -> DOMMinTimeoutValue
2024-01-15 20:58:30 +01:00
Moonchild be728322e0 Issue #2458 - Make HTMLInputElement.files read-write
Resolves #2458
2024-01-15 20:26:10 +01:00
Moonchild 70f567950b Issue #2453 - Don't try to directly access pref on worker thread. 2024-01-15 15:10:31 +01:00
Brian Smith cc697eb106 Issue #2456 - Intersection Observer - Accept a Document as an explicit root.
https://bugzilla.mozilla.org/show_bug.cgi?id=1617154
2024-01-15 05:54:48 -06:00
FranklinDM e2e50d065f Issue #2454 - Guard the classic email account wizard with its own configure option 2024-01-15 18:34:31 +08:00
Moonchild 133ec26f5e Merge pull request 'Allow disabling NPAPI to make GTK3-only builds possible.' (#2450) from athenian200/UXP:npapi_disable_work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2450
2024-01-14 16:56:32 +00:00
Jeremy Andrews a66c8a088f Issue #1638 - Follow-up: Fix syntax error in Part 6. 2024-01-12 00:32:33 -06:00
Moonchild 2354011d48 Issue #2451 - Send referrer headers with CORS preflight requests.
This is dependent on referrer policy.

Fixes #2451
2024-01-11 22:21:57 +01:00
Jeremy Andrews 722eaab39a Merge branch 'npapi_disable_work' of https://repo.palemoon.org/athenian200/UXP into npapi_disable_work 2024-01-11 12:30:40 -06:00
Jeremy Andrews 05cebf17e0 Issue #1638 - Part 8: Additional Mac fixes. 2024-01-11 12:30:13 -06:00
athenian200 9ea951fa6a Issue #1638 - Part 7: Allow GTK2 builds without gtk2xtbin. 2024-01-11 09:28:14 -06:00
Jeremy Andrews 174b2b76df Issue #1638 - Part 6: Disable plugin-container. 2024-01-11 07:10:27 -06:00
athenian200 9af4b97fbe Issue #1638 - Follow-up: Fix syntax error in Part 5. 2024-01-11 05:23:34 -06:00
Jeremy Andrews bbf374ad17 Issue #1638 - Part 5: Disallow mixing --enable-webrtc with --disable-npapi. 2024-01-11 04:43:33 -06:00
Jeremy Andrews ba58438b41 Issue #1638 - Part 4: Fix Mac build.
This was in the original removal bug, I just missed a couple lines.
2024-01-11 04:06:15 -06:00
Jeremy Andrews 0bf5eaaa2b Issue #1638 - Part 3: Clean up moz.build files. 2024-01-10 09:16:23 -06:00
Moonchild 2f65157f25 Merge pull request 'Don't toggle focus-within state past the nearest common flattened tree ancestor.' (#2449) from 2401-focus-within-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2449
2024-01-10 10:11:12 +00:00
athenian200 ff713f133e Issue #1638 - Part 2: Disable GTK2 when building with GTK3 and without NPAPI.
The original purpose of this issue.

Ref: BZ 1377445
2024-01-10 04:03:35 -06:00
athenian200 b787af5702 Issue #1638 - Part 1: Put NPAPI code behind MOZ_ENABLE_NPAPI.
Adds --disable-npapi as an additional build option. The default is still to build in NPAPI compatibility, but with this flag, it's finally possible to build without pulling in GTK2 on systems that don't have the package.

This essentially ifdefs everything associated with NPAPI, following various Mozilla removal bugs.

Ref: BZ 1682030, BZ 1251202, BZ 1217665, BZ 1687239
2024-01-10 04:03:35 -06:00
Moonchild 82395acfa6 Issue #2401 - Part 3: Don't toggle focus-within state past the nearest
common flattened tree ancestor.

Resolves #2401
2024-01-09 18:23:47 +01:00
Moonchild 994792bdc8 Issue #2401 - Part 2: Add GetCommonFlattenedTreeAncestor.
Passing GetFlattenedTreeParent() as the "get parent" function.

This way we can reduce the complexity in our EventStateManager by simply
calling out to the templatized function from Part 1.
2024-01-09 17:40:12 +01:00
Moonchild d36fa8bfce Issue #2401 - Part 1: Templatize GetCommonAncestor. 2024-01-09 11:32:18 +01:00
Moonchild 9dac9de154 Merge pull request 'Collection of CSP updates from Firefox 54-70.' (#2448) from dbsoft/UXP:csp-updates4 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2448
2024-01-09 09:42:42 +00:00
Brian Smith 391e17626b Issue #2402 - Fill in column in CSP Report. 2024-01-08 21:14:05 -06:00
Brian Smith 2150fb7fa9 Issue #2402 - Print Related JS-Line on CSP Violation (if any).
https://bugzilla.mozilla.org/show_bug.cgi?id=1100630
2024-01-08 08:49:05 -06:00
Brian Smith 3dd8bc0ddb Issue #2402 - CSP Violation events should have the correct sample for inline contexts.
https://bugzilla.mozilla.org/show_bug.cgi?id=1473587
Add preference to increase max length of CSP report source sample.
https://bugzilla.mozilla.org/show_bug.cgi?id=1415352
Return valid columnNumber value in CSP violation events.
https://bugzilla.mozilla.org/show_bug.cgi?id=1418246
2024-01-08 07:46:11 -06:00
Brian Smith 0fe8ac9349 Issue #2402 - Workers.setTimeout/setInterval must handle CSP rejections.
https://bugzilla.mozilla.org/show_bug.cgi?id=1490165
Has some namespace issues adding the files, so differs slightly.
2024-01-08 03:22:44 -06:00
Brian Smith a35ee1a6a5 Issue #2402 - CSP should throw EvalError when blocking eval() and Function().
https://bugzilla.mozilla.org/show_bug.cgi?id=1473024
https://bugzilla.mozilla.org/show_bug.cgi?id=1490165
2024-01-07 11:59:24 -06:00
Brian Smith d20b1f2fb6 Issue #2402 - CSP violation: blockedURI inline/eval.
https://bugzilla.mozilla.org/show_bug.cgi?id=1418241
CSP: Blocked URI should be empty for inline violations.
https://bugzilla.mozilla.org/show_bug.cgi?id=1236222
2024-01-07 11:48:56 -06:00
Brian Smith a86b4c35f1 Issue #2402 - Optionally strictly enforce the MIME type of scripts loaded by importScripts().
https://bugzilla.mozilla.org/show_bug.cgi?id=1514680
This is default on in Firefox 67 but Moonchild requested it be set off by default.
2024-01-07 08:29:30 -06:00
Brian Smith 6b00d13010 Issue #2402 - Require ServiceWorkerGlobalScope.importScripts() to only accept JavaScript MIME types.
https://bugzilla.mozilla.org/show_bug.cgi?id=1354577
Require ServiceWorkerContainer.register() to only accept JavaScript MIME types.
2024-01-07 07:37:47 -06:00
Brian Smith 830a634cec Issue #2402 - Don't call WorkerPrivate::WorkerName() to get service worker scope.
https://bugzilla.mozilla.org/show_bug.cgi?id=1350433
2024-01-07 07:34:05 -06:00
Brian Smith 80207d6d3f Issue #2402 - importScripts should be governed by script-src in Web Workers.
https://bugzilla.mozilla.org/show_bug.cgi?id=1322111
Add TYPE_INTERNAL_WORKER_IMPORT_SCRIPTS content policy.
Update the Cache API schema to account for new nsIContentPolicy type.
2024-01-06 15:32:04 -06:00
Brian Smith f4a49d6063 Issue #2402 - Move WorkerPrivate::SetPrincipal() logic into a WorkerLoadInfo method.
https://bugzilla.mozilla.org/show_bug.cgi?id=1333573
Make worker SetPrincipalOnMainThread fallible.
https://bugzilla.mozilla.org/show_bug.cgi?id=1338523
2024-01-06 15:32:04 -06:00
Brian Smith 86d22c2135 Issue #2402 - Persist response headers for offlined service worker scripts.
https://bugzilla.mozilla.org/show_bug.cgi?id=1337543
2024-01-06 15:32:04 -06:00
Brian Smith 2b14856b57 Issue #2402 - Move code to fill InternalHeaders from an nsIChannel response into utility method.
https://bugzilla.mozilla.org/show_bug.cgi?id=1337543
2024-01-06 15:32:03 -06:00
Brian Smith dfbf2aef81 Issue #2402 - Apply CSP headers to ServiceWorker when loading offlined script.
https://bugzilla.mozilla.org/show_bug.cgi?id=1337543
2024-01-06 15:32:03 -06:00
Brian Smith db049fa0cd Issue #2402 - Factor out code to set WorkerPrivate CSP from headers.
https://bugzilla.mozilla.org/show_bug.cgi?id=1337543
2024-01-06 15:32:03 -06:00
Brian Smith 27f416684f Issue #2402 - Improve ServiceWorker asserts and verify load principal does not inherit CSP.
https://bugzilla.mozilla.org/show_bug.cgi?id=1337543
2024-01-06 15:32:03 -06:00
Brian Smith 6ad6336fc9 Issue #2402 - ServiceWorker should not inherit CSP from registration principal.
https://bugzilla.mozilla.org/show_bug.cgi?id=1337543
2024-01-06 15:32:03 -06:00
Brian Smith 0044a85a07 Issue #2402 - Sanitize the nsIPrincipal used to register a service worker to ensure CSP is not persisted.
https://bugzilla.mozilla.org/show_bug.cgi?id=1337543
2024-01-06 15:32:02 -06:00
Brian Smith ec5d6d9b5d Issue #2402 - Fix SecurityPolicyViolationEvent.violatedDirective.
https://bugzilla.mozilla.org/show_bug.cgi?id=1418243
2024-01-06 15:32:02 -06:00
Brian Smith d9bd92c926 Issue #2402 - Implement security policy violation event.
https://bugzilla.mozilla.org/show_bug.cgi?id=1037335
2024-01-06 15:32:02 -06:00
Brian Smith afeab7fe26 Issue #2402 - Remove child-src deprecation warning.
https://bugzilla.mozilla.org/show_bug.cgi?id=1486331
2024-01-06 15:32:02 -06:00
Brian Smith ba183ce002 Issue #2402 - Ignore empty CSP directives.
https://bugzilla.mozilla.org/show_bug.cgi?id=1439425
2024-01-06 15:32:02 -06:00
Moonchild e3520a9118 Merge pull request 'Implement events for Promise rejection' (#2436) from martok/UXP-contrib:mr/prom-rejection-event into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2436
2024-01-06 12:09:05 +00:00
Martok ae667c9a36 Issue #2435 - Re-Implement rejected Promises events according to spec
Own implementation; upstream gets several things wrong.
2024-01-05 17:19:51 +01:00
Martok 14826c037b Issue #2435 - Implement notifying of rejected promises
Based-on: m-c 1362272
2024-01-05 17:19:51 +01:00
Martok 6bc2cfe6c1 Issue #2435 - Add onrejectionhandled and onunhandledrejection EventHandler
Based-on: m-c 1362272
2024-01-05 17:19:51 +01:00
Martok ca2f56cd5c Issue #2435 - Declare PromiseRejectionEvent WebIDL
Based-on: m-c 1338059
2024-01-05 17:19:50 +01:00
Martok 0dde96ba82 Issue #2240 - Align Microtasks and promises scheduling with spec
Microtasks, resolved Promises and Observers are handled after the sync
task that caused them, in the order they were generated.
Also simplifies reentrancy handling.

Based-on: m-c 1193394
2024-01-05 17:19:42 +01:00
Martok 980956063f Issue #2435 - Make CycleCollectedJSContext.h dependency explicit 2024-01-05 17:12:34 +01:00
Moonchild babe1377c6 Merge pull request 'No longer force tcp send buffer size on HTTP/2 uploads > 128KB' (#2431) from martok/UXP-contrib:2430-http2 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2431
Reviewed-by: Moonchild <moonchild@palemoon.org>
2024-01-03 21:40:12 +00:00
Martok 5e53809bb7 Issue #2430 - No longer force tcp send buffer size on HTTP/2 uploads > 128KB
With connection-level and stream-level flow control, it is not needed.
On fast connections with large-ish BWP, this can improve upload speed by > 5x
2024-01-02 01:41:02 +01:00
Martok c92b079235 Issue #2430 - Allow network.http.spdy.chunk-size to be larger than 16K
According to https://datatracker.ietf.org/doc/html/rfc7540#section-4.2    The size of a frame payload is limited by the maximum size that a
    receiver advertises in the SETTINGS_MAX_FRAME_SIZE setting. This
    setting can have any value between 2^14 (16,384) and 2^24-1
    (16,777,215) octets, inclusive.
2024-01-02 01:41:02 +01:00
Moonchild 9e3d5c38e8 Bump platform version 2024-01-01 18:35:14 +01:00
Moonchild 13476d771e Merge pull request 'No issue - Allow embedded search module in HYPE_ICEDOVE project' (#2433) from g4jc/UXP-contrib:hype_ice into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2433
2024-01-01 14:35:01 +00:00
Moonchild 1c298ec2a6 Merge pull request 'Fix debug build assertions' (#2432) from g4jc/UXP-contrib:2410_debug into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2432
2024-01-01 14:34:29 +00:00
Gaming4JC bf94026f51 No issue - Allow embedded search module in HYPE_ICEDOVE project 2023-12-30 22:50:55 -05:00
Gaming4JC 06714827ac Debug: Remove assertion for nsDOMNavigationTiming.
As mentioned in issue #2410, this aggressive assertion can cause an uneeded crash during debug build runs.
2023-12-30 22:35:42 -05:00
Gaming4JC be7d317f21 Issue #1442 Follow-up: Fix debug assertion in JSFun
Change in d5020b69bd introduced a debug build crash, this fixes the crash by properly porting the changes to an assertion as mentioned in issue #2410.
2023-12-30 22:35:38 -05:00
Moonchild bfe71e3271 No issue - Tighten default script time-outs and expose stop_slow_scripts
The timings here are still slightly more lenient than the hard-coded
fallback timings in code (10/20 for content/chrome respectively) but
we definitely should not need very long time-outs by default on Chrome
scripts anymore.

Also exposes dom.always_stop_slow_scripts to about:config since we're
making it also UI-configurable in Pale Moon and it just makes sense not
to hide this option.
2023-12-29 22:56:38 +01:00
Moonchild c4354d3775 Issue #2407 - Rename full-screen-api.ignore-widgets
Renames to full-screen-api.restrict-to-window and clarifies comments for
its intended use.
Resolves #2407.
2023-12-29 13:53:16 +01:00
Moonchild 22def28c94 Merge pull request 'No Issue - Fix syntax in js/src/jsapi-tests/moz.build' (#2411) from mrnhmath/UXP:jstests-fix into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2411
2023-12-29 10:54:49 +00:00
Matheus Marinho d79038b500 No Issue - Fix syntax in js/src/jsapi-tests/moz.build 2023-12-28 15:01:38 -03:00
Moonchild 9a3ac861de Revert "[XPCOM] Compare return value of readlink in nsLocalFileUnix::GetNativeTarget"
This reverts commit 66b07ce699.
2023-12-21 14:04:34 +01:00
Kershaw Chang 6929ce1f87 Bug 1736385 - Make sure thread is alive in CacheIOThread::ThreadFunc 2023-12-20 21:52:13 +01:00
Moonchild eaaa7ec3ab [dom] Better handling of aborted websocket workers.
Catch the case where we are in worker-shutdown but are still connecting
and make filing and closing connections a bit more robust with a RefPtr.
2023-12-20 21:41:00 +01:00
Barret Rennie 66b07ce699 [XPCOM] Compare return value of readlink in nsLocalFileUnix::GetNativeTarget 2023-12-20 18:33:23 +01:00
Moonchild dda1cf6f26 [layout] Always check against fragment length in nsTextFrame 2023-12-20 13:19:00 +01:00
Moonchild 779fc8abf3 Bug 1868901 2023-12-20 07:34:04 +01:00
Jeremy Andrews 87b346631f No Issue - Add full-screen-api.ignore-widgets pref to about:config.
This was already in the codebase, but not exposed by default. Mozilla exposed
the pref to fulfill user requests in Firefox 59. Forum users requested the same feaure of pseudo-fullscreen windows. Seems minor enough not to be worth
creating an issue for, since users can already access this by creating a bool
pref.

Ref: BZ 1422535
2023-12-19 00:23:03 -06:00
Moonchild b6121d3525 Merge pull request 'Add a pref to disable CSP reporting.' (#2406) from 2405 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2406
2023-12-18 11:56:45 +00:00
Moonchild 49a6a85969 Issue #2405 - Add a pref to disable CSP reporting.
Resolves #2405
2023-12-17 22:56:04 +01:00
Moonchild ce717e2633 No issue - Allow redirects for requests that require preflight
Spec update, see Bug 1312864
2023-12-12 12:38:45 +01:00
Moonchild b2399c9b76 [DOM] Fix double-free crash in MessagePort.cpp 2023-12-10 17:02:56 +01:00
Moonchild dd2f013047 Merge pull request 'Initial XULRunner bringup' (#2389) from mrnhmath/UXP:xulrunner-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2389
2023-12-03 23:54:21 +00:00
mrnhmath bc6de3eb9d Merge branch 'master' into xulrunner-work 2023-12-03 16:46:50 +00:00
Moonchild 27c8f022f1 Merge pull request 'Update ffvpx lib to 6.0.1' (#2398) from trav90/UXP-contrib:ffvpx-601 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2398
2023-12-02 07:46:08 +00:00
Moonchild 7ee0259133 Merge pull request 'Fix LDAP on Linux.' (#2400) from athenian200/UXP:ldap-fix-extern-c into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2400
2023-12-02 07:43:46 +00:00
Jeremy Andrews c84c6189cf Issue #2399 - Fix LDAP on Linux. 2023-12-01 19:01:18 -06:00
trav90 1f7023294a Issue #2317 - Follow-up - Update ffvpx to 6.0.1 2023-12-01 16:12:00 -06:00
Moonchild 041e7e7e47 Merge pull request 'Fix click handling.' (#2397) from toplevel-click-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2397
2023-12-01 21:50:24 +00:00
Moonchild 4b1b9cac33 Issue #2362 - Fix click handling according to the spec.
This removes some hackery surrounding preventing content clicks, and in
general handles auxclick as it should, firing that event on secondary
buttons (wheel/right on default setup for right-handed mouse).
2023-11-30 18:56:26 +01:00
mrnhmath f9898e24e9 Merge branch 'master' into xulrunner-work 2023-11-30 16:39:41 +00:00
Matheus Marinho b6bb2995b1 Issue #2391 - Follow-up: Don't discriminate against Darwin for the stub name 2023-11-30 13:35:23 -03:00
Moonchild 37e49bec28 Merge pull request 'Add general Big Endian ICU data file and initial Mac PowerPC support.' (#2392) from dbsoft/UXP:macppc-rebased3 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2392
2023-11-30 08:54:40 +00:00
Moonchild 0c392684fa Merge branch 'master' of https://repo.palemoon.org/MoonchildProductions/UXP 2023-11-30 00:03:10 +01:00
Moonchild 244c1e9ad1 Revert "No issue - Stop supporting data: scheme in SVG <use> elements."
This reverts commit 7e60482d80.

Of course it's not that simple. In Mozilla land they are also running
into issues but of a different variety and it was backed out there also.
2023-11-29 23:42:28 +01:00
Moonchild f85cb8d2f7 Merge pull request 'Fix crashes when canceling dynamic imports.' (#2395) from dbsoft/UXP:dmi-fix-2387 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2395
2023-11-29 22:25:52 +00:00
Moonchild c29be84c26 Merge pull request 'Add support for texture recycling' (#2394) from trav90/UXP-contrib:Issue2393 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2394
2023-11-29 20:32:38 +00:00
trav90 425914e43d Issue #2393 - Part 8 - Fix TextureClient-creating functions 2023-11-29 10:23:04 -06:00
trav90 6bfef39da0 Issue #2393 - Part 7 - Add missing #include to D3D11YCbCrImage.cpp 2023-11-29 07:56:15 -06:00
trav90 a7d9607b7a Issue #2393 - Part 6 - Remove stray "+". 2023-11-28 14:54:12 -06:00
trav90 5dfa048f04 Issue #2393 - Part 5 - Extract D3D11MTAutoEnter and reuse 2023-11-28 14:44:29 -06:00
trav90 3f497c7991 Issue #2393 - Part 4 - Reduce VideoQueue size for GPU based images 2023-11-28 14:42:53 -06:00
trav90 44b5594756 Issue #2393 - Part 3 - Remove extra copy of YUV buffer on Windows 2023-11-28 14:41:34 -06:00
trav90 d7baf6fc35 Issue #2393 - Part 2 - Add D3D11YCbCrImage type and related methods
Will allow to directly upload a YUV420 buffer into a D3D11 texture.
2023-11-28 14:40:11 -06:00
trav90 907ff19190 Issue #2393 - Part 1 - Allow client side uploads on Intel hardware 2023-11-28 14:38:32 -06:00
Brian Smith 2aee4a7692 Issue #2387 - Remove a missed AddRef() which could cause leaks.
Update comments explaining how the reference counting works.
2023-11-28 11:55:03 -06:00
Brian Smith 65d318f307 Issue #2387 - Collection of fixes related to a crash while canceling a dynamic import.
Add AddRef/Release hooks for embedding's script or module private value and set this script source object where appropriate.
https://bugzilla.mozilla.org/show_bug.cgi?id=1519140 Partial, no Value passing changes.
Clear the list of dynamic import requests after cancelling them in ScriptLoader::ParsingComplete as we do for other requests.
https://bugzilla.mozilla.org/show_bug.cgi?id=1291535
ScriptLoader::OnStreamComplete never returns a failure.
https://bugzilla.mozilla.org/show_bug.cgi?id=1627275
Also cancel the correct kind of parser for Modules.
2023-11-27 23:30:25 -06:00
mrnhmath 9a99a6ce3c Merge branch 'master' into xulrunner-work 2023-11-27 00:43:42 +00:00
Matheus Marinho 58ddf7abf4 Issue #2391 - Part 12: Use XML-style license block in simple.xul 2023-11-26 21:40:55 -03:00
Matheus Marinho a803a6c13b Issue #2391 - Part 11: Remove obsolete define for older MSVC
Also cleans up trailing spaces.
2023-11-25 18:50:53 -03:00
Matheus Marinho 77c99edbd8 Issue #2391 - Part 10: Update README 2023-11-25 18:50:46 -03:00
Matheus Marinho 8efcea0172 Issue #2391 - Part 9: Remove resource edit tool
Broken and largely unused outside B2G and Fennec
2023-11-25 18:50:36 -03:00
Matheus Marinho 9c121d2651 Issue #2391 - Part 8: Remove deb packaging target 2023-11-25 18:50:28 -03:00
Matheus Marinho 06d4d4f9c5 Issue #2391 - Part 7: Restore Windows installer folder 2023-11-25 18:50:19 -03:00
Matheus Marinho bcbfdfa370 Issue #2391 - Part 6: Use platform defaults 2023-11-25 18:50:13 -03:00
Matheus Marinho cf26dcd241 Issue #2391 - Part 5: Restore xulrunner-stub name overriding 2023-11-25 18:50:06 -03:00
Matheus Marinho 891b4cf513 Issue #2391 - Part 4: Restore building of stub, examples and (the bits of) installer 2023-11-25 18:49:55 -03:00
Matheus Marinho 23dc95f80a Issue #2391 - Part 3: Restore build.mk 2023-11-25 18:49:38 -03:00
Matheus Marinho 85fc119179 Issue #2391 - Part 2: Return the correct path for xulrunner 2023-11-25 18:49:31 -03:00
Matheus Marinho 169518553e Issue #2391 - Part 1: Revert XULRunner removal
This reverts commits 0f52679d2e and 4a7af0d90f.
Also accounts for non-comm building and comment changes.
2023-11-25 18:49:17 -03:00
Moonchild 6cd8c381b5 Issue #2381 - Fix error() mistake. 2023-11-25 17:16:28 +01:00
Moonchild 74266b6c30 Merge pull request 'Implement write-only version of Navigator.clipboard' (#2386) from 2361-nav-clipboard-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2386
2023-11-23 17:30:40 +00:00
Moonchild 231a8f6989 Merge branch 'master' into 2361-nav-clipboard-work
# Conflicts:
#	modules/libpref/init/all.js
2023-11-23 18:29:27 +01:00
Moonchild 6180288a7a [WebGL] Flip the validation state for gl_KHR_no_validation.
The original state was inverted due to confusion due to a double
negative (not:no_error).
This validation should only be enabled on Windows (for now).
Future tracking and discussion in BZ 1862039
2023-11-23 18:05:58 +01:00
Moonchild 9ed96de5a6 [DOM] Improve MessagePort state machine. 2023-11-23 17:32:44 +01:00
Moonchild a81085e7b7 [Network] Fix relative URL path starting with multiple slashes 2023-11-23 16:08:26 +01:00
Moonchild 88a656ec70 [DOM] Check if rootDoc is secure context for web compat 2023-11-23 14:44:33 +01:00
Moonchild e953529b5d [WebGL] Turn on more validation/error checking in webgl (when not on Win) 2023-11-23 14:05:37 +01:00
Brian Smith 7ffbfde627 Issue #2051 - Part 5 - Identify intel32 and powerpc platform types for Mac packaging.
Fix warnings building on MacOS 10.5 PPC.
2023-11-23 01:42:12 -06:00
Brian Smith 9dfc190714 Issue #2378 & #2051 - Part 4 - Remove unused moz_xposix_memalign().
Also switch to using HAVE_POSIX_MEMALIGN for Mac PowerPC tests.
When there is no posix_memalign() on Mac, just call malloc().
2023-11-23 01:42:12 -06:00
Brian Smith af52fd45f1 Issue #2051 - Part 3 - Use pre-built big-endian ICU data file for big-endian builds.
https://bugzilla.mozilla.org/show_bug.cgi?id=1264836
Disable unused ICU code during build.
2023-11-23 01:42:12 -06:00
Brian Smith 4f010e9218 Issue #2051 - Part 2 - Fix building with GCC 12 and on newer versions of MacOS.
AvailabilityMacros.h needed to be included manually, or it builds old font code.
2023-11-23 01:42:11 -06:00
Brian Smith 8cffdc299f Issue #2051 - Part 1 - Initial changes to get UXP building on Mac 10.5 PowerPC.
Additionally update the version detection back to 10.5 and forward to 14.
Fill some parts with code from TenFourFox when changes are not obvious.
Using gcc 7 from MacPorts, the gcc 4.8 TenFourFox used is too old.
Don't use GNU as on MacPPC it is too old.
Fix struct/class sizes by limiting bool size.
2023-11-23 01:42:11 -06:00
Moonchild 02e572c000 Issue #2361 - Enable Navigator.clipboard by default. 2023-11-19 16:22:59 +01:00
Gerald Squelart 3a092d3ae6 Bug 1332825 - Use move semantics in MozPromise::All() and AllPromiseHolder.
MozPromise::All sets up 'Then' lambdas on all sub-promises, each one
taking the resolve/reject object by value. Since this value will not be
used again in the lambda, it is safe to Move it, and from there
MozPromiseHolder::Resolve/Reject can also Move it again into the holder
storage, potentially saving two copies per Resolve/Reject. Also, once
all sub-promises have been resolved, the resolve-values can be Move'd
into the joining promise's Resolve function.
2023-11-19 16:19:11 +01:00
Moonchild 15d1f659a4 Issue #2249 - Stop advertising FIPS being a thing in the device manager.
If it can't be enabled, don't show the button at all
(don't just disable it)
2023-11-16 21:15:19 +01:00
Moonchild 272b8e43ac Issue #2361 - Remove clipboard-read code
Web content should never read the clipboard; extensions have other APIs
they can use through XPCOM so do not need to go through
Navigator.Clipboard, removing the only reason why it would even be here.
2023-11-16 01:34:40 +01:00
Moonchild 1ea0595e59 Issue #2361 - Base implementation of Navigator.Clipboard
This hard-refuses any reads from clipboard with a promise rejection.
2023-11-15 21:58:44 +01:00
Moonchild a14d588673 Merge pull request 'Remove MOZ_TREE_FREETYPE and freetype2 from tree.' (#2383) from athenian200/UXP:remove_tree_freetype into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2383
2023-11-15 14:10:20 +00:00
Moonchild fd81fe325f Merge pull request 'Switch to NSS mozpkix and update our cert signature handling' (#2384) from mozpkix-PSM-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2384
2023-11-15 14:05:14 +00:00
Moonchild baa57dd092 Merge branch 'master' of https://repo.palemoon.org/MoonchildProductions/UXP 2023-11-15 12:19:49 +01:00
Moonchild 465ae3c5e5 Revert "No Issue - add mutex in EventSource"
This reverts commit e4643f5bed.

Apparently causes deadlocks in Linux.
2023-11-15 12:19:13 +01:00
Moonchild fad42bb2d7 Revert "No Issue - add mutex in EventSource"
This reverts commit e4643f5bed.

Apparently causes deadlocks in Linux.
2023-11-15 11:34:15 +01:00
Jeremy Andrews d8bc8410b0 Issue #1312 - Switch to X-Mailer, and pull from AppInfo instead of HTTP headers.
I've been thinking about this issue, and ultimately it's just correcting a
mistake Mozilla made that no consumer of UXP's MailNews ever complained about
before, so I think it's reasonable to fix the default behavior first, and then
let others complain before I start worrying about prefs or ifdefs. One thing
at a time.
2023-11-14 23:47:34 -06:00
Moonchild 0b2e876d7d Issue #2366 - Part 5: Update mailnews core to use NSS mozpkix. 2023-11-14 17:49:28 +01:00
Moonchild 8f80ba860d Issue #2366 - Part 4: Remove old code in security/pkix 2023-11-14 17:43:13 +01:00
Moonchild cb509b2318 Issue #2366 - Part 3: Support RSA-PSS signatures on certificates 2023-11-14 17:36:42 +01:00
Moonchild c1e972f199 Issue #2366 - Part 2: PSM changes for pkix signature verification changes.
NSS 3.77 changed how mozilla::pkix verifies signatures.
This patch makes the corresponding changes in PSM.
2023-11-14 17:35:44 +01:00
Moonchild d8e44207ed Issue #2366 - Part 1: Switch PKIX handling over to NSS mozpkix 2023-11-14 17:28:39 +01:00
Jeremy Andrews acb1d52fe4 Issue #2382 - Move font-related stuff back to old-configure.
It's really easy to overlook configure options in moz.configure,
since most of what we work with is old-configure. Might as well move it
back in here so we can keep track more easily.
2023-11-13 20:59:54 -06:00
Jeremy Andrews 2fa3a6935e Issue #2382 - Remove remnants of MOZ_TREE_FREETYPE. 2023-11-13 20:59:44 -06:00
Jeremy Andrews 8d9c0d1209 Issue #2382 - Remove in-tree freetype2 library. 2023-11-13 20:59:33 -06:00
Jeremy Andrews 1d709ef0af Issue #2382 - Don't build dummy freetype2 library.
We don't actually build this, the build system just generates the
ghost of a static lib that pulls in OS libs. Someone made a mistake
at Mozilla years ago that they have not noticed to this day. They
only ever built freetype2 on Android, GTK always used the system FT2.
2023-11-13 20:59:17 -06:00
Moonchild f1f7466a72 No issue - Stop supporting data: scheme in SVG <use> elements. 2023-11-13 19:28:44 +01:00
Moonchild a36a691826 Merge pull request 'Use elfdump on SunOS instead of readelf.' (#2380) from athenian200/UXP:sunos-elfdump-fix into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2380
2023-11-13 11:46:33 +00:00
Moonchild 9816215ea7 Issue #2381 - Remove system-nspr/nss leftovers
Resolves #2381
2023-11-13 00:26:23 +01:00
Moonchild 294698153c Issue #1053 - Remove Android block in security/moz.build
Just ran across this, and thought I'd kick it off while there.
2023-11-13 00:02:06 +01:00
Moonchild db4ddc5f68 Merge pull request 'Replace MOZ_FALLTHROUGH with [[fallthrough]]' (#2379) from 2343-fallthrough-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2379
2023-11-12 20:30:17 +00:00
Moonchild 9c75c8235e Issue #2343 - Fix typo 2023-11-12 18:07:44 +01:00
Moonchild d854696ec9 Issue #2343 - Replace missed occurrences in .mm files 2023-11-12 17:59:41 +01:00
athenian200 98f59fb96c Issue #1824 - Use elfdump on SunOS instead of readelf.
GNU readelf isn't available as consistently as I assumed across SunOS,
and it can be named different things on different illumos distros (some call
it readelf, others call it greadelf, etc), so it's safer to use elfdump.
This is a fairly easy fix, just kind of annoying.
2023-11-11 10:39:42 -06:00
Moonchild 734f0957fb Issue #2343 - replace MOZ_FALLTHROUGH with [[fallthrough]]
Basically a S&R. Removed the macro and adjusts IDL codegen accordingly.
2023-11-11 14:27:03 +01:00
Moonchild c789882a29 Merge pull request 'Replace MOZ_MUST_USE with [[nodiscard]]' (#2375) from 2342-nodiscard-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2375
2023-11-11 01:55:07 +00:00
Moonchild f9ad625822 Issue #2342 - Fix attribute order in misc files (found by clang builds) 2023-11-10 23:34:34 +01:00
Moonchild c43a68113f Issue #2342 - Fix attribute order in nsIPipe.idl 2023-11-10 13:50:37 +01:00
Moonchild e869b44d0f Issue #2342 - Don't use [[nodiscard]] in C mode in mozalloc.
Since both gcc and clang support the internal __attribute__ form, and
this is guarded by HAVE_POSIX_MEMALIGN which is not a Windows thing,
it's safe to just use that attribute style unconditionally.
2023-11-10 10:53:47 +01:00
Moonchild 93eee35e84 Merge pull request 'Fix Linux and Oracle Solaris builds after recent changes.' (#2377) from dbsoft/UXP:sedfix-2376 into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2377
2023-11-09 12:54:20 +00:00
Moonchild ad134c48d6 Merge pull request 'Remove --enable-stdcxx-compat option.' (#2374) from athenian200/UXP:old-stdcxx-compat-cleanup into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2374
2023-11-09 12:52:52 +00:00
Moonchild e4643f5bed No Issue - add mutex in EventSource
Potentially avoids a gc crash when load is high.
2023-11-09 12:25:41 +01:00
Brian Smith bcc531f53b Issue #2281 - Follow-up: Don't include headers in extern "C".
In C++17 mode using GCC 13 on Linux this is causing C linkage
to be applied to the throw_gcc.h functions instead of C++.
2023-11-08 23:24:46 -06:00
Brian Smith 007b998b23 Issue #2376 - Split NSPR sed into BSD and GNU.
Mac and the BSDs use [^[:space:]].
Use GNU sed on other platforms with \S.
2023-11-08 19:20:13 -06:00
Moonchild 2637007c78 No Issue - Adjust configure to deal with FreeBSD regex breakage for \S 2023-11-08 15:34:07 +01:00
Moonchild 3dfad03649 Issue #2342: Remove MOZ_MUST_USE macro 2023-11-08 13:50:54 +01:00
Moonchild 190e7bd30a Issue #2342: Use [[nodiscard]] in /mfbt 2023-11-08 13:50:33 +01:00
Moonchild 292ece5fde Issue #2342: Use [[nodiscard]] in /xpcom and xpidl parser 2023-11-08 13:50:12 +01:00
Moonchild ccc8c3b988 Issue #2342: Use [[nodiscard]] in /uriloader /widget
Also a few misc low-volume places.
2023-11-08 13:49:51 +01:00
Moonchild d53992cc12 Issue #2342: Use [[nodiscard]] in /netwerk 2023-11-08 13:49:30 +01:00
Moonchild 6f7a751520 Issue #2342: Use [[nodiscard]] in /memory and remove Sun Studio hack 2023-11-08 13:49:08 +01:00
Moonchild 037fb1d123 Issue #2342: Use [[nodiscard]] in /media 2023-11-08 13:48:43 +01:00
Moonchild 706d07b3d5 Issue #2342: Use [[nodiscard]] in /js 2023-11-08 13:48:12 +01:00
Moonchild eb7be8c637 Issue #2342: Use [[nodiscard]] in IPDL generation and fix warnings
DOM plugin code had two warning in IPC caught by [[nodiscard]], these
were fixed in one go.
2023-11-08 13:47:43 +01:00
Moonchild 080c8cc134 Issue #2342: Use [[nodiscard]] in /ipc 2023-11-08 13:47:10 +01:00
Moonchild 8e81d25f5d Issue #2342: Use [[nodiscard]] in /hal /image and /intl 2023-11-08 13:46:01 +01:00
Moonchild 0cfefdfd42 Issue #2342: Use [[nodiscard]] in /accessible and /caps 2023-11-08 13:45:38 +01:00
Moonchild ad321f50d9 Issue #2342: Use [[nodiscard]] in /gfx and /layout 2023-11-08 13:45:15 +01:00
Moonchild cd8c5dae0c Issue #2342: Use [[nodiscard]] in /dom 2023-11-08 13:44:49 +01:00
Moonchild 7f99af4101 Merge pull request 'Switch our tree to building with c++17' (#2372) from 2281-c++17-buildwork into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2372
2023-11-08 12:33:50 +00:00
Moonchild e6f9b29951 Issue #2281 - Exclude throw wrapping on modern libcpp.
As discussed.
2023-11-07 19:54:01 +01:00
Moonchild 7181c37a39 Merge pull request 'Clean up GMP decryptor code' (#2368) from GMPdecryptor-cleanup into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2368
2023-11-07 01:40:09 +00:00
Jeremy Andrews 6e0ec4b5bc Issue #2373 - Remove all remaining traces of CHECK_STDCXX.
As far as I can tell, all this code is unused in our platform. GCC older than
7 didn't have the macro _GLIBC_RELEASE. As far as I can tell, using newer GCC
means you don't have to check for incompatible symbol versions in the build
system, not even if you are compiling with clang against GCC's libc.
2023-11-05 20:54:31 -06:00
Jeremy Andrews ab51260232 Issue #2373 - Remove obsolete GLIBCXX version checks.
These version checks were only used with --enable-stdcxx-compat,
which as far as I can tell no UXP application has ever relied on.
The only use case seems to have been building with clang against an
old version of GCC's libc that predates C++11, let alone C++17.
2023-11-05 20:54:20 -06:00
Jeremy Andrews 34cadf6068 Issue #2373 - Remove --enable-stdcxx-compat option. 2023-11-05 20:54:03 -06:00
Moonchild 087aa28bc7 Issue #2281 - Patch out google protobuf inheritance from std::iterator
Updating Iterators to be compatible with C++17

The std::iterator class is being deprecated on MSVC++,
and currently if the compilation flag /std:c++latest
is used a warning is issued in this regard if any
iterators use the class as a base class.

If an external source file being compiled includes
the repeated_field.h header, the iterator clases
RepeatedPtrIterator and RepeatedPtrOverPtrsIterator
trigger the warning.

This change solves the warning and should avoid it in
the future when the default is to remove the class.

See https://github.com/protocolbuffers/protobuf/commit/2949ebd842e25c1bcb8b63b377a454a0887ea5a2
2023-11-05 20:05:27 +01:00
Moonchild d0d212143a Merge pull request 'No Issue - Structured Clone Spec Compliance and Bugfix' (#2365) from Basilisk-Dev/UXP-contrib:master into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2365
2023-11-05 12:38:54 +00:00
Moonchild 05abfd8200 Issue #2281 - Remove the use of non-standard namespace std::tr1 in
Google's WebRTC gtest code
2023-11-05 13:17:15 +01:00
Moonchild a8a9d2cbd4 Issue #2281 - Force clobber
Without a clobber, mozconfigure doesn't properly pick up the /std:c++17
or -std=gnu++17 compiler switches needed to put them into C++17 mode.
2023-11-05 13:16:51 +01:00
Moonchild c87116b332 Issue #2281 - Add some deduction guides for class template arguments.
This is necessary if we want to start using Span() constructors
instead of the MakeSpan() kludge.
2023-11-05 13:16:39 +01:00
Moonchild e29ae4e08c Issue #2281 - Default to C++17 when building.
Configure the toolchain to default to C++17 language standard with
optional gnu extensions (if on GCC)
2023-11-05 13:16:24 +01:00
Moonchild 865d49bdc1 Issue #2281 - Avoid class-static constexpr in TypedArrayObject 2023-11-05 13:16:08 +01:00
Moonchild 9074b8d943 Issue #2281 - Build LZ4 as C instead of including it as C++. 2023-11-05 13:15:56 +01:00
Moonchild 01c37ba21f Issue #2281 - The 'register' storage class is no longer a thing in c++17 2023-11-05 13:15:39 +01:00
Moonchild b886cfadff Issue #2281 - Mark mozalloc new() as noexcept to aligh with what the VC
runtime expects.

Currently spams warnings but may actually error out if not fixed, or
result in undefined behaviour if mismatching signatures are treated as
redeclarations with different exception specifications.
2023-11-05 13:15:26 +01:00
Moonchild 73169b6863 Issue #2281 - Replace std::iterator inheritance with iterator traits
definitions (as required by C++17).
2023-11-05 13:15:08 +01:00
Moonchild 7a9e29d580 Merge pull request 'Various SunOS Fixes, rebased on current master.' (#2370) from athenian200/UXP:sunos_update_rebased into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2370
2023-11-04 21:48:02 +00:00
athenian200 98cb21f1bd Issue #1824 - Support SunOS Linker mapfiles.
Generating OS-appropriate mapfiles from a provided SYMBOL_FILE is
apparently required to work with newer ffvpx. Nothing else in our
codebase actually seemed to require it. Also seems to reduce the amount
of console spam I see relating to symbol visibility during the build
process, and I think it even makes libxul.so link a bit faster.

Signed-off-by: athenian200 <athenian200@outlook.com>
2023-11-04 13:36:18 -05:00
athenian200 8a11926150 Issue #1824 - Move to GCC 10.
It seems to work, but it is a lot slower than compiling with GCC 7.

Signed-off-by: athenian200 <athenian200@outlook.com>
2023-11-04 13:35:45 -05:00
Moonchild 6652764751 Issue #2346 - Remove now-unused DecryptorId 2023-11-03 21:50:37 +01:00
Moonchild d16bc65a16 Issue #2346 - Back-factor GetDecryptingGMPVideoDecoder to GetGMPVideoDecoder
The latter was still there as an alias for webRTC tests, making this
a bit simpler because the interface was still there.
2023-11-03 16:48:15 +01:00
Moonchild dc93e309e2 Issue #2346 - Cut out GMPDecryptor code 2023-11-03 16:26:01 +01:00
Basilisk-Dev fc1697622c No Issue - StructuredClone serialize and deserialize should treat back reference consistently
Backport of https://bugzilla.mozilla.org/show_bug.cgi?id=1538622
2023-10-30 15:38:40 -04:00
Basilisk-Dev ecb8ae6aba No issue - Structured clone algorithm doesn't serialize Array Length contrary to HTML spec, resulting in truncation of trailing sparse arrays like [1,2,3,,]
Backport of https://bugzilla.mozilla.org/show_bug.cgi?id=1476955
2023-10-30 15:36:44 -04:00
2899 changed files with 121909 additions and 779899 deletions

No files matched your search

+4
View File
@@ -7,6 +7,10 @@
* ROLE(geckoRole, stringRole, atkRole, macRole, msaaRole, ia2Role, nameRule)
*/
#ifndef NSAccessibilityCellRole
#define NSAccessibilityCellRole NSAccessibilityUnknownRole
#endif
ROLE(NOTHING,
"nothing",
ATK_ROLE_UNKNOWN,
+9 -1
View File
@@ -44,7 +44,9 @@
#ifdef XP_WIN
#include "mozilla/a11y/Compatibility.h"
#include "mozilla/dom/ContentChild.h"
#ifdef MOZ_ENABLE_NPAPI
#include "HTMLWin32ObjectAccessible.h"
#endif
#include "mozilla/StaticPtr.h"
#endif
@@ -55,7 +57,9 @@
#include "nsImageFrame.h"
#include "nsIObserverService.h"
#include "nsLayoutUtils.h"
#ifdef MOZ_ENABLE_NPAPI
#include "nsPluginFrame.h"
#endif
#include "nsSVGPathGeometryFrame.h"
#include "nsTreeBodyFrame.h"
#include "nsTreeColumns.h"
@@ -79,7 +83,7 @@
#include "XULTabAccessible.h"
#include "XULTreeGridAccessibleWrap.h"
#if defined(XP_WIN) || defined(MOZ_ACCESSIBILITY_ATK)
#if (defined(XP_WIN) || defined(MOZ_ACCESSIBILITY_ATK)) && defined(MOZ_ENABLE_NPAPI)
#include "nsNPAPIPluginInstance.h"
#endif
@@ -431,6 +435,7 @@ private:
NS_IMPL_ISUPPORTS(PluginTimerCallBack, nsITimerCallback)
#endif
#ifdef MOZ_ENABLE_NPAPI
already_AddRefed<Accessible>
nsAccessibilityService::CreatePluginAccessible(nsPluginFrame* aFrame,
nsIContent* aContent,
@@ -493,6 +498,7 @@ nsAccessibilityService::CreatePluginAccessible(nsPluginFrame* aFrame,
return nullptr;
}
#endif // MOZ_ENABLE_NPAPI
void
nsAccessibilityService::DeckPanelSwitched(nsIPresShell* aPresShell,
@@ -1638,11 +1644,13 @@ nsAccessibilityService::CreateAccessibleByFrameType(nsIFrame* aFrame,
case eOuterDocType:
newAcc = new OuterDocAccessible(aContent, document);
break;
#ifdef MOZ_ENABLE_NPAPI
case ePluginType: {
nsPluginFrame* pluginFrame = do_QueryFrame(aFrame);
newAcc = CreatePluginAccessible(pluginFrame, aContent, aContext);
break;
}
#endif
case eTextLeafType:
newAcc = new TextLeafAccessibleWrap(aContent, document);
break;
+4
View File
@@ -20,7 +20,9 @@
class nsImageFrame;
class nsIArray;
class nsIPersistentProperties;
#ifdef MOZ_ENABLE_NPAPI
class nsPluginFrame;
#endif
class nsITreeView;
namespace mozilla {
@@ -87,9 +89,11 @@ public:
Accessible* GetRootDocumentAccessible(nsIPresShell* aPresShell,
bool aCanCreate);
#ifdef MOZ_ENABLE_NPAPI
already_AddRefed<Accessible>
CreatePluginAccessible(nsPluginFrame* aFrame, nsIContent* aContent,
Accessible* aContext);
#endif
/**
* Adds/remove ATK root accessible for gtk+ native window to/from children
+2 -1
View File
@@ -486,13 +486,14 @@ DocAccessibleParent::SetCOMProxy(const RefPtr<IAccessible>& aCOMProxy)
IAccessibleHolder holder(Move(ptr));
Unused << SendParentCOMProxy(holder);
}
#ifdef MOZ_ENABLE_NPAPI
bool
DocAccessibleParent::RecvGetWindowedPluginIAccessible(
const WindowsHandle& aHwnd, IAccessibleHolder* aPluginCOMProxy)
{
return false;
}
#endif
#endif // defined(XP_WIN)
+3 -2
View File
@@ -143,10 +143,11 @@ public:
#if defined(XP_WIN)
void SetCOMProxy(const RefPtr<IAccessible>& aCOMProxy);
#ifdef MOZ_ENABLE_NPAPI
virtual bool RecvGetWindowedPluginIAccessible(
const WindowsHandle& aHwnd, IAccessibleHolder* aPluginCOMProxy) override;
#endif
#endif // MOZ_ENABLE_NPAPI
#endif // XP_WIN
private:
+2
View File
@@ -61,8 +61,10 @@ parent:
*/
async BindChildDoc(PDocAccessible aChildDoc, uint64_t aID);
#ifdef MOZ_ENABLE_NPAPI
sync GetWindowedPluginIAccessible(WindowsHandle aHwnd)
returns (IAccessibleHolder aPluginCOMProxy);
#endif
child:
async ParentCOMProxy(IAccessibleHolder aParentCOMProxy);
+1 -1
View File
@@ -8,7 +8,7 @@ if CONFIG['COMPILE_ENVIRONMENT']:
# With --disable-accessibility, we need to compile PDocAccessible.ipdl (which
# also depends on COMPtrTypes.h), but not the C++.
IPDL_SOURCES += ['PDocAccessible.ipdl']
PREPROCESSED_IPDL_SOURCES += ['PDocAccessible.ipdl']
EXPORTS.mozilla.a11y += ['COMPtrTypes.h']
if CONFIG['ACCESSIBILITY']:
+2
View File
@@ -295,6 +295,7 @@ enum CheckboxValue {
@implementation mozPaneAccessible
#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
- (NSUInteger)accessibilityArrayAttributeCount:(NSString*)attribute
{
AccessibleWrap* accWrap = [self getGeckoAccessible];
@@ -313,6 +314,7 @@ enum CheckboxValue {
return [super accessibilityArrayAttributeCount:attribute];
}
#endif
- (NSArray*)children
{
+34 -4
View File
@@ -47,6 +47,24 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
return nativeArray;
}
// Convert to an object without @ syntax
static inline id
ConvertToId(NSInteger val)
{
return [NSString stringWithFormat:@"%i", val];
}
// Missing from SDK 10.5
#if !defined(MAC_OS_X_VERSION_10_6) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6)
#define __IntToNSString(x) ([NSString stringWithFormat:@"%i", x])
#define NSAccessibilityRowIndexRangeAttribute @"AXRowIndexRange"
#define NSAccessibilityColumnIndexRangeAttribute @"AXColumnIndexRange"
#define NSAccessibilityRowHeaderUIElementsAttribute @"AXRowHeaderUIElements"
#define NSAccessibilityColumnHeaderUIElementsAttribute @"AXColumnHeaderUIElements"
#define NSAccessibilityRowCountAttribute @"AXRowCount"
#define NSAccessibilityColumnCountAttribute @"AXColumnCount"
#endif
@implementation mozTablePartAccessible
- (BOOL)isLayoutTablePart;
{
@@ -83,10 +101,14 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
NSArray* additionalAttributes = [super additionalAccessibilityAttributeNames];
if ([self isLayoutTablePart]) {
return additionalAttributes;
}
#else
NSArray* additionalAttributes = [[NSArray alloc] init];
#endif
static NSArray* tableAttrs = nil;
if (!tableAttrs) {
@@ -108,9 +130,9 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
if (AccessibleWrap* accWrap = [self getGeckoAccessible]) {
TableAccessible* table = accWrap->AsTable();
if ([attribute isEqualToString:NSAccessibilityRowCountAttribute])
return @(table->RowCount());
return ConvertToId(table->RowCount());
if ([attribute isEqualToString:NSAccessibilityColumnCountAttribute])
return @(table->ColCount());
return ConvertToId(table->ColCount());
if ([attribute isEqualToString:NSAccessibilityRowsAttribute]) {
// Create a new array with the list of table rows.
NSMutableArray* nativeArray = [[NSMutableArray alloc] init];
@@ -127,9 +149,9 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
}
} else if (ProxyAccessible* proxy = [self getProxyAccessible]) {
if ([attribute isEqualToString:NSAccessibilityRowCountAttribute])
return @(proxy->TableRowCount());
return ConvertToId(proxy->TableRowCount());
if ([attribute isEqualToString:NSAccessibilityColumnCountAttribute])
return @(proxy->TableColumnCount());
return ConvertToId(proxy->TableColumnCount());
if ([attribute isEqualToString:NSAccessibilityRowsAttribute]) {
// Create a new array with the list of table rows.
NSMutableArray* nativeArray = [[NSMutableArray alloc] init];
@@ -155,10 +177,14 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
NSArray* additionalAttributes = [super additionalAccessibilityAttributeNames];
if ([self isLayoutTablePart]) {
return additionalAttributes;
}
#else
NSArray* additionalAttributes = [[NSArray alloc] init];
#endif
static NSArray* tableRowAttrs = nil;
if (!tableRowAttrs) {
@@ -214,10 +240,14 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
#if defined(MAC_OS_X_VERSION_10_6) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
NSArray* additionalAttributes = [super additionalAccessibilityAttributeNames];
if ([self isLayoutTablePart]) {
return additionalAttributes;
}
#else
NSArray* additionalAttributes = [[NSArray alloc] init];
#endif
static NSArray* tableCellAttrs = nil;
if (!tableCellAttrs) {
+7
View File
@@ -38,6 +38,13 @@ SOURCES += [
'XULTreeGridAccessibleWrap.cpp',
]
if CONFIG['MOZ_ENABLE_NPAPI']:
SOURCES += [
'HTMLWin32ObjectAccessible.cpp',
]
LOCAL_INCLUDES += [
'/accessible/base',
'/accessible/generic',
File diff suppressed because it is too large. Load diff
+80
View File
@@ -0,0 +1,80 @@
dnl Map old names of Autoconf macros to new regularized names.
dnl This file is part of Autoconf.
dnl Copyright (C) 1994 Free Software Foundation, Inc.
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2, or (at your option)
dnl any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
dnl 02111-1307, USA.
dnl
dnl General macros.
dnl
define(AC_WARN, [indir([AC_MSG_WARN], $@)])dnl
define(AC_ERROR, [indir([AC_MSG_ERROR], $@)])dnl
AC_DEFUN(AC_PROGRAM_CHECK, [indir([AC_CHECK_PROG], $@)])dnl
AC_DEFUN(AC_PROGRAM_PATH, [indir([AC_PATH_PROG], $@)])dnl
AC_DEFUN(AC_PROGRAMS_CHECK, [indir([AC_CHECK_PROGS], $@)])dnl
AC_DEFUN(AC_PROGRAMS_PATH, [indir([AC_PATH_PROGS], $@)])dnl
AC_DEFUN(AC_PREFIX, [indir([AC_PREFIX_PROGRAM], $@)])dnl
AC_DEFUN(AC_HEADER_EGREP, [indir([AC_EGREP_HEADER], $@)])dnl
AC_DEFUN(AC_PROGRAM_EGREP, [indir([AC_EGREP_CPP], $@)])dnl
AC_DEFUN(AC_TEST_PROGRAM, [indir([AC_TRY_RUN], $@)])dnl
AC_DEFUN(AC_TEST_CPP, [indir([AC_TRY_CPP], $@)])dnl
AC_DEFUN(AC_HEADER_CHECK, [indir([AC_CHECK_HEADER], $@)])dnl
AC_DEFUN(AC_FUNC_CHECK, [indir([AC_CHECK_FUNC], $@)])dnl
AC_DEFUN(AC_HAVE_FUNCS, [indir([AC_CHECK_FUNCS], $@)])dnl
AC_DEFUN(AC_HAVE_HEADERS, [indir([AC_CHECK_HEADERS], $@)])dnl
AC_DEFUN(AC_SIZEOF_TYPE, [indir([AC_CHECK_SIZEOF], $@)])dnl
dnl
dnl Specific macros.
dnl
AC_DEFUN(AC_GCC_TRADITIONAL, [indir([AC_PROG_GCC_TRADITIONAL])])dnl
AC_DEFUN(AC_MINUS_C_MINUS_O, [indir([AC_PROG_CC_C_O])])dnl
AC_DEFUN(AC_SET_MAKE, [indir([AC_PROG_MAKE_SET])])dnl
AC_DEFUN(AC_YYTEXT_POINTER, [indir([AC_DECL_YYTEXT])])dnl
AC_DEFUN(AC_LN_S, [indir([AC_PROG_LN_S])])dnl
AC_DEFUN(AC_STDC_HEADERS, [indir([AC_HEADER_STDC])])dnl
AC_DEFUN(AC_MAJOR_HEADER, [indir([AC_HEADER_MAJOR])])dnl
AC_DEFUN(AC_STAT_MACROS_BROKEN, [indir([AC_HEADER_STAT])])dnl
AC_DEFUN(AC_SYS_SIGLIST_DECLARED, [indir([AC_DECL_SYS_SIGLIST])])dnl
AC_DEFUN(AC_GETGROUPS_T, [indir([AC_TYPE_GETGROUPS])])dnl
AC_DEFUN(AC_UID_T, [indir([AC_TYPE_UID_T])])dnl
AC_DEFUN(AC_SIZE_T, [indir([AC_TYPE_SIZE_T])])dnl
AC_DEFUN(AC_PID_T, [indir([AC_TYPE_PID_T])])dnl
AC_DEFUN(AC_OFF_T, [indir([AC_TYPE_OFF_T])])dnl
AC_DEFUN(AC_MODE_T, [indir([AC_TYPE_MODE_T])])dnl
AC_DEFUN(AC_RETSIGTYPE, [indir([AC_TYPE_SIGNAL])])dnl
AC_DEFUN(AC_MMAP, [indir([AC_FUNC_MMAP])])dnl
AC_DEFUN(AC_VPRINTF, [indir([AC_FUNC_VPRINTF])])dnl
AC_DEFUN(AC_VFORK, [indir([AC_FUNC_VFORK])])dnl
AC_DEFUN(AC_WAIT3, [indir([AC_FUNC_WAIT3])])dnl
AC_DEFUN(AC_ALLOCA, [indir([AC_FUNC_ALLOCA])])dnl
AC_DEFUN(AC_GETLOADAVG, [indir([AC_FUNC_GETLOADAVG])])dnl
AC_DEFUN(AC_UTIME_NULL, [indir([AC_FUNC_UTIME_NULL])])dnl
AC_DEFUN(AC_STRCOLL, [indir([AC_FUNC_STRCOLL])])dnl
AC_DEFUN(AC_SETVBUF_REVERSED, [indir([AC_FUNC_SETVBUF_REVERSED])])dnl
AC_DEFUN(AC_TIME_WITH_SYS_TIME, [indir([AC_HEADER_TIME])])dnl
AC_DEFUN(AC_TIMEZONE, [indir([AC_STRUCT_TIMEZONE])])dnl
AC_DEFUN(AC_ST_BLOCKS, [indir([AC_STRUCT_ST_BLOCKS])])dnl
AC_DEFUN(AC_ST_BLKSIZE, [indir([AC_STRUCT_ST_BLKSIZE])])dnl
AC_DEFUN(AC_ST_RDEV, [indir([AC_STRUCT_ST_RDEV])])dnl
AC_DEFUN(AC_CROSS_CHECK, [indir([AC_C_CROSS])])dnl
AC_DEFUN(AC_CHAR_UNSIGNED, [indir([AC_C_CHAR_UNSIGNED])])dnl
AC_DEFUN(AC_LONG_DOUBLE, [indir([AC_C_LONG_DOUBLE])])dnl
AC_DEFUN(AC_WORDS_BIGENDIAN, [indir([AC_C_BIGENDIAN])])dnl
AC_DEFUN(AC_INLINE, [indir([AC_C_INLINE])])dnl
AC_DEFUN(AC_CONST, [indir([AC_C_CONST])])dnl
AC_DEFUN(AC_LONG_FILE_NAMES, [indir([AC_SYS_LONG_FILE_NAMES])])dnl
AC_DEFUN(AC_RESTARTABLE_SYSCALLS, [indir([AC_SYS_RESTARTABLE_SYSCALLS])])dnl
AC_DEFUN(AC_FIND_X, [indir([AC_PATH_X])])dnl
AC_DEFUN(AC_FIND_XTRA, [indir([AC_PATH_XTRA])])dnl
File diff suppressed because it is too large. Load diff
+28
View File
@@ -0,0 +1,28 @@
dnl Driver that loads the Autoconf macro files.
dnl Requires GNU m4.
dnl This file is part of Autoconf.
dnl Copyright (C) 1994 Free Software Foundation, Inc.
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2, or (at your option)
dnl any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
dnl 02111-1307, USA.
dnl
dnl Written by David MacKenzie.
dnl
include(acgeneral.m4)dnl
builtin(include, acspecific.m4)dnl
builtin(include, acoldnames.m4)dnl
dnl Do not sinclude acsite.m4 here, because it may not be installed
dnl yet when Autoconf is frozen.
dnl Do not sinclude ./aclocal.m4 here, to prevent it from being frozen.
+159
View File
@@ -0,0 +1,159 @@
#! @SHELL@
# autoconf -- create `configure' using m4 macros
# Copyright (C) 1992, 1993, 1994, 1996 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# If given no args, create `configure' from template file `configure.in'.
# With one arg, create a configure script on standard output from
# the given template file.
usage="\
Usage: autoconf [-h] [--help] [-m dir] [--macrodir=dir]
[-l dir] [--localdir=dir] [--version] [template-file]"
# NLS nuisances.
# Only set these to C if already set. These must not be set unconditionally
# because not all systems understand e.g. LANG=C (notably SCO).
# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
# Non-C LC_CTYPE values break the ctype check.
if test "${LANG+set}" = set; then LANG=C; export LANG; fi
if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
: ${AC_MACRODIR=@datadir@}
: ${M4=@M4@}
: ${AWK=@AWK@}
case "${M4}" in
/*) # Handle the case that m4 has moved since we were configured.
# It may have been found originally in a build directory.
test -f "${M4}" || M4=m4 ;;
esac
: ${TMPDIR=/tmp}
tmpout=${TMPDIR}/acout.$$
localdir=
show_version=no
while test $# -gt 0 ; do
case "${1}" in
-h | --help | --h* )
echo "${usage}" 1>&2; exit 0 ;;
--localdir=* | --l*=* )
localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
shift ;;
-l | --localdir | --l*)
shift
test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
localdir="${1}"
shift ;;
--macrodir=* | --m*=* )
AC_MACRODIR="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
shift ;;
-m | --macrodir | --m* )
shift
test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
AC_MACRODIR="${1}"
shift ;;
--version | --v* )
show_version=yes; shift ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "${usage}" 1>&2; exit 1 ;;
* )
break ;;
esac
done
if test $show_version = yes; then
version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \
$AC_MACRODIR/acgeneral.m4`
echo "Autoconf version $version"
exit 0
fi
case $# in
0) infile=configure.in ;;
1) infile="$1" ;;
*) echo "$usage" >&2; exit 1 ;;
esac
trap 'rm -f $tmpin $tmpout; exit 1' 1 2 15
tmpin=${TMPDIR}/acin.$$ # Always set this, to avoid bogus errors from some rm's.
if test z$infile = z-; then
infile=$tmpin
cat > $infile
elif test ! -r "$infile"; then
echo "autoconf: ${infile}: No such file or directory" >&2
exit 1
fi
if test -n "$localdir"; then
use_localdir="-I$localdir -DAC_LOCALDIR=$localdir"
else
use_localdir=
fi
# Use the frozen version of Autoconf if available.
r= f=
# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
case `$M4 --help < /dev/null 2>&1` in
*reload-state*) test -r $AC_MACRODIR/autoconf.m4f && { r=--reload f=f; } ;;
*traditional*) ;;
*) echo Autoconf requires GNU m4 1.1 or later >&2; rm -f $tmpin; exit 1 ;;
esac
$M4 -I$AC_MACRODIR $use_localdir $r autoconf.m4$f $infile > $tmpout ||
{ rm -f $tmpin $tmpout; exit 2; }
# You could add your own prefixes to pattern if you wanted to check for
# them too, e.g. pattern='\(AC_\|ILT_\)', except that UNIX sed doesn't do
# alternation.
pattern="AC_"
status=0
if grep "^[^#]*${pattern}" $tmpout > /dev/null 2>&1; then
echo "autoconf: Undefined macros:" >&2
sed -n "s/^[^#]*\\(${pattern}[_A-Za-z0-9]*\\).*/\\1/p" $tmpout |
while read macro; do
grep -n "^[^#]*$macro" $infile /dev/null
test $? -eq 1 && echo >&2 "***BUG in Autoconf--please report*** $macro"
done | sort -u >&2
status=1
fi
if test $# -eq 0; then
exec 4> configure; chmod +x configure
else
exec 4>&1
fi
# Put the real line numbers into configure to make config.log more helpful.
$AWK '
/__oline__/ { printf "%d:", NR + 1 }
{ print }
' $tmpout | sed '
/__oline__/s/^\([0-9][0-9]*\):\(.*\)__oline__/\2\1/
' >&4
rm -f $tmpout
exit $status
+9 -7
View File
@@ -179,10 +179,12 @@ if test "$GNU_CC"; then
CFLAGS="$CFLAGS -fno-math-errno -pipe"
CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-math-errno -pipe"
if test "$CPU_ARCH" = "x86" -o "$CPU_ARCH" = "x86_64"; then
CFLAGS="$CFLAGS -msse2 -mfpmath=sse"
CXXFLAGS="$CXXFLAGS -msse2 -mfpmath=sse"
fi
case "${host_cpu}" in
i*86)
CFLAGS="$CFLAGS -msse2 -mfpmath=sse"
CXXFLAGS="$CXXFLAGS -msse2 -mfpmath=sse"
;;
esac
if test -z "$CLANG_CC"; then
case "$CC_VERSION" in
@@ -190,9 +192,9 @@ if test "$GNU_CC"; then
AC_MSG_ERROR([Unsupported GCC version.])
;;
*)
# Lifetime Dead Store Elimination level 2 (default in GCC6+) breaks Gecko.
# Instead of completely disabling this optimization on newer GCC's,
# we'll force them to use level 1 optimization with -flifetime-dse=1.
# Lifetime Dead Store Elimination level 2 (default in GCC) breaks Goanna.
# Instead of completely disabling this optimization, we force level 1
# optimization instead with -flifetime-dse=1.
# Add it first so that a mozconfig can override by setting CFLAGS/CXXFLAGS.
CFLAGS="-flifetime-dse=1 $CFLAGS"
CXXFLAGS="-flifetime-dse=1 $CXXFLAGS"
+2 -3
View File
@@ -28,9 +28,7 @@ if test -n "$USE_ICU"; then
fi
MOZ_ICU_VERSION="$version"
# TODO: the l is actually endian-dependent
# We could make this set as 'l' or 'b' for little or big, respectively,
# but we'd need to check in a big-endian version of the file.
ICU_DATA_FILE_BIG="icudt${version}b.dat"
ICU_DATA_FILE="icudt${version}l.dat"
dnl We won't build ICU data as a separate file when building
@@ -46,6 +44,7 @@ fi
AC_SUBST(MOZ_ICU_VERSION)
AC_SUBST(USE_ICU)
AC_SUBST(ICU_DATA_FILE_BIG)
AC_SUBST(ICU_DATA_FILE)
AC_SUBST(MOZ_ICU_DATA_ARCHIVE)
AC_SUBST(MOZ_SHARED_ICU)
-7
View File
@@ -33,10 +33,3 @@ endif
# correctly. Note that the binary produced here is a host tool and doesn't need
# to be distributed.
MACOSX_DEPLOYMENT_TARGET :=
# Temporarily relax the requirements for libstdc++ symbol versions on static
# analysis plugin in order to use a recent clang by accepting libstdc++ from
# gcc 4.4.0 (GLIBCXX_3.4.11).
ifdef CHECK_STDCXX
CHECK_STDCXX = $(call CHECK_SYMBOLS,$(1),GLIBCXX,libstdc++,v[1] > 3 || (v[1] == 3 && v[2] == 4 && v[3] > 11))
endif
+12 -2
View File
@@ -499,6 +499,14 @@ set_config('INTEL_ARCHITECTURE', delayed_getattr(target_variables,
'INTEL_ARCHITECTURE'))
set_config('TARGET_CPU', delayed_getattr(target, 'raw_cpu'))
set_config('TARGET_OS', delayed_getattr(target, 'raw_os'))
set_config('TARGET_ENDIANNESS', delayed_getattr(target, 'endianness'))
@depends(target)
def target_is_big_endian(target):
if target.endianness == 'big':
return True
set_define('TARGET_ENDIAN_BIG', target_is_big_endian)
@depends(host)
@@ -591,7 +599,9 @@ imply_option('--enable-project', application)
@depends(check_build_environment, '--help')
def default_project(build_env, help):
return 'js'
if build_env.topobjdir.endswith('/js/src'):
return 'js'
return 'xulrunner'
option('--enable-project', nargs=1, default=default_project,
help='Project to build')
@@ -638,7 +648,7 @@ def build_project(noncomm_build, project, external_source_dir, build_env, help):
build_app = project[0]
if not external_source_dir and build_app not in ('js'):
if not external_source_dir and build_app not in ('xulrunner', 'js'):
if noncomm_build:
log.info("=====WARNING WARNING WARNING=====")
log.info("UNSUPPORTED NONCOMM-BUILD: Application code SHOULD NOT be put inside the platform tree, and doing so may have unforseen consequences if/when platform code is changed.")
+26 -55
View File
@@ -10,66 +10,28 @@ def encoded_open(path, mode):
return codecs.open(path, mode, encoding)
option(env='AUTOCONF', nargs=1, help='Path to autoconf 2.13')
m4 = check_prog(
"M4",
(
"gm4",
"m4",
),
)
@depends(mozconfig, 'AUTOCONF')
@checking('for autoconf')
@imports(_from='os.path', _import='exists')
@imports('re')
def autoconf(mozconfig, autoconf):
mozconfig_autoconf = None
if mozconfig['path']:
make_extra = mozconfig['make_extra']
if make_extra:
for assignment in make_extra:
m = re.match('(?:export\s+)?AUTOCONF\s*:?=\s*(.+)$',
assignment)
if m:
mozconfig_autoconf = m.group(1)
autoconf = autoconf[0] if autoconf else None
for ac in (mozconfig_autoconf, autoconf, 'autoconf-2.13', 'autoconf2.13',
'autoconf213'):
if ac:
autoconf = find_program(ac)
if autoconf:
break
else:
fink = find_program('fink')
if fink:
autoconf = os.path.normpath(os.path.join(
fink, '..', '..', 'lib', 'autoconf2.13', 'bin', 'autoconf'))
else:
brew = find_program('brew')
if brew:
autoconf = os.path.normpath(os.path.join(
brew, '..', '..', 'Cellar', 'autoconf213', '2.13', 'bin',
'autoconf213'))
if not autoconf:
die('Could not find autoconf 2.13')
if not exists(autoconf):
die('Could not find autoconf 2.13 at %s', autoconf)
return autoconf
set_config('AUTOCONF', autoconf)
@depends('OLD_CONFIGURE', mozconfig, autoconf, check_build_environment, shell,
@depends('OLD_CONFIGURE', mozconfig, awk, m4, check_build_environment, shell,
old_configure_assignments, build_project)
@imports(_from='__builtin__', _import='open')
@imports(_from='__builtin__', _import='print')
@imports('glob')
@imports('sys')
@imports('itertools')
@imports('subprocess')
# Import getmtime without overwriting the sandbox os.path.
@imports(_from='os.path', _import='getmtime')
@imports(_from='os.path', _import='exists')
@imports(_from='mozbuild.shellutil', _import='quote')
def prepare_configure(old_configure, mozconfig, autoconf, build_env, shell,
@imports(_from='os', _import='environ')
def prepare_configure(old_configure, mozconfig, awk, m4, build_env, shell,
old_configure_assignments, build_project):
# os.path.abspath in the sandbox will ensure forward slashes on Windows,
# which is actually necessary because this path actually ends up literally
@@ -98,11 +60,22 @@ def prepare_configure(old_configure, mozconfig, autoconf, build_env, shell,
refresh = False
if refresh:
autoconf = os.path.join(build_env.topsrcdir, 'build', 'autoconf', 'autoconf.sh')
log.info('Refreshing %s with %s', old_configure, autoconf)
env = dict(environ)
env['M4'] = m4
env['AWK'] = awk
env['AC_MACRODIR'] = os.path.join(build_env.topsrcdir, 'build', 'autoconf')
my_env = env
# Handle Python 2.7 not allowing unicode in the environment on Windows
if sys.platform == 'win32':
my_env = dict()
for e in env:
my_env[e.encode('ascii','ignore')] = env[e].encode('ascii','ignore')
script = subprocess.check_output([
shell, autoconf,
'--localdir=%s' % os.path.dirname(old_configure),
old_configure + '.in'])
old_configure + '.in'], env=my_env)
# Make old-configure append to config.log, where we put our own log.
# This could be done with a m4 macro, but it's way easier this way
@@ -127,10 +100,6 @@ def prepare_configure(old_configure, mozconfig, autoconf, build_env, shell,
for key in mozconfig[t]['removed'].keys():
inject("unset %s" % key)
# Autoconf is special, because it might be passed from
# mozconfig['make_extra'], which we don't pass automatically above.
inject('export AUTOCONF=%s' % quote(autoconf))
for assignment in old_configure_assignments:
inject(assignment)
@@ -207,6 +176,7 @@ def old_configure_options(*options):
'--enable-necko-wifi',
'--enable-negotiateauth',
'--enable-nfc',
'--enable-npapi',
'--enable-nspr-build',
'--enable-official-branding',
'--enable-official-vendor',
@@ -235,7 +205,6 @@ def old_configure_options(*options):
'--enable-small-chunk-size',
'--enable-startup-notification',
'--enable-startupcache',
'--enable-stdcxx-compat',
'--enable-strip',
'--enable-synth-pico',
'--enable-system-cairo',
@@ -299,6 +268,7 @@ def old_configure_options(*options):
'--with-thumb-interwork',
'--with-unify-dist',
'--with-user-appdir',
'--with-xulrunner-stub-name',
'--x-includes',
'--x-libraries',
@@ -311,6 +281,7 @@ def old_configure_options(*options):
'--enable-incomplete-external-linkage',
'--enable-mailnews',
'--enable-mailnews-oauth2',
'--enable-classic-account-wizard',
# Below are configure flags used by Pale Moon
'--disable-browser-statusbar',
-21
View File
@@ -8,9 +8,6 @@ def Binary():
'''Generic template for target binaries. Meant to be used by other
templates.'''
if CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION']:
USE_LIBS += ['stdc++compat']
# Ideally, we'd support not adding this to the LIB_IS_C_ONLY case,
# but that variable is actually only set in db/sqlite/src, which
# doesn't build a shared library on the relevant platforms anyways.
@@ -77,27 +74,11 @@ def Framework(name):
IS_FRAMEWORK = True
@template
def HostStdCppCompat():
'''Template for libstdc++ compatibility for host binaries.'''
if CONFIG['MOZ_LIBSTDCXX_HOST_VERSION']:
HOST_USE_LIBS += ['host_stdc++compat']
@template
def HostProgram(name, c_only=False):
'''Template for build tools executables.'''
HOST_PROGRAM = name
# With context-based templates, this won't be needed anymore, and will
# work better than relying on the caller setting it, but at the moment,
# this is the best we have. And it doesn't matter /that/ much, so there's
# really only one place using this, where it does matter to avoid the
# extra dependency (because it creates a circular one).
if not c_only:
HostStdCppCompat()
@template
def HostSimplePrograms(names, ext='.cpp'):
@@ -109,8 +90,6 @@ def HostSimplePrograms(names, ext='.cpp'):
HOST_SOURCES += ['%s%s' % (name.replace('host_', ''), ext)
for name in names]
HostStdCppCompat()
@template
def HostLibrary(name):
-3
View File
@@ -3,9 +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/.
if CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION'] or CONFIG['MOZ_LIBSTDCXX_HOST_VERSION']:
DIRS += ['stdc++compat']
if CONFIG['USE_ELF_HACK']:
DIRS += ['elfhack']
-15
View File
@@ -1,15 +0,0 @@
# Avoid dependency on libstdc++ 4.7
ac_add_options --enable-stdcxx-compat
TOOLTOOL_DIR=${TOOLTOOL_DIR:-$topsrcdir}
if [ -f "$TOOLTOOL_DIR/clang/lib/libstdc++.so" ]; then
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$TOOLTOOL_DIR/clang/lib
elif [ -f "$TOOLTOOL_DIR/gcc/lib/libstdc++.so" ]; then
# We put both 32-bits and 64-bits library path in LD_LIBRARY_PATH: ld.so
# will prefer the files in the 32-bits path when loading 32-bits executables,
# and the files in the 64-bits path when loading 64-bits executables.
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$TOOLTOOL_DIR/gcc/lib64:$TOOLTOOL_DIR/gcc/lib
fi
mk_add_options "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
-2
View File
@@ -30,5 +30,3 @@ ac_add_options --enable-pie
ac_add_options --disable-install-strip
# -gline-tables-only results in significantly smaller binaries.
ac_add_options --enable-debug-symbols="-gline-tables-only"
. "$topsrcdir/build/unix/mozconfig.stdcxx"
-7
View File
@@ -1,7 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
ENABLE_CLANG_PLUGIN :=
include $(topsrcdir)/config/rules.mk
-23
View File
@@ -1,23 +0,0 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
if CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION']:
Library('stdc++compat')
SOURCES += ['stdc++compat.cpp']
if CONFIG['MOZ_LIBSTDCXX_HOST_VERSION']:
HostLibrary('host_stdc++compat')
HOST_SOURCES += [
'stdc++compat.cpp',
]
FORCE_STATIC_LIB = True
NO_PGO = True
DISABLE_STL_WRAPPING = True
DEFINES['MOZ_LIBSTDCXX_VERSION'] = CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION']
HOST_DEFINES['MOZ_LIBSTDCXX_VERSION'] = CONFIG['MOZ_LIBSTDCXX_HOST_VERSION']
-78
View File
@@ -1,78 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <ostream>
#include <istream>
#include <string>
#include <stdarg.h>
#include <stdio.h>
#include <mozilla/Assertions.h>
/* GLIBCXX_3.4.8 is from gcc 4.1.1 (111691)
GLIBCXX_3.4.9 is from gcc 4.2.0 (111690)
GLIBCXX_3.4.10 is from gcc 4.3.0 (126287)
GLIBCXX_3.4.11 is from gcc 4.4.0 (133006)
GLIBCXX_3.4.12 is from gcc 4.4.1 (147138)
GLIBCXX_3.4.13 is from gcc 4.4.2 (151127)
GLIBCXX_3.4.14 is from gcc 4.5.0 (151126)
GLIBCXX_3.4.15 is from gcc 4.6.0 (160071)
GLIBCXX_3.4.16 is from gcc 4.6.1 (172240)
GLIBCXX_3.4.17 is from gcc 4.7.0 (174383)
GLIBCXX_3.4.18 is from gcc 4.8.0 (190787)
GLIBCXX_3.4.19 is from gcc 4.8.1 (199309)
GLIBCXX_3.4.20 is from gcc 4.9.0 (199307)
GLIBCXX_3.4.21 is from gcc 5.0 (210290)
This file adds the necessary compatibility tricks to avoid symbols with
version GLIBCXX_3.4.16 and bigger, keeping binary compatibility with
libstdc++ 4.6.1.
*/
#define GLIBCXX_VERSION(a, b, c) (((a) << 16) | ((b) << 8) | (c))
#if MOZ_LIBSTDCXX_VERSION >= GLIBCXX_VERSION(3, 4, 20)
namespace std {
/* We shouldn't be throwing exceptions at all, but it sadly turns out
we call STL (inline) functions that do. */
void __throw_out_of_range_fmt(char const* fmt, ...)
{
va_list ap;
char buf[1024]; // That should be big enough.
va_start(ap, fmt);
vsnprintf(buf, sizeof(buf), fmt, ap);
buf[sizeof(buf) - 1] = 0;
va_end(ap);
__throw_range_error(buf);
}
}
#endif
#if MOZ_LIBSTDCXX_VERSION >= GLIBCXX_VERSION(3, 4, 20)
/* Technically, this symbol is not in GLIBCXX_3.4.20, but in CXXABI_1.3.8,
but that's equivalent, version-wise. Those calls are added by the compiler
itself on `new Class[n]` calls. */
extern "C" void
__cxa_throw_bad_array_new_length()
{
MOZ_CRASH();
}
#endif
#if MOZ_LIBSTDCXX_VERSION >= GLIBCXX_VERSION(3, 4, 21)
/* While we generally don't build with exceptions, we have some host tools
* that do use them. libstdc++ from GCC 5.0 added exception constructors with
* char const* argument. Older versions only have a constructor with
* std::string. */
namespace std {
runtime_error::runtime_error(char const* s)
: runtime_error(std::string(s))
{
}
}
#endif
+18 -5
View File
@@ -535,7 +535,8 @@ NS_IMPL_ISUPPORTS(nsScriptSecurityManager,
///////////////// Security Checks /////////////////
bool
nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx)
nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx,
JS::HandleValue aValue)
{
MOZ_ASSERT(cx == nsContentUtils::GetCurrentJSContext());
nsCOMPtr<nsIPrincipal> subjectPrincipal = nsContentUtils::SubjectPrincipal();
@@ -558,12 +559,23 @@ nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx)
}
if (reportViolation) {
nsAutoString fileName;
unsigned lineNum = 0;
NS_NAMED_LITERAL_STRING(scriptSample, "call to eval() or related function blocked by CSP");
JS::Rooted<JSString*> jsString(cx, JS::ToString(cx, aValue));
if (NS_WARN_IF(!jsString)) {
JS_ClearPendingException(cx);
return false;
}
nsAutoJSString scriptSample;
if (NS_WARN_IF(!scriptSample.init(cx, jsString))) {
JS_ClearPendingException(cx);
return false;
}
JS::AutoFilename scriptFilename;
if (JS::DescribeScriptedCaller(cx, &scriptFilename, &lineNum)) {
nsAutoString fileName;
unsigned lineNum = 0;
unsigned columnNum = 0;
if (JS::DescribeScriptedCaller(cx, &scriptFilename, &lineNum, &columnNum)) {
if (const char *file = scriptFilename.get()) {
CopyUTF8toUTF16(nsDependentCString(file), fileName);
}
@@ -574,6 +586,7 @@ nsScriptSecurityManager::ContentSecurityPolicyPermitsJSAction(JSContext *cx)
fileName,
scriptSample,
lineNum,
columnNum,
EmptyString(),
EmptyString());
}
+1 -1
View File
@@ -91,7 +91,7 @@ private:
// Decides, based on CSP, whether or not eval() and stuff can be executed.
static bool
ContentSecurityPolicyPermitsJSAction(JSContext *cx);
ContentSecurityPolicyPermitsJSAction(JSContext *cx, JS::HandleValue aValue);
static bool
JSPrincipalsSubsume(JSPrincipals *first, JSPrincipals *second);
+5 -33
View File
@@ -526,45 +526,17 @@ EXPAND_MKSHLIB_ARGS += --symbol-order $(SYMBOL_ORDER)
endif
EXPAND_MKSHLIB = $(EXPAND_LIBS_EXEC) $(EXPAND_MKSHLIB_ARGS) -- $(MKSHLIB)
# $(call CHECK_SYMBOLS,lib,PREFIX,dep_name,test)
# Checks that the given `lib` doesn't contain dependency on symbols with a
# version starting with `PREFIX`_ and matching the `test`. `dep_name` is only
# used for the error message.
# `test` is an awk expression using the information in the variable `v` which
# contains a list of version items ([major, minor, ...]).
define CHECK_SYMBOLS
@$(TOOLCHAIN_PREFIX)readelf -sW $(1) | \
awk '$$8 ~ /@$(2)_/ { \
split($$8,a,"@"); \
split(a[2],b,"_"); \
split(b[2],v,"."); \
if ($(4)) { \
if (!found) { \
print "TEST-UNEXPECTED-FAIL | check_stdcxx | We do not want these $(3) symbol versions to be used:" \
} \
print " ",$$8; \
found=1 \
} \
} \
END { \
if (found) { \
exit(1) \
} \
}'
endef
ifneq (,$(MOZ_LIBSTDCXX_TARGET_VERSION)$(MOZ_LIBSTDCXX_HOST_VERSION))
CHECK_STDCXX = $(call CHECK_SYMBOLS,$(1),GLIBCXX,libstdc++,v[1] > 3 || (v[1] == 3 && v[2] == 4 && v[3] > 16))
CHECK_GLIBC = $(call CHECK_SYMBOLS,$(1),GLIBC,libc,v[1] > 2 || (v[1] == 2 && v[2] > 12))
ifeq ($(OS_ARCH),SunOS)
ELF_TEST = elfdump -N .dynamic $(1)
else
ELF_TEST = $(TOOLCHAIN_PREFIX)readelf -d $(1)
endif
ifeq (,$(filter $(OS_TARGET),WINNT Darwin))
CHECK_TEXTREL = @$(TOOLCHAIN_PREFIX)readelf -d $(1) | grep TEXTREL > /dev/null && echo 'TEST-UNEXPECTED-FAIL | check_textrel | We do not want text relocations in libraries and programs' || true
CHECK_TEXTREL = @$(ELF_TEST) | grep TEXTREL > /dev/null && echo 'TEST-UNEXPECTED-FAIL | check_textrel | We do not want text relocations in libraries and programs' || true
endif
define CHECK_BINARY
$(call CHECK_GLIBC,$(1))
$(call CHECK_STDCXX,$(1))
$(call CHECK_TEXTREL,$(1))
$(call LOCAL_CHECKS,$(1))
$(call CHECK_MOZGLUE_ORDER,$(1))
-13
View File
@@ -1,13 +0,0 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
Library('freetype')
if CONFIG['MOZ_TREE_FREETYPE']:
USE_LIBS += [
'static:/modules/freetype2/.libs/freetype',
]
else:
OS_LIBS += CONFIG['FT2_LIBS']
+2
View File
@@ -15,3 +15,5 @@ LOCAL_INCLUDES += ['/intl/icu/source/i18n']
include('../defs.mozbuild')
include('sources.mozbuild')
SOURCES += sources
+30 -29
View File
@@ -1,5 +1,5 @@
# THIS FILE IS GENERATED BY /intl/icu_sources_data.py DO NOT EDIT
SOURCES += [
sources = [
'/intl/icu/source/common/appendable.cpp',
'/intl/icu/source/common/bmpset.cpp',
'/intl/icu/source/common/brkeng.cpp',
@@ -8,15 +8,12 @@ SOURCES += [
'/intl/icu/source/common/bytestream.cpp',
'/intl/icu/source/common/bytestrie.cpp',
'/intl/icu/source/common/bytestriebuilder.cpp',
'/intl/icu/source/common/bytestrieiterator.cpp',
'/intl/icu/source/common/caniter.cpp',
'/intl/icu/source/common/characterproperties.cpp',
'/intl/icu/source/common/chariter.cpp',
'/intl/icu/source/common/charstr.cpp',
'/intl/icu/source/common/cmemory.cpp',
'/intl/icu/source/common/cstr.cpp',
'/intl/icu/source/common/cstring.cpp',
'/intl/icu/source/common/cwchar.cpp',
'/intl/icu/source/common/dictbe.cpp',
'/intl/icu/source/common/dictionarydata.cpp',
'/intl/icu/source/common/dtintrv.cpp',
@@ -24,8 +21,6 @@ SOURCES += [
'/intl/icu/source/common/errorcode.cpp',
'/intl/icu/source/common/filteredbrk.cpp',
'/intl/icu/source/common/filterednormalizer2.cpp',
'/intl/icu/source/common/icudataver.cpp',
'/intl/icu/source/common/icuplug.cpp',
'/intl/icu/source/common/loadednormalizer2impl.cpp',
'/intl/icu/source/common/locavailable.cpp',
'/intl/icu/source/common/locbased.cpp',
@@ -42,9 +37,7 @@ SOURCES += [
'/intl/icu/source/common/normlzr.cpp',
'/intl/icu/source/common/parsepos.cpp',
'/intl/icu/source/common/patternprops.cpp',
'/intl/icu/source/common/pluralmap.cpp',
'/intl/icu/source/common/propname.cpp',
'/intl/icu/source/common/propsvec.cpp',
'/intl/icu/source/common/punycode.cpp',
'/intl/icu/source/common/putil.cpp',
'/intl/icu/source/common/rbbi.cpp',
@@ -57,7 +50,6 @@ SOURCES += [
'/intl/icu/source/common/rbbistbl.cpp',
'/intl/icu/source/common/rbbitblb.cpp',
'/intl/icu/source/common/resbund.cpp',
'/intl/icu/source/common/resbund_cnv.cpp',
'/intl/icu/source/common/resource.cpp',
'/intl/icu/source/common/ruleiter.cpp',
'/intl/icu/source/common/schriter.cpp',
@@ -77,13 +69,11 @@ SOURCES += [
'/intl/icu/source/common/ubidi.cpp',
'/intl/icu/source/common/ubidi_props.cpp',
'/intl/icu/source/common/ubidiln.cpp',
'/intl/icu/source/common/ubiditransform.cpp',
'/intl/icu/source/common/ubidiwrt.cpp',
'/intl/icu/source/common/ubrk.cpp',
'/intl/icu/source/common/ucase.cpp',
'/intl/icu/source/common/ucasemap.cpp',
'/intl/icu/source/common/ucasemap_titlecase_brkiter.cpp',
'/intl/icu/source/common/ucat.cpp',
'/intl/icu/source/common/uchar.cpp',
'/intl/icu/source/common/ucharstrie.cpp',
'/intl/icu/source/common/ucharstriebuilder.cpp',
@@ -92,28 +82,18 @@ SOURCES += [
'/intl/icu/source/common/ucln_cmn.cpp',
'/intl/icu/source/common/ucmndata.cpp',
'/intl/icu/source/common/ucnv.cpp',
'/intl/icu/source/common/ucnv2022.cpp',
'/intl/icu/source/common/ucnv_bld.cpp',
'/intl/icu/source/common/ucnv_cb.cpp',
'/intl/icu/source/common/ucnv_cnv.cpp',
'/intl/icu/source/common/ucnv_ct.cpp',
'/intl/icu/source/common/ucnv_err.cpp',
'/intl/icu/source/common/ucnv_ext.cpp',
'/intl/icu/source/common/ucnv_io.cpp',
'/intl/icu/source/common/ucnv_lmb.cpp',
'/intl/icu/source/common/ucnv_set.cpp',
'/intl/icu/source/common/ucnv_u16.cpp',
'/intl/icu/source/common/ucnv_u32.cpp',
'/intl/icu/source/common/ucnv_u7.cpp',
'/intl/icu/source/common/ucnv_u8.cpp',
'/intl/icu/source/common/ucnvbocu.cpp',
'/intl/icu/source/common/ucnvdisp.cpp',
'/intl/icu/source/common/ucnvhz.cpp',
'/intl/icu/source/common/ucnvisci.cpp',
'/intl/icu/source/common/ucnvlat1.cpp',
'/intl/icu/source/common/ucnvmbcs.cpp',
'/intl/icu/source/common/ucnvscsu.cpp',
'/intl/icu/source/common/ucnvsel.cpp',
'/intl/icu/source/common/ucol_swp.cpp',
'/intl/icu/source/common/ucptrie.cpp',
'/intl/icu/source/common/ucurr.cpp',
@@ -123,7 +103,6 @@ SOURCES += [
'/intl/icu/source/common/uenum.cpp',
'/intl/icu/source/common/uhash.cpp',
'/intl/icu/source/common/uhash_us.cpp',
'/intl/icu/source/common/uidna.cpp',
'/intl/icu/source/common/uinit.cpp',
'/intl/icu/source/common/uinvchar.cpp',
'/intl/icu/source/common/uiter.cpp',
@@ -149,25 +128,20 @@ SOURCES += [
'/intl/icu/source/common/unistr_cnv.cpp',
'/intl/icu/source/common/unistr_props.cpp',
'/intl/icu/source/common/unistr_titlecase_brkiter.cpp',
'/intl/icu/source/common/unorm.cpp',
'/intl/icu/source/common/unormcmp.cpp',
'/intl/icu/source/common/uobject.cpp',
'/intl/icu/source/common/uprops.cpp',
'/intl/icu/source/common/ures_cnv.cpp',
'/intl/icu/source/common/uresbund.cpp',
'/intl/icu/source/common/uresdata.cpp',
'/intl/icu/source/common/usc_impl.cpp',
'/intl/icu/source/common/uscript.cpp',
'/intl/icu/source/common/uscript_props.cpp',
'/intl/icu/source/common/uset.cpp',
'/intl/icu/source/common/uset_props.cpp',
'/intl/icu/source/common/usetiter.cpp',
'/intl/icu/source/common/ushape.cpp',
'/intl/icu/source/common/usprep.cpp',
'/intl/icu/source/common/ustack.cpp',
'/intl/icu/source/common/ustr_cnv.cpp',
'/intl/icu/source/common/ustr_titlecase_brkiter.cpp',
'/intl/icu/source/common/ustr_wcs.cpp',
'/intl/icu/source/common/ustrcase.cpp',
'/intl/icu/source/common/ustrcase_locale.cpp',
'/intl/icu/source/common/ustrenum.cpp',
@@ -177,7 +151,6 @@ SOURCES += [
'/intl/icu/source/common/utext.cpp',
'/intl/icu/source/common/utf_impl.cpp',
'/intl/icu/source/common/util.cpp',
'/intl/icu/source/common/util_props.cpp',
'/intl/icu/source/common/utrace.cpp',
'/intl/icu/source/common/utrie.cpp',
'/intl/icu/source/common/utrie2.cpp',
@@ -190,7 +163,35 @@ SOURCES += [
'/intl/icu/source/common/uvectr64.cpp',
'/intl/icu/source/common/wintz.cpp',
]
other_sources = [
'/intl/icu/source/common/bytestrieiterator.cpp',
'/intl/icu/source/common/cstr.cpp',
'/intl/icu/source/common/cwchar.cpp',
'/intl/icu/source/common/icudataver.cpp',
'/intl/icu/source/common/icuplug.cpp',
'/intl/icu/source/common/pluralmap.cpp',
'/intl/icu/source/common/propsvec.cpp',
'/intl/icu/source/common/resbund_cnv.cpp',
'/intl/icu/source/common/ubiditransform.cpp',
'/intl/icu/source/common/ucat.cpp',
'/intl/icu/source/common/ucnv2022.cpp',
'/intl/icu/source/common/ucnv_ct.cpp',
'/intl/icu/source/common/ucnv_ext.cpp',
'/intl/icu/source/common/ucnv_lmb.cpp',
'/intl/icu/source/common/ucnv_set.cpp',
'/intl/icu/source/common/ucnvdisp.cpp',
'/intl/icu/source/common/ucnvhz.cpp',
'/intl/icu/source/common/ucnvisci.cpp',
'/intl/icu/source/common/ucnvmbcs.cpp',
'/intl/icu/source/common/ucnvsel.cpp',
'/intl/icu/source/common/uidna.cpp',
'/intl/icu/source/common/unorm.cpp',
'/intl/icu/source/common/ures_cnv.cpp',
'/intl/icu/source/common/usc_impl.cpp',
'/intl/icu/source/common/ushape.cpp',
'/intl/icu/source/common/ustr_wcs.cpp',
'/intl/icu/source/common/util_props.cpp',
]
EXPORTS.unicode += [
'/intl/icu/source/common/unicode/appendable.h',
'/intl/icu/source/common/unicode/brkiter.h',
+14 -5
View File
@@ -3,10 +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/.
if CONFIG['MOZ_ICU_DATA_ARCHIVE']:
# Copy the pre-built ICU data file to dist/bin.
FINAL_TARGET_FILES += [CONFIG['ICU_DATA_FILE']]
# Build a library containing the ICU data for use in the JS shell, so that
# JSAPI consumers don't have to deal with setting ICU's data path.
Library('icudata')
@@ -17,8 +13,13 @@ if CONFIG['OS_ARCH'] == 'WINNT':
elif CONFIG['OS_ARCH'] == 'Darwin':
ASFLAGS += ['-DPREFIX']
data_file = {
'little': 'icudt%sl.dat' % CONFIG['MOZ_ICU_VERSION'],
'big': 'icudt%sb.dat' % CONFIG['MOZ_ICU_VERSION'],
}
ASFLAGS += [
'-DICU_DATA_FILE="%s"' % CONFIG['ICU_DATA_FILE'],
'-DICU_DATA_FILE="%s"' % data_file[CONFIG['TARGET_ENDIANNESS']],
'-DICU_DATA_SYMBOL=icudt%s_dat' % CONFIG['MOZ_ICU_VERSION'],
]
LOCAL_INCLUDES += ['.']
@@ -26,5 +27,13 @@ LOCAL_INCLUDES += ['.']
if CONFIG['HAVE_YASM']:
USE_YASM = True
SOURCES += ['icudata.s']
elif CONFIG['OS_ARCH'] == 'Darwin':
if CONFIG['CPU_ARCH'] != 'ppc':
SOURCES += ['icudata_gas.S']
elif CONFIG['GNU_AS']:
SOURCES += ['icudata_gas.S']
if CONFIG['MOZ_ICU_DATA_ARCHIVE']:
# Copy the pre-built ICU data file to dist/bin.
FINAL_TARGET_FILES += [data_file[CONFIG['TARGET_ENDIANNESS']]]
+3
View File
@@ -12,3 +12,6 @@ LOCAL_INCLUDES += ['/intl/icu/source/common']
include('../defs.mozbuild')
include('sources.mozbuild')
SOURCES += sources
+58 -57
View File
@@ -1,14 +1,10 @@
# THIS FILE IS GENERATED BY /intl/icu_sources_data.py DO NOT EDIT
SOURCES += [
'/intl/icu/source/i18n/alphaindex.cpp',
'/intl/icu/source/i18n/anytrans.cpp',
sources = [
'/intl/icu/source/i18n/astro.cpp',
'/intl/icu/source/i18n/basictz.cpp',
'/intl/icu/source/i18n/bocsu.cpp',
'/intl/icu/source/i18n/brktrans.cpp',
'/intl/icu/source/i18n/buddhcal.cpp',
'/intl/icu/source/i18n/calendar.cpp',
'/intl/icu/source/i18n/casetrn.cpp',
'/intl/icu/source/i18n/cecal.cpp',
'/intl/icu/source/i18n/chnsecal.cpp',
'/intl/icu/source/i18n/choicfmt.cpp',
@@ -35,15 +31,6 @@ SOURCES += [
'/intl/icu/source/i18n/collationweights.cpp',
'/intl/icu/source/i18n/compactdecimalformat.cpp',
'/intl/icu/source/i18n/coptccal.cpp',
'/intl/icu/source/i18n/cpdtrans.cpp',
'/intl/icu/source/i18n/csdetect.cpp',
'/intl/icu/source/i18n/csmatch.cpp',
'/intl/icu/source/i18n/csr2022.cpp',
'/intl/icu/source/i18n/csrecog.cpp',
'/intl/icu/source/i18n/csrmbcs.cpp',
'/intl/icu/source/i18n/csrsbcs.cpp',
'/intl/icu/source/i18n/csrucode.cpp',
'/intl/icu/source/i18n/csrutf8.cpp',
'/intl/icu/source/i18n/curramt.cpp',
'/intl/icu/source/i18n/currfmt.cpp',
'/intl/icu/source/i18n/currpinf.cpp',
@@ -68,20 +55,15 @@ SOURCES += [
'/intl/icu/source/i18n/dtptngen.cpp',
'/intl/icu/source/i18n/dtrule.cpp',
'/intl/icu/source/i18n/erarules.cpp',
'/intl/icu/source/i18n/esctrn.cpp',
'/intl/icu/source/i18n/ethpccal.cpp',
'/intl/icu/source/i18n/fmtable.cpp',
'/intl/icu/source/i18n/fmtable_cnv.cpp',
'/intl/icu/source/i18n/format.cpp',
'/intl/icu/source/i18n/fphdlimp.cpp',
'/intl/icu/source/i18n/fpositer.cpp',
'/intl/icu/source/i18n/funcrepl.cpp',
'/intl/icu/source/i18n/gender.cpp',
'/intl/icu/source/i18n/gregocal.cpp',
'/intl/icu/source/i18n/gregoimp.cpp',
'/intl/icu/source/i18n/hebrwcal.cpp',
'/intl/icu/source/i18n/indiancal.cpp',
'/intl/icu/source/i18n/inputext.cpp',
'/intl/icu/source/i18n/islamcal.cpp',
'/intl/icu/source/i18n/japancal.cpp',
'/intl/icu/source/i18n/listformatter.cpp',
@@ -89,13 +71,10 @@ SOURCES += [
'/intl/icu/source/i18n/measunit.cpp',
'/intl/icu/source/i18n/measure.cpp',
'/intl/icu/source/i18n/msgfmt.cpp',
'/intl/icu/source/i18n/name2uni.cpp',
'/intl/icu/source/i18n/nfrs.cpp',
'/intl/icu/source/i18n/nfrule.cpp',
'/intl/icu/source/i18n/nfsubs.cpp',
'/intl/icu/source/i18n/nortrans.cpp',
'/intl/icu/source/i18n/nounit.cpp',
'/intl/icu/source/i18n/nultrans.cpp',
'/intl/icu/source/i18n/number_affixutils.cpp',
'/intl/icu/source/i18n/number_asformat.cpp',
'/intl/icu/source/i18n/number_capi.cpp',
@@ -138,27 +117,13 @@ SOURCES += [
'/intl/icu/source/i18n/persncal.cpp',
'/intl/icu/source/i18n/plurfmt.cpp',
'/intl/icu/source/i18n/plurrule.cpp',
'/intl/icu/source/i18n/quant.cpp',
'/intl/icu/source/i18n/quantityformatter.cpp',
'/intl/icu/source/i18n/rbnf.cpp',
'/intl/icu/source/i18n/rbt.cpp',
'/intl/icu/source/i18n/rbt_data.cpp',
'/intl/icu/source/i18n/rbt_pars.cpp',
'/intl/icu/source/i18n/rbt_rule.cpp',
'/intl/icu/source/i18n/rbt_set.cpp',
'/intl/icu/source/i18n/rbtz.cpp',
'/intl/icu/source/i18n/regexcmp.cpp',
'/intl/icu/source/i18n/regeximp.cpp',
'/intl/icu/source/i18n/regexst.cpp',
'/intl/icu/source/i18n/regextxt.cpp',
'/intl/icu/source/i18n/region.cpp',
'/intl/icu/source/i18n/reldatefmt.cpp',
'/intl/icu/source/i18n/reldtfmt.cpp',
'/intl/icu/source/i18n/rematch.cpp',
'/intl/icu/source/i18n/remtrans.cpp',
'/intl/icu/source/i18n/repattrn.cpp',
'/intl/icu/source/i18n/rulebasedcollator.cpp',
'/intl/icu/source/i18n/scientificnumberformatter.cpp',
'/intl/icu/source/i18n/scriptset.cpp',
'/intl/icu/source/i18n/search.cpp',
'/intl/icu/source/i18n/selfmt.cpp',
@@ -168,20 +133,12 @@ SOURCES += [
'/intl/icu/source/i18n/smpdtfst.cpp',
'/intl/icu/source/i18n/sortkey.cpp',
'/intl/icu/source/i18n/standardplural.cpp',
'/intl/icu/source/i18n/strmatch.cpp',
'/intl/icu/source/i18n/strrepl.cpp',
'/intl/icu/source/i18n/stsearch.cpp',
'/intl/icu/source/i18n/taiwncal.cpp',
'/intl/icu/source/i18n/timezone.cpp',
'/intl/icu/source/i18n/titletrn.cpp',
'/intl/icu/source/i18n/tmunit.cpp',
'/intl/icu/source/i18n/tmutamt.cpp',
'/intl/icu/source/i18n/tmutfmt.cpp',
'/intl/icu/source/i18n/tolowtrn.cpp',
'/intl/icu/source/i18n/toupptrn.cpp',
'/intl/icu/source/i18n/translit.cpp',
'/intl/icu/source/i18n/transreg.cpp',
'/intl/icu/source/i18n/tridpars.cpp',
'/intl/icu/source/i18n/tzfmt.cpp',
'/intl/icu/source/i18n/tzgnames.cpp',
'/intl/icu/source/i18n/tznames.cpp',
@@ -194,42 +151,86 @@ SOURCES += [
'/intl/icu/source/i18n/ucol_res.cpp',
'/intl/icu/source/i18n/ucol_sit.cpp',
'/intl/icu/source/i18n/ucoleitr.cpp',
'/intl/icu/source/i18n/ucsdet.cpp',
'/intl/icu/source/i18n/udat.cpp',
'/intl/icu/source/i18n/udateintervalformat.cpp',
'/intl/icu/source/i18n/udatpg.cpp',
'/intl/icu/source/i18n/ufieldpositer.cpp',
'/intl/icu/source/i18n/uitercollationiterator.cpp',
'/intl/icu/source/i18n/ulistformatter.cpp',
'/intl/icu/source/i18n/ulocdata.cpp',
'/intl/icu/source/i18n/umsg.cpp',
'/intl/icu/source/i18n/unesctrn.cpp',
'/intl/icu/source/i18n/uni2name.cpp',
'/intl/icu/source/i18n/unum.cpp',
'/intl/icu/source/i18n/unumsys.cpp',
'/intl/icu/source/i18n/upluralrules.cpp',
'/intl/icu/source/i18n/uregex.cpp',
'/intl/icu/source/i18n/uregexc.cpp',
'/intl/icu/source/i18n/uregion.cpp',
'/intl/icu/source/i18n/usearch.cpp',
'/intl/icu/source/i18n/uspoof.cpp',
'/intl/icu/source/i18n/uspoof_build.cpp',
'/intl/icu/source/i18n/uspoof_conf.cpp',
'/intl/icu/source/i18n/uspoof_impl.cpp',
'/intl/icu/source/i18n/utf16collationiterator.cpp',
'/intl/icu/source/i18n/utf8collationiterator.cpp',
'/intl/icu/source/i18n/utmscale.cpp',
'/intl/icu/source/i18n/utrans.cpp',
'/intl/icu/source/i18n/vtzone.cpp',
'/intl/icu/source/i18n/vzone.cpp',
'/intl/icu/source/i18n/windtfmt.cpp',
'/intl/icu/source/i18n/winnmfmt.cpp',
'/intl/icu/source/i18n/wintzimpl.cpp',
'/intl/icu/source/i18n/zonemeta.cpp',
]
other_sources = [
'/intl/icu/source/i18n/alphaindex.cpp',
'/intl/icu/source/i18n/anytrans.cpp',
'/intl/icu/source/i18n/brktrans.cpp',
'/intl/icu/source/i18n/casetrn.cpp',
'/intl/icu/source/i18n/cpdtrans.cpp',
'/intl/icu/source/i18n/csdetect.cpp',
'/intl/icu/source/i18n/csmatch.cpp',
'/intl/icu/source/i18n/csr2022.cpp',
'/intl/icu/source/i18n/csrecog.cpp',
'/intl/icu/source/i18n/csrmbcs.cpp',
'/intl/icu/source/i18n/csrsbcs.cpp',
'/intl/icu/source/i18n/csrucode.cpp',
'/intl/icu/source/i18n/csrutf8.cpp',
'/intl/icu/source/i18n/esctrn.cpp',
'/intl/icu/source/i18n/fmtable_cnv.cpp',
'/intl/icu/source/i18n/funcrepl.cpp',
'/intl/icu/source/i18n/gender.cpp',
'/intl/icu/source/i18n/inputext.cpp',
'/intl/icu/source/i18n/name2uni.cpp',
'/intl/icu/source/i18n/nortrans.cpp',
'/intl/icu/source/i18n/nultrans.cpp',
'/intl/icu/source/i18n/quant.cpp',
'/intl/icu/source/i18n/rbt.cpp',
'/intl/icu/source/i18n/rbt_data.cpp',
'/intl/icu/source/i18n/rbt_pars.cpp',
'/intl/icu/source/i18n/rbt_rule.cpp',
'/intl/icu/source/i18n/rbt_set.cpp',
'/intl/icu/source/i18n/regexcmp.cpp',
'/intl/icu/source/i18n/regeximp.cpp',
'/intl/icu/source/i18n/regexst.cpp',
'/intl/icu/source/i18n/regextxt.cpp',
'/intl/icu/source/i18n/rematch.cpp',
'/intl/icu/source/i18n/remtrans.cpp',
'/intl/icu/source/i18n/repattrn.cpp',
'/intl/icu/source/i18n/scientificnumberformatter.cpp',
'/intl/icu/source/i18n/strmatch.cpp',
'/intl/icu/source/i18n/strrepl.cpp',
'/intl/icu/source/i18n/titletrn.cpp',
'/intl/icu/source/i18n/tolowtrn.cpp',
'/intl/icu/source/i18n/toupptrn.cpp',
'/intl/icu/source/i18n/translit.cpp',
'/intl/icu/source/i18n/transreg.cpp',
'/intl/icu/source/i18n/tridpars.cpp',
'/intl/icu/source/i18n/ucsdet.cpp',
'/intl/icu/source/i18n/udateintervalformat.cpp',
'/intl/icu/source/i18n/ulocdata.cpp',
'/intl/icu/source/i18n/unesctrn.cpp',
'/intl/icu/source/i18n/uni2name.cpp',
'/intl/icu/source/i18n/uregex.cpp',
'/intl/icu/source/i18n/uregexc.cpp',
'/intl/icu/source/i18n/uregion.cpp',
'/intl/icu/source/i18n/uspoof_build.cpp',
'/intl/icu/source/i18n/uspoof_conf.cpp',
'/intl/icu/source/i18n/utrans.cpp',
'/intl/icu/source/i18n/vzone.cpp',
'/intl/icu/source/i18n/zrule.cpp',
'/intl/icu/source/i18n/ztrans.cpp',
]
EXPORTS.unicode += [
'/intl/icu/source/i18n/unicode/alphaindex.h',
'/intl/icu/source/i18n/unicode/basictz.h',
+2 -2
View File
@@ -46,7 +46,7 @@ elif CONFIG['OS_TARGET'] == 'Darwin':
)
SOURCES += [
'/nsprpub/pr/src/md/unix/darwin.c',
'/nsprpub/pr/src/md/unix/os_Darwin.s',
'/nsprpub/pr/src/md/unix/os_Darwin.S',
]
if not CONFIG['MOZ_IOS']:
DEFINES['HAVE_CRT_EXTERNS_H'] = True
@@ -85,7 +85,7 @@ elif CONFIG['OS_TARGET'] == 'WINNT':
else:
DEFINES['_X86_'] = True
else:
error('Not a supported OS_TARGET for NSPR in moz.build: "%s". Use --with-system-nspr' % CONFIG['OS_TARGET'])
error('Not a supported OS_TARGET for NSPR in moz.build: "%s". Cannot build.' % CONFIG['OS_TARGET'])
LOCAL_INCLUDES += [
+1 -1
View File
@@ -8,4 +8,4 @@
# Referenced by milestone.py.
#--------------------------------------------------------
6.5.0
6.6.0
+2
View File
@@ -155,8 +155,10 @@ endif
# Interdependencies that moz.build world don't know about yet for compilation.
# Note some others are hardcoded or "guessed" in recursivemake.py and emitter.py
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk3)
ifdef MOZ_ENABLE_NPAPI
toolkit/library/target: widget/gtk/mozgtk/gtk3/target
endif
endif
ifdef MOZ_LDAP_XPCOM
ldap/target: security/target mozglue/build/target
toolkit/library/target: ldap/target
+4 -6
View File
@@ -411,6 +411,10 @@ EXTRA_DSO_LDOPTS += -Wl,--version-script,$(SYMBOLS_FILE)
else
ifeq ($(OS_TARGET),Darwin)
EXTRA_DSO_LDOPTS += -Wl,-exported_symbols_list,$(SYMBOLS_FILE)
else
ifeq ($(OS_TARGET),SunOS)
EXTRA_DSO_LDOPTS += -Wl,-M,$(SYMBOLS_FILE)
endif
endif
endif
endif
@@ -667,9 +671,6 @@ else
$(EXPAND_LIBS_EXEC) -- $(HOST_CC) -o $@ $(HOST_CFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
endif # HOST_CPP_PROG_LINK
endif
ifndef CROSS_COMPILE
$(call CHECK_STDCXX,$@)
endif
#
# This is an attempt to support generation of multiple binaries
@@ -712,9 +713,6 @@ else
$(EXPAND_LIBS_EXEC) -- $(HOST_CC) $(HOST_OUTOPTION)$@ $(HOST_CFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
endif
endif
ifndef CROSS_COMPILE
$(call CHECK_STDCXX,$@)
endif
ifdef DTRACE_PROBE_OBJ
EXTRA_DEPS += $(DTRACE_PROBE_OBJ)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

@@ -1,94 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
window {
-moz-appearance: none;
background-color: transparent;
}
#doorhanger-container {
width: 450px;
}
#top-panel {
padding: 20px;
background: #343c45; /* toolbars */
color: #8fa1b2; /* body text */
/*
* Sloppy preprocessing since UNIX_BUT_NOT_MAC is only defined
* in `browser/app/profile/firefox.js`, which this file cannot
* depend on. Must style font-size to target linux.
*/
%ifdef XP_UNIX
%ifndef XP_MACOSX
font-size: 13px;
%else
font-size: 15px;
%endif
%else
font-size: 15px;
%endif
line-height: 19px;
min-height: 100px;
}
#top-panel h1 {
font-weight: bold;
font-family: Open Sans, sans-serif;
font-size: 1.1em;
}
#top-panel p {
font-family: Open Sans, sans-serif;
font-size: 0.9em;
width: 300px;
display: block;
margin: 5px 0px 0px 0px;
}
#icon {
background-image: url("chrome://devtools/content/framework/dev-edition-promo/dev-edition-logo.png");
background-size: 64px 64px;
background-repeat: no-repeat;
width: 64px;
height: 64px;
margin-right: 20px;
}
#lower-panel {
padding: 20px;
background-color: #252c33; /* tab toolbars */
min-height: 75px;
border-top: 1px solid #292e33; /* text high contrast (light) */
}
#button-container {
margin: auto 20px;
}
#button-container button {
font: message-box !important;
font-size: 16px !important;
cursor: pointer;
width: 125px;
opacity: 1;
position: static;
-moz-appearance: none;
border-radius: 5px;
height: 30px;
width: 450px;
/* Override embossed borders on Windows/Linux */
border: none;
}
#close {
background-color: transparent;
color: #8fa1b2; /* body text */
}
#go {
margin-left: 100px;
background-color: #70bf53; /* green */
color: #f5f7fa; /* selection text color */
}
@@ -1,36 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE window [
<!ENTITY % toolboxDTD SYSTEM "chrome://devtools/locale/toolbox.dtd" >
%toolboxDTD;
]>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet rel="stylesheet" href="chrome://devtools/content/framework/dev-edition-promo/dev-edition-promo.css" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="dev-edition-promo">
<vbox id="doorhanger-container">
<hbox flex="1" id="top-panel">
<image id="icon" />
<vbox id="info">
<h1>Using Developer Tools in your browser?</h1>
<p>Download Firefox Developer Edition, our first browser made just for you.</p>
</vbox>
</hbox>
<hbox id="lower-panel" flex="1">
<hbox id="button-container" flex="1">
<button id="close"
flex="1"
standalone="true"
label="No thanks">
</button>
<button id="go"
flex="1"
standalone="true"
label="Learn more »">
</button>
</hbox>
</hbox>
</vbox>
</window>
+9 -25
View File
@@ -46,8 +46,6 @@ loader.lazyRequireGetter(this, "InspectorFront",
"devtools/shared/fronts/inspector", true);
loader.lazyRequireGetter(this, "flags",
"devtools/shared/flags");
loader.lazyRequireGetter(this, "showDoorhanger",
"devtools/client/shared/doorhanger", true);
loader.lazyRequireGetter(this, "createPerformanceFront",
"devtools/shared/fronts/performance", true);
loader.lazyRequireGetter(this, "system",
@@ -117,7 +115,6 @@ function Toolbox(target, selectedTool, hostType, contentWindow, frameId) {
this._saveSplitConsoleHeight = this._saveSplitConsoleHeight.bind(this);
this._onFocus = this._onFocus.bind(this);
this._onBrowserMessage = this._onBrowserMessage.bind(this);
this._showDevEditionPromo = this._showDevEditionPromo.bind(this);
this._updateTextBoxMenuItems = this._updateTextBoxMenuItems.bind(this);
this._onBottomHostMinimized = this._onBottomHostMinimized.bind(this);
this._onBottomHostMaximized = this._onBottomHostMaximized.bind(this);
@@ -149,8 +146,6 @@ function Toolbox(target, selectedTool, hostType, contentWindow, frameId) {
this.on("host-changed", this._refreshHostTitle);
this.on("select", this._refreshHostTitle);
this.on("ready", this._showDevEditionPromo);
gDevTools.on("tool-registered", this._toolRegistered);
gDevTools.on("tool-unregistered", this._toolUnregistered);
@@ -2095,7 +2090,6 @@ Toolbox.prototype = {
this._target.off("frame-update", this._updateFrames);
this.off("select", this._refreshHostTitle);
this.off("host-changed", this._refreshHostTitle);
this.off("ready", this._showDevEditionPromo);
gDevTools.off("tool-registered", this._toolRegistered);
gDevTools.off("tool-unregistered", this._toolUnregistered);
@@ -2188,14 +2182,16 @@ Toolbox.prototype = {
.then(() => {
this._removeHostListeners();
// `location` may already be null if the toolbox document is already
// in process of destruction. Otherwise if it is still around, ensure
// releasing toolbox document and triggering cleanup thanks to unload
// event. We do that precisely here, before nullifying the target as
// various cleanup code depends on the target attribute to be still
// defined.
if (win.location) {
// `location` may already be invalid if the toolbox document is
// already in process of destruction. Otherwise if it is still
// around, ensure releasing toolbox document and triggering cleanup
// thanks to unload event. We do that precisely here, before
// nullifying the target as various cleanup code depends on the
// target attribute to be still defined.
try {
win.location.replace("about:blank");
} catch (e) {
// Do nothing.
}
// Targets need to be notified that the toolbox is being torn down.
@@ -2251,18 +2247,6 @@ Toolbox.prototype = {
this.emit("highlighter-hide");
},
/**
* For displaying the promotional Doorhanger on first opening of
* the developer tools, promoting the Developer Edition.
*/
_showDevEditionPromo: function () {
// Do not display in browser toolbox
if (this.target.chrome) {
return;
}
showDoorhanger({ window: this.win, type: "deveditionpromo" });
},
/**
* Enable / disable necessary textbox menu items using globalOverlay.js.
*/
-3
View File
@@ -111,9 +111,6 @@ devtools.jar:
content/framework/options-panel.css (framework/options-panel.css)
content/framework/toolbox-process-window.xul (framework/toolbox-process-window.xul)
* content/framework/toolbox-process-window.js (framework/toolbox-process-window.js)
content/framework/dev-edition-promo/dev-edition-promo.xul (framework/dev-edition-promo/dev-edition-promo.xul)
* content/framework/dev-edition-promo/dev-edition-promo.css (framework/dev-edition-promo/dev-edition-promo.css)
content/framework/dev-edition-promo/dev-edition-logo.png (framework/dev-edition-promo/dev-edition-logo.png)
content/inspector/inspector.xhtml (inspector/inspector.xhtml)
content/framework/connect/connect.xhtml (framework/connect/connect.xhtml)
content/framework/connect/connect.css (framework/connect/connect.css)
@@ -39,9 +39,8 @@ function ConverterObserver() {
ConverterObserver.prototype = {
initialize: function () {
// Only the DevEdition has this feature available by default.
// Users need to manually flip 'devtools.jsonview.enabled' preference
// to have it available in other distributions.
// to have it available.
if (this.isEnabled()) {
this.register();
}
-11
View File
@@ -3,17 +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/.
// Developer edition promo preferences
pref("devtools.devedition.promo.shown", false);
pref("devtools.devedition.promo.url", "https://www.mozilla.org/firefox/developer/?utm_source=firefox-dev-tools&utm_medium=firefox-browser&utm_content=betadoorhanger");
// Only potentially show in beta release
#if MOZ_UPDATE_CHANNEL == beta
pref("devtools.devedition.promo.enabled", true);
#else
pref("devtools.devedition.promo.enabled", false);
#endif
// DevTools development workflow
pref("devtools.loader.hotreload", false);
@@ -8,7 +8,6 @@ const Cu = Components.utils;
var {loader, require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
var Telemetry = require("devtools/client/shared/telemetry");
var {showDoorhanger} = require("devtools/client/shared/doorhanger");
var {TouchEventSimulator} = require("devtools/shared/touch/simulator");
var {Task} = require("devtools/shared/task");
var promise = require("promise");
@@ -255,14 +254,6 @@ ResponsiveUI.prototype = {
yield this.connectToServer();
this.userAgentInput.hidden = false;
// Hook to display promotional Developer Edition doorhanger.
// Only displayed once.
showDoorhanger({
window: this.mainWindow,
type: "deveditionpromo",
anchor: this.chromeDoc.querySelector("#content")
});
// Notify that responsive mode is on.
this._telemetry.toolOpened("responsive");
ResponsiveUIManager.emit("on", { tab: this.tab });
-164
View File
@@ -1,164 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { Ci, Cc } = require("chrome");
const Services = require("Services");
const { DOMHelpers } = require("resource://devtools/client/shared/DOMHelpers.jsm");
const { Task } = require("devtools/shared/task");
const defer = require("devtools/shared/defer");
const { getMostRecentBrowserWindow } = require("sdk/window/utils");
const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
const DEV_EDITION_PROMO_URL = "chrome://devtools/content/framework/dev-edition-promo/dev-edition-promo.xul";
const DEV_EDITION_PROMO_ENABLED_PREF = "devtools.devedition.promo.enabled";
const DEV_EDITION_PROMO_SHOWN_PREF = "devtools.devedition.promo.shown";
const DEV_EDITION_PROMO_URL_PREF = "devtools.devedition.promo.url";
const LOCALE = Cc["@mozilla.org/chrome/chrome-registry;1"]
.getService(Ci.nsIXULChromeRegistry)
.getSelectedLocale("global");
/**
* Only show Dev Edition promo if it's enabled (beta channel),
* if it has not been shown before, and it's a locale build
* for `en-US`
*/
function shouldDevEditionPromoShow() {
return Services.prefs.getBoolPref(DEV_EDITION_PROMO_ENABLED_PREF) &&
!Services.prefs.getBoolPref(DEV_EDITION_PROMO_SHOWN_PREF) &&
LOCALE === "en-US";
}
var TYPES = {
// The Developer Edition promo doorhanger, called by
// opening the toolbox, browser console, WebIDE, or responsive design mode
// in Beta releases. Only displayed once per profile.
deveditionpromo: {
predicate: shouldDevEditionPromoShow,
success: () => {
return Services.prefs.setBoolPref(DEV_EDITION_PROMO_SHOWN_PREF, true);
},
action: () => {
let url = Services.prefs.getCharPref(DEV_EDITION_PROMO_URL_PREF);
getGBrowser().selectedTab = getGBrowser().addTab(url);
},
url: DEV_EDITION_PROMO_URL
}
};
var panelAttrs = {
orient: "vertical",
hidden: "false",
consumeoutsideclicks: "true",
noautofocus: "true",
align: "start",
role: "alert"
};
/**
* Helper to call a doorhanger, defined in `TYPES`, with defined conditions,
* success handlers and loads its own XUL in a frame. Takes an object with
* several properties:
*
* @param {XULWindow} window
* The window that should house the doorhanger.
* @param {String} type
* The type of doorhanger to be displayed is, using the `TYPES`
* definition.
* @param {String} selector
* The selector that the doorhanger should be appended to within
* `window`. Defaults to a XUL Document's `window` element.
*/
exports.showDoorhanger = Task.async(function* ({ window, type, anchor }) {
let { predicate, success, url, action } = TYPES[type];
// Abort if predicate fails
if (!predicate()) {
return;
}
// Call success function to set preferences/cleanup immediately,
// so if triggered multiple times, only happens once (Windows/Linux)
success();
// Wait 200ms to prevent flickering where the popup is displayed
// before the underlying window (Windows 7, 64bit)
yield wait(200);
let document = window.document;
let panel = document.createElementNS(XULNS, "panel");
let frame = document.createElementNS(XULNS, "iframe");
let parentEl = document.querySelector("window");
frame.setAttribute("src", url);
let close = () => parentEl.removeChild(panel);
setDoorhangerStyle(panel, frame);
panel.appendChild(frame);
parentEl.appendChild(panel);
yield onFrameLoad(frame);
panel.openPopup(anchor);
let closeBtn = frame.contentDocument.querySelector("#close");
if (closeBtn) {
closeBtn.addEventListener("click", close);
}
let goBtn = frame.contentDocument.querySelector("#go");
if (goBtn) {
goBtn.addEventListener("click", () => {
if (action) {
action();
}
close();
});
}
});
function setDoorhangerStyle(panel, frame) {
Object.keys(panelAttrs).forEach(prop => {
return panel.setAttribute(prop, panelAttrs[prop]);
});
panel.style.margin = "20px";
panel.style.borderRadius = "5px";
panel.style.border = "none";
panel.style.MozAppearance = "none";
panel.style.backgroundColor = "transparent";
frame.style.borderRadius = "5px";
frame.setAttribute("flex", "1");
frame.setAttribute("width", "450");
frame.setAttribute("height", "179");
}
function onFrameLoad(frame) {
let { resolve, promise } = defer();
if (frame.contentWindow) {
let domHelper = new DOMHelpers(frame.contentWindow);
domHelper.onceDOMReady(resolve);
} else {
let callback = () => {
frame.removeEventListener("DOMContentLoaded", callback);
resolve();
};
frame.addEventListener("DOMContentLoaded", callback);
}
return promise;
}
function getGBrowser() {
return getMostRecentBrowserWindow().gBrowser;
}
function wait(n) {
let { resolve, promise } = defer();
setTimeout(resolve, n);
return promise;
}
-1
View File
@@ -26,7 +26,6 @@ DevToolsModules(
'devices.js',
'devtools-file-watcher.js',
'DOMHelpers.jsm',
'doorhanger.js',
'file-watcher-worker.js',
'file-watcher.js',
'getjson.js',
@@ -908,6 +908,10 @@ VariablesView.prototype = {
// Copy current selection to clipboard.
if (e.ctrlKey || e.metaKey) {
let item = this.getFocusedItem();
if (!item) {
// No item is selected; do nothing.
return;
}
clipboardHelper.copyString(
item._nameString + item.separatorStr + item._valueString
);
-8
View File
@@ -19,7 +19,6 @@ loader.lazyRequireGetter(this, "WebConsoleFrame", "devtools/client/webconsole/we
loader.lazyRequireGetter(this, "gDevTools", "devtools/client/framework/devtools", true);
loader.lazyRequireGetter(this, "DebuggerServer", "devtools/server/main", true);
loader.lazyRequireGetter(this, "DebuggerClient", "devtools/shared/client/main", true);
loader.lazyRequireGetter(this, "showDoorhanger", "devtools/client/shared/doorhanger", true);
loader.lazyRequireGetter(this, "viewSource", "devtools/client/shared/view-source");
const STRINGS_URI = "devtools/client/locales/webconsole.properties";
@@ -675,19 +674,12 @@ BrowserConsole.prototype = extend(WebConsole.prototype, {
// instance.
let onClose = () => {
window.removeEventListener("unload", onClose);
window.removeEventListener("focus", onFocus);
this.destroy();
};
window.addEventListener("unload", onClose);
this._telemetry.toolOpened("browserconsole");
// Create an onFocus handler just to display the dev edition promo.
// This is to prevent race conditions in some environments.
// Hook to display promotional Developer Edition doorhanger. Only displayed once.
let onFocus = () => showDoorhanger({ window, type: "deveditionpromo" });
window.addEventListener("focus", onFocus);
this._bc_init = this.$init();
return this._bc_init;
},
+2 -9
View File
@@ -537,6 +537,7 @@ function newChannelForURL(url, { policy, window, principal }) {
// scheme to see if it helps.
uri = Services.io.newURI("file://" + url, null, null);
}
let channelOptions = {
contentPolicyType: policy,
securityFlags: securityFlags,
@@ -557,15 +558,7 @@ function newChannelForURL(url, { policy, window, principal }) {
}
channelOptions.loadingPrincipal = prin;
try {
return NetUtil.newChannel(channelOptions);
} catch (e) {
// In xpcshell tests on Windows, nsExternalProtocolHandler::NewChannel()
// can throw NS_ERROR_UNKNOWN_PROTOCOL if the external protocol isn't
// supported by Windows, so we also need to handle the exception here if
// parsing the URL above doesn't throw.
return newChannelForURL("file://" + url, { policy, window, principal });
}
return NetUtil.newChannel(channelOptions);
}
// Fetch is defined differently depending on whether we are on the main thread
+89 -14
View File
@@ -2208,10 +2208,10 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"auto",
"calc",
"content",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -2231,10 +2231,10 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"auto",
"calc",
"content",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -3282,7 +3282,6 @@ exports.CSS_PROPERTIES = {
"-moz-crisp-edges",
"-moz-deck",
"-moz-element",
"-moz-fit-content",
"-moz-grid",
"-moz-grid-group",
"-moz-grid-line",
@@ -3424,6 +3423,7 @@ exports.CSS_PROPERTIES = {
"extra-expanded",
"fill",
"fill-box",
"fit-content",
"fixed",
"flat",
"flex",
@@ -6000,10 +6000,10 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"auto",
"calc",
"content",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -6023,10 +6023,10 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"auto",
"calc",
"content",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -6816,9 +6816,9 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"auto",
"calc",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -6903,9 +6903,9 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"auto",
"calc",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -7257,6 +7257,25 @@ exports.CSS_PROPERTIES = {
"unset"
]
},
"margin-block": {
"isInherited": false,
"subproperties": [
"margin-block-start",
"margin-block-end"
],
"supports": [
6,
8
],
"values": [
"-moz-calc",
"auto",
"calc",
"inherit",
"initial",
"unset"
]
},
"margin-block-end": {
"isInherited": false,
"subproperties": [
@@ -7311,6 +7330,25 @@ exports.CSS_PROPERTIES = {
"unset"
]
},
"margin-inline": {
"isInherited": false,
"subproperties": [
"margin-inline-start",
"margin-inline-end"
],
"supports": [
6,
8
],
"values": [
"-moz-calc",
"auto",
"calc",
"inherit",
"initial",
"unset"
]
},
"margin-inline-end": {
"isInherited": false,
"subproperties": [
@@ -7744,8 +7782,8 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"calc",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -7766,8 +7804,8 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"calc",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -7788,8 +7826,8 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"calc",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -7828,9 +7866,9 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"auto",
"calc",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -7850,9 +7888,9 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"auto",
"calc",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -7872,9 +7910,9 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"auto",
"calc",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -8246,6 +8284,24 @@ exports.CSS_PROPERTIES = {
"unset"
]
},
"padding-block": {
"isInherited": false,
"subproperties": [
"padding-block-start",
"padding-block-end"
],
"supports": [
6,
8
],
"values": [
"-moz-calc",
"calc",
"inherit",
"initial",
"unset"
]
},
"padding-block-end": {
"isInherited": false,
"subproperties": [
@@ -8297,6 +8353,24 @@ exports.CSS_PROPERTIES = {
"unset"
]
},
"padding-inline": {
"isInherited": false,
"subproperties": [
"padding-inline-start",
"padding-inline-end"
],
"supports": [
6,
8
],
"values": [
"-moz-calc",
"calc",
"inherit",
"initial",
"unset"
]
},
"padding-inline-end": {
"isInherited": false,
"subproperties": [
@@ -9636,9 +9710,9 @@ exports.CSS_PROPERTIES = {
"values": [
"-moz-available",
"-moz-calc",
"-moz-fit-content",
"auto",
"calc",
"fit-content",
"inherit",
"initial",
"max-content",
@@ -9752,6 +9826,7 @@ exports.CSS_PROPERTIES = {
exports.PSEUDO_ELEMENTS = [
":after",
":before",
":slotted",
":backdrop",
":first-letter",
":first-line",
+1 -1
View File
@@ -136,7 +136,7 @@ nsDSURIContentListener::DoContent(const nsACString& aContentType,
mExistingJPEGRequest = baseChannel;
}
if (rv == NS_ERROR_REMOTE_XUL) {
if (rv == NS_ERROR_REMOTE_XUL || rv == NS_ERROR_DOCSHELL_DYING) {
aRequest->Cancel(rv);
*aAbortProcess = true;
return NS_OK;
+70 -7
View File
@@ -892,6 +892,8 @@ nsDocShell::~nsDocShell()
nsresult
nsDocShell::Init()
{
MOZ_ASSERT(!mIsBeingDestroyed);
nsresult rv = nsDocLoader::Init();
NS_ENSURE_SUCCESS(rv, rv);
@@ -1916,6 +1918,8 @@ bool
nsDocShell::SetCurrentURI(nsIURI* aURI, nsIRequest* aRequest,
bool aFireOnLocationChange, uint32_t aLocationFlags)
{
MOZ_ASSERT(!mIsBeingDestroyed);
if (gDocShellLeakLog && MOZ_LOG_TEST(gDocShellLeakLog, LogLevel::Debug)) {
PR_LogPrint("DOCSHELL %p SetCurrentURI %s\n",
this, aURI ? aURI->GetSpecOrDefault().get() : "");
@@ -2176,6 +2180,8 @@ nsDocShell::SetUsePrivateBrowsing(bool aUsePrivateBrowsing)
NS_IMETHODIMP
nsDocShell::SetPrivateBrowsing(bool aUsePrivateBrowsing)
{
MOZ_ASSERT(!mIsBeingDestroyed);
bool changed = aUsePrivateBrowsing != (mPrivateBrowsingId > 0);
if (changed) {
mPrivateBrowsingId = aUsePrivateBrowsing ? 1 : 0;
@@ -2246,6 +2252,8 @@ nsDocShell::SetRemoteTabs(bool aUseRemoteTabs)
NS_IMETHODIMP
nsDocShell::SetAffectPrivateSessionLifetime(bool aAffectLifetime)
{
MOZ_ASSERT(!mIsBeingDestroyed);
bool change = aAffectLifetime != mAffectPrivateSessionLifetime;
if (change && UsePrivateBrowsing()) {
AssertOriginAttributesMatchPrivateBrowsing();
@@ -2748,6 +2756,8 @@ nsDocShell::GetSecurityUI(nsISecureBrowserUI** aSecurityUI)
NS_IMETHODIMP
nsDocShell::SetSecurityUI(nsISecureBrowserUI* aSecurityUI)
{
MOZ_ASSERT(!mIsBeingDestroyed);
mSecurityUI = aSecurityUI;
mSecurityUI->SetDocShell(this);
return NS_OK;
@@ -3930,6 +3940,10 @@ PrintDocTree(nsIDocShellTreeItem* aParentNode)
NS_IMETHODIMP
nsDocShell::SetTreeOwner(nsIDocShellTreeOwner* aTreeOwner)
{
if (mIsBeingDestroyed && aTreeOwner) {
return NS_ERROR_FAILURE;
}
#ifdef DEBUG_DOCSHELL_FOCUS
nsCOMPtr<nsIDocShellTreeItem> item(do_QueryInterface(aTreeOwner));
if (item) {
@@ -5186,6 +5200,8 @@ nsDocShell::LoadErrorPage(nsIURI* aURI, const char16_t* aURL,
const char* aCSSClass,
nsIChannel* aFailedChannel)
{
MOZ_ASSERT(!mIsBeingDestroyed);
#if defined(DEBUG)
if (MOZ_LOG_TEST(gDocShellLog, LogLevel::Debug)) {
nsAutoCString chanName;
@@ -5539,6 +5555,8 @@ nsDocShell::SetSessionHistory(nsISHistory* aSessionHistory)
// make sure that we are the root docshell and
// set a handle to root docshell in SH.
MOZ_ASSERT(!mIsBeingDestroyed);
nsCOMPtr<nsIDocShellTreeItem> root;
/* Get the root docshell. If *this* is the root docshell
* then save a handle to *this* in SH. SH needs it to do
@@ -5719,16 +5737,22 @@ nsDocShell::Create()
NS_IMETHODIMP
nsDocShell::Destroy()
{
// XXX: We allow this function to be called just once. If you are going to
// reset new variables in this function, please make sure the variables will
// never be re-initialized. Adding assertions to check |mIsBeingDestroyed|
// in the setter functions for the variables would be enough.
if (mIsBeingDestroyed) {
return NS_ERROR_DOCSHELL_DYING;
}
NS_ASSERTION(mItemType == typeContent || mItemType == typeChrome,
"Unexpected item type in docshell");
if (!mIsBeingDestroyed) {
nsCOMPtr<nsIObserverService> serv = services::GetObserverService();
if (serv) {
const char* msg = mItemType == typeContent ?
NS_WEBNAVIGATION_DESTROY : NS_CHROME_WEBNAVIGATION_DESTROY;
serv->NotifyObservers(GetAsSupports(this), msg, nullptr);
}
nsCOMPtr<nsIObserverService> serv = services::GetObserverService();
if (serv) {
const char* msg = mItemType == typeContent ?
NS_WEBNAVIGATION_DESTROY : NS_CHROME_WEBNAVIGATION_DESTROY;
serv->NotifyObservers(GetAsSupports(this), msg, nullptr);
}
mIsBeingDestroyed = true;
@@ -6011,6 +6035,7 @@ nsDocShell::GetParentWidget(nsIWidget** aParentWidget)
NS_IMETHODIMP
nsDocShell::SetParentWidget(nsIWidget* aParentWidget)
{
MOZ_ASSERT(!mIsBeingDestroyed);
mParentWidget = aParentWidget;
return NS_OK;
@@ -6281,6 +6306,8 @@ nsDocShell::SetOnePermittedSandboxedNavigator(nsIDocShell* aSandboxedNavigator)
return NS_OK;
}
MOZ_ASSERT(!mIsBeingDestroyed);
mOnePermittedSandboxedNavigator = do_GetWeakReference(aSandboxedNavigator);
NS_ASSERTION(mOnePermittedSandboxedNavigator,
"One Permitted Sandboxed Navigator must support weak references.");
@@ -6641,6 +6668,8 @@ nsDocShell::RefreshURI(nsIURI* aURI,
bool aMetaRefresh,
nsIPrincipal* aPrincipal)
{
MOZ_ASSERT(!mIsBeingDestroyed);
NS_ENSURE_ARG(aURI);
/* Check if Meta refresh/redirects are permitted. Some
@@ -7985,6 +8014,10 @@ nsDocShell::CreateAboutBlankContentViewer(nsIPrincipal* aPrincipal,
// wrong information :-(
//
(void)FirePageHideNotification(!mSavingOldViewer);
// pagehide notification might destroy this docshell.
if (mIsBeingDestroyed) {
return NS_ERROR_DOCSHELL_DYING;
}
}
// Now make sure we don't think we're in the middle of firing unload after
@@ -8128,6 +8161,8 @@ nsDocShell::CanSavePresentation(uint32_t aLoadType,
void
nsDocShell::ReattachEditorToWindow(nsISHEntry* aSHEntry)
{
MOZ_ASSERT(!mIsBeingDestroyed);
NS_ASSERTION(!mEditorData,
"Why reattach an editor when we already have one?");
NS_ASSERTION(aSHEntry && aSHEntry->HasDetachedEditor(),
@@ -8165,6 +8200,9 @@ nsDocShell::DetachEditorFromWindow()
if (NS_SUCCEEDED(res)) {
// Make mOSHE hold the owning ref to the editor data.
if (mOSHE) {
MOZ_ASSERT(!mIsBeingDestroyed || !mOSHE->HasDetachedEditor(),
"We should not set the editor data again once after we "
"detached the editor data during destroying this docshell");
mOSHE->SetEditorData(mEditorData.forget());
} else {
mEditorData = nullptr;
@@ -8351,6 +8389,8 @@ nsDocShell::GetRestoringDocument(bool* aRestoring)
nsresult
nsDocShell::RestorePresentation(nsISHEntry* aSHEntry, bool* aRestoring)
{
MOZ_ASSERT(!mIsBeingDestroyed);
NS_ASSERTION(mLoadType & LOAD_CMD_HISTORY,
"RestorePresentation should only be called for history loads");
@@ -8512,6 +8552,10 @@ nsDocShell::RestoreFromHistory()
// Notify the old content viewer that it's being hidden.
FirePageHideNotification(!mSavingOldViewer);
// pagehide notification might destroy this docshell.
if (mIsBeingDestroyed) {
return NS_ERROR_DOCSHELL_DYING;
}
// If mLSHE was changed as a result of the pagehide event, then
// something else was loaded. Don't finish restoring.
@@ -8969,6 +9013,12 @@ nsDocShell::CreateContentViewer(const nsACString& aContentType,
{
*aContentHandler = nullptr;
if (!mTreeOwner || mIsBeingDestroyed) {
// If we don't have a tree owner, then we're in the process of being
// destroyed. Rather than continue trying to load something, just give up.
return NS_ERROR_DOCSHELL_DYING;
}
// Can we check the content type of the current content viewer
// and reuse it without destroying it and re-creating it?
@@ -9008,6 +9058,11 @@ nsDocShell::CreateContentViewer(const nsACString& aContentType,
aOpenedChannel->GetURI(getter_AddRefs(mLoadingURI));
}
FirePageHideNotification(!mSavingOldViewer);
if (mIsBeingDestroyed) {
// Force to stop the newly created orphaned viewer.
viewer->Stop();
return NS_ERROR_DOCSHELL_DYING;
}
mLoadingURI = nullptr;
// Set mFiredUnloadEvent = false so that the unload handler for the
@@ -9197,6 +9252,8 @@ nsDocShell::NewContentViewerObj(const nsACString& aContentType,
nsresult
nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer)
{
MOZ_ASSERT(!mIsBeingDestroyed);
//
// Copy content viewer state from previous or parent content viewer.
//
@@ -13382,6 +13439,8 @@ nsDocShell::EnsureScriptEnvironment()
NS_IMETHODIMP
nsDocShell::EnsureEditorData()
{
MOZ_ASSERT(!mIsBeingDestroyed);
bool openDocHasDetachedEditor = mOSHE && mOSHE->HasDetachedEditor();
if (!mEditorData && !mIsBeingDestroyed && !openDocHasDetachedEditor) {
// We shouldn't recreate the editor data if it already exists, or
@@ -13397,6 +13456,8 @@ nsDocShell::EnsureEditorData()
nsresult
nsDocShell::EnsureTransferableHookData()
{
MOZ_ASSERT(!mIsBeingDestroyed);
if (!mTransferableHookData) {
mTransferableHookData = new nsTransferableHookData();
}
@@ -14469,6 +14530,8 @@ nsDocShell::CanSetOriginAttributes()
nsresult
nsDocShell::SetOriginAttributes(const DocShellOriginAttributes& aAttrs)
{
MOZ_ASSERT(!mIsBeingDestroyed);
if (!CanSetOriginAttributes()) {
return NS_ERROR_FAILURE;
}
+32 -5
View File
@@ -1383,6 +1383,30 @@ Animation::GetRenderedDocument() const
return mEffect->AsKeyframeEffect()->GetRenderedDocument();
}
class AsyncFinishNotification : public MicroTaskRunnable
{
public:
explicit AsyncFinishNotification(Animation* aAnimation)
: MicroTaskRunnable()
, mAnimation(aAnimation)
{}
virtual void Run(AutoSlowOperation& aAso) override
{
mAnimation->DoFinishNotificationImmediately(this);
mAnimation = nullptr;
}
virtual bool Suppressed() override
{
nsIGlobalObject* global = mAnimation->GetOwnerGlobal();
return global && global->IsInSyncOperation();
}
private:
RefPtr<Animation> mAnimation;
};
void
Animation::DoFinishNotification(SyncNotifyFlag aSyncNotifyFlag)
{
@@ -1390,9 +1414,8 @@ Animation::DoFinishNotification(SyncNotifyFlag aSyncNotifyFlag)
if (aSyncNotifyFlag == SyncNotifyFlag::Sync) {
DoFinishNotificationImmediately();
} else if (!mFinishNotificationTask.IsPending()) {
RefPtr<nsRunnableMethod<Animation>> runnable =
NewRunnableMethod(this, &Animation::DoFinishNotificationImmediately);
} else if (!mFinishNotificationTask) {
RefPtr<MicroTaskRunnable> runnable = new AsyncFinishNotification(this);
context->DispatchToMicroTask(do_AddRef(runnable));
mFinishNotificationTask = runnable.forget();
}
@@ -1415,9 +1438,13 @@ Animation::MaybeResolveFinishedPromise()
}
void
Animation::DoFinishNotificationImmediately()
Animation::DoFinishNotificationImmediately(MicroTaskRunnable* aAsync)
{
mFinishNotificationTask.Revoke();
if (aAsync && aAsync != mFinishNotificationTask) {
return;
}
mFinishNotificationTask = nullptr;
if (PlayState() != AnimationPlayState::Finished) {
return;
+5 -2
View File
@@ -9,6 +9,7 @@
#include "nsWrapperCache.h"
#include "nsCycleCollectionParticipant.h"
#include "mozilla/Attributes.h"
#include "mozilla/CycleCollectedJSContext.h"
#include "mozilla/DOMEventTargetHelper.h"
#include "mozilla/EffectCompositor.h" // For EffectCompositor::CascadeLevel
#include "mozilla/LinkedList.h"
@@ -42,6 +43,7 @@ class AnimValuesStyleRule;
namespace dom {
class AsyncFinishNotification;
class CSSAnimation;
class CSSTransition;
@@ -378,7 +380,8 @@ protected:
void ResetFinishedPromise();
void MaybeResolveFinishedPromise();
void DoFinishNotification(SyncNotifyFlag aSyncNotifyFlag);
void DoFinishNotificationImmediately();
friend class AsyncFinishNotification;
void DoFinishNotificationImmediately(MicroTaskRunnable* aAsync = nullptr);
void DispatchPlaybackEvent(const nsAString& aName);
/**
@@ -446,7 +449,7 @@ protected:
// getAnimations() list.
bool mIsRelevant;
nsRevocableEventPtr<nsRunnableMethod<Animation>> mFinishNotificationTask;
RefPtr<MicroTaskRunnable> mFinishNotificationTask;
// True if mFinished is resolved or would be resolved if mFinished has
// yet to be created. This is not set when mFinished is rejected since
// in that case mFinished is immediately reset to represent a new current
+7
View File
@@ -155,6 +155,13 @@ DocumentTimeline::WillRefresh(mozilla::TimeStamp aTime)
bool needsTicks = false;
nsTArray<Animation*> animationsToRemove(mAnimations.Count());
// https://drafts.csswg.org/web-animations-1/#update-animations-and-send-events,
// step2.
// Note that this should be done before nsAutoAnimationMutationBatch. If
// PerformMicroTaskCheckpoint was called before nsAutoAnimationMutationBatch
// is destroyed, some mutation records might not be delivered in this
// checkpoint.
nsAutoMicroTask mt;
nsAutoAnimationMutationBatch mb(mDocument);
for (Animation* animation = mAnimationOrder.getFirst(); animation;
+3 -10
View File
@@ -14,8 +14,7 @@
#include "mozilla/AnimationUtils.h"
#include "mozilla/EffectSet.h"
#include "mozilla/LayerAnimationInfo.h"
#include "mozilla/RestyleManagerHandle.h"
#include "mozilla/RestyleManagerHandleInlines.h"
#include "mozilla/RestyleManager.h"
#include "nsComputedDOMStyle.h" // nsComputedDOMStyle::GetPresShellForContent
#include "nsCSSPropertyIDSet.h"
#include "nsCSSProps.h"
@@ -202,10 +201,7 @@ EffectCompositor::RequestRestyle(dom::Element* aElement,
if (aRestyleType == RestyleType::Layer) {
// Prompt layers to re-sync their animations.
MOZ_ASSERT(mPresContext->RestyleManager()->IsGecko(),
"stylo: Servo-backed style system should not be using "
"EffectCompositor");
mPresContext->RestyleManager()->AsGecko()->IncrementAnimationGeneration();
mPresContext->RestyleManager()->IncrementAnimationGeneration();
EffectSet* effectSet =
EffectSet::GetEffectSet(aElement, aPseudoType);
if (effectSet) {
@@ -317,10 +313,7 @@ EffectCompositor::GetAnimationRule(dom::Element* aElement,
return nullptr;
}
MOZ_ASSERT(mPresContext->RestyleManager()->IsGecko(),
"stylo: Servo-backed style system should not be using "
"EffectCompositor");
if (mPresContext->RestyleManager()->AsGecko()->SkipAnimationRules()) {
if (mPresContext->RestyleManager()->SkipAnimationRules()) {
// We don't need to worry about updating mElementsToRestyle in this case
// since this is not the animation restyle we requested when we called
// PostRestyleForAnimation (see comment at start of this method).
+2 -6
View File
@@ -5,8 +5,7 @@
#include "EffectSet.h"
#include "mozilla/dom/Element.h" // For Element
#include "mozilla/RestyleManagerHandle.h"
#include "mozilla/RestyleManagerHandleInlines.h"
#include "mozilla/RestyleManager.h"
#include "nsCSSPseudoElements.h" // For CSSPseudoElementType
#include "nsCycleCollectionNoteChild.h" // For CycleCollectionNoteChild
#include "nsPresContext.h"
@@ -110,11 +109,8 @@ EffectSet::DestroyEffectSet(dom::Element* aElement,
void
EffectSet::UpdateAnimationGeneration(nsPresContext* aPresContext)
{
MOZ_ASSERT(aPresContext->RestyleManager()->IsGecko(),
"stylo: Servo-backed style system should not be using "
"EffectSet");
mAnimationGeneration =
aPresContext->RestyleManager()->AsGecko()->GetAnimationGeneration();
aPresContext->RestyleManager()->GetAnimationGeneration();
}
/* static */ nsIAtom**
+6 -29
View File
@@ -15,7 +15,6 @@
#include "mozilla/FloatingPoint.h" // For IsFinite
#include "mozilla/LookAndFeel.h" // For LookAndFeel::GetInt
#include "mozilla/KeyframeUtils.h"
#include "mozilla/ServoBindings.h"
#include "mozilla/StyleAnimationValue.h"
#include "Layers.h" // For Layer
#include "nsComputedDOMStyle.h" // nsComputedDOMStyle::GetStyleContextForElement
@@ -32,17 +31,7 @@ namespace mozilla {
bool
PropertyValuePair::operator==(const PropertyValuePair& aOther) const
{
if (mProperty != aOther.mProperty || mValue != aOther.mValue) {
return false;
}
if (mServoDeclarationBlock == aOther.mServoDeclarationBlock) {
return true;
}
if (!mServoDeclarationBlock || !aOther.mServoDeclarationBlock) {
return false;
}
return Servo_DeclarationBlock_Equals(mServoDeclarationBlock,
aOther.mServoDeclarationBlock);
return mProperty == aOther.mProperty && mValue == aOther.mValue;
}
namespace dom {
@@ -296,10 +285,7 @@ KeyframeEffectReadOnly::UpdateProperties(nsStyleContext* aStyleContext)
runningOnCompositorProperties.HasProperty(property.mProperty);
}
// FIXME (bug 1303235): Do this for Servo too
if (aStyleContext->PresContext()->StyleSet()->IsGecko()) {
CalculateCumulativeChangeHint(aStyleContext);
}
CalculateCumulativeChangeHint(aStyleContext);
MarkCascadeNeedsUpdate();
@@ -936,13 +922,8 @@ KeyframeEffectReadOnly::GetKeyframes(JSContext*& aCx,
: propertyValue.mProperty;
nsAutoString stringValue;
if (propertyValue.mServoDeclarationBlock) {
Servo_DeclarationBlock_SerializeOneValue(
propertyValue.mServoDeclarationBlock, &stringValue);
} else {
propertyValue.mValue.AppendToString(
propertyForSerializing, stringValue, nsCSSValue::eNormalized);
}
propertyValue.mValue.AppendToString(
propertyForSerializing, stringValue, nsCSSValue::eNormalized);
JS::Rooted<JS::Value> value(aCx);
if (!ToJSValue(aCx, stringValue, &value) ||
@@ -1286,10 +1267,8 @@ CreateStyleContextForAnimationValue(nsCSSPropertyID aProperty,
nsCOMArray<nsIStyleRule> rules;
rules.AppendObject(styleRule);
MOZ_ASSERT(aBaseStyleContext->PresContext()->StyleSet()->IsGecko(),
"ServoStyleSet should not use StyleAnimationValue for animations");
nsStyleSet* styleSet =
aBaseStyleContext->PresContext()->StyleSet()->AsGecko();
aBaseStyleContext->PresContext()->StyleSet();
RefPtr<nsStyleContext> styleContext =
styleSet->ResolveStyleByAddingRules(aBaseStyleContext, rules);
@@ -1362,10 +1341,8 @@ KeyframeEffectReadOnly::CanIgnoreIfNotVisible() const
return false;
}
// FIXME (bug 1303235): We don't calculate mCumulativeChangeHint for
// the Servo backend yet
nsPresContext* presContext = GetPresContext();
if (!presContext || presContext->StyleSet()->IsServo()) {
if (!presContext) {
return false;
}
-7
View File
@@ -19,8 +19,6 @@
#include "mozilla/EffectCompositor.h"
#include "mozilla/KeyframeEffectParams.h"
#include "mozilla/LayerAnimationInfo.h" // LayerAnimations::kRecords
#include "mozilla/ServoBindingTypes.h" // RawServoDeclarationBlock and
// associated RefPtrTraits
#include "mozilla/StyleAnimationValue.h"
#include "mozilla/dom/AnimationEffectReadOnly.h"
#include "mozilla/dom/Element.h"
@@ -63,11 +61,6 @@ struct PropertyValuePair
// (string).
nsCSSValue mValue;
// The specified value when using the Servo backend. However, even when
// using the Servo backend, we still fill in |mValue| in the case where we
// fail to parse the value since we use it to store the original string.
RefPtr<RawServoDeclarationBlock> mServoDeclarationBlock;
bool operator==(const PropertyValuePair&) const;
};
+23 -83
View File
@@ -9,7 +9,6 @@
#include "mozilla/Move.h"
#include "mozilla/Preferences.h"
#include "mozilla/RangedArray.h"
#include "mozilla/ServoBindings.h"
#include "mozilla/StyleAnimationValue.h"
#include "mozilla/TimingParams.h"
#include "mozilla/dom/BaseKeyframeTypesBinding.h" // For FastBaseKeyframe etc.
@@ -319,12 +318,8 @@ public:
// ------------------------------------------------------------------
inline bool
IsInvalidValuePair(const PropertyValuePair& aPair, StyleBackendType aBackend)
IsInvalidValuePair(const PropertyValuePair& aPair)
{
if (aBackend == StyleBackendType::Servo) {
return !aPair.mServoDeclarationBlock;
}
// There are three types of values we store as token streams:
//
// * Shorthand values (where we manually extract the token stream's string
@@ -600,8 +595,6 @@ KeyframeUtils::GetComputedKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
MOZ_ASSERT(aStyleContext);
MOZ_ASSERT(aElement);
StyleBackendType styleBackend = aElement->OwnerDoc()->GetStyleBackendType();
const size_t len = aKeyframes.Length();
nsTArray<ComputedKeyframeValues> result(len);
@@ -610,12 +603,7 @@ KeyframeUtils::GetComputedKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
ComputedKeyframeValues* computedValues = result.AppendElement();
for (const PropertyValuePair& pair :
PropertyPriorityIterator(frame.mPropertyValues)) {
MOZ_ASSERT(!pair.mServoDeclarationBlock ||
styleBackend == StyleBackendType::Servo,
"Animation values were parsed using Servo backend but target"
" element is not using Servo backend?");
if (IsInvalidValuePair(pair, styleBackend)) {
if (IsInvalidValuePair(pair)) {
continue;
}
@@ -623,33 +611,25 @@ KeyframeUtils::GetComputedKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
// a KeyframeValueEntry for each value.
nsTArray<PropertyStyleAnimationValuePair> values;
if (styleBackend == StyleBackendType::Servo) {
// For shorthands, we store the string as a token stream so we need to
// extract that first.
if (nsCSSProps::IsShorthand(pair.mProperty)) {
nsCSSValueTokenStream* tokenStream = pair.mValue.GetTokenStreamValue();
if (!StyleAnimationValue::ComputeValues(pair.mProperty,
CSSEnabledState::eForAllContent, aStyleContext,
*pair.mServoDeclarationBlock, values)) {
CSSEnabledState::eForAllContent, aElement, aStyleContext,
tokenStream->mTokenStream, /* aUseSVGMode */ false, values) ||
IsComputeValuesFailureKey(pair)) {
continue;
}
} else {
// For shorthands, we store the string as a token stream so we need to
// extract that first.
if (nsCSSProps::IsShorthand(pair.mProperty)) {
nsCSSValueTokenStream* tokenStream = pair.mValue.GetTokenStreamValue();
if (!StyleAnimationValue::ComputeValues(pair.mProperty,
CSSEnabledState::eForAllContent, aElement, aStyleContext,
tokenStream->mTokenStream, /* aUseSVGMode */ false, values) ||
IsComputeValuesFailureKey(pair)) {
continue;
}
} else {
if (!StyleAnimationValue::ComputeValues(pair.mProperty,
CSSEnabledState::eForAllContent, aElement, aStyleContext,
pair.mValue, /* aUseSVGMode */ false, values)) {
continue;
}
MOZ_ASSERT(values.Length() == 1,
"Longhand properties should produce a single"
" StyleAnimationValue");
if (!StyleAnimationValue::ComputeValues(pair.mProperty,
CSSEnabledState::eForAllContent, aElement, aStyleContext,
pair.mValue, /* aUseSVGMode */ false, values)) {
continue;
}
MOZ_ASSERT(values.Length() == 1,
"Longhand properties should produce a single"
" StyleAnimationValue");
}
for (auto& value : values) {
@@ -999,30 +979,6 @@ MakePropertyValuePair(nsCSSPropertyID aProperty, const nsAString& aStringValue,
result.mProperty = aProperty;
if (aDocument->GetStyleBackendType() == StyleBackendType::Servo) {
nsCString name = nsCSSProps::GetStringValue(aProperty);
NS_ConvertUTF16toUTF8 value(aStringValue);
RefPtr<ThreadSafeURIHolder> base =
new ThreadSafeURIHolder(aDocument->GetDocumentURI());
RefPtr<ThreadSafeURIHolder> referrer =
new ThreadSafeURIHolder(aDocument->GetDocumentURI());
RefPtr<ThreadSafePrincipalHolder> principal =
new ThreadSafePrincipalHolder(aDocument->NodePrincipal());
nsCString baseString;
aDocument->GetDocumentURI()->GetSpec(baseString);
RefPtr<RawServoDeclarationBlock> servoDeclarationBlock =
Servo_ParseProperty(&name, &value, &baseString,
base, referrer, principal).Consume();
if (servoDeclarationBlock) {
result.mServoDeclarationBlock = servoDeclarationBlock.forget();
return result;
}
}
nsCSSValue value;
if (!nsCSSProps::IsShorthand(aProperty)) {
aParser.ParseLonghandProperty(aProperty,
@@ -1054,13 +1010,6 @@ MakePropertyValuePair(nsCSSPropertyID aProperty, const nsAString& aStringValue,
"The shorthand property of a token stream should be initialized"
" to unknown");
value.SetTokenStreamValue(tokenStream);
} else {
// If we succeeded in parsing with Gecko, but not Servo the animation is
// not going to work since, for the purposes of animation, we're going to
// ignore |mValue| when the backend is Servo.
NS_WARNING_ASSERTION(aDocument->GetStyleBackendType() !=
StyleBackendType::Servo,
"Gecko succeeded in parsing where Servo failed");
}
result.mValue = value;
@@ -1412,8 +1361,6 @@ HasImplicitKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
}
};
StyleBackendType styleBackend = aDocument->GetStyleBackendType();
for (size_t i = 0, len = aKeyframes.Length(); i < len; i++) {
const Keyframe& frame = aKeyframes[i];
@@ -1429,25 +1376,18 @@ HasImplicitKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
: computedOffset;
for (const PropertyValuePair& pair : frame.mPropertyValues) {
if (IsInvalidValuePair(pair, styleBackend)) {
if (IsInvalidValuePair(pair)) {
continue;
}
if (nsCSSProps::IsShorthand(pair.mProperty)) {
if (styleBackend == StyleBackendType::Gecko) {
nsCSSValueTokenStream* tokenStream =
pair.mValue.GetTokenStreamValue();
nsCSSParser parser(aDocument->CSSLoader());
if (!parser.IsValueValidForProperty(pair.mProperty,
tokenStream->mTokenStream)) {
continue;
}
nsCSSValueTokenStream* tokenStream =
pair.mValue.GetTokenStreamValue();
nsCSSParser parser(aDocument->CSSLoader());
if (!parser.IsValueValidForProperty(pair.mProperty,
tokenStream->mTokenStream)) {
continue;
}
// For the Servo backend, invalid shorthand values are represented by
// a null mServoDeclarationBlock member which we skip above in
// IsInvalidValuePair.
MOZ_ASSERT(styleBackend != StyleBackendType::Servo ||
pair.mServoDeclarationBlock);
CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(
prop, pair.mProperty, CSSEnabledState::eForAllContent) {
addToPropertySets(*prop, offsetToUse);
+1 -1
View File
@@ -135,7 +135,7 @@ TimingParams::ParseEasing(const nsAString& aEasing,
NS_STYLE_TRANSITION_TIMING_FUNCTION_LINEAR) {
return Nothing();
}
MOZ_FALLTHROUGH;
[[fallthrough]];
case eCSSUnit_Cubic_Bezier:
case eCSSUnit_Steps: {
nsTimingFunction timingFunction;
+1 -4
View File
@@ -474,10 +474,7 @@ IsNativeAnonymousImplementationOfPseudoElement(nsIContent* aContent)
// Unlike regular nodes, native anonymous content (NAC) gets created during
// frame construction, which happens after the main style traversal. This
// means that we have to manually resolve style for those nodes shortly after
// they're created, either by (a) invoking ResolvePseudoElementStyle (for PE
// NAC), or (b) handing the subtree off to Servo for a mini-traversal (for
// non-PE NAC). We have assertions in nsCSSFrameConstructor that we don't do
// both.
// they're created by invoking ResolvePseudoElementStyle (for PE NAC).
//
// Once that happens, the NAC has a frame. So if we have no frame here,
// we're either not NAC, or in the process of doing (b). Either way, this
+1 -2
View File
@@ -5,7 +5,6 @@
#include "mozilla/dom/CustomElementRegistry.h"
#include "mozilla/CycleCollectedJSContext.h"
#include "mozilla/dom/CustomElementRegistryBinding.h"
#include "mozilla/dom/HTMLElementBinding.h"
#include "mozilla/dom/WebComponentsBinding.h"
@@ -1153,7 +1152,7 @@ CustomElementReactionsStack::Enqueue(Element* aElement,
CycleCollectedJSContext* context = CycleCollectedJSContext::Get();
RefPtr<BackupQueueMicroTask> bqmt = new BackupQueueMicroTask(this);
context->DispatchMicroTaskRunnable(bqmt.forget());
context->DispatchToMicroTask(bqmt.forget());
}
void
+1
View File
@@ -9,6 +9,7 @@
#include "js/GCHashTable.h"
#include "js/TypeDecls.h"
#include "mozilla/Attributes.h"
#include "mozilla/CycleCollectedJSContext.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/FunctionBinding.h"
+46 -29
View File
@@ -80,7 +80,14 @@ DOMIntersectionObserver::Constructor(const mozilla::dom::GlobalObject& aGlobal,
RefPtr<DOMIntersectionObserver> observer =
new DOMIntersectionObserver(window.forget(), aCb);
observer->mRoot = aOptions.mRoot;
if (!aOptions.mRoot.IsNull()) {
if (aOptions.mRoot.Value().IsElement()) {
observer->mRoot = aOptions.mRoot.Value().GetAsElement();
} else {
MOZ_ASSERT(aOptions.mRoot.Value().IsDocument());
observer->mRoot = aOptions.mRoot.Value().GetAsDocument();
}
}
if (!observer->SetRootMargin(aOptions.mRootMargin)) {
aRv.ThrowDOMException(NS_ERROR_DOM_SYNTAX_ERR,
@@ -258,6 +265,30 @@ EdgeInclusiveIntersection(const nsRect& aRect, const nsRect& aOtherRect)
return Some(nsRect(left, top, right - left, bottom - top));
}
// NOTE: This returns nullptr if |aDocument| is in a cross process.
static nsIDocument* GetTopLevelDocument(const nsIDocument& aDocument) {
nsCOMPtr<nsIPresShell> presShell = aDocument.GetShell();
if (presShell) {
nsIFrame* rootFrame = presShell->GetRootScrollFrame();
if (rootFrame) {
nsPresContext* presContext = rootFrame->PresContext();
while (!presContext->IsRootContentDocument()) {
// Walk up the tree
presContext = presContext->GetParentPresContext();
if (!presContext) {
break;
}
}
if(presContext && presContext->IsRootContentDocument()) {
return presContext->Document();
}
}
}
return nullptr;
}
enum class BrowsingContextInfo {
SimilarOriginBrowsingContext,
DifferentOriginBrowsingContext,
@@ -267,14 +298,12 @@ enum class BrowsingContextInfo {
void
DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time)
{
Element* root = nullptr;
nsINode* root = mRoot;
nsIFrame* rootFrame = nullptr;
nsRect rootRect;
if (mRoot) {
root = mRoot;
rootFrame = root->GetPrimaryFrame();
if (rootFrame) {
if (mRoot && mRoot->IsElement()) {
if ((rootFrame = mRoot->AsElement()->GetPrimaryFrame())) {
nsRect rootRectRelativeToRootFrame;
if (rootFrame->GetType() == nsGkAtoms::scrollFrame) {
// rootRectRelativeToRootFrame should be the content rect of rootFrame, not including the scrollbars.
@@ -292,30 +321,18 @@ DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time
containingBlock);
}
} else {
nsCOMPtr<nsIPresShell> presShell = aDocument->GetShell();
if (presShell) {
rootFrame = presShell->GetRootScrollFrame();
if (rootFrame) {
nsPresContext* presContext = rootFrame->PresContext();
while (!presContext->IsRootContentDocument()) {
// Walk up the tree
presContext = presContext->GetParentPresContext();
if (!presContext) {
break;
MOZ_ASSERT(!mRoot || mRoot->IsInUncomposedDoc());
nsIDocument* rootDocument =
mRoot ? mRoot->GetUncomposedDoc() : GetTopLevelDocument(*aDocument);
if (rootDocument) {
if (nsIPresShell* presShell = rootDocument->GetShell()) {
rootFrame = presShell->GetRootScrollFrame();
if (rootFrame) {
root = rootFrame->GetContent()->AsElement();
nsIScrollableFrame* scrollFrame = do_QueryFrame(rootFrame);
if (scrollFrame) {
rootRect = scrollFrame->GetScrollPortRect();
}
nsIFrame* rootScrollFrame = presContext->PresShell()->GetRootScrollFrame();
if (rootScrollFrame) {
rootFrame = rootScrollFrame;
} else {
break;
}
}
root = rootFrame->GetContent()->AsElement();
nsIScrollableFrame* scrollFrame = do_QueryFrame(rootFrame);
// If we end up with a null root frame for some reason, we'll proceed
// with an empty root intersection rect.
if (scrollFrame) {
rootRect = scrollFrame->GetScrollPortRect();
}
}
}
+2 -2
View File
@@ -145,7 +145,7 @@ public:
return mOwner;
}
Element* GetRoot() const {
nsINode* GetRoot() const {
return mRoot;
}
@@ -178,7 +178,7 @@ protected:
nsCOMPtr<nsPIDOMWindowInner> mOwner;
RefPtr<nsIDocument> mDocument;
RefPtr<mozilla::dom::IntersectionCallback> mCallback;
RefPtr<Element> mRoot;
RefPtr<nsINode> mRoot;
nsCSSRect mRootMargin;
nsTArray<double> mThresholds;
+39
View File
@@ -117,6 +117,17 @@ ValidateAndFixupMatrixInit(DOMMatrixInit& aMatrixInit, ErrorResult& aRv)
#undef Check3DField
}
void
DOMMatrixReadOnly::SetDataFromMatrix2DInit(const DOMMatrix2DInit& aMatrixInit) {
MOZ_ASSERT(Is2D());
mMatrix2D->_11 = aMatrixInit.mM11.Value();
mMatrix2D->_12 = aMatrixInit.mM12.Value();
mMatrix2D->_21 = aMatrixInit.mM21.Value();
mMatrix2D->_22 = aMatrixInit.mM22.Value();
mMatrix2D->_31 = aMatrixInit.mM41.Value();
mMatrix2D->_32 = aMatrixInit.mM42.Value();
}
void
DOMMatrixReadOnly::SetDataFromMatrixInit(DOMMatrixInit& aMatrixInit)
{
@@ -149,6 +160,34 @@ DOMMatrixReadOnly::SetDataFromMatrixInit(DOMMatrixInit& aMatrixInit)
}
}
already_AddRefed<DOMMatrixReadOnly> DOMMatrixReadOnly::FromMatrix(
nsISupports* aParent, const DOMMatrix2DInit& aMatrixInit,
ErrorResult& aRv) {
DOMMatrix2DInit matrixInit(aMatrixInit);
if (!ValidateAndFixupMatrix2DInit(matrixInit, aRv)) {
return nullptr;
};
RefPtr<DOMMatrixReadOnly> matrix =
new DOMMatrixReadOnly(aParent, /* is2D */ true);
matrix->SetDataFromMatrix2DInit(matrixInit);
return matrix.forget();
}
already_AddRefed<DOMMatrixReadOnly> DOMMatrixReadOnly::FromMatrix(
nsISupports* aParent, const DOMMatrixInit& aMatrixInit, ErrorResult& aRv) {
DOMMatrixInit matrixInit(aMatrixInit);
if (!ValidateAndFixupMatrixInit(matrixInit, aRv)) {
return nullptr;
};
RefPtr<DOMMatrixReadOnly> rval =
new DOMMatrixReadOnly(aParent, matrixInit.mIs2D.Value());
rval->SetDataFromMatrixInit(matrixInit);
return rval.forget();
}
already_AddRefed<DOMMatrixReadOnly>
DOMMatrixReadOnly::FromMatrix(const GlobalObject& aGlobal, const DOMMatrixInit& aMatrixInit, ErrorResult& aRv)
{
+14
View File
@@ -26,6 +26,7 @@ class DOMPoint;
class StringOrUnrestrictedDoubleSequence;
struct DOMPointInit;
struct DOMMatrixInit;
struct DOMMatrix2DInit;
class DOMMatrixReadOnly : public nsWrapperCache
{
@@ -57,6 +58,12 @@ public:
nsISupports* GetParentObject() const { return mParent; }
virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override;
static already_AddRefed<DOMMatrixReadOnly>
FromMatrix(nsISupports* aParent, const DOMMatrix2DInit& aMatrixInit, ErrorResult& aRv);
static already_AddRefed<DOMMatrixReadOnly>
FromMatrix(nsISupports* aParent, const DOMMatrixInit& aMatrixInit, ErrorResult& aRv);
static already_AddRefed<DOMMatrixReadOnly>
FromMatrix(const GlobalObject& aGlobal, const DOMMatrixInit& aMatrixInit, ErrorResult& aRv);
@@ -207,6 +214,12 @@ public:
ErrorResult& aRv) const;
void Stringify(nsAString& aResult);
bool WriteStructuredClone(JSStructuredCloneWriter* aWriter) const;
const gfx::Matrix* GetInternal2D() const {
if (Is2D()) {
return mMatrix2D;
}
return nullptr;
}
protected:
nsCOMPtr<nsISupports> mParent;
@@ -220,6 +233,7 @@ protected:
* where all of its members are properly defined.
* The init dictionary's dimension must match the matrix one.
*/
void SetDataFromMatrix2DInit(const DOMMatrix2DInit& aMatrixInit);
void SetDataFromMatrixInit(DOMMatrixInit& aMatrixInit);
DOMMatrixReadOnly* SetMatrixValue(const nsAString& aTransformList, ErrorResult& aRv);
+1 -1
View File
@@ -169,7 +169,7 @@ DocumentOrShadowRoot::GetFullscreenElement()
return nullptr;
}
Element* element = AsNode().OwnerDoc()->FullScreenStackTop();
Element* element = AsNode().OwnerDoc()->GetUnretargetedFullScreenElement();
NS_ASSERTION(!element ||
element->State().HasState(NS_EVENT_STATE_FULL_SCREEN),
"Fullscreen element should have fullscreen styles applied");
+30 -31
View File
@@ -56,7 +56,6 @@
#include "mozilla/AnimationComparator.h"
#include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/ContentEvents.h"
#include "mozilla/DeclarationBlockInlines.h"
#include "mozilla/EffectSet.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/EventListenerManager.h"
@@ -106,6 +105,7 @@
#include "nsViewManager.h"
#include "nsIScrollableFrame.h"
#include "mozilla/css/StyleRule.h" /* For nsCSSSelectorList */
#include "mozilla/css/Declaration.h"
#include "nsCSSRuleProcessor.h"
#include "nsRuleProcessorData.h"
#include "nsTextNode.h"
@@ -1481,6 +1481,27 @@ Element::GetElementsByClassName(const nsAString& aClassNames,
return NS_OK;
}
CSSPseudoElementType
Element::GetPseudoElementType() const {
if (!HasProperties()) {
return CSSPseudoElementType::NotPseudo;
}
nsresult rv = NS_OK;
auto raw = GetProperty(nsGkAtoms::pseudoProperty, &rv);
if (rv == NS_PROPTABLE_PROP_NOT_THERE) {
return CSSPseudoElementType::NotPseudo;
}
return CSSPseudoElementType(reinterpret_cast<uintptr_t>(raw));
}
void
Element::SetPseudoElementType(CSSPseudoElementType aPseudo) {
static_assert(sizeof(CSSPseudoElementType) <= sizeof(uintptr_t),
"Need to be able to store this in a void*");
MOZ_ASSERT(aPseudo != CSSPseudoElementType::NotPseudo);
SetProperty(nsGkAtoms::pseudoProperty, reinterpret_cast<void*>(aPseudo));
}
/**
* Returns the count of descendants (inclusive of aContent) in
* the uncomposed document that are explicitly set as editable.
@@ -1607,7 +1628,7 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
// And clear the lazy frame construction bits.
NODE_NEEDS_FRAME | NODE_DESCENDANTS_NEED_FRAMES);
// And the restyle bits
UnsetRestyleFlagsIfGecko();
UnsetRestyleFlags();
} else if (IsInShadowTree()) {
// We're not in a document, but we did get inserted into a shadow tree.
// Since we won't have any restyle data in the document's restyle trackers,
@@ -1617,7 +1638,7 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
// inserted into a document.
UnsetFlags(NODE_FORCE_XBL_BINDINGS |
NODE_NEEDS_FRAME | NODE_DESCENDANTS_NEED_FRAMES);
UnsetRestyleFlagsIfGecko();
UnsetRestyleFlags();
} else {
// If we're not in the doc and not in a shadow tree,
// update our subtree pointer.
@@ -1758,18 +1779,6 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
}
}
// It would be cleanest to mark nodes as dirty when (a) they're created and
// (b) they're unbound from a tree. However, we can't easily do (a) right now,
// because IsStyledByServo() is not always easy to check at node creation time,
// and the bits have different meaning in the non-IsStyledByServo case.
//
// So for now, we just mark nodes as dirty when they're inserted into a
// document or shadow tree.
if (IsStyledByServo() && IsInComposedDoc()) {
MOZ_ASSERT(!HasServoData());
SetIsDirtyForServo();
}
// XXXbz script execution during binding can trigger some of these
// postcondition asserts.... But we do want that, since things will
// generally be quite broken when that happens.
@@ -1896,16 +1905,6 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent)
ClearInDocument();
// Computed styled data isn't useful for detached nodes, and we'll need to
// recomputed it anyway if we ever insert the nodes back into a document.
if (IsStyledByServo()) {
ClearServoData();
} else {
#ifdef MOZ_STYLO
MOZ_ASSERT(!HasServoData());
#endif
}
// Editable descendant count only counts descendants that
// are in the uncomposed document.
ResetEditableDescendantCount();
@@ -2015,7 +2014,7 @@ Element::GetSMILOverrideStyle()
return slots->mSMILOverrideStyle;
}
DeclarationBlock*
css::Declaration*
Element::GetSMILOverrideStyleDeclaration()
{
Element::nsExtendedDOMSlots* slots = GetExistingExtendedDOMSlots();
@@ -2023,7 +2022,7 @@ Element::GetSMILOverrideStyleDeclaration()
}
nsresult
Element::SetSMILOverrideStyleDeclaration(DeclarationBlock* aDeclaration,
Element::SetSMILOverrideStyleDeclaration(css::Declaration* aDeclaration,
bool aNotify)
{
Element::nsExtendedDOMSlots* slots = ExtendedDOMSlots();
@@ -2063,14 +2062,14 @@ Element::IsInteractiveHTMLContent(bool aIgnoreTabindex) const
return false;
}
DeclarationBlock*
css::Declaration*
Element::GetInlineStyleDeclaration()
{
return nullptr;
}
nsresult
Element::SetInlineStyleDeclaration(DeclarationBlock* aDeclaration,
Element::SetInlineStyleDeclaration(css::Declaration* aDeclaration,
const nsAString* aSerialized,
bool aNotify)
{
@@ -3199,7 +3198,7 @@ Element::GetEventTargetParentForLinks(EventChainPreVisitor& aVisitor)
// Set the status bar similarly for mouseover and focus
case eMouseOver:
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
MOZ_FALLTHROUGH;
[[fallthrough]];
case eFocus: {
InternalFocusEvent* focusEvent = aVisitor.mEvent->AsFocusEvent();
if (!focusEvent || !focusEvent->mIsRefocus) {
@@ -3214,7 +3213,7 @@ Element::GetEventTargetParentForLinks(EventChainPreVisitor& aVisitor)
}
case eMouseOut:
aVisitor.mEventStatus = nsEventStatus_eConsumeNoDefault;
MOZ_FALLTHROUGH;
[[fallthrough]];
case eBlur:
rv = LeaveLink(aVisitor.mPresContext);
if (NS_SUCCEEDED(rv)) {
+18 -31
View File
@@ -57,7 +57,9 @@ class nsDocument;
class nsDOMStringMap;
namespace mozilla {
class DeclarationBlock;
namespace css {
class Declaration;
} // namespace css
namespace dom {
struct AnimationFilter;
struct ScrollIntoViewOptions;
@@ -79,27 +81,27 @@ NS_GetContentList(nsINode* aRootNode,
// Element-specific flags
enum {
// Set if the element has a pending style change.
ELEMENT_HAS_PENDING_RESTYLE = NODE_SHARED_RESTYLE_BIT_1,
ELEMENT_HAS_PENDING_RESTYLE = ELEMENT_FLAG_BIT(0),
// Set if the element is a potential restyle root (that is, has a style
// change pending _and_ that style change will attempt to restyle
// descendants).
ELEMENT_IS_POTENTIAL_RESTYLE_ROOT = NODE_SHARED_RESTYLE_BIT_2,
ELEMENT_IS_POTENTIAL_RESTYLE_ROOT = ELEMENT_FLAG_BIT(1),
// Set if the element has a pending animation-only style change as
// part of an animation-only style update (where we update styles from
// animation to the current refresh tick, but leave everything else as
// it was).
ELEMENT_HAS_PENDING_ANIMATION_ONLY_RESTYLE = ELEMENT_FLAG_BIT(0),
ELEMENT_HAS_PENDING_ANIMATION_ONLY_RESTYLE = ELEMENT_FLAG_BIT(2),
// Set if the element is a potential animation-only restyle root (that
// is, has an animation-only style change pending _and_ that style
// change will attempt to restyle descendants).
ELEMENT_IS_POTENTIAL_ANIMATION_ONLY_RESTYLE_ROOT = ELEMENT_FLAG_BIT(1),
ELEMENT_IS_POTENTIAL_ANIMATION_ONLY_RESTYLE_ROOT = ELEMENT_FLAG_BIT(3),
// Set if this element has a pending restyle with an eRestyle_SomeDescendants
// restyle hint.
ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR = ELEMENT_FLAG_BIT(2),
ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR = ELEMENT_FLAG_BIT(4),
// Just the HAS_PENDING bits, for convenience
ELEMENT_PENDING_RESTYLE_FLAGS =
@@ -117,10 +119,10 @@ enum {
ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR,
// Set if this element is marked as 'scrollgrab' (see bug 912666)
ELEMENT_HAS_SCROLLGRAB = ELEMENT_FLAG_BIT(3),
ELEMENT_HAS_SCROLLGRAB = ELEMENT_FLAG_BIT(5),
// Remaining bits are for subclasses
ELEMENT_TYPE_SPECIFIC_BITS_OFFSET = NODE_TYPE_SPECIFIC_BITS_OFFSET + 4
ELEMENT_TYPE_SPECIFIC_BITS_OFFSET = NODE_TYPE_SPECIFIC_BITS_OFFSET + 6
};
#undef ELEMENT_FLAG_BIT
@@ -274,13 +276,13 @@ public:
/**
* Get the inline style declaration, if any, for this element.
*/
virtual DeclarationBlock* GetInlineStyleDeclaration();
virtual css::Declaration* GetInlineStyleDeclaration();
/**
* Set the inline style declaration for this element. This will send
* an appropriate AttributeChanged notification if aNotify is true.
*/
virtual nsresult SetInlineStyleDeclaration(DeclarationBlock* aDeclaration,
virtual nsresult SetInlineStyleDeclaration(css::Declaration* aDeclaration,
const nsAString* aSerialized,
bool aNotify);
@@ -288,7 +290,7 @@ public:
* Get the SMIL override style declaration for this element. If the
* rule hasn't been created, this method simply returns null.
*/
virtual DeclarationBlock* GetSMILOverrideStyleDeclaration();
virtual css::Declaration* GetSMILOverrideStyleDeclaration();
/**
* Set the SMIL override style declaration for this element. If
@@ -296,7 +298,7 @@ public:
* context, so that the style changes will be noticed.
*/
virtual nsresult SetSMILOverrideStyleDeclaration(
DeclarationBlock* aDeclaration, bool aNotify);
css::Declaration* aDeclaration, bool aNotify);
/**
* Returns a new nsISMILAttr that allows the caller to animate the given
@@ -814,24 +816,9 @@ public:
already_AddRefed<nsIHTMLCollection>
GetElementsByClassName(const nsAString& aClassNames);
CSSPseudoElementType GetPseudoElementType() const {
if (!HasProperties()) {
return CSSPseudoElementType::NotPseudo;
}
nsresult rv = NS_OK;
auto raw = GetProperty(nsGkAtoms::pseudoProperty, &rv);
if (rv == NS_PROPTABLE_PROP_NOT_THERE) {
return CSSPseudoElementType::NotPseudo;
}
return CSSPseudoElementType(reinterpret_cast<uintptr_t>(raw));
}
CSSPseudoElementType GetPseudoElementType() const;
void SetPseudoElementType(CSSPseudoElementType aPseudo) {
static_assert(sizeof(CSSPseudoElementType) <= sizeof(uintptr_t),
"Need to be able to store this in a void*");
MOZ_ASSERT(aPseudo != CSSPseudoElementType::NotPseudo);
SetProperty(nsGkAtoms::pseudoProperty, reinterpret_cast<void*>(aPseudo));
}
void SetPseudoElementType(CSSPseudoElementType aPseudo);
private:
/**
@@ -1662,9 +1649,9 @@ inline const mozilla::dom::Element* nsINode::AsElement() const
return static_cast<const mozilla::dom::Element*>(this);
}
inline void nsINode::UnsetRestyleFlagsIfGecko()
inline void nsINode::UnsetRestyleFlags()
{
if (IsElement() && !IsStyledByServo()) {
if (IsElement()) {
UnsetFlags(ELEMENT_ALL_RESTYLE_FLAGS);
}
}
+1 -49
View File
@@ -17,7 +17,6 @@
#include "mozilla/dom/FragmentOrElement.h"
#include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/DeclarationBlockInlines.h"
#include "mozilla/EffectSet.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/EventListenerManager.h"
@@ -97,6 +96,7 @@
#include "nsIScrollableFrame.h"
#include "ChildIterator.h"
#include "mozilla/css/StyleRule.h" /* For nsCSSSelectorList */
#include "mozilla/css/Declaration.h"
#include "nsRuleProcessorData.h"
#include "nsTextNode.h"
#include "mozilla/dom/NodeListBinding.h"
@@ -2527,51 +2527,3 @@ FragmentOrElement::SetIsElementInStyleScopeFlagOnShadowTree(bool aInStyleScope)
shadowRoot->SetIsElementInStyleScopeFlagOnSubtree(aInStyleScope);
}
}
#ifdef DEBUG
static void
AssertDirtyDescendantsBitPropagated(nsINode* aNode)
{
MOZ_ASSERT(aNode->HasDirtyDescendantsForServo());
nsINode* parent = aNode->GetFlattenedTreeParentNode();
if (!parent->IsContent()) {
MOZ_ASSERT(parent == aNode->OwnerDoc());
MOZ_ASSERT(parent->HasDirtyDescendantsForServo());
} else {
AssertDirtyDescendantsBitPropagated(parent);
}
}
#else
static void AssertDirtyDescendantsBitPropagated(nsINode* aNode) {}
#endif
void
nsIContent::MarkAncestorsAsHavingDirtyDescendantsForServo()
{
MOZ_ASSERT(IsInComposedDoc());
// Get the parent in the flattened tree.
nsINode* parent = GetFlattenedTreeParentNode();
// Loop until we hit a base case.
while (true) {
// Base case: the document.
if (!parent->IsContent()) {
MOZ_ASSERT(parent == OwnerDoc());
parent->SetHasDirtyDescendantsForServo();
return;
}
// Base case: the parent is already marked, and therefore
// so are all its ancestors.
if (parent->HasDirtyDescendantsForServo()) {
AssertDirtyDescendantsBitPropagated(parent);
return;
}
// Mark the parent and iterate.
parent->SetHasDirtyDescendantsForServo();
parent = parent->GetFlattenedTreeParentNode();
}
}
+4 -2
View File
@@ -35,7 +35,9 @@ class nsDOMStringMap;
class nsIURI;
namespace mozilla {
class DeclarationBlock;
namespace css {
class Declaration;
}
namespace dom {
struct CustomElementData;
class DOMIntersectionObserver;
@@ -264,7 +266,7 @@ public:
/**
* Holds any SMIL override style declaration for this element.
*/
RefPtr<mozilla::DeclarationBlock> mSMILOverrideStyleDeclaration;
RefPtr<mozilla::css::Declaration> mSMILOverrideStyleDeclaration;
/**
* The nearest enclosing content node with a binding that created us.
+306 -5
View File
@@ -15,6 +15,7 @@
#include "nsCPrefetchService.h"
#include "nsStyleLinkElement.h"
#include "nsAttrValueInlines.h"
#include "nsEscape.h"
#include "nsGkAtoms.h"
#include "nsHTMLDNSPrefetch.h"
@@ -23,9 +24,57 @@
#include "mozilla/Services.h"
#include "nsIContentPolicy.h"
#include "nsCSSParser.h"
#include "nsMimeTypes.h"
#include "nsIMediaList.h"
#include "DecoderTraits.h"
#include "imgLoader.h"
namespace mozilla {
namespace dom {
enum Destination : uint8_t
{
DESTINATION_INVALID,
DESTINATION_AUDIO,
DESTINATION_AUDIOWORKLET,
DESTINATION_DOCUMENT,
DESTINATION_EMBED,
DESTINATION_FONT,
DESTINATION_FRAME,
DESTINATION_IFRAME,
DESTINATION_IMAGE,
DESTINATION_JSON,
DESTINATION_MANIFEST,
DESTINATION_OBJECT,
DESTINATION_REPORT,
DESTINATION_SCRIPT,
DESTINATION_SERVICEWORKER,
DESTINATION_SHAREDWORKER,
DESTINATION_STYLE,
DESTINATION_TRACK,
DESTINATION_VIDEO,
DESTINATION_WEBIDENTITY,
DESTINATION_WORKER,
DESTINATION_XSLT,
DESTINATION_FETCH
};
static const nsAttrValue::EnumTable kDestinationAttributeTable[] = {
{ "", DESTINATION_INVALID },
{ "audio", DESTINATION_AUDIO },
{ "font", DESTINATION_FONT },
{ "image", DESTINATION_IMAGE },
{ "script", DESTINATION_SCRIPT },
{ "style", DESTINATION_STYLE },
{ "track", DESTINATION_TRACK },
{ "video", DESTINATION_VIDEO },
{ "fetch", DESTINATION_FETCH },
{ "json", DESTINATION_JSON },
{ nullptr, 0 }
};
Link::Link(Element *aElement)
: mElement(aElement)
, mHistory(services::GetHistoryService())
@@ -75,7 +124,7 @@ Link::CancelDNSPrefetch(nsWrapperCache::FlagsType aDeferredFlag,
}
void
Link::TryDNSPrefetchPreconnectOrPrefetch()
Link::TrySpeculativeLoadFeature()
{
MOZ_ASSERT(mElement->IsInComposedDoc());
if (!ElementHasHref()) {
@@ -95,15 +144,28 @@ Link::TryDNSPrefetchPreconnectOrPrefetch()
mElement->NodePrincipal());
if ((linkTypes & nsStyleLinkElement::ePREFETCH) ||
(linkTypes & nsStyleLinkElement::eNEXT)){
(linkTypes & nsStyleLinkElement::eNEXT) ||
(linkTypes & nsStyleLinkElement::ePRELOAD)) {
nsCOMPtr<nsIPrefetchService> prefetchService(do_GetService(NS_PREFETCHSERVICE_CONTRACTID));
if (prefetchService) {
nsCOMPtr<nsIURI> uri(GetURI());
if (uri) {
nsCOMPtr<nsIDOMNode> domNode = GetAsDOMNode(mElement);
prefetchService->PrefetchURI(uri,
mElement->OwnerDoc()->GetDocumentURI(),
domNode, linkTypes & nsStyleLinkElement::ePREFETCH);
if (linkTypes & nsStyleLinkElement::ePRELOAD) {
nsContentPolicyType policyType;
bool isPreloadValid = CheckPreloadAttrs(policyType, mElement);
if (!isPreloadValid) {
// XXX: WPTs expect that we timeout on invalid preloads including
// those with valid destinations instead of firing an error event.
return;
}
nsContentUtils::DispatchEventForPreloadURI(domNode, policyType);
} else {
prefetchService->PrefetchURI(uri,
mElement->OwnerDoc()->GetDocumentURI(),
domNode,
linkTypes & nsStyleLinkElement::ePREFETCH);
}
return;
}
}
@@ -125,6 +187,95 @@ Link::TryDNSPrefetchPreconnectOrPrefetch()
}
}
void
Link::UpdatePreload(nsIAtom* aName,
const nsAttrValue* aValue,
const nsAttrValue* aOldValue)
{
MOZ_ASSERT(mElement->IsInComposedDoc());
if (!ElementHasHref()) {
return;
}
nsAutoString rel;
if (!mElement->GetAttr(kNameSpaceID_None, nsGkAtoms::rel, rel)) {
return;
}
if (!nsContentUtils::PrefetchEnabled(mElement->OwnerDoc()->GetDocShell()) ||
!nsContentUtils::IsPreloadEnabled()) {
return;
}
uint32_t linkTypes = nsStyleLinkElement::ParseLinkTypes(rel,
mElement->NodePrincipal());
if (!(linkTypes & nsStyleLinkElement::ePRELOAD)) {
return;
}
nsCOMPtr<nsIURI> uri(GetURI());
if (!uri) {
return;
}
nsCOMPtr<nsIDOMNode> domNode = GetAsDOMNode(mElement);
nsContentPolicyType policyType;
bool isPreloadValid = CheckPreloadAttrs(policyType, mElement);
if (!isPreloadValid) {
// XXX: WPTs expect that we timeout on invalid preloads including
// those with valid destinations instead of firing an error event.
return;
}
if (aName == nsGkAtoms::crossorigin) {
CORSMode corsMode = Element::AttrValueToCORSMode(aValue);
CORSMode oldCorsMode = Element::AttrValueToCORSMode(aOldValue);
if (corsMode != oldCorsMode) {
nsContentUtils::DispatchEventForPreloadURI(domNode, policyType);
}
return;
}
nsAutoString oldValue;
if (aOldValue) {
aOldValue->ToString(oldValue);
} else {
oldValue = EmptyString();
}
nsContentPolicyType oldPolicyType = nsIContentPolicy::TYPE_INVALID;
if (aName == nsGkAtoms::as) {
if (aOldValue) {
CheckPreloadAttrs(oldPolicyType, aName, oldValue, mElement);
}
} else if (aName == nsGkAtoms::type) {
if (CheckPreloadAttrs(oldPolicyType, aName, oldValue, mElement)) {
oldPolicyType = policyType;
} else {
oldPolicyType = nsIContentPolicy::TYPE_INVALID;
}
} else if (aName == nsGkAtoms::media) {
if (CheckPreloadAttrs(oldPolicyType, aName, oldValue, mElement)) {
oldPolicyType = policyType;
} else {
oldPolicyType = nsIContentPolicy::TYPE_INVALID;
}
}
// Return early for invalid preloads since we shouldn't trigger a new fetch.
if (policyType == nsIContentPolicy::TYPE_INVALID) {
return;
}
// Fire the associated event if the policy type has changed.
if (policyType != oldPolicyType) {
nsContentUtils::DispatchEventForPreloadURI(domNode, policyType);
}
}
void
Link::CancelPrefetch()
{
@@ -635,6 +786,156 @@ Link::SetHrefAttribute(nsIURI *aURI)
NS_ConvertUTF8toUTF16(href), true);
}
bool
Link::CheckPreloadAttrs(nsContentPolicyType& aPolicyType,
const nsAString& aDestination,
const nsAString& aType,
const nsAString& aMedia,
nsIDocument* aDocument)
{
nsString mimeType;
nsString params;
nsContentUtils::SplitMimeType(aType, mimeType, params);
ToLowerCase(mimeType);
nsAttrValue destinationAttr;
ParseDestinationValue(aDestination, destinationAttr);
aPolicyType = DestinationToContentPolicy(destinationAttr);
if (aPolicyType == nsIContentPolicy::TYPE_INVALID) {
return false;
}
// Check if media attribute is valid.
if (!aMedia.IsEmpty()) {
nsCSSParser cssParser;
RefPtr<nsMediaList> mediaList = new nsMediaList();
cssParser.ParseMediaList(aMedia, nullptr, 0, mediaList, false);
nsIPresShell* shell = aDocument->GetShell();
if (!shell) {
return false;
}
nsPresContext* presContext = shell->GetPresContext();
if (!presContext) {
return false;
}
if (!mediaList->Matches(presContext, nullptr)) {
return false;
}
}
if (mimeType.IsEmpty()) {
return true;
}
switch (aPolicyType) {
case nsIContentPolicy::TYPE_OTHER:
if (destinationAttr.GetEnumValue() == DESTINATION_JSON) {
return nsContentUtils::IsJSONMIMEType(mimeType);
}
return true;
case nsIContentPolicy::TYPE_MEDIA:
if (destinationAttr.GetEnumValue() == DESTINATION_TRACK) {
return mimeType.EqualsASCII(TEXT_VTT);
}
return DecoderTraits::IsSupportedInVideoDocument(NS_ConvertUTF16toUTF8(mimeType));
case nsIContentPolicy::TYPE_FONT:
return nsContentUtils::IsFontMIMEType(mimeType);
case nsIContentPolicy::TYPE_IMAGE:
return imgLoader::SupportImageWithMimeType(NS_ConvertUTF16toUTF8(mimeType).get(),
AcceptedMimeTypes::IMAGES_AND_DOCUMENTS);
case nsIContentPolicy::TYPE_SCRIPT:
return nsContentUtils::IsJavascriptMIMEType(mimeType);
case nsIContentPolicy::TYPE_STYLESHEET:
return mimeType.EqualsASCII(TEXT_CSS);
default:
return false;
}
}
bool
Link::CheckPreloadAttrs(nsContentPolicyType& aPolicyType,
nsIAtom* aName,
const nsAString& aValue,
Element* aElement)
{
nsAutoString destination;
if (aName == nsGkAtoms::as) {
destination = aValue;
} else {
aElement->GetAttr(kNameSpaceID_None, nsGkAtoms::as, destination);
}
nsAutoString type;
if (aName == nsGkAtoms::type) {
type = aValue;
} else {
aElement->GetAttr(kNameSpaceID_None, nsGkAtoms::type, type);
}
nsAutoString media;
if (aName == nsGkAtoms::media) {
media = aValue;
} else {
aElement->GetAttr(kNameSpaceID_None, nsGkAtoms::media, media);
}
return CheckPreloadAttrs(aPolicyType,
destination,
type,
media,
aElement->OwnerDoc());
}
bool
Link::CheckPreloadAttrs(nsContentPolicyType& aPolicyType,
Element* aElement)
{
nsAutoString unused;
return CheckPreloadAttrs(aPolicyType,
nullptr,
unused,
aElement);
}
/* static */ void
Link::ParseDestinationValue(const nsAString& aValue,
nsAttrValue& aResult)
{
// Invalid values are treated as an empty string.
aResult.ParseEnumValue(aValue,
kDestinationAttributeTable,
false,
&kDestinationAttributeTable[0]);
}
/* static */ nsContentPolicyType
Link::DestinationToContentPolicy(const nsAttrValue& aValue)
{
switch (aValue.GetEnumValue()) {
case DESTINATION_AUDIO:
case DESTINATION_TRACK:
case DESTINATION_VIDEO:
return nsIContentPolicy::TYPE_MEDIA;
case DESTINATION_FONT:
return nsIContentPolicy::TYPE_FONT;
case DESTINATION_IMAGE:
return nsIContentPolicy::TYPE_IMAGE;
case DESTINATION_SCRIPT:
return nsIContentPolicy::TYPE_SCRIPT;
case DESTINATION_STYLE:
return nsIContentPolicy::TYPE_STYLESHEET;
case DESTINATION_JSON:
case DESTINATION_FETCH:
return nsIContentPolicy::TYPE_OTHER;
case DESTINATION_INVALID:
default:
return nsIContentPolicy::TYPE_INVALID;
}
}
size_t
Link::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
{
+18 -1
View File
@@ -116,9 +116,26 @@ public:
nsWrapperCache::FlagsType aRequestedFlag);
// This is called by HTMLLinkElement.
void TryDNSPrefetchPreconnectOrPrefetch();
void TrySpeculativeLoadFeature();
void UpdatePreload(nsIAtom* aName,
const nsAttrValue* aValue,
const nsAttrValue* aOldValue);
void CancelPrefetch();
static void ParseDestinationValue(const nsAString& aValue, nsAttrValue& aResult);
static bool CheckPreloadAttrs(nsContentPolicyType& aPolicyType,
Element* aElement);
static bool CheckPreloadAttrs(nsContentPolicyType& aPolicyType,
nsIAtom* aName,
const nsAString& aValue,
Element* aElement);
static bool CheckPreloadAttrs(nsContentPolicyType& aPolicyType,
const nsAString& aAs,
const nsAString& aType,
const nsAString& aMedia,
nsIDocument* aDocument);
static nsContentPolicyType DestinationToContentPolicy(const nsAttrValue& aValue);
protected:
virtual ~Link();
+30
View File
@@ -8,7 +8,9 @@
#include "Navigator.h"
#include "nsIXULAppInfo.h"
#ifdef MOZ_ENABLE_NPAPI
#include "nsPluginArray.h"
#endif
#include "nsMimeTypeArray.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/dom/BodyExtractor.h"
@@ -30,6 +32,7 @@
#include "nsContentUtils.h"
#include "nsUnicharUtils.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/Clipboard.h"
#ifdef MOZ_GAMEPAD
#include "mozilla/dom/GamepadServiceTest.h"
#endif
@@ -178,7 +181,9 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Navigator)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMimeTypes)
#ifdef MOZ_ENABLE_NPAPI
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPlugins)
#endif
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPermissions)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGeolocation)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mNotification)
@@ -209,10 +214,12 @@ Navigator::Invalidate()
mMimeTypes = nullptr;
#ifdef MOZ_ENABLE_NPAPI
if (mPlugins) {
mPlugins->Invalidate();
mPlugins = nullptr;
}
#endif
mPermissions = nullptr;
@@ -488,6 +495,7 @@ Navigator::GetMimeTypes(ErrorResult& aRv)
return mMimeTypes;
}
#ifdef MOZ_ENABLE_NPAPI
nsPluginArray*
Navigator::GetPlugins(ErrorResult& aRv)
{
@@ -502,6 +510,7 @@ Navigator::GetPlugins(ErrorResult& aRv)
return mPlugins;
}
#endif
Permissions*
Navigator::GetPermissions(ErrorResult& aRv)
@@ -662,6 +671,18 @@ Navigator::CpuHasSSE2()
return mozilla::supports_sse2();
}
bool
Navigator::CpuHasAVX()
{
return mozilla::supports_avx();
}
bool
Navigator::CpuHasAVX2()
{
return mozilla::supports_avx2();
}
void
Navigator::RefreshMIMEArray()
{
@@ -1489,5 +1510,14 @@ Navigator::GetUserAgent(nsPIDOMWindowInner* aWindow, nsIURI* aURI,
return siteSpecificUA->GetUserAgentForURIAndWindow(aURI, aWindow, aUserAgent);
}
Clipboard*
Navigator::Clipboard()
{
if (!mClipboard) {
mClipboard = new dom::Clipboard(GetWindow());
}
return mClipboard;
}
} // namespace dom
} // namespace mozilla
+12
View File
@@ -19,7 +19,9 @@
#include "nsTArray.h"
#include "nsWeakPtr.h"
#ifdef MOZ_ENABLE_NPAPI
class nsPluginArray;
#endif
class nsMimeTypeArray;
class nsPIDOMWindowInner;
class nsIDOMNavigatorSystemMessages;
@@ -37,6 +39,7 @@ class WakeLock;
class ArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams;
class ServiceWorkerContainer;
class DOMRequest;
class Clipboard;
} // namespace dom
} // namespace mozilla
@@ -126,7 +129,9 @@ public:
void RegisterContentHandler(const nsAString& aMIMEType, const nsAString& aURL,
const nsAString& aTitle, ErrorResult& aRv);
nsMimeTypeArray* GetMimeTypes(ErrorResult& aRv);
#ifdef MOZ_ENABLE_NPAPI
nsPluginArray* GetPlugins(ErrorResult& aRv);
#endif
Permissions* GetPermissions(ErrorResult& aRv);
bool GlobalPrivacyControl();
Geolocation* GetGeolocation(ErrorResult& aRv);
@@ -169,6 +174,8 @@ public:
bool JavaEnabled(ErrorResult& aRv);
uint64_t HardwareConcurrency();
bool CpuHasSSE2();
bool CpuHasAVX();
bool CpuHasAVX2();
bool TaintEnabled()
{
return false;
@@ -210,6 +217,8 @@ public:
ErrorResult& aRv);
already_AddRefed<ServiceWorkerContainer> ServiceWorker();
dom::Clipboard* Clipboard();
void GetLanguages(nsTArray<nsString>& aLanguages);
@@ -257,12 +266,15 @@ private:
ErrorResult& aRv);
RefPtr<nsMimeTypeArray> mMimeTypes;
#ifdef MOZ_ENABLE_NPAPI
RefPtr<nsPluginArray> mPlugins;
#endif
RefPtr<Permissions> mPermissions;
RefPtr<Geolocation> mGeolocation;
RefPtr<DesktopNotificationCenter> mNotification;
RefPtr<PowerManager> mPowerManager;
RefPtr<network::Connection> mConnection;
RefPtr<dom::Clipboard> mClipboard;
#ifdef MOZ_AUDIO_CHANNEL_MANAGER
RefPtr<system::AudioChannelManager> mAudioChannelManager;
#endif
+1 -2
View File
@@ -109,9 +109,8 @@ ShadowRoot::CloneInternalDataFrom(ShadowRoot* aOther)
for (size_t i = 0; i < sheetCount; ++i) {
StyleSheet* sheet = aOther->SheetAt(i);
if (sheet && sheet->IsApplicable()) {
// TODO: Remove AsGecko() call once Stylo is removed.
RefPtr<CSSStyleSheet> clonedSheet =
sheet->AsGecko()->Clone(nullptr, nullptr, nullptr, nullptr);
sheet->AsConcrete()->Clone(nullptr, nullptr, nullptr, nullptr);
if (clonedSheet) {
AppendStyleSheet(*clonedSheet);
}
+10 -4
View File
@@ -2548,16 +2548,22 @@ WebSocket::Close(const Optional<uint16_t>& aCode,
return;
}
// If the webSocket is not closed we MUST have a mImpl.
MOZ_ASSERT(mImpl);
// If we don't have mImpl, we are in a shutting down worker where we are still
// in CONNECTING state, but already disconnected internally.
if (!mImpl) {
MOZ_ASSERT(readyState == CONNECTING);
SetReadyState(CLOSING);
return;
}
RefPtr<WebSocketImpl> impl = mImpl;
if (readyState == CONNECTING) {
mImpl->FailConnection(closeCode, closeReason);
impl->FailConnection(closeCode, closeReason);
return;
}
MOZ_ASSERT(readyState == OPEN);
mImpl->CloseConnection(closeCode, closeReason);
impl->CloseConnection(closeCode, closeReason);
}
//-----------------------------------------------------------------------------
+1 -3
View File
@@ -43,9 +43,7 @@ ShouldExposeChildWindow(nsString& aNameBeingResolved, nsPIDOMWindowOuter* aChild
//
// This is problematic because it allows possibly-malicious and unrelated
// cross-origin subframes to pollute the global namespace of their parent in
// unpredictable ways (see bug 860494). This is also problematic for browser
// engines like Servo that want to run cross-origin script on different
// threads.
// unpredictable ways (see bug 860494).
//
// The naive solution here would be to filter out any cross-origin subframes
// obtained when doing named lookup in global scope. But that is unlikely to
+4 -3
View File
@@ -394,10 +394,11 @@ SOURCES += [
'nsImageLoadingContent.cpp',
# Because of OS X headers.
'nsObjectLoadingContent.cpp',
# nsPluginArray.cpp includes npapi.h indirectly, and that includes a lot of system headers
'nsPluginArray.cpp',
]
if CONFIG['MOZ_ENABLE_NPAPI']:
SOURCES += ['nsPluginArray.cpp']
# Are we targeting x86-32 or x86-64? If so, we want to include SSE2 code for
# nsTextFragment.cpp
if CONFIG['INTEL_ARCHITECTURE']:
@@ -464,7 +465,7 @@ include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
if CONFIG['MOZ_PHOENIX']:
if CONFIG['MOZ_PHOENIX'] or CONFIG['MOZ_XULRUNNER']:
DEFINES['HAVE_SIDEBAR'] = True
if CONFIG['MOZ_X11']:
+9 -16
View File
@@ -16,8 +16,7 @@
#include "nsIAtom.h"
#include "nsUnicharUtils.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/ServoBindingTypes.h"
#include "mozilla/DeclarationBlockInlines.h"
#include "mozilla/css/Declaration.h"
#include "nsContentUtils.h"
#include "nsReadableUtils.h"
#include "prprf.h"
@@ -150,7 +149,7 @@ nsAttrValue::nsAttrValue(nsIAtom* aValue)
SetTo(aValue);
}
nsAttrValue::nsAttrValue(already_AddRefed<DeclarationBlock> aValue,
nsAttrValue::nsAttrValue(already_AddRefed<css::Declaration> aValue,
const nsAString* aSerialized)
: mBits(0)
{
@@ -420,7 +419,7 @@ nsAttrValue::SetTo(double aValue, const nsAString* aSerialized)
}
void
nsAttrValue::SetTo(already_AddRefed<DeclarationBlock> aValue,
nsAttrValue::SetTo(already_AddRefed<css::Declaration> aValue,
const nsAString* aSerialized)
{
MiscContainer* cont = EnsureEmptyMiscContainer();
@@ -643,7 +642,7 @@ nsAttrValue::ToString(nsAString& aResult) const
{
aResult.Truncate();
MiscContainer *container = GetMiscContainer();
if (DeclarationBlock* decl = container->mValue.mCSSDeclaration) {
if (css::Declaration* decl = container->mValue.mCSSDeclaration) {
decl->ToString(aResult);
}
const_cast<nsAttrValue*>(this)->SetMiscAtomOrString(&aResult);
@@ -1748,15 +1747,11 @@ nsAttrValue::ParseStyleAttribute(const nsAString& aString,
}
}
RefPtr<DeclarationBlock> decl;
if (ownerDoc->GetStyleBackendType() == StyleBackendType::Servo) {
decl = ServoDeclarationBlock::FromCssText(aString);
} else {
css::Loader* cssLoader = ownerDoc->CSSLoader();
nsCSSParser cssParser(cssLoader);
decl = cssParser.ParseStyleAttribute(aString, docURI, baseURI,
aElement->NodePrincipal());
}
RefPtr<css::Declaration> decl;
css::Loader* cssLoader = ownerDoc->CSSLoader();
nsCSSParser cssParser(cssLoader);
decl = cssParser.ParseStyleAttribute(aString, docURI, baseURI,
aElement->NodePrincipal());
if (!decl) {
return false;
}
@@ -1988,8 +1983,6 @@ nsAttrValue::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
if (Type() == eCSSDeclaration && container->mValue.mCSSDeclaration) {
// TODO: mCSSDeclaration might be owned by another object which
// would make us count them twice, bug 677493.
// Bug 1281964: For ServoDeclarationBlock if we do measure we'll
// need a way to call the Servo heap_size_of function.
//n += container->mCSSDeclaration->SizeOfIncludingThis(aMallocSizeOf);
} else if (Type() == eAtomArray && container->mValue.mAtomArray) {
// Don't measure each nsIAtom, they are measured separatly.
+4 -4
View File
@@ -36,8 +36,8 @@ class nsStyledElement;
struct MiscContainer;
namespace mozilla {
class DeclarationBlock;
namespace css {
class Declaration;
struct URLValue;
struct ImageValue;
} // namespace css
@@ -122,7 +122,7 @@ public:
nsAttrValue(const nsAttrValue& aOther);
explicit nsAttrValue(const nsAString& aValue);
explicit nsAttrValue(nsIAtom* aValue);
nsAttrValue(already_AddRefed<mozilla::DeclarationBlock> aValue,
nsAttrValue(already_AddRefed<mozilla::css::Declaration> aValue,
const nsAString* aSerialized);
explicit nsAttrValue(const nsIntMargin& aValue);
~nsAttrValue();
@@ -148,7 +148,7 @@ public:
void SetTo(int16_t aInt);
void SetTo(int32_t aInt, const nsAString* aSerialized);
void SetTo(double aValue, const nsAString* aSerialized);
void SetTo(already_AddRefed<mozilla::DeclarationBlock> aValue,
void SetTo(already_AddRefed<mozilla::css::Declaration> aValue,
const nsAString* aSerialized);
void SetTo(mozilla::css::URLValue* aValue, const nsAString* aSerialized);
void SetTo(const nsIntMargin& aValue);
@@ -200,7 +200,7 @@ public:
inline int16_t GetEnumValue() const;
inline float GetPercentValue() const;
inline AtomArray* GetAtomArrayValue() const;
inline mozilla::DeclarationBlock* GetCSSDeclarationValue() const;
inline mozilla::css::Declaration* GetCSSDeclarationValue() const;
inline mozilla::css::URLValue* GetURLValue() const;
inline mozilla::css::ImageValue* GetImageValue() const;
inline double GetDoubleValue() const;
+2 -2
View File
@@ -30,7 +30,7 @@ struct MiscContainer final
nscolor mColor;
uint32_t mEnumValue;
int32_t mPercent;
mozilla::DeclarationBlock* mCSSDeclaration;
mozilla::css::Declaration* mCSSDeclaration;
mozilla::css::URLValue* mURL;
mozilla::css::ImageValue* mImage;
nsAttrValue::AtomArray* mAtomArray;
@@ -145,7 +145,7 @@ nsAttrValue::GetAtomArrayValue() const
return GetMiscContainer()->mValue.mAtomArray;
}
inline mozilla::DeclarationBlock*
inline mozilla::css::Declaration*
nsAttrValue::GetCSSDeclarationValue() const
{
NS_PRECONDITION(Type() == eCSSDeclaration, "wrong type");
+1 -2
View File
@@ -84,8 +84,7 @@ private:
nsIContent **outImageOrLinkNode,
bool* outDragSelectedText);
static already_AddRefed<nsIContent> FindParentLinkNode(nsIContent* inNode);
static [[nodiscard]] nsresult
GetAnchorURL(nsIContent* inNode, nsAString& outURL);
[[nodiscard]] static nsresult GetAnchorURL(nsIContent* inNode, nsAString& outURL);
static void GetNodeString(nsIContent* inNode, nsAString & outNodeString);
static void CreateLinkText(const nsAString& inURL, const nsAString & inText,
nsAString& outLinkText);
+1
View File
@@ -135,6 +135,7 @@ NS_CP_ContentTypeName(uint32_t contentType)
CASE_RETURN( TYPE_INTERNAL_STYLESHEET );
CASE_RETURN( TYPE_INTERNAL_STYLESHEET_PRELOAD );
CASE_RETURN( TYPE_SAVEAS_DOWNLOAD );
CASE_RETURN( TYPE_INTERNAL_WORKER_IMPORT_SCRIPTS );
default:
return "<Unknown Type>";
}
+57 -16
View File
@@ -48,6 +48,7 @@
#include "nsIObserverService.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/ScriptLoader.h"
#include "mozilla/dom/Link.h"
#include "nsParserConstants.h"
#include "nsSandboxFlags.h"
@@ -100,6 +101,7 @@ nsContentSink::nsContentSink()
, mDeferredFlushTags(0)
, mIsDocumentObserver(0)
, mRunsToCompletion(0)
, mIsBlockingOnload(false)
, mDeflectedCount(0)
, mHasPendingEvent(false)
, mCurrentParseEndTime(0)
@@ -470,6 +472,7 @@ nsContentSink::ProcessLinkHeader(const nsAString& aLinkData)
nsAutoString media;
nsAutoString anchor;
nsAutoString crossOrigin;
nsAutoString destination;
crossOrigin.SetIsVoid(true);
@@ -652,6 +655,11 @@ nsContentSink::ProcessLinkHeader(const nsAString& aLinkData)
crossOrigin = value;
crossOrigin.StripWhitespace();
}
} else if (attr.LowerCaseEqualsLiteral("as")) {
if (destination.IsEmpty()) {
destination = value;
destination.StripWhitespace();
}
}
}
}
@@ -665,7 +673,7 @@ nsContentSink::ProcessLinkHeader(const nsAString& aLinkData)
rv = ProcessLink(anchor, href, rel,
// prefer RFC 5987 variant over non-I18zed version
titleStar.IsEmpty() ? title : titleStar,
type, media, crossOrigin);
type, media, crossOrigin, destination);
}
href.Truncate();
@@ -675,6 +683,7 @@ nsContentSink::ProcessLinkHeader(const nsAString& aLinkData)
media.Truncate();
anchor.Truncate();
crossOrigin.SetIsVoid(true);
destination.Truncate();
seenParameters = false;
}
@@ -687,7 +696,7 @@ nsContentSink::ProcessLinkHeader(const nsAString& aLinkData)
rv = ProcessLink(anchor, href, rel,
// prefer RFC 5987 variant over non-I18zed version
titleStar.IsEmpty() ? title : titleStar,
type, media, crossOrigin);
type, media, crossOrigin, destination);
}
return rv;
@@ -698,7 +707,8 @@ nsresult
nsContentSink::ProcessLink(const nsSubstring& aAnchor, const nsSubstring& aHref,
const nsSubstring& aRel, const nsSubstring& aTitle,
const nsSubstring& aType, const nsSubstring& aMedia,
const nsSubstring& aCrossOrigin)
const nsSubstring& aCrossOrigin,
const nsSubstring& aDestination)
{
uint32_t linkTypes =
nsStyleLinkElement::ParseLinkTypes(aRel, mDocument->NodePrincipal());
@@ -715,18 +725,21 @@ nsContentSink::ProcessLink(const nsSubstring& aAnchor, const nsSubstring& aHref,
return NS_OK;
}
bool hasPrefetch = linkTypes & nsStyleLinkElement::ePREFETCH;
// prefetch href if relation is "next" or "prefetch"
if (hasPrefetch || (linkTypes & nsStyleLinkElement::eNEXT)) {
PrefetchHref(aHref, mDocument, hasPrefetch);
if ((linkTypes & nsStyleLinkElement::eNEXT) ||
(linkTypes & nsStyleLinkElement::ePREFETCH) ||
(linkTypes & nsStyleLinkElement::ePRELOAD)) {
PrefetchOrPreloadHref(aHref, mDocument, linkTypes, aDestination, aType, aMedia);
}
if (!aHref.IsEmpty() && (linkTypes & nsStyleLinkElement::eDNS_PREFETCH)) {
PrefetchDNS(aHref);
}
if (!aHref.IsEmpty()) {
if (linkTypes & nsStyleLinkElement::eDNS_PREFETCH) {
PrefetchDNS(aHref);
}
if (!aHref.IsEmpty() && (linkTypes & nsStyleLinkElement::ePRECONNECT)) {
Preconnect(aHref, aCrossOrigin);
if (linkTypes & nsStyleLinkElement::ePRECONNECT) {
Preconnect(aHref, aCrossOrigin);
}
}
// is it a stylesheet link?
@@ -846,9 +859,12 @@ nsContentSink::ProcessMETATag(nsIContent* aContent)
void
nsContentSink::PrefetchHref(const nsAString &aHref,
nsINode *aSource,
bool aExplicit)
nsContentSink::PrefetchOrPreloadHref(const nsAString &aHref,
nsINode *aSource,
uint32_t aLinkTypes,
const nsAString& aDestination,
const nsAString& aType,
const nsAString& aMedia)
{
nsCOMPtr<nsIPrefetchService> prefetchService(do_GetService(NS_PREFETCHSERVICE_CONTRACTID));
if (prefetchService) {
@@ -860,7 +876,25 @@ nsContentSink::PrefetchHref(const nsAString &aHref,
mDocument->GetDocBaseURI());
if (uri) {
nsCOMPtr<nsIDOMNode> domNode = do_QueryInterface(aSource);
prefetchService->PrefetchURI(uri, mDocumentURI, domNode, aExplicit);
if (aLinkTypes & nsStyleLinkElement::ePRELOAD) {
nsContentPolicyType policyType;
bool isPreloadValid = Link::CheckPreloadAttrs(policyType,
aDestination,
aType,
aMedia,
mDocument);
if (!isPreloadValid) {
// XXX: WPTs expect that we timeout on invalid preloads including
// those with valid destinations instead of firing an error event.
return;
}
nsContentUtils::DispatchEventForPreloadURI(domNode, policyType);
} else {
prefetchService->PrefetchURI(uri,
mDocumentURI,
domNode,
aLinkTypes & nsStyleLinkElement::ePREFETCH);
}
}
}
}
@@ -1539,8 +1573,14 @@ nsContentSink::DropParserAndPerfHint(void)
FavorPerformanceHint(true, 0);
}
if (!mRunsToCompletion) {
// Call UnblockOnload only if mRunsToComletion is false and if
// we have already started loading because it's possible that this function
// is called (i.e. the parser is terminated) before we start loading due to
// destroying the window inside unload event callbacks for the previous
// document.
if (!mRunsToCompletion && mIsBlockingOnload) {
mDocument->UnblockOnload(true);
mIsBlockingOnload = false;
}
}
@@ -1595,6 +1635,7 @@ nsContentSink::WillBuildModelImpl()
{
if (!mRunsToCompletion) {
mDocument->BlockOnload();
mIsBlockingOnload = true;
mBeginLoadTime = PR_IntervalToMicroseconds(PR_IntervalNow());
}
+10 -3
View File
@@ -153,7 +153,8 @@ protected:
nsresult ProcessLink(const nsSubstring& aAnchor,
const nsSubstring& aHref, const nsSubstring& aRel,
const nsSubstring& aTitle, const nsSubstring& aType,
const nsSubstring& aMedia, const nsSubstring& aCrossOrigin);
const nsSubstring& aMedia, const nsSubstring& aCrossOrigin,
const nsSubstring& aDestination);
virtual nsresult ProcessStyleLink(nsIContent* aElement,
const nsSubstring& aHref,
@@ -162,8 +163,12 @@ protected:
const nsSubstring& aType,
const nsSubstring& aMedia);
void PrefetchHref(const nsAString &aHref, nsINode *aSource,
bool aExplicit);
void PrefetchOrPreloadHref(const nsAString &aHref,
nsINode *aSource,
uint32_t aLinkTypes,
const nsAString& aDestination,
const nsAString& aType,
const nsAString& aMedia);
// For PrefetchDNS() aHref can either be the usual
// URI format or of the form "//www.hostname.com" without a scheme.
@@ -304,6 +309,8 @@ protected:
// True if this is parser is a fragment parser or an HTML DOMParser.
// XML DOMParser leaves this to false for now!
uint8_t mRunsToCompletion : 1;
// True if we are blocking load event.
bool mIsBlockingOnload : 1;
//
// -- Can interrupt parsing members --
+214 -36
View File
@@ -23,7 +23,9 @@
#include "Layers.h"
#include "MediaDecoder.h"
// nsNPAPIPluginInstance must be included before nsIDocument.h, which is included in mozAutoDocUpdate.h.
#ifdef MOZ_ENABLE_NPAPI
#include "nsNPAPIPluginInstance.h"
#endif
#include "gfxDrawable.h"
#include "gfxPrefs.h"
#include "ImageOps.h"
@@ -216,6 +218,7 @@
#include "TabChild.h"
#include "mozilla/dom/DocGroup.h"
#include "mozilla/dom/TabGroup.h"
#include "mozilla/AsyncEventDispatcher.h"
#include "nsIBidiKeyboard.h"
@@ -294,6 +297,7 @@ bool nsContentUtils::sGettersDecodeURLHash = false;
bool nsContentUtils::sPrivacyResistFingerprinting = false;
bool nsContentUtils::sSendPerformanceTimingNotifications = false;
bool nsContentUtils::sUseActivityCursor = false;
bool nsContentUtils::sPreloadEnabled = true;
uint32_t nsContentUtils::sHandlingInputTimeout = 1000;
@@ -632,6 +636,9 @@ nsContentUtils::Init()
Preferences::AddBoolVarCache(&sUseActivityCursor,
"ui.use_activity_cursor", false);
Preferences::AddBoolVarCache(&sPreloadEnabled,
"network.preload", true);
Element::InitCCCallbacks();
nsCOMPtr<nsIUUIDGenerator> uuidGenerator =
@@ -733,20 +740,40 @@ nsContentUtils::InitializeModifierStrings()
sModifierSeparator = new nsString(modifierSeparator);
}
mozilla::EventClassID
nsContentUtils::GetEventClassIDFromMessage(EventMessage aEventMessage)
{
switch (aEventMessage) {
#define MESSAGE_TO_EVENT(name_, message_, type_, struct_) \
case message_: return struct_;
#include "mozilla/EventNameList.h"
#undef MESSAGE_TO_EVENT
default:
MOZ_ASSERT_UNREACHABLE("Invalid event message?");
return eBasicEventClass;
}
}
static nsIAtom*
GetEventTypeFromMessage(EventMessage aEventMessage)
{
switch (aEventMessage) {
#define MESSAGE_TO_EVENT(name_, message_, type_, struct_) \
case message_: return nsGkAtoms::on##name_;
#include "mozilla/EventNameList.h"
#undef MESSAGE_TO_EVENT
default:
return nullptr;
}
}
// Because of SVG/SMIL we have several atoms mapped to the same
// id, but we can rely on MESSAGE_TO_EVENT to map id to only one atom.
static bool
ShouldAddEventToStringEventTable(const EventNameMapping& aMapping)
{
switch(aMapping.mMessage) {
#define MESSAGE_TO_EVENT(name_, message_, type_, struct_) \
case message_: return nsGkAtoms::on##name_ == aMapping.mAtom;
#include "mozilla/EventNameList.h"
#undef MESSAGE_TO_EVENT
default:
break;
}
return false;
MOZ_ASSERT(aMapping.mAtom);
return GetEventTypeFromMessage(aMapping.mMessage) == aMapping.mAtom;
}
bool
@@ -2395,34 +2422,35 @@ nsContentUtils::GetCommonAncestor(nsIDOMNode *aNode,
return CallQueryInterface(common, aCommonAncestor);
}
// static
nsINode*
nsContentUtils::GetCommonAncestor(nsINode* aNode1,
nsINode* aNode2)
template <typename Node, typename GetParentFunc>
static Node*
GetCommonAncestorInternal(Node* aNode1,
Node* aNode2,
GetParentFunc aGetParentFunc)
{
if (aNode1 == aNode2) {
return aNode1;
}
// Build the chain of parents
AutoTArray<nsINode*, 30> parents1, parents2;
AutoTArray<Node*, 30> parents1, parents2;
do {
parents1.AppendElement(aNode1);
aNode1 = aNode1->GetParentNode();
aNode1 = aGetParentFunc(aNode1);
} while (aNode1);
do {
parents2.AppendElement(aNode2);
aNode2 = aNode2->GetParentNode();
aNode2 = aGetParentFunc(aNode2);
} while (aNode2);
// Find where the parent chain differs
uint32_t pos1 = parents1.Length();
uint32_t pos2 = parents2.Length();
nsINode* parent = nullptr;
Node* parent = nullptr;
uint32_t len;
for (len = std::min(pos1, pos2); len > 0; --len) {
nsINode* child1 = parents1.ElementAt(--pos1);
nsINode* child2 = parents2.ElementAt(--pos2);
Node* child1 = parents1.ElementAt(--pos1);
Node* child2 = parents2.ElementAt(--pos2);
if (child1 != child2) {
break;
}
@@ -2432,6 +2460,25 @@ nsContentUtils::GetCommonAncestor(nsINode* aNode1,
return parent;
}
/* static */
nsINode*
nsContentUtils::GetCommonAncestor(nsINode* aNode1, nsINode* aNode2)
{
return GetCommonAncestorInternal(aNode1, aNode2, [](nsINode* aNode) {
return aNode->GetParentNode();
});
}
/* static */
nsIContent*
nsContentUtils::GetCommonFlattenedTreeAncestor(nsIContent* aContent1,
nsIContent* aContent2)
{
return GetCommonAncestorInternal(aContent1, aContent2, [](nsIContent* aContent) {
return aContent->GetFlattenedTreeParent();
});
}
// static
nsINode*
nsContentUtils::GetCommonAncestorUnderInteractiveContent(nsINode* aNode1,
@@ -4100,12 +4147,36 @@ nsresult GetEventAndTarget(nsIDocument* aDoc, nsISupports* aTarget,
return NS_OK;
}
void
nsContentUtils::DispatchEventForPreloadURI(nsIDOMNode* aNode,
nsContentPolicyType& aPolicyType)
{
if (!IsPreloadEnabled()) {
return;
}
nsCOMPtr<nsINode> domNode = do_QueryInterface(aNode);
if (domNode && domNode->IsInComposedDoc()) {
bool success = aPolicyType != nsIContentPolicy::TYPE_INVALID;
RefPtr<AsyncEventDispatcher> asyncDispatcher =
new AsyncEventDispatcher(domNode,
success ?
NS_LITERAL_STRING("load") :
NS_LITERAL_STRING("error"),
/* aCanBubble = */ false,
/* aCancelable = */ false);
asyncDispatcher->RunDOMEventWhenSafe();
}
}
// static
nsresult
nsContentUtils::DispatchTrustedEvent(nsIDocument* aDoc, nsISupports* aTarget,
nsContentUtils::DispatchTrustedEvent(nsIDocument* aDoc,
nsISupports* aTarget,
const nsAString& aEventName,
bool aCanBubble, bool aCancelable,
bool *aDefaultAction)
bool aCanBubble,
bool aCancelable,
bool* aDefaultAction)
{
return DispatchEvent(aDoc, aTarget, aEventName, aCanBubble, aCancelable,
true, aDefaultAction);
@@ -4113,10 +4184,12 @@ nsContentUtils::DispatchTrustedEvent(nsIDocument* aDoc, nsISupports* aTarget,
// static
nsresult
nsContentUtils::DispatchUntrustedEvent(nsIDocument* aDoc, nsISupports* aTarget,
nsContentUtils::DispatchUntrustedEvent(nsIDocument* aDoc,
nsISupports* aTarget,
const nsAString& aEventName,
bool aCanBubble, bool aCancelable,
bool *aDefaultAction)
bool aCanBubble,
bool aCancelable,
bool* aDefaultAction)
{
return DispatchEvent(aDoc, aTarget, aEventName, aCanBubble, aCancelable,
false, aDefaultAction);
@@ -4124,10 +4197,13 @@ nsContentUtils::DispatchUntrustedEvent(nsIDocument* aDoc, nsISupports* aTarget,
// static
nsresult
nsContentUtils::DispatchEvent(nsIDocument* aDoc, nsISupports* aTarget,
nsContentUtils::DispatchEvent(nsIDocument* aDoc,
nsISupports* aTarget,
const nsAString& aEventName,
bool aCanBubble, bool aCancelable,
bool aTrusted, bool *aDefaultAction,
bool aCanBubble,
bool aCancelable,
bool aTrusted,
bool* aDefaultAction,
bool aOnlyChromeDispatch)
{
nsCOMPtr<nsIDOMEvent> event;
@@ -4142,12 +4218,50 @@ nsContentUtils::DispatchEvent(nsIDocument* aDoc, nsISupports* aTarget,
return target->DispatchEvent(event, aDefaultAction ? aDefaultAction : &dummy);
}
// static
nsresult
nsContentUtils::DispatchEvent(nsIDocument* aDoc,
nsISupports* aTarget,
WidgetEvent& aEvent,
EventMessage aEventMessage,
bool aCanBubble,
bool aCancelable,
bool aTrusted,
bool* aDefaultAction,
bool aOnlyChromeDispatch)
{
MOZ_ASSERT_IF(aOnlyChromeDispatch, aTrusted);
nsCOMPtr<EventTarget> target(do_QueryInterface(aTarget));
aEvent.mTime = PR_Now();
aEvent.mSpecifiedEventType = GetEventTypeFromMessage(aEventMessage);
aEvent.SetDefaultComposed();
aEvent.SetDefaultComposedInNativeAnonymousContent();
aEvent.mFlags.mBubbles = aCanBubble;
aEvent.mFlags.mCancelable = aCancelable;
aEvent.mFlags.mOnlyChromeDispatch = aOnlyChromeDispatch;
aEvent.mTarget = target;
nsEventStatus status = nsEventStatus_eIgnore;
nsresult rv = EventDispatcher::DispatchDOMEvent(target, &aEvent, nullptr,
nullptr, &status);
if (aDefaultAction) {
*aDefaultAction = (status != nsEventStatus_eConsumeNoDefault);
}
return rv;
}
nsresult
nsContentUtils::DispatchChromeEvent(nsIDocument *aDoc,
nsISupports *aTarget,
const nsAString& aEventName,
bool aCanBubble, bool aCancelable,
bool *aDefaultAction)
bool aCanBubble,
bool aCancelable,
bool* aDefaultAction)
{
nsCOMPtr<nsIDOMEvent> event;
@@ -5418,10 +5532,18 @@ nsContentUtils::RunInStableState(already_AddRefed<nsIRunnable> aRunnable)
/* static */
void
nsContentUtils::RunInMetastableState(already_AddRefed<nsIRunnable> aRunnable)
nsContentUtils::AddPendingIDBTransaction(already_AddRefed<nsIRunnable> aTransaction)
{
MOZ_ASSERT(CycleCollectedJSContext::Get(), "Must be on a script thread!");
CycleCollectedJSContext::Get()->RunInMetastableState(Move(aRunnable));
CycleCollectedJSContext::Get()->AddPendingIDBTransaction(Move(aTransaction));
}
/* static */
bool
nsContentUtils::IsInStableOrMetaStableState()
{
MOZ_ASSERT(CycleCollectedJSContext::Get(), "Must be on a script thread!");
return CycleCollectedJSContext::Get()->IsInStableOrMetaStableState();
}
/*
@@ -6470,9 +6592,16 @@ nsContentUtils::IsSubDocumentTabbable(nsIContent* aContent)
contentViewer->GetPreviousViewer(getter_AddRefs(zombieViewer));
// If there are 2 viewers for the current docshell, that
// means the current document is a zombie document.
// Only navigate into the subdocument if it's not a zombie.
return !zombieViewer;
// means the current document may be a zombie document.
// While load and pageshow events are dispatched, zombie viewer is the old,
// to be hidden document.
if (zombieViewer) {
bool inOnLoad = false;
docShell->GetIsExecutingOnLoadHandler(&inOnLoad);
return inOnLoad;
}
return true;
}
bool
@@ -6943,7 +7072,7 @@ nsContentUtils::HaveEqualPrincipals(nsIDocument* aDoc1, nsIDocument* aDoc2)
bool
nsContentUtils::HasPluginWithUncontrolledEventDispatch(nsIContent* aContent)
{
#ifdef XP_MACOSX
#if defined(XP_MACOSX) || !defined(MOZ_ENABLE_NPAPI)
// We control dispatch to all mac plugins.
return false;
#else
@@ -7340,6 +7469,12 @@ nsContentUtils::GPCEnabled()
return nsContentUtils::sGPCEnabled;
}
bool
nsContentUtils::IsPreloadEnabled()
{
return nsContentUtils::sPreloadEnabled;
}
mozilla::LogModule*
nsContentUtils::DOMDumpLog()
{
@@ -7404,6 +7539,48 @@ nsContentUtils::IsJavascriptMIMEType(const nsAString& aMIMEType)
return false;
}
bool
nsContentUtils::IsJSONMIMEType(const nsAString& aMIMEType)
{
static const char* jsonTypes[] = {
"text/json",
"application/json",
"application/geo+json",
nullptr
};
for (uint32_t i = 0; jsonTypes[i]; ++i) {
if (aMIMEType.LowerCaseEqualsASCII(jsonTypes[i])) {
return true;
}
}
return false;
}
bool
nsContentUtils::IsFontMIMEType(const nsAString& aMIMEType)
{
// The following list was taken from IANA and excludes deprecated mime-types:
// https://www.iana.org/assignments/media-types/media-types.xhtml#font
static const char* fontTypes[] = {
"font/otf",
"font/sfnt",
"font/ttf",
"font/woff",
"font/woff2",
nullptr
};
for (uint32_t i = 0; fontTypes[i]; ++i) {
if (aMIMEType.LowerCaseEqualsASCII(fontTypes[i])) {
return true;
}
}
return false;
}
nsresult
nsContentUtils::GenerateUUIDInPlace(nsID& aUUID)
{
@@ -8586,6 +8763,7 @@ nsContentUtils::InternalContentPolicyTypeToExternal(nsContentPolicyType aType)
case nsIContentPolicy::TYPE_INTERNAL_WORKER:
case nsIContentPolicy::TYPE_INTERNAL_SHARED_WORKER:
case nsIContentPolicy::TYPE_INTERNAL_SERVICE_WORKER:
case nsIContentPolicy::TYPE_INTERNAL_WORKER_IMPORT_SCRIPTS:
return nsIContentPolicy::TYPE_SCRIPT;
case nsIContentPolicy::TYPE_INTERNAL_EMBED:
+108 -14
View File
@@ -19,6 +19,7 @@
#include "js/TypeDecls.h"
#include "js/Value.h"
#include "js/RootingAPI.h"
#include "mozilla/BasicEvents.h"
#include "mozilla/EventForwards.h"
#include "mozilla/GuardObjects.h"
#include "mozilla/TimeStamp.h"
@@ -333,12 +334,18 @@ public:
nsIDOMNode** aCommonAncestor);
/**
* Returns the common ancestor, if any, for two nodes. Returns null if the
* nodes are disconnected.
* Returns the common ancestor, if any, for two nodes.
* Returns null if the nodes are disconnected.
*/
static nsINode* GetCommonAncestor(nsINode* aNode1,
nsINode* aNode2);
static nsINode* GetCommonAncestor(nsINode* aNode1, nsINode* aNode2);
/**
* Returns the common flattened tree ancestor, if any, for two given content
* nodes.
*/
static nsIContent* GetCommonFlattenedTreeAncestor(nsIContent* aContent1,
nsIContent* aContent2);
/**
* Returns the common ancestor under interactive content, if any.
* If neither one has interactive content as ancestor, common ancestor will be
@@ -1172,6 +1179,16 @@ public:
static void MaybeFireNodeRemoved(nsINode* aChild, nsINode* aParent,
nsIDocument* aOwnerDoc);
/**
* This method creates and dispatches either a "load" or "error" event
* to the provided node (a preload link).
* @param aNode The node to fire the event at.
* @param aPolicyType The resulting content policy from the preload.
*/
static void DispatchEventForPreloadURI(nsIDOMNode* aNode,
nsContentPolicyType& aPolicyType);
/**
* This method creates and dispatches a trusted event.
* Works only with events which can be created by calling
@@ -1192,6 +1209,33 @@ public:
bool aCancelable,
bool *aDefaultAction = nullptr);
/**
* This method creates and dispatches a trusted event using an event message.
* @param aDoc The document which will be used to create the event.
* @param aTarget The target of the event, should be QIable to
* EventTarget.
* @param aEventMessage The event message.
* @param aCanBubble Whether the event can bubble.
* @param aCancelable Is the event cancelable.
* @param aDefaultAction Set to true if default action should be taken,
* see nsIDOMEventTarget::DispatchEvent.
*/
template <class WidgetEventType>
static nsresult DispatchTrustedEvent(nsIDocument* aDoc,
nsISupports* aTarget,
mozilla::EventMessage aEventMessage,
bool aCanBubble,
bool aCancelable,
bool *aDefaultAction = nullptr,
bool aOnlyChromeDispatch = false)
{
WidgetEventType event(true, aEventMessage);
MOZ_ASSERT(GetEventClassIDFromMessage(aEventMessage) == event.mClass);
return DispatchEvent(aDoc, aTarget, event, aEventMessage,
aCanBubble, aCancelable, true,
aDefaultAction, aOnlyChromeDispatch);
}
/**
* This method creates and dispatches a untrusted event.
* Works only with events which can be created by calling
@@ -1212,6 +1256,33 @@ public:
bool aCancelable,
bool *aDefaultAction = nullptr);
/**
* This method creates and dispatches a untrusted event using an event message.
* @param aDoc The document which will be used to create the event.
* @param aTarget The target of the event, should be QIable to
* EventTarget.
* @param aEventMessage The event message.
* @param aCanBubble Whether the event can bubble.
* @param aCancelable Is the event cancelable.
* @param aDefaultAction Set to true if default action should be taken,
* see nsIDOMEventTarget::DispatchEvent.
*/
template <class WidgetEventType>
static nsresult DispatchUntrustedEvent(nsIDocument* aDoc,
nsISupports* aTarget,
mozilla::EventMessage aEventMessage,
bool aCanBubble,
bool aCancelable,
bool *aDefaultAction = nullptr,
bool aOnlyChromeDispatch = false)
{
WidgetEventType event(false, aEventMessage);
MOZ_ASSERT(GetEventClassIDFromMessage(aEventMessage) == event.mClass);
return DispatchEvent(aDoc, aTarget, event, aEventMessage,
aCanBubble, aCancelable, false,
aDefaultAction, aOnlyChromeDispatch);
}
/**
* This method creates and dispatches a trusted event to the chrome
* event handler (the parent object of the DOM Window in the event target
@@ -1767,17 +1838,17 @@ public:
*/
static void RunInStableState(already_AddRefed<nsIRunnable> aRunnable);
/* Add a "synchronous section", in the form of an nsIRunnable run once the
* event loop has reached a "metastable state". |aRunnable| must not cause any
* queued events to be processed (i.e. must not spin the event loop).
* We've reached a metastable state when the currently executing task or
* microtask has finished. This is not specced at this time.
* In practice this runs aRunnable once the currently executing task or
* microtask finishes. If called multiple times per microtask, all the
* runnables will be executed, in the order in which RunInMetastableState()
* was called
/* Add a pending IDBTransaction to be cleaned up at the end of performing a
* microtask checkpoint.
* See the step of "Cleanup Indexed Database Transactions" in
* https://html.spec.whatwg.org/multipage/webappapis.html#perform-a-microtask-checkpoint
*/
static void RunInMetastableState(already_AddRefed<nsIRunnable> aRunnable);
static void AddPendingIDBTransaction(already_AddRefed<nsIRunnable> aTransaction);
/**
* Returns true if we are doing StableState/MetastableState.
*/
static bool IsInStableOrMetaStableState();
/* Process viewport META data. This gives us information for the scale
* and zoom of a page on mobile devices. We stick the information in
@@ -2134,6 +2205,11 @@ public:
return sUseActivityCursor;
}
/**
* Returns true if the preload service is enabled.
*/
static bool IsPreloadEnabled();
/**
* Return true if this doc is controlled by a ServiceWorker.
*/
@@ -2378,6 +2454,10 @@ public:
static bool IsJavascriptMIMEType(const nsAString& aMIMEType);
static bool IsJSONMIMEType(const nsAString& aMIMEType);
static bool IsFontMIMEType(const nsAString& aMIMEType);
static void SplitMimeType(const nsAString& aValue, nsString& aType,
nsString& aParams);
@@ -2859,6 +2939,16 @@ private:
bool *aDefaultAction = nullptr,
bool aOnlyChromeDispatch = false);
static nsresult DispatchEvent(nsIDocument* aDoc,
nsISupports* aTarget,
mozilla::WidgetEvent& aWidgetEvent,
mozilla::EventMessage aEventMessage,
bool aCanBubble,
bool aCancelable,
bool aTrusted,
bool *aDefaultAction = nullptr,
bool aOnlyChromeDispatch = false);
static void InitializeModifierStrings();
static void DropFragmentParsers();
@@ -2870,6 +2960,9 @@ private:
static void* AllocClassMatchingInfo(nsINode* aRootNode,
const nsString* aClasses);
static mozilla::EventClassID
GetEventClassIDFromMessage(mozilla::EventMessage aEventMessage);
// Fills in aInfo with the tokens from the supplied autocomplete attribute.
static AutocompleteAttrState InternalSerializeAutocompleteAttribute(const nsAttrValue* aAttrVal,
mozilla::dom::AutocompleteInfo& aInfo);
@@ -2950,6 +3043,7 @@ private:
static bool sPrivacyResistFingerprinting;
static bool sSendPerformanceTimingNotifications;
static bool sUseActivityCursor;
static bool sPreloadEnabled;
static uint32_t sCookiesLifetimePolicy;
static uint32_t sCookiesBehavior;
-93
View File
@@ -67,21 +67,10 @@
#include "nsIDOMEventTarget.h"
// CSS related includes
#include "nsCSSRules.h"
#include "nsIDOMCSSRule.h"
#include "nsMemory.h"
// includes needed for the prototype chain interfaces
#include "nsIDOMCSSKeyframeRule.h"
#include "nsIDOMCSSKeyframesRule.h"
#include "nsIDOMCSSImportRule.h"
#include "nsIDOMCSSMediaRule.h"
#include "nsIDOMCSSFontFaceRule.h"
#include "nsIDOMCSSMozDocumentRule.h"
#include "nsIDOMCSSSupportsRule.h"
#include "nsIDOMCSSCounterStyleRule.h"
#include "nsIDOMCSSPageRule.h"
#include "nsIDOMCSSStyleRule.h"
#include "nsIDOMXULCommandDispatcher.h"
#include "nsIControllers.h"
#include "nsITreeSelection.h"
@@ -186,16 +175,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
// Misc Core related classes
// CSS classes
NS_DEFINE_CLASSINFO_DATA(CSSStyleRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSImportRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSMediaRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSNameSpaceRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
// XUL classes
NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULCommandDispatcher, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
@@ -212,15 +191,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULTreeBuilder, nsDOMGenericSH,
DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSMozDocumentRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSSupportsRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSFontFaceRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CHROME_ONLY_CLASSINFO_DATA(ContentFrameMessageManager,
nsMessageManagerSH<nsEventTargetSH>,
DOM_DEFAULT_SCRIPTABLE_FLAGS |
@@ -236,21 +206,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
NS_DEFINE_CHROME_ONLY_CLASSINFO_DATA(ChromeMessageSender, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSKeyframeRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSKeyframesRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSCounterStyleRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSPageRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSFontFeatureValuesRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULControlElement, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULLabeledControlElement, nsDOMGenericSH,
@@ -503,22 +458,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDOMConstructor)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSStyleRule, nsIDOMCSSStyleRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSStyleRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSImportRule, nsIDOMCSSImportRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSImportRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSMediaRule, nsIDOMCSSMediaRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSMediaRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(CSSNameSpaceRule, nsIDOMCSSRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(XULCommandDispatcher, nsIDOMXULCommandDispatcher)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULCommandDispatcher)
DOM_CLASSINFO_MAP_END
@@ -546,18 +485,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsITreeView)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSMozDocumentRule, nsIDOMCSSMozDocumentRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSMozDocumentRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSSupportsRule, nsIDOMCSSSupportsRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSSupportsRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSFontFaceRule, nsIDOMCSSFontFaceRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSFontFaceRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(ContentFrameMessageManager, nsISupports)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
DOM_CLASSINFO_MAP_ENTRY(nsIMessageListenerManager)
@@ -589,26 +516,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIMessageSender)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSKeyframeRule, nsIDOMCSSKeyframeRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSKeyframeRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSKeyframesRule, nsIDOMCSSKeyframesRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSKeyframesRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSCounterStyleRule, nsIDOMCSSCounterStyleRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSCounterStyleRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSPageRule, nsIDOMCSSPageRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSPageRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSFontFeatureValuesRule, nsIDOMCSSFontFeatureValuesRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSFontFeatureValuesRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(XULControlElement, nsIDOMXULControlElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULControlElement)
DOM_CLASSINFO_MAP_END
-22
View File
@@ -7,12 +7,6 @@
DOMCI_CLASS(DOMPrototype)
DOMCI_CLASS(DOMConstructor)
// CSS classes
DOMCI_CLASS(CSSStyleRule)
DOMCI_CLASS(CSSImportRule)
DOMCI_CLASS(CSSMediaRule)
DOMCI_CLASS(CSSNameSpaceRule)
// XUL classes
DOMCI_CLASS(XULCommandDispatcher)
DOMCI_CLASS(XULControllers)
@@ -21,27 +15,11 @@ DOMCI_CLASS(TreeContentView)
DOMCI_CLASS(XULTemplateBuilder)
DOMCI_CLASS(XULTreeBuilder)
DOMCI_CLASS(CSSMozDocumentRule)
DOMCI_CLASS(CSSSupportsRule)
// @font-face in CSS
DOMCI_CLASS(CSSFontFaceRule)
DOMCI_CLASS(ContentFrameMessageManager)
DOMCI_CLASS(ContentProcessMessageManager)
DOMCI_CLASS(ChromeMessageBroadcaster)
DOMCI_CLASS(ChromeMessageSender)
DOMCI_CLASS(CSSKeyframeRule)
DOMCI_CLASS(CSSKeyframesRule)
// @counter-style in CSS
DOMCI_CLASS(CSSCounterStyleRule)
DOMCI_CLASS(CSSPageRule)
DOMCI_CLASS(CSSFontFeatureValuesRule)
DOMCI_CLASS(XULControlElement)
DOMCI_CLASS(XULLabeledControlElement)
DOMCI_CLASS(XULButtonElement)
+3 -4
View File
@@ -623,7 +623,7 @@ nsDOMMutationObserver::QueueMutationObserverMicroTask()
RefPtr<MutationObserverMicroTask> momt =
new MutationObserverMicroTask();
ccjs->DispatchMicroTaskRunnable(momt.forget());
ccjs->DispatchToMicroTask(momt.forget());
}
void
@@ -644,9 +644,8 @@ nsDOMMutationObserver::RescheduleForRun()
return;
}
RefPtr<MutationObserverMicroTask> momt =
new MutationObserverMicroTask();
ccjs->DispatchMicroTaskRunnable(momt.forget());
RefPtr<MutationObserverMicroTask> momt = new MutationObserverMicroTask();
ccjs->DispatchToMicroTask(momt.forget());
sScheduledMutationObservers = new AutoTArray<RefPtr<nsDOMMutationObserver>, 4>;
}
-1
View File
@@ -162,7 +162,6 @@ public:
inline DOMHighResTimeStamp TimeStampToDOMHighRes(mozilla::TimeStamp aStamp) const
{
MOZ_ASSERT(!aStamp.IsNull(), "The timestamp should not be null");
if (aStamp.IsNull()) {
return 0;
}
+3
View File
@@ -3145,9 +3145,11 @@ nsDOMWindowUtils::GetPaintingSuppressed(bool *aPaintingSuppressed)
return NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::GetPlugins(JSContext* cx, JS::MutableHandle<JS::Value> aPlugins)
{
#ifdef MOZ_ENABLE_NPAPI
nsCOMPtr<nsIDocument> doc = GetDocument();
NS_ENSURE_STATE(doc);
@@ -3159,6 +3161,7 @@ nsDOMWindowUtils::GetPlugins(JSContext* cx, JS::MutableHandle<JS::Value> aPlugin
NS_ENSURE_SUCCESS(rv, rv);
aPlugins.setObject(*jsPlugins);
#endif
return NS_OK;
}
Loaded 100 of 2899 files, more files were not shown because too many files have changed in this diff. Show more