зеркало из https://github.com/mozilla/gecko-dev.git
Bug 911786 - Part 1: Store computed relative position offsets. r=dholbert
This commit is contained in:
Родитель
05a8238e35
Коммит
23d185d13b
|
@ -116,11 +116,11 @@ StickyScrollContainer::ComputeStickyOffsets(nsIFrame* aFrame)
|
|||
// Store the offset
|
||||
FrameProperties props = aFrame->Properties();
|
||||
nsMargin* offsets = static_cast<nsMargin*>
|
||||
(props.Get(nsIFrame::ComputedStickyOffsetProperty()));
|
||||
(props.Get(nsIFrame::ComputedOffsetProperty()));
|
||||
if (offsets) {
|
||||
*offsets = computedOffsets;
|
||||
} else {
|
||||
props.Set(nsIFrame::ComputedStickyOffsetProperty(),
|
||||
props.Set(nsIFrame::ComputedOffsetProperty(),
|
||||
new nsMargin(computedOffsets));
|
||||
}
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ StickyScrollContainer::ComputeStickyLimits(nsIFrame* aFrame, nsRect* aStick,
|
|||
aContain->SetRect(nscoord_MIN/2, nscoord_MIN/2, nscoord_MAX, nscoord_MAX);
|
||||
|
||||
const nsMargin* computedOffsets = static_cast<nsMargin*>(
|
||||
aFrame->Properties().Get(nsIFrame::ComputedStickyOffsetProperty()));
|
||||
aFrame->Properties().Get(nsIFrame::ComputedOffsetProperty()));
|
||||
if (!computedOffsets) {
|
||||
// We haven't reflowed the scroll frame yet, so offsets haven't been
|
||||
// computed. Bail.
|
||||
|
|
|
@ -831,6 +831,17 @@ nsHTMLReflowState::ComputeRelativeOffsets(uint8_t aCBDirection,
|
|||
// Computed value for 'bottom' is minus the value of 'top'
|
||||
aComputedOffsets.bottom = -aComputedOffsets.top;
|
||||
}
|
||||
|
||||
// Store the offset
|
||||
FrameProperties props = aFrame->Properties();
|
||||
nsMargin* offsets = static_cast<nsMargin*>
|
||||
(props.Get(nsIFrame::ComputedOffsetProperty()));
|
||||
if (offsets) {
|
||||
*offsets = aComputedOffsets;
|
||||
} else {
|
||||
props.Set(nsIFrame::ComputedOffsetProperty(),
|
||||
new nsMargin(aComputedOffsets));
|
||||
}
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
|
|
|
@ -927,7 +927,7 @@ public:
|
|||
NS_DECLARE_FRAME_PROPERTY(IBSplitSpecialPrevSibling, nullptr)
|
||||
|
||||
NS_DECLARE_FRAME_PROPERTY(NormalPositionProperty, DestroyPoint)
|
||||
NS_DECLARE_FRAME_PROPERTY(ComputedStickyOffsetProperty, DestroyMargin)
|
||||
NS_DECLARE_FRAME_PROPERTY(ComputedOffsetProperty, DestroyMargin)
|
||||
|
||||
NS_DECLARE_FRAME_PROPERTY(OutlineInnerRectProperty, DestroyRect)
|
||||
NS_DECLARE_FRAME_PROPERTY(PreEffectsBBoxProperty, DestroyRect)
|
||||
|
|
Загрузка…
Ссылка в новой задаче