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

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

Issue 878303002: Remove more scrolling code from Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « sky/engine/core/editing/FrameSelection.cpp ('k') | sky/engine/core/frame/FrameView.h » ('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 * 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 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 bool isLogicalEndOfLine(const VisiblePosition &p) 876 bool isLogicalEndOfLine(const VisiblePosition &p)
877 { 877 {
878 return p.isNotNull() && p == logicalEndOfLine(p); 878 return p.isNotNull() && p == logicalEndOfLine(p);
879 } 879 }
880 880
881 static inline IntPoint absoluteLineDirectionPointToLocalPointInBlock(RootInlineB ox* root, int lineDirectionPoint) 881 static inline IntPoint absoluteLineDirectionPointToLocalPointInBlock(RootInlineB ox* root, int lineDirectionPoint)
882 { 882 {
883 ASSERT(root); 883 ASSERT(root);
884 RenderBlockFlow& containingBlock = root->block(); 884 RenderBlockFlow& containingBlock = root->block();
885 FloatPoint absoluteBlockPoint = containingBlock.localToAbsolute(FloatPoint() ); 885 FloatPoint absoluteBlockPoint = containingBlock.localToAbsolute(FloatPoint() );
886 if (containingBlock.hasOverflowClip())
887 absoluteBlockPoint -= containingBlock.scrolledContentOffset();
888 return IntPoint(lineDirectionPoint - absoluteBlockPoint.x(), root->blockDire ctionPointInLine()); 886 return IntPoint(lineDirectionPoint - absoluteBlockPoint.x(), root->blockDire ctionPointInLine());
889 } 887 }
890 888
891 VisiblePosition previousLinePosition(const VisiblePosition &visiblePosition, int lineDirectionPoint, EditableType editableType) 889 VisiblePosition previousLinePosition(const VisiblePosition &visiblePosition, int lineDirectionPoint, EditableType editableType)
892 { 890 {
893 Position p = visiblePosition.deepEquivalent(); 891 Position p = visiblePosition.deepEquivalent();
894 Node* node = p.deprecatedNode(); 892 Node* node = p.deprecatedNode();
895 893
896 if (!node) 894 if (!node)
897 return VisiblePosition(); 895 return VisiblePosition();
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
1372 int caretOffset; 1370 int caretOffset;
1373 position.position().getInlineBoxAndOffset(position.affinity(), inlineBox, ca retOffset); 1371 position.position().getInlineBoxAndOffset(position.affinity(), inlineBox, ca retOffset);
1374 1372
1375 if (inlineBox) 1373 if (inlineBox)
1376 renderer = &inlineBox->renderer(); 1374 renderer = &inlineBox->renderer();
1377 1375
1378 return renderer->localCaretRect(inlineBox, caretOffset); 1376 return renderer->localCaretRect(inlineBox, caretOffset);
1379 } 1377 }
1380 1378
1381 } 1379 }
OLDNEW
« no previous file with comments | « sky/engine/core/editing/FrameSelection.cpp ('k') | sky/engine/core/frame/FrameView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698