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

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

Issue 2261663002: Disallow cast/implicit conversion from LayoutUnit to int/unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 3 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 | « no previous file | third_party/WebKit/Source/core/editing/commands/EditorCommand.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) 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 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 // start and end are on the same line 1166 // start and end are on the same line
1167 return IntRect(std::min(startCaretRect.x(), endCaretRect.x()), 1167 return IntRect(std::min(startCaretRect.x(), endCaretRect.x()),
1168 startCaretRect.y(), 1168 startCaretRect.y(),
1169 abs(endCaretRect.x() - startCaretRect.x()), 1169 abs(endCaretRect.x() - startCaretRect.x()),
1170 std::max(startCaretRect.height(), endCaretRect.height())); 1170 std::max(startCaretRect.height(), endCaretRect.height()));
1171 } 1171 }
1172 1172
1173 // start and end aren't on the same line, so go from start to the end of its line 1173 // start and end aren't on the same line, so go from start to the end of its line
1174 return IntRect(startCaretRect.x(), 1174 return IntRect(startCaretRect.x(),
1175 startCaretRect.y(), 1175 startCaretRect.y(),
1176 startCaretRect.width() + extraWidthToEndOfLine, 1176 (startCaretRect.width() + extraWidthToEndOfLine).toInt(),
1177 startCaretRect.height()); 1177 startCaretRect.height());
1178 } 1178 }
1179 1179
1180 IntRect Editor::firstRectForRange(const Range* range) const 1180 IntRect Editor::firstRectForRange(const Range* range) const
1181 { 1181 {
1182 DCHECK(range); 1182 DCHECK(range);
1183 return firstRectForRange(EphemeralRange(range)); 1183 return firstRectForRange(EphemeralRange(range));
1184 } 1184 }
1185 1185
1186 void Editor::computeAndSetTypingStyle(StylePropertySet* style, InputEvent::Input Type inputType) 1186 void Editor::computeAndSetTypingStyle(StylePropertySet* style, InputEvent::Input Type inputType)
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 1408
1409 DEFINE_TRACE(Editor) 1409 DEFINE_TRACE(Editor)
1410 { 1410 {
1411 visitor->trace(m_frame); 1411 visitor->trace(m_frame);
1412 visitor->trace(m_lastEditCommand); 1412 visitor->trace(m_lastEditCommand);
1413 visitor->trace(m_undoStack); 1413 visitor->trace(m_undoStack);
1414 visitor->trace(m_mark); 1414 visitor->trace(m_mark);
1415 } 1415 }
1416 1416
1417 } // namespace blink 1417 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698