Add a "set or allocate" frame property API
Categories
(Core :: Layout, task)
Tracking
()
People
(Reporter: TYLin, Unassigned)
Details
Bug 1731509 reminds me an improvement I want to see about frame property: a generic version of SetOrUpdateRectValuedProperty()
[1] in nsIFrame
to update a value to an existing property or allocate a space if the property is not there. That may simplify patterns like [2] that is common used in layout/.
A "get or allocate" version may also be useful for patterns like [3].
[1] https://searchfox.org/mozilla-central/rev/5966e98bdfa7355e0a3d9cce482f4717dc3419b0/layout/generic/nsIFrame.cpp#222-236
[2] https://searchfox.org/mozilla-central/rev/5966e98bdfa7355e0a3d9cce482f4717dc3419b0/layout/generic/ReflowInput.cpp#857-864
[3] https://searchfox.org/mozilla-central/rev/5966e98bdfa7355e0a3d9cce482f4717dc3419b0/layout/painting/RetainedDisplayListBuilder.cpp#81-98
Reporter | ||
Comment 1•4 years ago
|
||
Here's another helper function updating nsMargin
property in ReflowInput.cpp.
Description
•