| 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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
| 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } | 85 } |
| 86 | 86 |
| 87 void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle& newStyl
e) | 87 void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle& newStyl
e) |
| 88 { | 88 { |
| 89 RenderStyle* oldStyle = style(); | 89 RenderStyle* oldStyle = style(); |
| 90 if (oldStyle) { | 90 if (oldStyle) { |
| 91 // When a layout hint happens and an object's position style changes, we
have to do a layout | 91 // When a layout hint happens and an object's position style changes, we
have to do a layout |
| 92 // to dirty the render tree using the old position value now. | 92 // to dirty the render tree using the old position value now. |
| 93 if (diff.needsFullLayout() && parent() && oldStyle->position() != newSty
le.position()) { | 93 if (diff.needsFullLayout() && parent() && oldStyle->position() != newSty
le.position()) { |
| 94 markContainingBlocksForLayout(); | 94 markContainingBlocksForLayout(); |
| 95 if (oldStyle->position() == StaticPosition) | 95 if (newStyle.hasOutOfFlowPosition()) |
| 96 setShouldDoFullPaintInvalidation(true); | |
| 97 else if (newStyle.hasOutOfFlowPosition()) | |
| 98 parent()->setChildNeedsLayout(); | 96 parent()->setChildNeedsLayout(); |
| 99 } | 97 } |
| 100 } | 98 } |
| 101 | 99 |
| 102 RenderBoxModelObject::styleWillChange(diff, newStyle); | 100 RenderBoxModelObject::styleWillChange(diff, newStyle); |
| 103 } | 101 } |
| 104 | 102 |
| 105 void RenderBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle
) | 103 void RenderBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle
) |
| 106 { | 104 { |
| 107 RenderBoxModelObject::styleDidChange(diff, oldStyle); | 105 RenderBoxModelObject::styleDidChange(diff, oldStyle); |
| (...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 if (shouldDrawBackgroundInSeparateBuffer) | 945 if (shouldDrawBackgroundInSeparateBuffer) |
| 948 context->endLayer(); | 946 context->endLayer(); |
| 949 } | 947 } |
| 950 | 948 |
| 951 void RenderBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const
FillLayer& fillLayer, const LayoutRect& rect, | 949 void RenderBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const
FillLayer& fillLayer, const LayoutRect& rect, |
| 952 BackgroundBleedAvoidance bleedAvoidance, RenderObject* backgroundObject, boo
l skipBaseColor) | 950 BackgroundBleedAvoidance bleedAvoidance, RenderObject* backgroundObject, boo
l skipBaseColor) |
| 953 { | 951 { |
| 954 paintFillLayerExtended(paintInfo, c, fillLayer, rect, bleedAvoidance, 0, Lay
outSize(), backgroundObject, skipBaseColor); | 952 paintFillLayerExtended(paintInfo, c, fillLayer, rect, bleedAvoidance, 0, Lay
outSize(), backgroundObject, skipBaseColor); |
| 955 } | 953 } |
| 956 | 954 |
| 957 void RenderBox::imageChanged(WrappedImagePtr image, const IntRect*) | |
| 958 { | |
| 959 if (!parent()) | |
| 960 return; | |
| 961 | |
| 962 AllowPaintInvalidationScope scoper(frameView()); | |
| 963 | |
| 964 if ((style()->borderImage().image() && style()->borderImage().image()->data(
) == image) || | |
| 965 (style()->maskBoxImage().image() && style()->maskBoxImage().image()->dat
a() == image)) { | |
| 966 setShouldDoFullPaintInvalidation(true); | |
| 967 return; | |
| 968 } | |
| 969 | |
| 970 if (!paintInvalidationLayerRectsForImage(image, style()->backgroundLayers(),
true)) | |
| 971 paintInvalidationLayerRectsForImage(image, style()->maskLayers(), false)
; | |
| 972 } | |
| 973 | |
| 974 bool RenderBox::paintInvalidationLayerRectsForImage(WrappedImagePtr image, const
FillLayer& layers, bool drawingBackground) | |
| 975 { | |
| 976 RenderBox* layerRenderer = 0; | |
| 977 if (drawingBackground && isDocumentElement()) | |
| 978 layerRenderer = view(); | |
| 979 else | |
| 980 layerRenderer = this; | |
| 981 | |
| 982 for (const FillLayer* curLayer = &layers; curLayer; curLayer = curLayer->nex
t()) { | |
| 983 if (curLayer->image() && image == curLayer->image()->data() && curLayer-
>image()->canRender(*this)) { | |
| 984 layerRenderer->setShouldDoFullPaintInvalidation(true); | |
| 985 return true; | |
| 986 } | |
| 987 } | |
| 988 return false; | |
| 989 } | |
| 990 | |
| 991 bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumu
latedOffset, ContentsClipBehavior contentsClipBehavior) | 955 bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumu
latedOffset, ContentsClipBehavior contentsClipBehavior) |
| 992 { | 956 { |
| 993 if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == Paint
PhaseSelfOutline || paintInfo.phase == PaintPhaseMask) | 957 if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == Paint
PhaseSelfOutline || paintInfo.phase == PaintPhaseMask) |
| 994 return false; | 958 return false; |
| 995 | 959 |
| 996 bool isControlClip = hasControlClip(); | 960 bool isControlClip = hasControlClip(); |
| 997 bool isOverflowClip = hasOverflowClip() && !layer()->isSelfPaintingLayer(); | 961 bool isOverflowClip = hasOverflowClip() && !layer()->isSelfPaintingLayer(); |
| 998 | 962 |
| 999 if (!isControlClip && !isOverflowClip) | 963 if (!isControlClip && !isOverflowClip) |
| 1000 return false; | 964 return false; |
| (...skipping 2274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3275 | 3239 |
| 3276 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) | 3240 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) |
| 3277 { | 3241 { |
| 3278 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); | 3242 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); |
| 3279 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); | 3243 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); |
| 3280 ASSERT(hasBackground == style.hasBackground()); | 3244 ASSERT(hasBackground == style.hasBackground()); |
| 3281 hasBorder = style.hasBorder(); | 3245 hasBorder = style.hasBorder(); |
| 3282 } | 3246 } |
| 3283 | 3247 |
| 3284 } // namespace blink | 3248 } // namespace blink |
| OLD | NEW |