Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cc0631f6705ab4beef5007a7e7965d4421b7b1b1
      
https://github.com/WebKit/WebKit/commit/cc0631f6705ab4beef5007a7e7965d4421b7b1b1
  Author: Tim Horton <[email protected]>
  Date:   2024-07-01 (Mon, 01 Jul 2024)

  Changed paths:
    M Source/WebCore/html/parser/HTMLParserOptions.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewEvaluateJavaScript.mm

  Log Message:
  -----------
  Setting allowsContentJavaScript=NO does not show <noscript> elements
https://bugs.webkit.org/show_bug.cgi?id=276037
rdar://130822453

Reviewed by Richard Robinson and Geoffrey Garen.

* Source/WebCore/html/parser/HTMLParserOptions.cpp:
(WebCore::HTMLParserOptions::HTMLParserOptions):
Sites generally expect that if their script won't run, <noscript> elements
are inserted into the DOM. Some use this, for example, to insert style that
hides elements that won't be populated by forthcoming changes from script.

Previously, WebKit would insert <noscript> elements if JavaScript was totally
disabled, but not if it was disabled by the "disable content JavaScript" 
mechanism
(which still allows the user agent to run script, just denies script from the 
page).

However, given the overall purpose of <noscript> is about script from the page,
it seems prudent to insert <noscript> contents in both cases.

The scriptingFlag in the parser seems to only affect <noscript> participation,
so this minimal patch appears to do the trick without any unexpected downstream
effects.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewEvaluateJavaScript.mm:
(TEST(WebKit, AllowsContentJavaScriptAffectsNoscriptElements)):
Add a test that covers this behavior.

Canonical link: https://commits.webkit.org/280544@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to