Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/ng_fragment_base.cc

Issue 2270983002: [layoutng] Add an NGFragmentBuilder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove SwapChildren Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "core/layout/ng/ng_fragment_base.h" 5 #include "core/layout/ng/ng_fragment_base.h"
6 #include "core/layout/ng/ng_fragment.h" 6 #include "core/layout/ng/ng_fragment.h"
7 #include "core/layout/ng/ng_text_fragment.h" 7 #include "core/layout/ng/ng_text_fragment.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
11 NGFragmentBase::NGFragmentBase(LayoutUnit inlineSize, 11 NGFragmentBase::NGFragmentBase(NGLogicalSize size,
12 LayoutUnit blockSize, 12 NGLogicalSize overflow,
13 LayoutUnit inlineOverflow, 13 NGWritingMode writing_mode,
14 LayoutUnit blockOverflow,
15 NGWritingMode writingMode,
16 NGDirection direction, 14 NGDirection direction,
17 NGFragmentType type) 15 NGFragmentType type)
18 : m_inlineSize(inlineSize), 16 : size_(size),
19 m_blockSize(blockSize), 17 overflow_(overflow),
20 m_inlineOverflow(inlineOverflow), 18 type_(type),
21 m_blockOverflow(blockOverflow), 19 writing_mode_(writing_mode),
22 m_type(type), 20 direction_(direction),
23 m_writingMode(writingMode), 21 has_been_placed_(false) {}
24 m_direction(direction),
25 m_hasBeenPlaced(false) {}
26 22
27 void NGFragmentBase::setOffset(LayoutUnit inlineOffset, 23 void NGFragmentBase::SetOffset(LayoutUnit inline_offset,
28 LayoutUnit blockOffset) { 24 LayoutUnit block_offset) {
29 // setOffset should only be called once. 25 // setOffset should only be called once.
30 DCHECK(!m_hasBeenPlaced); 26 DCHECK(!has_been_placed_);
31 m_inlineOffset = inlineOffset; 27 offset_.inlineOffset = inline_offset;
32 m_blockOffset = blockOffset; 28 offset_.blockOffset = block_offset;
33 m_hasBeenPlaced = true; 29 has_been_placed_ = true;
34 } 30 }
35 31
36 DEFINE_TRACE(NGFragmentBase) { 32 DEFINE_TRACE(NGFragmentBase) {
37 if (type() == FragmentText) 33 if (Type() == FragmentText)
38 static_cast<NGTextFragment*>(this)->traceAfterDispatch(visitor); 34 static_cast<NGTextFragment*>(this)->traceAfterDispatch(visitor);
39 else 35 else
40 static_cast<NGFragment*>(this)->traceAfterDispatch(visitor); 36 static_cast<NGFragment*>(this)->traceAfterDispatch(visitor);
41 } 37 }
42 38
43 } // namespace blink 39 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698