Commit graph

1,098 commits

Author SHA1 Message Date
Brian Smith
86e0057ea7 Issue #1691 - Part 6b: Initial browser support for dynamic import from module scripts. https://bugzilla.mozilla.org/show_bug.cgi?id=1342012 Factor out script fetch options from script load request classes. https://bugzilla.mozilla.org/show_bug.cgi?id=1480720 Remove support for version parameter from script loader. https://bugzilla.mozilla.org/show_bug.cgi?id=1428745
(cherry picked from commit 3ec2529aa6303f6950622e3cb91a23580649c73b)
2023-04-30 21:18:11 +08:00
Brian Smith
3f4985ce6c Issue #1691 - Part 3: Finish implementing import meta. https://bugzilla.mozilla.org/show_bug.cgi?id=1427610
(cherry picked from commit a8625238ac846fb7eb103646ddb8634a5860f067)
2023-04-30 21:17:00 +08:00
Brian Smith
1a6b3a822c Issue #1691 - Part 1: Provide a way of associating a private value with a script or module.
This is a prerequisite for dynamic import

(cherry picked from commit 2e2972647ee29340df51a804f05e40fc1da2c89b)
2023-04-30 21:16:28 +08:00
Moonchild
733451d1bb Remove unmaintained WebGL conformance test suite. 2023-04-30 09:28:42 +08:00
Moonchild
7823439b1b Issue #2053 - Follow-up: Make the default ResourceTimingBufferSize larger
Contrary to setting no limit by default, we're giving it a reasonable
default size to prevent runaway memory usage when websites just keep
recording ad infinitum.
2023-04-12 10:04:05 +08:00
FranklinDM
ef8e3b5419 Issue #2053 - Part 5: Throw a DOMException instead of a JS exception for some errors 2023-04-12 10:03:50 +08:00
FranklinDM
a0d52c0094 Issue #2053 - Part 4b: Fix measure name to timestamp conversion
Partially based on https://bugzilla.mozilla.org/show_bug.cgi?id=1772417
2023-04-12 10:03:34 +08:00
FranklinDM
4fc9cde7c1 Issue #2053 - Part 4a: Align IsPerformanceTimingAttribute to user-timing spec
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1772417
2023-04-12 10:03:17 +08:00
FranklinDM
3b57ba1415 Issue #2053 - Part 3: Update PerformanceMark to User Timing L3
There are a few minor differences between this and Mozilla's implementation:
(a) The type error messages were not hardcoded to the Performance class and were moved to Errors.msg or domerr.msg instead.
(b) Resist fingerprinting-pref changes were skipped.

Partially based on https://bugzilla.mozilla.org/show_bug.cgi?id=1724645
2023-04-12 10:02:58 +08:00
FranklinDM
23519e0c22 Issue #2053 - Part 2: Update PerformanceMeasure to User Timing L3
There are a few minor differences between this and Mozilla's implementation:
(a) The type error messages were not hardcoded to the Performance class and were moved to Errors.msg instead.
(b) PerformanceMeasureOptions is used directly and doesn't use the the Maybe<> container class. I haven't found the reason yet, but PerformanceMeasureOptions is disallowed from having a copy constructor and without that, it isn't possible to use it with Maybe<>... There doesn't seem to be any problem with using it directly, though.
(c) Resist fingerprinting-pref changes were skipped.

Partially based on https://bugzilla.mozilla.org/show_bug.cgi?id=1762482
2023-04-12 10:02:42 +08:00
FranklinDM
995f3117b0 Issue #2053 - Part 1: Performance should be an EventTarget
Some sites (e.g. Bitbucket) are now calling `performance.addEventListener` and expect that Performance is an EventTarget.

Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1432522
2023-04-12 10:02:25 +08:00
FranklinDM
31283d993b Issue #595 - Implement window.event
This MSIE extension is still technically part of the standard*, although its use is discouraged. This API will also likely never go away based on some comments at this issue on MDN content**.

Note that this uses a different approach for getting the inner window.

* https://dom.spec.whatwg.org/#interface-window-extensions
** https://github.com/mdn/content/issues/21848

Spec PR: https://github.com/whatwg/dom/pull/407
Spec discussion: https://github.com/whatwg/dom/issues/334

