Open Bug 1787086 Opened 2 years ago Updated 2 years ago

Make `nsIHTMLEditor.insertLinkAroundSelection` better

Categories

(Core :: DOM: Editor, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: masayuki, Unassigned)

References

(Blocks 1 open bug)

Details

It takes an <a href="..."> element to support any inserting a link with any attributes.

Now, Firefox passes <a href="..." _moz_dirty=""> to it.

Thunderbird passes an element cached with a global variable, and it's created with _moz_dirty="" too, and globalElement whose attributes are cloned to the global variable is a clone of the global variable and nobody update its attributes.

SeaMonkey does exactly same things.
https://searchfox.org/comm-central/source/suite/editor/components/dialogs/content/EdLinkProps.js#303

Finally, Calendar simply passes <a href="..." _moz_dirty="">.

It seems that the API can be replaced with insertLink(aHref). Then, we can stop using nsAtom in PropItem (can be replaced with nsStaticAtom).

If it's not enough, we can make new API take array of optional attributes and values, but restrict

You need to log in before you can comment on or make changes to this bug.