#include "core/frame/FrameHost.h"
#include "core/frame/FrameView.h"
#include "core/frame/Settings.h"
-#include "core/frame/animation/AnimationController.h"
#include "core/html/HTMLFrameElementBase.h"
#include "core/inspector/InspectorInstrumentation.h"
#include "core/loader/EmptyClients.h"
#include "core/page/Page.h"
#include "core/page/scrolling/ScrollingCoordinator.h"
#include "core/rendering/HitTestResult.h"
+#include "core/rendering/RenderLayer.h"
#include "core/rendering/RenderLayerCompositor.h"
#include "core/rendering/RenderPart.h"
#include "core/rendering/RenderView.h"
DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, frameCounter, ("Frame"));
-static inline Frame* parentFromOwnerElement(HTMLFrameOwnerElement* ownerElement)
-{
- if (!ownerElement)
- return 0;
- return ownerElement->document().frame();
-}
-
static inline float parentPageZoomFactor(Frame* frame)
{
Frame* parent = frame->tree().parent();
inline Frame::Frame(PassRefPtr<FrameInit> frameInit)
: m_host(frameInit->frameHost())
- , m_treeNode(this, parentFromOwnerElement(frameInit->ownerElement()))
+ , m_treeNode(this)
, m_loader(this, frameInit->frameLoaderClient())
, m_navigationScheduler(this)
, m_script(adoptPtr(new ScriptController(this)))
, m_spellChecker(SpellChecker::create(*this))
, m_selection(adoptPtr(new FrameSelection(this)))
, m_eventHandler(adoptPtr(new EventHandler(this)))
- , m_animationController(adoptPtr(new AnimationController(this)))
, m_inputMethodController(InputMethodController::create(*this))
, m_frameInit(frameInit)
, m_pageZoomFactor(parentPageZoomFactor(this))
document()->prepareForDestruction();
}
- if (m_view)
- m_view->unscheduleRelayout();
-
eventHandler().clear();
m_view = view;
return 0;
}
-void Frame::setPrinting(bool printing, const FloatSize& pageSize, const FloatSize& originalPageSize, float maximumShrinkRatio, AdjustViewSizeOrNot shouldAdjustViewSize)
+void Frame::setPrinting(bool printing, const FloatSize& pageSize, const FloatSize& originalPageSize, float maximumShrinkRatio)
{
// In setting printing, we should not validate resources already cached for the document.
// See https://bugs.webkit.org/show_bug.cgi?id=43704
document()->styleResolverChanged(RecalcStyleImmediately);
if (shouldUsePrintingLayout()) {
- view()->forceLayoutForPagination(pageSize, originalPageSize, maximumShrinkRatio, shouldAdjustViewSize);
+ view()->forceLayoutForPagination(pageSize, originalPageSize, maximumShrinkRatio);
} else {
view()->forceLayout();
- if (shouldAdjustViewSize == AdjustViewSize)
- view()->adjustViewSize();
+ view()->adjustViewSize();
}
// Subframes of the one we're printing don't lay out to the page size.
for (RefPtr<Frame> child = tree().firstChild(); child; child = child->tree().nextSibling())
- child->setPrinting(printing, FloatSize(), FloatSize(), 0, shouldAdjustViewSize);
+ child->setPrinting(printing, FloatSize(), FloatSize(), 0);
}
bool Frame::shouldUsePrintingLayout() const
return toRenderPart(object);
}
-void Frame::dispatchVisibilityStateChangeEvent()
+void Frame::didChangeVisibilityState()
{
if (document())
- document()->dispatchVisibilityStateChangeEvent();
+ document()->didChangeVisibilityState();
Vector<RefPtr<Frame> > childFrames;
for (Frame* child = tree().firstChild(); child; child = child->tree().nextSibling())
childFrames.append(child);
for (size_t i = 0; i < childFrames.size(); ++i)
- childFrames[i]->dispatchVisibilityStateChangeEvent();
+ childFrames[i]->didChangeVisibilityState();
}
void Frame::willDetachFrameHost()
m_pageZoomFactor = pageZoomFactor;
m_textZoomFactor = textZoomFactor;
- document->recalcStyle(Force);
-
for (RefPtr<Frame> child = tree().firstChild(); child; child = child->tree().nextSibling())
child->setPageAndTextZoomFactors(m_pageZoomFactor, m_textZoomFactor);
- if (FrameView* view = this->view()) {
- if (document->renderer() && document->renderer()->needsLayout() && view->didFirstLayout())
- view->layout();
- }
+ document->setNeedsStyleRecalc(SubtreeStyleChange);
+ document->updateLayoutIgnorePendingStylesheets();
}
void Frame::deviceOrPageScaleFactorChanged()
buffer->context()->translate(-paintingRect.x(), -paintingRect.y());
buffer->context()->clip(FloatRect(0, 0, paintingRect.maxX(), paintingRect.maxY()));
+ // https://code.google.com/p/chromium/issues/detail?id=343755
+ DisableCompositingQueryAsserts disabler;
m_view->paintContents(buffer->context(), paintingRect);
RefPtr<Image> image = buffer->copyImage();
return 0;
double ratio = m_host->deviceScaleFactor();
- if (RuntimeEnabledFeatures::devicePixelRatioIncludesZoomEnabled())
- ratio *= pageZoomFactor();
+ ratio *= pageZoomFactor();
return ratio;
}