Closed Bug 261385 Opened 20 years ago Closed 20 years ago

Inconsistent selection schemes in HTML tables

Categories

(Core :: DOM: Editor, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: glazou, Assigned: glazou)

Details

Attachments

(1 file)

1. launch Composer
2. create a 3x3 table, the first line being only TH elements
3. put some text in each cell
4. place the caret in a TH on first line and extend the selection

   ==> this selects the text in the cells

5. now place the caret in a TD and extend the selection

   ==> this selects cells

This is not intentional and it is a bug. In particular, if you copy a textual
selection created by step 4 and paste it elsewhere in the document, you may end
up with very funky incomplete tables...
Attached patch fix #1Splinter Review
we never really cared about table header cells...
Comment on attachment 159963 [details] [diff] [review]
fix #1

Neil can you review please ?
Attachment #159963 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 159963 [details] [diff] [review]
fix #1

>-  return (aContent->Tag() == nsHTMLAtoms::td &&
>+  return ((aContent->Tag() == nsHTMLAtoms::td ||
>+           aContent->Tag() == nsHTMLAtoms::th) &&
>           aContent->IsContentOfType(nsIContent::eHTML));
Nit: probably cheaper to do the content type test first.
Attachment #159963 - Flags: review?(neil.parkwaycc.co.uk) → review+
Daniel: is this ready to go?
Comment on attachment 159963 [details] [diff] [review]
fix #1

roc, can you sr this trivial patch please ? Thanks!
Attachment #159963 - Flags: superreview?(roc)
Attachment #159963 - Flags: superreview?(roc) → superreview+
checked in
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: