Bug 285143
| Summary: | FIXME: replace by a switch statement in CSSPrimitiveValue::primitiveType() | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Karl Dubost <karlcow> |
| Component: | CSS | Assignee: | Karl Dubost <karlcow> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | koivisto, webkit-bug-importer |
| Priority: | P2 | Keywords: | GoodFirstBug, InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Karl Dubost
https://searchfox.org/wubkat/rev/86e4a015037fed5778aab8eb507f495e5d974875/Source/WebCore/css/CSSPrimitiveValue.cpp#243-259
```cpp
CSSUnitType CSSPrimitiveValue::primitiveType() const
{
// FIXME: Use a switch statement here.
if (primitiveUnitType() == CSSUnitType::CSS_PROPERTY_ID || primitiveUnitType() == CSSUnitType::CSS_VALUE_ID || primitiveUnitType() == CSSUnitType::CustomIdent)
return CSSUnitType::CSS_IDENT;
// Web-exposed content expects font family values to have CSSUnitType::CSS_STRING primitive type
// so we need to map our internal CSSUnitType::CSS_FONT_FAMILY type here.
if (primitiveUnitType() == CSSUnitType::CSS_FONT_FAMILY)
return CSSUnitType::CSS_STRING;
if (!isCalculated())
return primitiveUnitType();
return m_value.calc->primitiveType();
}
```
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Karl Dubost
Using this as an example for an article on helping WebKit contributions.
Radar WebKit Bug Importer
<rdar://problem/142020781>
Karl Dubost
Pull request: https://github.com/WebKit/WebKit/pull/38371
EWS
Committed 288286@main (3bb614e73c44): <https://commits.webkit.org/288286@main>
Reviewed commits have been landed. Closing PR #38371 and removing active labels.