Commit 8b923b0d authored by inferno@chromium.org's avatar inferno@chromium.org

Crash with range selection across different documents.

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

Reviewed by Ryosuke Niwa.

Source/WebCore: 

Test: fast/dom/Range/range-selection-across-documents-crash.html

* page/DOMSelection.cpp:
(WebCore::DOMSelection::addRange):

LayoutTests: 

* fast/dom/Range/range-selection-across-documents-crash-expected.txt: Added.
* fast/dom/Range/range-selection-across-documents-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104317 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1edea935
2012-01-06 Abhishek Arya <inferno@chromium.org>
Crash with range selection across different documents.
https://bugs.webkit.org/show_bug.cgi?id=74285
Reviewed by Ryosuke Niwa.
* fast/dom/Range/range-selection-across-documents-crash-expected.txt: Added.
* fast/dom/Range/range-selection-across-documents-crash.html: Added.
2012-01-06 Dmitry Lomov <dslomov@google.com>
Unreviewed; fixing expectation error.
<!DOCTYPE html>
<html>
<head>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
function runTest()
{
var iframeElement = document.getElementById('iframe1');
var iframeDocument = iframeElement.contentDocument;
var iframeDocumentRoot = iframeDocument.documentElement;
var selection = window.getSelection();
var range = document.createRange();
selection.addRange(range);
range.selectNode(iframeDocumentRoot);
selection.addRange(range);
iframeDocument.removeChild(iframeDocumentRoot);
}
</script>
</head>
<body>
Test passes if it does not crash.
<iframe id="iframe1" onload="runTest()"></iframe>
</body>
</html>
2012-01-06 Abhishek Arya <inferno@chromium.org>
Crash with range selection across different documents.
https://bugs.webkit.org/show_bug.cgi?id=74285
Reviewed by Ryosuke Niwa.
Test: fast/dom/Range/range-selection-across-documents-crash.html
* page/DOMSelection.cpp:
(WebCore::DOMSelection::addRange):
2012-01-06 Sam Weinig <sam@webkit.org>
Remove unused OwnFastMallocPtr class.
......@@ -419,7 +419,7 @@ void DOMSelection::addRange(Range* r)
}
} else {
// We don't support discontiguous selection. We don't do anything if r and range don't intersect.
if (r->compareBoundaryPoints(Range::END_TO_START, range.get(), ec) < 1) {
if (r->compareBoundaryPoints(Range::END_TO_START, range.get(), ec) < 1 && !ec) {
if (r->compareBoundaryPoints(Range::END_TO_END, range.get(), ec) == -1)
// The original range contains r.
selection->setSelection(VisibleSelection(range.get()));
......
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