| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
| 3 * Portions Copyright (c) 2011 Motorola Mobility, Inc. All rights reserved. | 3 * Portions Copyright (c) 2011 Motorola Mobility, Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 if (localRect.isEmpty() || !renderer) | 663 if (localRect.isEmpty() || !renderer) |
| 664 return 0; | 664 return 0; |
| 665 | 665 |
| 666 // This ignores transforms on purpose, for now. Vertical navigation is done | 666 // This ignores transforms on purpose, for now. Vertical navigation is done |
| 667 // without consulting transforms, so that 'up' in transformed text is 'up' | 667 // without consulting transforms, so that 'up' in transformed text is 'up' |
| 668 // relative to the text, not absolute 'up'. | 668 // relative to the text, not absolute 'up'. |
| 669 FloatPoint caretPoint = renderer->localToAbsolute(localRect.location()); | 669 FloatPoint caretPoint = renderer->localToAbsolute(localRect.location()); |
| 670 RenderObject* containingBlock = renderer->containingBlock(); | 670 RenderObject* containingBlock = renderer->containingBlock(); |
| 671 if (!containingBlock) | 671 if (!containingBlock) |
| 672 containingBlock = renderer; // Just use ourselves to determine the writi
ng mode if we have no containing block. | 672 containingBlock = renderer; // Just use ourselves to determine the writi
ng mode if we have no containing block. |
| 673 return containingBlock->isHorizontalWritingMode() ? caretPoint.x() : caretPo
int.y(); | 673 return caretPoint.x(); |
| 674 } | 674 } |
| 675 | 675 |
| 676 #ifndef NDEBUG | 676 #ifndef NDEBUG |
| 677 | 677 |
| 678 void VisiblePosition::debugPosition(const char* msg) const | 678 void VisiblePosition::debugPosition(const char* msg) const |
| 679 { | 679 { |
| 680 if (isNull()) | 680 if (isNull()) |
| 681 fprintf(stderr, "Position [%s]: null\n", msg); | 681 fprintf(stderr, "Position [%s]: null\n", msg); |
| 682 else { | 682 else { |
| 683 fprintf(stderr, "Position [%s]: %s, ", msg, m_deepPosition.deprecatedNod
e()->nodeName().utf8().data()); | 683 fprintf(stderr, "Position [%s]: %s, ", msg, m_deepPosition.deprecatedNod
e()->nodeName().utf8().data()); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 if (vpos) | 781 if (vpos) |
| 782 vpos->showTreeForThis(); | 782 vpos->showTreeForThis(); |
| 783 } | 783 } |
| 784 | 784 |
| 785 void showTree(const blink::VisiblePosition& vpos) | 785 void showTree(const blink::VisiblePosition& vpos) |
| 786 { | 786 { |
| 787 vpos.showTreeForThis(); | 787 vpos.showTreeForThis(); |
| 788 } | 788 } |
| 789 | 789 |
| 790 #endif | 790 #endif |
| OLD | NEW |