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

Side by Side Diff: Source/core/dom/Position.h

Issue 307353002: Use Position instead of VisiblePosition for SurroundingText. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix crash Created 6 years, 6 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) 2004, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved.
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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 return offset < anchorNode->maxCharacterOffset(); 311 return offset < anchorNode->maxCharacterOffset();
312 312
313 int currentOffset = 0; 313 int currentOffset = 0;
314 for (Node* node = anchorNode->firstChild(); node && currentOffset < offset; node = node->nextSibling()) 314 for (Node* node = anchorNode->firstChild(); node && currentOffset < offset; node = node->nextSibling())
315 currentOffset++; 315 currentOffset++;
316 316
317 317
318 return offset < currentOffset; 318 return offset < currentOffset;
319 } 319 }
320 320
321 PassRefPtrWillBeRawPtr<Range> makeRange(const Position&, const Position&);
Yuta Kitamura 2014/06/06 08:57:30 I'm not sure what's the difference between this fu
mlamouri (slow - plz ping) 2014/06/06 09:23:16 Removed.
322
321 class PositionWithAffinity { 323 class PositionWithAffinity {
322 DISALLOW_ALLOCATION(); 324 DISALLOW_ALLOCATION();
323 public: 325 public:
324 PositionWithAffinity() 326 PositionWithAffinity()
325 : m_affinity(DOWNSTREAM) 327 : m_affinity(DOWNSTREAM)
326 { 328 {
327 } 329 }
328 330
329 PositionWithAffinity(const Position& position, EAffinity affinity = DOWNSTRE AM) 331 PositionWithAffinity(const Position& position, EAffinity affinity = DOWNSTRE AM)
330 : m_position(position) 332 : m_position(position)
(...skipping 16 matching lines...) Expand all
347 349
348 } // namespace WebCore 350 } // namespace WebCore
349 351
350 #ifndef NDEBUG 352 #ifndef NDEBUG
351 // Outside the WebCore namespace for ease of invocation from gdb. 353 // Outside the WebCore namespace for ease of invocation from gdb.
352 void showTree(const WebCore::Position&); 354 void showTree(const WebCore::Position&);
353 void showTree(const WebCore::Position*); 355 void showTree(const WebCore::Position*);
354 #endif 356 #endif
355 357
356 #endif // Position_h 358 #endif // Position_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698