Bug 1361478 - Add a ctor for FrameTextTraversal that initializes all members. r=jfkthame

MozReview-Commit-ID: 9XdG2up2yTi
This commit is contained in:
Mats Palmgren 2017-05-03 22:19:14 +02:00
Родитель 7760981e45
Коммит 43e71f49d2
1 изменённых файлов: 10 добавлений и 9 удалений

Просмотреть файл

@ -1207,7 +1207,16 @@ TextContainsLineBreakerWhiteSpace(const void* aText, uint32_t aLength,
}
}
struct FrameTextTraversal {
struct FrameTextTraversal
{
FrameTextTraversal()
: mFrameToScan(nullptr)
, mOverflowFrameToScan(nullptr)
, mScanSiblings(false)
, mLineBreakerCanCrossFrameBoundary(false)
, mTextRunCanCrossFrameBoundary(false)
{}
// These fields identify which frames should be recursively scanned
// The first normal frame to scan (or null, if no such frame should be scanned)
nsIFrame* mFrameToScan;
@ -1246,7 +1255,6 @@ CanTextCrossFrameBoundary(nsIFrame* aFrame)
// placeholders are "invisible", so a text run should be able to span
// across one. But don't descend into the out-of-flow.
result.mLineBreakerCanCrossFrameBoundary = true;
result.mOverflowFrameToScan = nullptr;
if (continuesTextRun) {
// ... Except for first-letter floats, which are really in-flow
// from the point of view of capitalization etc, so we'd better
@ -1255,10 +1263,7 @@ CanTextCrossFrameBoundary(nsIFrame* aFrame)
// ligature across the float boundary.
result.mFrameToScan =
(static_cast<nsPlaceholderFrame*>(aFrame))->GetOutOfFlowFrame();
result.mScanSiblings = false;
result.mTextRunCanCrossFrameBoundary = false;
} else {
result.mFrameToScan = nullptr;
result.mTextRunCanCrossFrameBoundary = true;
}
} else {
@ -1275,10 +1280,6 @@ CanTextCrossFrameBoundary(nsIFrame* aFrame)
} else {
MOZ_ASSERT(!aFrame->IsRubyTextContainerFrame(),
"Shouldn't call this method for ruby text container");
result.mFrameToScan = nullptr;
result.mOverflowFrameToScan = nullptr;
result.mTextRunCanCrossFrameBoundary = false;
result.mLineBreakerCanCrossFrameBoundary = false;
}
}
return result;