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 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1475 LayoutRect rect = visualOverflowRect(); | 1475 LayoutRect rect = visualOverflowRect(); |
| 1476 LayoutView* layoutView = view(); | 1476 LayoutView* layoutView = view(); |
| 1477 while (layoutView->frame()->ownerLayoutObject()) | 1477 while (layoutView->frame()->ownerLayoutObject()) |
| 1478 layoutView = layoutView->frame()->ownerLayoutObject()->view(); | 1478 layoutView = layoutView->frame()->ownerLayoutObject()->view(); |
| 1479 mapToVisibleRectInAncestorSpace(layoutView, rect, nullptr); | 1479 mapToVisibleRectInAncestorSpace(layoutView, rect, nullptr); |
| 1480 return rect.intersects(LayoutRect(layoutView->frameView()->scrollableArea()- >visibleContentRectDouble())); | 1480 return rect.intersects(LayoutRect(layoutView->frameView()->scrollableArea()- >visibleContentRectDouble())); |
| 1481 } | 1481 } |
| 1482 | 1482 |
| 1483 PaintInvalidationReason LayoutBox::invalidatePaintIfNeeded(PaintInvalidationStat e& paintInvalidationState, const LayoutBoxModelObject& paintInvalidationContaine r) | 1483 PaintInvalidationReason LayoutBox::invalidatePaintIfNeeded(PaintInvalidationStat e& paintInvalidationState, const LayoutBoxModelObject& paintInvalidationContaine r) |
| 1484 { | 1484 { |
| 1485 if (isFloating()) | 1485 PaintLayer& enclosingSelfPaintingLayer = paintInvalidationState.enclosingSel fPaintingLayer(*this); |
| 1486 paintInvalidationState.enclosingSelfPaintingLayer(*this).setNeedsPaintPh aseFloat(); | 1486 if (enclosingSelfPaintingLayer.layoutObject() != this) { |
| 1487 if (isFloating()) | |
| 1488 enclosingSelfPaintingLayer.setNeedsPaintPhaseFloat(); | |
|
Xianzhu
2016/03/08 22:08:42
This change is because a self-painting floating la
| |
| 1487 | 1489 |
| 1488 if (hasBoxDecorationBackground() | 1490 if (hasBoxDecorationBackground() |
| 1489 // We also paint overflow controls in background phase. | 1491 // We also paint overflow controls in background phase. |
| 1490 || (hasOverflowClip() && scrollableArea()->hasOverflowControls())) { | 1492 || (hasOverflowClip() && scrollableArea()->hasOverflowControls())) |
| 1491 PaintLayer& layer = paintInvalidationState.enclosingSelfPaintingLayer(*t his); | 1493 enclosingSelfPaintingLayer.setNeedsPaintPhaseDescendantBlockBackgrou nds(); |
|
chrishtr
2016/03/09 03:40:47
A self-painting layer also doesn't need PaintPhase
Xianzhu
2016/03/09 21:39:52
Right. The layer paints its own background in Pain
| |
| 1492 if (layer.layoutObject() != this) | |
| 1493 layer.setNeedsPaintPhaseDescendantBlockBackgrounds(); | |
| 1494 } | 1494 } |
| 1495 | 1495 |
| 1496 PaintInvalidationReason fullInvalidationReason = fullPaintInvalidationReason (); | 1496 PaintInvalidationReason fullInvalidationReason = fullPaintInvalidationReason (); |
| 1497 // If the current paint invalidation reason is PaintInvalidationDelayedFull, then this paint invalidation can delayed if the | 1497 // If the current paint invalidation reason is PaintInvalidationDelayedFull, then this paint invalidation can delayed if the |
| 1498 // LayoutBox in question is not on-screen. The logic to decide whether this is appropriate exists at the site of the original | 1498 // LayoutBox in question is not on-screen. The logic to decide whether this is appropriate exists at the site of the original |
| 1499 // paint invalidation that chose PaintInvalidationDelayedFull. | 1499 // paint invalidation that chose PaintInvalidationDelayedFull. |
| 1500 if (fullInvalidationReason == PaintInvalidationDelayedFull) { | 1500 if (fullInvalidationReason == PaintInvalidationDelayedFull) { |
| 1501 if (!intersectsVisibleViewport()) | 1501 if (!intersectsVisibleViewport()) |
| 1502 return PaintInvalidationDelayedFull; | 1502 return PaintInvalidationDelayedFull; |
| 1503 | 1503 |
| (...skipping 3174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4678 } | 4678 } |
| 4679 | 4679 |
| 4680 void LayoutBox::IntrinsicSizingInfo::transpose() | 4680 void LayoutBox::IntrinsicSizingInfo::transpose() |
| 4681 { | 4681 { |
| 4682 size = size.transposedSize(); | 4682 size = size.transposedSize(); |
| 4683 aspectRatio = aspectRatio.transposedSize(); | 4683 aspectRatio = aspectRatio.transposedSize(); |
| 4684 std::swap(hasWidth, hasHeight); | 4684 std::swap(hasWidth, hasHeight); |
| 4685 } | 4685 } |
| 4686 | 4686 |
| 4687 } // namespace blink | 4687 } // namespace blink |
| OLD | NEW |