Bug 128587 - Frame::rectForSelection shouldn't instantiate FrameSelection
Summary: Frame::rectForSelection shouldn't instantiate FrameSelection
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks: 127832
  Show dependency treegraph
 
Reported: 2014-02-11 01:19 PST by Ryosuke Niwa
Modified: 2014-02-11 17:48 PST (History)
8 users (show)

See Also:


Attachments
Cleanup (25.71 KB, patch)
2014-02-11 01:38 PST, Ryosuke Niwa
enrica: review+
rniwa: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-07 for mac-mountainlion (504.22 KB, application/zip)
2014-02-11 04:19 PST, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2014-02-11 01:19:39 PST
Right now, Frame::rectForSelection instantiates a FrameSelection in order to compute the absolute caret bounds of start and end points.

We're trying to contain the side-effects of FrameSelection::setSelection with suppressSelectionNotifications and restoreSelectionNotifications on WebEditorClient,
as well as suppressCloseTyping and restoreCloseTyping on FrameSelection but selectionchange event still fires and it could change the focus,

Because it uses FrameSelection::setSelection on both start and end points, it erroneously fires selectionchange events and closes the open typing command.
Comment 1 Ryosuke Niwa 2014-02-11 01:38:33 PST
Created attachment 223827 [details]
Cleanup
Comment 2 Build Bot 2014-02-11 04:19:56 PST
Comment on attachment 223827 [details]
Cleanup

Attachment 223827 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/5678939372519424

New failing tests:
animations/stop-animation-on-suspend.html
Comment 3 Build Bot 2014-02-11 04:19:57 PST
Created attachment 223841 [details]
Archive of layout-test-results from webkit-ews-07 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-07  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 4 Alexey Proskuryakov 2014-02-11 10:29:29 PST
> animations/stop-animation-on-suspend.html

Now, that's a lie.
Comment 5 Enrica Casucci 2014-02-11 14:09:45 PST
Comment on attachment 223827 [details]
Cleanup

View in context: https://bugs.webkit.org/attachment.cgi?id=223827&action=review

> Source/WebCore/editing/htmlediting.cpp:1278
> +    // if caretNode is a block and caret is inside it then caret should be painted by that block

Comment style.
Comment 6 Ryosuke Niwa 2014-02-11 14:31:56 PST
Comment on attachment 223827 [details]
Cleanup

(In reply to comment #5)
> (From update of attachment 223827 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=223827&action=review
> 
> > Source/WebCore/editing/htmlediting.cpp:1278
> > +    // if caretNode is a block and caret is inside it then caret should be painted by that block
> 
> Comment style.

WIll fix.
Comment 7 Ryosuke Niwa 2014-02-11 17:48:15 PST
Committed r163920: <http://trac.webkit.org/changeset/163920>