Title: [280909] trunk
Revision
280909
Author
[email protected]
Date
2021-08-11 08:39:04 -0700 (Wed, 11 Aug 2021)

Log Message

Dynamically changing HTMLStyleElement.type should change the rendering accordingly
https://bugs.webkit.org/show_bug.cgi?id=228980

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Rebaseline WPT test that is now passing.

* web-platform-tests/html/semantics/document-metadata/the-style-element/style_type_change-expected.txt:

Source/WebCore:

Dynamically changing HTMLStyleElement.type should change the rendering accordingly.

This is causing the following WPT test to fail in WebKit:
- html/semantics/document-metadata/the-style-element/style_type_change.html

This test is passing in both Firefox and Chrome.

No new tests, rebaselined existing test.

* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::parseAttribute):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (280908 => 280909)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-08-11 15:09:00 UTC (rev 280908)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-08-11 15:39:04 UTC (rev 280909)
@@ -1,3 +1,14 @@
+2021-08-11  Chris Dumez  <[email protected]>
+
+        Dynamically changing HTMLStyleElement.type should change the rendering accordingly
+        https://bugs.webkit.org/show_bug.cgi?id=228980
+
+        Reviewed by Antti Koivisto.
+
+        Rebaseline WPT test that is now passing.
+
+        * web-platform-tests/html/semantics/document-metadata/the-style-element/style_type_change-expected.txt:
+
 2021-08-11  Lauro Moura  <[email protected]>
 
         Remove leftover offscreen canvas test case after r280084

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-style-element/style_type_change-expected.txt (280908 => 280909)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-style-element/style_type_change-expected.txt	2021-08-11 15:09:00 UTC (rev 280908)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/document-metadata/the-style-element/style_type_change-expected.txt	2021-08-11 15:39:04 UTC (rev 280909)
@@ -1,6 +1,6 @@
 Text content.
 
 PASS Check initial styleSheets length type
-FAIL Change type from invalid type to valid type assert_equals: expected "rgb(0, 128, 0)" but got "rgb(0, 0, 0)"
-FAIL Change type from valid type to invalid type assert_equals: expected "rgb(0, 128, 0)" but got "rgb(0, 0, 0)"
+PASS Change type from invalid type to valid type
+PASS Change type from valid type to invalid type
 

Modified: trunk/Source/WebCore/ChangeLog (280908 => 280909)


--- trunk/Source/WebCore/ChangeLog	2021-08-11 15:09:00 UTC (rev 280908)
+++ trunk/Source/WebCore/ChangeLog	2021-08-11 15:39:04 UTC (rev 280909)
@@ -1,3 +1,22 @@
+2021-08-11  Chris Dumez  <[email protected]>
+
+        Dynamically changing HTMLStyleElement.type should change the rendering accordingly
+        https://bugs.webkit.org/show_bug.cgi?id=228980
+
+        Reviewed by Antti Koivisto.
+
+        Dynamically changing HTMLStyleElement.type should change the rendering accordingly.
+
+        This is causing the following WPT test to fail in WebKit:
+        - html/semantics/document-metadata/the-style-element/style_type_change.html 
+
+        This test is passing in both Firefox and Chrome.
+
+        No new tests, rebaselined existing test.
+
+        * html/HTMLStyleElement.cpp:
+        (WebCore::HTMLStyleElement::parseAttribute):
+
 2021-08-11  Adrian Perez de Castro  <[email protected]>
 
         Non-unified build fixes, mid August 2021 edition

Modified: trunk/Source/WebCore/html/HTMLStyleElement.cpp (280908 => 280909)


--- trunk/Source/WebCore/html/HTMLStyleElement.cpp	2021-08-11 15:09:00 UTC (rev 280908)
+++ trunk/Source/WebCore/html/HTMLStyleElement.cpp	2021-08-11 15:39:04 UTC (rev 280909)
@@ -87,9 +87,12 @@
                 scope->didChangeStyleSheetContents();
         } else
             m_styleSheetOwner.childrenChanged(*this);
-    } else if (name == typeAttr)
+    } else if (name == typeAttr) {
         m_styleSheetOwner.setContentType(value);
-    else
+        m_styleSheetOwner.childrenChanged(*this);
+        if (auto* scope = m_styleSheetOwner.styleScope())
+            scope->didChangeStyleSheetContents();
+    } else
         HTMLElement::parseAttribute(name, value);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to