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 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
606 if (current->hasLayer()) | 606 if (current->hasLayer()) |
607 return toLayoutBoxModelObject(current)->layer(); | 607 return toLayoutBoxModelObject(current)->layer(); |
608 } | 608 } |
609 // TODO(crbug.com/365897): we should get rid of detached layout subtrees, at | 609 // TODO(crbug.com/365897): we should get rid of detached layout subtrees, at |
610 // which point this code should not be reached. | 610 // which point this code should not be reached. |
611 return nullptr; | 611 return nullptr; |
612 } | 612 } |
613 | 613 |
614 PaintLayer* LayoutObject::paintingLayer() const { | 614 PaintLayer* LayoutObject::paintingLayer() const { |
615 for (const LayoutObject* current = this; current; | 615 for (const LayoutObject* current = this; current; |
616 // Use containingBlock instead of paintInvalidationParent for floating | 616 // Use container instead of paintInvalidationParent for floating object |
617 // object to omit any self-painting layers of inline objects that don't | 617 // to omit any self-painting layers of inline objects that don't paint |
618 // paint the floating object. | 618 // the floating object. |
619 current = current->isFloating() ? current->containingBlock() | 619 current = current->isFloating() ? current->container() |
620 : current->paintInvalidationParent()) { | 620 : current->paintInvalidationParent()) { |
621 if (current->hasLayer() && | 621 if (current->hasLayer() && |
622 toLayoutBoxModelObject(current)->layer()->isSelfPaintingLayer()) { | 622 toLayoutBoxModelObject(current)->layer()->isSelfPaintingLayer()) { |
623 return toLayoutBoxModelObject(current)->layer(); | 623 return toLayoutBoxModelObject(current)->layer(); |
624 } else if (current->isColumnSpanAll()) { | 624 } else if (current->isColumnSpanAll()) { |
625 // Column spanners paint through their multicolumn containers which can | 625 // Column spanners paint through their multicolumn containers which can |
626 // be accessed through the associated out-of-flow placeholder's parent. | 626 // be accessed through the associated out-of-flow placeholder's parent. |
627 current = current->spannerPlaceholder(); | 627 current = current->spannerPlaceholder(); |
628 } | 628 } |
629 } | 629 } |
(...skipping 1831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2461 if (skipInfo) | 2461 if (skipInfo) |
2462 skipInfo->resetOutput(); | 2462 skipInfo->resetOutput(); |
2463 | 2463 |
2464 if (isTextOrSVGChild()) | 2464 if (isTextOrSVGChild()) |
2465 return parent(); | 2465 return parent(); |
2466 | 2466 |
2467 EPosition pos = m_style->position(); | 2467 EPosition pos = m_style->position(); |
2468 if (pos == FixedPosition) | 2468 if (pos == FixedPosition) |
2469 return containerForFixedPosition(skipInfo); | 2469 return containerForFixedPosition(skipInfo); |
2470 | 2470 |
2471 if (pos == AbsolutePosition) { | 2471 if (pos == AbsolutePosition) |
2472 return containerForAbsolutePosition(skipInfo); | 2472 return containerForAbsolutePosition(skipInfo); |
2473 } | |
2474 | 2473 |
2475 if (isColumnSpanAll()) { | 2474 if (isColumnSpanAll()) { |
2476 LayoutObject* multicolContainer = spannerPlaceholder()->container(); | 2475 LayoutObject* multicolContainer = spannerPlaceholder()->container(); |
2477 if (skipInfo) { | 2476 if (skipInfo) { |
2478 // We jumped directly from the spanner to the multicol container. Need to | 2477 // We jumped directly from the spanner to the multicol container. Need to |
2479 // check if we skipped |ancestor| or filter/reflection on the way. | 2478 // check if we skipped |ancestor| or filter/reflection on the way. |
2480 for (LayoutObject* walker = parent(); | 2479 for (LayoutObject* walker = parent(); |
2481 walker && walker != multicolContainer; walker = walker->parent()) | 2480 walker && walker != multicolContainer; walker = walker->parent()) |
2482 skipInfo->update(*walker); | 2481 skipInfo->update(*walker); |
2483 } | 2482 } |
2484 return multicolContainer; | 2483 return multicolContainer; |
2485 } | 2484 } |
2486 | 2485 |
2487 if (isFloating()) | 2486 if (isFloating()) { |
2488 return containingBlock(skipInfo); | 2487 for (LayoutObject* object = parent(); object; object = object->parent()) { |
2488 if (object->canContainFloatingObject(*this)) | |
2489 return object; | |
2490 if (skipInfo) | |
2491 skipInfo->update(*object); | |
2492 } | |
2493 } | |
chrishtr
2017/01/21 02:14:59
ASSERT_NOT_REACHED()
| |
2489 | 2494 |
2490 return parent(); | 2495 return parent(); |
2491 } | 2496 } |
2492 | 2497 |
2493 inline LayoutObject* LayoutObject::paintInvalidationParent() const { | 2498 inline LayoutObject* LayoutObject::paintInvalidationParent() const { |
2494 if (isLayoutView()) | 2499 if (isLayoutView()) |
2495 return LayoutAPIShim::layoutObjectFrom(frame()->ownerLayoutItem()); | 2500 return LayoutAPIShim::layoutObjectFrom(frame()->ownerLayoutItem()); |
2496 return parent(); | 2501 return parent(); |
2497 } | 2502 } |
2498 | 2503 |
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3477 const blink::LayoutObject* root = object1; | 3482 const blink::LayoutObject* root = object1; |
3478 while (root->parent()) | 3483 while (root->parent()) |
3479 root = root->parent(); | 3484 root = root->parent(); |
3480 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3485 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3481 } else { | 3486 } else { |
3482 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3487 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
3483 } | 3488 } |
3484 } | 3489 } |
3485 | 3490 |
3486 #endif | 3491 #endif |
OLD | NEW |