Commit 92111146 authored by Oriol Brufau's avatar Oriol Brufau Committed by Commit Bot

[css-pseudo] Don't propagate style to children of normal markers

In r720875 I changed the pseudo type of the style used for markers with
'content: normal' from kPseudoIdNone to kPseudoIdMarker. This had the
side effect that they started to propagate style to its children,
producing a 90.6%-99.9% performance regression in the
flexbox_with_list_item test.

This patch prevents that style propagationg for normal markers, fixing
the perf regression. Markers with 'content' different than 'normal' are
still propagated since it's necessary in that case.

Bug: 1030884, 457718
Change-Id: Ia8341b605366ebdfd117cf569d030b38862348dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1953723Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Oriol Brufau <obrufau@igalia.com>
Cr-Commit-Position: refs/heads/master@{#722421}
parent 2f83652e
...@@ -2489,7 +2489,13 @@ void LayoutObject::PropagateStyleToAnonymousChildren() { ...@@ -2489,7 +2489,13 @@ void LayoutObject::PropagateStyleToAnonymousChildren() {
child->SetStyle(std::move(new_style)); child->SetStyle(std::move(new_style));
} }
if (StyleRef().StyleType() == kPseudoIdNone) PseudoId pseudo_id = StyleRef().StyleType();
if (pseudo_id == kPseudoIdNone)
return;
// Don't propagate style from markers with 'content: normal' because it's not
// needed and it would be slow.
if (pseudo_id == kPseudoIdMarker && !StyleRef().GetContentData())
return; return;
// Propagate style from pseudo elements to generated content. We skip children // Propagate style from pseudo elements to generated content. We skip children
......
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