On Jun 6, 10:51 pm, Jonas Sicking <[EMAIL PROTECTED]> wrote: > krithika wrote: > > On Jun 1, 6:00 am, Jonas Sicking <[EMAIL PROTECTED]> wrote: > >> krithika wrote: > >>> I have a problem in using nsIDOMRange.insertNode > >>> I create a range(with some start and end) inside a node and insert a > >>> div node it works. > >>> Immediately if i create another range(different offset) inside the > >>> same node and insert a new div node , it fails. > >>> Is there any restriction for create range with different offsets > >>> inside same node.Iam doing this from c++ code. > >>> Please let me know if Iam missing something. > >> Nope, that should work fine. Does the same thing work if you do it from > >> javascript? If it fails there too please provide a minimal testcase and > >> we can look at it. > > >> / Jonas > > > We were actually doing insertnode from inside printpreview code which > > will not call reflow automatically.But if we exit PrintPreview and > > reenter and then insert the second div inside the same node it works.I > > think insertion without reflow happening was the cause for the > > problem. > > Reflows should have absolutely no effect on this. The DOM should work > fine independently of when reflows happen. > > / Jonas
Our problem is 100% reproducible.This is my use case. I have a div surrounding a text which has a style -moz-column-count:3. In print engine code I just get the ColumnSetFrame iterate it to find the text where each column starts and create a range and insert a node. if the all the text ranges happens to be inside a same node the second and third insert always fails. if the text ranges happens to be in different nodes (say multiple li's> it works. Can you just give some pointers on how find out the problem?. thanks & regards, Krith _______________________________________________ dev-tech-layout mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-layout

