Open Bug 1239411 Opened 9 years ago Updated 2 years ago

Rich-text API, on contenteditable it's impossible to prevent the cell selection to show up

Categories

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

43 Branch
defect

Tracking

()

People

(Reporter: cyril.auburtin, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [h2review-noted])

Attachments

(1 file)

Attached image Capture.PNG (deleted) —
User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36 Steps to reproduce: document.execCommand('enableInlineTableEditing',null, false); for contenteditable doesn't prevent the cell selection (blue borders on <td>) of showing demo: http://jsfiddle.net/crl/kf1qa7rf/ start pressing your left mouse button in a <td> cell, then move the mouse to other cells. Firefox highlights the selection, the above command should disable it Actual results: the cell selection is still showing Expected results: it should be disabled like other editing tools
Component: DOM → Editor
the editing tools are fine actually, other bugs unfortunately
This is a problem for us too -- we have our own cell selection implementation, but even after the selection is reset, the blue borders stick around (sometimes flickering or showing other artefacts)

This line should probably be conditional on something else.

Makoto, do you know what the right check is for this kind of stuff?

Flags: needinfo?(m_kato)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3

Hmm, I agree to change this. but I need discuss with masayuki about this.

First of all, enableInlineTableEditing is not related to the table-selection.

The table-selection is widely implemented in layout, and editor uses the feature. So, if editor should have a new command to disable it, layout needs to have an API to stop handling table-selection.

Flags: needinfo?(m_kato)

Ah, it might be enough just to stop handling table selection here if the selection ancestor limiter is set to an editing host.
https://searchfox.org/mozilla-central/rev/efdf9bb55789ea782ae3a431bda6be74a87b041e/layout/generic/nsFrame.cpp#4849-4858

I guess that HTMLEditor should have an API to allow/disallow table selection, and HTMLEditor should allow it only when it's in email composer of Thunderbird, composer of SeaMonkey or BlueGriffon.

Makoto-san, do you have idea how to consider it?

Flags: needinfo?(m_kato)

(In reply to Masayuki Nakano [:masayuki] (he/him)(JST, +0900) from comment #6)

Ah, it might be enough just to stop handling table selection here if the selection ancestor limiter is set to an editing host.
https://searchfox.org/mozilla-central/rev/efdf9bb55789ea782ae3a431bda6be74a87b041e/layout/generic/nsFrame.cpp#4849-4858

I guess that HTMLEditor should have an API to allow/disallow table selection, and HTMLEditor should allow it only when it's in email composer of Thunderbird, composer of SeaMonkey or BlueGriffon.

Yes. nsFrameSelection (nsISelectionController) should have the API to manage this feature. Old Gecko based application wants to keep this, but Web content may not (I don't know most people likes this feature.). And we may add new execCommand to enable/disable it.

Flags: needinfo?(m_kato)
Whiteboard: [h2review-noted]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: