OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r
ights reserved. |
7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 class LayoutFlowThread; | 61 class LayoutFlowThread; |
62 class LayoutGeometryMap; | 62 class LayoutGeometryMap; |
63 class LayoutMultiColumnSpannerPlaceholder; | 63 class LayoutMultiColumnSpannerPlaceholder; |
64 class LayoutView; | 64 class LayoutView; |
65 class ObjectPaintProperties; | 65 class ObjectPaintProperties; |
66 class PaintLayer; | 66 class PaintLayer; |
67 class PseudoStyleRequest; | 67 class PseudoStyleRequest; |
68 class TransformState; | 68 class TransformState; |
69 | 69 |
70 struct PaintInfo; | 70 struct PaintInfo; |
| 71 struct PaintInvalidatorContext; |
71 | 72 |
72 enum CursorDirective { | 73 enum CursorDirective { |
73 SetCursorBasedOnStyle, | 74 SetCursorBasedOnStyle, |
74 SetCursor, | 75 SetCursor, |
75 DoNotSetCursor | 76 DoNotSetCursor |
76 }; | 77 }; |
77 | 78 |
78 enum HitTestFilter { | 79 enum HitTestFilter { |
79 HitTestAll, | 80 HitTestAll, |
80 HitTestSelf, | 81 HitTestSelf, |
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1299 LayoutRect previousPaintInvalidationRectIncludingCompositedScrolling(const L
ayoutBoxModelObject& paintInvalidationContainer) const; | 1300 LayoutRect previousPaintInvalidationRectIncludingCompositedScrolling(const L
ayoutBoxModelObject& paintInvalidationContainer) const; |
1300 LayoutSize previousPaintInvalidationRectSize() const { return previousPaintI
nvalidationRect().size(); } | 1301 LayoutSize previousPaintInvalidationRectSize() const { return previousPaintI
nvalidationRect().size(); } |
1301 | 1302 |
1302 // Called when the previous paint invalidation rect(s) is no longer valid. | 1303 // Called when the previous paint invalidation rect(s) is no longer valid. |
1303 virtual void clearPreviousPaintInvalidationRects(); | 1304 virtual void clearPreviousPaintInvalidationRects(); |
1304 | 1305 |
1305 // Only adjusts if the paint invalidation container is not a composited scro
ller. | 1306 // Only adjusts if the paint invalidation container is not a composited scro
ller. |
1306 void adjustPreviousPaintInvalidationForScrollIfNeeded(const DoubleSize& scro
llDelta); | 1307 void adjustPreviousPaintInvalidationForScrollIfNeeded(const DoubleSize& scro
llDelta); |
1307 | 1308 |
1308 // The previous position of the top-left corner of the object in its previou
s paint backing. | 1309 // The previous position of the top-left corner of the object in its previou
s paint backing. |
1309 const LayoutPoint& previousPositionFromPaintInvalidationBacking() const | 1310 const LayoutPoint& previousPositionFromPaintInvalidationBacking() const { re
turn m_previousPositionFromPaintInvalidationBacking; } |
1310 { | 1311 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& posi
tionFromPaintInvalidationBacking) { m_previousPositionFromPaintInvalidationBacki
ng = positionFromPaintInvalidationBacking; } |
1311 ASSERT(!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); | |
1312 return m_previousPositionFromPaintInvalidationBacking; | |
1313 } | |
1314 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& posi
tionFromPaintInvalidationBacking) | |
1315 { | |
1316 ASSERT(!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); | |
1317 m_previousPositionFromPaintInvalidationBacking = positionFromPaintInvali
dationBacking; | |
1318 } | |
1319 | 1312 |
1320 bool paintOffsetChanged(const LayoutPoint& newPaintOffset) const | 1313 bool paintOffsetChanged(const LayoutPoint& newPaintOffset) const |
1321 { | 1314 { |
1322 ASSERT(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); | 1315 ASSERT(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); |
1323 return m_previousPositionFromPaintInvalidationBacking != uninitializedPa
intOffset() && m_previousPositionFromPaintInvalidationBacking != newPaintOffset; | 1316 return m_previousPositionFromPaintInvalidationBacking != uninitializedPa
intOffset() && m_previousPositionFromPaintInvalidationBacking != newPaintOffset; |
1324 } | 1317 } |
1325 void setPreviousPaintOffset(const LayoutPoint& paintOffset) | 1318 void setPreviousPaintOffset(const LayoutPoint& paintOffset) |
1326 { | 1319 { |
1327 ASSERT(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); | 1320 ASSERT(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); |
1328 m_previousPositionFromPaintInvalidationBacking = paintOffset; | 1321 m_previousPositionFromPaintInvalidationBacking = paintOffset; |
1329 } | 1322 } |
1330 | 1323 |
1331 PaintInvalidationReason fullPaintInvalidationReason() const { return m_bitfi
elds.fullPaintInvalidationReason(); } | 1324 PaintInvalidationReason fullPaintInvalidationReason() const { return m_bitfi
elds.fullPaintInvalidationReason(); } |
1332 bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInv
alidationReason() != PaintInvalidationNone; } | 1325 bool shouldDoFullPaintInvalidation() const { return m_bitfields.fullPaintInv
alidationReason() != PaintInvalidationNone; } |
1333 void setShouldDoFullPaintInvalidation(PaintInvalidationReason = PaintInvalid
ationFull); | 1326 void setShouldDoFullPaintInvalidation(PaintInvalidationReason = PaintInvalid
ationFull); |
1334 void clearShouldDoFullPaintInvalidation() { m_bitfields.setFullPaintInvalida
tionReason(PaintInvalidationNone); } | 1327 void clearShouldDoFullPaintInvalidation() { m_bitfields.setFullPaintInvalida
tionReason(PaintInvalidationNone); } |
1335 | 1328 |
1336 virtual void clearPaintInvalidationFlags(const PaintInvalidationState&); | 1329 virtual void clearPaintInvalidationFlags(); |
1337 | 1330 |
1338 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval
idation(); } | 1331 bool mayNeedPaintInvalidation() const { return m_bitfields.mayNeedPaintInval
idation(); } |
1339 void setMayNeedPaintInvalidation(); | 1332 void setMayNeedPaintInvalidation(); |
1340 | 1333 |
1341 bool mayNeedPaintInvalidationSubtree() const { return m_bitfields.mayNeedPai
ntInvalidationSubtree(); } | 1334 bool mayNeedPaintInvalidationSubtree() const { return m_bitfields.mayNeedPai
ntInvalidationSubtree(); } |
1342 void setMayNeedPaintInvalidationSubtree(); | 1335 void setMayNeedPaintInvalidationSubtree(); |
1343 | 1336 |
1344 bool shouldInvalidateSelection() const { return m_bitfields.shouldInvalidate
Selection(); } | 1337 bool shouldInvalidateSelection() const { return m_bitfields.shouldInvalidate
Selection(); } |
1345 void setShouldInvalidateSelection(); | 1338 void setShouldInvalidateSelection(); |
1346 | 1339 |
(...skipping 23 matching lines...) Expand all Loading... |
1370 | 1363 |
1371 // Sets painting layer needsRepaint, then calls invaldiateDisplayItemClient(
). | 1364 // Sets painting layer needsRepaint, then calls invaldiateDisplayItemClient(
). |
1372 // Should use this version when PaintInvalidationState is available. | 1365 // Should use this version when PaintInvalidationState is available. |
1373 void setPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient(const PaintI
nvalidationState&, const DisplayItemClient&, PaintInvalidationReason) const; | 1366 void setPaintingLayerNeedsRepaintAndInvalidateDisplayItemClient(const PaintI
nvalidationState&, const DisplayItemClient&, PaintInvalidationReason) const; |
1374 | 1367 |
1375 // The caller should ensure the painting layer has been setNeedsRepaint befo
re calling this function. | 1368 // The caller should ensure the painting layer has been setNeedsRepaint befo
re calling this function. |
1376 void invalidateDisplayItemClient(const DisplayItemClient&, PaintInvalidation
Reason) const; | 1369 void invalidateDisplayItemClient(const DisplayItemClient&, PaintInvalidation
Reason) const; |
1377 | 1370 |
1378 void invalidateDisplayItemClientsIncludingNonCompositingDescendants(PaintInv
alidationReason) const; | 1371 void invalidateDisplayItemClientsIncludingNonCompositingDescendants(PaintInv
alidationReason) const; |
1379 | 1372 |
| 1373 // New version to replace the above old version. |
| 1374 virtual PaintInvalidationReason invalidatePaintIfNeeded(const PaintInvalidat
orContext&) const; |
| 1375 |
| 1376 // When this object is invalidated for paint, this method is called to inval
idate any DisplayItemClients |
| 1377 // owned by this object, including the object itself, LayoutText/LayoutInlin
e line boxes, etc., |
| 1378 // not including children which will be invalidated normally during invalida
teTreeIfNeeded() and |
| 1379 // parts which are invalidated separately (e.g. scrollbars). |
| 1380 // The caller should ensure the painting layer has been setNeedsRepaint befo
re calling this function. |
| 1381 virtual void invalidateDisplayItemClients(PaintInvalidationReason) const; |
| 1382 |
| 1383 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP
aintInvalidationRect; } |
| 1384 |
| 1385 virtual bool hasNonCompositedScrollbars() const { return false; } |
| 1386 |
1380 // Called before anonymousChild.setStyle(). Override to set custom styles fo
r the child. | 1387 // Called before anonymousChild.setStyle(). Override to set custom styles fo
r the child. |
1381 virtual void updateAnonymousChildStyle(const LayoutObject& anonymousChild, C
omputedStyle& style) const { } | 1388 virtual void updateAnonymousChildStyle(const LayoutObject& anonymousChild, C
omputedStyle& style) const { } |
1382 | 1389 |
1383 // Painters can use const methods only, except for these explicitly declared
methods. | 1390 // Painters can use const methods only, except for these explicitly declared
methods. |
1384 class MutableForPainting { | 1391 class MutableForPainting { |
1385 public: | 1392 public: |
1386 void setPreviousPaintOffset(const LayoutPoint& paintOffset) { m_layoutOb
ject.setPreviousPaintOffset(paintOffset); } | 1393 void setPreviousPaintOffset(const LayoutPoint& paintOffset) { m_layoutOb
ject.setPreviousPaintOffset(paintOffset); } |
1387 PaintInvalidationReason invalidatePaintIfNeeded(const PaintInvalidationS
tate& paintInvalidationState) { return m_layoutObject.invalidatePaintIfNeeded(pa
intInvalidationState); } | 1394 void clearPaintInvalidationFlags() { m_layoutObject.clearPaintInvalidati
onFlags(); } |
1388 void clearPaintInvalidationFlags(const PaintInvalidationState& paintInva
lidationState) { m_layoutObject.clearPaintInvalidationFlags(paintInvalidationSta
te); } | 1395 void setShouldDoFullPaintInvalidation(PaintInvalidationReason reason) {
m_layoutObject.setShouldDoFullPaintInvalidation(reason); } |
1389 void setShouldDoDelayedFullPaintInvalidation() { m_layoutObject.setShoul
dDoFullPaintInvalidation(PaintInvalidationDelayedFull); } | 1396 |
| 1397 void setPreviousPaintInvalidationRect(const LayoutRect& r) { m_layoutObj
ect.setPreviousPaintInvalidationRect(r); } |
| 1398 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint&
p) { m_layoutObject.setPreviousPositionFromPaintInvalidationBacking(p); } |
| 1399 void setPreviousBoxDecorationBackgroundObscured(bool b) { m_layoutObject
.setPreviousBoxDecorationBackgroundObscured(b); } |
1390 | 1400 |
1391 private: | 1401 private: |
1392 friend class PaintPropertyTreeBuilder; | 1402 friend class PaintPropertyTreeBuilder; |
1393 // The following two functions can be called from PaintPropertyTreeBuild
er only. | 1403 // The following two functions can be called from PaintPropertyTreeBuild
er only. |
1394 ObjectPaintProperties& ensureObjectPaintProperties() { return m_layoutOb
ject.ensureObjectPaintProperties(); } | 1404 ObjectPaintProperties& ensureObjectPaintProperties() { return m_layoutOb
ject.ensureObjectPaintProperties(); } |
1395 ObjectPaintProperties* objectPaintProperties() { return const_cast<Objec
tPaintProperties*>(m_layoutObject.objectPaintProperties()); } | 1405 ObjectPaintProperties* objectPaintProperties() { return const_cast<Objec
tPaintProperties*>(m_layoutObject.objectPaintProperties()); } |
1396 | 1406 |
1397 friend class LayoutObject; | 1407 friend class LayoutObject; |
1398 MutableForPainting(const LayoutObject& layoutObject) : m_layoutObject(co
nst_cast<LayoutObject&>(layoutObject)) { } | 1408 MutableForPainting(const LayoutObject& layoutObject) : m_layoutObject(co
nst_cast<LayoutObject&>(layoutObject)) { } |
1399 | 1409 |
1400 LayoutObject& m_layoutObject; | 1410 LayoutObject& m_layoutObject; |
1401 }; | 1411 }; |
1402 MutableForPainting getMutableForPainting() const { return MutableForPainting
(*this); } | 1412 MutableForPainting getMutableForPainting() const { return MutableForPainting
(*this); } |
1403 | 1413 |
1404 void setIsScrollAnchorObject() { m_bitfields.setIsScrollAnchorObject(true);
} | 1414 void setIsScrollAnchorObject() { m_bitfields.setIsScrollAnchorObject(true);
} |
1405 // Clears the IsScrollAnchorObject bit, unless any ScrollAnchor still refers
to us. | 1415 // Clears the IsScrollAnchorObject bit, unless any ScrollAnchor still refers
to us. |
1406 void maybeClearIsScrollAnchorObject(); | 1416 void maybeClearIsScrollAnchorObject(); |
1407 | 1417 |
1408 void clearChildNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setChildN
eedsOverflowRecalcAfterStyleChange(false); } | 1418 void clearChildNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setChildN
eedsOverflowRecalcAfterStyleChange(false); } |
1409 | 1419 |
1410 bool compositedScrollsWithRespectTo(const LayoutBoxModelObject& paintInvalid
ationContainer) const; | 1420 bool compositedScrollsWithRespectTo(const LayoutBoxModelObject& paintInvalid
ationContainer) const; |
1411 IntSize scrollAdjustmentForPaintInvalidation(const LayoutBoxModelObject& pai
ntInvalidationContainer) const; | 1421 IntSize scrollAdjustmentForPaintInvalidation(const LayoutBoxModelObject& pai
ntInvalidationContainer) const; |
1412 | 1422 |
| 1423 bool previousBoxDecorationBackgroundObscured() const { return m_bitfields.pr
eviousBoxDecorationBackgroundObscured(); } |
| 1424 void setPreviousBoxDecorationBackgroundObscured(bool b) { m_bitfields.setPre
viousBoxDecorationBackgroundObscured(b); } |
| 1425 |
1413 protected: | 1426 protected: |
1414 enum LayoutObjectType { | 1427 enum LayoutObjectType { |
1415 LayoutObjectBr, | 1428 LayoutObjectBr, |
1416 LayoutObjectCanvas, | 1429 LayoutObjectCanvas, |
1417 LayoutObjectFieldset, | 1430 LayoutObjectFieldset, |
1418 LayoutObjectCounter, | 1431 LayoutObjectCounter, |
1419 LayoutObjectDetailsMarker, | 1432 LayoutObjectDetailsMarker, |
1420 LayoutObjectEmbeddedObject, | 1433 LayoutObjectEmbeddedObject, |
1421 LayoutObjectFileUploadControl, | 1434 LayoutObjectFileUploadControl, |
1422 LayoutObjectFrame, | 1435 LayoutObjectFrame, |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1523 // be a container for child elements. Any rect wholly contained by container
Rect can be | 1536 // be a container for child elements. Any rect wholly contained by container
Rect can be |
1524 // skipped. | 1537 // skipped. |
1525 virtual void addLayerHitTestRects(LayerHitTestRects&, const PaintLayer* curr
entLayer, const LayoutPoint& layerOffset, const LayoutRect& containerRect) const
; | 1538 virtual void addLayerHitTestRects(LayerHitTestRects&, const PaintLayer* curr
entLayer, const LayoutPoint& layerOffset, const LayoutRect& containerRect) const
; |
1526 | 1539 |
1527 // Add hit-test rects for this layoutObject only to the provided list. layer
Offset is the offset | 1540 // Add hit-test rects for this layoutObject only to the provided list. layer
Offset is the offset |
1528 // of this layoutObject within the current layer that should be used for eac
h result. | 1541 // of this layoutObject within the current layer that should be used for eac
h result. |
1529 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint&
layerOffset) const { } | 1542 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint&
layerOffset) const { } |
1530 | 1543 |
1531 void setPreviousPaintInvalidationRect(const LayoutRect& rect) { m_previousPa
intInvalidationRect = rect; } | 1544 void setPreviousPaintInvalidationRect(const LayoutRect& rect) { m_previousPa
intInvalidationRect = rect; } |
1532 | 1545 |
1533 virtual PaintInvalidationReason getPaintInvalidationReason(const PaintInvali
dationState&, | |
1534 const LayoutRect& oldPaintInvalidationRect, const LayoutPoint& oldPositi
onFromPaintInvalidationBacking, | |
1535 const LayoutRect& newPaintInvalidationRect, const LayoutPoint& newPositi
onFromPaintInvalidationBacking) const; | |
1536 | |
1537 // This function tries to minimize the amount of invalidation | |
1538 // generated by invalidating the "difference" between |oldBounds| | |
1539 // and |newBounds|. This means invalidating the union of the | |
1540 // previous rectangles but not their intersection. | |
1541 // | |
1542 // The use case is when an element only requires a paint | |
1543 // invalidation (which means that its content didn't change) | |
1544 // and its bounds changed but its location didn't. | |
1545 // | |
1546 // If we don't meet the criteria for an incremental paint, the | |
1547 // alternative is a full paint invalidation. | |
1548 virtual void incrementallyInvalidatePaint(const LayoutBoxModelObject& paintI
nvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds,
const LayoutPoint& positionFromPaintInvalidationBacking); | |
1549 | |
1550 virtual bool hasNonCompositedScrollbars() const { return false; } | |
1551 | |
1552 #if ENABLE(ASSERT) | 1546 #if ENABLE(ASSERT) |
1553 virtual bool paintInvalidationStateIsDirty() const | 1547 virtual bool paintInvalidationStateIsDirty() const |
1554 { | 1548 { |
1555 return shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState
(); | 1549 return shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState
(); |
1556 } | 1550 } |
1557 #endif | 1551 #endif |
1558 | 1552 |
1559 // This function walks the descendants of |this|, following a | 1553 // This function walks the descendants of |this|, following a |
1560 // layout ordering. | 1554 // layout ordering. |
1561 // | 1555 // |
1562 // The ordering is important for PaintInvalidationState, as | 1556 // The ordering is important for PaintInvalidationState, as |
1563 // it requires to be called following a descendant/container | 1557 // it requires to be called following a descendant/container |
1564 // relationship. | 1558 // relationship. |
1565 // | 1559 // |
1566 // The function is overridden to handle special children | 1560 // The function is overridden to handle special children |
1567 // (e.g. percentage height descendants or reflections). | 1561 // (e.g. percentage height descendants or reflections). |
1568 virtual void invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationState&
childPaintInvalidationState); | 1562 virtual void invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationState&
childPaintInvalidationState); |
1569 | 1563 |
1570 // This function generates the invalidation for this object only. | 1564 // This function generates the invalidation for this object only. |
1571 // It doesn't recurse into other object, as this is handled | 1565 // It doesn't recurse into other object, as this is handled |
1572 // by invalidatePaintOfSubtreesIfNeeded. | 1566 // by invalidatePaintOfSubtreesIfNeeded. |
1573 virtual PaintInvalidationReason invalidatePaintIfNeeded(const PaintInvalidat
ionState&); | 1567 virtual PaintInvalidationReason invalidatePaintIfNeeded(const PaintInvalidat
ionState&); |
1574 | 1568 |
1575 // When this object is invalidated for paint, this method is called to inval
idate any DisplayItemClients | |
1576 // owned by this object, including the object itself, LayoutText/LayoutInlin
e line boxes, etc., | |
1577 // not including children which will be invalidated normally during invalida
teTreeIfNeeded() and | |
1578 // parts which are invalidated separately (e.g. scrollbars). | |
1579 // The caller should ensure the painting layer has been setNeedsRepaint befo
re calling this function. | |
1580 virtual void invalidateDisplayItemClients(PaintInvalidationReason) const; | |
1581 | |
1582 // Sets painting layer needsRepaint, then calls invalidateDisplayItemClients
(). | |
1583 // Should use this version when PaintInvalidationState is available. | |
1584 void invalidateDisplayItemClientsWithPaintInvalidationState(const PaintInval
idationState&, PaintInvalidationReason) const; | |
1585 | |
1586 void setIsBackgroundAttachmentFixedObject(bool); | 1569 void setIsBackgroundAttachmentFixedObject(bool); |
1587 | 1570 |
1588 void clearSelfNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setSelfNee
dsOverflowRecalcAfterStyleChange(false); } | 1571 void clearSelfNeedsOverflowRecalcAfterStyleChange() { m_bitfields.setSelfNee
dsOverflowRecalcAfterStyleChange(false); } |
1589 void setEverHadLayout() { m_bitfields.setEverHadLayout(true); } | 1572 void setEverHadLayout() { m_bitfields.setEverHadLayout(true); } |
1590 | 1573 |
1591 // Remove this object and all descendants from the containing LayoutFlowThre
ad. | 1574 // Remove this object and all descendants from the containing LayoutFlowThre
ad. |
1592 void removeFromLayoutFlowThread(); | 1575 void removeFromLayoutFlowThread(); |
1593 | 1576 |
1594 bool containsInlineWithOutlineAndContinuation() const { return m_bitfields.c
ontainsInlineWithOutlineAndContinuation(); } | 1577 bool containsInlineWithOutlineAndContinuation() const { return m_bitfields.c
ontainsInlineWithOutlineAndContinuation(); } |
1595 void setContainsInlineWithOutlineAndContinuation(bool b) { m_bitfields.setCo
ntainsInlineWithOutlineAndContinuation(b); } | 1578 void setContainsInlineWithOutlineAndContinuation(bool b) { m_bitfields.setCo
ntainsInlineWithOutlineAndContinuation(b); } |
1596 | 1579 |
1597 const LayoutRect& previousPaintInvalidationRect() const { return m_previousP
aintInvalidationRect; } | |
1598 | |
1599 private: | 1580 private: |
1600 // This function generates a full invalidation, which | |
1601 // means invalidating both |oldBounds| and |newBounds|. | |
1602 // | |
1603 // This is the default choice when generating an invalidation, | |
1604 // as it is always correct, albeit it may force some extra painting. | |
1605 void fullyInvalidatePaint(const LayoutBoxModelObject& paintInvalidationConta
iner, PaintInvalidationReason, const LayoutRect& oldBounds, const LayoutRect& ne
wBounds); | |
1606 | |
1607 // Adjusts a paint invalidation rect in the space of |m_previousPaintInvalid
ationRect| and |m_previousPositionFromPaintInvalidationBacking| | 1581 // Adjusts a paint invalidation rect in the space of |m_previousPaintInvalid
ationRect| and |m_previousPositionFromPaintInvalidationBacking| |
1608 // to be in the space of the |paintInvalidationContainer|, | 1582 // to be in the space of the |paintInvalidationContainer|, |
1609 // if needed. They can be different only if |paintInvalidationContainer| is
a composited scroller. | 1583 // if needed. They can be different only if |paintInvalidationContainer| is
a composited scroller. |
1610 void adjustInvalidationRectForCompositedScrolling(LayoutRect&, const LayoutB
oxModelObject& paintInvalidationContainer) const; | 1584 void adjustInvalidationRectForCompositedScrolling(LayoutRect&, const LayoutB
oxModelObject& paintInvalidationContainer) const; |
1611 | 1585 |
1612 void clearLayoutRootIfNeeded() const; | 1586 void clearLayoutRootIfNeeded() const; |
1613 | 1587 |
1614 bool isInert() const; | 1588 bool isInert() const; |
1615 | 1589 |
1616 void updateImage(StyleImage*, StyleImage*); | 1590 void updateImage(StyleImage*, StyleImage*); |
1617 | 1591 |
1618 void scheduleRelayout(); | 1592 void scheduleRelayout(); |
1619 | 1593 |
1620 void updateShapeImage(const ShapeValue*, const ShapeValue*); | 1594 void updateShapeImage(const ShapeValue*, const ShapeValue*); |
1621 void updateFillImages(const FillLayer* oldLayers, const FillLayer& newLayers
); | 1595 void updateFillImages(const FillLayer* oldLayers, const FillLayer& newLayers
); |
1622 void updateCursorImages(const CursorList* oldCursors, const CursorList* newC
ursors); | 1596 void updateCursorImages(const CursorList* oldCursors, const CursorList* newC
ursors); |
1623 | 1597 |
1624 void setNeedsOverflowRecalcAfterStyleChange(); | 1598 void setNeedsOverflowRecalcAfterStyleChange(); |
1625 | 1599 |
1626 // FIXME: This should be 'markContaingBoxChainForOverflowRecalc when we make
LayoutBox | 1600 // FIXME: This should be 'markContaingBoxChainForOverflowRecalc when we make
LayoutBox |
1627 // recomputeOverflow-capable. crbug.com/437012 and crbug.com/434700. | 1601 // recomputeOverflow-capable. crbug.com/437012 and crbug.com/434700. |
1628 inline void markAncestorsForOverflowRecalcIfNeeded(); | 1602 inline void markAncestorsForOverflowRecalcIfNeeded(); |
1629 | 1603 |
1630 inline void markAncestorsForPaintInvalidation(); | 1604 inline void markAncestorsForPaintInvalidation(); |
1631 | 1605 |
1632 inline void invalidateSelectionIfNeeded(const LayoutBoxModelObject& paintInv
alidationContainer, const PaintInvalidationState&, PaintInvalidationReason); | |
1633 | |
1634 inline void invalidateContainerPreferredLogicalWidths(); | 1606 inline void invalidateContainerPreferredLogicalWidths(); |
1635 | 1607 |
1636 void invalidatePaintIncludingNonSelfPaintingLayerDescendantsInternal(const L
ayoutBoxModelObject& paintInvalidationContainer); | 1608 void invalidatePaintIncludingNonSelfPaintingLayerDescendantsInternal(const L
ayoutBoxModelObject& paintInvalidationContainer); |
1637 | 1609 |
1638 // The caller should ensure the painting layer has been setNeedsRepaint befo
re calling this function. | 1610 // The caller should ensure the painting layer has been setNeedsRepaint befo
re calling this function. |
1639 void invalidatePaintOfPreviousPaintInvalidationRect(const LayoutBoxModelObje
ct& paintInvalidationContainer, PaintInvalidationReason); | 1611 void invalidatePaintOfPreviousPaintInvalidationRect(const LayoutBoxModelObje
ct& paintInvalidationContainer, PaintInvalidationReason); |
1640 | 1612 |
1641 LayoutRect previousSelectionRectForPaintInvalidation() const; | |
1642 void setPreviousSelectionRectForPaintInvalidation(const LayoutRect&); | |
1643 | |
1644 LayoutObject* containerForAbsolutePosition(const LayoutBoxModelObject* ances
tor = nullptr, bool* ancestorSkipped = nullptr, bool* filterOrReflectionSkipped
= nullptr) const; | 1613 LayoutObject* containerForAbsolutePosition(const LayoutBoxModelObject* ances
tor = nullptr, bool* ancestorSkipped = nullptr, bool* filterOrReflectionSkipped
= nullptr) const; |
1645 | 1614 |
1646 const LayoutBoxModelObject* enclosingCompositedContainer() const; | 1615 const LayoutBoxModelObject* enclosingCompositedContainer() const; |
1647 | 1616 |
1648 LayoutFlowThread* locateFlowThreadContainingBlock() const; | 1617 LayoutFlowThread* locateFlowThreadContainingBlock() const; |
1649 void removeFromLayoutFlowThreadRecursive(LayoutFlowThread*); | 1618 void removeFromLayoutFlowThreadRecursive(LayoutFlowThread*); |
1650 | 1619 |
1651 ComputedStyle* cachedFirstLineStyle() const; | 1620 ComputedStyle* cachedFirstLineStyle() const; |
1652 StyleDifference adjustStyleDifference(StyleDifference) const; | 1621 StyleDifference adjustStyleDifference(StyleDifference) const; |
1653 | 1622 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1750 , m_everHadLayout(false) | 1719 , m_everHadLayout(false) |
1751 , m_ancestorLineBoxDirty(false) | 1720 , m_ancestorLineBoxDirty(false) |
1752 , m_hasPendingResourceUpdate(false) | 1721 , m_hasPendingResourceUpdate(false) |
1753 , m_isInsideFlowThread(false) | 1722 , m_isInsideFlowThread(false) |
1754 , m_subtreeChangeListenerRegistered(false) | 1723 , m_subtreeChangeListenerRegistered(false) |
1755 , m_notifiedOfSubtreeChange(false) | 1724 , m_notifiedOfSubtreeChange(false) |
1756 , m_consumesSubtreeChangeNotification(false) | 1725 , m_consumesSubtreeChangeNotification(false) |
1757 , m_childrenInline(false) | 1726 , m_childrenInline(false) |
1758 , m_containsInlineWithOutlineAndContinuation(false) | 1727 , m_containsInlineWithOutlineAndContinuation(false) |
1759 , m_alwaysCreateLineBoxesForLayoutInline(false) | 1728 , m_alwaysCreateLineBoxesForLayoutInline(false) |
1760 , m_lastBoxDecorationBackgroundObscured(false) | 1729 , m_previousBoxDecorationBackgroundObscured(false) |
1761 , m_isBackgroundAttachmentFixedObject(false) | 1730 , m_isBackgroundAttachmentFixedObject(false) |
1762 , m_isScrollAnchorObject(false) | 1731 , m_isScrollAnchorObject(false) |
1763 , m_positionedState(IsStaticallyPositioned) | 1732 , m_positionedState(IsStaticallyPositioned) |
1764 , m_selectionState(SelectionNone) | 1733 , m_selectionState(SelectionNone) |
1765 , m_boxDecorationBackgroundState(NoBoxDecorationBackground) | 1734 , m_boxDecorationBackgroundState(NoBoxDecorationBackground) |
1766 , m_fullPaintInvalidationReason(PaintInvalidationNone) | 1735 , m_fullPaintInvalidationReason(PaintInvalidationNone) |
1767 { | 1736 { |
1768 } | 1737 } |
1769 | 1738 |
1770 // 32 bits have been used in the first word, and 16 in the second. | 1739 // 32 bits have been used in the first word, and 16 in the second. |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1885 // from LayoutBlock | 1854 // from LayoutBlock |
1886 ADD_BOOLEAN_BITFIELD(childrenInline, ChildrenInline); | 1855 ADD_BOOLEAN_BITFIELD(childrenInline, ChildrenInline); |
1887 | 1856 |
1888 // from LayoutBlockFlow | 1857 // from LayoutBlockFlow |
1889 ADD_BOOLEAN_BITFIELD(containsInlineWithOutlineAndContinuation, ContainsI
nlineWithOutlineAndContinuation); | 1858 ADD_BOOLEAN_BITFIELD(containsInlineWithOutlineAndContinuation, ContainsI
nlineWithOutlineAndContinuation); |
1890 | 1859 |
1891 // from LayoutInline | 1860 // from LayoutInline |
1892 ADD_BOOLEAN_BITFIELD(alwaysCreateLineBoxesForLayoutInline, AlwaysCreateL
ineBoxesForLayoutInline); | 1861 ADD_BOOLEAN_BITFIELD(alwaysCreateLineBoxesForLayoutInline, AlwaysCreateL
ineBoxesForLayoutInline); |
1893 | 1862 |
1894 // For slimming-paint. | 1863 // For slimming-paint. |
1895 ADD_BOOLEAN_BITFIELD(lastBoxDecorationBackgroundObscured, LastBoxDecorat
ionBackgroundObscured); | 1864 ADD_BOOLEAN_BITFIELD(previousBoxDecorationBackgroundObscured, PreviousBo
xDecorationBackgroundObscured); |
1896 | 1865 |
1897 ADD_BOOLEAN_BITFIELD(isBackgroundAttachmentFixedObject, IsBackgroundAtta
chmentFixedObject); | 1866 ADD_BOOLEAN_BITFIELD(isBackgroundAttachmentFixedObject, IsBackgroundAtta
chmentFixedObject); |
1898 ADD_BOOLEAN_BITFIELD(isScrollAnchorObject, IsScrollAnchorObject); | 1867 ADD_BOOLEAN_BITFIELD(isScrollAnchorObject, IsScrollAnchorObject); |
1899 | 1868 |
1900 private: | 1869 private: |
1901 // This is the cached 'position' value of this object | 1870 // This is the cached 'position' value of this object |
1902 // (see ComputedStyle::position). | 1871 // (see ComputedStyle::position). |
1903 unsigned m_positionedState : 2; // PositionedState | 1872 unsigned m_positionedState : 2; // PositionedState |
1904 unsigned m_selectionState : 3; // SelectionState | 1873 unsigned m_selectionState : 3; // SelectionState |
1905 // Mutable for getter which lazily update this field. | 1874 // Mutable for getter which lazily update this field. |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2181 void showTree(const blink::LayoutObject*); | 2150 void showTree(const blink::LayoutObject*); |
2182 void showLineTree(const blink::LayoutObject*); | 2151 void showLineTree(const blink::LayoutObject*); |
2183 void showLayoutTree(const blink::LayoutObject* object1); | 2152 void showLayoutTree(const blink::LayoutObject* object1); |
2184 // We don't make object2 an optional parameter so that showLayoutTree | 2153 // We don't make object2 an optional parameter so that showLayoutTree |
2185 // can be called from gdb easily. | 2154 // can be called from gdb easily. |
2186 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec
t* object2); | 2155 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec
t* object2); |
2187 | 2156 |
2188 #endif | 2157 #endif |
2189 | 2158 |
2190 #endif // LayoutObject_h | 2159 #endif // LayoutObject_h |
OLD | NEW |