Example #1
0
StyleDifference RenderStyle::visualInvalidationDiff(const RenderStyle& other) const
{
    // Note, we use .get() on each DataRef below because DataRef::operator== will do a deep
    // compare, which is duplicate work when we're going to compare each property inside
    // this function anyway.

    StyleDifference diff;

    if (diffNeedsFullLayout(other)) {
        diff.setNeedsFullLayout();
    } else if (position() != StaticPosition && surround->offset != other.surround->offset) {
        // Optimize for the case where a positioned layer is moving but not changing size.
        if (positionedObjectMovedOnly(surround->offset, other.surround->offset, m_box->width()))
            diff.setNeedsPositionedMovementLayout();
        else
            diff.setNeedsFullLayout();
    }

    updatePropertySpecificDifferences(other, diff);

    // Cursors are not checked, since they will be set appropriately in response to mouse events,
    // so they don't need to cause any paint invalidation or layout.

    return diff;
}