OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 VisibleSelection newSelection; | 470 VisibleSelection newSelection; |
471 if (m_selection.isBaseFirst()) | 471 if (m_selection.isBaseFirst()) |
472 newSelection.setWithoutValidation(start, end); | 472 newSelection.setWithoutValidation(start, end); |
473 else | 473 else |
474 newSelection.setWithoutValidation(end, start); | 474 newSelection.setWithoutValidation(end, start); |
475 setSelection(newSelection, DoNotSetFocus); | 475 setSelection(newSelection, DoNotSetFocus); |
476 } | 476 } |
477 | 477 |
478 TextDirection FrameSelection::directionOfEnclosingBlock() | 478 TextDirection FrameSelection::directionOfEnclosingBlock() |
479 { | 479 { |
480 return blink::directionOfEnclosingBlock(m_selection.extent()); | 480 return blink::isEnclosingBoxHasLeftToRightDirection(m_selection.extent()) ?
LTR : RTL; |
481 } | 481 } |
482 | 482 |
483 TextDirection FrameSelection::directionOfSelection() | 483 TextDirection FrameSelection::directionOfSelection() |
484 { | 484 { |
485 InlineBox* startBox = 0; | 485 InlineBox* startBox = 0; |
486 InlineBox* endBox = 0; | 486 InlineBox* endBox = 0; |
487 int unusedOffset; | 487 int unusedOffset; |
488 // Cache the VisiblePositions because visibleStart() and visibleEnd() | 488 // Cache the VisiblePositions because visibleStart() and visibleEnd() |
489 // can cause layout, which has the potential to invalidate lineboxes. | 489 // can cause layout, which has the potential to invalidate lineboxes. |
490 VisiblePosition startPosition = m_selection.visibleStart(); | 490 VisiblePosition startPosition = m_selection.visibleStart(); |
(...skipping 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1932 sel.showTreeForThis(); | 1932 sel.showTreeForThis(); |
1933 } | 1933 } |
1934 | 1934 |
1935 void showTree(const blink::FrameSelection* sel) | 1935 void showTree(const blink::FrameSelection* sel) |
1936 { | 1936 { |
1937 if (sel) | 1937 if (sel) |
1938 sel->showTreeForThis(); | 1938 sel->showTreeForThis(); |
1939 } | 1939 } |
1940 | 1940 |
1941 #endif | 1941 #endif |
OLD | NEW |