Bug 1322570 Part 3 - Get StyleContext from parent frame in nsFlexContainerFrame::Init(). r=dholbert

In stylo, nsStyleContext::GetParent() is not valid.

MozReview-Commit-ID: 5FbgUwobG3U

--HG--
extra : rebase_source : 47910f056eaf59af4e68276dd8e48b2a86634874
This commit is contained in:
Ting-Yu Lin 2017-03-20 14:12:28 +08:00
Родитель 5696ee9603
Коммит 954acaddd0
1 изменённых файлов: 4 добавлений и 3 удалений

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

@ -2364,10 +2364,11 @@ nsFlexContainerFrame::Init(nsIContent* aContent,
bool isLegacyBox = IsDisplayValueLegacyBox(styleDisp);
// If this frame is for a scrollable element, then it will actually have
// "display:block", and its *parent* will have the real flex-flavored display
// value. So in that case, check the parent to find out if we're legacy.
// "display:block", and its *parent frame* will have the real
// flex-flavored display value. So in that case, check the parent frame to
// find out if we're legacy.
if (!isLegacyBox && styleDisp->mDisplay == mozilla::StyleDisplay::Block) {
nsStyleContext* parentStyleContext = mStyleContext->GetParent();
nsStyleContext* parentStyleContext = GetParent()->StyleContext();
NS_ASSERTION(parentStyleContext &&
(mStyleContext->GetPseudo() == nsCSSAnonBoxes::buttonContent ||
mStyleContext->GetPseudo() == nsCSSAnonBoxes::scrolledContent),