| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 RenderBlock::removePercentHeightDescendantIfNeeded(this); | 123 RenderBlock::removePercentHeightDescendantIfNeeded(this); |
| 124 | 124 |
| 125 // Normally we can do optimized positioning layout for absolute/fixed po
sitioned objects. There is one special case, however, which is | 125 // Normally we can do optimized positioning layout for absolute/fixed po
sitioned objects. There is one special case, however, which is |
| 126 // when the positioned object's margin-before is changed. In this case t
he parent has to get a layout in order to run margin collapsing | 126 // when the positioned object's margin-before is changed. In this case t
he parent has to get a layout in order to run margin collapsing |
| 127 // to determine the new static position. | 127 // to determine the new static position. |
| 128 if (isOutOfFlowPositioned() && newStyle->hasStaticBlockPosition() && old
Style->marginBefore() != newStyle->marginBefore() | 128 if (isOutOfFlowPositioned() && newStyle->hasStaticBlockPosition() && old
Style->marginBefore() != newStyle->marginBefore() |
| 129 && parent() && !parent()->normalChildNeedsLayout()) | 129 && parent() && !parent()->normalChildNeedsLayout()) |
| 130 parent()->setChildNeedsLayout(); | 130 parent()->setChildNeedsLayout(); |
| 131 } | 131 } |
| 132 | 132 |
| 133 // If our zoom factor changes and we have a defined scrollLeft/Top, we need
to adjust that value into the | |
| 134 // new zoomed coordinate space. | |
| 135 if (hasOverflowClip() && oldStyle && newStyle && oldStyle->effectiveZoom() !
= newStyle->effectiveZoom() && layer()) { | |
| 136 if (int left = layer()->scrollableArea()->scrollXOffset()) { | |
| 137 left = (left / oldStyle->effectiveZoom()) * newStyle->effectiveZoom(
); | |
| 138 layer()->scrollableArea()->scrollToXOffset(left); | |
| 139 } | |
| 140 if (int top = layer()->scrollableArea()->scrollYOffset()) { | |
| 141 top = (top / oldStyle->effectiveZoom()) * newStyle->effectiveZoom(); | |
| 142 layer()->scrollableArea()->scrollToYOffset(top); | |
| 143 } | |
| 144 } | |
| 145 | |
| 146 // Our opaqueness might have changed without triggering layout. | 133 // Our opaqueness might have changed without triggering layout. |
| 147 if (diff.needsPaintInvalidation()) { | 134 if (diff.needsPaintInvalidation()) { |
| 148 RenderObject* parentToInvalidate = parent(); | 135 RenderObject* parentToInvalidate = parent(); |
| 149 for (unsigned i = 0; i < backgroundObscurationTestMaxDepth && parentToIn
validate; ++i) { | 136 for (unsigned i = 0; i < backgroundObscurationTestMaxDepth && parentToIn
validate; ++i) { |
| 150 parentToInvalidate->invalidateBackgroundObscurationStatus(); | 137 parentToInvalidate->invalidateBackgroundObscurationStatus(); |
| 151 parentToInvalidate = parentToInvalidate->parent(); | 138 parentToInvalidate = parentToInvalidate->parent(); |
| 152 } | 139 } |
| 153 } | 140 } |
| 154 } | 141 } |
| 155 | 142 |
| (...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 969 bool RenderBox::backgroundHasOpaqueTopLayer() const | 956 bool RenderBox::backgroundHasOpaqueTopLayer() const |
| 970 { | 957 { |
| 971 const FillLayer& fillLayer = style()->backgroundLayers(); | 958 const FillLayer& fillLayer = style()->backgroundLayers(); |
| 972 if (fillLayer.clip() != BorderFillBox) | 959 if (fillLayer.clip() != BorderFillBox) |
| 973 return false; | 960 return false; |
| 974 | 961 |
| 975 // Clipped with local scrolling | 962 // Clipped with local scrolling |
| 976 if (hasOverflowClip() && fillLayer.attachment() == LocalBackgroundAttachment
) | 963 if (hasOverflowClip() && fillLayer.attachment() == LocalBackgroundAttachment
) |
| 977 return false; | 964 return false; |
| 978 | 965 |
| 979 if (fillLayer.hasOpaqueImage(this) && fillLayer.hasRepeatXY() && fillLayer.i
mage()->canRender(*this, style()->effectiveZoom())) | 966 if (fillLayer.hasOpaqueImage(this) && fillLayer.hasRepeatXY() && fillLayer.i
mage()->canRender(*this)) |
| 980 return true; | 967 return true; |
| 981 | 968 |
| 982 // If there is only one layer and no image, check whether the background col
or is opaque | 969 // If there is only one layer and no image, check whether the background col
or is opaque |
| 983 if (!fillLayer.next() && !fillLayer.hasImage()) { | 970 if (!fillLayer.next() && !fillLayer.hasImage()) { |
| 984 Color bgColor = resolveColor(CSSPropertyBackgroundColor); | 971 Color bgColor = resolveColor(CSSPropertyBackgroundColor); |
| 985 if (bgColor.alpha() == 255) | 972 if (bgColor.alpha() == 255) |
| 986 return true; | 973 return true; |
| 987 } | 974 } |
| 988 | 975 |
| 989 return false; | 976 return false; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1063 // on layers with no repeat by testing whether the image covers the layo
ut rect. | 1050 // on layers with no repeat by testing whether the image covers the layo
ut rect. |
| 1064 // Testing that here would imply duplicating a lot of calculations that
are currently done in | 1051 // Testing that here would imply duplicating a lot of calculations that
are currently done in |
| 1065 // RenderBoxModelObject::paintFillLayerExtended. A more efficient soluti
on might be to move | 1052 // RenderBoxModelObject::paintFillLayerExtended. A more efficient soluti
on might be to move |
| 1066 // the layer recursion into paintFillLayerExtended, or to compute the la
yer geometry here | 1053 // the layer recursion into paintFillLayerExtended, or to compute the la
yer geometry here |
| 1067 // and pass it down. | 1054 // and pass it down. |
| 1068 | 1055 |
| 1069 if (!shouldDrawBackgroundInSeparateBuffer && curLayer->blendMode() != We
bBlendModeNormal) | 1056 if (!shouldDrawBackgroundInSeparateBuffer && curLayer->blendMode() != We
bBlendModeNormal) |
| 1070 shouldDrawBackgroundInSeparateBuffer = true; | 1057 shouldDrawBackgroundInSeparateBuffer = true; |
| 1071 | 1058 |
| 1072 // The clipOccludesNextLayers condition must be evaluated first to avoid
short-circuiting. | 1059 // The clipOccludesNextLayers condition must be evaluated first to avoid
short-circuiting. |
| 1073 if (curLayer->clipOccludesNextLayers(curLayer == &fillLayer) && curLayer
->hasOpaqueImage(this) && curLayer->image()->canRender(*this, style()->effective
Zoom()) && curLayer->hasRepeatXY() && curLayer->blendMode() == WebBlendModeNorma
l && !boxShadowShouldBeAppliedToBackground(bleedAvoidance)) | 1060 if (curLayer->clipOccludesNextLayers(curLayer == &fillLayer) && curLayer
->hasOpaqueImage(this) && curLayer->image()->canRender(*this) && curLayer->hasRe
peatXY() && curLayer->blendMode() == WebBlendModeNormal && !boxShadowShouldBeApp
liedToBackground(bleedAvoidance)) |
| 1074 break; | 1061 break; |
| 1075 curLayer = curLayer->next(); | 1062 curLayer = curLayer->next(); |
| 1076 } | 1063 } |
| 1077 | 1064 |
| 1078 if (layers.size() > 0 && (**layers.rbegin()).next()) | 1065 if (layers.size() > 0 && (**layers.rbegin()).next()) |
| 1079 isBottomLayerOccluded = true; | 1066 isBottomLayerOccluded = true; |
| 1080 | 1067 |
| 1081 GraphicsContext* context = paintInfo.context; | 1068 GraphicsContext* context = paintInfo.context; |
| 1082 if (!context) | 1069 if (!context) |
| 1083 shouldDrawBackgroundInSeparateBuffer = false; | 1070 shouldDrawBackgroundInSeparateBuffer = false; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1128 | 1115 |
| 1129 bool RenderBox::paintInvalidationLayerRectsForImage(WrappedImagePtr image, const
FillLayer& layers, bool drawingBackground) | 1116 bool RenderBox::paintInvalidationLayerRectsForImage(WrappedImagePtr image, const
FillLayer& layers, bool drawingBackground) |
| 1130 { | 1117 { |
| 1131 RenderBox* layerRenderer = 0; | 1118 RenderBox* layerRenderer = 0; |
| 1132 if (drawingBackground && isDocumentElement()) | 1119 if (drawingBackground && isDocumentElement()) |
| 1133 layerRenderer = view(); | 1120 layerRenderer = view(); |
| 1134 else | 1121 else |
| 1135 layerRenderer = this; | 1122 layerRenderer = this; |
| 1136 | 1123 |
| 1137 for (const FillLayer* curLayer = &layers; curLayer; curLayer = curLayer->nex
t()) { | 1124 for (const FillLayer* curLayer = &layers; curLayer; curLayer = curLayer->nex
t()) { |
| 1138 if (curLayer->image() && image == curLayer->image()->data() && curLayer-
>image()->canRender(*this, style()->effectiveZoom())) { | 1125 if (curLayer->image() && image == curLayer->image()->data() && curLayer-
>image()->canRender(*this)) { |
| 1139 layerRenderer->setShouldDoFullPaintInvalidation(true); | 1126 layerRenderer->setShouldDoFullPaintInvalidation(true); |
| 1140 return true; | 1127 return true; |
| 1141 } | 1128 } |
| 1142 } | 1129 } |
| 1143 return false; | 1130 return false; |
| 1144 } | 1131 } |
| 1145 | 1132 |
| 1146 InvalidationReason RenderBox::invalidatePaintIfNeeded(const PaintInvalidationSta
te& paintInvalidationState, const RenderLayerModelObject& newPaintInvalidationCo
ntainer) | 1133 InvalidationReason RenderBox::invalidatePaintIfNeeded(const PaintInvalidationSta
te& paintInvalidationState, const RenderLayerModelObject& newPaintInvalidationCo
ntainer) |
| 1147 { | 1134 { |
| 1148 const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect(); | 1135 const LayoutRect oldPaintInvalidationRect = previousPaintInvalidationRect(); |
| (...skipping 2594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3743 | 3730 |
| 3744 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) | 3731 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) |
| 3745 { | 3732 { |
| 3746 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); | 3733 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); |
| 3747 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); | 3734 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); |
| 3748 ASSERT(hasBackground == style.hasBackground()); | 3735 ASSERT(hasBackground == style.hasBackground()); |
| 3749 hasBorder = style.hasBorder(); | 3736 hasBorder = style.hasBorder(); |
| 3750 } | 3737 } |
| 3751 | 3738 |
| 3752 } // namespace blink | 3739 } // namespace blink |
| OLD | NEW |