Opened 10 years ago

Last modified 7 years ago

#1167 reopened defect

Selection problem in Safari 3 prevents display of table, row and cell props dialogs

Reported by: guest Owned by:
Priority: normal Milestone: 0.97
Component: Browsers_Safari Version: trunk
Severity: normal Keywords:


If you use the nightly build demo on, enable TableOperations and ContextMenu, create a table, then right click in a table cell, selecting table, row or cell properties, you get an empty dialog window.

Change History (4)

comment:1 Changed 9 years ago by douglas

  • Resolution set to worksforme
  • Status changed from new to closed

I've tested on trunk, and this works for me...

comment:2 Changed 9 years ago by douglas

  • Resolution worksforme deleted
  • Status changed from closed to reopened

Ooops, didn't see that this was Safari, reopening

comment:3 Changed 9 years ago by nicholasbs

I've done some detective work and I think I've tracked down the root of this problem.

First, this is only an issue for some table operations. Right-clicking on a cell and choosing Table or Row Properties does in fact work in Safari. However, Cell Properties, as well as many of the other cell functions (delete cells, insert cell before, etc), do not work.

TableOperations uses a function called getClosest() to find the closest td, tr, and table tags. getClosest() calls getAllAncestors(), which calls getParentElement. This function creates a range object and then calls commonAncestorContainer on it.

This is where the trouble comes in. When you right/control-click in a table cell, if there's no other visible content in the cell, or if you click after all of the content in the cell, Safari will automatically create a blank (i.e., white-space only) selection. The trouble is that calling commonAncestorContainer() on the Range object created from this selection returns an element that contains the table cell (e.g., the tr element). This of course means that getClosest will not find the correct td element; this yields a null value that InlineStyler.createStyleFieldset (which helps build the dialog box) chokes on.

You can easily verify this by noting that the cell properties dialog box works fine in Safari if you use the toolbar button, or if you right-click on text inside of a cell, or if you remove the selection after opening the context menu but before selecting the menu item.

Thoughts as to how best to fix this?

comment:4 Changed 7 years ago by gogo

  • Milestone changed from 0.96 to 0.97
Note: See TracTickets for help on using tickets.