diff options
author | win7-7 <win7-7@users.noreply.github.com> | 2019-06-26 01:51:45 +0300 |
---|---|---|
committer | win7-7 <win7-7@users.noreply.github.com> | 2019-06-26 01:51:45 +0300 |
commit | 00812e30dfa70f9b1a752cf0d09de00f6d401c85 (patch) | |
tree | e7eec9b55dd4e5825d3196f196c7f981be56e17a /layout/generic/StickyScrollContainer.cpp | |
parent | d7359c38b197c221c43def1e24cb48d4aee51bba (diff) | |
download | UXP-00812e30dfa70f9b1a752cf0d09de00f6d401c85.tar UXP-00812e30dfa70f9b1a752cf0d09de00f6d401c85.tar.gz UXP-00812e30dfa70f9b1a752cf0d09de00f6d401c85.tar.lz UXP-00812e30dfa70f9b1a752cf0d09de00f6d401c85.tar.xz UXP-00812e30dfa70f9b1a752cf0d09de00f6d401c85.zip |
Attach FrameProperties to each frame instead of using a shared hashtable
Dispense the shared hashtable and instead attach the frame property list directly to nsIFrame.
Diffstat (limited to 'layout/generic/StickyScrollContainer.cpp')
-rw-r--r-- | layout/generic/StickyScrollContainer.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/layout/generic/StickyScrollContainer.cpp b/layout/generic/StickyScrollContainer.cpp index d61a7e042..ca68992c3 100644 --- a/layout/generic/StickyScrollContainer.cpp +++ b/layout/generic/StickyScrollContainer.cpp @@ -45,12 +45,12 @@ StickyScrollContainer::GetStickyScrollContainerForFrame(nsIFrame* aFrame) // <html style="position: fixed"> return nullptr; } - FrameProperties props = static_cast<nsIFrame*>(do_QueryFrame(scrollFrame))-> - Properties(); - StickyScrollContainer* s = props.Get(StickyScrollContainerProperty()); + auto frame = static_cast<nsIFrame*>(do_QueryFrame(scrollFrame)); + StickyScrollContainer* s = + frame->GetProperty(StickyScrollContainerProperty()); if (!s) { s = new StickyScrollContainer(scrollFrame); - props.Set(StickyScrollContainerProperty(), s); + frame->SetProperty(StickyScrollContainerProperty(), s); } return s; } @@ -69,9 +69,9 @@ StickyScrollContainer::NotifyReparentedFrameAcrossScrollFrameBoundary(nsIFrame* // we aren't going to handle that. return; } - FrameProperties props = static_cast<nsIFrame*>(do_QueryFrame(oldScrollFrame))-> - Properties(); - StickyScrollContainer* oldSSC = props.Get(StickyScrollContainerProperty()); + StickyScrollContainer* oldSSC = + static_cast<nsIFrame*>(do_QueryFrame(oldScrollFrame))-> + GetProperty(StickyScrollContainerProperty()); if (!oldSSC) { // aOldParent had no sticky descendants, so aFrame doesn't have any sticky // descendants, and we're done here. @@ -95,8 +95,7 @@ StickyScrollContainer::NotifyReparentedFrameAcrossScrollFrameBoundary(nsIFrame* StickyScrollContainer* StickyScrollContainer::GetStickyScrollContainerForScrollFrame(nsIFrame* aFrame) { - FrameProperties props = aFrame->Properties(); - return props.Get(StickyScrollContainerProperty()); + return aFrame->GetProperty(StickyScrollContainerProperty()); } static nscoord @@ -141,13 +140,12 @@ StickyScrollContainer::ComputeStickyOffsets(nsIFrame* aFrame) scrollContainerSize.height); // Store the offset - FrameProperties props = aFrame->Properties(); - nsMargin* offsets = props.Get(nsIFrame::ComputedOffsetProperty()); + nsMargin* offsets = aFrame->GetProperty(nsIFrame::ComputedOffsetProperty()); if (offsets) { *offsets = computedOffsets; } else { - props.Set(nsIFrame::ComputedOffsetProperty(), - new nsMargin(computedOffsets)); + aFrame->SetProperty(nsIFrame::ComputedOffsetProperty(), + new nsMargin(computedOffsets)); } } @@ -162,7 +160,7 @@ StickyScrollContainer::ComputeStickyLimits(nsIFrame* aFrame, nsRect* aStick, aContain->SetRect(nscoord_MIN/2, nscoord_MIN/2, nscoord_MAX, nscoord_MAX); const nsMargin* computedOffsets = - aFrame->Properties().Get(nsIFrame::ComputedOffsetProperty()); + aFrame->GetProperty(nsIFrame::ComputedOffsetProperty()); if (!computedOffsets) { // We haven't reflowed the scroll frame yet, so offsets haven't been // computed. Bail. |