| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 setIsBox(); | 75 setIsBox(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void RenderBox::willBeDestroyed() | 78 void RenderBox::willBeDestroyed() |
| 79 { | 79 { |
| 80 clearOverrideSize(); | 80 clearOverrideSize(); |
| 81 clearContainingBlockOverrideSize(); | 81 clearContainingBlockOverrideSize(); |
| 82 | 82 |
| 83 RenderBlock::removePercentHeightDescendantIfNeeded(this); | 83 RenderBlock::removePercentHeightDescendantIfNeeded(this); |
| 84 | 84 |
| 85 ShapeOutsideInfo::removeInfo(*this); | |
| 86 | |
| 87 RenderBoxModelObject::willBeDestroyed(); | 85 RenderBoxModelObject::willBeDestroyed(); |
| 88 } | 86 } |
| 89 | 87 |
| 90 void RenderBox::removeFloatingOrPositionedChildFromBlockLists() | 88 void RenderBox::removeFloatingOrPositionedChildFromBlockLists() |
| 91 { | 89 { |
| 92 ASSERT(isFloatingOrOutOfFlowPositioned()); | 90 ASSERT(isFloatingOrOutOfFlowPositioned()); |
| 93 | 91 |
| 94 if (documentBeingDestroyed()) | 92 if (documentBeingDestroyed()) |
| 95 return; | 93 return; |
| 96 | 94 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 } | 144 } |
| 147 | 145 |
| 148 // Our opaqueness might have changed without triggering layout. | 146 // Our opaqueness might have changed without triggering layout. |
| 149 if (diff.needsPaintInvalidation()) { | 147 if (diff.needsPaintInvalidation()) { |
| 150 RenderObject* parentToInvalidate = parent(); | 148 RenderObject* parentToInvalidate = parent(); |
| 151 for (unsigned i = 0; i < backgroundObscurationTestMaxDepth && parentToIn
validate; ++i) { | 149 for (unsigned i = 0; i < backgroundObscurationTestMaxDepth && parentToIn
validate; ++i) { |
| 152 parentToInvalidate->invalidateBackgroundObscurationStatus(); | 150 parentToInvalidate->invalidateBackgroundObscurationStatus(); |
| 153 parentToInvalidate = parentToInvalidate->parent(); | 151 parentToInvalidate = parentToInvalidate->parent(); |
| 154 } | 152 } |
| 155 } | 153 } |
| 156 | |
| 157 updateShapeOutsideInfoAfterStyleChange(*style(), oldStyle); | |
| 158 } | |
| 159 | |
| 160 void RenderBox::updateShapeOutsideInfoAfterStyleChange(const RenderStyle& style,
const RenderStyle* oldStyle) | |
| 161 { | |
| 162 const ShapeValue* shapeOutside = style.shapeOutside(); | |
| 163 const ShapeValue* oldShapeOutside = oldStyle ? oldStyle->shapeOutside() : Re
nderStyle::initialShapeOutside(); | |
| 164 | |
| 165 Length shapeMargin = style.shapeMargin(); | |
| 166 Length oldShapeMargin = oldStyle ? oldStyle->shapeMargin() : RenderStyle::in
itialShapeMargin(); | |
| 167 | |
| 168 float shapeImageThreshold = style.shapeImageThreshold(); | |
| 169 float oldShapeImageThreshold = oldStyle ? oldStyle->shapeImageThreshold() :
RenderStyle::initialShapeImageThreshold(); | |
| 170 | |
| 171 // FIXME: A future optimization would do a deep comparison for equality. (bu
g 100811) | |
| 172 if (shapeOutside == oldShapeOutside && shapeMargin == oldShapeMargin && shap
eImageThreshold == oldShapeImageThreshold) | |
| 173 return; | |
| 174 | |
| 175 if (!shapeOutside) | |
| 176 ShapeOutsideInfo::removeInfo(*this); | |
| 177 else | |
| 178 ShapeOutsideInfo::ensureInfo(*this).markShapeAsDirty(); | |
| 179 } | 154 } |
| 180 | 155 |
| 181 void RenderBox::updateFromStyle() | 156 void RenderBox::updateFromStyle() |
| 182 { | 157 { |
| 183 RenderBoxModelObject::updateFromStyle(); | 158 RenderBoxModelObject::updateFromStyle(); |
| 184 | 159 |
| 185 RenderStyle* styleToUse = style(); | 160 RenderStyle* styleToUse = style(); |
| 186 bool isRootObject = isDocumentElement(); | 161 bool isRootObject = isDocumentElement(); |
| 187 bool isViewObject = isRenderView(); | 162 bool isViewObject = isRenderView(); |
| 188 | 163 |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 973 break; | 948 break; |
| 974 } | 949 } |
| 975 return backgroundRect.contains(localRect); | 950 return backgroundRect.contains(localRect); |
| 976 } | 951 } |
| 977 | 952 |
| 978 static bool isCandidateForOpaquenessTest(RenderBox* childBox) | 953 static bool isCandidateForOpaquenessTest(RenderBox* childBox) |
| 979 { | 954 { |
| 980 RenderStyle* childStyle = childBox->style(); | 955 RenderStyle* childStyle = childBox->style(); |
| 981 if (childStyle->position() != StaticPosition && childBox->containingBlock()
!= childBox->parent()) | 956 if (childStyle->position() != StaticPosition && childBox->containingBlock()
!= childBox->parent()) |
| 982 return false; | 957 return false; |
| 983 if (childStyle->shapeOutside()) | |
| 984 return false; | |
| 985 if (!childBox->width() || !childBox->height()) | 958 if (!childBox->width() || !childBox->height()) |
| 986 return false; | 959 return false; |
| 987 if (RenderLayer* childLayer = childBox->layer()) { | 960 if (RenderLayer* childLayer = childBox->layer()) { |
| 988 // FIXME: perhaps this could be less conservative? | 961 // FIXME: perhaps this could be less conservative? |
| 989 if (childLayer->compositingState() != NotComposited) | 962 if (childLayer->compositingState() != NotComposited) |
| 990 return false; | 963 return false; |
| 991 // FIXME: Deal with z-index. | 964 // FIXME: Deal with z-index. |
| 992 if (!childStyle->hasAutoZIndex()) | 965 if (!childStyle->hasAutoZIndex()) |
| 993 return false; | 966 return false; |
| 994 if (childLayer->hasTransform() || childLayer->isTransparent() || childLa
yer->hasFilter()) | 967 if (childLayer->hasTransform() || childLayer->isTransparent() || childLa
yer->hasFilter()) |
| (...skipping 2884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3879 | 3852 |
| 3880 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) | 3853 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) |
| 3881 { | 3854 { |
| 3882 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); | 3855 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); |
| 3883 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); | 3856 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); |
| 3884 ASSERT(hasBackground == style.hasBackground()); | 3857 ASSERT(hasBackground == style.hasBackground()); |
| 3885 hasBorder = style.hasBorder(); | 3858 hasBorder = style.hasBorder(); |
| 3886 } | 3859 } |
| 3887 | 3860 |
| 3888 } // namespace blink | 3861 } // namespace blink |
| OLD | NEW |