Make `nsIHTMLEditor.insertLinkAroundSelection` better
Categories
(Core :: DOM: Editor, enhancement, P3)
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.
- https://searchfox.org/mozilla-central/rev/642be079c4465445ab42b55d18e0a4d644c19c36/editor/libeditor/HTMLEditorCommands.cpp#1227-1229,1236-1238,1245,1255
- https://searchfox.org/mozilla-central/rev/642be079c4465445ab42b55d18e0a4d644c19c36/editor/libeditor/HTMLEditor.cpp#3262,3270
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
Description
•