Bug 57233 - move directionOfEnclosingBlock() to be global so that it could be reused
Summary: move directionOfEnclosingBlock() to be global so that it could be reused
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 25298
  Show dependency treegraph
 
Reported: 2011-03-28 07:47 PDT by Xiaomei Ji
Modified: 2011-03-28 08:56 PDT (History)
2 users (show)

See Also:


Attachments
patch (3.96 KB, patch)
2011-03-28 08:19 PDT, Xiaomei Ji
rniwa: review-
Details | Formatted Diff | Diff
patch (3.99 KB, patch)
2011-03-28 08:44 PDT, Xiaomei Ji
rniwa: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xiaomei Ji 2011-03-28 07:47:24 PDT
we should provide a directionOfEnclosingBlock(Node*) so that it could be reused in SelectionController and other functions in visible_units.cpp, such as moving caret by word in visual order (which needs to know the direction of box and enclosing block, and the caret movement direction).
Comment 1 Xiaomei Ji 2011-03-28 08:19:55 PDT
Created attachment 87147 [details]
patch
Comment 2 Ryosuke Niwa 2011-03-28 08:27:25 PDT
Comment on attachment 87147 [details]
patch

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

> Source/WebCore/editing/SelectionController.cpp:339
> +    return WebCore::directionOfEnclosingBlock(m_selection.extent().anchorNode()); 

This isn't right.  You're calling anchorNode() here even though the original code called containerNode().
Comment 3 Xiaomei Ji 2011-03-28 08:44:54 PDT
Created attachment 87149 [details]
patch
Comment 4 Ryosuke Niwa 2011-03-28 08:51:33 PDT
Comment on attachment 87149 [details]
patch

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

> Source/WebCore/ChangeLog:8
> +        Provide global function directionOfEnclosingBlock(Node*) so that it could be
> +        reused in SelectionController and other functionalities that need enclosing
> +        block's direcionality, such as moving caret by word in visual order.
> +        https://bugs.webkit.org/show_bug.cgi?id=57233.

This isn't really a standard way of writing a change long entry.  Please do:

move directionOfEnclosingBlock() to be global so that it could be reused
https://bugs.webkit.org/show_bug.cgi?id=57233

Provide global function directionOfEnclosingBlock(Node*) so that it could be
reused in SelectionController and other functionalities that need enclosing
block's direcionality, such as moving caret by word in visual order.
Comment 5 Xiaomei Ji 2011-03-28 08:56:41 PDT
Committed r82121: <http://trac.webkit.org/changeset/82121>