Commit graph

1,455 commits

Author SHA1 Message Date
MeladJM
70cbf0dfd3 Issue #2790 - Cleanup: Remove whitespaces 2025-07-29 10:41:22 +08:00
MeladJM
156c755085 Issue #2790 - Part 5: Persistent highlight despite blur click 2025-07-29 10:36:38 +08:00
MeladJM
bf8cfcc980 Issue #2790 - Part 4: Working non persistent autofill highlight 2025-07-29 10:35:07 +08:00
MeladJM
4cdfb9e16b Issue #2790 - Part 3: Address BZ bug 1849122 and resolve build issues 2025-07-29 10:14:48 +08:00
MeladJM
d99eab0d9d Issue #2790 - Part 2: Address BZ bugs: 1355438 and 1341230 2025-07-29 10:14:23 +08:00
MeladJM
13d1054046 Issue #2790 - Part 1: Add: event state, pseudo-class mapping, SetAutofilled methods 2025-07-29 10:14:06 +08:00
Francis Dominic Fajardo
e05d4d8306 Issue #2828 - Part 5: Implement child rule processors 2025-07-25 20:50:57 +08:00
Francis Dominic Fajardo
03f29e75ec Issue #2828 - Part 3: Refactor selector matching and rule cascade data into separate files/classes 2025-07-25 20:47:06 +08:00
Moonchild
f902d2ad0e [DOM] Make object loading use an explicit scheme whitelist. 2025-07-25 07:33:16 +08:00
Moonchild
0a8f50fafa No issue - Adjust CSP URI reporting more closely with the spec.
According to the W3C discussion we should allow websocket URIs to be
reported aside from http/https/ftp ones.
This rewrites things slightly and updates comments to clarify.
We do retain the non-standard reduction to origin only in case the
report is for cross-origin URIs (stops leaking full URIs to the CSP
reported destination).
See https://github.com/w3c/webappsec-csp/issues/735
2025-07-25 07:30:32 +08:00
Francis Dominic Fajardo
c8608ad5cf Issue #2736 - Follow-up: Stop using worker thread-only functions for checking if CSP is enabled
Should stop the barrage of worker thread assertions on debug builds.
2025-07-16 15:21:31 +08:00
MeladJM
5e8e1208e7 Issue #2499 - Part 3: Add CSS clip overflow support with serialization fixes 2025-07-16 15:20:45 +08:00
Andy
b11affbdf3 Issue #2106 - Clean-up: Un-prefix -moz-user-select in Comments 2025-07-08 10:01:21 +08:00
Andy
abb891ff26 Issue #2106 - Follow-up: Un-prefix DOM Attribute MozUserSelect 2025-07-08 10:00:32 +08:00
Andy
1a5b3dcae6 Issue #2106 - Follow-up: Additional Un-prefixing 2025-07-08 10:00:02 +08:00
Francis Dominic Fajardo
9105c58a30 Issue #2045 - Part 4: Parse "revert" in property values wherever "unset" is allowed 2025-07-07 11:20:42 +08:00
Andy
4cc014cb6b Unprefix -moz-read-write / -moz-read-only 2025-07-04 22:27:22 +08:00
Moonchild
0c2770ff7b [DOM] Update YouTube embed rewrites.
Youtube's usage patterns have changed regarding video embeds, so we can
remove special handling for the enablejsapi flag.
Applies YouTube embed URL replacement to the path component only.
2025-06-27 23:30:17 +08:00
Moonchild
1c8e994b65 Issue #2762 - Remove SVGZoomEvent interface.
Resolves #2762
2025-06-27 23:29:48 +08:00
Moonchild
3c2c7ce1e2 No issue - Escape < and > in element attribute values.
Per spec, extend escaping of attribute value characters to include
`<` and `>`. We already did this for text fragments, and it makes sense
to apply the same to attribute values. We are at parity with mainstream
that default-escape attribute values this way in current releases.
2025-06-27 23:29:12 +08:00
Moonchild
51022b98b2 Issue #2734 - Add base-64 grammar check to CSP nonces where applicable.
Resolves #2734
2025-06-17 09:29:05 +08:00
Moonchild
2782cded29 Issue #2752 - Change DOMMatrix Rotate{Self}() to the current spec.
This changes Rotate{Self}(angle, translateX, translateY) to
Rotate{Self}(rotateX, rotateY, rotateZ) per the spec.
The resulting matrix will be a 3DMatrix

