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

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

Issue 2330953002: Audit the use of updateStyleAndLayoutIgnorePendingStylesheets in inSameLine (Closed)
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/web/WebLocalFrameImpl.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) 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 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 { 1234 {
1235 return logicalEndOfLineAlgorithm<EditingInFlatTreeStrategy>(currentPosition) ; 1235 return logicalEndOfLineAlgorithm<EditingInFlatTreeStrategy>(currentPosition) ;
1236 } 1236 }
1237 1237
1238 template <typename Strategy> 1238 template <typename Strategy>
1239 bool inSameLineAlgorithm(const PositionWithAffinityTemplate<Strategy>& position1 , const PositionWithAffinityTemplate<Strategy>& position2) 1239 bool inSameLineAlgorithm(const PositionWithAffinityTemplate<Strategy>& position1 , const PositionWithAffinityTemplate<Strategy>& position2)
1240 { 1240 {
1241 if (position1.isNull() || position2.isNull()) 1241 if (position1.isNull() || position2.isNull())
1242 return false; 1242 return false;
1243 DCHECK_EQ(position1.position().document(), position2.position().document()); 1243 DCHECK_EQ(position1.position().document(), position2.position().document());
1244 1244 DCHECK(!position1.position().document()->needsLayoutTreeUpdate());
1245 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
1246 // needs to be audited. See http://crbug.com/590369 for more details.
1247 position1.position().document()->updateStyleAndLayoutIgnorePendingStylesheet s();
1248 1245
1249 PositionWithAffinityTemplate<Strategy> startOfLine1 = startOfLine(position1) ; 1246 PositionWithAffinityTemplate<Strategy> startOfLine1 = startOfLine(position1) ;
1250 PositionWithAffinityTemplate<Strategy> startOfLine2 = startOfLine(position2) ; 1247 PositionWithAffinityTemplate<Strategy> startOfLine2 = startOfLine(position2) ;
1251 if (startOfLine1 == startOfLine2) 1248 if (startOfLine1 == startOfLine2)
1252 return true; 1249 return true;
1253 PositionTemplate<Strategy> canonicalized1 = canonicalPositionOf(startOfLine1 .position()); 1250 PositionTemplate<Strategy> canonicalized1 = canonicalPositionOf(startOfLine1 .position());
1254 if (canonicalized1 == startOfLine2.position()) 1251 if (canonicalized1 == startOfLine2.position())
1255 return true; 1252 return true;
1256 return canonicalized1 == canonicalPositionOf(startOfLine2.position()); 1253 return canonicalized1 == canonicalPositionOf(startOfLine2.position());
1257 } 1254 }
(...skipping 2064 matching lines...) Expand 10 before | Expand all | Expand 10 after
3322 { 3319 {
3323 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule); 3320 return previousPositionOfAlgorithm<EditingStrategy>(visiblePosition, rule);
3324 } 3321 }
3325 3322
3326 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi siblePosition, EditingBoundaryCrossingRule rule) 3323 VisiblePositionInFlatTree previousPositionOf(const VisiblePositionInFlatTree& vi siblePosition, EditingBoundaryCrossingRule rule)
3327 { 3324 {
3328 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio n, rule); 3325 return previousPositionOfAlgorithm<EditingInFlatTreeStrategy>(visiblePositio n, rule);
3329 } 3326 }
3330 3327
3331 } // namespace blink 3328 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698