Partially based on https://bugzilla.mozilla.org/show_bug.cgi?id=218415
2023-04-10 07:27:37 +08:00
FranklinDM
bbcfb62753 Issue #2197 - Part 4: Expose structuredClone in Sandbox
Partially based on https://bugzilla.mozilla.org/show_bug.cgi?id=1734320
2023-04-10 07:27:03 +08:00
FranklinDM
ef6b8db1d5 Issue #2197 - Part 3: Implement self.structuredClone()
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1722576
2023-04-10 07:26:49 +08:00
FranklinDM
4174037d8a Issue #2197 - Part 2d: Implement PostMessageOptions for Window
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1502802
2023-04-10 07:26:20 +08:00
FranklinDM
4d58139fe1 Issue #2197 - Part 2c: Implement StructuredSerializeOptions for ServiceWorker
Partially based on https://bugzilla.mozilla.org/show_bug.cgi?id=1502802
2023-04-10 07:26:05 +08:00
FranklinDM
158784cbed Issue #2197 - Part 2b: Implement StructuredSerializeOptions for Worker
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1502802
2023-04-10 07:25:49 +08:00
FranklinDM
fd982fd298 Issue #2197 - Part 2a: Implement StructuredSerializeOptions for MessagePort
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1502802
2023-04-10 07:25:34 +08:00
FranklinDM
47147d58b0 Issue #2197 - Part 1b: Transferables should be arrays of objects
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1336020
2023-04-10 07:25:20 +08:00
FranklinDM
438cdbd913 Issue #2197 - Part 1a: postMessages should have transferable as [] by default
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1336020
2023-04-10 07:25:03 +08:00
FranklinDM
b2d7504112 Issue #252 - Move getElementsByName from HTMLDocument to Document
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1415176
2023-04-08 07:29:02 +08:00
Job Bautista
8182d08b13 Issue #1361 - Follow-up: Merge dom.getRootNode.enabled pref into dom.webcomponents.enabled. 2023-04-08 07:28:24 +08:00
Moonchild
371d7cf05d Issue #61 - Reinstate buildability with shared gkmedias dll
This fully works for splitting gkmedias.dll back out from xul with one exception
which is Skia throwing undefined externals when linking gkmedias.
2023-03-28 12:07:03 +08:00
Moonchild
078b1b73dc Issue #2161 - Ctrl + Enter should cause keypress event even though the key combination doesn't input any character
Currently, we dispatch keypress event when Enter is pressed without
modifiers or only with the Shift key (line break).
However, other browsers dispatch keypress events for Ctrl + Enter also
even if it doesn't cause any text input.

So, we should fire keypress events for Ctrl + Enter, even in strict
keypress dispatching mode. Note that with other modifiers, it depends on
the browser and/or platform and we can't dispatch the event for
consistent behavior.

This means web developers shouldn't rely one keypress events to catch
Alt + Enter, Meta + Enter and two or more modifiers + Enter.