Resolves #2752
2025-06-17 09:26:52 +08:00
Moonchild
3b1fe322f7 Issue #2721 - Simplify CheckHandleEventForAnchorsPreconditions.
The special case check is no longer necessary after our changes in this
issue and #2732 where <A> no longer applies as a link inside image maps.
2025-06-17 09:25:18 +08:00
Moonchild
c3f1c0cdba Issue #2721 - Remove nsILinkHandler.
This interface inly has a single implementation behind it, which is also
only used in 2 places after the previous commit. That's a lot of
additional complexity and compiler indirection for no good reason.
This change removes the interface and uses direct nsDocShell::Cast calls
instead of going through the interface in the few places left now that
we no longer build on a presentation context for links.
2025-06-17 09:25:00 +08:00
Moonchild
37de431ac0 Issue #2721 - Create special case exception for <A>.Click() outside of DOM
This removes the requirement for there to be a non-null PresShell to
dispatch `Click()` events on `<A>` elements (only), since the exception
to the rule has propagated to the spec.

With these changes it should now be possible do create an anchor and
`Click()` on it from JS without actually first attaching it to the DOM
of the presented document, as abused by scripted downloads in pages
(instead of using the A attribute to custom-name downloads).
2025-06-17 09:24:44 +08:00
Moonchild
6da047af1e Issue #2736 - Follow-up: Remove erroneous workerthread CSP check.
In `OnStreamCompleteInternal` an incorrect workerthread CSP enabled check
was added. This was a duplicate check and this is actually on the main
thread so asserts the wrong thread for a `WorkerPref`.
2025-05-27 23:22:08 +08:00
trav90
96cc879fab Issue #2741 - Part 3 - Clamp rolloff factor appropriately in PannerNodeEngine 2025-05-27 23:17:53 +08:00
Shadow
a8f9e383fa No Issue - Fix a typo in DOMSVGPoint constructor.
Bug 1442972

DOMSVGPoint constructor checked mX is finite twice, leaving out mY finite.

-- Stupidly rushed.  Shambles.
2025-05-27 23:17:27 +08:00
Moonchild
9847e9f759 Issue #2736 - Part 13: Override page CSP for loads by expanded principals.
Per the CSP specification, content injected by extensions is meant to
be exempt from page CSP. This patch takes care of the most common case
of content injected by extension content scripts, which always have
expanded principals which inherit from the page principal.

To make this easier, de-virtualize BasePrincipal::Kind(), using CTOR
initializers instead.
2025-05-14 15:48:54 +08:00
Moonchild
53a6f6349d Issue #2736 - Part 14: Make CSP-enabled available to workers. 2025-05-14 14:35:35 +08:00
Moonchild
60ad5b2ffd Issue #2736 - Part 12: Re-work style <link> href attribute.
Use subject principal as triggering principal in style <link> "href"
attribute.
2025-05-14 14:33:26 +08:00
Moonchild
dde21838de Issue #2736 - Part 11: Re-work <input> src attribute.
Use subject principal as triggering principal in <input> "src" attribute.
2025-05-14 14:33:09 +08:00
Moonchild
faf4f2c23f Issue #2736 - Part 10: Re-work <source> srcset attribute.
Use subject principal as triggering principal in <source> "srcset"
attribute for <picture>.
2025-05-14 14:32:54 +08:00
Moonchild
b1b5062dc4 Issue #2736 - Part 9: Re-work <source> src attribute.
Use subject principal as triggering principal in <source> "src" attribute
for <audio>/<video> elements.
2025-05-14 14:32:39 +08:00
Moonchild
b6bdce6f98 Issue #2736 - Part 8: Re-work <video> and <audio> src attribute.
Use subject principal as triggering principal in <video>/<audio> "src"
attribute. We deviate from Mozilla here because we do not worry
about content isolation principals in Page Info.
2025-05-14 14:32:24 +08:00
Moonchild
2416e71cd3 Issue #2736 - Part 7: Re-work <frame> and <iframe> src attribute.
Use subject principal as triggering principal in <iframe>/<frame> "src" attribute.
2025-05-14 14:26:23 +08:00
Moonchild
1f638b22ec Issue #2736 - Part 6: Re-work <script> src attribute.
Use subject principal as triggering principal in <script> "src" attribute.
2025-05-14 14:26:06 +08:00
Moonchild
2bdb9f3d85 Issue #2736 - Part 5: Re-work img <srcset> attribute.
Use subject principal as triggering principal in <img> "srcset" attribute.
2025-05-14 14:23:33 +08:00
Moonchild
c8db9efb3c Issue #2736 - Part 4: Re-work img <src> attribute.
Use subject principal as triggering principal in <img> "src" attribute.
Also get rid of the `BeforeMaybeChangeAttr`/`AfterMaybeChangeAttr` dance:
It makes more logical sense for these effects to happen _after_ the
attribute has actually been changed.
2025-05-14 14:23:17 +08:00
Moonchild
824d0cad58 Issue #2736 - Part 2: Pass subject principal to SetAttribute and friends.
In order to tailor certain security checks to the caller that is
attempting to load a particular piece of content, we need to be able to
attach an appropriate triggering principal to the corresponding requests.

