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. 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 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 { | 662 { |
663 ASSERT(isInsideFlowThread()); | 663 ASSERT(isInsideFlowThread()); |
664 | 664 |
665 // See if we have the thread cached because we're in the middle of layout. | 665 // See if we have the thread cached because we're in the middle of layout. |
666 if (LayoutState* layoutState = view()->layoutState()) { | 666 if (LayoutState* layoutState = view()->layoutState()) { |
667 if (LayoutFlowThread* flowThread = layoutState->flowThread()) | 667 if (LayoutFlowThread* flowThread = layoutState->flowThread()) |
668 return flowThread; | 668 return flowThread; |
669 } | 669 } |
670 | 670 |
671 // Not in the middle of layout so have to find the thread the slow way. | 671 // Not in the middle of layout so have to find the thread the slow way. |
672 LayoutObject* curr = const_cast<LayoutObject*>(this); | 672 return LayoutFlowThread::locateFlowThreadContainingBlockOf(*this); |
673 while (curr) { | |
674 if (curr->isSVG() && !curr->isSVGRoot()) | |
675 return nullptr; | |
676 if (curr->isLayoutFlowThread()) | |
677 return toLayoutFlowThread(curr); | |
678 LayoutObject* container = curr->container(); | |
679 curr = curr->parent(); | |
680 while (curr != container) { | |
681 if (curr->isLayoutFlowThread()) { | |
682 // The nearest ancestor flow thread isn't in our containing bloc
k chain. Then we | |
683 // aren't really part of any flow thread, and we should stop loo
king. This happens | |
684 // when there are out-of-flow objects or column spanners. | |
685 return nullptr; | |
686 } | |
687 curr = curr->parent(); | |
688 } | |
689 } | |
690 return nullptr; | |
691 } | 673 } |
692 | 674 |
693 // FIXME: This could be used when changing the size of a layoutObject without ch
ildren to skip some invalidations. | 675 // FIXME: This could be used when changing the size of a layoutObject without ch
ildren to skip some invalidations. |
694 // FIXME: This is incorrect for document element. Remove this when we enable sli
mming paint. | 676 // FIXME: This is incorrect for document element. Remove this when we enable sli
mming paint. |
695 static inline bool layoutObjectHasNoBoxEffectObsolete(const LayoutObject& object
) | 677 static inline bool layoutObjectHasNoBoxEffectObsolete(const LayoutObject& object
) |
696 { | 678 { |
697 return !object.style()->hasVisualOverflowingEffect() && !object.style()->has
BorderDecoration() && !object.style()->hasBackground(); | 679 return !object.style()->hasVisualOverflowingEffect() && !object.style()->has
BorderDecoration() && !object.style()->hasBackground(); |
698 } | 680 } |
699 | 681 |
700 bool LayoutObject::skipInvalidationWhenLaidOutChildren() const | 682 bool LayoutObject::skipInvalidationWhenLaidOutChildren() const |
(...skipping 2676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3377 const blink::LayoutObject* root = object1; | 3359 const blink::LayoutObject* root = object1; |
3378 while (root->parent()) | 3360 while (root->parent()) |
3379 root = root->parent(); | 3361 root = root->parent(); |
3380 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3362 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3381 } else { | 3363 } else { |
3382 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3364 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
3383 } | 3365 } |
3384 } | 3366 } |
3385 | 3367 |
3386 #endif | 3368 #endif |
OLD | NEW |