Bug 44295 - Insertion point does not show when dragging text into an editable area
Summary: Insertion point does not show when dragging text into an editable area
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: All OS X 10.5
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords: InRadar
Depends on: 21834
Blocks: 44290
  Show dependency treegraph
 
Reported: 2010-08-19 14:41 PDT by Simon Fraser (smfr)
Modified: 2010-09-16 12:42 PDT (History)
1 user (show)

See Also:


Attachments
Patch (1.70 KB, patch)
2010-08-27 14:35 PDT, Simon Fraser (smfr)
tony: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2010-08-19 14:41:04 PDT
65681 caused the caret to use the last-computed caret rect when painting, rather than forcing a style update. That seems to have changed the drawing of the insertion caret during drag and drop. This affects the pixel results of this test: editing/selection/drag-in-iframe.html
Comment 1 Simon Fraser (smfr) 2010-08-20 09:53:27 PDT
<rdar://problem/8335352>
Comment 2 Simon Fraser (smfr) 2010-08-27 13:56:36 PDT
My patch fixes the bug interactively, but the caret still doesn't get captured in the pixel result.

Interactively, DragController::doSystemDrag() blocks in m_client->startDrag() until the drag is complete.

In DRT, it seems to return immediately, so cleanupAfterSystemDrag() resets the drag caret to empty, before the snapshot is taken.
Comment 3 Simon Fraser (smfr) 2010-08-27 14:35:01 PDT
Created attachment 65769 [details]
Patch
Comment 4 Enrica Casucci 2010-08-27 14:42:21 PDT
Comment on attachment 65769 [details]
Patch

> diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
> index c8f9bcf61fa93600c1aac821e070adcb3f67a2d9..95357b5dda1f94c6d24ea0838d6d22645fb4a4f8 100644
> --- a/WebCore/ChangeLog
> +++ b/WebCore/ChangeLog
> @@ -1,5 +1,26 @@
>  2010-08-27  Simon Fraser  <simon.fraser@apple.com>
>  
> +        Reviewed by NOBODY (OOPS!).
> +
> +        Insertion point does not show when dragging text into an editable area
> +        https://bugs.webkit.org/show_bug.cgi?id=44295
> +        
> +        r65681 caused the caret to use the last-computed caret rect when
> +        painting, rather than forcing a style update. Because of this,
> +        we now need to eagerly update the caret rect when changing
> +        the drag selection.
> +        
> +        Not testable in DRT because the drag selection is always cleared
> +        before EventSender returns, so the drag caret can never show in
> +        the pixel results.
> +
> +        Tested by running editing/selection/drag-in-iframe.html manually.
> +
> +        * editing/SelectionController.cpp:
> +        (WebCore::SelectionController::setSelection):
> +
> +2010-08-27  Simon Fraser  <simon.fraser@apple.com>
> +
>          Reviewed by Tony Chang.
>  
>          Crash in CSSStyleSelector.cpp
> diff --git a/WebCore/editing/SelectionController.cpp b/WebCore/editing/SelectionController.cpp
> index 3672e3e757bfdd87f40395e46004e4dab17e220d..97dde55e3cde543ccf23ea6344de4249ec8311ed 100644
> --- a/WebCore/editing/SelectionController.cpp
> +++ b/WebCore/editing/SelectionController.cpp
> @@ -118,6 +118,7 @@ void SelectionController::setSelection(const VisibleSelection& s, bool closeTypi
>          m_selection = s;
>          m_caretRectNeedsUpdate = true;
>          invalidateCaretRect();
> +        updateCaretRect();
>          return;
>      }
>      if (!m_frame) {

Looks good to me.
Comment 5 Simon Fraser (smfr) 2010-08-27 15:50:52 PDT
http://trac.webkit.org/changeset/66269