From 46fffff746715a9774c12a73d3eedece65c725de 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 closer the definition of which does use connectedness (though it uses "browsing-context connected", which is a bit different): https://html.spec.whatwg.org/#link-type-stylesheet --- source | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source b/source index 50b4da3e8eb..5812370a783 100644 --- a/source +++ b/source @@ -15102,11 +15102,10 @@ 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