Bug 264317

Summary: Log quirks on the Console of Web Inspector when browsing a website
Product: WebKit Reporter: Karl Dubost <karlcow>
Component: WebKit Misc.Assignee: Brandon <brandonstewart>
Status: NEW ---    
Severity: Normal CC: ahmad.saleem792, brandonstewart, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 17   
Hardware: Unspecified   
OS: Unspecified   

Description Karl Dubost 2023-11-06 21:29:49 PST
Quirks are a mechanism to fix websites breaking in Safari for different type of reasons.
See https://github.com/WebKit/WebKit/blob/main/Source/WebCore/page/Quirks.cpp

There are often triggered based on domain names.
We need a mechanism to advertise in the Web Inspector Console, that this specific Quirk is happening for this site.
The goal is to raise awareness to Web developers of these sites that something need to be fixed on their site and/or help them understand to understand when the current behavior is unexpected.
Comment 1 Karl Dubost 2023-11-06 21:30:33 PST
<rdar://114721582>
Comment 2 Karl Dubost 2023-11-06 21:53:50 PST
An additional question that could be a separate bug related to this bug. 
Should the Quirks be documented on an external site (https://webkit.org/)?
It could be as simple as one liners. 

Ahmad had ideas on the type of informations.
Comment 3 Karl Dubost 2024-07-01 22:59:01 PDT
Note:
What should it be done when the Quirk is being matched a couple of times? 

* Send the information just once per URL?
* Send the information every time there is a match (it can become spammy, but we could wrap them like Jon Davis did for Sourcemap errors) Bug 256683 or could it give more information on where exactly the quirk is happening so that the webdev understands how to fix it.
Comment 4 Karl Dubost 2024-07-01 22:59:50 PDT
From Brandon Stewart, a way to add a message:

```
m_document->addConsoleMessage(makeUnique<Inspector::ConsoleMessage>(MessageSource::JS, MessageType::Log, MessageLevel::Warning, "Quirk is enabled."_s));
```