Chromium Code Reviews| 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 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1278 // of the paint phase. Potentially returning different results at different phases. | 1278 // of the paint phase. Potentially returning different results at different phases. |
| 1279 geometry.calculate(*this, nullptr, GlobalPaintNormalPhase, style()->backgrou ndLayers(), backgroundRect); | 1279 geometry.calculate(*this, nullptr, GlobalPaintNormalPhase, style()->backgrou ndLayers(), backgroundRect); |
| 1280 if (geometry.hasNonLocalGeometry()) | 1280 if (geometry.hasNonLocalGeometry()) |
| 1281 return false; | 1281 return false; |
| 1282 paintedExtent = LayoutRect(geometry.destRect()); | 1282 paintedExtent = LayoutRect(geometry.destRect()); |
| 1283 return true; | 1283 return true; |
| 1284 } | 1284 } |
| 1285 | 1285 |
| 1286 bool LayoutBox::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) c onst | 1286 bool LayoutBox::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) c onst |
| 1287 { | 1287 { |
| 1288 // Instead of returning false unconditionnaly for the document, check if it | |
| 1289 // is transparent. | |
| 1288 if (isDocumentElement() || backgroundStolenForBeingBody()) | 1290 if (isDocumentElement() || backgroundStolenForBeingBody()) |
| 1289 return false; | 1291 return !isTransparent(); |
|
trchen
2016/03/08 01:57:21
This change is incorrect. The document element ind
| |
| 1290 | 1292 |
| 1291 Color backgroundColor = resolveColor(CSSPropertyBackgroundColor); | 1293 Color backgroundColor = resolveColor(CSSPropertyBackgroundColor); |
| 1292 if (backgroundColor.hasAlpha()) | 1294 if (backgroundColor.hasAlpha()) |
| 1293 return false; | 1295 return false; |
| 1294 | 1296 |
| 1295 // If the element has appearance, it might be painted by theme. | 1297 // If the element has appearance, it might be painted by theme. |
| 1296 // We cannot be sure if theme paints the background opaque. | 1298 // We cannot be sure if theme paints the background opaque. |
| 1297 // In this case it is safe to not assume opaqueness. | 1299 // In this case it is safe to not assume opaqueness. |
| 1298 // FIXME: May be ask theme if it paints opaque. | 1300 // FIXME: May be ask theme if it paints opaque. |
| 1299 if (style()->hasAppearance()) | 1301 if (style()->hasAppearance()) |
| (...skipping 3378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4678 } | 4680 } |
| 4679 | 4681 |
| 4680 void LayoutBox::IntrinsicSizingInfo::transpose() | 4682 void LayoutBox::IntrinsicSizingInfo::transpose() |
| 4681 { | 4683 { |
| 4682 size = size.transposedSize(); | 4684 size = size.transposedSize(); |
| 4683 aspectRatio = aspectRatio.transposedSize(); | 4685 aspectRatio = aspectRatio.transposedSize(); |
| 4684 std::swap(hasWidth, hasHeight); | 4686 std::swap(hasWidth, hasHeight); |
| 4685 } | 4687 } |
| 4686 | 4688 |
| 4687 } // namespace blink | 4689 } // namespace blink |
| OLD | NEW |