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

Side by Side Diff: third_party/WebKit/Source/core/editing/Editor.cpp

Issue 1653673002: Even more explicit LayoutUnit conversion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@moarConstructors
Patch Set: address comments Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
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 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1111 // WebCore inserts <div><br></div> *before* the current block, which correct ly moves the paragraph down but which doesn't 1111 // WebCore inserts <div><br></div> *before* the current block, which correct ly moves the paragraph down but which doesn't
1112 // change the caret's DOM position (["hello", 0]). In these situations the a bove FrameSelection::setSelection call 1112 // change the caret's DOM position (["hello", 0]). In these situations the a bove FrameSelection::setSelection call
1113 // does not call EditorClient::respondToChangedSelection(), which, on the Ma c, sends selection change notifications and 1113 // does not call EditorClient::respondToChangedSelection(), which, on the Ma c, sends selection change notifications and
1114 // starts a new kill ring sequence, but we want to do these things (matches AppKit). 1114 // starts a new kill ring sequence, but we want to do these things (matches AppKit).
1115 if (selectionDidNotChangeDOMPosition) 1115 if (selectionDidNotChangeDOMPosition)
1116 client().respondToChangedSelection(m_frame, frame().selection().selectio nType()); 1116 client().respondToChangedSelection(m_frame, frame().selection().selectio nType());
1117 } 1117 }
1118 1118
1119 IntRect Editor::firstRectForRange(const EphemeralRange& range) const 1119 IntRect Editor::firstRectForRange(const EphemeralRange& range) const
1120 { 1120 {
1121 LayoutUnit extraWidthToEndOfLine = 0; 1121 LayoutUnit extraWidthToEndOfLine;
1122 ASSERT(range.isNotNull()); 1122 ASSERT(range.isNotNull());
1123 1123
1124 IntRect startCaretRect = RenderedPosition(createVisiblePosition(range.startP osition()).deepEquivalent(), TextAffinity::Downstream).absoluteRect(&extraWidthT oEndOfLine); 1124 IntRect startCaretRect = RenderedPosition(createVisiblePosition(range.startP osition()).deepEquivalent(), TextAffinity::Downstream).absoluteRect(&extraWidthT oEndOfLine);
1125 if (startCaretRect.isEmpty()) 1125 if (startCaretRect.isEmpty())
1126 return IntRect(); 1126 return IntRect();
1127 1127
1128 IntRect endCaretRect = RenderedPosition(createVisiblePosition(range.endPosit ion()).deepEquivalent(), TextAffinity::Upstream).absoluteRect(); 1128 IntRect endCaretRect = RenderedPosition(createVisiblePosition(range.endPosit ion()).deepEquivalent(), TextAffinity::Upstream).absoluteRect();
1129 if (endCaretRect.isEmpty()) 1129 if (endCaretRect.isEmpty())
1130 return IntRect(); 1130 return IntRect();
1131 1131
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 } 1380 }
1381 1381
1382 DEFINE_TRACE(Editor) 1382 DEFINE_TRACE(Editor)
1383 { 1383 {
1384 visitor->trace(m_frame); 1384 visitor->trace(m_frame);
1385 visitor->trace(m_lastEditCommand); 1385 visitor->trace(m_lastEditCommand);
1386 visitor->trace(m_mark); 1386 visitor->trace(m_mark);
1387 } 1387 }
1388 1388
1389 } // namespace blink 1389 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/CaretBase.cpp ('k') | third_party/WebKit/Source/core/editing/SelectionEditor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698