Commit 1fe30363 authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Moved SVG check for ::first-letter to CanGeneratePseudoElement.

Was currently just checked when trying to create the pseudo element.
This change should have no effect, but is done in preparation for [1].

[1] https://chromium-review.googlesource.com/c/chromium/src/+/1155591

Bug: 847218
Change-Id: I99fa06bed1256cb6405e6f24a5f116def366acf9
Reviewed-on: https://chromium-review.googlesource.com/1156389Reviewed-by: default avatarHayato Ito <hayato@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579376}
parent 453728e1
...@@ -4009,8 +4009,6 @@ PseudoElement* Element::CreatePseudoElementIfNeeded(PseudoId pseudo_id) { ...@@ -4009,8 +4009,6 @@ PseudoElement* Element::CreatePseudoElementIfNeeded(PseudoId pseudo_id) {
if (!CanGeneratePseudoElement(pseudo_id)) if (!CanGeneratePseudoElement(pseudo_id))
return nullptr; return nullptr;
if (pseudo_id == kPseudoIdFirstLetter) { if (pseudo_id == kPseudoIdFirstLetter) {
if (IsSVGElement())
return nullptr;
if (!FirstLetterPseudoElement::FirstLetterTextLayoutObject(*this)) if (!FirstLetterPseudoElement::FirstLetterTextLayoutObject(*this))
return nullptr; return nullptr;
} }
...@@ -4128,6 +4126,8 @@ scoped_refptr<ComputedStyle> Element::StyleForPseudoElement( ...@@ -4128,6 +4126,8 @@ scoped_refptr<ComputedStyle> Element::StyleForPseudoElement(
bool Element::CanGeneratePseudoElement(PseudoId pseudo_id) const { bool Element::CanGeneratePseudoElement(PseudoId pseudo_id) const {
if (pseudo_id == kPseudoIdBackdrop && !IsInTopLayer()) if (pseudo_id == kPseudoIdBackdrop && !IsInTopLayer())
return false; return false;
if (pseudo_id == kPseudoIdFirstLetter && IsSVGElement())
return false;
if (const ComputedStyle* style = GetComputedStyle()) if (const ComputedStyle* style = GetComputedStyle())
return style->CanGeneratePseudoElement(pseudo_id); return style->CanGeneratePseudoElement(pseudo_id);
return false; return false;
......
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