Bug 81593 - Merge nextRootInlineBox with nextLinePosition
Summary: Merge nextRootInlineBox with nextLinePosition
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks: 81490
  Show dependency treegraph
 
Reported: 2012-03-19 16:50 PDT by Ryosuke Niwa
Modified: 2012-05-19 02:42 PDT (History)
8 users (show)

See Also:


Attachments
Patch (14.29 KB, patch)
2012-03-19 16:55 PDT, Ryosuke Niwa
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Less intrusive patch (7.56 KB, patch)
2012-05-15 00:46 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Deleted more code but considerably more complicated patch (13.05 KB, patch)
2012-05-15 02:38 PDT, Ryosuke Niwa
enrica: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2012-03-19 16:50:01 PDT
Merge nextRootInlineBox with nextLinePosition
Comment 1 Ryosuke Niwa 2012-03-19 16:55:02 PDT
Created attachment 132721 [details]
Patch
Comment 2 Eric Seidel (no email) 2012-03-19 17:19:02 PDT
Comment on attachment 132721 [details]
Patch

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

> Source/WebCore/ChangeLog:9
> +        Refactroed nextLinePosition and previousLinePosition to use nextRootInlineBox and previousRootInlineBox.
> +

Can you give me a bit more high-level overview of what's going on here? What did these fucntions used to do?  Why are we merging them, etc...
Comment 3 Ryosuke Niwa 2012-03-19 17:25:03 PDT
(In reply to comment #2)
> (From update of attachment 132721 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=132721&action=review
> 
> > Source/WebCore/ChangeLog:9
> > +        Refactroed nextLinePosition and previousLinePosition to use nextRootInlineBox and previousRootInlineBox.
> > +
> 
> Can you give me a bit more high-level overview of what's going on here? What did these fucntions used to do?  Why are we merging them, etc...

nextRootInlineBox and previousRootInlineBox look for previous or next root inline boxes across renderers, and nextLinePosition and previousLinePosition had duplicated code in them.

I had asked xji (who recently added nextRootInlineBox and previousRootInlineBox) to refactor them later but it turned out that I needed this refactoring in order to fix the bug 81490.
Comment 4 WebKit Review Bot 2012-03-19 21:35:01 PDT
Comment on attachment 132721 [details]
Patch

Attachment 132721 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12000071

New failing tests:
editing/selection/3690703-2.html
editing/selection/3690703.html
Comment 5 Ryosuke Niwa 2012-03-20 14:08:26 PDT
Odd. This failure doesn't reproduce on Windows port either :(
Comment 6 Tony Chang 2012-03-20 14:23:56 PDT
Diffs from chromium-linux:

--- /src/chrome/src/webkit/Release/layout-test-results/editing/selection/3690703-2-expected.txt 
+++ /src/chrome/src/webkit/Release/layout-test-results/editing/selection/3690703-2-actual.txt 
@@ -147,5 +147,5 @@
           RenderInline {FONT} at (0,0) size 60x12
             RenderText {#text} at (362,0) size 60x12
               text run at (362,0) width 60: "\x{A9}2005 Google"
-selection start: position 0 of child 3 {INPUT} of child 1 {TD} of child 0 {TR} of child 0 {TBODY} of child 2 {TABLE} of child 4 {DIV} of child 0 {CENTER} of body
-selection end:   position 1 of child 2 {BR} of child 0 {FONT} of child 2 {TD} of child 0 {TR} of child 0 {TBODY} of child 2 {TABLE} of child 4 {DIV} of child 0 {CENTER} of body
+selection start: position 0 of child 0 {#text} of child 0 {FONT} of child 2 {TD} of child 0 {TR} of child 0 {TBODY} of child 2 {TABLE} of child 4 {DIV} of child 0 {CENTER} of body
+selection end:   position 1 of child 5 {BR} of child 0 {FONT} of child 2 {TD} of child 0 {TR} of child 0 {TBODY} of child 2 {TABLE} of child 4 {DIV} of child 0 {CENTER} of body

--- /src/chrome/src/webkit/Release/layout-test-results/editing/selection/3690703-expected.txt 
+++ /src/chrome/src/webkit/Release/layout-test-results/editing/selection/3690703-actual.txt 
@@ -1,6 +1,5 @@
 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > CENTER > BODY > HTML > #document to 6 of DIV > CENTER > BODY > HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
Comment 7 Ryosuke Niwa 2012-03-20 14:37:07 PDT
I don't quite understand what's causing the failure. As far as I know, there should be no difference between Mac and Chromium Linux when moving or extending selection via Selection.modify.

Unfortunately, it seems intractable to debug this regression without access to cr-linux, so I'll give up on this patch.
Comment 8 Ryosuke Niwa 2012-05-15 00:46:54 PDT
Created attachment 141880 [details]
Less intrusive patch
Comment 9 Ryosuke Niwa 2012-05-15 00:47:28 PDT
Xiaomei must have cleaned up the code there since this patch was much easier to write.
Comment 10 Ryosuke Niwa 2012-05-15 01:24:17 PDT
Comment on attachment 141880 [details]
Less intrusive patch

Ugh... that's because I didn't complete the second half.
Comment 11 Ryosuke Niwa 2012-05-15 02:38:22 PDT
Created attachment 141901 [details]
Deleted more code but considerably more complicated patch
Comment 12 Enrica Casucci 2012-05-16 14:02:35 PDT
Comment on attachment 141901 [details]
Deleted more code but considerably more complicated patch

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

The change looks good.

> Source/WebCore/ChangeLog:9
> +        to share the code. Moved out the nullity check of startBox and extraction of the renderer's node from

should be: "and extracted the renderer's node..."
Comment 13 Ryosuke Niwa 2012-05-16 16:23:39 PDT
Committed r117359: <http://trac.webkit.org/changeset/117359>