OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NGBlockBreakToken_h |
| 6 #define NGBlockBreakToken_h |
| 7 |
| 8 #include "core/layout/ng/ng_break_token.h" |
| 9 #include "platform/LayoutUnit.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 class NGBlockNode; |
| 14 |
| 15 class NGBlockBreakToken : public NGBreakToken { |
| 16 public: |
| 17 NGBlockBreakToken(NGBlockNode* node, LayoutUnit break_offset) |
| 18 : NGBreakToken(kBlockBreakToken), |
| 19 node_(node), |
| 20 break_offset_(break_offset) {} |
| 21 |
| 22 NGBlockNode& InputNode() const { return *node_.get(); } |
| 23 LayoutUnit BreakOffset() const { return break_offset_; } |
| 24 |
| 25 DEFINE_INLINE_VIRTUAL_TRACE() { |
| 26 NGBreakToken::trace(visitor); |
| 27 visitor->trace(node_); |
| 28 } |
| 29 |
| 30 private: |
| 31 Member<NGBlockNode> node_; |
| 32 LayoutUnit break_offset_; |
| 33 }; |
| 34 |
| 35 DEFINE_TYPE_CASTS(NGBlockBreakToken, |
| 36 NGBreakToken, |
| 37 token, |
| 38 token->Type() == NGBreakToken::kBlockBreakToken, |
| 39 token.Type() == NGBreakToken::kBlockBreakToken); |
| 40 |
| 41 } // namespace blink |
| 42 |
| 43 #endif // NGBlockBreakToken_h |
OLD | NEW |