Commit Graph

53 Commits

Author SHA1 Message Date
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 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
FranklinDM 4d7bdedade Issue #2488 - Part 2: Remove the DeclarationBlock class and use Declaration directly 2024-04-02 22:47:20 +08:00
FranklinDM 63076e4211 Issue #2488 - Part 1b: Move PseudoElementType getter/setter implementation of Element away from header 2024-04-02 22:47:00 +08:00
FranklinDM 10bf8705d0 Issue #2112 - Part 6: Remove IsStyledByServo function and callers 2024-04-02 22:41:54 +08:00
FranklinDM e777ae5a3c Issue #2112 - Part 3: Remove --enable-stylo config and conditionals 2024-04-02 22:30:28 +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 14e8922dca Issue #2078 - Part 3: Rename nsCSSRuleProcessor::SelectorListMatches to RestrictedSelectorListMatches
This is in preparation for merging the logic of RestrictedSelectorListMatches and AnySelectorInArgListMatches.
2023-02-22 07:05:25 +08:00
Moonchild 8d800b1cb0 Issue #21 - Remove Telemetry plumbing and fix build.
Note this won't give working applications. Requires FE changes and
additional js module changes (next part).
2022-04-28 10:25:48 +08:00
Moonchild 21f707390d Issue #1705 - Part 3: Rename ScrollbarStyles to ScrollStyles.
ScrollbarStyles contains values of overflow, (over)scroll-behavior, etc.
The only one which is marginally related to scroll _bars_ is overflow, which can
be used to hide scrollbar (by making an element not scrollable) or enforce the
scrollbar to display.

It makes more sense to be called ScrollStyles as it's mainly concerning behavior
of scrolling, not scrollbars. Also, with the addition of scrollbar width
properties, the current name can be confusing.
2021-01-14 22:19:53 +08:00
Moonchild ed7e49eda6 Issue #1656 - Part 2: Unmangle some unfortunate UTF-8 victims.
The poor fellows got lost in an ASCII-interpretation of the world.
2020-09-25 22:04:14 +08:00
Moonchild 8c395520d9 Issue #1656 - Part 1: Nuke most vim config lines in the tree.
Since these are just interpreted comments, there's 0 impact on actual code.
This removes all lines that match /* vim: set(.*)tw=80: */ with S&R -- there are
a few others scattered around which will be removed manually in a second part.
2020-09-25 22:04:12 +08:00
Matt A. Tobin 7e48e4407c Bug 1426503 - Remove DestInsertionPoints stuff
Tag #1375
2020-04-18 07:06:32 +08:00
Matt A. Tobin cedff6e214 Bug 1416999 - Remove document.registerElement
Tag #1375
2020-04-18 07:05:32 +08:00
Matt A. Tobin 31b26a24e3 Bug 1411878 - Support Element.shadowRoot and Element.assignedSlot / TextNode.assignedSlot on closed shadow root
Tag #1375
2020-04-18 07:05:29 +08:00
Matt A. Tobin 67c4d022dc Bug 1404842 - Implement Element.attachShadow and Element.slot
Tag #1375
2020-04-18 07:05:26 +08:00
Matt A. Tobin efb5979ad5 Bug 1411754 - Rename PresShell::DestroyFramesFor to DestroyFramesForAndRestyle
Tag #1375
2020-04-18 07:05:22 +08:00
Matt A. Tobin 5917636e83 Bug 1396584 - Remove support for multiple ShadowRoots
Tag #1375
2020-04-18 07:05:03 +08:00
Matt A. Tobin f63cd76698 Bug 1389743 - Only reconstruct frames synchronously from ContentRemoved when called from frame construction
Tag #1375
2020-04-18 07:04:47 +08:00
Matt A. Tobin fe13c5bffc Bug 1375701 - Atomize class attribute value in the parser in the innerHTML case
Tag #1375
2020-04-18 07:04:45 +08:00
Matt A. Tobin 6aa436b588 Bug 1365092 - Move side effects of SetAttr and ParseAttribute to BeforeSetAttr and AfterSetAttr
* Moves side effects of nsGenericHTMLElement and Element's SetAttr, UnsetAttr, and ParseAttribute functions to the corresponding BeforeSetAttr and AfterSetAttr functions
* Moves side effects of HTMLAnchorElement's SetAttr, UnsetAttr, and ParseAttribute functions to the corresponding BeforeSetAttr and AfterSetAttr functions
* Moves side effects of HTMLImageElement's SetAttr function to the corresponding BeforeSetAttr and AfterSetAttr functions
* Moves side effects of SetAttr, UnsetAttr, and ParseAttribute functions to BeforeSetAttr and AfterSetAttr

