Commit 2389662b authored by shend's avatar shend Committed by Commit bot

Make ComputedStyle::InheritFrom group independent.

In ComputedStyle::InheritFrom, we assume that the UserModify() field is
always stored in RareInheritedData. After we generate the user-modify
property, we might want to change where it is stored, so UserModify may
no longer be in RareInheritedData. This patch rearranges the logic in
the function so that UserModify can be stored in any subgroup without
breaking the code. There are no changes in behaviour.

BUG=628043

Review-Url: https://codereview.chromium.org/2829773003
Cr-Commit-Position: refs/heads/master@{#471095}
parent 2a03a774
......@@ -311,19 +311,19 @@ ContentDistributionType ComputedStyle::ResolvedAlignContentDistribution(
void ComputedStyle::InheritFrom(const ComputedStyle& inherit_parent,
IsAtShadowBoundary is_at_shadow_boundary) {
EUserModify current_user_modify = UserModify();
ComputedStyleBase::InheritFrom(inherit_parent, is_at_shadow_boundary);
rare_inherited_data_ = inherit_parent.rare_inherited_data_;
inherited_data_ = inherit_parent.inherited_data_;
if (svg_style_ != inherit_parent.svg_style_)
svg_style_.Access()->InheritFrom(inherit_parent.svg_style_.Get());
if (is_at_shadow_boundary == kAtShadowBoundary) {
// Even if surrounding content is user-editable, shadow DOM should act as a
// single unit, and not necessarily be editable
EUserModify current_user_modify = UserModify();
rare_inherited_data_ = inherit_parent.rare_inherited_data_;
SetUserModify(current_user_modify);
} else {
rare_inherited_data_ = inherit_parent.rare_inherited_data_;
}
inherited_data_ = inherit_parent.inherited_data_;
if (svg_style_ != inherit_parent.svg_style_)
svg_style_.Access()->InheritFrom(inherit_parent.svg_style_.Get());
}
void ComputedStyle::CopyNonInheritedFromCached(const ComputedStyle& other) {
......
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