OLD | NEW |
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. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. |
7 * All rights reserved. | 7 * All rights reserved. |
8 * Copyright (C) 2009 Google Inc. All rights reserved. | 8 * Copyright (C) 2009 Google Inc. All rights reserved. |
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. | 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. |
10 * (http://www.torchmobile.com/) | 10 * (http://www.torchmobile.com/) |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 children->InsertChildNode(this, table, before_child); | 321 children->InsertChildNode(this, table, before_child); |
322 } | 322 } |
323 table->AddChild(new_child); | 323 table->AddChild(new_child); |
324 } else { | 324 } else { |
325 children->InsertChildNode(this, new_child, before_child); | 325 children->InsertChildNode(this, new_child, before_child); |
326 } | 326 } |
327 | 327 |
328 if (new_child->IsText() && | 328 if (new_child->IsText() && |
329 new_child->Style()->TextTransform() == ETextTransform::kCapitalize) | 329 new_child->Style()->TextTransform() == ETextTransform::kCapitalize) |
330 ToLayoutText(new_child)->TransformText(); | 330 ToLayoutText(new_child)->TransformText(); |
331 | |
332 // SVG creates layoutObjects for <g display="none">, as SVG requires children | |
333 // of hidden <g>s to have layoutObjects - at least that's how our | |
334 // implementation works. | |
335 // Consider: | |
336 // <g display="none"><foreignObject><body style="position: relative">FOO... | |
337 // - layerTypeRequired() would return true for the <body>, creating a new | |
338 // Layer | |
339 // - when the document is painted, both layers are painted. The <body> layer | |
340 // doesn't know that it's inside a "hidden SVG subtree", and thus paints, | |
341 // even if it shouldn't. | |
342 // To avoid the problem altogether, detect early if we're inside a hidden SVG | |
343 // subtree and stop creating layers at all for these cases - they're not used | |
344 // anyways. | |
345 if (new_child->HasLayer() && !LayerCreationAllowedForSubtree()) | |
346 ToLayoutBoxModelObject(new_child) | |
347 ->Layer() | |
348 ->RemoveOnlyThisLayerAfterStyleChange(); | |
349 } | 331 } |
350 | 332 |
351 void LayoutObject::RemoveChild(LayoutObject* old_child) { | 333 void LayoutObject::RemoveChild(LayoutObject* old_child) { |
352 DCHECK(IsAllowedToModifyLayoutTreeStructure(GetDocument())); | 334 DCHECK(IsAllowedToModifyLayoutTreeStructure(GetDocument())); |
353 | 335 |
354 LayoutObjectChildList* children = VirtualChildren(); | 336 LayoutObjectChildList* children = VirtualChildren(); |
355 DCHECK(children); | 337 DCHECK(children); |
356 if (!children) | 338 if (!children) |
357 return; | 339 return; |
358 | 340 |
(...skipping 3294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3653 const blink::LayoutObject* root = object1; | 3635 const blink::LayoutObject* root = object1; |
3654 while (root->Parent()) | 3636 while (root->Parent()) |
3655 root = root->Parent(); | 3637 root = root->Parent(); |
3656 root->ShowLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3638 root->ShowLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3657 } else { | 3639 } else { |
3658 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3640 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
3659 } | 3641 } |
3660 } | 3642 } |
3661 | 3643 |
3662 #endif | 3644 #endif |
OLD | NEW |