Bug 36948 - Refactoring: Position::primaryDirection() should be extracted.
Summary: Refactoring: Position::primaryDirection() should be extracted.
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P3 Normal
Assignee: Nobody
Depends on:
Reported: 2010-04-01 04:47 PDT by Hajime Morrita
Modified: 2010-04-01 22:30 PDT (History)
4 users (show)

See Also:

patch v0 (3.89 KB, patch)
2010-04-01 04:52 PDT, Hajime Morrita
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hajime Morrita 2010-04-01 04:47:12 PDT
TextDirection typed variables named "primaryDirection" are computed several part on our code-base.
It should be extract to a function.
Comment 1 Hajime Morrita 2010-04-01 04:52:05 PDT
Created attachment 52285 [details]
patch v0
Comment 2 Shinichiro Hamaji 2010-04-01 07:50:01 PDT
Comment on attachment 52285 [details]
patch v0

Comment 3 Shinichiro Hamaji 2010-04-01 08:14:55 PDT
Comment on attachment 52285 [details]
patch v0

Clearing flags on attachment: 52285

Committed r56915: <http://trac.webkit.org/changeset/56915>
Comment 4 Shinichiro Hamaji 2010-04-01 08:15:05 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 WebKit Commit Bot 2010-04-01 08:23:00 PDT
Comment on attachment 52285 [details]
patch v0

Rejecting patch 52285 from commit-queue.

Unexpected failure when landing patch!  Please file a bug against webkit-patch.
Failed to run "['WebKitTools/Scripts/webkit-patch', '--status-host=webkit-commit-queue.appspot.com', 'land-attachment', '--force-clean', '--non-interactive', '--build-style=both', '--quiet', '52285', '--parent-command=commit-queue', '--no-update']" exit_code: 1
Last 500 characters of output:
Fetching: https://bugs.webkit.org/show_bug.cgi?id=36948&ctype=xml
Processing 1 patch from 1 bug.
Cleaning working directory
Processing patch 52285 from bug 36948.
NOBODY (OOPS!) found in /Users/eseidel/Projects/CommitQueue/WebCore/ChangeLog does not appear to be a valid reviewer according to committers.py.
ERROR: /Users/eseidel/Projects/CommitQueue/WebCore/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive).
Comment 6 Alexey Proskuryakov 2010-04-01 10:28:48 PDT
It's definitely a great change to extract this code into a function. But I'm not sure if Position is a good place for it. Of all data members in Position, this code only uses m_node, so I wonder if direction is conceptually a function of position. It's also easy to confuse with VisiblePosition affinity.

On the other hand, it's only used in Position and VisiblePosition code. Hmm.

+    for (const RenderObject* r = node()->renderer(); r; r = r->parent()) {

We don't usually use accessor functions in class implementation, should preferably be m_anchorNode->renderer().
Comment 7 Eric Seidel (no email) 2010-04-01 18:19:25 PDT
Comment on attachment 52285 [details]
patch v0

Looks like cq+ was just set prematurely.
Comment 8 Hajime Morrita 2010-04-01 22:30:35 PDT
Hi eric,
> Looks like cq+ was just set prematurely.
Umm. I filed the fix on Bug 37011 and submitted a patch to do that small cleanup,
just for taking advantage of commit-queue.