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

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

Issue 2727853002: [css-display] Support display: contents pseudo-elements.
Patch Set: Add missing nullcheck (whoops). Created 3 years, 9 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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 if (currentCounter->parent()) 417 if (currentCounter->parent())
418 continue; 418 continue;
419 if (stayWithin == parentElement(*currentLayoutObject) && 419 if (stayWithin == parentElement(*currentLayoutObject) &&
420 currentCounter->hasResetType()) 420 currentCounter->hasResetType())
421 break; 421 break;
422 newNode->insertAfter(currentCounter, newNode->lastChild(), identifier); 422 newNode->insertAfter(currentCounter, newNode->lastChild(), identifier);
423 } 423 }
424 return newNode.get(); 424 return newNode.get();
425 } 425 }
426 426
427 LayoutCounter::LayoutCounter(Document* node, const CounterContent& counter) 427 LayoutCounter::LayoutCounter(PseudoElement& node, const CounterContent& counter)
428 : LayoutText(node, StringImpl::empty), 428 : LayoutText(nullptr, StringImpl::empty),
429 m_counter(counter), 429 m_counter(counter),
430 m_counterNode(nullptr), 430 m_counterNode(nullptr),
431 m_nextForSameCounter(nullptr) { 431 m_nextForSameCounter(nullptr) {
432 setPseudoForAnonymous(node);
432 view()->addLayoutCounter(); 433 view()->addLayoutCounter();
433 } 434 }
434 435
435 LayoutCounter::~LayoutCounter() {} 436 LayoutCounter::~LayoutCounter() {}
436 437
437 void LayoutCounter::willBeDestroyed() { 438 void LayoutCounter::willBeDestroyed() {
438 if (m_counterNode) { 439 if (m_counterNode) {
439 m_counterNode->removeLayoutObject(this); 440 m_counterNode->removeLayoutObject(this);
440 ASSERT(!m_counterNode); 441 ASSERT(!m_counterNode);
441 } 442 }
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 current->nextSibling(), 705 current->nextSibling(),
705 current->hasCounterNodeMap() 706 current->hasCounterNodeMap()
706 ? counterName ? blink::counterMaps().at(current)->at(identifier) 707 ? counterName ? blink::counterMaps().at(current)->at(identifier)
707 : (blink::CounterNode*)1 708 : (blink::CounterNode*)1
708 : (blink::CounterNode*)0); 709 : (blink::CounterNode*)0);
709 } 710 }
710 fflush(stderr); 711 fflush(stderr);
711 } 712 }
712 713
713 #endif // NDEBUG 714 #endif // NDEBUG
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698