Commit 0258e724 authored by antti@apple.com's avatar antti@apple.com

Hide Document::renderer()

https://bugs.webkit.org/show_bug.cgi?id=121028

Reviewed by Andreas Kling.

Use less generic Document::renderView() instead.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::postNotification):
* accessibility/AccessibilityObject.cpp:
(WebCore::appendAccessibilityObject):
* accessibility/AccessibilityScrollView.cpp:
(WebCore::AccessibilityScrollView::webAreaObject):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::dispatchInvalidationCallbacks):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::appendAuthorStyleSheets):
* dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::webkitGetNamedFlows):
(WebCore::Document::setVisualUpdatesAllowed):
(WebCore::Document::elementFromPoint):
(WebCore::Document::caretRangeFromPoint):
(WebCore::Document::updateLayout):
(WebCore::Document::existingAXObjectCache):
(WebCore::Document::axObjectCache):
(WebCore::Document::setVisuallyOrdered):
(WebCore::Document::implicitClose):
(WebCore::Document::prepareMouseEvent):
(WebCore::Document::styleResolverChanged):
(WebCore::Document::documentWillBecomeInactive):
(WebCore::Document::documentDidResumeFromPageCache):
* dom/Document.h:
* dom/DocumentStyleSheetCollection.cpp:
(WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets):
* dom/Element.cpp:
(WebCore::Element::~Element):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::removedFromDocument):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::removedFrom):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::contains):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::removedFrom):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::parseAttribute):
(WebCore::HTMLStyleElement::registerWithScopingNode):
(WebCore::HTMLStyleElement::unregisterWithScopingNode):
* html/parser/HTMLResourcePreloader.cpp:
(WebCore::HTMLResourcePreloader::preload):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
(WebCore::EventHandler::handleGestureScrollBegin):
* page/Frame.cpp:
(WebCore::Frame::setPageAndTextZoomFactors):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::doLayoutWithFrameFlattening):
* page/Page.cpp:
(WebCore::Page::setPageScaleFactor):
* page/PrintContext.cpp:
(WebCore::PrintContext::spoolAllPagesWithBoundaries):
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivateQTKit::paint):
* style/StyleResolveTree.cpp:
(WebCore::Style::resolveTree):
* svg/SVGDocument.cpp:
(WebCore::SVGDocument::updatePan):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155344 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8a3491f0
2013-09-09 Antti Koivisto <antti@apple.com>
Hide Document::renderer()
https://bugs.webkit.org/show_bug.cgi?id=121028
Reviewed by Andreas Kling.
Use less generic Document::renderView() instead.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::postNotification):
* accessibility/AccessibilityObject.cpp:
(WebCore::appendAccessibilityObject):
* accessibility/AccessibilityScrollView.cpp:
(WebCore::AccessibilityScrollView::webAreaObject):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::dispatchInvalidationCallbacks):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::appendAuthorStyleSheets):
* dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::webkitGetNamedFlows):
(WebCore::Document::setVisualUpdatesAllowed):
(WebCore::Document::elementFromPoint):
(WebCore::Document::caretRangeFromPoint):
(WebCore::Document::updateLayout):
(WebCore::Document::existingAXObjectCache):
(WebCore::Document::axObjectCache):
(WebCore::Document::setVisuallyOrdered):
(WebCore::Document::implicitClose):
(WebCore::Document::prepareMouseEvent):
(WebCore::Document::styleResolverChanged):
(WebCore::Document::documentWillBecomeInactive):
(WebCore::Document::documentDidResumeFromPageCache):
* dom/Document.h:
* dom/DocumentStyleSheetCollection.cpp:
(WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets):
* dom/Element.cpp:
(WebCore::Element::~Element):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::removedFromDocument):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::removedFrom):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::contains):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::removedFrom):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::parseAttribute):
(WebCore::HTMLStyleElement::registerWithScopingNode):
(WebCore::HTMLStyleElement::unregisterWithScopingNode):
* html/parser/HTMLResourcePreloader.cpp:
(WebCore::HTMLResourcePreloader::preload):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
(WebCore::EventHandler::handleGestureScrollBegin):
* page/Frame.cpp:
(WebCore::Frame::setPageAndTextZoomFactors):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::doLayoutWithFrameFlattening):
* page/Page.cpp:
(WebCore::Page::setPageScaleFactor):
* page/PrintContext.cpp:
(WebCore::PrintContext::spoolAllPagesWithBoundaries):
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivateQTKit::paint):
* style/StyleResolveTree.cpp:
(WebCore::Style::resolveTree):
* svg/SVGDocument.cpp:
(WebCore::SVGDocument::updatePan):
2013-09-09 Christophe Dumez <ch.dumez@sisa.samsung.com>
[DOM4] Have ProcessingInstruction inherit CharacterData
......@@ -727,7 +727,7 @@ void AXObjectCache::postNotification(AccessibilityObject* object, Document* docu
object = object->observableObject();
if (!object && document)
object = get(document->renderer());
object = get(document->renderView());
if (!object)
return;
......
......@@ -398,7 +398,7 @@ static void appendAccessibilityObject(AccessibilityObject* object, Accessibility
return;
Document* doc = toFrameView(widget)->frame().document();
if (!doc || !doc->renderer())
if (!doc || !doc->renderView())
return;
object = object->axObjectCache()->getOrCreate(doc);
......
......@@ -189,7 +189,7 @@ AccessibilityObject* AccessibilityScrollView::webAreaObject() const
return 0;
Document* doc = toFrameView(m_scrollView)->frame().document();
if (!doc || !doc->renderer())
if (!doc || !doc->renderView())
return 0;
return axObjectCache()->getOrCreate(doc);
......
......@@ -351,7 +351,7 @@ void CSSFontSelector::dispatchInvalidationCallbacks()
return;
if (StyleResolver* styleResolver = m_document->styleResolverIfExists())
styleResolver->invalidateMatchedPropertiesCache();
if (m_document->inPageCache() || !m_document->renderer())
if (m_document->inPageCache() || !m_document->renderView())
return;
m_document->scheduleForcedStyleRecalc();
}
......
......@@ -298,8 +298,8 @@ StyleResolver::StyleResolver(Document& document, bool matchAuthorAndUserStyles)
void StyleResolver::appendAuthorStyleSheets(unsigned firstNew, const Vector<RefPtr<CSSStyleSheet> >& styleSheets)
{
m_ruleSets.appendAuthorStyleSheets(firstNew, styleSheets, m_medium.get(), m_inspectorCSSOMWrappers, document().isViewSource(), this);
if (document().renderer() && document().renderer()->style())
document().renderer()->style()->font().update(fontSelector());
if (document().renderView() && document().renderView()->style())
document().renderView()->style()->font().update(fontSelector());
#if ENABLE(CSS_DEVICE_ADAPTATION)
viewportStyleResolver()->resolve();
......
......@@ -543,7 +543,7 @@ static bool isAttributeOnAllOwners(const WebCore::QualifiedName& attribute, cons
Document::~Document()
{
ASSERT(!renderer());
ASSERT(!renderView());
ASSERT(!m_inPageCache);
ASSERT(!m_savedRenderView);
ASSERT(m_ranges.isEmpty());
......@@ -1151,7 +1151,7 @@ bool Document::cssGridLayoutEnabled() const
PassRefPtr<DOMNamedFlowCollection> Document::webkitGetNamedFlows()
{
if (!cssRegionsEnabled() || !renderer())
if (!cssRegionsEnabled() || !renderView())
return 0;
updateStyleIfNeeded();
......@@ -1274,7 +1274,7 @@ void Document::setVisualUpdatesAllowed(bool visualUpdatesAllowed)
return;
FrameView* frameView = view();
bool needsLayout = frameView && renderer() && (frameView->layoutPending() || renderer()->needsLayout());
bool needsLayout = frameView && renderView() && (frameView->layoutPending() || renderView()->needsLayout());
if (needsLayout)
updateLayout();
......@@ -1416,7 +1416,7 @@ String Document::suggestedMIMEType() const
Element* Document::elementFromPoint(int x, int y) const
{
if (!renderer())
if (!renderView())
return 0;
return TreeScope::elementFromPoint(x, y);
......@@ -1424,7 +1424,7 @@ Element* Document::elementFromPoint(int x, int y) const
PassRefPtr<Range> Document::caretRangeFromPoint(int x, int y)
{
if (!renderer())
if (!renderView())
return 0;
LayoutPoint localPoint;
Node* node = nodeFromPoint(this, x, y, &localPoint);
......@@ -1851,7 +1851,7 @@ void Document::updateLayout()
StackStats::LayoutCheckPoint layoutCheckPoint;
// Only do a layout if changes have occurred that make it necessary.
if (frameView && renderer() && (frameView->layoutPending() || renderer()->needsLayout()))
if (frameView && renderView() && (frameView->layoutPending() || renderView()->needsLayout()))
frameView->layout();
}
......@@ -2161,7 +2161,7 @@ AXObjectCache* Document::existingAXObjectCache() const
// If the renderer is gone then we are in the process of destruction.
// This method will be called before m_frame = 0.
if (!topDocument()->renderer())
if (!topDocument()->renderView())
return 0;
return topDocument()->m_axObjectCache.get();
......@@ -2179,7 +2179,7 @@ AXObjectCache* Document::axObjectCache() const
Document* topDocument = this->topDocument();
// If the document has already been detached, do not make a new axObjectCache.
if (!topDocument->renderer())
if (!topDocument->renderView())
return 0;
ASSERT(topDocument == this || !m_axObjectCache);
......@@ -2191,8 +2191,8 @@ AXObjectCache* Document::axObjectCache() const
void Document::setVisuallyOrdered()
{
m_visuallyOrdered = true;
if (renderer())
renderer()->style()->setRTLOrdering(VisualOrder);
if (renderView())
renderView()->style()->setRTLOrdering(VisualOrder);
}
PassRefPtr<DocumentParser> Document::createParser()
......@@ -2454,25 +2454,25 @@ void Document::implicitClose()
updateStyleIfNeeded();
// Always do a layout after loading if needed.
if (view() && renderer() && (!renderer()->firstChild() || renderer()->needsLayout()))
if (view() && renderView() && (!renderView()->firstChild() || renderView()->needsLayout()))
view()->layout();
}
m_processingLoadEvent = false;
#if PLATFORM(MAC) || PLATFORM(WIN)
if (f && renderer() && AXObjectCache::accessibilityEnabled()) {
if (f && renderView() && AXObjectCache::accessibilityEnabled()) {
// The AX cache may have been cleared at this point, but we need to make sure it contains an
// AX object to send the notification to. getOrCreate will make sure that an valid AX object
// exists in the cache (we ignore the return value because we don't need it here). This is
// only safe to call when a layout is not in progress, so it can not be used in postNotification.
axObjectCache()->getOrCreate(renderer());
axObjectCache()->getOrCreate(renderView());
if (this == topDocument())
axObjectCache()->postNotification(renderer(), AXObjectCache::AXLoadComplete, true);
axObjectCache()->postNotification(renderView(), AXObjectCache::AXLoadComplete, true);
else {
// AXLoadComplete can only be posted on the top document, so if it's a document
// in an iframe that just finished loading, post AXLayoutComplete instead.
axObjectCache()->postNotification(renderer(), AXObjectCache::AXLayoutComplete, true);
axObjectCache()->postNotification(renderView(), AXObjectCache::AXLayoutComplete, true);
}
}
#endif
......@@ -2968,9 +2968,7 @@ void Document::processReferrerPolicy(const String& policy)
MouseEventWithHitTestResults Document::prepareMouseEvent(const HitTestRequest& request, const LayoutPoint& documentPoint, const PlatformMouseEvent& event)
{
ASSERT(!renderer() || renderer()->isRenderView());
if (!renderer())
if (!renderView())
return MouseEventWithHitTestResults(event, HitTestResult(LayoutPoint()));
HitTestResult result(documentPoint);
......@@ -3181,7 +3179,7 @@ void Document::styleResolverChanged(StyleResolverUpdateFlag updateFlag)
if (didLayoutWithPendingStylesheets() && !m_styleSheetCollection->hasPendingSheets()) {
m_pendingSheetLayout = IgnoreLayoutWithPendingSheets;
if (renderer())
if (renderView())
renderView()->repaintViewAndCompositedLayers();
}
......@@ -3200,8 +3198,8 @@ void Document::styleResolverChanged(StyleResolverUpdateFlag updateFlag)
printf("Finished update of style selector at time %d\n", elapsedTime());
#endif
if (renderer()) {
renderer()->setNeedsLayoutAndPrefWidthsRecalc();
if (renderView()) {
renderView()->setNeedsLayoutAndPrefWidthsRecalc();
if (view())
view()->scheduleRelayout();
}
......@@ -4020,7 +4018,7 @@ void Document::setInPageCache(bool flag)
void Document::documentWillBecomeInactive()
{
#if USE(ACCELERATED_COMPOSITING)
if (renderer())
if (renderView())
renderView()->setIsInWindow(false);
#endif
}
......@@ -4049,7 +4047,7 @@ void Document::documentDidResumeFromPageCache()
(*i)->documentDidResumeFromPageCache();
#if USE(ACCELERATED_COMPOSITING)
if (renderer())
if (renderView())
renderView()->setIsInWindow(true);
#endif
......
......@@ -541,10 +541,6 @@ public:
// returns renderer so callers can avoid verbose casts.
RenderView* renderView() const { return m_renderView; }
// FIXME: Remove this, callers that have a Document* should call renderView().
// Shadow the implementations on Node to provide faster access for documents.
RenderView* renderer() const { return m_renderView; }
bool renderTreeBeingDestroyed() const { return m_renderTreeBeingDestroyed; }
AXObjectCache* existingAXObjectCache() const;
......@@ -1188,6 +1184,7 @@ private:
friend class Node;
friend class IgnoreDestructiveWriteCountIncrementer;
RenderObject* renderer() const WTF_DELETED_FUNCTION;
void setRenderer(RenderObject*) WTF_DELETED_FUNCTION;
void setRenderView(RenderView*);
......
......@@ -463,7 +463,7 @@ bool DocumentStyleSheetCollection::updateActiveStyleSheets(UpdateFlag updateFlag
return false;
}
if (!m_document->renderer() || !m_document->attached())
if (!m_document->renderView() || !m_document->attached())
return false;
Vector<RefPtr<StyleSheet> > activeStyleSheets;
......
......@@ -162,7 +162,7 @@ PassRefPtr<Element> Element::create(const QualifiedName& tagName, Document* docu
Element::~Element()
{
#ifndef NDEBUG
if (document().renderer()) {
if (document().renderView()) {
// When the document is not destroyed, an element that was part of a named flow
// content nodes should have been removed from the content nodes collection
// and the inNamedFlow flag reset.
......
......@@ -70,7 +70,7 @@ void InlineStyleSheetOwner::removedFromDocument(Document* document, Element* ele
clearSheet();
// If we're in document teardown, then we don't need to do any notification of our sheet's removal.
if (document->renderer())
if (document->renderView())
document->styleResolverChanged(DeferRecalcStyle);
}
......
......@@ -287,7 +287,7 @@ void ProcessingInstruction::removedFrom(ContainerNode* insertionPoint)
}
// If we're in document teardown, then we don't need to do any notification of our sheet's removal.
if (document().renderer())
if (document().renderView())
document().styleResolverChanged(DeferRecalcStyle);
}
......
......@@ -1559,7 +1559,7 @@ bool FrameSelection::contains(const LayoutPoint& point)
// Treat a collapsed selection like no selection.
if (!isRange())
return false;
if (!document->renderer())
if (!document->renderView())
return false;
HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent);
......
......@@ -914,7 +914,7 @@ void HTMLElement::calculateAndAdjustDirectionality()
void HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged(Element* beforeChange, ChildChangeType changeType)
{
// FIXME: This function looks suspicious.
if (document().renderer() && (changeType == ElementRemoved || changeType == TextRemoved)) {
if (document().renderView() && (changeType == ElementRemoved || changeType == TextRemoved)) {
Node* node = beforeChange ? beforeChange->nextSibling() : 0;
for (; node; node = node->nextSibling()) {
if (elementAffectsDirectionality(node))
......
......@@ -282,7 +282,7 @@ void HTMLLinkElement::removedFrom(ContainerNode* insertionPoint)
if (styleSheetIsLoading())
removePendingSheet(RemovePendingSheetNotifyLater);
if (document().renderer())
if (document().renderView())
document().styleResolverChanged(DeferRecalcStyleIfNeeded);
}
......
......@@ -80,7 +80,7 @@ void HTMLStyleElement::parseAttribute(const QualifiedName& name, const AtomicStr
m_styleSheetOwner.setMedia(value);
if (sheet()) {
sheet()->setMediaQueries(MediaQuerySet::createAllowingDescriptionSyntax(value));
if (inDocument() && document().renderer())
if (inDocument() && document().renderView())
document().styleResolverChanged(RecalcStyleImmediately);
}
} else if (name == typeAttr)
......@@ -147,7 +147,7 @@ void HTMLStyleElement::registerWithScopingNode(bool scoped)
scope->shadowHost()->setNeedsStyleRecalc();
else
scope->setNeedsStyleRecalc();
if (inDocument() && !document().parsing() && document().renderer())
if (inDocument() && !document().parsing() && document().renderView())
document().styleResolverChanged(DeferRecalcStyle);
m_scopedStyleRegistrationState = scoped ? RegisteredAsScoped : RegisteredInShadowRoot;
......@@ -165,7 +165,7 @@ void HTMLStyleElement::unregisterWithScopingNode(ContainerNode* scope)
scope->unregisterScopedHTMLStyleChild();
scope->setNeedsStyleRecalc();
}
if (inDocument() && !document().parsing() && document().renderer())
if (inDocument() && !document().parsing() && document().renderView())
document().styleResolverChanged(DeferRecalcStyle);
m_scopedStyleRegistrationState = NotRegistered;
......
......@@ -81,9 +81,9 @@ static bool mediaAttributeMatches(Frame* frame, RenderStyle* renderStyle, const
void HTMLResourcePreloader::preload(PassOwnPtr<PreloadRequest> preload)
{
ASSERT(m_document->frame());
ASSERT(m_document->renderer());
ASSERT(m_document->renderer()->style());
if (!preload->media().isEmpty() && !mediaAttributeMatches(m_document->frame(), m_document->renderer()->style(), preload->media()))
ASSERT(m_document->renderView());
ASSERT(m_document->renderView()->style());
if (!preload->media().isEmpty() && !mediaAttributeMatches(m_document->frame(), m_document->renderView()->style(), preload->media()))
return;
CachedResourceRequest request = preload->resourceRequest(m_document);
......
......@@ -168,7 +168,7 @@ void ImageLoader::updateFromElement()
// If we're not making renderers for the page, then don't load images. We don't want to slow
// down the raw HTML parsing case by loading images we don't intend to display.
Document& document = m_element->document();
if (!document.renderer())
if (!document.renderView())
return;
AtomicString attr = m_element->imageSourceURL();
......
......@@ -2459,7 +2459,7 @@ bool EventHandler::handleWheelEvent(const PlatformWheelEvent& e)
{
Document* doc = m_frame.document();
RenderObject* docRenderer = doc->renderer();
RenderObject* docRenderer = doc->renderView();
if (!docRenderer)
return false;
......@@ -2797,7 +2797,7 @@ bool EventHandler::passGestureEventToWidgetIfPossible(const PlatformGestureEvent
bool EventHandler::handleGestureScrollBegin(const PlatformGestureEvent& gestureEvent)
{
Document* document = m_frame.document();
RenderObject* documentRenderer = document->renderer();
RenderObject* documentRenderer = document->renderView();
if (!documentRenderer)
return false;
......
......@@ -885,7 +885,7 @@ void Frame::setPageAndTextZoomFactors(float pageZoomFactor, float textZoomFactor
child->setPageAndTextZoomFactors(m_pageZoomFactor, m_textZoomFactor);
if (FrameView* view = this->view()) {
if (document->renderer() && document->renderer()->needsLayout() && view->didFirstLayout())
if (document->renderView() && document->renderView()->needsLayout() && view->didFirstLayout())
view->layout();
}
......
......@@ -1171,7 +1171,7 @@ void FrameView::layout(bool allowSubtree)
if (hasOneRef())
return;
root = subtree ? m_layoutRoot : document->renderer();
root = subtree ? m_layoutRoot : document->renderView();
if (!root) {
// FIXME: Do we need to set m_size here?
return;
......@@ -3447,7 +3447,7 @@ bool FrameView::doLayoutWithFrameFlattening(bool allowSubtree)
parentView->layout(allowSubtree);
RenderObject* root = m_layoutRoot ? m_layoutRoot : frame().document()->renderer();
RenderObject* root = m_layoutRoot ? m_layoutRoot : frame().document()->renderView();
ASSERT_UNUSED(root, !root->needsLayout());
return true;
......
......@@ -763,8 +763,8 @@ void Page::setPageScaleFactor(float scale, const IntPoint& origin)
m_pageScaleFactor = scale;
if (!m_settings->applyPageScaleFactorInCompositor()) {
if (document->renderer())
document->renderer()->setNeedsLayout(true);
if (document->renderView())
document->renderView()->setNeedsLayout(true);
document->recalcStyle(Style::Force);
......@@ -780,7 +780,7 @@ void Page::setPageScaleFactor(float scale, const IntPoint& origin)
view->setViewportConstrainedObjectsNeedLayout();
if (view && view->scrollPosition() != origin) {
if (!m_settings->applyPageScaleFactorInCompositor() && document->renderer() && document->renderer()->needsLayout() && view->didFirstLayout())
if (!m_settings->applyPageScaleFactorInCompositor() && document->renderView() && document->renderView()->needsLayout() && view->didFirstLayout())
view->layout();
view->setScrollPosition(origin);
}
......
......@@ -317,7 +317,7 @@ int PrintContext::numberOfPages(Frame* frame, const FloatSize& pageSizeInPixels)
void PrintContext::spoolAllPagesWithBoundaries(Frame* frame, GraphicsContext& graphicsContext, const FloatSize& pageSizeInPixels)
{
if (!frame->document() || !frame->view() || !frame->document()->renderer())
if (!frame->document() || !frame->view() || !frame->document()->renderView())
return;
frame->document()->updateLayout();
......
......@@ -1354,7 +1354,7 @@ void MediaPlayerPrivateQTKit::paint(GraphicsContext* context, const IntRect& r)
if (m_frameCountWhilePlaying > 10) {
Frame* frame = m_player->frameView() ? &m_player->frameView()->frame() : NULL;
Document* document = frame ? frame->document() : NULL;
RenderObject* renderer = document ? document->renderer() : NULL;
RenderObject* renderer = document ? document->renderView() : NULL;
RenderStyle* styleToUse = renderer ? renderer->style() : NULL;
if (styleToUse) {
double frameRate = (m_frameCountWhilePlaying - 1) / ( m_startedPlaying ? ([NSDate timeIntervalSinceReferenceDate] - m_timeStartedPlaying) :
......
......@@ -811,9 +811,9 @@ void resolveTree(Document& document, Change change)
}
#endif
Style::Change documentChange = determineChange(documentStyle.get(), document.renderer()->style(), document.settings());
Style::Change documentChange = determineChange(documentStyle.get(), document.renderView()->style(), document.settings());
if (documentChange != NoChange)
document.renderer()->setStyle(documentStyle.release());
document.renderView()->setStyle(documentStyle.release());
}
Element* documentElement = document.documentElement();
......
......@@ -88,8 +88,8 @@ void SVGDocument::updatePan(const FloatPoint& pos) const
{
if (rootElement()) {
rootElement()->setCurrentTranslate(FloatPoint(pos.x() - m_translate.x(), pos.y() - m_translate.y()));
if (renderer())
renderer()->repaint();
if (renderView())
renderView()->repaint();
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment