Reviewed by Adam Roben.
- fix http://bugs.webkit.org/show_bug.cgi?id=15942
REGRESSION: Selecting "Edit Html" tab in Blogger causes crash (Assertion failed: isRange())
Test: editing/selection/cleared-by-relayout.html
* editing/Selection.cpp:
(WebCore::Selection::toRange): Check if the selection has been cleared
by updating layout.
LayoutTests:
Reviewed by Adam Roben.
- test for http://bugs.webkit.org/show_bug.cgi?id=15942
REGRESSION: Selecting "Edit Html" tab in Blogger causes crash (Assertion failed: isRange())
* editing/selection/cleared-by-relayout-expected.txt: Added.
* editing/selection/cleared-by-relayout.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27706
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-11-11 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Adam Roben.
+
+ - test for http://bugs.webkit.org/show_bug.cgi?id=15942
+ REGRESSION: Selecting "Edit Html" tab in Blogger causes crash (Assertion failed: isRange())
+
+ * editing/selection/cleared-by-relayout-expected.txt: Added.
+ * editing/selection/cleared-by-relayout.html: Added.
+
2007-11-11 Antti Koivisto <antti@apple.com>
Reviewed by Darin.
--- /dev/null
+Test for http://bugs.webkit.org/show_bug.cgi?id=15942 REGRESSION: Selecting "Edit Html" tab in Blogger causes crash (Assertion failed: isRange()).
+
+
--- /dev/null
+<p>
+ Test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=15942">http://bugs.webkit.org/show_bug.cgi?id=15942</a>
+ REGRESSION: Selecting "Edit Html" tab in Blogger causes crash (Assertion failed: isRange())</i>.
+</p>
+<p>
+ <iframe onload="prepare()" id="target" src="data:text/html,<body contenteditable>"></iframe>
+</p>
+<script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ var target = document.getElementById('target');
+ function prepare()
+ {
+ var doc = target.contentDocument;
+ target.contentWindow.getSelection().setPosition(doc.body, 0);
+ target.focus();
+ test();
+ }
+
+ function test()
+ {
+ target.style.display = 'none';
+ target.contentDocument.body.innerHTML;
+ }
+</script>
+2007-11-11 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Adam Roben.
+
+ - fix http://bugs.webkit.org/show_bug.cgi?id=15942
+ REGRESSION: Selecting "Edit Html" tab in Blogger causes crash (Assertion failed: isRange())
+
+ Test: editing/selection/cleared-by-relayout.html
+
+ * editing/Selection.cpp:
+ (WebCore::Selection::toRange): Check if the selection has been cleared
+ by updating layout.
+
2007-11-11 Darin Adler <darin@apple.com>
Reviewed by Mark Rowe.
// incorrect results.
m_start.node()->document()->updateLayout();
+ // Check again, because updating layout can clear the selection.
+ if (isNone())
+ return 0;
+
Position s, e;
if (isCaret()) {
// If the selection is a caret, move the range start upstream. This helps us match