Changeset 56915 in webkit
- Timestamp:
- Apr 1, 2010 8:14:41 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r56909 r56915 1 2010-04-01 MORITA Hajime <morrita@google.com> 2 3 Reviewed by Shinichiro Hamaji. 4 5 https://bugs.webkit.org/show_bug.cgi?id=36948 6 Refactoring: Position::primaryDirection() should be extracted. 7 8 No new tests. No functinal change. 9 10 * dom/Position.cpp: 11 (WebCore::Position::getInlineBoxAndOffset): 12 (WebCore::Position::primaryDirection): Added 13 * dom/Position.h: 14 * editing/VisiblePosition.cpp: 15 (WebCore::VisiblePosition::leftVisuallyDistinctCandidate): 16 (WebCore::VisiblePosition::rightVisuallyDistinctCandidate): 17 1 18 2010-04-01 Alexander Pavlov <apavlov@chromium.org> 2 19 -
trunk/WebCore/dom/Position.cpp
r56825 r56915 947 947 void Position::getInlineBoxAndOffset(EAffinity affinity, InlineBox*& inlineBox, int& caretOffset) const 948 948 { 949 TextDirection primaryDirection = LTR; 950 for (RenderObject* r = node()->renderer(); r; r = r->parent()) { 951 if (r->isBlockFlow()) { 952 primaryDirection = r->style()->direction(); 953 break; 954 } 955 } 956 getInlineBoxAndOffset(affinity, primaryDirection, inlineBox, caretOffset); 949 getInlineBoxAndOffset(affinity, primaryDirection(), inlineBox, caretOffset); 957 950 } 958 951 … … 1148 1141 } 1149 1142 1143 TextDirection Position::primaryDirection() const 1144 { 1145 TextDirection primaryDirection = LTR; 1146 for (const RenderObject* r = node()->renderer(); r; r = r->parent()) { 1147 if (r->isBlockFlow()) { 1148 primaryDirection = r->style()->direction(); 1149 break; 1150 } 1151 } 1152 1153 return primaryDirection; 1154 } 1155 1156 1150 1157 void Position::debugPosition(const char* msg) const 1151 1158 { -
trunk/WebCore/dom/Position.h
r53809 r56915 159 159 void getInlineBoxAndOffset(EAffinity, TextDirection primaryDirection, InlineBox*&, int& caretOffset) const; 160 160 161 TextDirection primaryDirection() const; 162 161 163 static bool hasRenderedNonAnonymousDescendantsWithHeight(RenderObject*); 162 164 static bool nodeIsUserSelectNone(Node*); -
trunk/WebCore/editing/VisiblePosition.cpp
r56825 r56915 111 111 112 112 Position downstreamStart = p.downstream(); 113 TextDirection primaryDirection = LTR; 114 for (RenderObject* r = p.node()->renderer(); r; r = r->parent()) { 115 if (r->isBlockFlow()) { 116 primaryDirection = r->style()->direction(); 117 break; 118 } 119 } 113 TextDirection primaryDirection = p.primaryDirection(); 120 114 121 115 while (true) { … … 253 247 254 248 Position downstreamStart = p.downstream(); 255 TextDirection primaryDirection = LTR; 256 for (RenderObject* r = p.node()->renderer(); r; r = r->parent()) { 257 if (r->isBlockFlow()) { 258 primaryDirection = r->style()->direction(); 259 break; 260 } 261 } 249 TextDirection primaryDirection = p.primaryDirection(); 262 250 263 251 while (true) {
Note: See TracChangeset
for help on using the changeset viewer.