Skip to content
Permalink
Browse files
REGRESSION(r293956): Bad color inheritance due to disallowsFastPathIn…
…heritance bit missing from RenderStyle::copyNonInheritedFrom

https://bugs.webkit.org/show_bug.cgi?id=240770

Reviewed by Alan Bujtas.

Test: fast/css/color-inheritance-dynamic.html

* Source/WebCore/rendering/style/RenderStyle.h:
(WebCore::RenderStyle::NonInheritedFlags::copyNonInheritedFrom):

Add it.

* LayoutTests/fast/css/color-inheritance-dynamic-expected.html: Added.
* LayoutTests/fast/css/color-inheritance-dynamic.html: Added.

Canonical link: https://commits.webkit.org/250846@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294620 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
anttijk committed May 22, 2022
1 parent fd038f4 commit 1d98cdbb6e7993c6bd907f4a04d9ce08514201ec
Showing 3 changed files with 15 additions and 0 deletions.
@@ -0,0 +1,5 @@
<!DOCTYPE html>
<html>
<body style="font-family: ahem; font-size: 50px">
<span style="color:green">A</span><span style="color:green">B</span><span style="color:blue">C</span>
</html>
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<body style="font-family: ahem; font-size: 50px">
<span style="color:green">A</span><span style="color:green">B</span><span>C</span>
<script>
document.body.offsetTop;
document.body.style.color = "blue";
</script>
</html>
@@ -2167,6 +2167,7 @@ inline void RenderStyle::NonInheritedFlags::copyNonInheritedFrom(const NonInheri
tableLayout = other.tableLayout;
hasViewportUnits = other.hasViewportUnits;
hasExplicitlyInheritedProperties = other.hasExplicitlyInheritedProperties;
disallowsFastPathInheritance = other.disallowsFastPathInheritance;

// Unlike properties tracked by the other hasExplicitlySet* flags, border-radius is non-inherited
// and we need to remember whether it's been explicitly set when copying m_surroundData.

0 comments on commit 1d98cdb

Please sign in to comment.