Closed Bug 75271 Opened 23 years ago Closed 23 years ago

Edit|Undo does not highlight if table is the first thing added

Categories

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

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED
mozilla0.9.1

People

(Reporter: shrir, Assigned: sfraser_bugs)

Details

Attachments

(1 file)

seen on windows trunk 0409

steps:
Launch composer
click on the TABLE button in composition toolbar and add the 2x2 table
now select 'Edit' menu and observe that UNDO appears disabled

expected: UNDO should appear enabled
this is weird, the undo will be enabled if I minimize the window and then 
redisplay the window, not really sure who this should go to
charley, handing this one over to you to see if you can see anything in the 
xul/css that might be causing this
Assignee: beppe → cmanske
Priority: -- → P3
Target Milestone: --- → mozilla0.9.1
cc:kin
Sounds like another instance of command enable/disable state not updating
correctly.
Always cc Simon on bugs like this so he can see the various examples.
The bug here is that nsInterfaceState assumes that after a transaction is done 
(executed) that there will be something on the undo stack. This is not the case 
when batches are involved since executed transactions get added to the batch 
instead of the undo stack until the batch is closed. 

We'll need to add some mechanism to nsInterfaceState that tracks 
DidEndBatch() notifications similar to what is done in DidDo(), but also tracks 
nested batches ... in this scenario DidDo() would only set mFirstDoOfFirstUndo 
to false if the batch nest count was zero.
Removing the BeginBatchChanges() and EndBatchChanges() in EdInsertTable.js
confirms what Kin described. So Kin or Joe would have to fix this?
Note that I don't see "Undo" enabled after minimizing or window resizing or
anything else that *doesn't* trigger another transaction, such as typing.

Assignee: cmanske → kin
Assignee: kin → sfraser
nsInterfaceState.cpp is sfraser's baby. Simon, I can help you out with this if 
you're overloaded for 0.9.1.
I'll take a look.
Status: NEW → ASSIGNED
Fixing this could be quite a big performance win. Calling UpdateCommands() is 
expensive, and we're doing it a lot for batched transactions.
r=akkana
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
verifiedin 4/19 build.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: