Closed Bug 1484645 Opened 3 years ago Closed 3 years ago

Re-enable table/image resizers which were removed by default in bug 1449564

Categories

(Thunderbird :: Message Compose Window, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 63.0

People

(Reporter: jorgk-bmo, Assigned: jorgk-bmo)

Details

Attachments

(1 file, 2 obsolete files)

Maybe as simple as setting these prefs:
https://hg.mozilla.org/mozilla-central/rev/541fbb29f21d#l2.22

+pref("editor.resizing.enabled_by_default", true);
+pref("editor.inline_table_editing.enabled_by_default", true);
+pref("editor.positioning.enabled_by_default", true);

Or should we do it via a command cmd_enableAbsolutePositionEditing
https://hg.mozilla.org/mozilla-central/rev/ccb713187e45#l1.12
like we do here:
https://dxr.mozilla.org/comm-central/rev/e5e1510b8d914bfa8439b21ba3f73e4f2e83e957/mail/components/compose/content/MsgComposeCommands.js#6855
  editor.document.execCommand("defaultparagraphseparator", ...

I see there is also cmd_enableObjectResizing and cmd_enableInlineTableEditing which was there before.
Flags: needinfo?(masayuki)
Confirmed in local build that image resizers and table grips are gone :-(
Summary: Re-enabel table/image resizers which were removed by default in bug 1449564 → Re-enable table/image resizers which were removed by default in bug 1449564
Attached patch 1484645-resizers.patch (obsolete) — Splinter Review
This does the trick and brings back the resizers.

Masayuki-san, should we be using cmd_enableObjectResizing and cmd_enableInlineTableEditing instead as per comment #0?
Assignee: nobody → jorgk
Status: NEW → ASSIGNED
Flags: needinfo?(masayuki)
Attachment #9002413 - Flags: review?(acelists)
Attachment #9002413 - Flags: feedback?(masayuki)
Comment on attachment 9002413 [details] [diff] [review]
1484645-resizers.patch

Or, you can use execCommand for each editor. Either way is fine to me.
Attachment #9002413 - Flags: feedback?(masayuki) → feedback+
(If we'd remove them from web content completely, I have no idea which is the best to enable only on Thunderbird. HTMLEditor can check document's principal though.)
In bug 1449564 comment 18 it is said execCommand is not a good option.
Masayuki-san, sorry to trouble you again. Here's the alternative solution. I think I prefer this. You might one day remove the preferences but not the commands?

BTW, what is the enableAbsolutePositionEditing? Do we need this? The other two are for tables and images, right?
Attachment #9002423 - Flags: review?(acelists)
Attachment #9002423 - Flags: feedback?(masayuki)
Is there a particular order these need to be called in? I'm trying to understand the commit comment in
https://hg.mozilla.org/mozilla-central/rev/ccb713187e45#l1.12
but there seem to be words missing.

  Note that whether resizing UI is available only with enableObjectResizing
  state is different from enableInlineTableEditing command.

Sorry, I don't understand that.

  Resizers for absolute positioned elements are NOT available (unless??)
  both enableObjectResizing and enableAbsolutePositionEditor are enabled.
(In reply to :aceman from comment #5)
> In bug 1449564 comment 18 it is said execCommand is not a good option.
Thanks for the reminder. Not quite what comment #3 says.
(In reply to :aceman from comment #5)
> In bug 1449564 comment 18 it is said execCommand is not a good option.

Ah, yes. I completely forgot that. Yes, using XPCOM method is the best.

So, doing nsIHTMLAbsPosEditor.absolutePositioningEnabled = true, nsIHTMLInlineTableEditor.inlineTableEditingEnabled = true and nsIHTMLObjectResizer.objectResizingEnabled = true won't be broken under current plan. I meant that execCommand may be removed if we'd decide that those UIs are removed form the web completely.

(In reply to Jorg K (GMT+2) from comment #6)
> Masayuki-san, sorry to trouble you again. 

np.

> Here's the alternative solution. I
> think I prefer this. You might one day remove the preferences but not the
> commands?

Sorry, as above, using XPCOM methods (attributes) is the best.

> BTW, what is the enableAbsolutePositionEditing? Do we need this? The other
> two are for tables and images, right?

Enabling it shows a grabber, which is draggable, when absolute positioned element is selected. It's movable with D&D.
https://jsfiddle.net/5h201fqw/1/

Perhaps, Thunderbird don't have UI, but perhaps, this feature is available when composing a reply message if original HTML mail has absolute positioned element. So, for backward compatibility, I recommend to enable it too.

(In reply to Jorg K (GMT+2) from comment #7)
> Is there a particular order these need to be called in?

No. When a target is selected, each UI enabled state is checked.

> I'm trying to
> understand the commit comment in
> https://hg.mozilla.org/mozilla-central/rev/ccb713187e45#l1.12
> but there seem to be words missing.
> 
>   Note that whether resizing UI is available only with enableObjectResizing
>   state is different from enableInlineTableEditing command.
> 
> Sorry, I don't understand that.
> 
>   Resizers for absolute positioned elements are NOT available (unless??)
>   both enableObjectResizing and enableAbsolutePositionEditor are enabled.

Sorry for the broken English text...

resizers are available even with <table> and absolute positioned element. However, if resizers are disabled, inline-table-editing UI allows only modifying number of rows/columns. Similarly, absolute positioned element is only movable.
Here's more trouble ;-) - This works for me.
Attachment #9002413 - Attachment is obsolete: true
Attachment #9002423 - Attachment is obsolete: true
Attachment #9002413 - Flags: review?(acelists)
Attachment #9002423 - Flags: review?(acelists)
Attachment #9002423 - Flags: feedback?(masayuki)
Attachment #9002455 - Flags: review?(acelists)
Attachment #9002455 - Flags: feedback?(masayuki)
Comment on attachment 9002455 [details] [diff] [review]
1484645-resizers-alternative.patch (v2) - using XPCOM

Review of attachment 9002455 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks, works for me too.
Attachment #9002455 - Flags: review?(acelists) → review+
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/018b18ddbfa6
Re-enable table/image resizers which were removed by default in bug 1449564. r=aceman
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 63.0
Comment on attachment 9002455 [details] [diff] [review]
1484645-resizers-alternative.patch (v2) - using XPCOM

Nice. Thank you!
Attachment #9002455 - Flags: feedback?(masayuki) → feedback+
You need to log in before you can comment on or make changes to this bug.