Opened 13 years ago

Closed 3 years ago

#1167 closed defect (fixed)

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 (5)

comment:1 Changed 12 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 12 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 12 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 10 years ago by gogo

  • Milestone changed from 0.96 to 0.97

comment:5 Changed 3 years ago by gogo

  • Resolution set to fixed
  • Status changed from reopened to closed

I seem unable to reproduce this now in Safari 9.1.1 (OSX 10.9), either it's been fixed in my recent updates to Xinha, or it's been fixed in Safari over the years.

@NOTE This may be the first notification you will have seen from activity on Xinha in years. If you currently use Xinha you might want to check the Timeline at , to borrow from Twain, reports of it's death have been greatly exaggerated.

Note: See TracTickets for help on using tickets.