Closed Bug 1510183 Opened 6 years ago Closed 6 years ago

It's not possible to erase a web link when it is create

Categories

(Core :: DOM: Editor, defect)

60 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
thunderbird_esr60 --- fixed
firefox-esr60 --- wontfix
firefox64 --- wontfix
firefox65 --- fixed

People

(Reporter: serge.boucher, Assigned: masayuki)

References

Details

(Keywords: regression)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.4

Steps to reproduce:

(sorry but I'm using a french version of thunderbird 60.3.1 (32 bits))
In a new email, you create a Web link on words with the menu "insert" "link ..." you insert the Web address in the box "link properties" and you confirm with "OK
When you edit this link again with a double-click on the words, the box "link properties" opens. Inside, you delete the link (the field becomes white) and you confirm with "OK" but the link is not deleted (the words are always in blue and underlined)


Actual results:

the link is not deleted
I can reproduce this, and bug 1510210 using 60.3.1
I didn't test in safe mode
Status: UNCONFIRMED → NEW
Component: Untriaged → Message Compose Window
Ever confirmed: true
Keywords: regression
Aceman, can you check this for us.
Flags: needinfo?(acelists)
Just inputing the link into the dialog throws:
NS_ERROR_FILE_NOT_FOUND:  UnifiedComplete.js:2528 (mozilla/toolkit/components/places/UnifiedComplete.js)

Clicking "Advanced edit" throw:
TypeError: right-hand side of 'in' should be an object, got null in text.xml:31:15

But those may not cause the bug here. I'll continue investigating.
Flags: needinfo?(acelists)
So if the href value is removed, the editor calls:
EditorRemoveTextProperty("href", "");
which calls:

which ends up here:
https://searchfox.org/comm-central/source/mozilla/editor/libeditor/HTMLStyleEditor.cpp#1325

And then runs through all of HTMLEditor::RemoveInlinePropertyInternal() until the final NS_OK, so no errors.

There were recent changes in the file in bug 1497746, but if you say it is already in TB60, it can't be caused by those.

Other candidate is Bug 1482015 which actually creates the HTMLEditor::RemoveInlinePropertyInternal() function (on 13th Aug 2018).

Did this work before TB60?
I'm sure Alice can find the regression. Yes, worked with TB 52.
Flags: needinfo?(alice0775)
I also reached bug 1427060 from source code.
Assignee: nobody → masayuki
Blocks: 1427060
Status: NEW → ASSIGNED
OS: Unspecified → All
Hardware: Unspecified → All
After fixing bug 1427060, HTMLEditor treats attribute of style as nullptr.
However, if empty string is used to call NS_Atomize(), it returns
nsGkAtoms::_empty.  Therefore, HTMLEditor fails to check whether attribute is
specified or not with nullptr check since some root callers sets
nsGkAtoms::_empty instead of nullptr.

This patch makes HTMLEditor always use nullptr for empty string of attribute
of style with wrapping NS_Atomize() with AtomzieAttribute().  Additionally,
for safer change, this patch makes PropItem and TypeInState treat
nsGkAtom::_empty as nullptr.
Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/b096dc953832
Make HTMLEditor treat empty string attribute of style as nullptr of nsAtom rather than nsGkAtoms::_empty r=m_kato
https://hg.mozilla.org/mozilla-central/rev/b096dc953832
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 65.0
Masayuki-san, any chance for a backport to mozilla-esr60?
Component: Message Compose Window → Editor
Flags: needinfo?(masayuki)
Product: Thunderbird → Core
Target Milestone: Thunderbird 65.0 → mozilla65
Version: 60 → 60 Branch
Attached patch Patch for ESR60Splinter Review
Here is. If this is not enough to fix on Thunderbird, please file another bug.
Flags: needinfo?(masayuki)
That try build didn't work. We use a trick to base the Mozilla repo on try instead of mozilla-esr60, and that trick didn't work here.
Works for me, thanks Masayuki-san! I'll include it in TB 60.3.3 or TB 60.4.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: