зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1464363: Remove IMAGE_GOTINITIALREFLOW. r=dholbert
The methods where it's used don't run from reflow (they're image notifications that run off runnables and such), so should be an idempotent change. MozReview-Commit-ID: LdmSOcKDdw1 --HG-- extra : rebase_source : 273ed355a9bfb8aefdf92a85802a47ac39373d19
This commit is contained in:
Родитель
07a30fbde5
Коммит
ea25d05826
|
@ -560,7 +560,6 @@ FRAME_STATE_BIT(Block, 63, BULLET_FRAME_IMAGE_LOADING)
|
|||
FRAME_STATE_GROUP(Image, nsImageFrame)
|
||||
|
||||
FRAME_STATE_BIT(Image, 20, IMAGE_SIZECONSTRAINED)
|
||||
FRAME_STATE_BIT(Image, 21, IMAGE_GOTINITIALREFLOW)
|
||||
|
||||
|
||||
// == Frame state bits that apply to inline frames ============================
|
||||
|
|
|
@ -604,7 +604,7 @@ nsImageFrame::OnSizeAvailable(imgIRequest* aRequest, imgIContainer* aImage)
|
|||
|
||||
MarkNeedsDisplayItemRebuild();
|
||||
|
||||
if (intrinsicSizeChanged && (mState & IMAGE_GOTINITIALREFLOW)) {
|
||||
if (intrinsicSizeChanged && GotInitialReflow()) {
|
||||
// Now we need to reflow if we have an unconstrained size and have
|
||||
// already gotten the initial reflow
|
||||
if (!(mState & IMAGE_SIZECONSTRAINED)) {
|
||||
|
@ -627,7 +627,7 @@ nsImageFrame::OnFrameUpdate(imgIRequest* aRequest, const nsIntRect* aRect)
|
|||
{
|
||||
NS_ENSURE_ARG_POINTER(aRect);
|
||||
|
||||
if (!(mState & IMAGE_GOTINITIALREFLOW)) {
|
||||
if (!GotInitialReflow()) {
|
||||
// Don't bother to do anything; we have a reflow coming up!
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -692,7 +692,7 @@ nsImageFrame::OnLoadComplete(imgIRequest* aRequest, nsresult aStatus)
|
|||
void
|
||||
nsImageFrame::ResponsiveContentDensityChanged()
|
||||
{
|
||||
if (!(mState & IMAGE_GOTINITIALREFLOW)) {
|
||||
if (!GotInitialReflow()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -733,7 +733,7 @@ nsImageFrame::NotifyNewCurrentRequest(imgIRequest* aRequest, nsresult aStatus)
|
|||
mIntrinsicRatio.SizeTo(0, 0);
|
||||
}
|
||||
|
||||
if (mState & IMAGE_GOTINITIALREFLOW) { // do nothing if we haven't gotten the initial reflow yet
|
||||
if (GotInitialReflow()) {
|
||||
if (intrinsicSizeChanged) {
|
||||
if (!(mState & IMAGE_SIZECONSTRAINED)) {
|
||||
PresShell()->FrameNeedsReflow(this, nsIPresShell::eStyleChange,
|
||||
|
@ -978,12 +978,6 @@ nsImageFrame::Reflow(nsPresContext* aPresContext,
|
|||
RemoveStateBits(IMAGE_SIZECONSTRAINED);
|
||||
}
|
||||
|
||||
// XXXldb These two bits are almost exact opposites (except in the
|
||||
// middle of the initial reflow); remove IMAGE_GOTINITIALREFLOW.
|
||||
if (GetStateBits() & NS_FRAME_FIRST_REFLOW) {
|
||||
AddStateBits(IMAGE_GOTINITIALREFLOW);
|
||||
}
|
||||
|
||||
mComputedSize =
|
||||
nsSize(aReflowInput.ComputedWidth(), aReflowInput.ComputedHeight());
|
||||
|
||||
|
|
|
@ -191,6 +191,11 @@ protected:
|
|||
|
||||
void EnsureIntrinsicSizeAndRatio();
|
||||
|
||||
bool GotInitialReflow() const
|
||||
{
|
||||
return !HasAnyStateBits(NS_FRAME_FIRST_REFLOW);
|
||||
}
|
||||
|
||||
virtual mozilla::LogicalSize
|
||||
ComputeSize(gfxContext *aRenderingContext,
|
||||
mozilla::WritingMode aWritingMode,
|
||||
|
|
Загрузка…
Ссылка в новой задаче