Tag #1375
2020-04-18 07:04:04 +08:00
Matt A. Tobin 1f233fa14b Bug 1363481 - Add the old attribute value as a parameter to Element::AfterSetAttr
Tag #1375
2020-04-18 07:03:55 +08:00
Matt A. Tobin 922cbf0217 Bug 1352389 -Don't push extra script blocker on stack when setting attributes
Tag #1375
2020-04-18 07:03:37 +08:00
Matt A. Tobin 7a3f9be509 Bug 656197 - Push state updates further out across beforesetattr/aftersetattr
* Remove the generic attr preparsing mechanism from BeforeSetAttr and just preparse class attributes directly in the one place that needs to do it
* Move calls to BeforeSetAttr to after AttributeWillChange
* Remove UpdateState calls in BeforeSetAttr
* Move calls to AfterSetAttr to before UpdateState when manipulating attributes
* Remove UpdateState calls from AfterSetAttr, since they are no longer needed there

Tag #1375
2020-04-18 07:03:22 +08:00
Matt A. Tobin b723a5c8c4 Bug 1331322 - Allow tagging of pseudo-implementing native anonymous content with the pseudo type at creation time
* Stop using a node bit for HasExplicitBaseURI
* Move MAY_HAVE_CLASS to mBoolFlags
* Add a flag to indicate that a node is native anonymous content
* Allow tagging of pseudo-implementing native anonymous content with the pseudo type at creation time, and eliminate explicit style contexts in nsIAnonymousContentCreator::ContentInfo

Tag #1375
2020-04-18 07:03:03 +08:00
Matt A. Tobin cb2b45e472 Bug 1305458 - Changing -moz-appearence on hover breaks change event
* Rename nsIDOMEventTarget::PreHandleEvent to nsIDOMEventTarget::GetEventTargetParent
* Add nsIDOMEventTarget::PreHandleEvent
* Add EventTargetChainItem::GetFirstEventTarget
* Call EventTargetChainItem::PreHandleEvent even it sets mCanHandle=false
* Move form control frame focus/blur from nsGenericHTMLFormElement::GetEventTargetParent to PreHandleEvent
* Move fire change event from HTMLTextAreaElement::GetEventTargetParent to PreHandleEvent
* Refine nsXULElement::GetEventTargetParent
* Move dispatch XUL command from nsXULElement::GetEventTargetParent to PreHandleEvent
* Move fire events and set value from HTMLInputElement::GetEventTargetParent to PreHandleEvent
* Add test case
* Let HTMLInputElement delegate event handling to it's parent class
* Refine EventTargetChain flags to reduce overheads
* Refine event target chain creation
* Refine assertion in EventTargetChainItem::Create

Tag #1375
2020-04-18 07:02:44 +08:00
Gaming4JC 3639f0e2bd Bug 1396620 - Part 2: Fix compartment mismatch crash when doing old prototype swizzling for custom element
Tag UXP Issue #1344
2020-01-31 07:40:28 +08:00
Gaming4JC dba59f0317 Bug 1406325 - Part 5: Implement try to upgrade.
Tag UXP Issue #1344
2020-01-31 07:39:51 +08:00
Gaming4JC db3b6b5884 Bug 1406325 - Part 4: Use mType for LookupCustomElementDefinition and also removing parts of v0.
Tag UXP Issue #1344
2020-01-31 07:39:47 +08:00
Gaming4JC cce9b3379a Bug 1406325 - Part 1: Make sure custom element state is custom before sending callback.
Tag UXP Issue #1344
2020-01-31 07:39:37 +08:00
Gaming4JC d35ff2985e Bug 1121994 - Implement adopted callback for custom elements.
Tag UXP Issue #1344
2020-01-31 07:37:46 +08:00
Gaming4JC 659204631b Bug 1334044: Replace detached callback (v0) with disconnected callback (v1).
Tag UXP Issue #1344
2020-01-31 07:37:43 +08:00
Gaming4JC befa1027e3 Bug 1334043 - Part 2: Make nsContentUtils::EnqueueLifecycleCallback static.
We make nsContentUtils::EnqueueLifecycleCallback static so that it can be called without a window object. To achive this, we also make CustomElementReaction not taking a CustomElementRegistry in the constructor, as it can call Upgrade statically.

