root/Source/core/frame/DeprecatedScheduleStyleRecalcDuringLayout.cpp

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. m_wasInPerformLayout

// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "config.h"
#include "core/frame/DeprecatedScheduleStyleRecalcDuringLayout.h"

#include "wtf/Assertions.h"

namespace WebCore {

DeprecatedScheduleStyleRecalcDuringLayout::DeprecatedScheduleStyleRecalcDuringLayout(DocumentLifecycle& lifecycle)
    : m_lifecycle(lifecycle)
    , m_deprecatedTransition(DocumentLifecycle::InPerformLayout, DocumentLifecycle::StyleRecalcPending)
    , m_wasInPerformLayout(lifecycle.state() == DocumentLifecycle::InPerformLayout)
{
}

DeprecatedScheduleStyleRecalcDuringLayout::~DeprecatedScheduleStyleRecalcDuringLayout()
{
    // This block of code is intended to restore the state machine to the
    // proper state. The style recalc will still have been schedule, however.
    if (m_wasInPerformLayout && m_lifecycle.state() != DocumentLifecycle::InPerformLayout) {
        ASSERT(m_lifecycle.state() == DocumentLifecycle::StyleRecalcPending);
        m_lifecycle.advanceTo(DocumentLifecycle::InPerformLayout);
    }
}

}

/* [<][>][^][v][top][bottom][index][help] */