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

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

Issue 2230803005: [LayoutNG] Add writing-mode and direction to NGFragmentBase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase w/HEAD Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/ng/ng_fragment_base.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_fragment_base.cc b/third_party/WebKit/Source/core/layout/ng/ng_fragment_base.cc
index 7cd0be3a46ae16c4d55c4d5ecc5bb3028ee7bc11..223475ba247fcd40f403f4f2bdd65e11bfc54086 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_fragment_base.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_fragment_base.cc
@@ -11,20 +11,30 @@ namespace blink {
NGFragmentBase::NGFragmentBase(LayoutUnit inlineSize,
LayoutUnit blockSize,
LayoutUnit inlineOverflow,
- LayoutUnit blockOverflow)
+ LayoutUnit blockOverflow,
+ NGWritingMode writingMode,
+ NGDirection direction,
+ NGFragmentType type)
: m_inlineSize(inlineSize),
m_blockSize(blockSize),
m_inlineOverflow(inlineOverflow),
- m_blockOverflow(blockOverflow) {}
+ m_blockOverflow(blockOverflow),
+ m_type(type),
+ m_writingMode(writingMode),
+ m_direction(direction),
+ m_hasBeenPlaced(false) {}
void NGFragmentBase::setOffset(LayoutUnit inlineOffset,
LayoutUnit blockOffset) {
+ // setOffset should only be called once.
+ DCHECK(!m_hasBeenPlaced);
m_inlineOffset = inlineOffset;
m_blockOffset = blockOffset;
+ m_hasBeenPlaced = true;
}
DEFINE_TRACE(NGFragmentBase) {
- if (m_isText)
+ if (type() == FragmentText)
static_cast<NGText*>(this)->traceAfterDispatch(visitor);
else
static_cast<NGFragment*>(this)->traceAfterDispatch(visitor);
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_fragment_base.h ('k') | third_party/WebKit/Source/core/layout/ng/ng_text.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698