void RenderVideo::imageChanged(WrappedImagePtr newImage, const IntRect* rect) { RenderMedia::imageChanged(newImage, rect); // Cache the image intrinsic size so we can continue to use it to draw the image correctly // even if we know the video intrinsic size but aren't able to draw video frames yet // (we don't want to scale the poster to the video size without keeping aspect ratio). if (videoElement()->shouldDisplayPosterImage()) m_cachedImageSize = intrinsicSize(); // The intrinsic size is now that of the image, but in case we already had the // intrinsic size of the video we call this here to restore the video size. updateIntrinsicSize(); }
LayoutSVGRoot::LayoutSVGRoot(SVGElement* node) : LayoutReplaced(node) , m_objectBoundingBoxValid(false) , m_isLayoutSizeChanged(false) , m_needsBoundariesOrTransformUpdate(true) , m_hasBoxDecorationBackground(false) , m_hasNonIsolatedBlendingDescendants(false) , m_hasNonIsolatedBlendingDescendantsDirty(false) { LayoutSize intrinsicSize(calculateIntrinsicSize()); if (!intrinsicSize.width()) intrinsicSize.setWidth(defaultWidth); if (!intrinsicSize.height()) intrinsicSize.setHeight(defaultHeight); setIntrinsicSize(intrinsicSize); }
void RenderSVGImage::layout() { ASSERT(needsLayout()); LayoutRepainter repainter(*this, checkForRepaintDuringLayout()); SVGImageElement* image = static_cast<SVGImageElement*>(node()); m_localTransform = image->animatedLocalTransform(); // minimum height setHeight(errorOccurred() ? intrinsicSize().height() : 0); calcWidth(); calcHeight(); m_localBounds = FloatRect(image->x().value(image), image->y().value(image), image->width().value(image), image->height().value(image)); repainter.repaintAfterLayout(); setNeedsLayout(false); }
void RenderHTMLCanvas::canvasSizeChanged() { IntSize canvasSize = toHTMLCanvasElement(node())->size(); if (canvasSize == intrinsicSize()) return; setIntrinsicSize(canvasSize); if (!parent()) return; if (!preferredLogicalWidthsDirty()) setPreferredLogicalWidthsDirty(); LayoutSize oldSize = size(); updateLogicalWidth(); updateLogicalHeight(); if (oldSize == size()) return; if (!selfNeedsLayout()) setNeedsLayoutAndFullPaintInvalidation(); }
LayoutUnit RenderImage::minimumReplacedHeight() const { return m_imageResource->errorOccurred() ? intrinsicSize().height() : LayoutUnit(); }