Bug 238549 - InspectorCSSAgent::getSupportedCSSProperties() should use a real CSS parser context
Summary: InspectorCSSAgent::getSupportedCSSProperties() should use a real CSS parser c...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-03-30 06:48 PDT by Sam Sneddon [:gsnedders]
Modified: 2022-04-06 06:49 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Sneddon [:gsnedders] 2022-03-30 06:48:51 PDT
Currently this calls:

CSSParserFastPaths::isValidKeywordPropertyAndValue(propertyID, valueID, strictCSSParserContext())

However, by using a strictCSSParserContext() we're actually calling this with basically everything that can be runtime-disabled disabled, which likely means we're missing some valid values.
Comment 1 Patrick Angle 2022-03-30 09:24:48 PDT
If bug 217802 takes Devin's suggestion to keep a `Page& m_inspectedPage` in `InspectorCSSAgent`, I think we should be able to do something along the lines of `CSSParserContext(m_inspectedPage->mainFrame().document())` (with appropriate checks to fall back to the strict context if the page or document is missing) to get a parsing context for the main document.
Comment 2 Sam Sneddon [:gsnedders] 2022-04-05 10:32:39 PDT
Also, as part of this, we should add to CSSParserFastPaths::isValidKeywordPropertyAndValue:

> ASSERT(isCSSPropertyExposed(propertyId, &context.propertySettings))

Or if that's still not possible (perhaps with `isInternalCSSProperty(propertyId)` if we need to), we should file another bug for that.
Comment 3 Radar WebKit Bug Importer 2022-04-06 06:49:13 PDT
<rdar://problem/91350740>