Bug 911786 - Part 1: Store computed relative position offsets. r=dholbert

This commit is contained in:
Corey Ford 2013-09-10 11:33:59 -07:00
Родитель 05a8238e35
Коммит 23d185d13b
3 изменённых файлов: 15 добавлений и 4 удалений

Просмотреть файл

@ -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)