Changes between Initial Version and Version 1 of Ticket #11460, comment 13


Ignore:
Timestamp:
Feb 27, 2014, 1:52:39 PM (10 years ago)
Author:
Piotrek Koszuliński
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11460, comment 13

    initial v1  
    1212  * `MoveToPoint` indeed throws errors. Unfortunately it does it on every IE, but luckily I found only two cases, although pretty often.
    1313  * Custom script doesn't work for me. I recorded [[attachment:customRangeFromPointBugs.webm]] which shows that this method isn't any better than `moveToPoint`. Actually, it is worse, it's long even though IE8 is still not supported there, so it's not a good choice.
    14   * Therefore I've got a different proposal. Since moveToPoint mostly fails when dropping between blocks of text, why not looking for a range up and down? With a step e.g. 2px look up, if moveToPoint failed, look down, if failed again, look up 4px, then down, etc, up to e.g. 30px. This way we'll find a position in the nearest block, so exactly what IE visually showed us. We may not find anything useful on the right side of anchor (e.g. in the "Broadcasting and quotest" header) - in this case we can back up with `elementFromPoint` and place selection at the end of it (remember about bogus <br> in IE11). That of course may still not be enough, but I think that it will be good enough.
     14  * Therefore I've got a different proposal. Since moveToPoint mostly fails when dropping between blocks of text, why not looking for a range up and down? With a step e.g. 2px look up, if moveToPoint failed, look down, if failed again, look up 4px, then down, etc, up to e.g. 30px. This way we'll find a position in the nearest block, so exactly what IE visually showed us. We may not find anything useful on the right side of anchor (e.g. in the "Broadcasting and quotest" header) - in this case we can back up with `elementFromPoint` and place selection at the end of it (remember about bogus <br> in IE11). That of course may still not be enough to handle all cases, but I think that it will be good enough in general.
    1515  * We may also check other method - if `moveToPoint` failed we can let IE does its native drop, then get selection, and most often we'll find dropped content inside it. However, this may cause blinking and may be unreliable as well. So if previous option is going to work I'll be for it.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy