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

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

Issue 1892473002: Update PaintLayer::needsPaintPhaseXXX flags when add/remove layer on style change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutObject.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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 createLayer(type); 210 createLayer(type);
211 if (parent() && !needsLayout()) { 211 if (parent() && !needsLayout()) {
212 // FIXME: We should call a specialized version of this function. 212 // FIXME: We should call a specialized version of this function.
213 layer()->updateLayerPositionsAfterLayout(); 213 layer()->updateLayerPositionsAfterLayout();
214 } 214 }
215 } 215 }
216 } else if (layer() && layer()->parent()) { 216 } else if (layer() && layer()->parent()) {
217 PaintLayer* parentLayer = layer()->parent(); 217 PaintLayer* parentLayer = layer()->parent();
218 setHasTransformRelatedProperty(false); // Either a transform wasn't spec ified or the object doesn't support transforms, so just null out the bit. 218 setHasTransformRelatedProperty(false); // Either a transform wasn't spec ified or the object doesn't support transforms, so just null out the bit.
219 setHasReflection(false); 219 setHasReflection(false);
220 layer()->removeOnlyThisLayer(); // calls destroyLayer() which clears m_l ayer 220 layer()->removeOnlyThisLayerAfterStyleChange(); // calls destroyLayer() which clears m_layer
221 if (wasFloatingBeforeStyleChanged && isFloating()) 221 if (wasFloatingBeforeStyleChanged && isFloating())
222 setChildNeedsLayout(); 222 setChildNeedsLayout();
223 if (hadTransform) 223 if (hadTransform)
224 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInva lidationReason::StyleChange); 224 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInva lidationReason::StyleChange);
225 if (!needsLayout()) { 225 if (!needsLayout()) {
226 // FIXME: We should call a specialized version of this function. 226 // FIXME: We should call a specialized version of this function.
227 parentLayer->updateLayerPositionsAfterLayout(); 227 parentLayer->updateLayerPositionsAfterLayout();
228 } 228 }
229 } 229 }
230 230
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 if (newStyleIsViewportConstained && layer()) 288 if (newStyleIsViewportConstained && layer())
289 frameView->addViewportConstrainedObject(this); 289 frameView->addViewportConstrainedObject(this);
290 else 290 else
291 frameView->removeViewportConstrainedObject(this); 291 frameView->removeViewportConstrainedObject(this);
292 } 292 }
293 } 293 }
294 } 294 }
295 295
296 void LayoutBoxModelObject::createLayer(PaintLayerType type) 296 void LayoutBoxModelObject::createLayer(PaintLayerType type)
297 { 297 {
298 // If the current paint invalidation container is not a stacking context and this object is
299 // stacked content, creating this layer may cause this object and its
300 // descendants to change paint invalidation container. Therefore we must eag erly invalidate
301 // them on the original paint invalidation container before creating the lay er.
302 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() && isRooted() && style Ref().isStacked()) {
303 const LayoutBoxModelObject& currentPaintInvalidationContainer = containe rForPaintInvalidation();
304 if (!currentPaintInvalidationContainer.styleRef().isStackingContext())
305 invalidatePaintIncludingNonSelfPaintingLayerDescendants(currentPaint InvalidationContainer);
306 }
307
308 ASSERT(!m_layer); 298 ASSERT(!m_layer);
309 m_layer = adoptPtr(new PaintLayer(this, type)); 299 m_layer = adoptPtr(new PaintLayer(this, type));
310 setHasLayer(true); 300 setHasLayer(true);
311 m_layer->insertOnlyThisLayer(); 301 m_layer->insertOnlyThisLayerAfterStyleChange();
312 } 302 }
313 303
314 void LayoutBoxModelObject::destroyLayer() 304 void LayoutBoxModelObject::destroyLayer()
315 { 305 {
316 setHasLayer(false); 306 setHasLayer(false);
317 m_layer = nullptr; 307 m_layer = nullptr;
318 } 308 }
319 309
320 bool LayoutBoxModelObject::hasSelfPaintingLayer() const 310 bool LayoutBoxModelObject::hasSelfPaintingLayer() const
321 { 311 {
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 if (rootElementStyle->hasBackground()) 959 if (rootElementStyle->hasBackground())
970 return false; 960 return false;
971 961
972 if (node() != document().firstBodyElement()) 962 if (node() != document().firstBodyElement())
973 return false; 963 return false;
974 964
975 return true; 965 return true;
976 } 966 }
977 967
978 } // namespace blink 968 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698