Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: sky/engine/core/editing/VisiblePosition.cpp

Issue 688213002: First pass at removing dead vertical writing mode code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/core/dom/Position.cpp ('k') | sky/engine/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « sky/engine/core/dom/Position.cpp ('k') | sky/engine/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698