Based on BZ 1438133
Resolves #2161
2023-03-24 09:13:51 +08:00
FranklinDM
b29522749a Issue #1592 - Follow-up: Don't post a restyle event if restyleElement is null
This fixes a potential crash caused if restyleElement is null.
2023-03-24 09:13:34 +08:00
FranklinDM
bc12e05bd3 Issue #1592 - Part 10: Slot elements should restyle their parent on attribute changes 2023-03-24 09:13:16 +08:00
FranklinDM
9a071f3b7a Issue #1592 - Part 9: Post a restyle event after changing the slot of a slottable 2023-03-24 09:12:52 +08:00
FranklinDM
4cd0de04d0 Issue #1592 - Part 8: Test the assigned slot for type/class/ID/attribute instead of the slottable when matching ::slotted() 2023-03-24 09:12:35 +08:00
FranklinDM
518c41fd7a Issue #1592 - Part 4: Walk ::slotted()-containing rules for slottables
- Check against all selector parts and not the leftmost selector only for ::slotted()
- Walk rules for ::slotted() regardless if the shadow root is opened/closed
- Ensure that ::slotted() rules are walked in the right order
- Fix ::slotted inheritance from topmost shadow root
2023-03-24 09:11:07 +08:00
Moonchild
f09d2bba0f Issue #2171 - Skip over shadow nodes that don't have an owning node.
Resolves #2171
2023-03-23 09:03:06 +08:00
FranklinDM
18e693464d Issue #2135 - Destroy the host frame and restyle when there are content changes
This is likely inefficient, but I haven't found a way other than this to ensure that the host frame is updated if the inserted/removed content isn't slotted. I'm assuming that Firefox is handling this somewhere else (and may have been even moved to Stylo), but was mentioned in an m-c bug we haven't seen yet. In fact, this is actually similar to how we handled elements passed to ContentInserted before landing e31ed5b07466d4a579fe4b025f97c971003fbc3f.
2023-03-12 07:10:24 +08:00
FranklinDM
cfef3fa487 Issue #2135 - Follow-up: Ensure document is not null in nsImageLoadingContent::BindToTree 2023-03-09 14:26:54 +08:00
FranklinDM
ad929c5dd5 Issue #2135 - Follow-up: Fix potential crash if shadow root is null 2023-03-06 16:27:34 +08:00
FranklinDM
9cb33ab843 Issue #2135 - Follow-up: Fix typo 2023-03-06 16:26:20 +08:00
FranklinDM
c194fbf6a8 Issue #2135 - Follow-up: Fix crash for passing nullptr as an argument to the aNodesWithProperties parameter 2023-03-06 16:25:56 +08:00
FranklinDM
4d778226ed Issue #2135 - Bug 1433669/Part 2: Flush the document instead of the shell in ContentEventHandler
* Unlike the original patch, I went with just getting a reference to the document rather than replacing mPresShell with mDocument.
2023-03-06 16:25:38 +08:00
FranklinDM
2f9186959c Issue #2135 - Bug 1433669/Part 1: Remove dead function 2023-03-06 16:25:21 +08:00
FranklinDM
70d493586d Issue #2135 - Bug 1419803: Use GetComposedDoc instead of GetUncomposedDoc in ContentEventHandler 2023-03-06 16:25:04 +08:00
FranklinDM
015148fcc3 Issue #2135 - Bug 1425864: Ensure printing documents which have shadow DOM works 2023-03-06 16:24:46 +08:00
FranklinDM
9f0fb9c16e Issue #2135 - Bug 1393806/Part 3: Change dom::ReparentWrapper to take an ErrorResult
* Bug 1393806 (Part 4) landed as part of Issue #1118.
* Account for ReparentWrappersInSubtree, introduced in 1466991
2023-03-06 16:24:26 +08:00
FranklinDM
3062964d28 Issue #2135 - Bug 1393806/Part 2: Modify AdoptNodeIntoOwnerDoc to use the non-XPCOM version of document.AdoptNode
* Unlike the original patch, this does not remove the XPCOM version of Document.adoptNode/importNode to avoid breaking other applications that might be using those functions.
2023-03-06 16:24:10 +08:00
FranklinDM
e65a864a3e Issue #2135 - Bug 1393806/Part 1: Change nsNodeUtils cloning/adopting stuff to use an ErrorResult for errors
This will allow us to propagate out more informative errors in some cases.
2023-03-06 16:23:51 +08:00
FranklinDM
b72ddcf657 Issue #2135 - Bug 1414692: Adopt shadow roots when adopting a shadow host across documents 2023-03-06 16:20:46 +08:00
FranklinDM
7b395189ac Issue #2135 - Bug 1518795: Properly track responsive content in a connected ShadowRoot 2023-03-06 16:17:59 +08:00
FranklinDM
56193120c5 Issue #2135 - Implement sequential focus navigation for shadow DOM
This covers the following:
Bug 1413834	Implement sequential focus navigation regarding shadow DOM
> Bug 1430020	Let sequential focus navigation in shadow DOM enter iframes
> Bug 1430701	Handle focus navigation on frameless shadow hosts in light DOM
> Bug 1430692	Handle focus navigation on NAC in shadow DOM
> Bug 1453693	Ensure sequential focus navigation works in Shadow DOM and add some tests
> Bug 1466581	Handle sequential focus also in nested shadow DOM
> Bug 1481079	Shadow DOM hosts should be focusable
> Bug 1507101	Use StyleChildrenIterator instead of custom frame tree walking code to handle NAC inside shadow dom
> Bug 1512043	Ensure traverse all nodes owned by the top level shadow host
> Bug 1512457	Fix various cases that focus navigation doesn't work well with frameless shadow host
> Bug 1513141	Really minor nsFocusManager cleanup
> Bug 1519090	Keyboard focus is trapped inside <slot>
> Bug 1528034	Make IsHostOrSlot null-safe
> Bug 1544826	Wrong focus navigation behavior when the root element is a shadow root
>> Bug 1500273	Ensure backward focus navigation works in Shadow DOM
2023-03-06 16:17:39 +08:00
FranklinDM
263b719ef8 Issue #2135 - Bug 1455891/Part 1: Improve StyleChildrenIterator 2023-03-06 16:17:21 +08:00
FranklinDM
588c2154a5 Issue #2135 - Bug 1410578: Make <link rel="stylesheet"> work in shadow trees 2023-03-06 16:17:01 +08:00
FranklinDM
45c179d01b Issue #2135 - Bug 1453789: Remove Element.createShadowRoot 2023-03-06 16:16:40 +08:00
FranklinDM
010db07bf3 Issue #2135 - Bug 1066965: Make contentEditable and spellchecking to work in Shadow DOM 2023-03-06 16:16:21 +08:00
FranklinDM
e64aeea52d Issue #2135 - Bug 1430301: Implement ShadowRoot.elementFromPoint/elementsFromPoint 2023-03-06 16:15:38 +08:00