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. | 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. |
7 * All rights reserved. | 7 * All rights reserved. |
8 * Copyright (C) 2009 Google Inc. All rights reserved. | 8 * Copyright (C) 2009 Google Inc. All rights reserved. |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 1643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1654 | 1654 |
1655 // Called when the previous visual rect(s) is no longer valid. | 1655 // Called when the previous visual rect(s) is no longer valid. |
1656 virtual void ClearPreviousVisualRects(); | 1656 virtual void ClearPreviousVisualRects(); |
1657 | 1657 |
1658 const LayoutPoint& PaintOffset() const { return paint_offset_; } | 1658 const LayoutPoint& PaintOffset() const { return paint_offset_; } |
1659 | 1659 |
1660 PaintInvalidationReason FullPaintInvalidationReason() const { | 1660 PaintInvalidationReason FullPaintInvalidationReason() const { |
1661 return bitfields_.FullPaintInvalidationReason(); | 1661 return bitfields_.FullPaintInvalidationReason(); |
1662 } | 1662 } |
1663 bool ShouldDoFullPaintInvalidation() const { | 1663 bool ShouldDoFullPaintInvalidation() const { |
1664 return bitfields_.FullPaintInvalidationReason() != kPaintInvalidationNone; | 1664 return bitfields_.FullPaintInvalidationReason() != |
| 1665 PaintInvalidationReason::kNone; |
1665 } | 1666 } |
1666 void SetShouldDoFullPaintInvalidation( | 1667 void SetShouldDoFullPaintInvalidation( |
1667 PaintInvalidationReason = kPaintInvalidationFull); | 1668 PaintInvalidationReason = PaintInvalidationReason::kFull); |
1668 void SetShouldDoFullPaintInvalidationWithoutGeometryChange( | 1669 void SetShouldDoFullPaintInvalidationWithoutGeometryChange( |
1669 PaintInvalidationReason = kPaintInvalidationFull); | 1670 PaintInvalidationReason = PaintInvalidationReason::kFull); |
1670 void ClearShouldDoFullPaintInvalidation() { | 1671 void ClearShouldDoFullPaintInvalidation() { |
1671 bitfields_.SetFullPaintInvalidationReason(kPaintInvalidationNone); | 1672 bitfields_.SetFullPaintInvalidationReason(PaintInvalidationReason::kNone); |
1672 } | 1673 } |
1673 | 1674 |
1674 void ClearPaintInvalidationFlags(); | 1675 void ClearPaintInvalidationFlags(); |
1675 | 1676 |
1676 bool MayNeedPaintInvalidation() const { | 1677 bool MayNeedPaintInvalidation() const { |
1677 return bitfields_.MayNeedPaintInvalidation(); | 1678 return bitfields_.MayNeedPaintInvalidation(); |
1678 } | 1679 } |
1679 void SetMayNeedPaintInvalidation(); | 1680 void SetMayNeedPaintInvalidation(); |
1680 void SetMayNeedPaintInvalidationWithoutGeometryChange(); | 1681 void SetMayNeedPaintInvalidationWithoutGeometryChange(); |
1681 | 1682 |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2295 has_previous_selection_visual_rect_(false), | 2296 has_previous_selection_visual_rect_(false), |
2296 needs_paint_property_update_(true), | 2297 needs_paint_property_update_(true), |
2297 subtree_needs_paint_property_update_(true), | 2298 subtree_needs_paint_property_update_(true), |
2298 descendant_needs_paint_property_update_(true), | 2299 descendant_needs_paint_property_update_(true), |
2299 background_changed_since_last_paint_invalidation_(false), | 2300 background_changed_since_last_paint_invalidation_(false), |
2300 outline_may_be_affected_by_descendants_(false), | 2301 outline_may_be_affected_by_descendants_(false), |
2301 previous_outline_may_be_affected_by_descendants_(false), | 2302 previous_outline_may_be_affected_by_descendants_(false), |
2302 positioned_state_(kIsStaticallyPositioned), | 2303 positioned_state_(kIsStaticallyPositioned), |
2303 selection_state_(SelectionNone), | 2304 selection_state_(SelectionNone), |
2304 background_obscuration_state_(kBackgroundObscurationStatusInvalid), | 2305 background_obscuration_state_(kBackgroundObscurationStatusInvalid), |
2305 full_paint_invalidation_reason_(kPaintInvalidationNone) {} | 2306 full_paint_invalidation_reason_( |
| 2307 static_cast<unsigned>(PaintInvalidationReason::kNone)) {} |
2306 | 2308 |
2307 // Self needs layout means that this layout object is marked for a full | 2309 // Self needs layout means that this layout object is marked for a full |
2308 // layout. This is the default layout but it is expensive as it recomputes | 2310 // layout. This is the default layout but it is expensive as it recomputes |
2309 // everything. For CSS boxes, this includes the width (laying out the line | 2311 // everything. For CSS boxes, this includes the width (laying out the line |
2310 // boxes again), the margins (due to block collapsing margins), the | 2312 // boxes again), the margins (due to block collapsing margins), the |
2311 // positions, the height and the potential overflow. | 2313 // positions, the height and the potential overflow. |
2312 ADD_BOOLEAN_BITFIELD(self_needs_layout_, SelfNeedsLayout); | 2314 ADD_BOOLEAN_BITFIELD(self_needs_layout_, SelfNeedsLayout); |
2313 | 2315 |
2314 // A positioned movement layout is a specialized type of layout used on | 2316 // A positioned movement layout is a specialized type of layout used on |
2315 // positioned objects that only visually moved. This layout is used when | 2317 // positioned objects that only visually moved. This layout is used when |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2502 unsigned unused_bits_ : 4; | 2504 unsigned unused_bits_ : 4; |
2503 | 2505 |
2504 private: | 2506 private: |
2505 // This is the cached 'position' value of this object | 2507 // This is the cached 'position' value of this object |
2506 // (see ComputedStyle::position). | 2508 // (see ComputedStyle::position). |
2507 unsigned positioned_state_ : 2; // PositionedState | 2509 unsigned positioned_state_ : 2; // PositionedState |
2508 unsigned selection_state_ : 3; // SelectionState | 2510 unsigned selection_state_ : 3; // SelectionState |
2509 // Mutable for getter which lazily update this field. | 2511 // Mutable for getter which lazily update this field. |
2510 mutable unsigned | 2512 mutable unsigned |
2511 background_obscuration_state_ : 2; // BackgroundObscurationState | 2513 background_obscuration_state_ : 2; // BackgroundObscurationState |
| 2514 |
2512 unsigned full_paint_invalidation_reason_ : 5; // PaintInvalidationReason | 2515 unsigned full_paint_invalidation_reason_ : 5; // PaintInvalidationReason |
| 2516 static_assert(static_cast<unsigned>(PaintInvalidationReason::kMax) < |
| 2517 (1u << 5), |
| 2518 "PaintInvalidationReason should fit in the bit field"); |
2513 | 2519 |
2514 public: | 2520 public: |
2515 bool IsOutOfFlowPositioned() const { | 2521 bool IsOutOfFlowPositioned() const { |
2516 return positioned_state_ == kIsOutOfFlowPositioned; | 2522 return positioned_state_ == kIsOutOfFlowPositioned; |
2517 } | 2523 } |
2518 bool IsRelPositioned() const { | 2524 bool IsRelPositioned() const { |
2519 return positioned_state_ == kIsRelativelyPositioned; | 2525 return positioned_state_ == kIsRelativelyPositioned; |
2520 } | 2526 } |
2521 bool IsStickyPositioned() const { | 2527 bool IsStickyPositioned() const { |
2522 return positioned_state_ == kIsStickyPositioned; | 2528 return positioned_state_ == kIsStickyPositioned; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2570 ALWAYS_INLINE void SetBackgroundObscurationState( | 2576 ALWAYS_INLINE void SetBackgroundObscurationState( |
2571 BackgroundObscurationState s) const { | 2577 BackgroundObscurationState s) const { |
2572 background_obscuration_state_ = s; | 2578 background_obscuration_state_ = s; |
2573 } | 2579 } |
2574 | 2580 |
2575 PaintInvalidationReason FullPaintInvalidationReason() const { | 2581 PaintInvalidationReason FullPaintInvalidationReason() const { |
2576 return static_cast<PaintInvalidationReason>( | 2582 return static_cast<PaintInvalidationReason>( |
2577 full_paint_invalidation_reason_); | 2583 full_paint_invalidation_reason_); |
2578 } | 2584 } |
2579 void SetFullPaintInvalidationReason(PaintInvalidationReason reason) { | 2585 void SetFullPaintInvalidationReason(PaintInvalidationReason reason) { |
2580 full_paint_invalidation_reason_ = reason; | 2586 full_paint_invalidation_reason_ = static_cast<unsigned>(reason); |
2581 } | 2587 } |
2582 }; | 2588 }; |
2583 | 2589 |
2584 #undef ADD_BOOLEAN_BITFIELD | 2590 #undef ADD_BOOLEAN_BITFIELD |
2585 | 2591 |
2586 LayoutObjectBitfields bitfields_; | 2592 LayoutObjectBitfields bitfields_; |
2587 | 2593 |
2588 void SetSelfNeedsLayout(bool b) { bitfields_.SetSelfNeedsLayout(b); } | 2594 void SetSelfNeedsLayout(bool b) { bitfields_.SetSelfNeedsLayout(b); } |
2589 void SetNeedsPositionedMovementLayout(bool b) { | 2595 void SetNeedsPositionedMovementLayout(bool b) { |
2590 bitfields_.SetNeedsPositionedMovementLayout(b); | 2596 bitfields_.SetNeedsPositionedMovementLayout(b); |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2829 CORE_EXPORT void showLineTree(const blink::LayoutObject*); | 2835 CORE_EXPORT void showLineTree(const blink::LayoutObject*); |
2830 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1); | 2836 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1); |
2831 // We don't make object2 an optional parameter so that showLayoutTree | 2837 // We don't make object2 an optional parameter so that showLayoutTree |
2832 // can be called from gdb easily. | 2838 // can be called from gdb easily. |
2833 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1, | 2839 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1, |
2834 const blink::LayoutObject* object2); | 2840 const blink::LayoutObject* object2); |
2835 | 2841 |
2836 #endif | 2842 #endif |
2837 | 2843 |
2838 #endif // LayoutObject_h | 2844 #endif // LayoutObject_h |
OLD | NEW |