OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
3 * | 3 * |
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
5 * | 5 * |
6 * Other contributors: | 6 * Other contributors: |
7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
9 * Christian Biesinger <cbiesinger@gmail.com> | 9 * Christian Biesinger <cbiesinger@gmail.com> |
10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
(...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1486 | 1486 |
1487 static bool layerNeedsCompositedScrolling(PaintLayerScrollableArea::LCDTextMode
mode, const PaintLayer* layer) | 1487 static bool layerNeedsCompositedScrolling(PaintLayerScrollableArea::LCDTextMode
mode, const PaintLayer* layer) |
1488 { | 1488 { |
1489 if (!layer->scrollsOverflow()) | 1489 if (!layer->scrollsOverflow()) |
1490 return false; | 1490 return false; |
1491 | 1491 |
1492 Node* node = layer->enclosingNode(); | 1492 Node* node = layer->enclosingNode(); |
1493 if (node && node->isElementNode() && (toElement(node)->compositorMutableProp
erties() & (CompositorMutableProperty::kScrollTop | CompositorMutableProperty::k
ScrollLeft))) | 1493 if (node && node->isElementNode() && (toElement(node)->compositorMutableProp
erties() & (CompositorMutableProperty::kScrollTop | CompositorMutableProperty::k
ScrollLeft))) |
1494 return true; | 1494 return true; |
1495 | 1495 |
1496 // TODO(schenney) The color test alone is inadequate. When https://coderevie
w.chromium.org/2196583002 lands | 1496 // TODO(schenney): LCD Text also requires integer scroll offsets for the lay
er. While we |
1497 // we should use PaintLayer::shouldPaintBackgroundOntoForeground() because w
e will not still get | 1497 // use integer scroll offsets locally when !layer->compositor()->preferCompo
sitingToLCDTextEnabled(), |
1498 // LCD text unless the conditions there are met. It also unifies logic for s
crolling compositing decisions. | 1498 // we do not check offsets accumulated from the root (including translates).
crbug.com/644833 |
1499 bool backgroundSupportsLCDText = RuntimeEnabledFeatures::compositeOpaqueScro
llersEnabled() | 1499 bool backgroundSupportsLCDText = RuntimeEnabledFeatures::compositeOpaqueScro
llersEnabled() |
1500 && !layer->layoutObject()->style()->visitedDependentColor(CSSPropertyBac
kgroundColor).hasAlpha(); | 1500 && layer->shouldPaintBackgroundOntoScrollingContentsLayer() |
| 1501 && layer->backgroundIsKnownToBeOpaqueInRect(toLayoutBox(layer->layoutObj
ect())->paddingBoxRect()); |
1501 if (mode == PaintLayerScrollableArea::ConsiderLCDText | 1502 if (mode == PaintLayerScrollableArea::ConsiderLCDText |
1502 && !layer->compositor()->preferCompositingToLCDTextEnabled() | 1503 && !layer->compositor()->preferCompositingToLCDTextEnabled() |
1503 && !backgroundSupportsLCDText) | 1504 && !backgroundSupportsLCDText) |
1504 return false; | 1505 return false; |
1505 | 1506 |
1506 // TODO(schenney) Tests fail if we do not also exclude layer->layoutObject()
->style()->hasBorderDecoration() | 1507 // TODO(schenney) Tests fail if we do not also exclude layer->layoutObject()
->style()->hasBorderDecoration() |
1507 // (missing background behind dashed borders). Resolve this case, or not, an
d update this check with | 1508 // (missing background behind dashed borders). Resolve this case, or not, an
d update this check with |
1508 // the results. | 1509 // the results. |
1509 return !(layer->size().isEmpty() | 1510 return !(layer->size().isEmpty() |
1510 || layer->hasDescendantWithClipPath() | 1511 || layer->hasDescendantWithClipPath() |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1767 | 1768 |
1768 void PaintLayerScrollableArea::DelayScrollPositionClampScope::clampScrollableAre
as() | 1769 void PaintLayerScrollableArea::DelayScrollPositionClampScope::clampScrollableAre
as() |
1769 { | 1770 { |
1770 for (auto& scrollableArea : *s_needsClamp) | 1771 for (auto& scrollableArea : *s_needsClamp) |
1771 scrollableArea->clampScrollPositionsAfterLayout(); | 1772 scrollableArea->clampScrollPositionsAfterLayout(); |
1772 delete s_needsClamp; | 1773 delete s_needsClamp; |
1773 s_needsClamp = nullptr; | 1774 s_needsClamp = nullptr; |
1774 } | 1775 } |
1775 | 1776 |
1776 } // namespace blink | 1777 } // namespace blink |
OLD | NEW |