Commit graph

6,021 commits

Author SHA1 Message Date
Moonchild
fffe6c4996 Issue #2542 - Part 7: Move SecFetch.* to /netwerk where it belongs. 2024-07-10 14:49:06 +08:00
Moonchild
53149ed646 Issue #2542 - Part 6: Add Sec-Fetch-User header for all requests that are the direct result of a system principal request.
This means navigation resulting from interaction with the browser UI
should result in a -user header (address bar navigation, bookmarks, etc.)
2024-07-10 14:48:35 +08:00
Moonchild
0ef8b05101 Issue #2542 - Part 5: Assume browser-initiated requests for unspecified content types to always be user-triggered. 2024-07-10 14:48:15 +08:00
Moonchild
9846090a38 Issue #2542 - Part 4b: Fix pointer mess-up. 2024-07-10 14:47:58 +08:00
Moonchild
65a588ba17 Issue #2542 - Part 4: Use BasePrincipal's IsSameOrigin() in SecFetch. 2024-07-10 14:47:20 +08:00
Moonchild
5ee2871524 Issue #2542 - Part 3: Expand BasePrincipal with an IsSameOrigin check
Manual checking of the origins in SecFetch fails, so we add this
capability to the base principal interface for sake of ease.
We could use ScriptSecurityManager directly but it's more convenient
this way and can be re-used elsewhere in the future.
2024-07-10 14:47:01 +08:00
Moonchild
8ee9e3bc52 Issue #2542 - Part 2b: Fix typo in pref check 2024-07-10 14:46:36 +08:00
Moonchild
8076de8965 Issue #2542 - Part 2: Base implementation of Sec-Fetch-* header code.
Currently following Mozilla putting stuff in /dom for additional porting,
but it's actually the wrong location since it belongs in /netwerk with
the other code that deals with http headers.
2024-07-10 14:45:39 +08:00
Moonchild
1f4b858be2 Issue #2542 - Part 1b: Fix dom.securecontext.whitelist code issues
Some minor bugfixes (wrong condition and string type)
2024-07-10 14:44:56 +08:00
Moonchild
0c71a6ada0 Issue #2542 - Part 1: Factor out Potentially Trustworthy URI checks.
For sake of ease of use, converted to boolean functions that just assume "false"
in case of errors.

Note: Mozilla makes special arrangements for .onion addresses as well but
we explicitly do not adopt that. TOR browser can do that all day if it wants.
2024-07-10 14:44:37 +08:00
Moonchild
f86664f131 Issue #2045 - Temporarily force hidden elements to be actually hidden.
For the time being, because we don't have `revert` yet, we should force
normally hidden elements to be hidden, so they aren't revealed by sites
using the bad practice of `*{ }` style blanking rules but then using
`revert` to re-hide them.
2024-07-09 10:25:58 +08:00
Moonchild
ef1f142cde Issue #2531 - Adjust rounding in toExponential (and kin) to round up at midpoint.
Resolves #2531
2024-07-02 22:08:14 +08:00
Moonchild
f4b6cee0cc Issue #2543 - adjust toFixed precision range according to spec update.
As pointed out in the ecma-262 spec change discussion, the behavior is
inconsistent for negative numbers because the exponential fallback assumes
all the digits will be displayed. The negative support was motivated just
by consistency, without any particular concrete use cases, and it's not
supported in other browsers, so this patch removes negatives.

Resolves #2543
2024-07-02 22:07:55 +08:00
Moonchild
5bdec62cb0 Issue #2541 - Deal with empty LineNameList in CSS grid templates.
Resolves #2541
2024-07-01 06:58:50 +08:00
Moonchild
6525b2980c Issue #2537 - Don't assume username fields appear before password fields in forms. 2024-06-28 22:06:02 +08:00
Andy
44f81b46b6 Issue #2538 - Part 3: Bring ZWJ Awareness to ClusterReverseIterator
Additional patch to resolve a bug exposed while working on the Cluster issue.
2024-06-28 22:05:40 +08:00
Andy
68bcd4e61e Issue #2538 - Part 2: Add IsEmojiClusterExtender
Check specifically for Emoji-specific clusters only in Emoji-specific contexts.
2024-06-28 22:05:20 +08:00
Andy
a1b6142e18 Issue #2538 - Part 1: Undo IsClusterExtender Change
This partially reverts commit 49b7816286498e9ad5b48864847f0a2adabff318.
So much for getting rid of the stupid constants...
2024-06-28 22:04:50 +08:00
Moonchild
af227c4574 Issue #2534 - Part 2: Update tests 2024-06-24 23:11:39 +08:00
Moonchild
fb16b1b4ae Issue #2534 - Part 1: window.postMessage should provide a trusted MessageEvent 2024-06-24 23:11:25 +08:00
Moonchild
22f745761b Issue #2536 - Re-implement plugin enumeration shuffle.
Resolves #2536
2024-06-24 23:11:06 +08:00
Moonchild
6a200d5284 No Issue - Add navigator.webdriver attribute.
This patch adds an enumerable, configurable, readonly attribute "webdriver" to
the Navigator object. The attribute is always false because we do not support
WebDriver or scripted automation.

