bool RenderIFrame::flattenFrame() const { if (!node() || !node()->hasTagName(iframeTag)) return false; HTMLIFrameElement* element = static_cast<HTMLIFrameElement*>(node()); Frame* frame = element->document()->frame(); if (isSeamless()) return false; // Seamless iframes are already "flat", don't try to flatten them. bool enabled = frame && frame->settings() && frame->settings()->frameFlatteningEnabled(); if (!enabled || !frame->page()) return false; if (style()->width().isFixed() && style()->height().isFixed()) { // Do not flatten iframes with scrolling="no". if (element->scrollingMode() == ScrollbarAlwaysOff) return false; if (style()->width().value() <= 0 || style()->height().value() <= 0) return false; } // Do not flatten offscreen inner frames during frame flattening, as flattening might make them visible. IntRect boundingRect = absoluteBoundingBoxRectIgnoringTransforms(); return boundingRect.maxX() > 0 && boundingRect.maxY() > 0; }
bool RenderIFrame::flattenFrame() { if (!node() || !node()->hasTagName(iframeTag)) return false; HTMLIFrameElement* element = static_cast<HTMLIFrameElement*>(node()); bool isScrollable = element->scrollingMode() != ScrollbarAlwaysOff; if (style()->width().isFixed() && style()->height().isFixed()) { if (!isScrollable) return false; if (style()->width().value() <= 0 || style()->height().value() <= 0) return false; } Frame* frame = element->document()->frame(); bool enabled = frame && frame->settings()->frameFlatteningEnabled(); if (!enabled || !frame->page()) return false; FrameView* view = frame->page()->mainFrame()->view(); if (!view) return false; // Do not flatten offscreen inner frames during frame flattening, as flattening might make them visible. IntRect boundingRect = absoluteBoundingBoxRect(); return boundingRect.maxX() > 0 && boundingRect.maxY() > 0; }
bool RenderIFrame::flattenFrame() { if (!node() || !node()->hasTagName(iframeTag)) return false; HTMLIFrameElement* element = static_cast<HTMLIFrameElement*>(node()); bool isScrollable = element->scrollingMode() != ScrollbarAlwaysOff; if (style()->width().isFixed() && style()->height().isFixed()) { if (!isScrollable) return false; if (style()->width().value() <= 0 || style()->height().value() <= 0) return false; } Frame* frame = element->document()->frame(); bool enabled = frame && frame->settings()->frameFlatteningEnabled(); if (!enabled || !frame->page()) return false; FrameView* view = frame->page()->mainFrame()->view(); if (!view) return false; // Do not flatten offscreen inner frames during frame flattening. return absoluteBoundingBoxRect().intersects(IntRect(IntPoint(0, 0), view->contentsSize())); }
static void collectActiveCSSStyleSheetsFromSeamlessParents(Vector<RefPtr<CSSStyleSheet> >& sheets, Document* document) { HTMLIFrameElement* seamlessParentIFrame = document->seamlessParentIFrame(); if (!seamlessParentIFrame) return; sheets.appendVector(seamlessParentIFrame->document()->styleSheetCollection()->activeAuthorStyleSheets()); }
bool RenderIFrame::flattenFrame() { if (!node() || !node()->hasTagName(iframeTag)) return false; // CAPPFIX_WEB_HTML5: SECURITY if (isSeamless()) return false; // Seamless iframes are already "flat", don't try to flatten them. // CAPPFIX_WEB_HTML5_END HTMLIFrameElement* element = static_cast<HTMLIFrameElement*>(node()); bool isScrollable = element->scrollingMode() != ScrollbarAlwaysOff; if (!isScrollable && style()->width().isFixed() && style()->height().isFixed()) return false; Frame* frame = element->document()->frame(); bool enabled = frame && frame->settings()->frameFlatteningEnabled(); if (!enabled || !frame->page()) return false; FrameView* view = frame->page()->mainFrame()->view(); if (!view) return false; // Do not flatten offscreen inner frames during frame flattening. return absoluteBoundingBoxRect().intersects(IntRect(IntPoint(0, 0), view->contentsSize())); }