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

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: Addressed comments 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
« no previous file with comments | « Source/core/editing/VisibleUnits.h ('k') | no next file » | 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 * 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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 int caretOffset; 1407 int caretOffset;
1403 position.position().getInlineBoxAndOffset(position.affinity(), inlineBox, ca retOffset); 1408 position.position().getInlineBoxAndOffset(position.affinity(), inlineBox, ca retOffset);
1404 1409
1405 if (inlineBox) 1410 if (inlineBox)
1406 renderer = &inlineBox->renderer(); 1411 renderer = &inlineBox->renderer();
1407 1412
1408 return renderer->localCaretRect(inlineBox, caretOffset); 1413 return renderer->localCaretRect(inlineBox, caretOffset);
1409 } 1414 }
1410 1415
1411 } 1416 }
OLDNEW
« no previous file with comments | « Source/core/editing/VisibleUnits.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698