[Webkit-unassigned] [Bug 285143] New: FIXME: replace by a switch statement in CSSPrimitiveValue::primitiveType()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Dec 25 01:15:43 PST 2024


https://bugs.webkit.org/show_bug.cgi?id=285143

            Bug ID: 285143
           Summary: FIXME: replace by a switch statement in
                    CSSPrimitiveValue::primitiveType()
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: karlcow at apple.com
                CC: koivisto at iki.fi

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();
}
```

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20241225/38c0f64f/attachment.htm>


More information about the webkit-unassigned mailing list