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

Side by Side Diff: Source/core/rendering/RenderObjectChildList.cpp

Issue 571603003: Convert first letter into a pseudo element. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 3 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
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 27 matching lines...) Expand all
38 38
39 void RenderObjectChildList::trace(Visitor* visitor) 39 void RenderObjectChildList::trace(Visitor* visitor)
40 { 40 {
41 visitor->trace(m_firstChild); 41 visitor->trace(m_firstChild);
42 visitor->trace(m_lastChild); 42 visitor->trace(m_lastChild);
43 } 43 }
44 44
45 void RenderObjectChildList::destroyLeftoverChildren() 45 void RenderObjectChildList::destroyLeftoverChildren()
46 { 46 {
47 while (firstChild()) { 47 while (firstChild()) {
48 if (firstChild()->isListMarker() || (firstChild()->style()->styleType() == FIRST_LETTER && !firstChild()->isText())) { 48 if (firstChild()->isListMarker()) {
49 firstChild()->remove(); // List markers are owned by their enclosin g list and so don't get destroyed by this container. Similarly, first letters ar e destroyed by their remaining text fragment. 49 firstChild()->remove(); // List markers are owned by their enclosing list and so don't get destroyed by this container.
Julien - ping for review 2014/10/01 21:14:47 Nit: I would move that above the isListMarker chec
dsinclair 2014/10/04 02:01:34 Done.
50 } else { 50 continue;
51 // Destroy any anonymous children remaining in the render tree, as w ell as implicit (shadow) DOM elements like those used in the engine-based text f ields.
52 if (firstChild()->node())
53 firstChild()->node()->setRenderer(0);
54 firstChild()->destroy();
55 } 51 }
52
53 // Destroy any anonymous children remaining in the render tree, as well as implicit (shadow) DOM elements like those used in the engine-based text field s.
54 if (firstChild()->node())
55 firstChild()->node()->setRenderer(0);
56 firstChild()->destroy();
56 } 57 }
57 } 58 }
58 59
59 RenderObject* RenderObjectChildList::removeChildNode(RenderObject* owner, Render Object* oldChild, bool notifyRenderer) 60 RenderObject* RenderObjectChildList::removeChildNode(RenderObject* owner, Render Object* oldChild, bool notifyRenderer)
60 { 61 {
61 ASSERT(oldChild->parent() == owner); 62 ASSERT(oldChild->parent() == owner);
62 63
63 if (oldChild->isFloatingOrOutOfFlowPositioned()) 64 if (oldChild->isFloatingOrOutOfFlowPositioned())
64 toRenderBox(oldChild)->removeFloatingOrPositionedChildFromBlockLists(); 65 toRenderBox(oldChild)->removeFloatingOrPositionedChildFromBlockLists();
65 66
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 } 181 }
181 if (oldChild.isText()) { 182 if (oldChild.isText()) {
182 oldChild.parent()->setShouldDoFullPaintInvalidation(true); 183 oldChild.parent()->setShouldDoFullPaintInvalidation(true);
183 return; 184 return;
184 } 185 }
185 DisableCompositingQueryAsserts disabler; 186 DisableCompositingQueryAsserts disabler;
186 oldChild.invalidatePaintUsingContainer(oldChild.containerForPaintInvalidatio n(), oldChild.previousPaintInvalidationRect(), InvalidationRendererRemoval); 187 oldChild.invalidatePaintUsingContainer(oldChild.containerForPaintInvalidatio n(), oldChild.previousPaintInvalidationRect(), InvalidationRendererRemoval);
187 } 188 }
188 189
189 } // namespace blink 190 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698