bool HTMLPlugInImageElement::isTopLevelFullPagePlugin(const RenderEmbeddedObject& renderer) const { Frame& frame = *document().frame(); if (!frame.isMainFrame()) return false; auto& style = renderer.style(); IntSize visibleSize = frame.view()->visibleSize(); LayoutRect contentRect = renderer.contentBoxRect(); int contentWidth = contentRect.width(); int contentHeight = contentRect.height(); return is100Percent(style.width()) && is100Percent(style.height()) && contentWidth * contentHeight > visibleSize.area() * sizingFullPageAreaRatioThreshold; }
static inline bool isSmallerThanTinySizingThreshold(const RenderEmbeddedObject& renderer) { LayoutRect contentRect = renderer.contentBoxRect(); return contentRect.width() <= sizingTinyDimensionThreshold || contentRect.height() <= sizingTinyDimensionThreshold; }