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