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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutCounter.cpp

Issue 2701993002: DO NOT COMMIT: Results of running new (proposed) clang-format on Blink (Closed)
Patch Set: Created 3 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) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 2 * Copyright (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
3 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 makeCounterNodeIfNeeded(*currentLayoutObject, identifier, false); 243 makeCounterNodeIfNeeded(*currentLayoutObject, identifier, false);
244 if (searchEndLayoutObject == currentLayoutObject) { 244 if (searchEndLayoutObject == currentLayoutObject) {
245 // We may be at the end of our search. 245 // We may be at the end of our search.
246 if (currentCounter) { 246 if (currentCounter) {
247 // We have a suitable counter on the EndSearchLayoutObject. 247 // We have a suitable counter on the EndSearchLayoutObject.
248 if (previousSiblingProtector) { 248 if (previousSiblingProtector) {
249 // But we already found another counter that we come after. 249 // But we already found another counter that we come after.
250 if (currentCounter->actsAsReset()) { 250 if (currentCounter->actsAsReset()) {
251 // We found a reset counter that is on a layoutObject that is a 251 // We found a reset counter that is on a layoutObject that is a
252 // sibling of ours or a parent. 252 // sibling of ours or a parent.
253 if (isReset && areLayoutObjectsElementsSiblings( 253 if (isReset &&
254 *currentLayoutObject, counterOwner)) { 254 areLayoutObjectsElementsSiblings(*currentLayoutObject,
255 counterOwner)) {
255 // We are also a reset counter and the previous reset was on a 256 // We are also a reset counter and the previous reset was on a
256 // sibling layoutObject hence we are the next sibling of that 257 // sibling layoutObject hence we are the next sibling of that
257 // counter if that reset is not a root or we are a root node if 258 // counter if that reset is not a root or we are a root node if
258 // that reset is a root. 259 // that reset is a root.
259 parent = currentCounter->parent(); 260 parent = currentCounter->parent();
260 previousSibling = parent ? currentCounter : nullptr; 261 previousSibling = parent ? currentCounter : nullptr;
261 return parent.get(); 262 return parent.get();
262 } 263 }
263 // We are not a reset node or the previous reset must be on an 264 // We are not a reset node or the previous reset must be on an
264 // ancestor of our owner layoutObject hence we must be a child of 265 // ancestor of our owner layoutObject hence we must be a child of
(...skipping 24 matching lines...) Expand all
289 previousSibling = previousSiblingProtector.get(); 290 previousSibling = previousSiblingProtector.get();
290 return true; 291 return true;
291 } 292 }
292 } else { 293 } else {
293 // We are at the potential end of the search, but we had no previous 294 // We are at the potential end of the search, but we had no previous
294 // sibling candidate. In this case we follow pretty much the same 295 // sibling candidate. In this case we follow pretty much the same
295 // logic as above but no ASSERTs about previousSibling, and when we 296 // logic as above but no ASSERTs about previousSibling, and when we
296 // are a sibling of the end counter we must set previousSibling to 297 // are a sibling of the end counter we must set previousSibling to
297 // currentCounter. 298 // currentCounter.
298 if (currentCounter->actsAsReset()) { 299 if (currentCounter->actsAsReset()) {
299 if (isReset && areLayoutObjectsElementsSiblings( 300 if (isReset &&
300 *currentLayoutObject, counterOwner)) { 301 areLayoutObjectsElementsSiblings(*currentLayoutObject,
302 counterOwner)) {
301 parent = currentCounter->parent(); 303 parent = currentCounter->parent();
302 previousSibling = currentCounter; 304 previousSibling = currentCounter;
303 return parent.get(); 305 return parent.get();
304 } 306 }
305 parent = currentCounter; 307 parent = currentCounter;
306 previousSibling = previousSiblingProtector.get(); 308 previousSibling = previousSiblingProtector.get();
307 return true; 309 return true;
308 } 310 }
309 if (!isReset || 311 if (!isReset ||
310 !areLayoutObjectsElementsSiblings(*currentLayoutObject, 312 !areLayoutObjectsElementsSiblings(*currentLayoutObject,
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 current->parent(), current->previousSibling(), current->nextSibling(), 707 current->parent(), current->previousSibling(), current->nextSibling(),
706 current->hasCounterNodeMap() 708 current->hasCounterNodeMap()
707 ? counterName ? blink::counterMaps().get(current)->get(identifier) 709 ? counterName ? blink::counterMaps().get(current)->get(identifier)
708 : (blink::CounterNode*)1 710 : (blink::CounterNode*)1
709 : (blink::CounterNode*)0); 711 : (blink::CounterNode*)0);
710 } 712 }
711 fflush(stderr); 713 fflush(stderr);
712 } 714 }
713 715
714 #endif // NDEBUG 716 #endif // NDEBUG
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698