From 47744d95add56352ab5d0631d3dd5e054aad3849 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Mon, 9 Nov 2015 15:19:13 -0800 Subject: [PATCH] Make RESTYLE_SELF imply RESTYLE_DESCENDANTS. This is a temporary workaround for #8438. --- components/layout/wrapper.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/layout/wrapper.rs b/components/layout/wrapper.rs index ae8462426e8..ad745d2d091 100644 --- a/components/layout/wrapper.rs +++ b/components/layout/wrapper.rs @@ -413,7 +413,7 @@ impl<'le> LayoutElement<'le> { } /// Properly marks nodes as dirty in response to restyle hints. - pub fn note_restyle_hint(&self, hint: RestyleHint) { + pub fn note_restyle_hint(&self, mut hint: RestyleHint) { // Bail early if there's no restyling to do. if hint.is_empty() { return; @@ -446,6 +446,11 @@ impl<'le> LayoutElement<'le> { // Process hints. if hint.contains(RESTYLE_SELF) { dirty_node(&node); + + // FIXME(bholley, #8438): We currently need to RESTYLE_DESCENDANTS in the + // RESTYLE_SELF case in order to make sure "inherit" style structs propagate + // properly. See the explanation in the github issue. + hint.insert(RESTYLE_DESCENDANTS); } if hint.contains(RESTYLE_DESCENDANTS) { unsafe { node.set_dirty_descendants(true); }