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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.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
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) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 345
346 // SVG creates layoutObjects for <g display="none">, as SVG requires childre n of hidden 346 // SVG creates layoutObjects for <g display="none">, as SVG requires childre n of hidden
347 // <g>s to have layoutObjects - at least that's how our implementation works . Consider: 347 // <g>s to have layoutObjects - at least that's how our implementation works . Consider:
348 // <g display="none"><foreignObject><body style="position: relative">FOO... 348 // <g display="none"><foreignObject><body style="position: relative">FOO...
349 // - layerTypeRequired() would return true for the <body>, creating a new La yer 349 // - layerTypeRequired() would return true for the <body>, creating a new La yer
350 // - when the document is painted, both layers are painted. The <body> layer doesn't 350 // - when the document is painted, both layers are painted. The <body> layer doesn't
351 // know that it's inside a "hidden SVG subtree", and thus paints, even if it shouldn't. 351 // know that it's inside a "hidden SVG subtree", and thus paints, even if it shouldn't.
352 // To avoid the problem altogether, detect early if we're inside a hidden SV G subtree 352 // To avoid the problem altogether, detect early if we're inside a hidden SV G subtree
353 // and stop creating layers at all for these cases - they're not used anyway s. 353 // and stop creating layers at all for these cases - they're not used anyway s.
354 if (newChild->hasLayer() && !layerCreationAllowedForSubtree()) 354 if (newChild->hasLayer() && !layerCreationAllowedForSubtree())
355 toLayoutBoxModelObject(newChild)->layer()->removeOnlyThisLayer(); 355 toLayoutBoxModelObject(newChild)->layer()->removeOnlyThisLayerAfterStyle Change();
356 } 356 }
357 357
358 void LayoutObject::removeChild(LayoutObject* oldChild) 358 void LayoutObject::removeChild(LayoutObject* oldChild)
359 { 359 {
360 ASSERT(isAllowedToModifyLayoutTreeStructure(document())); 360 ASSERT(isAllowedToModifyLayoutTreeStructure(document()));
361 361
362 LayoutObjectChildList* children = virtualChildren(); 362 LayoutObjectChildList* children = virtualChildren();
363 ASSERT(children); 363 ASSERT(children);
364 if (!children) 364 if (!children)
365 return; 365 return;
(...skipping 3313 matching lines...) Expand 10 before | Expand all | Expand 10 after
3679 const blink::LayoutObject* root = object1; 3679 const blink::LayoutObject* root = object1;
3680 while (root->parent()) 3680 while (root->parent())
3681 root = root->parent(); 3681 root = root->parent();
3682 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3682 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3683 } else { 3683 } else {
3684 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3684 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3685 } 3685 }
3686 } 3686 }
3687 3687
3688 #endif 3688 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp ('k') | third_party/WebKit/Source/core/paint/PaintLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698