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 2672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2683 // Keep our layer hierarchy updated. Optimize for the common case where we d
on't have any children | 2683 // Keep our layer hierarchy updated. Optimize for the common case where we d
on't have any children |
2684 // and don't have a layer attached to ourselves. | 2684 // and don't have a layer attached to ourselves. |
2685 PaintLayer* layer = nullptr; | 2685 PaintLayer* layer = nullptr; |
2686 if (slowFirstChild() || hasLayer()) { | 2686 if (slowFirstChild() || hasLayer()) { |
2687 layer = parent()->enclosingLayer(); | 2687 layer = parent()->enclosingLayer(); |
2688 addLayers(layer); | 2688 addLayers(layer); |
2689 } | 2689 } |
2690 | 2690 |
2691 // If |this| is visible but this object was not, tell the layer it has some
visible content | 2691 // If |this| is visible but this object was not, tell the layer it has some
visible content |
2692 // that needs to be drawn and layer visibility optimization can't be used | 2692 // that needs to be drawn and layer visibility optimization can't be used |
2693 if (parent()->style()->visibility() != VISIBLE && style()->visibility() == V
ISIBLE && !hasLayer()) { | 2693 if (parent()->style()->visibility() != EVisibility::Visible && style()->visi
bility() == EVisibility::Visible && !hasLayer()) { |
2694 if (!layer) | 2694 if (!layer) |
2695 layer = parent()->enclosingLayer(); | 2695 layer = parent()->enclosingLayer(); |
2696 if (layer) | 2696 if (layer) |
2697 layer->dirtyVisibleContentStatus(); | 2697 layer->dirtyVisibleContentStatus(); |
2698 } | 2698 } |
2699 | 2699 |
2700 if (parent()->childrenInline()) | 2700 if (parent()->childrenInline()) |
2701 parent()->dirtyLinesFromChangedChild(this); | 2701 parent()->dirtyLinesFromChangedChild(this); |
2702 | 2702 |
2703 if (LayoutFlowThread* flowThread = flowThreadContainingBlock()) | 2703 if (LayoutFlowThread* flowThread = flowThreadContainingBlock()) |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2740 } | 2740 } |
2741 return found; | 2741 return found; |
2742 } | 2742 } |
2743 | 2743 |
2744 void LayoutObject::willBeRemovedFromTree() | 2744 void LayoutObject::willBeRemovedFromTree() |
2745 { | 2745 { |
2746 // FIXME: We should ASSERT(isRooted()) but we have some out-of-order removal
s which would need to be fixed first. | 2746 // FIXME: We should ASSERT(isRooted()) but we have some out-of-order removal
s which would need to be fixed first. |
2747 | 2747 |
2748 // If we remove a visible child from an invisible parent, we don't know the
layer visibility any more. | 2748 // If we remove a visible child from an invisible parent, we don't know the
layer visibility any more. |
2749 PaintLayer* layer = nullptr; | 2749 PaintLayer* layer = nullptr; |
2750 if (parent()->style()->visibility() != VISIBLE && style()->visibility() == V
ISIBLE && !hasLayer()) { | 2750 if (parent()->style()->visibility() != EVisibility::Visible && style()->visi
bility() == EVisibility::Visible && !hasLayer()) { |
2751 layer = parent()->enclosingLayer(); | 2751 layer = parent()->enclosingLayer(); |
2752 if (layer) | 2752 if (layer) |
2753 layer->dirtyVisibleContentStatus(); | 2753 layer->dirtyVisibleContentStatus(); |
2754 } | 2754 } |
2755 | 2755 |
2756 // Keep our layer hierarchy updated. | 2756 // Keep our layer hierarchy updated. |
2757 if (slowFirstChild() || hasLayer()) { | 2757 if (slowFirstChild() || hasLayer()) { |
2758 if (!layer) | 2758 if (!layer) |
2759 layer = parent()->enclosingLayer(); | 2759 layer = parent()->enclosingLayer(); |
2760 removeLayers(layer); | 2760 removeLayers(layer); |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3133 if (decorations & TextDecorationLineThrough) { | 3133 if (decorations & TextDecorationLineThrough) { |
3134 linethrough.color = resultColor; | 3134 linethrough.color = resultColor; |
3135 linethrough.style = resultStyle; | 3135 linethrough.style = resultStyle; |
3136 } | 3136 } |
3137 } | 3137 } |
3138 } | 3138 } |
3139 | 3139 |
3140 void LayoutObject::addAnnotatedRegions(Vector<AnnotatedRegionValue>& regions) | 3140 void LayoutObject::addAnnotatedRegions(Vector<AnnotatedRegionValue>& regions) |
3141 { | 3141 { |
3142 // Convert the style regions to absolute coordinates. | 3142 // Convert the style regions to absolute coordinates. |
3143 if (style()->visibility() != VISIBLE || !isBox()) | 3143 if (style()->visibility() != EVisibility::Visible || !isBox()) |
3144 return; | 3144 return; |
3145 | 3145 |
3146 if (style()->getDraggableRegionMode() == DraggableRegionNone) | 3146 if (style()->getDraggableRegionMode() == DraggableRegionNone) |
3147 return; | 3147 return; |
3148 | 3148 |
3149 LayoutBox* box = toLayoutBox(this); | 3149 LayoutBox* box = toLayoutBox(this); |
3150 FloatRect localBounds(FloatPoint(), FloatSize(box->size())); | 3150 FloatRect localBounds(FloatPoint(), FloatSize(box->size())); |
3151 FloatRect absBounds = localToAbsoluteQuad(localBounds).boundingBox(); | 3151 FloatRect absBounds = localToAbsoluteQuad(localBounds).boundingBox(); |
3152 | 3152 |
3153 AnnotatedRegionValue region; | 3153 AnnotatedRegionValue region; |
3154 region.draggable = style()->getDraggableRegionMode() == DraggableRegionDrag; | 3154 region.draggable = style()->getDraggableRegionMode() == DraggableRegionDrag; |
3155 region.bounds = LayoutRect(absBounds); | 3155 region.bounds = LayoutRect(absBounds); |
3156 regions.append(region); | 3156 regions.append(region); |
3157 } | 3157 } |
3158 | 3158 |
3159 bool LayoutObject::willRenderImage() | 3159 bool LayoutObject::willRenderImage() |
3160 { | 3160 { |
3161 // Without visibility we won't render (and therefore don't care about animat
ion). | 3161 // Without visibility we won't render (and therefore don't care about animat
ion). |
3162 if (style()->visibility() != VISIBLE) | 3162 if (style()->visibility() != EVisibility::Visible) |
3163 return false; | 3163 return false; |
3164 | 3164 |
3165 // We will not render a new image when Active DOM is suspended | 3165 // We will not render a new image when Active DOM is suspended |
3166 if (document().activeDOMObjectsAreSuspended()) | 3166 if (document().activeDOMObjectsAreSuspended()) |
3167 return false; | 3167 return false; |
3168 | 3168 |
3169 // If we're not in a window (i.e., we're dormant from being in a background
tab) | 3169 // If we're not in a window (i.e., we're dormant from being in a background
tab) |
3170 // then we don't want to render either. | 3170 // then we don't want to render either. |
3171 return document().view()->isVisible(); | 3171 return document().view()->isVisible(); |
3172 } | 3172 } |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3674 const blink::LayoutObject* root = object1; | 3674 const blink::LayoutObject* root = object1; |
3675 while (root->parent()) | 3675 while (root->parent()) |
3676 root = root->parent(); | 3676 root = root->parent(); |
3677 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3677 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3678 } else { | 3678 } else { |
3679 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3679 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
3680 } | 3680 } |
3681 } | 3681 } |
3682 | 3682 |
3683 #endif | 3683 #endif |
OLD | NEW |