| 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 2645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2656 // Keep our layer hierarchy updated. Optimize for the common case where we d
on't have any children | 2656 // Keep our layer hierarchy updated. Optimize for the common case where we d
on't have any children |
| 2657 // and don't have a layer attached to ourselves. | 2657 // and don't have a layer attached to ourselves. |
| 2658 PaintLayer* layer = nullptr; | 2658 PaintLayer* layer = nullptr; |
| 2659 if (slowFirstChild() || hasLayer()) { | 2659 if (slowFirstChild() || hasLayer()) { |
| 2660 layer = parent()->enclosingLayer(); | 2660 layer = parent()->enclosingLayer(); |
| 2661 addLayers(layer); | 2661 addLayers(layer); |
| 2662 } | 2662 } |
| 2663 | 2663 |
| 2664 // If |this| is visible but this object was not, tell the layer it has some
visible content | 2664 // If |this| is visible but this object was not, tell the layer it has some
visible content |
| 2665 // that needs to be drawn and layer visibility optimization can't be used | 2665 // that needs to be drawn and layer visibility optimization can't be used |
| 2666 if (parent()->style()->visibility() != VISIBLE && style()->visibility() == V
ISIBLE && !hasLayer()) { | 2666 if (parent()->style()->visibility() != EVisibility::Visible && style()->visi
bility() == EVisibility::Visible && !hasLayer()) { |
| 2667 if (!layer) | 2667 if (!layer) |
| 2668 layer = parent()->enclosingLayer(); | 2668 layer = parent()->enclosingLayer(); |
| 2669 if (layer) | 2669 if (layer) |
| 2670 layer->dirtyVisibleContentStatus(); | 2670 layer->dirtyVisibleContentStatus(); |
| 2671 } | 2671 } |
| 2672 | 2672 |
| 2673 if (parent()->childrenInline()) | 2673 if (parent()->childrenInline()) |
| 2674 parent()->dirtyLinesFromChangedChild(this); | 2674 parent()->dirtyLinesFromChangedChild(this); |
| 2675 | 2675 |
| 2676 if (LayoutFlowThread* flowThread = flowThreadContainingBlock()) | 2676 if (LayoutFlowThread* flowThread = flowThreadContainingBlock()) |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2713 } | 2713 } |
| 2714 return found; | 2714 return found; |
| 2715 } | 2715 } |
| 2716 | 2716 |
| 2717 void LayoutObject::willBeRemovedFromTree() | 2717 void LayoutObject::willBeRemovedFromTree() |
| 2718 { | 2718 { |
| 2719 // FIXME: We should ASSERT(isRooted()) but we have some out-of-order removal
s which would need to be fixed first. | 2719 // FIXME: We should ASSERT(isRooted()) but we have some out-of-order removal
s which would need to be fixed first. |
| 2720 | 2720 |
| 2721 // If we remove a visible child from an invisible parent, we don't know the
layer visibility any more. | 2721 // If we remove a visible child from an invisible parent, we don't know the
layer visibility any more. |
| 2722 PaintLayer* layer = nullptr; | 2722 PaintLayer* layer = nullptr; |
| 2723 if (parent()->style()->visibility() != VISIBLE && style()->visibility() == V
ISIBLE && !hasLayer()) { | 2723 if (parent()->style()->visibility() != EVisibility::Visible && style()->visi
bility() == EVisibility::Visible && !hasLayer()) { |
| 2724 layer = parent()->enclosingLayer(); | 2724 layer = parent()->enclosingLayer(); |
| 2725 if (layer) | 2725 if (layer) |
| 2726 layer->dirtyVisibleContentStatus(); | 2726 layer->dirtyVisibleContentStatus(); |
| 2727 } | 2727 } |
| 2728 | 2728 |
| 2729 // Keep our layer hierarchy updated. | 2729 // Keep our layer hierarchy updated. |
| 2730 if (slowFirstChild() || hasLayer()) { | 2730 if (slowFirstChild() || hasLayer()) { |
| 2731 if (!layer) | 2731 if (!layer) |
| 2732 layer = parent()->enclosingLayer(); | 2732 layer = parent()->enclosingLayer(); |
| 2733 removeLayers(layer); | 2733 removeLayers(layer); |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3106 if (decorations & TextDecorationLineThrough) { | 3106 if (decorations & TextDecorationLineThrough) { |
| 3107 linethrough.color = resultColor; | 3107 linethrough.color = resultColor; |
| 3108 linethrough.style = resultStyle; | 3108 linethrough.style = resultStyle; |
| 3109 } | 3109 } |
| 3110 } | 3110 } |
| 3111 } | 3111 } |
| 3112 | 3112 |
| 3113 void LayoutObject::addAnnotatedRegions(Vector<AnnotatedRegionValue>& regions) | 3113 void LayoutObject::addAnnotatedRegions(Vector<AnnotatedRegionValue>& regions) |
| 3114 { | 3114 { |
| 3115 // Convert the style regions to absolute coordinates. | 3115 // Convert the style regions to absolute coordinates. |
| 3116 if (style()->visibility() != VISIBLE || !isBox()) | 3116 if (style()->visibility() != EVisibility::Visible || !isBox()) |
| 3117 return; | 3117 return; |
| 3118 | 3118 |
| 3119 if (style()->getDraggableRegionMode() == DraggableRegionNone) | 3119 if (style()->getDraggableRegionMode() == DraggableRegionNone) |
| 3120 return; | 3120 return; |
| 3121 | 3121 |
| 3122 LayoutBox* box = toLayoutBox(this); | 3122 LayoutBox* box = toLayoutBox(this); |
| 3123 FloatRect localBounds(FloatPoint(), FloatSize(box->size())); | 3123 FloatRect localBounds(FloatPoint(), FloatSize(box->size())); |
| 3124 FloatRect absBounds = localToAbsoluteQuad(localBounds).boundingBox(); | 3124 FloatRect absBounds = localToAbsoluteQuad(localBounds).boundingBox(); |
| 3125 | 3125 |
| 3126 AnnotatedRegionValue region; | 3126 AnnotatedRegionValue region; |
| 3127 region.draggable = style()->getDraggableRegionMode() == DraggableRegionDrag; | 3127 region.draggable = style()->getDraggableRegionMode() == DraggableRegionDrag; |
| 3128 region.bounds = LayoutRect(absBounds); | 3128 region.bounds = LayoutRect(absBounds); |
| 3129 regions.append(region); | 3129 regions.append(region); |
| 3130 } | 3130 } |
| 3131 | 3131 |
| 3132 bool LayoutObject::willRenderImage() | 3132 bool LayoutObject::willRenderImage() |
| 3133 { | 3133 { |
| 3134 // Without visibility we won't render (and therefore don't care about animat
ion). | 3134 // Without visibility we won't render (and therefore don't care about animat
ion). |
| 3135 if (style()->visibility() != VISIBLE) | 3135 if (style()->visibility() != EVisibility::Visible) |
| 3136 return false; | 3136 return false; |
| 3137 | 3137 |
| 3138 // We will not render a new image when Active DOM is suspended | 3138 // We will not render a new image when Active DOM is suspended |
| 3139 if (document().activeDOMObjectsAreSuspended()) | 3139 if (document().activeDOMObjectsAreSuspended()) |
| 3140 return false; | 3140 return false; |
| 3141 | 3141 |
| 3142 // If we're not in a window (i.e., we're dormant from being in a background
tab) | 3142 // If we're not in a window (i.e., we're dormant from being in a background
tab) |
| 3143 // then we don't want to render either. | 3143 // then we don't want to render either. |
| 3144 return document().view()->isVisible(); | 3144 return document().view()->isVisible(); |
| 3145 } | 3145 } |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3650 const blink::LayoutObject* root = object1; | 3650 const blink::LayoutObject* root = object1; |
| 3651 while (root->parent()) | 3651 while (root->parent()) |
| 3652 root = root->parent(); | 3652 root = root->parent(); |
| 3653 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3653 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3654 } else { | 3654 } else { |
| 3655 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3655 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
| 3656 } | 3656 } |
| 3657 } | 3657 } |
| 3658 | 3658 |
| 3659 #endif | 3659 #endif |
| OLD | NEW |