From 0bdf2583ae5bc16ac91aa8b4444ada0d135dd892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Fri, 15 Jan 2021 19:30:12 +0100 Subject: [PATCH] Fix update a style block to match reality and CSSWG resolution. No browser passed the test-case that was linked from the comment. The algorithm was also inconsistent, as it looked at whether the element was in a shadow tree or in the document tree, but it was only specified to be re-run if the element becomes connected or disconnected. The CSSWG discussed this in https://github.com/w3c/csswg-drafts/issues/3096#issuecomment-420719482 and there are WPTs for this. This also matches the definition of which does use connectedness: https://html.spec.whatwg.org/#link-type-stylesheet --- source | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/source b/source index e4c174919c6..d9230cc1226 100644 --- a/source +++ b/source @@ -15096,11 +15096,8 @@ interface HTMLStyleElement : HTMLElement {
  • If element has an associated CSS style sheet, remove the CSS style sheet in question.

  • -
  • If element's root is neither a shadow root nor a - document, then return.

  • - +
  • If element is not connected, then return.

  • +
  • If element's type attribute is present and