Bug 298817
| Summary: | Fix static_assert() in WebCore::SVGPropertyOwnerRegistry::fastAnimatedPropertyLookup() with upstream clang | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | David Kilzer (:ddkilzer) <ddkilzer> |
| Component: | SVG | Assignee: | David Kilzer (:ddkilzer) <ddkilzer> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | sabouhallawa, webkit-bug-importer, zimmermann |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
David Kilzer (:ddkilzer)
Fix static_assert() in WebCore::SVGPropertyOwnerRegistry::fastAnimatedPropertyLookup() with upstream clang.
Upstream clang fails to build WebCore with the following error:
```
Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h:267:27: error: static assertion failed due to requirement '!std::is_same_v<WebCore::SVGRectElement, WebCore::SVGRectElement>': Element should use fast property path
267 | static_assert(!std::is_same_v<OwnerType, SVGRectElement> && !std::is_same_v<OwnerType, SVGCircleElement>, "Element should use fast property path");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h:243:30: note: in instantiation of member function 'WebCore::SVGPropertyOwnerRegistry<WebCore::SVGRectElement, WebCore::SVGGeometryElement>::fastAnimatedPropertyLookup' requested here
243 | if (auto* property = fastAnimatedPropertyLookup(m_owner, attributeName)) {
| ^
```
<rdar://157029024>
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
David Kilzer (:ddkilzer)
As I understand it, the issue is that the `propertyForAttribute()` method on `SVGRectElement` is declared `private`, but concept evaluation occurs during template instantiation, before `friend` relationships are considered.
```
template<typename T>
concept HasFastPropertyForAttribute = requires(const T& element, const QualifiedName& name)
{
{ element.propertyForAttribute(name) } -> std::same_as<SVGAnimatedProperty*>;
};
```
Note that the `SVGCircleElement` class has the same issue.
David Kilzer (:ddkilzer)
Pull request: https://github.com/WebKit/WebKit/pull/50705
EWS
Committed 299969@main (4397d9f07bfd): <https://commits.webkit.org/299969@main>
Reviewed commits have been landed. Closing PR #50705 and removing active labels.