Here is a stack trace for the creation of a display item for the selection carets:
```
#0 nsDisplayItem::nsDisplayItem (this=0x7fc4db1ca420, aBuilder=0x7fc4db3ba000, aFrame=0x7fc4e182e528, aActiveScrolledRoot=0x7fc4e369cb00, aAnonymous=false)
at /home/botond/dev/projects/mozilla/central/layout/painting/nsDisplayList.cpp:3077
#1 0x00007fc4f158ae73 in nsDisplayHitTestInfoItem::nsDisplayHitTestInfoItem (this=0x7fc4db1ca420, aBuilder=0x7fc4db3ba000, aFrame=0x7fc4e182e528,
aActiveScrolledRoot=0x7fc4e369cb00, aAnonymous=false) at /home/botond/dev/projects/mozilla/central/layout/painting/nsDisplayList.h:3603
#2 0x00007fc4f155f0fb in nsDisplayWrapList::nsDisplayWrapList (this=0x7fc4db1ca420, aBuilder=0x7fc4db3ba000, aFrame=0x7fc4e182e528, aList=0x7ffd49a0f160,
aActiveScrolledRoot=0x7fc4e369cb00, aClearClipChain=true, aIndex=0, aAnonymous=false)
at /home/botond/dev/projects/mozilla/central/layout/painting/nsDisplayList.cpp:5492
#3 0x00007fc4f12cd78f in MakeDisplayItem<nsDisplayWrapList, nsIFrame*&, nsDisplayList*&, mozilla::ActiveScrolledRoot const*&, bool>(nsDisplayListBuilder*, nsIFrame*&, nsDisplayList*&, mozilla::ActiveScrolledRoot const*&, bool&&) (aBuilder=0x7fc4db3ba000,
at /home/botond/dev/projects/mozilla/central/layout/painting/nsDisplayList.h:2030
#4 0x00007fc4f12114d0 in WrapInWrapList (aBuilder=0x7fc4db3ba000, aFrame=0x7fc4e182e528, aList=0x7ffd49a0f160, aContainerASR=0x7fc4e369cb00, aCanSkipWrapList=false)
at /home/botond/dev/projects/mozilla/central/layout/generic/nsFrame.cpp:3395
#5 0x00007fc4f1210bb8 in nsIFrame::BuildDisplayListForChild (this=0x7fc4e182e3b8, aBuilder=0x7fc4db3ba000, aChild=0x7fc4e182e5e0, aLists=..., aFlags=4)
at /home/botond/dev/projects/mozilla/central/layout/generic/nsFrame.cpp:3794
#6 0x00007fc4f11ab7fe in DisplayLine (aBuilder=0x7fc4db3ba000, aLineArea=..., aLine=..., aDepth=0, aDrawnLines=@0x7ffd49a0f7ec: 32708, aLists=..., aFrame=0x7fc4e182e3b8,
aTextOverflow=0x0, aLineNumberForTextOverflow=0) at /home/botond/dev/projects/mozilla/central/layout/generic/nsBlockFrame.cpp:6405
#7 0x00007fc4f11aac96 in nsBlockFrame::BuildDisplayList (this=0x7fc4e182e3b8, aBuilder=0x7fc4db3ba000, aLists=...)
at /home/botond/dev/projects/mozilla/central/layout/generic/nsBlockFrame.cpp:6496
#8 0x00007fc4f120cc7f in nsIFrame::BuildDisplayListForStackingContext (this=0x7fc4e182e3b8, aBuilder=0x7fc4db3ba000, aList=0x7ffd49a109b0,
aCreatedContainerItem=0x7ffd49a108d7) at /home/botond/dev/projects/mozilla/central/layout/generic/nsFrame.cpp:3061
#9 0x00007fc4f12105c0 in nsIFrame::BuildDisplayListForChild (this=0x7fc4e1ef0448, aBuilder=0x7fc4db3ba000, aChild=0x7fc4db3f7de8, aLists=..., aFlags=4)
at /home/botond/dev/projects/mozilla/central/layout/generic/nsFrame.cpp:3711
#10 0x00007fc4f11ab7fe in DisplayLine (aBuilder=0x7fc4db3ba000, aLineArea=..., aLine=..., aDepth=0, aDrawnLines=@0x7ffd49a1103c: 32708, aLists=..., aFrame=0x7fc4e1ef0448,
aTextOverflow=0x0, aLineNumberForTextOverflow=0) at /home/botond/dev/projects/mozilla/central/layout/generic/nsBlockFrame.cpp:6405
#11 0x00007fc4f11aac96 in nsBlockFrame::BuildDisplayList (this=0x7fc4e1ef0448, aBuilder=0x7fc4db3ba000, aLists=...)
at /home/botond/dev/projects/mozilla/central/layout/generic/nsBlockFrame.cpp:6496
#12 0x00007fc4f120cc7f in nsIFrame::BuildDisplayListForStackingContext (this=0x7fc4e1ef0448, aBuilder=0x7fc4db3ba000, aList=0x7ffd49a11ff8, aCreatedContainerItem=0x0)
at /home/botond/dev/projects/mozilla/central/layout/generic/nsFrame.cpp:3061
#13 0x00007fc4f1185d15 in BuildDisplayListForTopLayerFrame (aBuilder=0x7fc4db3ba000, aFrame=0x7fc4e1ef0448, aList=0x7ffd49a122c8)
at /home/botond/dev/projects/mozilla/central/layout/generic/ViewportFrame.cpp:124
#14 0x00007fc4f11859be in mozilla::ViewportFrame::BuildDisplayListForTopLayer (this=0x7fc4dee8d020, aBuilder=0x7fc4db3ba000, aList=0x7ffd49a122c8)
at /home/botond/dev/projects/mozilla/central/layout/generic/ViewportFrame.cpp:180
#15 0x00007fc4f1185334 in mozilla::ViewportFrame::BuildDisplayList (this=0x7fc4dee8d020, aBuilder=0x7fc4db3ba000, aLists=...)
at /home/botond/dev/projects/mozilla/central/layout/generic/ViewportFrame.cpp:64
#16 0x00007fc4f120cc7f in nsIFrame::BuildDisplayListForStackingContext (this=0x7fc4dee8d020, aBuilder=0x7fc4db3ba000, aList=0x7ffd49a13008, aCreatedContainerItem=0x0)
at /home/botond/dev/projects/mozilla/central/layout/generic/nsFrame.cpp:3061
#17 0x00007fc4f1525508 in RetainedDisplayListBuilder::AttemptPartialUpdate (this=0x7fc4db3ba000, aBackstop=0, aChecker=0x0)
at /home/botond/dev/projects/mozilla/central/layout/painting/RetainedDisplayListBuilder.cpp:1304
#18 0x00007fc4f10ecfcf in nsLayoutUtils::PaintFrame (aRenderingContext=0x0, aFrame=0x7fc4dee8d020, aDirtyRegion=..., aBackstop=0,
aBuilderMode=nsDisplayListBuilderMode::PAINTING,
aFlags=(nsLayoutUtils::PaintFrameFlags::PAINT_WIDGET_LAYERS | nsLayoutUtils::PaintFrameFlags::PAINT_EXISTING_TRANSACTION | nsLayoutUtils::PaintFrameFlags::PAINT_NO_COMP
```
The item's ASR (which is the RCD-RSF's ASR, hence the layer getting the RCD-RSF metadata) is pushed [in `BuildDisplayListForTopLayerFrame()`](https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/layout/generic/ViewportFrame.cpp#117).
Bug 1528743 Comment 2 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Here is a stack trace for the creation of a display item for the selection carets:
```
#0 nsDisplayItem::nsDisplayItem (this=0x7fc4db1ca420, aBuilder=0x7fc4db3ba000, aFrame=0x7fc4e182e528, aActiveScrolledRoot=0x7fc4e369cb00, aAnonymous=false)
at /home/botond/dev/projects/mozilla/central/layout/painting/nsDisplayList.cpp:3077
#1 0x00007fc4f158ae73 in nsDisplayHitTestInfoItem::nsDisplayHitTestInfoItem (this=0x7fc4db1ca420, aBuilder=0x7fc4db3ba000, aFrame=0x7fc4e182e528,
aActiveScrolledRoot=0x7fc4e369cb00, aAnonymous=false) at /home/botond/dev/projects/mozilla/central/layout/painting/nsDisplayList.h:3603
#2 0x00007fc4f155f0fb in nsDisplayWrapList::nsDisplayWrapList (this=0x7fc4db1ca420, aBuilder=0x7fc4db3ba000, aFrame=0x7fc4e182e528, aList=0x7ffd49a0f160,
aActiveScrolledRoot=0x7fc4e369cb00, aClearClipChain=true, aIndex=0, aAnonymous=false)
at /home/botond/dev/projects/mozilla/central/layout/painting/nsDisplayList.cpp:5492
#3 0x00007fc4f12cd78f in MakeDisplayItem<nsDisplayWrapList, nsIFrame*&, nsDisplayList*&, mozilla::ActiveScrolledRoot const*&, bool>(nsDisplayListBuilder*, nsIFrame*&, nsDisplayList*&, mozilla::ActiveScrolledRoot const*&, bool&&) (aBuilder=0x7fc4db3ba000,
at /home/botond/dev/projects/mozilla/central/layout/painting/nsDisplayList.h:2030
#4 0x00007fc4f12114d0 in WrapInWrapList (aBuilder=0x7fc4db3ba000, aFrame=0x7fc4e182e528, aList=0x7ffd49a0f160, aContainerASR=0x7fc4e369cb00, aCanSkipWrapList=false)
at /home/botond/dev/projects/mozilla/central/layout/generic/nsFrame.cpp:3395
#5 0x00007fc4f1210bb8 in nsIFrame::BuildDisplayListForChild (this=0x7fc4e182e3b8, aBuilder=0x7fc4db3ba000, aChild=0x7fc4e182e5e0, aLists=..., aFlags=4)
at /home/botond/dev/projects/mozilla/central/layout/generic/nsFrame.cpp:3794
#6 0x00007fc4f11ab7fe in DisplayLine (aBuilder=0x7fc4db3ba000, aLineArea=..., aLine=..., aDepth=0, aDrawnLines=@0x7ffd49a0f7ec: 32708, aLists=..., aFrame=0x7fc4e182e3b8,
aTextOverflow=0x0, aLineNumberForTextOverflow=0) at /home/botond/dev/projects/mozilla/central/layout/generic/nsBlockFrame.cpp:6405
#7 0x00007fc4f11aac96 in nsBlockFrame::BuildDisplayList (this=0x7fc4e182e3b8, aBuilder=0x7fc4db3ba000, aLists=...)
at /home/botond/dev/projects/mozilla/central/layout/generic/nsBlockFrame.cpp:6496
#8 0x00007fc4f120cc7f in nsIFrame::BuildDisplayListForStackingContext (this=0x7fc4e182e3b8, aBuilder=0x7fc4db3ba000, aList=0x7ffd49a109b0,
aCreatedContainerItem=0x7ffd49a108d7) at /home/botond/dev/projects/mozilla/central/layout/generic/nsFrame.cpp:3061
#9 0x00007fc4f12105c0 in nsIFrame::BuildDisplayListForChild (this=0x7fc4e1ef0448, aBuilder=0x7fc4db3ba000, aChild=0x7fc4db3f7de8, aLists=..., aFlags=4)
at /home/botond/dev/projects/mozilla/central/layout/generic/nsFrame.cpp:3711
#10 0x00007fc4f11ab7fe in DisplayLine (aBuilder=0x7fc4db3ba000, aLineArea=..., aLine=..., aDepth=0, aDrawnLines=@0x7ffd49a1103c: 32708, aLists=..., aFrame=0x7fc4e1ef0448,
aTextOverflow=0x0, aLineNumberForTextOverflow=0) at /home/botond/dev/projects/mozilla/central/layout/generic/nsBlockFrame.cpp:6405
#11 0x00007fc4f11aac96 in nsBlockFrame::BuildDisplayList (this=0x7fc4e1ef0448, aBuilder=0x7fc4db3ba000, aLists=...)
at /home/botond/dev/projects/mozilla/central/layout/generic/nsBlockFrame.cpp:6496
#12 0x00007fc4f120cc7f in nsIFrame::BuildDisplayListForStackingContext (this=0x7fc4e1ef0448, aBuilder=0x7fc4db3ba000, aList=0x7ffd49a11ff8, aCreatedContainerItem=0x0)
at /home/botond/dev/projects/mozilla/central/layout/generic/nsFrame.cpp:3061
#13 0x00007fc4f1185d15 in BuildDisplayListForTopLayerFrame (aBuilder=0x7fc4db3ba000, aFrame=0x7fc4e1ef0448, aList=0x7ffd49a122c8)
at /home/botond/dev/projects/mozilla/central/layout/generic/ViewportFrame.cpp:124
#14 0x00007fc4f11859be in mozilla::ViewportFrame::BuildDisplayListForTopLayer (this=0x7fc4dee8d020, aBuilder=0x7fc4db3ba000, aList=0x7ffd49a122c8)
at /home/botond/dev/projects/mozilla/central/layout/generic/ViewportFrame.cpp:180
#15 0x00007fc4f1185334 in mozilla::ViewportFrame::BuildDisplayList (this=0x7fc4dee8d020, aBuilder=0x7fc4db3ba000, aLists=...)
at /home/botond/dev/projects/mozilla/central/layout/generic/ViewportFrame.cpp:64
#16 0x00007fc4f120cc7f in nsIFrame::BuildDisplayListForStackingContext (this=0x7fc4dee8d020, aBuilder=0x7fc4db3ba000, aList=0x7ffd49a13008, aCreatedContainerItem=0x0)
at /home/botond/dev/projects/mozilla/central/layout/generic/nsFrame.cpp:3061
#17 0x00007fc4f1525508 in RetainedDisplayListBuilder::AttemptPartialUpdate (this=0x7fc4db3ba000, aBackstop=0, aChecker=0x0)
at /home/botond/dev/projects/mozilla/central/layout/painting/RetainedDisplayListBuilder.cpp:1304
#18 0x00007fc4f10ecfcf in nsLayoutUtils::PaintFrame (aRenderingContext=0x0, aFrame=0x7fc4dee8d020, aDirtyRegion=..., aBackstop=0,
aBuilderMode=nsDisplayListBuilderMode::PAINTING,
aFlags=(nsLayoutUtils::PaintFrameFlags::PAINT_WIDGET_LAYERS | nsLayoutUtils::PaintFrameFlags::PAINT_EXISTING_TRANSACTION | nsLayoutUtils::PaintFrameFlags::PAINT_NO_COMP
```
The ASR that gets assigned to the item (which is the RCD-RSF's ASR, hence the layer getting the RCD-RSF metadata) gets pushed onto the display list builder [in `BuildDisplayListForTopLayerFrame()`](https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/layout/generic/ViewportFrame.cpp#117).