Commit 90057f85 authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

[Squad] Split out method for inline box style for pseudo elements.

We create an unobservable inline box for display:contents pseudo
elements storing the original style on the element. Split this code out
into a separate method as we will need it for constructing pseudo
elements as part of style recalc later.

Bug: 836126
Change-Id: I8610ea5cd92ebbefd0428f84ca2ff4e48169b232
Reviewed-on: https://chromium-review.googlesource.com/1109827Reviewed-by: default avatarAnders Ruud <andruud@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569264}
parent b17cf903
......@@ -109,6 +109,11 @@ scoped_refptr<ComputedStyle> PseudoElement::CustomStyleForLayoutObject() {
if (!original_style || original_style->Display() != EDisplay::kContents)
return original_style;
return StoreOriginalAndReturnLayoutStyle(std::move(original_style));
}
scoped_refptr<ComputedStyle> PseudoElement::StoreOriginalAndReturnLayoutStyle(
scoped_refptr<ComputedStyle> original_style) {
// For display:contents we should not generate a box, but we generate a non-
// observable inline box for pseudo elements to be able to locate the
// anonymous layout objects for generated content during DetachLayoutTree().
......@@ -120,7 +125,7 @@ scoped_refptr<ComputedStyle> PseudoElement::CustomStyleForLayoutObject() {
// Store the actual ComputedStyle to be able to return the correct values from
// getComputedStyle().
StoreNonLayoutObjectComputedStyle(original_style);
StoreNonLayoutObjectComputedStyle(std::move(original_style));
return layout_style;
}
......
......@@ -47,6 +47,8 @@ class CORE_EXPORT PseudoElement : public Element {
PseudoId GetPseudoId() const override { return pseudo_id_; }
const ComputedStyle* VirtualEnsureComputedStyle(
PseudoId pseudo_element_specifier = kPseudoIdNone) final;
scoped_refptr<ComputedStyle> StoreOriginalAndReturnLayoutStyle(
scoped_refptr<ComputedStyle>);
static String PseudoElementNameForEvents(PseudoId);
......
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