Closed
Bug 14617
Opened 25 years ago
Closed 24 years ago
calling GetAnchor/GetFocus from editor code
Categories
(Core :: DOM: Editor, defect, P3)
Tracking
()
VERIFIED
FIXED
M17
People
(Reporter: buster, Assigned: mozeditor)
Details
From Joe's posting: We shouldn't ever be calling GetFocusNode()/GetAnchorNode() in the editor. I wasn't going to say anything about it until I found an actual example of code that was broken because of this approach. Well, I've found it: the old nsTextEditRules::DidUndo()/DidRedo() code didn't work at all and caused flurries of bogus nodes to start populating the document. There are 6 (remaining) places where we call GetFocusNode() and 17 places where we call GetAnchorNode() and I consider them all guilty until proven innocent. The editor never cares, as far as I can tell, what the selection code considers anchor or focus, and our operations should instead just operate on selection ranges.
Updated•25 years ago
|
Status: NEW → ASSIGNED
Target Milestone: M12
Comment 1•25 years ago
|
||
I will review all uses of this, although I don't understand how it affects undo.
Comment 3•25 years ago
|
||
Can someone explain more about how using it generates "bogus nodes"? The cases that use GetFocusNode() seem to be valid: E.g., nsAutoSelectionReset uses them to save the current selection endpoints. Steve: Do you want me to evaluate their use in code I didn't write? Their use in SetTextPropertiesForNodeWithDifferentParents looks suspicious to me.
Comment 4•25 years ago
|
||
Steve: Please evaluate SetTextPropertiesForNodeWithDifferentParents as requested above.
Updated•25 years ago
|
Summary: calling GetAnchor/GetFocus from editor code → [CODE cleanup]calling GetAnchor/GetFocus from editor code
Whiteboard: [CODE general cleanup]
Target Milestone: M12 → M17
Comment 5•25 years ago
|
||
setting out to M17, general code cleanup
Updated•25 years ago
|
Assignee: cmanske → jfrancis
Status: ASSIGNED → NEW
Comment 6•25 years ago
|
||
The instances in my code are Ok. I'm not sure about those in other people's code. Joe: please review uses in your code.
Assignee | ||
Comment 7•25 years ago
|
||
accepting bug
Comment 8•25 years ago
|
||
removing whiteboard status text
Summary: [CODE cleanup]calling GetAnchor/GetFocus from editor code → calling GetAnchor/GetFocus from editor code
Whiteboard: [CODE general cleanup]
Assignee | ||
Comment 9•24 years ago
|
||
All this stuff has been reviewed, so I'm closing it out.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•