| 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 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1335 BoxPainter(*this).paint(paintInfo, paintOffset); | 1335 BoxPainter(*this).paint(paintInfo, paintOffset); |
| 1336 } | 1336 } |
| 1337 | 1337 |
| 1338 void LayoutBox::paintBoxDecorationBackground(const PaintInfo& paintInfo, const L
ayoutPoint& paintOffset) const | 1338 void LayoutBox::paintBoxDecorationBackground(const PaintInfo& paintInfo, const L
ayoutPoint& paintOffset) const |
| 1339 { | 1339 { |
| 1340 BoxPainter(*this).paintBoxDecorationBackground(paintInfo, paintOffset); | 1340 BoxPainter(*this).paintBoxDecorationBackground(paintInfo, paintOffset); |
| 1341 } | 1341 } |
| 1342 | 1342 |
| 1343 bool LayoutBox::getBackgroundPaintedExtent(LayoutRect& paintedExtent) const | 1343 bool LayoutBox::getBackgroundPaintedExtent(LayoutRect& paintedExtent) const |
| 1344 { | 1344 { |
| 1345 ASSERT(hasBackground()); | 1345 DCHECK(styleRef().hasBackground()); |
| 1346 | 1346 |
| 1347 // LayoutView is special in the sense that it expands to the whole canvas, | 1347 // LayoutView is special in the sense that it expands to the whole canvas, |
| 1348 // thus can't be handled by this function. | 1348 // thus can't be handled by this function. |
| 1349 ASSERT(!isLayoutView()); | 1349 DCHECK(!isLayoutView()); |
| 1350 | 1350 |
| 1351 LayoutRect backgroundRect(borderBoxRect()); | 1351 LayoutRect backgroundRect(borderBoxRect()); |
| 1352 | 1352 |
| 1353 Color backgroundColor = resolveColor(CSSPropertyBackgroundColor); | 1353 Color backgroundColor = resolveColor(CSSPropertyBackgroundColor); |
| 1354 if (backgroundColor.alpha()) { | 1354 if (backgroundColor.alpha()) { |
| 1355 paintedExtent = backgroundRect; | 1355 paintedExtent = backgroundRect; |
| 1356 return true; | 1356 return true; |
| 1357 } | 1357 } |
| 1358 | 1358 |
| 1359 if (!style()->backgroundLayers().image() || style()->backgroundLayers().next
()) { | 1359 if (!style()->backgroundLayers().image() || style()->backgroundLayers().next
()) { |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1452 return true; | 1452 return true; |
| 1453 } | 1453 } |
| 1454 return false; | 1454 return false; |
| 1455 } | 1455 } |
| 1456 | 1456 |
| 1457 bool LayoutBox::computeBackgroundIsKnownToBeObscured() const | 1457 bool LayoutBox::computeBackgroundIsKnownToBeObscured() const |
| 1458 { | 1458 { |
| 1459 if (scrollsOverflow()) | 1459 if (scrollsOverflow()) |
| 1460 return false; | 1460 return false; |
| 1461 // Test to see if the children trivially obscure the background. | 1461 // Test to see if the children trivially obscure the background. |
| 1462 // FIXME: This test can be much more comprehensive. | 1462 if (!styleRef().hasBackground()) |
| 1463 if (!hasBackground()) | |
| 1464 return false; | 1463 return false; |
| 1465 // Root background painting is special. | 1464 // Root background painting is special. |
| 1466 if (isLayoutView()) | 1465 if (isLayoutView()) |
| 1467 return false; | 1466 return false; |
| 1468 // FIXME: box-shadow is painted while background painting. | 1467 // FIXME: box-shadow is painted while background painting. |
| 1469 if (style()->boxShadow()) | 1468 if (style()->boxShadow()) |
| 1470 return false; | 1469 return false; |
| 1471 LayoutRect backgroundRect; | 1470 LayoutRect backgroundRect; |
| 1472 if (!getBackgroundPaintedExtent(backgroundRect)) | 1471 if (!getBackgroundPaintedExtent(backgroundRect)) |
| 1473 return false; | 1472 return false; |
| (...skipping 3514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4988 m_rareData->m_snapAreas->remove(&snapArea); | 4987 m_rareData->m_snapAreas->remove(&snapArea); |
| 4989 } | 4988 } |
| 4990 } | 4989 } |
| 4991 | 4990 |
| 4992 SnapAreaSet* LayoutBox::snapAreas() const | 4991 SnapAreaSet* LayoutBox::snapAreas() const |
| 4993 { | 4992 { |
| 4994 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; | 4993 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; |
| 4995 } | 4994 } |
| 4996 | 4995 |
| 4997 } // namespace blink | 4996 } // namespace blink |
| OLD | NEW |