Commit 1f22d13d authored by cfleizach@apple.com's avatar cfleizach@apple.com
Browse files

Crash in invalid index for _textMarkerForIndex

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

Reviewed by Beth Dakin.

Source/WebCore:

Test: platform/mac/accessibility/textmarker-for-index-out-of-bounds-crash.html

* accessibility/mac/WebAccessibilityObjectWrapper.mm:
(-[WebAccessibilityObjectWrapper _textMarkerForIndex:]):

LayoutTests:

* platform/mac/accessibility/textmarker-for-index-out-of-bounds-crash-expected.txt: Added.
* platform/mac/accessibility/textmarker-for-index-out-of-bounds-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114418 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 644e6bdf
2012-04-17 Chris Fleizach <cfleizach@apple.com>
Crash in invalid index for _textMarkerForIndex
https://bugs.webkit.org/show_bug.cgi?id=84104
Reviewed by Beth Dakin.
* platform/mac/accessibility/textmarker-for-index-out-of-bounds-crash-expected.txt: Added.
* platform/mac/accessibility/textmarker-for-index-out-of-bounds-crash.html: Added.
2012-04-17 Jer Noble <jer.noble@apple.com>
 
HTML5 Video Full Screen button broken (looks like white square)
text
text
text
This verifies that textMarkerForIndex for not crash when given an index out of bounds
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS item1.isTextMarkerValid(item1.textMarkerForIndex(99999999999)) is false
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<script src="../../../fast/js/resources/js-test-pre.js"></script>
<body id="body" tabindex="0">
<div tabindex="0" id="text1">text</div>
text
<div tabindex="0" id="text2">text</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This verifies that textMarkerForIndex for not crash when given an index out of bounds");
if (window.accessibilityController) {
document.getElementById("text1").focus();
var item1 = accessibilityController.focusedElement;
shouldBeFalse("item1.isTextMarkerValid(item1.textMarkerForIndex(99999999999))");
}
</script>
<script src="../../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
2012-04-17 Chris Fleizach <cfleizach@apple.com>
Crash in invalid index for _textMarkerForIndex
https://bugs.webkit.org/show_bug.cgi?id=84104
Reviewed by Beth Dakin.
Test: platform/mac/accessibility/textmarker-for-index-out-of-bounds-crash.html
* accessibility/mac/WebAccessibilityObjectWrapper.mm:
(-[WebAccessibilityObjectWrapper _textMarkerForIndex:]):
2012-04-17 Jer Noble <jer.noble@apple.com>
 
HTML5 Video Full Screen button broken (looks like white square)
......@@ -2805,7 +2805,9 @@ static RenderObject* rendererForView(NSView* view)
return nil;
PassRefPtr<Range> textRange = TextIterator::rangeFromLocationAndLength(document->documentElement(), textIndex, 0);
if (!textRange || !textRange->boundaryPointsValid())
return nil;
VisiblePosition position(textRange->startPosition());
return [self textMarkerForVisiblePosition:position];
}
......
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