| 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 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1181 if (backgroundIsKnownToBeObscured()) | 1181 if (backgroundIsKnownToBeObscured()) |
| 1182 return; | 1182 return; |
| 1183 paintFillLayers(paintInfo, resolveColor(CSSPropertyBackgroundColor), style()
->backgroundLayers(), paintRect, bleedAvoidance); | 1183 paintFillLayers(paintInfo, resolveColor(CSSPropertyBackgroundColor), style()
->backgroundLayers(), paintRect, bleedAvoidance); |
| 1184 } | 1184 } |
| 1185 | 1185 |
| 1186 LayoutRect RenderBox::backgroundPaintedExtent() const | 1186 LayoutRect RenderBox::backgroundPaintedExtent() const |
| 1187 { | 1187 { |
| 1188 ASSERT(hasBackground()); | 1188 ASSERT(hasBackground()); |
| 1189 LayoutRect backgroundRect = pixelSnappedIntRect(borderBoxRect()); | 1189 LayoutRect backgroundRect = pixelSnappedIntRect(borderBoxRect()); |
| 1190 | 1190 |
| 1191 StyleColor backgroundColor = resolveStyleColor(CSSPropertyBackgroundColor); | 1191 Color backgroundColor = resolveColor(CSSPropertyBackgroundColor); |
| 1192 if (backgroundColor.isValid() && backgroundColor.alpha()) | 1192 if (backgroundColor.isValid() && backgroundColor.alpha()) |
| 1193 return backgroundRect; | 1193 return backgroundRect; |
| 1194 if (!style()->backgroundLayers()->image() || style()->backgroundLayers()->ne
xt()) | 1194 if (!style()->backgroundLayers()->image() || style()->backgroundLayers()->ne
xt()) |
| 1195 return backgroundRect; | 1195 return backgroundRect; |
| 1196 BackgroundImageGeometry geometry; | 1196 BackgroundImageGeometry geometry; |
| 1197 const_cast<RenderBox*>(this)->calculateBackgroundImageGeometry(style()->back
groundLayers(), backgroundRect, geometry); | 1197 const_cast<RenderBox*>(this)->calculateBackgroundImageGeometry(style()->back
groundLayers(), backgroundRect, geometry); |
| 1198 return geometry.destRect(); | 1198 return geometry.destRect(); |
| 1199 } | 1199 } |
| 1200 | 1200 |
| 1201 bool RenderBox::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) c
onst | 1201 bool RenderBox::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) c
onst |
| 1202 { | 1202 { |
| 1203 if (isBody() && skipBodyBackground(this)) | 1203 if (isBody() && skipBodyBackground(this)) |
| 1204 return false; | 1204 return false; |
| 1205 | 1205 |
| 1206 StyleColor backgroundColor = resolveStyleColor(CSSPropertyBackgroundColor); | 1206 Color backgroundColor = resolveColor(CSSPropertyBackgroundColor); |
| 1207 if (!backgroundColor.isValid() || backgroundColor.hasAlpha()) | 1207 if (!backgroundColor.isValid() || backgroundColor.hasAlpha()) |
| 1208 return false; | 1208 return false; |
| 1209 | 1209 |
| 1210 // If the element has appearance, it might be painted by theme. | 1210 // If the element has appearance, it might be painted by theme. |
| 1211 // We cannot be sure if theme paints the background opaque. | 1211 // We cannot be sure if theme paints the background opaque. |
| 1212 // In this case it is safe to not assume opaqueness. | 1212 // In this case it is safe to not assume opaqueness. |
| 1213 // FIXME: May be ask theme if it paints opaque. | 1213 // FIXME: May be ask theme if it paints opaque. |
| 1214 if (style()->hasAppearance()) | 1214 if (style()->hasAppearance()) |
| 1215 return false; | 1215 return false; |
| 1216 // FIXME: Check the opaqueness of background images. | 1216 // FIXME: Check the opaqueness of background images. |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1314 | 1314 |
| 1315 // Clipped with local scrolling | 1315 // Clipped with local scrolling |
| 1316 if (hasOverflowClip() && fillLayer->attachment() == LocalBackgroundAttachmen
t) | 1316 if (hasOverflowClip() && fillLayer->attachment() == LocalBackgroundAttachmen
t) |
| 1317 return false; | 1317 return false; |
| 1318 | 1318 |
| 1319 if (fillLayer->hasOpaqueImage(this) && fillLayer->hasRepeatXY() && fillLayer
->image()->canRender(this, style()->effectiveZoom())) | 1319 if (fillLayer->hasOpaqueImage(this) && fillLayer->hasRepeatXY() && fillLayer
->image()->canRender(this, style()->effectiveZoom())) |
| 1320 return true; | 1320 return true; |
| 1321 | 1321 |
| 1322 // If there is only one layer and no image, check whether the background col
or is opaque | 1322 // If there is only one layer and no image, check whether the background col
or is opaque |
| 1323 if (!fillLayer->next() && !fillLayer->hasImage()) { | 1323 if (!fillLayer->next() && !fillLayer->hasImage()) { |
| 1324 StyleColor bgColor = resolveStyleColor(CSSPropertyBackgroundColor); | 1324 Color bgColor = resolveColor(CSSPropertyBackgroundColor); |
| 1325 if (bgColor.isValid() && bgColor.alpha() == 255) | 1325 if (bgColor.isValid() && bgColor.alpha() == 255) |
| 1326 return true; | 1326 return true; |
| 1327 } | 1327 } |
| 1328 | 1328 |
| 1329 return false; | 1329 return false; |
| 1330 } | 1330 } |
| 1331 | 1331 |
| 1332 void RenderBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset) | 1332 void RenderBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
| 1333 { | 1333 { |
| 1334 if (!paintInfo.shouldPaintWithinRoot(this) || style()->visibility() != VISIB
LE || paintInfo.phase != PaintPhaseMask || paintInfo.context->paintingDisabled()
) | 1334 if (!paintInfo.shouldPaintWithinRoot(this) || style()->visibility() != VISIB
LE || paintInfo.phase != PaintPhaseMask || paintInfo.context->paintingDisabled()
) |
| (...skipping 3399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4734 } | 4734 } |
| 4735 | 4735 |
| 4736 if (didSplitParentAnonymousBoxes) | 4736 if (didSplitParentAnonymousBoxes) |
| 4737 markBoxForRelayoutAfterSplit(this); | 4737 markBoxForRelayoutAfterSplit(this); |
| 4738 | 4738 |
| 4739 ASSERT(beforeChild->parent() == this); | 4739 ASSERT(beforeChild->parent() == this); |
| 4740 return beforeChild; | 4740 return beforeChild; |
| 4741 } | 4741 } |
| 4742 | 4742 |
| 4743 } // namespace WebCore | 4743 } // namespace WebCore |
| OLD | NEW |