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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 { | 434 { |
435 ASSERT(isLayoutInline()); | 435 ASSERT(isLayoutInline()); |
436 m_bitfields.setAlwaysCreateLineBoxesForLayoutInline(alwaysCreateLineBoxe
s); | 436 m_bitfields.setAlwaysCreateLineBoxesForLayoutInline(alwaysCreateLineBoxe
s); |
437 } | 437 } |
438 | 438 |
439 bool ancestorLineBoxDirty() const { return m_bitfields.ancestorLineBoxDirty(
); } | 439 bool ancestorLineBoxDirty() const { return m_bitfields.ancestorLineBoxDirty(
); } |
440 void setAncestorLineBoxDirty(bool value = true) | 440 void setAncestorLineBoxDirty(bool value = true) |
441 { | 441 { |
442 m_bitfields.setAncestorLineBoxDirty(value); | 442 m_bitfields.setAncestorLineBoxDirty(value); |
443 if (value) | 443 if (value) |
444 setNeedsLayoutAndFullPaintInvalidation(); | 444 setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReason::Lin
eBoxesChanged); |
445 } | 445 } |
446 | 446 |
447 enum FlowThreadState { | 447 enum FlowThreadState { |
448 NotInsideFlowThread = 0, | 448 NotInsideFlowThread = 0, |
449 InsideOutOfFlowThread = 1, | 449 InsideOutOfFlowThread = 1, |
450 InsideInFlowThread = 2, | 450 InsideInFlowThread = 2, |
451 }; | 451 }; |
452 | 452 |
453 void setFlowThreadStateIncludingDescendants(FlowThreadState); | 453 void setFlowThreadStateIncludingDescendants(FlowThreadState); |
454 | 454 |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 // If paintInvalidationContainer and paintInvalidationContainerSkipped are n
ot null, on return *paintInvalidationContainerSkipped | 653 // If paintInvalidationContainer and paintInvalidationContainerSkipped are n
ot null, on return *paintInvalidationContainerSkipped |
654 // is true if the renderer returned is an ancestor of paintInvalidationConta
iner. | 654 // is true if the renderer returned is an ancestor of paintInvalidationConta
iner. |
655 LayoutObject* container(const LayoutBoxModelObject* paintInvalidationContain
er = 0, bool* paintInvalidationContainerSkipped = 0) const; | 655 LayoutObject* container(const LayoutBoxModelObject* paintInvalidationContain
er = 0, bool* paintInvalidationContainerSkipped = 0) const; |
656 LayoutBlock* containerForFixedPosition(const LayoutBoxModelObject* paintInva
lidationContainer = 0, bool* paintInvalidationContainerSkipped = 0) const; | 656 LayoutBlock* containerForFixedPosition(const LayoutBoxModelObject* paintInva
lidationContainer = 0, bool* paintInvalidationContainerSkipped = 0) const; |
657 | 657 |
658 virtual LayoutObject* hoverAncestor() const { return parent(); } | 658 virtual LayoutObject* hoverAncestor() const { return parent(); } |
659 | 659 |
660 Element* offsetParent() const; | 660 Element* offsetParent() const; |
661 | 661 |
662 void markContainerChainForLayout(bool scheduleRelayout = true, LayoutObject*
newRoot = 0, SubtreeLayoutScope* = 0); | 662 void markContainerChainForLayout(bool scheduleRelayout = true, LayoutObject*
newRoot = 0, SubtreeLayoutScope* = 0); |
663 void setNeedsLayout(MarkingBehavior = MarkContainerChain, SubtreeLayoutScope
* = 0); | 663 void setNeedsLayout(LayoutInvalidationReasonForTracing, MarkingBehavior = Ma
rkContainerChain, SubtreeLayoutScope* = 0); |
664 void setNeedsLayoutAndFullPaintInvalidation(MarkingBehavior = MarkContainerC
hain, SubtreeLayoutScope* = 0); | 664 void setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidationReasonForTraci
ng, MarkingBehavior = MarkContainerChain, SubtreeLayoutScope* = 0); |
665 void clearNeedsLayout(); | 665 void clearNeedsLayout(); |
666 void setChildNeedsLayout(MarkingBehavior = MarkContainerChain, SubtreeLayout
Scope* = 0); | 666 void setChildNeedsLayout(MarkingBehavior = MarkContainerChain, SubtreeLayout
Scope* = 0); |
667 void setNeedsPositionedMovementLayout(); | 667 void setNeedsPositionedMovementLayout(); |
668 void setPreferredLogicalWidthsDirty(MarkingBehavior = MarkContainerChain); | 668 void setPreferredLogicalWidthsDirty(MarkingBehavior = MarkContainerChain); |
669 void clearPreferredLogicalWidthsDirty(); | 669 void clearPreferredLogicalWidthsDirty(); |
670 void invalidateContainerPreferredLogicalWidths(); | 670 void invalidateContainerPreferredLogicalWidths(); |
671 | 671 |
672 void setNeedsLayoutAndPrefWidthsRecalc() | 672 void setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReasonForTracing re
ason) |
673 { | 673 { |
674 setNeedsLayout(); | 674 setNeedsLayout(reason); |
675 setPreferredLogicalWidthsDirty(); | 675 setPreferredLogicalWidthsDirty(); |
676 } | 676 } |
677 void setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation() | 677 void setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalid
ationReasonForTracing reason) |
678 { | 678 { |
679 setNeedsLayoutAndFullPaintInvalidation(); | 679 setNeedsLayoutAndFullPaintInvalidation(reason); |
680 setPreferredLogicalWidthsDirty(); | 680 setPreferredLogicalWidthsDirty(); |
681 } | 681 } |
682 | 682 |
683 void setPositionState(EPosition position) | 683 void setPositionState(EPosition position) |
684 { | 684 { |
685 ASSERT((position != AbsolutePosition && position != FixedPosition) || is
Box()); | 685 ASSERT((position != AbsolutePosition && position != FixedPosition) || is
Box()); |
686 m_bitfields.setPositionedState(position); | 686 m_bitfields.setPositionedState(position); |
687 } | 687 } |
688 void clearPositionedState() { m_bitfields.clearPositionedState(); } | 688 void clearPositionedState() { m_bitfields.clearPositionedState(); } |
689 | 689 |
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1493 return true; | 1493 return true; |
1494 } | 1494 } |
1495 | 1495 |
1496 inline bool LayoutObject::isBeforeOrAfterContent() const | 1496 inline bool LayoutObject::isBeforeOrAfterContent() const |
1497 { | 1497 { |
1498 return isBeforeContent() || isAfterContent(); | 1498 return isBeforeContent() || isAfterContent(); |
1499 } | 1499 } |
1500 | 1500 |
1501 // setNeedsLayout() won't cause full paint invalidations as | 1501 // setNeedsLayout() won't cause full paint invalidations as |
1502 // setNeedsLayoutAndFullPaintInvalidation() does. Otherwise the two methods are
identical. | 1502 // setNeedsLayoutAndFullPaintInvalidation() does. Otherwise the two methods are
identical. |
1503 inline void LayoutObject::setNeedsLayout(MarkingBehavior markParents, SubtreeLay
outScope* layouter) | 1503 inline void LayoutObject::setNeedsLayout(LayoutInvalidationReasonForTracing reas
on, MarkingBehavior markParents, SubtreeLayoutScope* layouter) |
1504 { | 1504 { |
1505 TRACE_EVENT_INSTANT1( | |
1506 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidationTracking"), | |
1507 "LayoutInvalidationTracking", | |
1508 "data", | |
1509 InspectorLayoutInvalidationTrackingEvent::data(this)); | |
1510 ASSERT(!isSetNeedsLayoutForbidden()); | 1505 ASSERT(!isSetNeedsLayoutForbidden()); |
1511 bool alreadyNeededLayout = m_bitfields.selfNeedsLayout(); | 1506 bool alreadyNeededLayout = m_bitfields.selfNeedsLayout(); |
1512 setSelfNeedsLayout(true); | 1507 setSelfNeedsLayout(true); |
1513 if (!alreadyNeededLayout) { | 1508 if (!alreadyNeededLayout) { |
| 1509 TRACE_EVENT_INSTANT1( |
| 1510 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.invalidationTracking"), |
| 1511 "LayoutInvalidationTracking", |
| 1512 "data", |
| 1513 InspectorLayoutInvalidationTrackingEvent::data(this, reason)); |
1514 if (markParents == MarkContainerChain && (!layouter || layouter->root()
!= this)) | 1514 if (markParents == MarkContainerChain && (!layouter || layouter->root()
!= this)) |
1515 markContainerChainForLayout(true, 0, layouter); | 1515 markContainerChainForLayout(true, 0, layouter); |
1516 } | 1516 } |
1517 } | 1517 } |
1518 | 1518 |
1519 inline void LayoutObject::setNeedsLayoutAndFullPaintInvalidation(MarkingBehavior
markParents, SubtreeLayoutScope* layouter) | 1519 inline void LayoutObject::setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidat
ionReasonForTracing reason, MarkingBehavior markParents, SubtreeLayoutScope* lay
outer) |
1520 { | 1520 { |
1521 setNeedsLayout(markParents, layouter); | 1521 setNeedsLayout(reason, markParents, layouter); |
1522 setShouldDoFullPaintInvalidation(); | 1522 setShouldDoFullPaintInvalidation(); |
1523 } | 1523 } |
1524 | 1524 |
1525 inline void LayoutObject::clearNeedsLayout() | 1525 inline void LayoutObject::clearNeedsLayout() |
1526 { | 1526 { |
1527 setNeededLayoutBecauseOfChildren(needsLayoutBecauseOfChildren()); | 1527 setNeededLayoutBecauseOfChildren(needsLayoutBecauseOfChildren()); |
1528 setLayoutDidGetCalledSinceLastFrame(); | 1528 setLayoutDidGetCalledSinceLastFrame(); |
1529 setSelfNeedsLayout(false); | 1529 setSelfNeedsLayout(false); |
1530 setEverHadLayout(true); | 1530 setEverHadLayout(true); |
1531 setPosChildNeedsLayout(false); | 1531 setPosChildNeedsLayout(false); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1665 void showTree(const blink::LayoutObject*); | 1665 void showTree(const blink::LayoutObject*); |
1666 void showLineTree(const blink::LayoutObject*); | 1666 void showLineTree(const blink::LayoutObject*); |
1667 void showLayoutTree(const blink::LayoutObject* object1); | 1667 void showLayoutTree(const blink::LayoutObject* object1); |
1668 // We don't make object2 an optional parameter so that showLayoutTree | 1668 // We don't make object2 an optional parameter so that showLayoutTree |
1669 // can be called from gdb easily. | 1669 // can be called from gdb easily. |
1670 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec
t* object2); | 1670 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec
t* object2); |
1671 | 1671 |
1672 #endif | 1672 #endif |
1673 | 1673 |
1674 #endif // LayoutObject_h | 1674 #endif // LayoutObject_h |
OLD | NEW |