Summary: | Blend using calc() when necessary | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Antoine Quint <graouts> | ||||
Component: | Animations | Assignee: | Antoine Quint <graouts> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | dino, graouts, koivisto, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 223875 | ||||||
Attachments: |
|
Description
Antoine Quint
2021-04-16 06:27:53 PDT
Created attachment 426218 [details]
Patch
Comment on attachment 426218 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=426218&action=review > Source/WebCore/animation/CSSPropertyAnimation.cpp:851 > + if (!canInterpolate(from, to)) > + (destination->*m_setter)(progress ? LengthBox(value(to)) : LengthBox(value(from))); > + else { You could early return instead of having an else branch. > Source/WebCore/platform/LengthBox.h:61 > + LengthBox(const LengthBox& box) > + : RectEdges { Length(box.top()), Length(box.right()), Length(box.bottom()), Length(box.left()) } > + { > + } > + I guess you also just give both RectEdges and LengthBox defaulted copy constructors. Committed r276138 (236632@main): <https://commits.webkit.org/236632@main> (In reply to Antti Koivisto from comment #2) > Comment on attachment 426218 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=426218&action=review > > > Source/WebCore/animation/CSSPropertyAnimation.cpp:851 > > + if (!canInterpolate(from, to)) > > + (destination->*m_setter)(progress ? LengthBox(value(to)) : LengthBox(value(from))); > > + else { > > You could early return instead of having an else branch. Good point, made the change in the landed patch. > > Source/WebCore/platform/LengthBox.h:61 > > + LengthBox(const LengthBox& box) > > + : RectEdges { Length(box.top()), Length(box.right()), Length(box.bottom()), Length(box.left()) } > > + { > > + } > > + > > I guess you also just give both RectEdges and LengthBox defaulted copy > constructors. Yes, that's the approach I took in the landed patch. |