diff options
author | Moonchild <moonchild@palemoon.org> | 2019-07-03 15:17:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-03 15:17:08 +0000 |
commit | 0e54a032624b4ce23a959454047bfd504a734cc0 (patch) | |
tree | 6e19e55c35095548177db6fb9e5fbabe2aff2310 /layout/generic/StickyScrollContainer.cpp | |
parent | 8ea1f38f9c55a076dade47eaf0daaea27590d179 (diff) | |
parent | 3051056bbb0b41b8258d91e44a4ff8ec33a98d8f (diff) | |
download | UXP-0e54a032624b4ce23a959454047bfd504a734cc0.tar UXP-0e54a032624b4ce23a959454047bfd504a734cc0.tar.gz UXP-0e54a032624b4ce23a959454047bfd504a734cc0.tar.lz UXP-0e54a032624b4ce23a959454047bfd504a734cc0.tar.xz UXP-0e54a032624b4ce23a959454047bfd504a734cc0.zip |
Merge pull request #1151 from win7-7/FrameProperties
Attach FrameProperties to each frame instead of using a shared hashtable
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. |