Closed Bug 1402197 Opened 6 years ago Closed 6 years ago

Add an option for GetTransformToAncestor to stop at stacking contexts and displayport

Categories

(Core :: Layout, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox57 --- wontfix
firefox58 --- fixed

People

(Reporter: mattwoodrow, Assigned: mattwoodrow)

References

Details

Attachments

(1 file)

Retained display lists wants a way to convert coordinates into the coordinate space of the nearest ancestor with a stacking context or displayport and this seemed the easiest way to achieve that.
Attachment #8911020 - Flags: review?(mstange)
Comment on attachment 8911020 [details] [diff] [review]
transform-to-ancestor

Review of attachment 8911020 [details] [diff] [review]:
-----------------------------------------------------------------

::: layout/generic/nsFrame.cpp
@@ +10523,5 @@
> +}
> +
> +// If you change any of these, also change the computation in BuildDisplayListForChild
> +bool
> +nsIFrame::IsStackingContext() {

You could make these two functions take a bunch of optional arguments for the things that nsIFrame::BuildDisplayListForChild already has. The default value for those optional arguments would then do the manual lookups that you do here. Not sure if that will work, but if it does, then you can share the code and don't need the comments.

::: layout/generic/nsIFrame.h
@@ +2790,5 @@
>     *   into points in aOutAncestor's coordinate space.
>     */
> +  enum {
> +    IN_CSS_UNITS = (1 << 0),
> +    STOP_AT_STACKING_CONTEXT_AND_DISPLAY_PORT = (1 << 1)

no need for the parens
Attachment #8911020 - Flags: review?(mstange) → review+
Pushed by mwoodrow@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/92dd76c32727
Add an option for GetTransformToAncestor to stop at stacking contexts and displayport. r=mstange
Priority: -- → P3
https://hg.mozilla.org/mozilla-central/rev/92dd76c32727
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.