The navigator.webdriver attribute is meant as an indication to web authors that
a document is visited by WebDriver. It is important to stress that it is not
meant as a way to detect that a website is being visited by a browser automation
tool or bot, but as a tool for web documents to take alternate code paths.

On the off-chance exposing navigator.webdriver turns out to be catastrophic,
we put it behind a new preference dom.webdriver.enabled that controls its
exposure.
2024-06-17 16:14:48 +08:00
Moonchild
1db268ef50 Issue #2532 - 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

See Bug 1719872
2024-06-17 16:12:14 +08:00
Moonchild
b6d077bbbb Issue #2532 - Prevent unwanted text selection when backdrop is clicked. 2024-06-17 16:12:00 +08:00
Moonchild
368ee51d86 Issue #2532 - 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.

See Bug 1649278
2024-06-17 16:11:45 +08:00
Moonchild
f50948c82a Issue #2532 - Fix a null pointer crash while doing dialog form submission
See Bug 1652699
2024-06-17 16:11:29 +08:00
Moonchild
f598fe63cd Issue #2532 - Default pref check to true 2024-06-17 16:11:07 +08:00
Moonchild
6ee3f46900 Issue #2532 - Implement form[method=dialog]
See bug 1557303
2024-06-17 16:10:50 +08:00
Richard-Rogalski
b73f500c04 PR #2530 - Fix altivec code, fix building for PPC
Altivec code was previously uncompilable, and the altivec accelerations
also could not be disabled with a build flag or env variable, leading
to pale moon not being buildable on any altivec supported CPU ( all
PPC CPUs ever almost ). Why? I don't know, 'inline' in C is cursed
and making it static makes it significantly less so.

Closes: https://forum.palemoon.org/viewtopic.php?f=5&t=31108&p=252462#p252462
Signed-off-by: Richard Rogalski <rrogalski@firemail.cc>
2024-06-17 16:10:19 +08:00
Daniel Holbert
0e05cb9630 [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-13 11:31:46 +08:00
Moonchild
9c8bd37fe5 [uri] Implement additional filename checks. 2024-06-13 11:31:03 +08:00
Moonchild
40c9102d6d [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-13 11:30:25 +08:00
Moonchild
b4caa69a9c [toolkit] Close autocomplete popup when window is resized. 2024-06-13 11:29:32 +08:00
Moonchild
a2417d573b [DOM] Clone video info properly. 2024-06-13 11:28:58 +08:00
Moonchild
a09accc204 [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 15:41:01 +08:00
Moonchild
bcdf7dc845 [network] Avoid accessing raw pointers in nsTransportEventSinkProxy. 2024-06-12 15:12:37 +08:00
Moonchild
bfb171c783 [network] Perform a case-insensitive match on special cookie prefixes. 2024-06-12 15:11:50 +08:00
FranklinDM
2ba31f4e97 Issue #2522 - Part 2: Implement support for logical viewport units 2024-06-11 10:14:40 +08:00
FranklinDM
5c06335c5b Issue #2522 - Part 1: Alias small, large, and dynamic viewport units to base viewport 2024-06-11 10:14:27 +08:00
Moonchild
359a4a2069 Issue #2524 - Implement smart granularity for canvas poisoning.
User-configurable time interval between 1s and 8h. Default 5 minutes.
Resolves #2524
2024-06-11 10:14:09 +08:00
Moonchild
91fc5614ec Issue #1749 - Remove restriction of SVG width/height element attributes.
According to the original SVG spec, the SVG element in documents had to follow
special rules as to what was allowed for width/height attributes. This is no
longer the case, so we can decouple it from whatever internal units SVG/XML
language uses and allow all units like every other element.
2024-06-06 14:11:31 +08:00
Martok
2128ac642e Issue #2519 - Use parser error reporter to report missing module exports 2024-06-04 10:16:36 +08:00
Moonchild
7381521cf7 Issue #2518 - Make various arguments optional in XPathEvaluator/XPathExpression.
Resolves #2518
2024-06-04 10:16:17 +08:00
Moonchild
7d2ecc13dd [gfx] Use calloc for cairo font-creation functions. 2024-05-22 15:22:50 +08:00
Moonchild
7672f932f7 [gfx] Ensure font entry's unitsPerEm and font extents are initialized when gfxFont is created. 2024-05-22 15:22:23 +08:00
Moonchild
22830d18cf [DOM] Clean up ReportLoadError and normalize error messages. 2024-05-22 15:21:54 +08:00
Moonchild
552cd74b08 [gfx] Clear mSharedBlobData if blob creation failed. 2024-05-22 15:21:23 +08:00
Moonchild
f3413e94b9 [network] Make http digest auth cnonce length configurable. 2024-05-22 15:20:46 +08:00
Basilisk-Dev
4a95f9d418 [Basilisk] fix bug with preferences not working 2024-05-16 22:53:06 +08:00
Andy
52d7e4f3db PR #2514 - 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-16 22:50:32 +08:00