void RenderHTMLCanvas::canvasSizeChanged() { IntSize canvasSize = toHTMLCanvasElement(node())->size(); LayoutSize zoomedSize(canvasSize.width() * style()->effectiveZoom(), canvasSize.height() * style()->effectiveZoom()); if (zoomedSize == intrinsicSize()) return; setIntrinsicSize(zoomedSize); if (!parent()) return; if (!preferredLogicalWidthsDirty()) setPreferredLogicalWidthsDirty(); LayoutSize oldSize = size(); updateLogicalWidth(); updateLogicalHeight(); if (oldSize == size()) return; if (!selfNeedsLayout()) setNeedsLayoutAndFullPaintInvalidation(); }
RenderMedia::RenderMedia(HTMLMediaElement* video, const IntSize& intrinsicSize) : RenderImage(video) , m_controls(new MediaControls(video)) { setImageResource(RenderImageResource::create()); setIntrinsicSize(intrinsicSize); }
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 RenderImage::updateIntrinsicSizeIfNeeded(const LayoutSize& newSize) { if (m_imageResource->errorOccurred() || !m_imageResource->hasImage()) return; setIntrinsicSize(newSize); }
RenderMedia::RenderMedia(HTMLMediaElement& element, RenderStyle&& style, const IntSize& intrinsicSize) : RenderImage(element, WTFMove(style)) { setIntrinsicSize(intrinsicSize); setHasShadowControls(true); }
RenderMedia::RenderMedia(HTMLMediaElement& element, PassRef<RenderStyle> style, const IntSize& intrinsicSize) : RenderImage(element, std::move(style)) { setImageResource(RenderImageResource::create()); setIntrinsicSize(intrinsicSize); }