| OLD | NEW |
| 1 | 1 |
| 2 // Copyright 2016 The Chromium Authors. All rights reserved. | 2 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 | 5 |
| 6 #ifndef LayoutBlockItem_h | 6 #ifndef LayoutBlockItem_h |
| 7 #define LayoutBlockItem_h | 7 #define LayoutBlockItem_h |
| 8 | 8 |
| 9 #include "core/layout/LayoutBlock.h" | 9 #include "core/layout/LayoutBlock.h" |
| 10 #include "core/layout/api/LayoutBoxItem.h" | 10 #include "core/layout/api/LayoutBoxItem.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class LayoutBlockItem : public LayoutBoxItem { | 14 class LayoutBlockItem : public LayoutBoxItem { |
| 15 public: | 15 public: |
| 16 explicit LayoutBlockItem(LayoutBlock* layoutBlock) | 16 explicit LayoutBlockItem(LayoutBlock* layoutBlock) |
| 17 : LayoutBoxItem(layoutBlock) {} | 17 : LayoutBoxItem(layoutBlock) {} |
| 18 | 18 |
| 19 explicit LayoutBlockItem(const LayoutBoxItem& item) : LayoutBoxItem(item) { | 19 explicit LayoutBlockItem(const LayoutBoxItem& item) : LayoutBoxItem(item) { |
| 20 ASSERT_WITH_SECURITY_IMPLICATION(!item || item.isLayoutBlock()); | 20 SECURITY_DCHECK(!item || item.isLayoutBlock()); |
| 21 } | 21 } |
| 22 | 22 |
| 23 explicit LayoutBlockItem(std::nullptr_t) : LayoutBoxItem(nullptr) {} | 23 explicit LayoutBlockItem(std::nullptr_t) : LayoutBoxItem(nullptr) {} |
| 24 | 24 |
| 25 LayoutBlockItem() {} | 25 LayoutBlockItem() {} |
| 26 | 26 |
| 27 bool recalcOverflowAfterStyleChange() { | 27 bool recalcOverflowAfterStyleChange() { |
| 28 return toBlock()->recalcOverflowAfterStyleChange(); | 28 return toBlock()->recalcOverflowAfterStyleChange(); |
| 29 } | 29 } |
| 30 | 30 |
| 31 LayoutItem firstChild() const { return LayoutItem(toBlock()->firstChild()); } | 31 LayoutItem firstChild() const { return LayoutItem(toBlock()->firstChild()); } |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 LayoutBlock* toBlock() { return toLayoutBlock(layoutObject()); } | 34 LayoutBlock* toBlock() { return toLayoutBlock(layoutObject()); } |
| 35 const LayoutBlock* toBlock() const { return toLayoutBlock(layoutObject()); } | 35 const LayoutBlock* toBlock() const { return toLayoutBlock(layoutObject()); } |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 } // namespace blink | 38 } // namespace blink |
| 39 | 39 |
| 40 #endif // LayoutBlockItem_h | 40 #endif // LayoutBlockItem_h |
| OLD | NEW |