Tag UXP Issue #1344
2020-01-31 07:37:35 +08:00
Gaming4JC 207d5a2e3e Bug 1334043 - Part 1: Replace attached callback (v0) with connected callback (v1).
Tag UXP Issue #1344
2020-01-31 07:37:32 +08:00
Gaming4JC 7ce1742985 Bug 1392970 - Part 1: Make CustomElementDefinition ref-counted and put it in CustomElementData.
Tag UXP Issue #1344
2020-01-31 07:37:25 +08:00
Gaming4JC 2bd8be69ea Bug 1334051 - Part 2: Invoke attributeChangedCallback only if attribute name is in the observed attribute list.
We call attributeChangedCallback in two cases:

1. When any of the attributes in the observed attribute list has changed, appended, removed, or replaced.

2. When upgrading an element, for each attribute in element's attribute list that is in the observed attribute list.

Note: w/ Fixup for not implementing an API Enhancement Bug 1363481.

Tag UXP Issue #1344
2020-01-31 07:37:07 +08:00
Gaming4JC 4408e19e96 Bug 1334051 - Part 1: Include namespace in attributeChangedCallback.
Per spec [1], we should include namesapce in attributeChangedCallback argurment list.
[1] https://html.spec.whatwg.org/multipage/custom-elements.html#concept-upgrade-an-element, step 3

Tag UXP Issue #1344
2020-01-31 07:37:03 +08:00
Gaming4JC dd7fa403a8 Bug 1377993 - Make node slots less memory hungry in common cases.
Tag UXP Issue #1344
2020-01-31 07:36:13 +08:00
Gaming4JC 7f03d02552 Bug 1347634 - GetCustomElementData and SetCustomElementData don't need to be virtual;
Tag UXP Issue #1344
2020-01-31 07:36:11 +08:00
win7-7 37870c0ff2 Add missing NS_AtomizeMainThread(nameToUse);
nsCOMPtr<nsIAtom> nameAtom = NS_AtomizeMainThread(nameToUse);
2019-05-31 07:17:59 +08:00
win7-7 c4af2549b2 add main thread only cache for nsIAtoms to speed up atomization dom/base
add main thread only cache for nsIAtoms to speed up atomization
2019-05-31 07:17:44 +08:00
wolfbeast 14ea8bb121 Align Element.ScrollIntoView() with the spec.
This also removes the (unused) shadow alias from nsIDOMHTMLElement
which used the different calling convention.

This resolves #927
2019-02-16 00:24:00 +08:00
wolfbeast 42d9f2ffb3 Revise lifetime management of IntersectionObservers.
Tag #249
2019-02-16 00:22:51 +08:00
wolfbeast 9b1124ccbd Remove VR hardware support.
This resolves #881
2019-02-16 00:20:27 +08:00
janekptacijarabaci 8714f52f69 DOM - Element - add support for Element.toggleAttribute() 2019-02-16 00:08:52 +08:00
wolfbeast 5af4107852 Stabilize and align Intersection Observers
- Fixes several crashes
- Aligns the feature with the W3C WD spec

Tag #249
2019-02-16 00:05:46 +08:00
janekptacijarabaci 85692a1198 moebius#138: Optimize operations on root of deeply-nested frame tree
https://github.com/MoonchildProductions/moebius/pull/138
2019-02-15 23:50:20 +08:00