Commit 178ff08f authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

Fix crash in LayoutObject::FirstLineStyleWithoutFallback()

Bug: 1025907
Change-Id: I7849f4decfd800f1608a231c1ae038b4ec56e90f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2136882Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757097}
parent 757fa1cc
...@@ -3540,9 +3540,12 @@ const ComputedStyle* LayoutObject::FirstLineStyleWithoutFallback() const { ...@@ -3540,9 +3540,12 @@ const ComputedStyle* LayoutObject::FirstLineStyleWithoutFallback() const {
// it's based on first_line_block's style. We need to get the uncached // it's based on first_line_block's style. We need to get the uncached
// first line style based on this object's style and cache the result in // first line style based on this object's style and cache the result in
// it. // it.
return StyleRef().AddCachedPseudoElementStyle( if (scoped_refptr<ComputedStyle> first_line_style =
first_line_block->GetUncachedPseudoElementStyle( first_line_block->GetUncachedPseudoElementStyle(
PseudoElementStyleRequest(kPseudoIdFirstLine), Style())); PseudoElementStyleRequest(kPseudoIdFirstLine), Style())) {
return StyleRef().AddCachedPseudoElementStyle(
std::move(first_line_style));
}
} }
} else if (!IsAnonymous() && IsLayoutInline() && } else if (!IsAnonymous() && IsLayoutInline() &&
!GetNode()->IsFirstLetterPseudoElement()) { !GetNode()->IsFirstLetterPseudoElement()) {
...@@ -3554,9 +3557,12 @@ const ComputedStyle* LayoutObject::FirstLineStyleWithoutFallback() const { ...@@ -3554,9 +3557,12 @@ const ComputedStyle* LayoutObject::FirstLineStyleWithoutFallback() const {
Parent()->FirstLineStyleWithoutFallback()) { Parent()->FirstLineStyleWithoutFallback()) {
// A first-line style is in effect. Get uncached first line style based on // A first-line style is in effect. Get uncached first line style based on
// parent_first_line_style and cache the result in this object's style. // parent_first_line_style and cache the result in this object's style.
return StyleRef().AddCachedPseudoElementStyle( if (scoped_refptr<ComputedStyle> first_line_style =
GetUncachedPseudoElementStyle(kPseudoIdFirstLineInherited, GetUncachedPseudoElementStyle(kPseudoIdFirstLineInherited,
parent_first_line_style)); parent_first_line_style)) {
return StyleRef().AddCachedPseudoElementStyle(
std::move(first_line_style));
}
} }
} }
return nullptr; return nullptr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment