[Webkit-unassigned] [Bug 23600] New: Ranges do not work?

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 28 13:49:51 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=23600

           Summary: Ranges do not work?
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: HTML Editing
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: eric at webkit.org
                CC: darin at apple.com, justin.garcia at apple.com,
                    ojan at google.com, jparent at google.com


Ojan and I were trying to use comparePoint in a test case.  It didn't work like
we thought it would.  After some investigation, it just seems our ranges are
borked.  This is probably a dupe of the "VisualPosiition shouldn't be used as
much as they are" bug.

Test case:
<html>
<body>
    <div id='log'></div>
<script>
function debug(str) {
    var logger = document.getElementById('log');
    logger.appendChild(document.createTextNode(str));
    logger.appendChild(document.createElement('br'));
}
var div = document.createElement('div');
document.body.appendChild(div);
var textNode = document.createTextNode("");
div.appendChild(textNode);

var sel = window.getSelection();
sel.collapse(textNode, 0);
var range = sel.getRangeAt(0);

debug("comparing point with <text>, offset 0:");
var result = range.comparePoint(textNode, 0);
if (result == 0) {
    debug("PASSED: result = 0");
} else {
    debug("FAILED: result = " + result + " expected 0");
}

debug("range:");
debug("startContainer: " + range.startContainer);
debug("startOffset: " + range.startOffset);
debug("endContainer: " + range.endContainer);
debug("endOffset: " + range.endOffset);

debug("selection:");
debug("anchorNode: " + sel.anchorNode);
debug("anchorOffset: " + sel.anchorOffset);
debug("focusNode: " + sel.focusNode);
debug("focusOffset: " + sel.focusOffset);
</script>
</body>
</html>


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list