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 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 if (backgroundIsKnownToBeObscured()) | 1164 if (backgroundIsKnownToBeObscured()) |
1165 return; | 1165 return; |
1166 paintFillLayers(paintInfo, resolveColor(CSSPropertyBackgroundColor), style()
->backgroundLayers(), paintRect, bleedAvoidance); | 1166 paintFillLayers(paintInfo, resolveColor(CSSPropertyBackgroundColor), style()
->backgroundLayers(), paintRect, bleedAvoidance); |
1167 } | 1167 } |
1168 | 1168 |
1169 LayoutRect RenderBox::backgroundPaintedExtent() const | 1169 LayoutRect RenderBox::backgroundPaintedExtent() const |
1170 { | 1170 { |
1171 ASSERT(hasBackground()); | 1171 ASSERT(hasBackground()); |
1172 LayoutRect backgroundRect = pixelSnappedIntRect(borderBoxRect()); | 1172 LayoutRect backgroundRect = pixelSnappedIntRect(borderBoxRect()); |
1173 | 1173 |
1174 Color backgroundColor = resolveColor(CSSPropertyBackgroundColor); | 1174 StyleColor backgroundColor = resolveStyleColor(CSSPropertyBackgroundColor); |
1175 if (backgroundColor.isValid() && backgroundColor.alpha()) | 1175 if (backgroundColor.isValid() && backgroundColor.alpha()) |
1176 return backgroundRect; | 1176 return backgroundRect; |
1177 if (!style()->backgroundLayers()->image() || style()->backgroundLayers()->ne
xt()) | 1177 if (!style()->backgroundLayers()->image() || style()->backgroundLayers()->ne
xt()) |
1178 return backgroundRect; | 1178 return backgroundRect; |
1179 BackgroundImageGeometry geometry; | 1179 BackgroundImageGeometry geometry; |
1180 const_cast<RenderBox*>(this)->calculateBackgroundImageGeometry(style()->back
groundLayers(), backgroundRect, geometry); | 1180 const_cast<RenderBox*>(this)->calculateBackgroundImageGeometry(style()->back
groundLayers(), backgroundRect, geometry); |
1181 return geometry.destRect(); | 1181 return geometry.destRect(); |
1182 } | 1182 } |
1183 | 1183 |
1184 bool RenderBox::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) c
onst | 1184 bool RenderBox::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) c
onst |
1185 { | 1185 { |
1186 if (isBody() && skipBodyBackground(this)) | 1186 if (isBody() && skipBodyBackground(this)) |
1187 return false; | 1187 return false; |
1188 | 1188 |
1189 Color backgroundColor = resolveColor(CSSPropertyBackgroundColor); | 1189 StyleColor backgroundColor = resolveStyleColor(CSSPropertyBackgroundColor); |
1190 if (!backgroundColor.isValid() || backgroundColor.hasAlpha()) | 1190 if (!backgroundColor.isValid() || backgroundColor.hasAlpha()) |
1191 return false; | 1191 return false; |
1192 | 1192 |
1193 // If the element has appearance, it might be painted by theme. | 1193 // If the element has appearance, it might be painted by theme. |
1194 // We cannot be sure if theme paints the background opaque. | 1194 // We cannot be sure if theme paints the background opaque. |
1195 // In this case it is safe to not assume opaqueness. | 1195 // In this case it is safe to not assume opaqueness. |
1196 // FIXME: May be ask theme if it paints opaque. | 1196 // FIXME: May be ask theme if it paints opaque. |
1197 if (style()->hasAppearance()) | 1197 if (style()->hasAppearance()) |
1198 return false; | 1198 return false; |
1199 // FIXME: Check the opaqueness of background images. | 1199 // FIXME: Check the opaqueness of background images. |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1297 | 1297 |
1298 // Clipped with local scrolling | 1298 // Clipped with local scrolling |
1299 if (hasOverflowClip() && fillLayer->attachment() == LocalBackgroundAttachmen
t) | 1299 if (hasOverflowClip() && fillLayer->attachment() == LocalBackgroundAttachmen
t) |
1300 return false; | 1300 return false; |
1301 | 1301 |
1302 if (fillLayer->hasOpaqueImage(this) && fillLayer->hasRepeatXY() && fillLayer
->image()->canRender(this, style()->effectiveZoom())) | 1302 if (fillLayer->hasOpaqueImage(this) && fillLayer->hasRepeatXY() && fillLayer
->image()->canRender(this, style()->effectiveZoom())) |
1303 return true; | 1303 return true; |
1304 | 1304 |
1305 // If there is only one layer and no image, check whether the background col
or is opaque | 1305 // If there is only one layer and no image, check whether the background col
or is opaque |
1306 if (!fillLayer->next() && !fillLayer->hasImage()) { | 1306 if (!fillLayer->next() && !fillLayer->hasImage()) { |
1307 Color bgColor = resolveColor(CSSPropertyBackgroundColor); | 1307 StyleColor bgColor = resolveStyleColor(CSSPropertyBackgroundColor); |
1308 if (bgColor.isValid() && bgColor.alpha() == 255) | 1308 if (bgColor.isValid() && bgColor.alpha() == 255) |
1309 return true; | 1309 return true; |
1310 } | 1310 } |
1311 | 1311 |
1312 return false; | 1312 return false; |
1313 } | 1313 } |
1314 | 1314 |
1315 void RenderBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset) | 1315 void RenderBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
1316 { | 1316 { |
1317 if (!paintInfo.shouldPaintWithinRoot(this) || style()->visibility() != VISIB
LE || paintInfo.phase != PaintPhaseMask || paintInfo.context->paintingDisabled()
) | 1317 if (!paintInfo.shouldPaintWithinRoot(this) || style()->visibility() != VISIB
LE || paintInfo.phase != PaintPhaseMask || paintInfo.context->paintingDisabled()
) |
(...skipping 3323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4641 } | 4641 } |
4642 | 4642 |
4643 if (didSplitParentAnonymousBoxes) | 4643 if (didSplitParentAnonymousBoxes) |
4644 markBoxForRelayoutAfterSplit(this); | 4644 markBoxForRelayoutAfterSplit(this); |
4645 | 4645 |
4646 ASSERT(beforeChild->parent() == this); | 4646 ASSERT(beforeChild->parent() == this); |
4647 return beforeChild; | 4647 return beforeChild; |
4648 } | 4648 } |
4649 | 4649 |
4650 } // namespace WebCore | 4650 } // namespace WebCore |
OLD | NEW |