#include "core/rendering/RenderInline.h"
#include "core/rendering/RenderLayer.h"
#include "core/rendering/RenderListItem.h"
-#include "core/rendering/RenderMarquee.h"
#include "core/rendering/RenderObjectInlines.h"
#include "core/rendering/RenderPart.h"
#include "core/rendering/RenderScrollbarPart.h"
#include "platform/TraceEvent.h"
#include "platform/TracedValue.h"
#include "platform/geometry/TransformState.h"
-#include "platform/graphics/FirstPaintInvalidationTracking.h"
#include "platform/graphics/GraphicsContext.h"
#include "wtf/RefCountedLeakCounter.h"
#include "wtf/text/StringBuilder.h"
static bool gModifyRenderTreeStructureAnyState = false;
-typedef WillBeHeapHashSet<RawPtrWillBeWeakMember<const RenderObject> > RenderObjectWeakSet;
-RenderObjectWeakSet& renderObjectNeverHadPaintInvalidationSet()
-{
- DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<RenderObjectWeakSet>, set, (adoptPtrWillBeNoop(new RenderObjectWeakSet())));
- return *set;
-}
-
} // namespace
using namespace HTMLNames;
bool RenderObject::s_affectsParentBlock = false;
+typedef HashMap<const RenderObject*, LayoutRect> SelectionPaintInvalidationMap;
+static SelectionPaintInvalidationMap* selectionPaintInvalidationMap = 0;
+
#if !ENABLE(OILPAN)
void* RenderObject::operator new(size_t sz)
{
#endif
, m_bitfields(node)
{
- if (firstPaintInvalidationTrackingEnabled())
- renderObjectNeverHadPaintInvalidationSet().add(this);
-
#ifndef NDEBUG
renderObjectCounter.increment();
#endif
RenderObject::~RenderObject()
{
- if (firstPaintInvalidationTrackingEnabled())
- renderObjectNeverHadPaintInvalidationSet().remove(this);
-
ASSERT(!m_hasAXObject);
#if ENABLE(OILPAN)
ASSERT(m_didCallDestroy);
{
}
-void RenderObject::setHadPaintInvalidation()
-{
- if (firstPaintInvalidationTrackingEnabled())
- renderObjectNeverHadPaintInvalidationSet().remove(this);
-}
-
-bool RenderObject::hadPaintInvalidation() const
-{
- if (!firstPaintInvalidationTrackingEnabled())
- return true;
-
- return !renderObjectNeverHadPaintInvalidationSet().contains(this);
-}
-
const RenderLayerModelObject* RenderObject::containerForPaintInvalidation() const
{
RELEASE_ASSERT(isRooted());
return clippedOverflowRectForPaintInvalidation(paintInvalidationContainer, paintInvalidationState);
}
-void RenderObject::invalidatePaintUsingContainer(const RenderLayerModelObject* paintInvalidationContainer, const LayoutRect& r, InvalidationReason invalidationReason) const
+void RenderObject::invalidatePaintUsingContainer(const RenderLayerModelObject* paintInvalidationContainer, const LayoutRect& r, PaintInvalidationReason invalidationReason) const
{
+ if (RuntimeEnabledFeatures::slimmingPaintEnabled())
+ view()->viewDisplayList().invalidate(this);
+
if (r.isEmpty())
return;
"data", InspectorPaintInvalidationTrackingEvent::data(this, paintInvalidationContainer));
TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "RenderObject::invalidatePaintUsingContainer()",
"object", this->debugName().ascii(),
- "info", jsonObjectForPaintInvalidationInfo(r, invalidationReasonToString(invalidationReason)));
+ "info", jsonObjectForPaintInvalidationInfo(r, paintInvalidationReasonToString(invalidationReason)));
if (paintInvalidationContainer->isRenderFlowThread()) {
toRenderFlowThread(paintInvalidationContainer)->paintInvalidationRectangleInRegions(r);
}
if (paintInvalidationContainer->isRenderView()) {
- toRenderView(paintInvalidationContainer)->invalidatePaintForRectangle(r);
+ toRenderView(paintInvalidationContainer)->invalidatePaintForRectangle(r, invalidationReason);
return;
}
if (paintInvalidationContainer->view()->usesCompositing()) {
ASSERT(paintInvalidationContainer->isPaintInvalidationContainer());
- paintInvalidationContainer->setBackingNeedsPaintInvalidationInRect(r);
+ paintInvalidationContainer->setBackingNeedsPaintInvalidationInRect(r, invalidationReason);
}
}
const RenderLayerModelObject* paintInvalidationContainer = containerForPaintInvalidation();
RenderLayer::mapRectToPaintInvalidationBacking(this, paintInvalidationContainer, dirtyRect);
- invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRect, InvalidationPaintRectangle);
+ invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRect, PaintInvalidationRectangle);
}
IntRect RenderObject::pixelSnappedAbsoluteClippedOverflowRect() const
return pixelSnappedIntRect(absoluteClippedOverflowRect());
}
-const char* RenderObject::invalidationReasonToString(InvalidationReason reason) const
-{
- switch (reason) {
- case InvalidationNone:
- return "none";
- case InvalidationIncremental:
- return "incremental";
- case InvalidationFull:
- return "full";
- case InvalidationBorderFitLines:
- return "border fit lines";
- case InvalidationBorderBoxChange:
- return "border box change";
- case InvalidationBoundsChange:
- return "bounds change";
- case InvalidationLocationChange:
- return "location change";
- case InvalidationBecameVisible:
- return "became visible";
- case InvalidationBecameInvisible:
- return "became invisible";
- case InvalidationScroll:
- return "scroll";
- case InvalidationSelection:
- return "selection";
- case InvalidationLayer:
- return "layer";
- case InvalidationRendererRemoval:
- return "renderer removal";
- case InvalidationPaintRectangle:
- return "invalidate paint rectangle";
- }
- ASSERT_NOT_REACHED();
- return "";
-}
-
void RenderObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInvalidationState)
{
ASSERT(!needsLayout());
return value;
}
-InvalidationReason RenderObject::invalidatePaintIfNeeded(const PaintInvalidationState& paintInvalidationState, const RenderLayerModelObject& paintInvalidationContainer)
+LayoutRect RenderObject::previousSelectionRectForPaintInvalidation() const
+{
+ ASSERT(shouldInvalidateSelection());
+
+ if (!selectionPaintInvalidationMap)
+ return LayoutRect();
+
+ return selectionPaintInvalidationMap->get(this);
+}
+
+void RenderObject::setPreviousSelectionRectForPaintInvalidation(const LayoutRect& selectionRect)
+{
+ if (!selectionPaintInvalidationMap)
+ selectionPaintInvalidationMap = new SelectionPaintInvalidationMap();
+
+ selectionPaintInvalidationMap->set(this, selectionRect);
+}
+
+void RenderObject::invalidateSelectionIfNeeded(const RenderLayerModelObject& paintInvalidationContainer, PaintInvalidationReason invalidationReason)
+{
+ if (!shouldInvalidateSelection())
+ return;
+
+ LayoutRect oldSelectionRect = previousSelectionRectForPaintInvalidation();
+ LayoutRect previousSelectionRectForPaintInvalidation = selectionRectForPaintInvalidation(&paintInvalidationContainer);
+ // FIXME: groupedMapping() leaks the squashing abstraction.
+ if (paintInvalidationContainer.layer()->groupedMapping())
+ RenderLayer::mapRectToPaintBackingCoordinates(&paintInvalidationContainer, previousSelectionRectForPaintInvalidation);
+ setPreviousSelectionRectForPaintInvalidation(previousSelectionRectForPaintInvalidation);
+
+ if (view()->doingFullPaintInvalidation() || isFullPaintInvalidationReason(invalidationReason))
+ return;
+
+ fullyInvalidatePaint(paintInvalidationContainer, PaintInvalidationSelection, oldSelectionRect, previousSelectionRectForPaintInvalidation);
+}
+
+PaintInvalidationReason RenderObject::invalidatePaintIfNeeded(const PaintInvalidationState& paintInvalidationState, const RenderLayerModelObject& paintInvalidationContainer)
{
RenderView* v = view();
if (v->document().printing())
- return InvalidationNone; // Don't invalidate paints if we're printing.
+ return PaintInvalidationNone; // Don't invalidate paints if we're printing.
const LayoutRect oldBounds = previousPaintInvalidationRect();
const LayoutPoint oldLocation = previousPositionFromPaintInvalidationBacking();
setPreviousPaintInvalidationRect(newBounds);
setPreviousPositionFromPaintInvalidationBacking(newLocation);
+ PaintInvalidationReason invalidationReason = paintInvalidationReason(paintInvalidationContainer, oldBounds, oldLocation, newBounds, newLocation);
+
+ // We need to invalidate the selection before checking for whether we are doing a full invalidation.
+ // This is because we need to update the old rect regardless.
+ invalidateSelectionIfNeeded(paintInvalidationContainer, invalidationReason);
+
// If we are set to do a full paint invalidation that means the RenderView will issue
// paint invalidations. We can then skip issuing of paint invalidations for the child
// renderers as they'll be covered by the RenderView.
if (view()->doingFullPaintInvalidation())
- return InvalidationNone;
+ return invalidationReason;
TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "RenderObject::invalidatePaintIfNeeded()",
"object", this->debugName().ascii(),
"info", jsonObjectForOldAndNewRects(oldBounds, oldLocation, newBounds, newLocation));
- InvalidationReason invalidationReason = getPaintInvalidationReason(paintInvalidationContainer, oldBounds, oldLocation, newBounds, newLocation);
-
- if (invalidationReason == InvalidationNone)
+ if (invalidationReason == PaintInvalidationNone)
return invalidationReason;
- if (invalidationReason == InvalidationIncremental) {
+ if (invalidationReason == PaintInvalidationIncremental) {
incrementallyInvalidatePaint(paintInvalidationContainer, oldBounds, newBounds, newLocation);
return invalidationReason;
}
return invalidationReason;
}
-InvalidationReason RenderObject::getPaintInvalidationReason(const RenderLayerModelObject& paintInvalidationContainer,
- const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInvalidationBacking, const LayoutRect& newBounds, const LayoutPoint& newPositionFromPaintInvalidationBacking)
+PaintInvalidationReason RenderObject::paintInvalidationReason(const RenderLayerModelObject& paintInvalidationContainer,
+ const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInvalidationBacking,
+ const LayoutRect& newBounds, const LayoutPoint& newPositionFromPaintInvalidationBacking) const
{
- if (shouldDoFullPaintInvalidation())
- return InvalidationFull;
-
- // Presumably a background or a border exists if border-fit:lines was specified.
- if (style()->borderFit() == BorderFitLines)
- return InvalidationBorderFitLines;
+ // First check for InvalidationLocationChange to avoid it from being hidden by other
+ // invalidation reasons because we'll need to force check for paint invalidation for
+ // children when location of this object changed.
+ if (newPositionFromPaintInvalidationBacking != oldPositionFromPaintInvalidationBacking)
+ return PaintInvalidationLocationChange;
- if (compositingState() != PaintsIntoOwnBacking && newPositionFromPaintInvalidationBacking != oldPositionFromPaintInvalidationBacking)
- return InvalidationLocationChange;
+ if (shouldDoFullPaintInvalidation())
+ return m_bitfields.fullPaintInvalidationReason();
// If the bounds are the same then we know that none of the statements below
// can match, so we can early out since we will not need to do any
// invalidation.
if (oldBounds == newBounds)
- return InvalidationNone;
+ return PaintInvalidationNone;
// If we shifted, we don't know the exact reason so we are conservative and trigger a full invalidation. Shifting could
// be caused by some layout property (left / top) or some in-flow renderer inserted / removed before us in the tree.
if (newBounds.location() != oldBounds.location())
- return InvalidationBoundsChange;
+ return PaintInvalidationBoundsChange;
// This covers the case where we mark containing blocks for layout
// and they change size but don't have anything to paint. This is
// a pretty common case for <body> as we add / remove children
// (and the default background is done by FrameView).
if (skipInvalidationWhenLaidOutChildren())
- return InvalidationNone;
+ return PaintInvalidationNone;
// If the size is zero on one of our bounds then we know we're going to have
// to do a full invalidation of either old bounds or new bounds. If we fall
// into the incremental invalidation we'll issue two invalidations instead
// of one.
if (oldBounds.isEmpty())
- return InvalidationBecameVisible;
+ return PaintInvalidationBecameVisible;
if (newBounds.isEmpty())
- return InvalidationBecameInvisible;
+ return PaintInvalidationBecameInvisible;
- return InvalidationIncremental;
+ return PaintInvalidationIncremental;
}
void RenderObject::incrementallyInvalidatePaint(const RenderLayerModelObject& paintInvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBounds, const LayoutPoint& positionFromPaintInvalidationBacking)
LayoutUnit deltaRight = newBounds.maxX() - oldBounds.maxX();
if (deltaRight > 0)
- invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(oldBounds.maxX(), newBounds.y(), deltaRight, newBounds.height()), InvalidationIncremental);
+ invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(oldBounds.maxX(), newBounds.y(), deltaRight, newBounds.height()), PaintInvalidationIncremental);
else if (deltaRight < 0)
- invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(newBounds.maxX(), oldBounds.y(), -deltaRight, oldBounds.height()), InvalidationIncremental);
+ invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(newBounds.maxX(), oldBounds.y(), -deltaRight, oldBounds.height()), PaintInvalidationIncremental);
LayoutUnit deltaBottom = newBounds.maxY() - oldBounds.maxY();
if (deltaBottom > 0)
- invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(newBounds.x(), oldBounds.maxY(), newBounds.width(), deltaBottom), InvalidationIncremental);
+ invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(newBounds.x(), oldBounds.maxY(), newBounds.width(), deltaBottom), PaintInvalidationIncremental);
else if (deltaBottom < 0)
- invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(oldBounds.x(), newBounds.maxY(), oldBounds.width(), -deltaBottom), InvalidationIncremental);
+ invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(oldBounds.x(), newBounds.maxY(), oldBounds.width(), -deltaBottom), PaintInvalidationIncremental);
}
-void RenderObject::fullyInvalidatePaint(const RenderLayerModelObject& paintInvalidationContainer, InvalidationReason invalidationReason, const LayoutRect& oldBounds, const LayoutRect& newBounds)
+void RenderObject::fullyInvalidatePaint(const RenderLayerModelObject& paintInvalidationContainer, PaintInvalidationReason invalidationReason, const LayoutRect& oldBounds, const LayoutRect& newBounds)
{
// Otherwise do full paint invalidation.
invalidatePaintUsingContainer(&paintInvalidationContainer, oldBounds, invalidationReason);
invalidatePaintForOverflow();
}
-bool RenderObject::checkForPaintInvalidation() const
-{
- return !document().view()->needsFullPaintInvalidation() && everHadLayout();
-}
-
LayoutRect RenderObject::rectWithOutlineForPaintInvalidation(const RenderLayerModelObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInvalidationState* paintInvalidationState) const
{
LayoutRect r(clippedOverflowRectForPaintInvalidation(paintInvalidationContainer, paintInvalidationState));
if (paintInvalidationContainer == this)
return;
+ if (paintInvalidationState && paintInvalidationState->canMapToContainer(paintInvalidationContainer)) {
+ rect.move(paintInvalidationState->paintOffset());
+ if (paintInvalidationState->isClipped())
+ rect.intersect(paintInvalidationState->clipRect());
+ return;
+ }
+
if (RenderObject* o = parent()) {
if (o->isRenderBlockFlow()) {
RenderBlock* cb = toRenderBlock(o);
diff.setNeedsPaintInvalidationLayer();
}
- if (diff.textOrColorChanged() && !diff.needsPaintInvalidation()
- && hasImmediateNonWhitespaceTextChildOrPropertiesDependentOnColor())
- diff.setNeedsPaintInvalidationObject();
+ if (diff.textOrColorChanged() && !diff.needsPaintInvalidation()) {
+ if (style()->hasBorder() || style()->hasOutline()
+ || (isText() && !toRenderText(this)->isAllCollapsibleWhitespace()))
+ diff.setNeedsPaintInvalidationObject();
+ }
// The answer to layerTypeRequired() for plugins, iframes, and canvas can change without the actual
// style changing, since it depends on whether we decide to composite these elements. When the
setStyle(pseudoStyle);
}
-inline bool RenderObject::hasImmediateNonWhitespaceTextChildOrPropertiesDependentOnColor() const
-{
- if (style()->hasBorder() || style()->hasOutline())
- return true;
- for (const RenderObject* r = slowFirstChild(); r; r = r->nextSibling()) {
- if (r->isText() && !toRenderText(r)->isAllCollapsibleWhitespace())
- return true;
- if (r->style()->hasOutline() || r->style()->hasBorder())
- return true;
- }
- return false;
-}
-
void RenderObject::markContainingBlocksForOverflowRecalc()
{
for (RenderBlock* container = containingBlock(); container && !container->childNeedsOverflowRecalcAfterStyleChange(); container = container->containingBlock())
updateShapeImage(oldStyle ? oldStyle->shapeOutside() : 0, m_style->shapeOutside());
- bool doesNotNeedLayout = !m_parent || isText();
+ bool doesNotNeedLayoutOrPaintInvalidation = !m_parent;
styleDidChange(diff, oldStyle.get());
// FIXME: |this| might be destroyed here. This can currently happen for a RenderTextFragment when
// its first-letter block gets an update in RenderTextFragment::styleDidChange. For RenderTextFragment(s),
- // we will safely bail out with the doesNotNeedLayout flag. We might want to broaden this condition
- // in the future as we move renderer changes out of layout and into style changes.
- if (doesNotNeedLayout)
+ // we will safely bail out with the doesNotNeedLayoutOrPaintInvalidation flag. We might want to broaden
+ // this condition in the future as we move renderer changes out of layout and into style changes.
+ if (doesNotNeedLayoutOrPaintInvalidation)
return;
// Now that the layer (if any) has been updated, we need to adjust the diff again,
if (updatedDiff.needsPaintInvalidationLayer())
toRenderLayerModelObject(this)->layer()->setShouldDoFullPaintInvalidationIncludingNonCompositingDescendants();
else if (diff.needsPaintInvalidationObject() || updatedDiff.needsPaintInvalidationObject())
- setShouldDoFullPaintInvalidation(true);
+ setShouldDoFullPaintInvalidation();
}
static inline bool rendererHasBackground(const RenderObject* renderer)
// FIXME: this should call offsetFromContainer to share code, but I'm not sure it's ever called.
LayoutPoint centerPoint = roundedLayoutPoint(transformState.mappedPoint());
if (mode & ApplyContainerFlip && o->isBox()) {
- if (o->style()->isFlippedBlocksWritingMode())
+ if (o->style()->slowIsFlippedBlocksWritingMode())
transformState.move(toRenderBox(o)->flipForWritingModeIncludingColumns(roundedLayoutPoint(transformState.mappedPoint())) - centerPoint);
mode &= ~ApplyContainerFlip;
}
ASSERT(nextContainer); // This means we reached the top without finding container.
if (!nextContainer)
break;
- ASSERT(!currContainer->hasTransform());
+ ASSERT(!currContainer->hasTransformRelatedProperty());
LayoutSize currentOffset = currContainer->offsetFromContainer(nextContainer, referencePoint);
offset += currentOffset;
referencePoint.move(currentOffset);
if (hasCounterNodeMap())
RenderCounter::destroyCounterNodes(*this);
- // Remove the handler if node had touch-action set. Don't call when
- // document is being destroyed as all handlers will have been cleared
- // previously. Handlers are not added for text nodes so don't try removing
- // for one too. Need to check if m_style is null in cases of partial construction.
- if (!documentBeingDestroyed() && node() && !node()->isTextNode() && m_style && m_style->touchAction() != TouchActionAuto)
- document().frameHost()->eventHandlerRegistry().didRemoveEventHandler(*node(), EventHandlerRegistry::TouchEvent);
+ // Remove the handler if node had touch-action set. Handlers are not added
+ // for text nodes so don't try removing for one too. Need to check if
+ // m_style is null in cases of partial construction. Any handler we added
+ // previously may have already been removed by the Document independently.
+ if (node() && !node()->isTextNode() && m_style && m_style->touchAction() != TouchActionAuto) {
+ EventHandlerRegistry& registry = document().frameHost()->eventHandlerRegistry();
+ if (registry.eventHandlerTargets(EventHandlerRegistry::TouchEvent)->contains(node()))
+ registry.didRemoveEventHandler(*node(), EventHandlerRegistry::TouchEvent);
+ }
setAncestorLineBoxDirty(false);
+ if (selectionPaintInvalidationMap)
+ selectionPaintInvalidationMap->remove(this);
+
clearLayoutRootIfNeeded();
}
if (!isFloating() && parent()->childrenInline())
parent()->dirtyLinesFromChangedChild(this);
+
+ if (RenderFlowThread* flowThread = parent()->flowThreadContainingBlock())
+ flowThread->flowThreadDescendantWasInserted(this);
}
void RenderObject::willBeRemovedFromTree()
for (RenderObject* child = children->firstChild(); child; child = child->nextSibling())
child->removeFromRenderFlowThreadRecursive(renderFlowThread);
}
-
setFlowThreadState(NotInsideFlowThread);
}
setIsDragging(dragOn);
if (valueChanged && node()) {
if (node()->isElementNode() && toElement(node())->childrenOrSiblingsAffectedByDrag())
- node()->setNeedsStyleRecalc(SubtreeStyleChange);
+ node()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::Drag));
else if (style()->affectedByDrag())
- node()->setNeedsStyleRecalc(LocalStyleChange);
+ node()->setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::Drag));
}
for (RenderObject* curr = slowFirstChild(); curr; curr = curr->nextSibling())
curr->updateDragState(dragOn);
void RenderObject::forceLayout()
{
setSelfNeedsLayout(true);
- setShouldDoFullPaintInvalidation(true);
+ setShouldDoFullPaintInvalidation();
layout();
}
return objectIsRelayoutBoundary(this);
}
-void RenderObject::setShouldDoFullPaintInvalidation(bool b, MarkingBehavior markBehavior)
+static PaintInvalidationReason documentLifecycleBasedPaintInvalidationReason(const DocumentLifecycle& documentLifecycle)
{
- // RenderText objects don't know how to invalidate paint for themselves, since they don't know how to compute their bounds.
- // Instead the parent fully invalidate when any text needs full paint invalidation.
- if (isText()) {
- parent()->setShouldDoFullPaintInvalidation(b, markBehavior);
- return;
+ switch (documentLifecycle.state()) {
+ case DocumentLifecycle::InStyleRecalc:
+ return PaintInvalidationStyleChange;
+ case DocumentLifecycle::InPreLayout:
+ case DocumentLifecycle::InPerformLayout:
+ case DocumentLifecycle::AfterPerformLayout:
+ return PaintInvalidationForcedByLayout;
+ case DocumentLifecycle::InCompositingUpdate:
+ return PaintInvalidationCompositingUpdate;
+ default:
+ return PaintInvalidationFull;
}
+}
- m_bitfields.setShouldDoFullPaintInvalidation(b);
+void RenderObject::setShouldDoFullPaintInvalidation(PaintInvalidationReason reason)
+{
+ // Only full invalidation reasons are allowed.
+ ASSERT(isFullPaintInvalidationReason(reason));
- if (markBehavior == MarkContainingBlockChain && b) {
- ASSERT(document().lifecycle().state() != DocumentLifecycle::InPaintInvalidation);
- frame()->page()->animator().scheduleVisualUpdate(); // In case that this is called not during FrameView::updateLayoutAndStyleForPainting().
- markContainingBlockChainForPaintInvalidation();
+ if (m_bitfields.fullPaintInvalidationReason() == PaintInvalidationNone) {
+ if (reason == PaintInvalidationFull)
+ reason = documentLifecycleBasedPaintInvalidationReason(document().lifecycle());
+ m_bitfields.setFullPaintInvalidationReason(reason);
}
+
+ ASSERT(document().lifecycle().state() != DocumentLifecycle::InPaintInvalidation);
+ frame()->page()->animator().scheduleVisualUpdate(); // In case that this is called not during FrameView::updateLayoutAndStyleForPainting().
+ markContainingBlockChainForPaintInvalidation();
}
void RenderObject::clearPaintInvalidationState(const PaintInvalidationState& paintInvalidationState)
// paintInvalidationStateIsDirty should be kept in sync with the
// booleans that are cleared below.
ASSERT(paintInvalidationState.forceCheckForPaintInvalidation() || paintInvalidationStateIsDirty());
- setShouldDoFullPaintInvalidation(false);
- setShouldDoFullPaintInvalidationIfSelfPaintingLayer(false);
- setOnlyNeededPositionedMovementLayout(false);
+ clearShouldDoFullPaintInvalidation();
setNeededLayoutBecauseOfChildren(false);
setShouldInvalidateOverflowForPaint(false);
- setLayoutDidGetCalled(false);
+ clearLayoutDidGetCalledSinceLastFrame();
setMayNeedPaintInvalidation(false);
+ clearShouldInvalidateSelection();
}
bool RenderObject::isAllowedToModifyRenderTreeStructure(Document& document)
void RenderObject::invalidatePaintIncludingNonCompositingDescendantsInternal(const RenderLayerModelObject* paintInvalidationContainer)
{
- invalidatePaintUsingContainer(paintInvalidationContainer, previousPaintInvalidationRect(), InvalidationLayer);
+ invalidatePaintUsingContainer(paintInvalidationContainer, previousPaintInvalidationRect(), PaintInvalidationLayer);
for (RenderObject* child = slowFirstChild(); child; child = child->nextSibling()) {
if (!child->isPaintInvalidationContainer())