mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 749186: Make the root frame always be an inflation container to prevent a crash during font inflation. [r=dbaron]
This commit is contained in:
parent
f80ce2f947
commit
77bfda7fb2
@ -4725,8 +4725,7 @@ nsLayoutUtils::FontSizeInflationInner(const nsIFrame *aFrame,
|
||||
nsIContent* content = f->GetContent();
|
||||
// Also, if there is more than one frame corresponding to a single
|
||||
// content node, we want the outermost one.
|
||||
if (!(f->GetParent() &&
|
||||
f->GetParent()->GetContent() == content) &&
|
||||
if (!(f->GetParent() && f->GetParent()->GetContent() == content) &&
|
||||
f->GetType() != nsGkAtoms::inlineFrame) {
|
||||
nsStyleCoord stylePosWidth = f->GetStylePosition()->mWidth;
|
||||
nsStyleCoord stylePosHeight = f->GetStylePosition()->mHeight;
|
||||
|
@ -463,6 +463,12 @@ IsFontSizeInflationContainer(nsIFrame* aFrame,
|
||||
* thing to count as a container, so we don't try, and blocks are
|
||||
* always containers.
|
||||
*/
|
||||
|
||||
// The root frame should always be an inflation container.
|
||||
if (!aFrame->GetParent()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
nsIContent *content = aFrame->GetContent();
|
||||
bool isInline = (aStyleDisplay->mDisplay == NS_STYLE_DISPLAY_INLINE ||
|
||||
(aStyleDisplay->IsFloating() &&
|
||||
@ -470,13 +476,11 @@ IsFontSizeInflationContainer(nsIFrame* aFrame,
|
||||
// Given multiple frames for the same node, only the
|
||||
// outer one should be considered a container.
|
||||
// (Important, e.g., for nsSelectsAreaFrame.)
|
||||
(aFrame->GetParent() &&
|
||||
aFrame->GetParent()->GetContent() == content) ||
|
||||
(aFrame->GetParent()->GetContent() == content) ||
|
||||
(content && (content->IsHTML(nsGkAtoms::option) ||
|
||||
content->IsHTML(nsGkAtoms::optgroup) ||
|
||||
content->IsInNativeAnonymousSubtree()))) &&
|
||||
!(aFrame->IsBoxFrame() && aFrame->GetParent() &&
|
||||
aFrame->GetParent()->IsBoxFrame());
|
||||
!(aFrame->IsBoxFrame() && aFrame->GetParent()->IsBoxFrame());
|
||||
NS_ASSERTION(!aFrame->IsFrameOfType(nsIFrame::eLineParticipant) ||
|
||||
isInline ||
|
||||
// br frames and mathml frames report being line
|
||||
|
Loading…
Reference in New Issue
Block a user