Open Bug 1731510 Opened 4 years ago Updated 4 years ago

Add a "set or allocate" frame property API

Categories

(Core :: Layout, task)

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

You need to log in before you can comment on or make changes to this bug.