Bug 287554
| Summary: | Make `Vector::operator==` work correctly with padded structs | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Antoine Quint <graouts> |
| Component: | New Bugs | Assignee: | Chris Dumez <cdumez> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | simon.fraser, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Antoine Quint
In 289948@main a workaround was implemented to let two `Vector<StyleRuleKeyframe::Key>` be compared with the `==` operator:
```
// FIXME: using Vector::operator==() here fails on Intel, so we provide our own logic.
auto keysAreEqual = [](const Vector<StyleRuleKeyframe::Key>& a, const Vector<StyleRuleKeyframe::Key>& b) {
if (a.size() != b.size())
return false;
for (auto i = a.size(); i--;) {
if (!(a[i] == b[i]))
return false;
}
return true;
};
```
Indeed, on Intel, simply using the existing `Vector::operator==` would yield failures in `LayoutTests/animations/keyframes-rule.html`. Apparently this is due to the fact that `memcmp()` is used in this case and that it doesn't work correctly with padded structs like `StyleRuleKeyframe::Key`.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/144700872>
Chris Dumez
Pull request: https://github.com/WebKit/WebKit/pull/41696
EWS
Committed 291724@main (30eb04f14b59): <https://commits.webkit.org/291724@main>
Reviewed commits have been landed. Closing PR #41696 and removing active labels.