Commit 43f6c9d0 authored by harrison's avatar harrison

LayoutTests:

        Reviewed by John Sullivan.

        <rdar://problem/4663772> REGRESSION: Cannot type in Japanese after replying to a particular message
        <rdar://problem/4673293> REGRESSION: Can't enter the Japanese characters in Mail or Blot

        * fast/text/attributed-substring-from-range-001-expected.txt: Added.
        * fast/text/attributed-substring-from-range-001.html: Added.
        
        Check attributed string results when starting or ending at a br element.

WebCore:

        Reviewed by John Sullivan.

        <rdar://problem/4663772> REGRESSION: Cannot type in Japanese after replying to a particular message
        <rdar://problem/4673293> REGRESSION: Can't enter the Japanese characters in Mail or Blot

        Test added
        * fast/text/attributed-substring-from-range-001.html

        * bridge/mac/FrameMac.mm:
        (WebCore::FrameMac::attributedString):
        Handle non-zero offsets when start and/or end node is a container. Offset used to be ignored in this case.
        Also, add validation of the range.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@16642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ba8aa975
2006-09-29 David Harrison <harrison@apple.com>
Reviewed by John Sullivan.
<rdar://problem/4663772> REGRESSION: Cannot type in Japanese after replying to a particular message
<rdar://problem/4673293> REGRESSION: Can't enter the Japanese characters in Mail or Blot
* fast/text/attributed-substring-from-range-001-expected.txt: Added.
* fast/text/attributed-substring-from-range-001.html: Added.
Check attributed string results when starting or ending at a br element.
2006-09-29 Rob Buis <buis@kde.org>
Reviewed by Maciej.
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 5 of BODY > HTML > #document
EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
Testing text with br elements (<div><br></div>hello<br>)
(0, 0):
(0, 1): {}
(0, 2): {}h{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }
(1, 1): h{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }
(1, 5): hello{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; }
(1, 6): hello{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; } {}
(1, 100): hello{ NSColor = NSCalibratedWhiteColorSpace 0 1; NSFont = "Times-Roman 16.00 pt. S [] (0xXXXXXXXX) fobj=0xXXXXXXXX, spc=4.00"; } {}
(6, 1): {}
(7, 1):
(100, 0): undefined
(100, 100): undefined
<html>
<head>
<style>
body { margin: 10; padding: 0 }
</style>
</head>
<body contenteditable><div><br></div>hello<br>
<script type="text/javascript">
var console_messages = document.createElement("ol");
function log(message)
{
var item = document.createElement("li");
item.appendChild(document.createTextNode(String(message).replace(/0x[0-9a-fA-F]{8}/g, "0xXXXXXXXX")));
console_messages.appendChild(item);
}
if (window.layoutTestController) {
try {
layoutTestController.dumpAsText();
log("Testing text with br elements (<div><br></div>hello<br>)");
window.getSelection().setPosition(document.body, 5);
log("(0, 0): " + textInputController.attributedSubstringFromRange(0, 0));
log("(0, 1): " + textInputController.attributedSubstringFromRange(0, 1));
log("(0, 2): " + textInputController.attributedSubstringFromRange(0, 2));
log("(1, 1): " + textInputController.attributedSubstringFromRange(1, 1));
log("(1, 5): " + textInputController.attributedSubstringFromRange(1, 5));
log("(1, 6): " + textInputController.attributedSubstringFromRange(1, 6));
log("(1, 100): " + textInputController.attributedSubstringFromRange(1, 100));
log("(6, 1): " + textInputController.attributedSubstringFromRange(6, 1));
log("(7, 1): " + textInputController.attributedSubstringFromRange(7, 1)); // should be empty
log("(100, 0): " + textInputController.attributedSubstringFromRange(100, 0)); // should be undefined
log("(100, 100): " + textInputController.attributedSubstringFromRange(100, 100)); // should be undefined
document.body.innerHTML = "";
} catch (ex) {
log("Exception: " + ex.description);
}
var console = document.createElement("p");
console.appendChild(console_messages);
document.body.appendChild(console);
} else {
document.write("This testcase is buggy: 9337. (cannot run interactively)");
}
</script>
</body>
</html>
2006-09-29 David Harrison <harrison@apple.com>
Reviewed by John Sullivan.
<rdar://problem/4663772> REGRESSION: Cannot type in Japanese after replying to a particular message
<rdar://problem/4673293> REGRESSION: Can't enter the Japanese characters in Mail or Blot
Test added
* fast/text/attributed-substring-from-range-001.html
* bridge/mac/FrameMac.mm:
(WebCore::FrameMac::attributedString):
Handle non-zero offsets when start and/or end node is a container. Offset used to be ignored in this case.
Also, add validation of the range.
2006-09-29 Rob Buis <buis@kde.org>
Reviewed by Maciej.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment