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 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 o->m_bitfields.setPreferredLogicalWidthsDirty(true); | 847 o->m_bitfields.setPreferredLogicalWidthsDirty(true); |
848 if (o->style()->hasOutOfFlowPosition()) { | 848 if (o->style()->hasOutOfFlowPosition()) { |
849 // A positioned object has no effect on the min/max width of its con
taining block ever. | 849 // A positioned object has no effect on the min/max width of its con
taining block ever. |
850 // We can optimize this case and not go up any further. | 850 // We can optimize this case and not go up any further. |
851 break; | 851 break; |
852 } | 852 } |
853 o = container; | 853 o = container; |
854 } | 854 } |
855 } | 855 } |
856 | 856 |
857 LayoutObject* LayoutObject::containerForAbsolutePosition(const LayoutBoxModelObj
ect* ancestor, bool* ancestorSkipped) const | 857 bool LayoutObject::hasFilterOrReflection() const |
858 { | 858 { |
| 859 return (!RuntimeEnabledFeatures::cssBoxReflectFilterEnabled() && hasReflecti
on()) |
| 860 || (hasLayer() && toLayoutBoxModelObject(this)->layer()->hasFilterInduci
ngProperty()); |
| 861 } |
| 862 |
| 863 LayoutObject* LayoutObject::containerForAbsolutePosition(const LayoutBoxModelObj
ect* ancestor, bool* ancestorSkipped, bool* filterOrReflectionSkipped) const |
| 864 { |
| 865 ASSERT(!ancestorSkipped || !*ancestorSkipped); |
| 866 ASSERT(!filterOrReflectionSkipped || !*filterOrReflectionSkipped); |
| 867 |
859 // We technically just want our containing block, but | 868 // We technically just want our containing block, but |
860 // we may not have one if we're part of an uninstalled | 869 // we may not have one if we're part of an uninstalled |
861 // subtree. We'll climb as high as we can though. | 870 // subtree. We'll climb as high as we can though. |
862 for (LayoutObject* object = parent(); object; object = object->parent()) { | 871 for (LayoutObject* object = parent(); object; object = object->parent()) { |
863 if (object->canContainAbsolutePositionObjects()) | 872 if (object->canContainAbsolutePositionObjects()) |
864 return object; | 873 return object; |
865 | 874 |
866 if (ancestorSkipped && object == ancestor) | 875 if (ancestorSkipped && object == ancestor) |
867 *ancestorSkipped = true; | 876 *ancestorSkipped = true; |
| 877 |
| 878 if (filterOrReflectionSkipped && object->hasFilterOrReflection()) |
| 879 *filterOrReflectionSkipped = true; |
868 } | 880 } |
869 return nullptr; | 881 return nullptr; |
870 } | 882 } |
871 | 883 |
872 LayoutBlock* LayoutObject::containerForFixedPosition(const LayoutBoxModelObject*
ancestor, bool* ancestorSkipped) const | 884 LayoutBlock* LayoutObject::containerForFixedPosition(const LayoutBoxModelObject*
ancestor, bool* ancestorSkipped, bool* filterOrReflectionSkipped) const |
873 { | 885 { |
874 ASSERT(!ancestorSkipped || !*ancestorSkipped); | 886 ASSERT(!ancestorSkipped || !*ancestorSkipped); |
| 887 ASSERT(!filterOrReflectionSkipped || !*filterOrReflectionSkipped); |
875 ASSERT(!isText()); | 888 ASSERT(!isText()); |
876 | 889 |
877 LayoutObject* object = parent(); | 890 LayoutObject* object = parent(); |
878 for (; object && !object->canContainFixedPositionObjects(); object = object-
>parent()) { | 891 for (; object && !object->canContainFixedPositionObjects(); object = object-
>parent()) { |
879 if (ancestorSkipped && object == ancestor) | 892 if (ancestorSkipped && object == ancestor) |
880 *ancestorSkipped = true; | 893 *ancestorSkipped = true; |
| 894 |
| 895 if (filterOrReflectionSkipped && object->hasFilterOrReflection()) |
| 896 *filterOrReflectionSkipped = true; |
881 } | 897 } |
882 | 898 |
883 ASSERT(!object || !object->isAnonymousBlock()); | 899 ASSERT(!object || !object->isAnonymousBlock()); |
884 return toLayoutBlock(object); | 900 return toLayoutBlock(object); |
885 } | 901 } |
886 | 902 |
887 LayoutBlock* LayoutObject::containingBlockForAbsolutePosition() const | 903 LayoutBlock* LayoutObject::containingBlockForAbsolutePosition() const |
888 { | 904 { |
889 LayoutObject* o = containerForAbsolutePosition(); | 905 LayoutObject* o = containerForAbsolutePosition(); |
890 | 906 |
(...skipping 1666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2557 | 2573 |
2558 if (layoutObject->document().settings() && layoutObject->document().settings
()->shouldRespectImageOrientation()) | 2574 if (layoutObject->document().settings() && layoutObject->document().settings
()->shouldRespectImageOrientation()) |
2559 return RespectImageOrientation; | 2575 return RespectImageOrientation; |
2560 | 2576 |
2561 if (layoutObject->style() && layoutObject->style()->respectImageOrientation(
) == RespectImageOrientation) | 2577 if (layoutObject->style() && layoutObject->style()->respectImageOrientation(
) == RespectImageOrientation) |
2562 return RespectImageOrientation; | 2578 return RespectImageOrientation; |
2563 | 2579 |
2564 return DoNotRespectImageOrientation; | 2580 return DoNotRespectImageOrientation; |
2565 } | 2581 } |
2566 | 2582 |
2567 LayoutObject* LayoutObject::container(const LayoutBoxModelObject* ancestor, bool
* ancestorSkipped) const | 2583 LayoutObject* LayoutObject::container(const LayoutBoxModelObject* ancestor, bool
* ancestorSkipped, bool* filterOrReflectionSkipped) const |
2568 { | 2584 { |
2569 if (ancestorSkipped) | 2585 if (ancestorSkipped) |
2570 *ancestorSkipped = false; | 2586 *ancestorSkipped = false; |
| 2587 if (filterOrReflectionSkipped) |
| 2588 *filterOrReflectionSkipped = false; |
2571 | 2589 |
2572 LayoutObject* o = parent(); | 2590 LayoutObject* o = parent(); |
2573 | 2591 |
2574 if (isTextOrSVGChild()) | 2592 if (isTextOrSVGChild()) |
2575 return o; | 2593 return o; |
2576 | 2594 |
2577 EPosition pos = m_style->position(); | 2595 EPosition pos = m_style->position(); |
2578 if (pos == FixedPosition) | 2596 if (pos == FixedPosition) |
2579 return containerForFixedPosition(ancestor, ancestorSkipped); | 2597 return containerForFixedPosition(ancestor, ancestorSkipped, filterOrRefl
ectionSkipped); |
2580 | 2598 |
2581 if (pos == AbsolutePosition) | 2599 if (pos == AbsolutePosition) |
2582 return containerForAbsolutePosition(ancestor, ancestorSkipped); | 2600 return containerForAbsolutePosition(ancestor, ancestorSkipped, filterOrR
eflectionSkipped); |
2583 | 2601 |
2584 if (isColumnSpanAll()) { | 2602 if (isColumnSpanAll()) { |
2585 LayoutObject* multicolContainer = spannerPlaceholder()->container(); | 2603 LayoutObject* multicolContainer = spannerPlaceholder()->container(); |
2586 if (ancestorSkipped && ancestor) { | 2604 if ((ancestorSkipped && ancestor) || filterOrReflectionSkipped) { |
2587 // We jumped directly from the spanner to the multicol container. Ne
ed to check if | 2605 // We jumped directly from the spanner to the multicol container. Ne
ed to check if |
2588 // we skipped |paintInvalidationContainer| on the way. | 2606 // we skipped |ancestor| or filter/reflection on the way. |
2589 for (LayoutObject* walker = parent(); walker && walker != multicolCo
ntainer; walker = walker->parent()) { | 2607 for (LayoutObject* walker = parent(); walker && walker != multicolCo
ntainer; walker = walker->parent()) { |
2590 if (walker == ancestor) { | 2608 if (ancestorSkipped && walker == ancestor) |
2591 *ancestorSkipped = true; | 2609 *ancestorSkipped = true; |
2592 break; | 2610 if (filterOrReflectionSkipped && walker->hasFilterOrReflection()
) |
2593 } | 2611 *filterOrReflectionSkipped = true; |
2594 } | 2612 } |
2595 } | 2613 } |
2596 return multicolContainer; | 2614 return multicolContainer; |
2597 } | 2615 } |
2598 | 2616 |
2599 return o; | 2617 return o; |
2600 } | 2618 } |
2601 | 2619 |
2602 LayoutObject* LayoutObject::parentCrossingFrameBoundaries() const | 2620 LayoutObject* LayoutObject::parentCrossingFrameBoundaries() const |
2603 { | 2621 { |
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3688 const blink::LayoutObject* root = object1; | 3706 const blink::LayoutObject* root = object1; |
3689 while (root->parent()) | 3707 while (root->parent()) |
3690 root = root->parent(); | 3708 root = root->parent(); |
3691 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3709 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3692 } else { | 3710 } else { |
3693 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3711 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
3694 } | 3712 } |
3695 } | 3713 } |
3696 | 3714 |
3697 #endif | 3715 #endif |
OLD | NEW |