Since most HTML content is loaded based on attribute values, this means
capturing the subject principal of the caller who sets those attributes,
which in turn means we need to make it available to `AfterSetAttr` hooks
on all relevant element types.
2025-05-14 14:22:13 +08:00
Moonchild
9ad680cfc4 Issue #2736 - Part 1: Provide more consistent principals to CSP.
We're currently fairly vague and inconsistent about the values we provide to
content policy implementations for requestOrigin and requestPrincipal. In some
cases they're the triggering principal, sometimes the loading principal,
sometimes the channel principal.

Our existing content policy implementations which require or expect a
loading principal currently retrieve it from the context node.
Since no current callers require the principal to be the loading
principal, and some already expect it to be the triggering principal
(which there's currently no other way to retrieve), a choice was made
to pass the triggering principal whenever possible, but use the loading
principal to determine the origin URL.
2025-05-14 14:21:46 +08:00
Moonchild
fd4a224d1d Issue #2737 - Part 1: Base implementation of SVGGeometryElement.
Mostly mechanical changes to generalize path geometry for all SVG draw
elements. No user-exposed changes.
2025-04-30 23:02:16 +08:00
Moonchild
0331e633bd Issue #2728 - Remove obsolete CSP referrer policy.
This has been superseded by the dedicated Referrer-policy header.
Resolves #2728
2025-04-30 22:58:43 +08:00
Moonchild
8bacedc9a9 Issue #2729 - Add missing jsonifier interfaces to DOM{Matrix|Rect|Point}
Resolves #2729
Resolves #2705
2025-04-18 10:31:48 +08:00
Moonchild
0113b2715d [DOM] Check state before compiling/transforming. 2025-04-03 09:47:35 +08:00
Moonchild
f1c456c625 Issue #2713 - Check for NaN before std::min/max() in DOMQuad and DOMRect.
If there is a NaN involved we should not return 0 here.
2025-03-23 12:52:03 +08:00
Moonchild
6411abd43c Issue #2711 - Apply pattern transforms when using text-rendering on canvas.
Resolves #2711
2025-03-23 12:26:21 +08:00
Moonchild
6449b7514b No issue - Fix some deprot 2025-03-23 12:25:55 +08:00
Moonchild
2e4620b5af Issue #2692 - Part 6: Don't #include js/SourceBufferHolder.h in jsapi.h.
Instead, require users to do so. This is a minor translation-unit size
improvement for anyone who never has to use SourceBufferHolder other than
by reference.
2025-03-13 23:01:46 +08:00
Shadow
c318657acd Explicitly use javascript: instead of URI_INHERITS_SECURITY_CONTEXT within subjectToCSP() (#2696)
Bug 1330035

Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2696
Co-authored-by: Shadow <shadow@no-reply.palemoon.org>
Co-committed-by: Shadow <shadow@no-reply.palemoon.org>
2025-03-12 10:31:54 +08:00