Changeset 155344 in webkit


Ignore:
Timestamp:
Sep 9, 2013, 3:37:34 AM (11 years ago)
Author:
Antti Koivisto
Message:

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):

Location:
trunk/Source/WebCore
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r155340 r155344  
     12013-09-09  Antti Koivisto  <antti@apple.com>
     2
     3        Hide Document::renderer()
     4        https://bugs.webkit.org/show_bug.cgi?id=121028
     5
     6        Reviewed by Andreas Kling.
     7
     8        Use less generic Document::renderView() instead.
     9
     10        * accessibility/AXObjectCache.cpp:
     11        (WebCore::AXObjectCache::postNotification):
     12        * accessibility/AccessibilityObject.cpp:
     13        (WebCore::appendAccessibilityObject):
     14        * accessibility/AccessibilityScrollView.cpp:
     15        (WebCore::AccessibilityScrollView::webAreaObject):
     16        * css/CSSFontSelector.cpp:
     17        (WebCore::CSSFontSelector::dispatchInvalidationCallbacks):
     18        * css/StyleResolver.cpp:
     19        (WebCore::StyleResolver::appendAuthorStyleSheets):
     20        * dom/Document.cpp:
     21        (WebCore::Document::~Document):
     22        (WebCore::Document::webkitGetNamedFlows):
     23        (WebCore::Document::setVisualUpdatesAllowed):
     24        (WebCore::Document::elementFromPoint):
     25        (WebCore::Document::caretRangeFromPoint):
     26        (WebCore::Document::updateLayout):
     27        (WebCore::Document::existingAXObjectCache):
     28        (WebCore::Document::axObjectCache):
     29        (WebCore::Document::setVisuallyOrdered):
     30        (WebCore::Document::implicitClose):
     31        (WebCore::Document::prepareMouseEvent):
     32        (WebCore::Document::styleResolverChanged):
     33        (WebCore::Document::documentWillBecomeInactive):
     34        (WebCore::Document::documentDidResumeFromPageCache):
     35        * dom/Document.h:
     36        * dom/DocumentStyleSheetCollection.cpp:
     37        (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets):
     38        * dom/Element.cpp:
     39        (WebCore::Element::~Element):
     40        * dom/InlineStyleSheetOwner.cpp:
     41        (WebCore::InlineStyleSheetOwner::removedFromDocument):
     42        * dom/ProcessingInstruction.cpp:
     43        (WebCore::ProcessingInstruction::removedFrom):
     44        * editing/FrameSelection.cpp:
     45        (WebCore::FrameSelection::contains):
     46        * html/HTMLElement.cpp:
     47        (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged):
     48        * html/HTMLLinkElement.cpp:
     49        (WebCore::HTMLLinkElement::removedFrom):
     50        * html/HTMLStyleElement.cpp:
     51        (WebCore::HTMLStyleElement::parseAttribute):
     52        (WebCore::HTMLStyleElement::registerWithScopingNode):
     53        (WebCore::HTMLStyleElement::unregisterWithScopingNode):
     54        * html/parser/HTMLResourcePreloader.cpp:
     55        (WebCore::HTMLResourcePreloader::preload):
     56        * loader/ImageLoader.cpp:
     57        (WebCore::ImageLoader::updateFromElement):
     58        * page/EventHandler.cpp:
     59        (WebCore::EventHandler::handleWheelEvent):
     60        (WebCore::EventHandler::handleGestureScrollBegin):
     61        * page/Frame.cpp:
     62        (WebCore::Frame::setPageAndTextZoomFactors):
     63        * page/FrameView.cpp:
     64        (WebCore::FrameView::layout):
     65        (WebCore::FrameView::doLayoutWithFrameFlattening):
     66        * page/Page.cpp:
     67        (WebCore::Page::setPageScaleFactor):
     68        * page/PrintContext.cpp:
     69        (WebCore::PrintContext::spoolAllPagesWithBoundaries):
     70        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
     71        (WebCore::MediaPlayerPrivateQTKit::paint):
     72        * style/StyleResolveTree.cpp:
     73        (WebCore::Style::resolveTree):
     74        * svg/SVGDocument.cpp:
     75        (WebCore::SVGDocument::updatePan):
     76
    1772013-09-09  Christophe Dumez  <ch.dumez@sisa.samsung.com>
    278
  • trunk/Source/WebCore/accessibility/AXObjectCache.cpp

    r154877 r155344  
    728728
    729729    if (!object && document)
    730         object = get(document->renderer());
     730        object = get(document->renderView());
    731731
    732732    if (!object)
  • trunk/Source/WebCore/accessibility/AccessibilityObject.cpp

    r155191 r155344  
    399399       
    400400        Document* doc = toFrameView(widget)->frame().document();
    401         if (!doc || !doc->renderer())
     401        if (!doc || !doc->renderView())
    402402            return;
    403403       
  • trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp

    r154184 r155344  
    190190   
    191191    Document* doc = toFrameView(m_scrollView)->frame().document();
    192     if (!doc || !doc->renderer())
     192    if (!doc || !doc->renderView())
    193193        return 0;
    194194
  • trunk/Source/WebCore/css/CSSFontSelector.cpp

    r154962 r155344  
    352352    if (StyleResolver* styleResolver = m_document->styleResolverIfExists())
    353353        styleResolver->invalidateMatchedPropertiesCache();
    354     if (m_document->inPageCache() || !m_document->renderer())
     354    if (m_document->inPageCache() || !m_document->renderView())
    355355        return;
    356356    m_document->scheduleForcedStyleRecalc();
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r154996 r155344  
    299299{
    300300    m_ruleSets.appendAuthorStyleSheets(firstNew, styleSheets, m_medium.get(), m_inspectorCSSOMWrappers, document().isViewSource(), this);
    301     if (document().renderer() && document().renderer()->style())
    302         document().renderer()->style()->font().update(fontSelector());
     301    if (document().renderView() && document().renderView()->style())
     302        document().renderView()->style()->font().update(fontSelector());
    303303
    304304#if ENABLE(CSS_DEVICE_ADAPTATION)
  • trunk/Source/WebCore/dom/Document.cpp

    r155304 r155344  
    544544Document::~Document()
    545545{
    546     ASSERT(!renderer());
     546    ASSERT(!renderView());
    547547    ASSERT(!m_inPageCache);
    548548    ASSERT(!m_savedRenderView);
     
    11521152PassRefPtr<DOMNamedFlowCollection> Document::webkitGetNamedFlows()
    11531153{
    1154     if (!cssRegionsEnabled() || !renderer())
     1154    if (!cssRegionsEnabled() || !renderView())
    11551155        return 0;
    11561156
     
    12751275
    12761276    FrameView* frameView = view();
    1277     bool needsLayout = frameView && renderer() && (frameView->layoutPending() || renderer()->needsLayout());
     1277    bool needsLayout = frameView && renderView() && (frameView->layoutPending() || renderView()->needsLayout());
    12781278    if (needsLayout)
    12791279        updateLayout();
     
    14171417Element* Document::elementFromPoint(int x, int y) const
    14181418{
    1419     if (!renderer())
     1419    if (!renderView())
    14201420        return 0;
    14211421
     
    14251425PassRefPtr<Range> Document::caretRangeFromPoint(int x, int y)
    14261426{
    1427     if (!renderer())
     1427    if (!renderView())
    14281428        return 0;
    14291429    LayoutPoint localPoint;
     
    18521852
    18531853    // Only do a layout if changes have occurred that make it necessary.     
    1854     if (frameView && renderer() && (frameView->layoutPending() || renderer()->needsLayout()))
     1854    if (frameView && renderView() && (frameView->layoutPending() || renderView()->needsLayout()))
    18551855        frameView->layout();
    18561856}
     
    21622162    // If the renderer is gone then we are in the process of destruction.
    21632163    // This method will be called before m_frame = 0.
    2164     if (!topDocument()->renderer())
     2164    if (!topDocument()->renderView())
    21652165        return 0;
    21662166
     
    21802180
    21812181    // If the document has already been detached, do not make a new axObjectCache.
    2182     if (!topDocument->renderer())
     2182    if (!topDocument->renderView())
    21832183        return 0;
    21842184
     
    21922192{
    21932193    m_visuallyOrdered = true;
    2194     if (renderer())
    2195         renderer()->style()->setRTLOrdering(VisualOrder);
     2194    if (renderView())
     2195        renderView()->style()->setRTLOrdering(VisualOrder);
    21962196}
    21972197
     
    24552455       
    24562456        // Always do a layout after loading if needed.
    2457         if (view() && renderer() && (!renderer()->firstChild() || renderer()->needsLayout()))
     2457        if (view() && renderView() && (!renderView()->firstChild() || renderView()->needsLayout()))
    24582458            view()->layout();
    24592459    }
     
    24622462
    24632463#if PLATFORM(MAC) || PLATFORM(WIN)
    2464     if (f && renderer() && AXObjectCache::accessibilityEnabled()) {
     2464    if (f && renderView() && AXObjectCache::accessibilityEnabled()) {
    24652465        // The AX cache may have been cleared at this point, but we need to make sure it contains an
    24662466        // AX object to send the notification to. getOrCreate will make sure that an valid AX object
    24672467        // exists in the cache (we ignore the return value because we don't need it here). This is
    24682468        // only safe to call when a layout is not in progress, so it can not be used in postNotification.   
    2469         axObjectCache()->getOrCreate(renderer());
     2469        axObjectCache()->getOrCreate(renderView());
    24702470        if (this == topDocument())
    2471             axObjectCache()->postNotification(renderer(), AXObjectCache::AXLoadComplete, true);
     2471            axObjectCache()->postNotification(renderView(), AXObjectCache::AXLoadComplete, true);
    24722472        else {
    24732473            // AXLoadComplete can only be posted on the top document, so if it's a document
    24742474            // in an iframe that just finished loading, post AXLayoutComplete instead.
    2475             axObjectCache()->postNotification(renderer(), AXObjectCache::AXLayoutComplete, true);
     2475            axObjectCache()->postNotification(renderView(), AXObjectCache::AXLayoutComplete, true);
    24762476        }
    24772477    }
     
    29692969MouseEventWithHitTestResults Document::prepareMouseEvent(const HitTestRequest& request, const LayoutPoint& documentPoint, const PlatformMouseEvent& event)
    29702970{
    2971     ASSERT(!renderer() || renderer()->isRenderView());
    2972 
    2973     if (!renderer())
     2971    if (!renderView())
    29742972        return MouseEventWithHitTestResults(event, HitTestResult(LayoutPoint()));
    29752973
     
    31823180    if (didLayoutWithPendingStylesheets() && !m_styleSheetCollection->hasPendingSheets()) {
    31833181        m_pendingSheetLayout = IgnoreLayoutWithPendingSheets;
    3184         if (renderer())
     3182        if (renderView())
    31853183            renderView()->repaintViewAndCompositedLayers();
    31863184    }
     
    32013199#endif
    32023200
    3203     if (renderer()) {
    3204         renderer()->setNeedsLayoutAndPrefWidthsRecalc();
     3201    if (renderView()) {
     3202        renderView()->setNeedsLayoutAndPrefWidthsRecalc();
    32053203        if (view())
    32063204            view()->scheduleRelayout();
     
    40214019{
    40224020#if USE(ACCELERATED_COMPOSITING)
    4023     if (renderer())
     4021    if (renderView())
    40244022        renderView()->setIsInWindow(false);
    40254023#endif
     
    40504048
    40514049#if USE(ACCELERATED_COMPOSITING)
    4052     if (renderer())
     4050    if (renderView())
    40534051        renderView()->setIsInWindow(true);
    40544052#endif
  • trunk/Source/WebCore/dom/Document.h

    r155304 r155344  
    542542    RenderView* renderView() const { return m_renderView; }
    543543
    544     // FIXME: Remove this, callers that have a Document* should call renderView().
    545     // Shadow the implementations on Node to provide faster access for documents.
    546     RenderView* renderer() const { return m_renderView; }
    547 
    548544    bool renderTreeBeingDestroyed() const { return m_renderTreeBeingDestroyed; }
    549545
     
    11891185    friend class IgnoreDestructiveWriteCountIncrementer;
    11901186
     1187    RenderObject* renderer() const WTF_DELETED_FUNCTION;
    11911188    void setRenderer(RenderObject*) WTF_DELETED_FUNCTION;
    11921189    void setRenderView(RenderView*);
  • trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp

    r154877 r155344  
    464464
    465465    }
    466     if (!m_document->renderer() || !m_document->attached())
     466    if (!m_document->renderView() || !m_document->attached())
    467467        return false;
    468468
  • trunk/Source/WebCore/dom/Element.cpp

    r155303 r155344  
    163163{
    164164#ifndef NDEBUG
    165     if (document().renderer()) {
     165    if (document().renderView()) {
    166166        // When the document is not destroyed, an element that was part of a named flow
    167167        // content nodes should have been removed from the content nodes collection
  • trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp

    r154877 r155344  
    7171
    7272    // If we're in document teardown, then we don't need to do any notification of our sheet's removal.
    73     if (document->renderer())
     73    if (document->renderView())
    7474        document->styleResolverChanged(DeferRecalcStyle);
    7575}
  • trunk/Source/WebCore/dom/ProcessingInstruction.cpp

    r155340 r155344  
    288288
    289289    // If we're in document teardown, then we don't need to do any notification of our sheet's removal.
    290     if (document().renderer())
     290    if (document().renderView())
    291291        document().styleResolverChanged(DeferRecalcStyle);
    292292}
  • trunk/Source/WebCore/editing/FrameSelection.cpp

    r155211 r155344  
    15601560    if (!isRange())
    15611561        return false;
    1562     if (!document->renderer())
     1562    if (!document->renderView())
    15631563        return false;
    15641564   
  • trunk/Source/WebCore/html/HTMLElement.cpp

    r155194 r155344  
    915915{
    916916    // FIXME: This function looks suspicious.
    917     if (document().renderer() && (changeType == ElementRemoved || changeType == TextRemoved)) {
     917    if (document().renderView() && (changeType == ElementRemoved || changeType == TextRemoved)) {
    918918        Node* node = beforeChange ? beforeChange->nextSibling() : 0;
    919919        for (; node; node = node->nextSibling()) {
  • trunk/Source/WebCore/html/HTMLLinkElement.cpp

    r154962 r155344  
    283283        removePendingSheet(RemovePendingSheetNotifyLater);
    284284
    285     if (document().renderer())
     285    if (document().renderView())
    286286        document().styleResolverChanged(DeferRecalcStyleIfNeeded);
    287287}
  • trunk/Source/WebCore/html/HTMLStyleElement.cpp

    r154957 r155344  
    8181        if (sheet()) {
    8282            sheet()->setMediaQueries(MediaQuerySet::createAllowingDescriptionSyntax(value));
    83             if (inDocument() && document().renderer())
     83            if (inDocument() && document().renderView())
    8484                document().styleResolverChanged(RecalcStyleImmediately);
    8585        }
     
    148148    else
    149149        scope->setNeedsStyleRecalc();
    150     if (inDocument() && !document().parsing() && document().renderer())
     150    if (inDocument() && !document().parsing() && document().renderView())
    151151        document().styleResolverChanged(DeferRecalcStyle);
    152152
     
    166166        scope->setNeedsStyleRecalc();
    167167    }
    168     if (inDocument() && !document().parsing() && document().renderer())
     168    if (inDocument() && !document().parsing() && document().renderView())
    169169        document().styleResolverChanged(DeferRecalcStyle);
    170170
  • trunk/Source/WebCore/html/parser/HTMLResourcePreloader.cpp

    r154676 r155344  
    8282{
    8383    ASSERT(m_document->frame());
    84     ASSERT(m_document->renderer());
    85     ASSERT(m_document->renderer()->style());
    86     if (!preload->media().isEmpty() && !mediaAttributeMatches(m_document->frame(), m_document->renderer()->style(), preload->media()))
     84    ASSERT(m_document->renderView());
     85    ASSERT(m_document->renderView()->style());
     86    if (!preload->media().isEmpty() && !mediaAttributeMatches(m_document->frame(), m_document->renderView()->style(), preload->media()))
    8787        return;
    8888
  • trunk/Source/WebCore/loader/ImageLoader.cpp

    r154937 r155344  
    169169    // down the raw HTML parsing case by loading images we don't intend to display.
    170170    Document& document = m_element->document();
    171     if (!document.renderer())
     171    if (!document.renderView())
    172172        return;
    173173
  • trunk/Source/WebCore/page/EventHandler.cpp

    r154947 r155344  
    24602460    Document* doc = m_frame.document();
    24612461
    2462     RenderObject* docRenderer = doc->renderer();
     2462    RenderObject* docRenderer = doc->renderView();
    24632463    if (!docRenderer)
    24642464        return false;
     
    27982798{
    27992799    Document* document = m_frame.document();
    2800     RenderObject* documentRenderer = document->renderer();
     2800    RenderObject* documentRenderer = document->renderView();
    28012801    if (!documentRenderer)
    28022802        return false;
  • trunk/Source/WebCore/page/Frame.cpp

    r155174 r155344  
    886886
    887887    if (FrameView* view = this->view()) {
    888         if (document->renderer() && document->renderer()->needsLayout() && view->didFirstLayout())
     888        if (document->renderView() && document->renderView()->needsLayout() && view->didFirstLayout())
    889889            view->layout();
    890890    }
  • trunk/Source/WebCore/page/FrameView.cpp

    r155315 r155344  
    11721172            return;
    11731173
    1174         root = subtree ? m_layoutRoot : document->renderer();
     1174        root = subtree ? m_layoutRoot : document->renderView();
    11751175        if (!root) {
    11761176            // FIXME: Do we need to set m_size here?
     
    34483448    parentView->layout(allowSubtree);
    34493449
    3450     RenderObject* root = m_layoutRoot ? m_layoutRoot : frame().document()->renderer();
     3450    RenderObject* root = m_layoutRoot ? m_layoutRoot : frame().document()->renderView();
    34513451    ASSERT_UNUSED(root, !root->needsLayout());
    34523452
  • trunk/Source/WebCore/page/Page.cpp

    r155228 r155344  
    764764
    765765    if (!m_settings->applyPageScaleFactorInCompositor()) {
    766         if (document->renderer())
    767             document->renderer()->setNeedsLayout(true);
     766        if (document->renderView())
     767            document->renderView()->setNeedsLayout(true);
    768768
    769769        document->recalcStyle(Style::Force);
     
    781781
    782782    if (view && view->scrollPosition() != origin) {
    783         if (!m_settings->applyPageScaleFactorInCompositor() && document->renderer() && document->renderer()->needsLayout() && view->didFirstLayout())
     783        if (!m_settings->applyPageScaleFactorInCompositor() && document->renderView() && document->renderView()->needsLayout() && view->didFirstLayout())
    784784            view->layout();
    785785        view->setScrollPosition(origin);
  • trunk/Source/WebCore/page/PrintContext.cpp

    r154877 r155344  
    318318void PrintContext::spoolAllPagesWithBoundaries(Frame* frame, GraphicsContext& graphicsContext, const FloatSize& pageSizeInPixels)
    319319{
    320     if (!frame->document() || !frame->view() || !frame->document()->renderer())
     320    if (!frame->document() || !frame->view() || !frame->document()->renderView())
    321321        return;
    322322
  • trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm

    r154314 r155344  
    13551355        Frame* frame = m_player->frameView() ? &m_player->frameView()->frame() : NULL;
    13561356        Document* document = frame ? frame->document() : NULL;
    1357         RenderObject* renderer = document ? document->renderer() : NULL;
     1357        RenderObject* renderer = document ? document->renderView() : NULL;
    13581358        RenderStyle* styleToUse = renderer ? renderer->style() : NULL;
    13591359        if (styleToUse) {
  • trunk/Source/WebCore/style/StyleResolveTree.cpp

    r155253 r155344  
    812812#endif
    813813
    814         Style::Change documentChange = determineChange(documentStyle.get(), document.renderer()->style(), document.settings());
     814        Style::Change documentChange = determineChange(documentStyle.get(), document.renderView()->style(), document.settings());
    815815        if (documentChange != NoChange)
    816             document.renderer()->setStyle(documentStyle.release());
     816            document.renderView()->setStyle(documentStyle.release());
    817817    }
    818818
  • trunk/Source/WebCore/svg/SVGDocument.cpp

    r154371 r155344  
    8989    if (rootElement()) {
    9090        rootElement()->setCurrentTranslate(FloatPoint(pos.x() - m_translate.x(), pos.y() - m_translate.y()));
    91         if (renderer())
    92             renderer()->repaint();
     91        if (renderView())
     92            renderView()->repaint();
    9393    }
    9494}
Note: See TracChangeset for help on using the changeset viewer.