Closed Bug 294482 Opened 20 years ago Closed 19 years ago

update documentation

Categories

(Documentation Graveyard :: Web Developer, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: theserg, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

in JavaScript function insertNodeAtSelection(win, insertNode)

container.insertBefore(afterNode, textNode);
container.insertBefore(insertNode, afterNode);
container.insertBefore(beforeNode, insertNode);

is not working, but

container.insertBefore(beforeNode, textNode);
container.insertBefore(insertNode, textNode);
container.insertBefore(afterNode, textNode);

is ok

Reproducible: Always
Assignee: nobody → web.developer
Component: Help Documentation → Web Developer
Product: Firefox → Documentation
QA Contact: help.documentation
If we did it your way, the text would go in backwards.

Since we are using insert before, we have to insert back to front.

Given a string:

AC - we want to insert B into the middle

Split where A is beforeNode and C is after node

inert after before the old text Node:

CAC

insert new text before after node;

BCAC

insert beforenode before insertnode;

ABCAC

remove old text node

ABC

Hope this helps explain.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.