Changeset 82121 in webkit
- Timestamp:
- Mar 28, 2011 8:56:11 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r82117 r82121 1 2011-03-28 Xiaomei Ji <xji@chromium.org> 2 3 Reviewed by Ryosuke Niwa. 4 5 move directionOfEnclosingBlock() to be global so that it could be reused. 6 https://bugs.webkit.org/show_bug.cgi?id=57233. 7 8 Provide global function directionOfEnclosingBlock(Node*) so that it could be 9 reused in SelectionController and other functionalities that need enclosing 10 block's direcionality, such as moving caret by word in visual order. 11 12 No new functionality, so no new tests. 13 14 * editing/SelectionController.cpp: 15 (WebCore::SelectionController::directionOfEnclosingBlock): 16 * editing/htmlediting.cpp: 17 (WebCore::directionOfEnclosingBlock): 18 * editing/htmlediting.h: 19 1 20 2011-03-28 Jarkko Sakkinen <jarkko.j.sakkinen@gmail.com> 2 21 -
trunk/Source/WebCore/editing/SelectionController.cpp
r81965 r82121 335 335 } 336 336 337 TextDirection SelectionController::directionOfEnclosingBlock() 338 { 339 return WebCore::directionOfEnclosingBlock(m_selection.extent()); 340 } 341 337 342 void SelectionController::willBeModified(EAlteration alter, SelectionDirection direction) 338 343 { … … 382 387 m_selection.setExtent(start); 383 388 } 384 }385 386 TextDirection SelectionController::directionOfEnclosingBlock()387 {388 Node* enclosingBlockNode = enclosingBlock(m_selection.extent().containerNode());389 if (!enclosingBlockNode)390 return LTR;391 RenderObject* renderer = enclosingBlockNode->renderer();392 if (renderer)393 return renderer->style()->direction();394 return LTR;395 389 } 396 390 -
trunk/Source/WebCore/editing/htmlediting.cpp
r81965 r82121 333 333 } 334 334 335 TextDirection directionOfEnclosingBlock(const Position& position) 336 { 337 Node* enclosingBlockNode = enclosingBlock(position.containerNode()); 338 if (!enclosingBlockNode) 339 return LTR; 340 RenderObject* renderer = enclosingBlockNode->renderer(); 341 return renderer ? renderer->style()->direction() : LTR; 342 } 343 335 344 // This method is used to create positions in the DOM. It returns the maximum valid offset 336 345 // in a node. It returns 1 for some elements even though they do not have children, which -
trunk/Source/WebCore/editing/htmlediting.h
r81295 r82121 31 31 #include "HTMLNames.h" 32 32 #include "Position.h" 33 #include "TextDirection.h" 33 34 #include <wtf/Forward.h> 34 35 #include <wtf/unicode/CharacterNames.h> … … 97 98 bool isNodeInTextFormControl(Node* node); 98 99 100 TextDirection directionOfEnclosingBlock(const Position&); 101 99 102 // ------------------------------------------------------------------------- 100 103 // Position
Note: See TracChangeset
for help on using the changeset viewer.