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

Side by Side Diff: Source/core/editing/VisibleUnits.cpp

Issue 437843002: Invalid caret at the end of line in overtype mode (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 months 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
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 * 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 878 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 bool isStartOfLine(const VisiblePosition &p) 889 bool isStartOfLine(const VisiblePosition &p)
890 { 890 {
891 return p.isNotNull() && p == startOfLine(p); 891 return p.isNotNull() && p == startOfLine(p);
892 } 892 }
893 893
894 bool isEndOfLine(const VisiblePosition &p) 894 bool isEndOfLine(const VisiblePosition &p)
895 { 895 {
896 return p.isNotNull() && p == endOfLine(p); 896 return p.isNotNull() && p == endOfLine(p);
897 } 897 }
898 898
899 bool isLogicalEndOfLine(const VisiblePosition &p)
900 {
901 return p.isNotNull() && p == logicalEndOfLine(p);
902 }
903
899 static inline IntPoint absoluteLineDirectionPointToLocalPointInBlock(RootInlineB ox* root, int lineDirectionPoint) 904 static inline IntPoint absoluteLineDirectionPointToLocalPointInBlock(RootInlineB ox* root, int lineDirectionPoint)
900 { 905 {
901 ASSERT(root); 906 ASSERT(root);
902 RenderBlockFlow& containingBlock = root->block(); 907 RenderBlockFlow& containingBlock = root->block();
903 FloatPoint absoluteBlockPoint = containingBlock.localToAbsolute(FloatPoint() ); 908 FloatPoint absoluteBlockPoint = containingBlock.localToAbsolute(FloatPoint() );
904 if (containingBlock.hasOverflowClip()) 909 if (containingBlock.hasOverflowClip())
905 absoluteBlockPoint -= containingBlock.scrolledContentOffset(); 910 absoluteBlockPoint -= containingBlock.scrolledContentOffset();
906 911
907 if (root->block().isHorizontalWritingMode()) 912 if (root->block().isHorizontalWritingMode())
908 return IntPoint(lineDirectionPoint - absoluteBlockPoint.x(), root->block DirectionPointInLine()); 913 return IntPoint(lineDirectionPoint - absoluteBlockPoint.x(), root->block DirectionPointInLine());
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 { 1385 {
1381 return direction == LTR ? logicalStartOfLine(c) : logicalEndOfLine(c); 1386 return direction == LTR ? logicalStartOfLine(c) : logicalEndOfLine(c);
1382 } 1387 }
1383 1388
1384 VisiblePosition rightBoundaryOfLine(const VisiblePosition& c, TextDirection dire ction) 1389 VisiblePosition rightBoundaryOfLine(const VisiblePosition& c, TextDirection dire ction)
1385 { 1390 {
1386 return direction == LTR ? logicalEndOfLine(c) : logicalStartOfLine(c); 1391 return direction == LTR ? logicalEndOfLine(c) : logicalStartOfLine(c);
1387 } 1392 }
1388 1393
1389 } 1394 }
OLDNEW
« Source/core/editing/FrameSelection.cpp ('K') | « Source/core/editing/VisibleUnits.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698