RenderWidget* HTMLEmbedElement::renderWidgetForJSBindings() const { FrameView* view = document().view(); if (!view || (!view->isInLayout() && !view->isPainting())) document().updateLayoutIgnorePendingStylesheets(); return findWidgetRenderer(this); }
void SVGImageCache::redrawTimerFired(Timer<SVGImageCache>*) { // We have no guarantee that the frame does not require layout when the timer fired. // So be sure to check again in case it is still not safe to run redraw. FrameView* frameView = m_svgImage->frameView(); if (frameView && (frameView->needsLayout() || frameView->isInLayout())) { if (!m_redrawTimer.isActive()) m_redrawTimer.startOneShot(0); } else redraw(); }
RenderWidget* HTMLEmbedElement::renderWidgetLoadingPlugin() const { FrameView* view = document().view(); if (!view || (!view->isInLayout() && !view->isPainting())) { // Needs to load the plugin immediatedly because this function is called // when JavaScript code accesses the plugin. // FIXME: <rdar://16893708> Check if dispatching events here is safe. document().updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasks::Synchronously); } return findWidgetRenderer(this); }
void SVGImageCache::imageContentChanged() { ImageDataMap::iterator end = m_imageDataMap.end(); for (ImageDataMap::iterator it = m_imageDataMap.begin(); it != end; ++it) it->second.imageNeedsUpdate = true; // If we're in the middle of layout, start redrawing dirty // images on a timer; otherwise it's safe to draw immediately. FrameView* frameView = m_svgImage->frameView(); if (frameView && (frameView->needsLayout() || frameView->isInLayout())) { if (!m_redrawTimer.isActive()) m_redrawTimer.startOneShot(0); } else redraw(); }