Commit 24714dfa authored by justing's avatar justing
Browse files

LayoutTests:

        Reviewed by harrison
        
        <rdar://problem/4774354>
        REGRESSION: In Gmail, caret reappears when dragging a selection over some text in the message body

        * fast/repaint/4774354-expected.checksum: Added.
        * fast/repaint/4774354-expected.png: Added.
        * fast/repaint/4774354-expected.txt: Added.
        * fast/repaint/4774354.html: Added.
        * fast/repaint/resources/contenteditable-iframe-src.html: Added.

WebCore:

        Reviewed by harrison
        
        <rdar://problem/4774354>
        REGRESSION: In Gmail, caret reappears when dragging a selection over some text in the message body

        Functions call recomputCaretRect to see if the caret rect has changed, 
        and, if it has, they invalidate (repaint) it.  recomputeCaretRect was 
        returning false if the caret turned into a range selection or was blown 
        away.

        * editing/SelectionController.cpp:
        (WebCore::SelectionController::recomputeCaretRect): Don't early return if
        !isCaret().  Obtain the FrameView* using the m_frame pointer, because m_sel 
        may now be null.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@17093 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 84dc6664
2006-10-17 Justin Garcia <justin.garcia@apple.com>
Reviewed by harrison
<rdar://problem/4774354>
REGRESSION: In Gmail, caret reappears when dragging a selection over some text in the message body
* fast/repaint/4774354-expected.checksum: Added.
* fast/repaint/4774354-expected.png: Added.
* fast/repaint/4774354-expected.txt: Added.
* fast/repaint/4774354.html: Added.
* fast/repaint/resources/contenteditable-iframe-src.html: Added.
2006-10-17 Justin Garcia <justin.garcia@apple.com>
 
Reviewed by sullivan
880c8befe324d3f8ff20cd55676a182b
\ No newline at end of file
EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 1 of BODY > HTML > #document
EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document toDOMRange:range from 40 of #text > BODY > HTML > #document to 40 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderPartObject {IFRAME} at (0,0) size 300x150
layer at (0,0) size 300x150
RenderView at (0,0) size 300x150
layer at (0,0) size 300x150
RenderBlock {HTML} at (0,0) size 300x150
RenderBody {BODY} at (8,8) size 284x134 [bgcolor=#FFFFE0]
RenderText {#text} at (0,0) size 240x18
text run at (0,0) width 240: "You should not see a caret in this text."
RenderText {#text} at (0,0) size 0x0
<script src="repaint.js" type="text/javascript"></script>
<script type="text/javascript">
function step1() {
if (window.layoutTestController)
window.layoutTestController.waitUntilDone();
// Wait for the frame to load.
window.setTimeout(step2, 100);
}
function step2() {
var frame = frames[0];
var doc = frame.document;
var body = doc.body;
var sel = frame.getSelection();
frame.focus();
sel.setPosition(body, 0);
doc.execCommand("InsertText", false, "You should not see a caret in this text.");
var text = body.firstChild;
sel.setPosition(text, text.length);
// Wait for the caret to paint.
window.setTimeout(runRepaintTest, 100);
}
function repaintTest() {
var frame = frames[0];
var doc = frame.document;
var body = doc.body;
var text = body.firstChild;
var sel = frame.getSelection();
sel.setBaseAndExtent(text, 5, text, text.length);
if (window.layoutTestController)
window.layoutTestController.notifyDone();
}
</script>
<body onload="step1();">
<iframe src="resources/contenteditable-iframe-src.html"></iframe>
</body>
<body bgcolor="lightyellow" contenteditable></body>
\ No newline at end of file
2006-10-17 Justin Garcia <justin.garcia@apple.com>
Reviewed by harrison
<rdar://problem/4774354>
REGRESSION: In Gmail, caret reappears when dragging a selection over some text in the message body
Functions call recomputCaretRect to see if the caret rect has changed,
and, if it has, they invalidate (repaint) it. recomputeCaretRect was
returning false if the caret turned into a range selection or was blown
away.
* editing/SelectionController.cpp:
(WebCore::SelectionController::recomputeCaretRect): Don't early return if
!isCaret(). Obtain the FrameView* using the m_frame pointer, because m_sel
may now be null.
2006-10-17 Geoffrey Garen <ggaren@apple.com>
 
Reviewed by Brady.
......@@ -791,10 +791,10 @@ IntRect SelectionController::caretRepaintRect() const
bool SelectionController::recomputeCaretRect()
{
if (!isCaret())
if (!m_frame || !m_frame->document())
return false;
FrameView* v = m_sel.start().node()->document()->view();
FrameView* v = m_frame->document()->view();
if (!v)
return false;
......
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