| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef LineLayoutBR_h | 5 #ifndef LineLayoutBR_h |
| 6 #define LineLayoutBR_h | 6 #define LineLayoutBR_h |
| 7 | 7 |
| 8 #include "core/layout/LayoutBR.h" | 8 #include "core/layout/LayoutBR.h" |
| 9 #include "core/layout/api/LineLayoutText.h" | 9 #include "core/layout/api/LineLayoutText.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class LineLayoutBR : public LineLayoutText { | 13 class LineLayoutBR : public LineLayoutText { |
| 14 public: | 14 public: |
| 15 explicit LineLayoutBR(LayoutBR* layoutBR) : LineLayoutText(layoutBR) {} | 15 explicit LineLayoutBR(LayoutBR* layoutBR) : LineLayoutText(layoutBR) {} |
| 16 | 16 |
| 17 explicit LineLayoutBR(const LineLayoutItem& item) : LineLayoutText(item) { | 17 explicit LineLayoutBR(const LineLayoutItem& item) : LineLayoutText(item) { |
| 18 ASSERT_WITH_SECURITY_IMPLICATION(!item || item.isBR()); | 18 SECURITY_DCHECK(!item || item.isBR()); |
| 19 } | 19 } |
| 20 | 20 |
| 21 explicit LineLayoutBR(std::nullptr_t) : LineLayoutText(nullptr) {} | 21 explicit LineLayoutBR(std::nullptr_t) : LineLayoutText(nullptr) {} |
| 22 | 22 |
| 23 LineLayoutBR() {} | 23 LineLayoutBR() {} |
| 24 | 24 |
| 25 int lineHeight(bool firstLine) const { return toBR()->lineHeight(firstLine); } | 25 int lineHeight(bool firstLine) const { return toBR()->lineHeight(firstLine); } |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 LayoutBR* toBR() { return toLayoutBR(layoutObject()); } | 28 LayoutBR* toBR() { return toLayoutBR(layoutObject()); } |
| 29 | 29 |
| 30 const LayoutBR* toBR() const { return toLayoutBR(layoutObject()); } | 30 const LayoutBR* toBR() const { return toLayoutBR(layoutObject()); } |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 } // namespace blink | 33 } // namespace blink |
| 34 | 34 |
| 35 #endif // LineLayoutBR_h | 35 #endif // LineLayoutBR_h |
| OLD | NEW |