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: Source/core/layout/LayoutObjectChildList.cpp

Issue 778003003: List marker pseudo elements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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
« no previous file with comments | « Source/core/layout/LayoutObject.cpp ('k') | Source/core/layout/TextAutosizer.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) 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 10 matching lines...) Expand all
21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27 #include "config.h" 27 #include "config.h"
28 #include "core/layout/LayoutObjectChildList.h" 28 #include "core/layout/LayoutObjectChildList.h"
29 29
30 #include "core/dom/AXObjectCache.h" 30 #include "core/dom/AXObjectCache.h"
31 #include "core/dom/MarkerPseudoElement.h"
31 #include "core/layout/LayoutCounter.h" 32 #include "core/layout/LayoutCounter.h"
32 #include "core/layout/LayoutObject.h" 33 #include "core/layout/LayoutObject.h"
33 #include "core/layout/LayoutView.h" 34 #include "core/layout/LayoutView.h"
34 #include "core/style/ComputedStyle.h" 35 #include "core/style/ComputedStyle.h"
35 #include "core/paint/DeprecatedPaintLayer.h" 36 #include "core/paint/DeprecatedPaintLayer.h"
36 37
37 namespace blink { 38 namespace blink {
38 39
39 void LayoutObjectChildList::destroyLeftoverChildren() 40 void LayoutObjectChildList::destroyLeftoverChildren()
40 { 41 {
41 while (firstChild()) { 42 while (firstChild()) {
43 // RuntimeEnabledFeatures::listMarkerPseudoElementEnabled
44 // List markers are owned by the list marker pseudo element and so don't get destroyed by this container.
45 // else
42 // List markers are owned by their enclosing list and so don't get destr oyed by this container. 46 // List markers are owned by their enclosing list and so don't get destr oyed by this container.
43 if (firstChild()->isListMarker()) { 47 if (firstChild()->isListMarker()) {
44 firstChild()->remove(); 48 firstChild()->remove();
45 continue; 49 continue;
46 } 50 }
47 51
48 // 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. 52 // 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.
49 if (firstChild()->node()) 53 if (firstChild()->node())
50 firstChild()->node()->setLayoutObject(nullptr); 54 firstChild()->node()->setLayoutObject(nullptr);
51 firstChild()->destroy(); 55 firstChild()->destroy();
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 setLastChild(newChild); 153 setLastChild(newChild);
150 } 154 }
151 155
152 if (!owner->documentBeingDestroyed() && notifyRenderer) 156 if (!owner->documentBeingDestroyed() && notifyRenderer)
153 newChild->insertedIntoTree(); 157 newChild->insertedIntoTree();
154 158
155 if (!owner->documentBeingDestroyed()) { 159 if (!owner->documentBeingDestroyed()) {
156 LayoutCounter::layoutObjectSubtreeAttached(newChild); 160 LayoutCounter::layoutObjectSubtreeAttached(newChild);
157 } 161 }
158 162
163 if (RuntimeEnabledFeatures::listMarkerPseudoElementEnabled() && owner->isLis tItem())
164 newChild->setAncestorNeedsSubtreeChangeNotification(true);
165
159 newChild->setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::AddedT oLayout); 166 newChild->setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::AddedT oLayout);
160 newChild->setShouldDoFullPaintInvalidation(PaintInvalidationRendererInsertio n); 167 newChild->setShouldDoFullPaintInvalidation(PaintInvalidationRendererInsertio n);
161 if (!owner->normalChildNeedsLayout()) 168 if (!owner->normalChildNeedsLayout())
162 owner->setChildNeedsLayout(); // We may supply the static position for a n absolute positioned child. 169 owner->setChildNeedsLayout(); // We may supply the static position for a n absolute positioned child.
163 170
164 if (AXObjectCache* cache = owner->document().axObjectCache()) 171 if (AXObjectCache* cache = owner->document().axObjectCache())
165 cache->childrenChanged(owner); 172 cache->childrenChanged(owner);
166 } 173 }
167 174
168 void LayoutObjectChildList::invalidatePaintOnRemoval(const LayoutObject& oldChil d) 175 void LayoutObjectChildList::invalidatePaintOnRemoval(const LayoutObject& oldChil d)
169 { 176 {
170 if (!oldChild.isRooted()) 177 if (!oldChild.isRooted())
171 return; 178 return;
172 if (oldChild.isBody()) { 179 if (oldChild.isBody()) {
173 oldChild.view()->setShouldDoFullPaintInvalidation(); 180 oldChild.view()->setShouldDoFullPaintInvalidation();
174 return; 181 return;
175 } 182 }
176 183
177 DisableCompositingQueryAsserts disabler; 184 DisableCompositingQueryAsserts disabler;
178 // FIXME: We should not allow paint invalidation out of paint invalidation s tate. crbug.com/457415 185 // FIXME: We should not allow paint invalidation out of paint invalidation s tate. crbug.com/457415
179 DisablePaintInvalidationStateAsserts paintInvalidationAssertDisabler; 186 DisablePaintInvalidationStateAsserts paintInvalidationAssertDisabler;
180 const LayoutBoxModelObject* paintInvalidationContainer = oldChild.containerF orPaintInvalidation(); 187 const LayoutBoxModelObject* paintInvalidationContainer = oldChild.containerF orPaintInvalidation();
181 oldChild.invalidatePaintUsingContainer(paintInvalidationContainer, oldChild. previousPaintInvalidationRect(), PaintInvalidationRendererRemoval); 188 oldChild.invalidatePaintUsingContainer(paintInvalidationContainer, oldChild. previousPaintInvalidationRect(), PaintInvalidationRendererRemoval);
182 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) 189 if (RuntimeEnabledFeatures::slimmingPaintEnabled())
183 oldChild.invalidateDisplayItemClients(*paintInvalidationContainer); 190 oldChild.invalidateDisplayItemClients(*paintInvalidationContainer);
184 } 191 }
185 192
186 } // namespace blink 193 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutObject.cpp ('k') | Source/core/layout/TextAutosizer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698