Commit c95b6ff6 authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Commit Bot

Opt out of anonymous style propagation for spanner placeholders.

LayoutObject::PropagateStyleToAnonymousChildren() doesn't do the right
thing for LayoutMultiColumnSpannerPlaceholder. Spanner placeholders need
to copy the margins from the actual spanner object, in addition to
inheriting properties from the parent of the actual spanner.

Bug: 903699
Change-Id: I4252c546610eca2698efd523f98f20a98627d217
Reviewed-on: https://chromium-review.googlesource.com/c/1328986
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607179}
parent 02410b53
...@@ -2889,7 +2889,6 @@ crbug.com/893480 external/wpt/infrastructure/testdriver/actions/multiDevice.html ...@@ -2889,7 +2889,6 @@ crbug.com/893480 external/wpt/infrastructure/testdriver/actions/multiDevice.html
# ====== New tests from wpt-importer added here ====== # ====== New tests from wpt-importer added here ======
crbug.com/626703 virtual/layout_ng_experimental/external/wpt/css/css-multicol/multicol-margin-003.html [ Failure ] crbug.com/626703 virtual/layout_ng_experimental/external/wpt/css/css-multicol/multicol-margin-003.html [ Failure ]
crbug.com/626703 external/wpt/css/css-multicol/multicol-margin-003.html [ Failure ] crbug.com/626703 external/wpt/css/css-multicol/multicol-margin-003.html [ Failure ]
crbug.com/626703 external/wpt/css/css-multicol/multicol-span-all-restyle-003.html [ Failure ]
crbug.com/626703 external/wpt/css/filter-effects/filter-grayscale-003.html [ Failure ] crbug.com/626703 external/wpt/css/filter-effects/filter-grayscale-003.html [ Failure ]
crbug.com/626703 external/wpt/css/filter-effects/filter-grayscale-002.html [ Failure ] crbug.com/626703 external/wpt/css/filter-effects/filter-grayscale-002.html [ Failure ]
crbug.com/626703 external/wpt/css/filter-effects/filter-external-002-test.html [ Failure ] crbug.com/626703 external/wpt/css/filter-effects/filter-external-002-test.html [ Failure ]
......
...@@ -27,11 +27,7 @@ LayoutMultiColumnSpannerPlaceholder::CreateAnonymous( ...@@ -27,11 +27,7 @@ LayoutMultiColumnSpannerPlaceholder::CreateAnonymous(
new LayoutMultiColumnSpannerPlaceholder(&layout_object_in_flow_thread); new LayoutMultiColumnSpannerPlaceholder(&layout_object_in_flow_thread);
Document& document = layout_object_in_flow_thread.GetDocument(); Document& document = layout_object_in_flow_thread.GetDocument();
new_spanner->SetDocumentForAnonymous(&document); new_spanner->SetDocumentForAnonymous(&document);
scoped_refptr<ComputedStyle> new_style = new_spanner->UpdateProperties(parent_style);
ComputedStyle::CreateAnonymousStyleWithDisplay(parent_style,
EDisplay::kBlock);
CopyMarginProperties(*new_style, layout_object_in_flow_thread.StyleRef());
new_spanner->SetStyle(new_style);
return new_spanner; return new_spanner;
} }
...@@ -60,13 +56,16 @@ void LayoutMultiColumnSpannerPlaceholder:: ...@@ -60,13 +56,16 @@ void LayoutMultiColumnSpannerPlaceholder::
} }
return; return;
} }
UpdateMarginProperties(); UpdateProperties(Parent()->StyleRef());
} }
void LayoutMultiColumnSpannerPlaceholder::UpdateMarginProperties() { void LayoutMultiColumnSpannerPlaceholder::UpdateProperties(
scoped_refptr<ComputedStyle> new_style = ComputedStyle::Clone(StyleRef()); const ComputedStyle& parent_style) {
scoped_refptr<ComputedStyle> new_style =
ComputedStyle::CreateAnonymousStyleWithDisplay(parent_style,
EDisplay::kBlock);
CopyMarginProperties(*new_style, layout_object_in_flow_thread_->StyleRef()); CopyMarginProperties(*new_style, layout_object_in_flow_thread_->StyleRef());
SetStyle(new_style); SetStyle(std::move(new_style));
} }
void LayoutMultiColumnSpannerPlaceholder::InsertedIntoTree() { void LayoutMultiColumnSpannerPlaceholder::InsertedIntoTree() {
......
...@@ -42,8 +42,10 @@ class LayoutMultiColumnSpannerPlaceholder final : public LayoutBox { ...@@ -42,8 +42,10 @@ class LayoutMultiColumnSpannerPlaceholder final : public LayoutBox {
SetChildNeedsLayout(kMarkOnlyThis); SetChildNeedsLayout(kMarkOnlyThis);
} }
bool AnonymousHasStylePropagationOverride() final { return true; }
void LayoutObjectInFlowThreadStyleDidChange(const ComputedStyle* old_style); void LayoutObjectInFlowThreadStyleDidChange(const ComputedStyle* old_style);
void UpdateMarginProperties(); void UpdateProperties(const ComputedStyle& parent_style);
const char* GetName() const override { const char* GetName() const override {
return "LayoutMultiColumnSpannerPlaceholder"; return "LayoutMultiColumnSpannerPlaceholder";
......
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