Changeset 180574 in webkit


Ignore:
Timestamp:
Feb 24, 2015, 10:47:54 AM (11 years ago)
Author:
Simon Fraser
Message:

Use nullptr in more places in FrameView, RenderView, RenderObject
https://bugs.webkit.org/show_bug.cgi?id=141974

Reviewed by Zalan Bujtas.

0 -> nullptr in FrameView.h/cpp, RenderView.h/cpp, RenderObject.h/cpp.

Rename FrameView::m_deferSetNeedsLayouts to FrameView::m_deferSetNeedsLayoutCount
to make it more clear that it's a count.

  • page/FrameView.cpp:

(WebCore::FrameView::FrameView):
(WebCore::FrameView::reset):
(WebCore::FrameView::setContentsSize):
(WebCore::FrameView::calculateScrollbarModesForLayout):
(WebCore::FrameView::layerForScrolling):
(WebCore::FrameView::layerForHorizontalScrollbar):
(WebCore::FrameView::layerForVerticalScrollbar):
(WebCore::FrameView::layerForScrollCorner):
(WebCore::FrameView::tiledBacking):
(WebCore::FrameView::scrollLayerID):
(WebCore::FrameView::layerForOverhangAreas):
(WebCore::FrameView::setWantsLayerForTopOverHangArea):
(WebCore::FrameView::setWantsLayerForBottomOverHangArea):
(WebCore::FrameView::hasCompositedContentIncludingDescendants):
(WebCore::FrameView::layoutRoot):
(WebCore::FrameView::forceLayoutParentViewIfNeeded):
(WebCore::FrameView::layout):
(WebCore::FrameView::hostWindow):
(WebCore::FrameView::scheduleRelayout):
(WebCore::FrameView::scheduleRelayoutOfSubtree):
(WebCore::FrameView::needsLayout):
(WebCore::FrameView::setNeedsLayout):
(WebCore::FrameView::enclosingScrollableArea):
(WebCore::FrameView::parentFrameView):
(WebCore::FrameView::paintControlTints):
(WebCore::FrameView::adjustPageHeightDeprecated):
(WebCore::FrameView::axObjectCache):

  • page/FrameView.h:
  • rendering/RenderObject.cpp:

(WebCore::RenderObject::RenderObject):
(WebCore::RenderObject::nextInPreOrderAfterChildren):
(WebCore::RenderObject::previousInPreOrder):
(WebCore::RenderObject::firstLeafChild):
(WebCore::RenderObject::lastLeafChild):
(WebCore::RenderObject::traverseNext):
(WebCore::RenderObject::firstLineBlock):
(WebCore::RenderObject::containerForRepaint):
(WebCore::RenderObject::showRenderSubTreeAndMark):
(WebCore::RenderObject::localToAbsolute):
(WebCore::RenderObject::container):

  • rendering/RenderObject.h:

(WebCore::RenderObject::virtualContinuation):
(WebCore::RenderObject::node):
(WebCore::RenderObject::nonPseudoNode):
(WebCore::RenderObject::localToAbsoluteQuad):
(WebCore::RenderObject::absoluteQuads):
(WebCore::RenderObject::absoluteClippedOverflowRect):
(WebCore::RenderObject::outlineBoundsForRepaint):
(WebCore::RenderObject::computeAbsoluteRepaintRect):
(WebCore::RenderObject::selectionRect):
(WebCore::RenderObject::imageChanged):
(WebCore::RenderObject::addFocusRingRects):
(WebCore::RenderObject::absoluteOutlineBounds):

  • rendering/RenderView.cpp:

(WebCore::SelectionIterator::next):
(WebCore::RenderView::RenderView):
(WebCore::RenderView::mapLocalToContainer):
(WebCore::RenderView::pushMappingToContainer):
(WebCore::RenderView::computeRectForRepaint):
(WebCore::rendererAfterPosition):
(WebCore::RenderView::splitSelectionBetweenSubtrees):
(WebCore::RenderView::rootBackgroundIsEntirelyFixed):

  • rendering/RenderView.h:
Location:
trunk/Source/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r180570 r180574  
     12015-02-24  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Use nullptr in more places in FrameView, RenderView, RenderObject
     4        https://bugs.webkit.org/show_bug.cgi?id=141974
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        0 -> nullptr in FrameView.h/cpp, RenderView.h/cpp, RenderObject.h/cpp.
     9       
     10        Rename FrameView::m_deferSetNeedsLayouts to FrameView::m_deferSetNeedsLayoutCount
     11        to make it more clear that it's a count.
     12
     13        * page/FrameView.cpp:
     14        (WebCore::FrameView::FrameView):
     15        (WebCore::FrameView::reset):
     16        (WebCore::FrameView::setContentsSize):
     17        (WebCore::FrameView::calculateScrollbarModesForLayout):
     18        (WebCore::FrameView::layerForScrolling):
     19        (WebCore::FrameView::layerForHorizontalScrollbar):
     20        (WebCore::FrameView::layerForVerticalScrollbar):
     21        (WebCore::FrameView::layerForScrollCorner):
     22        (WebCore::FrameView::tiledBacking):
     23        (WebCore::FrameView::scrollLayerID):
     24        (WebCore::FrameView::layerForOverhangAreas):
     25        (WebCore::FrameView::setWantsLayerForTopOverHangArea):
     26        (WebCore::FrameView::setWantsLayerForBottomOverHangArea):
     27        (WebCore::FrameView::hasCompositedContentIncludingDescendants):
     28        (WebCore::FrameView::layoutRoot):
     29        (WebCore::FrameView::forceLayoutParentViewIfNeeded):
     30        (WebCore::FrameView::layout):
     31        (WebCore::FrameView::hostWindow):
     32        (WebCore::FrameView::scheduleRelayout):
     33        (WebCore::FrameView::scheduleRelayoutOfSubtree):
     34        (WebCore::FrameView::needsLayout):
     35        (WebCore::FrameView::setNeedsLayout):
     36        (WebCore::FrameView::enclosingScrollableArea):
     37        (WebCore::FrameView::parentFrameView):
     38        (WebCore::FrameView::paintControlTints):
     39        (WebCore::FrameView::adjustPageHeightDeprecated):
     40        (WebCore::FrameView::axObjectCache):
     41        * page/FrameView.h:
     42        * rendering/RenderObject.cpp:
     43        (WebCore::RenderObject::RenderObject):
     44        (WebCore::RenderObject::nextInPreOrderAfterChildren):
     45        (WebCore::RenderObject::previousInPreOrder):
     46        (WebCore::RenderObject::firstLeafChild):
     47        (WebCore::RenderObject::lastLeafChild):
     48        (WebCore::RenderObject::traverseNext):
     49        (WebCore::RenderObject::firstLineBlock):
     50        (WebCore::RenderObject::containerForRepaint):
     51        (WebCore::RenderObject::showRenderSubTreeAndMark):
     52        (WebCore::RenderObject::localToAbsolute):
     53        (WebCore::RenderObject::container):
     54        * rendering/RenderObject.h:
     55        (WebCore::RenderObject::virtualContinuation):
     56        (WebCore::RenderObject::node):
     57        (WebCore::RenderObject::nonPseudoNode):
     58        (WebCore::RenderObject::localToAbsoluteQuad):
     59        (WebCore::RenderObject::absoluteQuads):
     60        (WebCore::RenderObject::absoluteClippedOverflowRect):
     61        (WebCore::RenderObject::outlineBoundsForRepaint):
     62        (WebCore::RenderObject::computeAbsoluteRepaintRect):
     63        (WebCore::RenderObject::selectionRect):
     64        (WebCore::RenderObject::imageChanged):
     65        (WebCore::RenderObject::addFocusRingRects):
     66        (WebCore::RenderObject::absoluteOutlineBounds):
     67        * rendering/RenderView.cpp:
     68        (WebCore::SelectionIterator::next):
     69        (WebCore::RenderView::RenderView):
     70        (WebCore::RenderView::mapLocalToContainer):
     71        (WebCore::RenderView::pushMappingToContainer):
     72        (WebCore::RenderView::computeRectForRepaint):
     73        (WebCore::rendererAfterPosition):
     74        (WebCore::RenderView::splitSelectionBetweenSubtrees):
     75        (WebCore::RenderView::rootBackgroundIsEntirelyFixed):
     76        * rendering/RenderView.h:
     77
    1782015-02-24  Yusuke Suzuki  <utatane.tea@gmail.com>
    279
  • trunk/Source/WebCore/page/FrameView.cpp

    r180474 r180574  
    165165    , m_canHaveScrollbars(true)
    166166    , m_layoutTimer(*this, &FrameView::layoutTimerFired)
    167     , m_layoutRoot(0)
     167    , m_layoutRoot(nullptr)
    168168    , m_layoutPhase(OutsideLayout)
    169169    , m_inSynchronousPostLayout(false)
     
    174174    , m_mediaType("screen")
    175175    , m_overflowStatusDirty(true)
    176     , m_viewportRenderer(0)
     176    , m_viewportRenderer(nullptr)
    177177    , m_wasScrolledByUser(false)
    178178    , m_inProgrammaticScroll(false)
     
    182182    , m_shouldUpdateWhileOffscreen(true)
    183183    , m_exposedRect(FloatRect::infiniteRect())
    184     , m_deferSetNeedsLayouts(0)
     184    , m_deferSetNeedsLayoutCount(0)
    185185    , m_setNeedsLayoutWasDeferred(false)
    186186    , m_speculativeTilingEnabled(false)
     
    264264    m_contentIsOpaque = false;
    265265    m_layoutTimer.stop();
    266     m_layoutRoot = 0;
     266    m_layoutRoot = nullptr;
    267267    m_delayedLayout = false;
    268268    m_needsFullRepaint = true;
     
    564564        return;
    565565
    566     m_deferSetNeedsLayouts++;
     566    m_deferSetNeedsLayoutCount++;
    567567
    568568    ScrollView::setContentsSize(size);
     
    580580        frame().mainFrame().pageOverlayController().didChangeDocumentSize();
    581581
    582     ASSERT(m_deferSetNeedsLayouts);
    583     m_deferSetNeedsLayouts--;
    584    
    585     if (!m_deferSetNeedsLayouts)
     582    ASSERT(m_deferSetNeedsLayoutCount);
     583    m_deferSetNeedsLayoutCount--;
     584   
     585    if (!m_deferSetNeedsLayoutCount)
    586586        m_setNeedsLayoutWasDeferred = false; // FIXME: Find a way to make the deferred layout actually happen.
    587587}
     
    694694void FrameView::calculateScrollbarModesForLayout(ScrollbarMode& hMode, ScrollbarMode& vMode, ScrollbarModesCalculationStrategy strategy)
    695695{
    696     m_viewportRenderer = 0;
     696    m_viewportRenderer = nullptr;
    697697
    698698    const HTMLFrameOwnerElement* owner = frame().ownerElement();
     
    785785    RenderView* renderView = this->renderView();
    786786    if (!renderView)
    787         return 0;
     787        return nullptr;
    788788    return renderView->compositor().scrollLayer();
    789789}
    790790
    791791GraphicsLayer* FrameView::layerForHorizontalScrollbar() const
     792{
     793    RenderView* renderView = this->renderView();
     794    if (!renderView)
     795        return nullptr;
     796    return renderView->compositor().layerForHorizontalScrollbar();
     797}
     798
     799GraphicsLayer* FrameView::layerForVerticalScrollbar() const
     800{
     801    RenderView* renderView = this->renderView();
     802    if (!renderView)
     803        return nullptr;
     804    return renderView->compositor().layerForVerticalScrollbar();
     805}
     806
     807GraphicsLayer* FrameView::layerForScrollCorner() const
     808{
     809    RenderView* renderView = this->renderView();
     810    if (!renderView)
     811        return nullptr;
     812    return renderView->compositor().layerForScrollCorner();
     813}
     814
     815TiledBacking* FrameView::tiledBacking() const
     816{
     817    RenderView* renderView = this->renderView();
     818    if (!renderView)
     819        return nullptr;
     820
     821    RenderLayerBacking* backing = renderView->layer()->backing();
     822    if (!backing)
     823        return nullptr;
     824
     825    return backing->graphicsLayer()->tiledBacking();
     826}
     827
     828uint64_t FrameView::scrollLayerID() const
    792829{
    793830    RenderView* renderView = this->renderView();
    794831    if (!renderView)
    795832        return 0;
    796     return renderView->compositor().layerForHorizontalScrollbar();
    797 }
    798 
    799 GraphicsLayer* FrameView::layerForVerticalScrollbar() const
    800 {
    801     RenderView* renderView = this->renderView();
    802     if (!renderView)
    803         return 0;
    804     return renderView->compositor().layerForVerticalScrollbar();
    805 }
    806 
    807 GraphicsLayer* FrameView::layerForScrollCorner() const
    808 {
    809     RenderView* renderView = this->renderView();
    810     if (!renderView)
    811         return 0;
    812     return renderView->compositor().layerForScrollCorner();
    813 }
    814 
    815 TiledBacking* FrameView::tiledBacking() const
    816 {
    817     RenderView* renderView = this->renderView();
    818     if (!renderView)
    819         return 0;
    820833
    821834    RenderLayerBacking* backing = renderView->layer()->backing();
     
    823836        return 0;
    824837
    825     return backing->graphicsLayer()->tiledBacking();
    826 }
    827 
    828 uint64_t FrameView::scrollLayerID() const
    829 {
    830     RenderView* renderView = this->renderView();
    831     if (!renderView)
    832         return 0;
    833 
    834     RenderLayerBacking* backing = renderView->layer()->backing();
    835     if (!backing)
    836         return 0;
    837 
    838838    return backing->scrollingNodeIDForRole(FrameScrollingNode);
    839839}
     
    853853    RenderView* renderView = this->renderView();
    854854    if (!renderView)
    855         return 0;
     855        return nullptr;
    856856    return renderView->compositor().layerForOverhangAreas();
    857857}
     
    861861    RenderView* renderView = this->renderView();
    862862    if (!renderView)
    863         return 0;
     863        return nullptr;
    864864
    865865    return renderView->compositor().updateLayerForTopOverhangArea(wantsLayer);
     
    870870    RenderView* renderView = this->renderView();
    871871    if (!renderView)
    872         return 0;
     872        return nullptr;
    873873
    874874    return renderView->compositor().updateLayerForBottomOverhangArea(wantsLayer);
     
    10171017    for (Frame* frame = m_frame.get(); frame; frame = frame->tree().traverseNext(m_frame.get())) {
    10181018        RenderView* renderView = frame->contentRenderer();
    1019         if (RenderLayerCompositor* compositor = renderView ? &renderView->compositor() : 0) {
     1019        if (RenderLayerCompositor* compositor = renderView ? &renderView->compositor() : nullptr) {
    10201020            if (compositor->inCompositingMode())
    10211021                return true;
     
    10851085RenderObject* FrameView::layoutRoot(bool onlyDuringLayout) const
    10861086{
    1087     return onlyDuringLayout && layoutPending() ? 0 : m_layoutRoot;
     1087    return onlyDuringLayout && layoutPending() ? nullptr : m_layoutRoot;
    10881088}
    10891089
     
    11041104    // If the embedded SVG document appears the first time, the ownerRenderer has already finished
    11051105    // layout without knowing about the existence of the embedded SVG document, because RenderReplaced
    1106     // embeddedContentBox() returns 0, as long as the embedded document isn't loaded yet. Before
     1106    // embeddedContentBox() returns nullptr, as long as the embedded document isn't loaded yet. Before
    11071107    // bothering to lay out the SVG document, mark the ownerRenderer needing layout and ask its
    11081108    // FrameView for a layout. After that the RenderEmbeddedObject (ownerRenderer) carries the
     
    13051305            root->view().pushLayoutState(*root);
    13061306        }
    1307         LayoutStateDisabler layoutStateDisabler(disableLayoutState ? &root->view() : 0);
     1307        LayoutStateDisabler layoutStateDisabler(disableLayoutState ? &root->view() : nullptr);
    13081308        RenderView::RepaintRegionAccumulator repaintRegionAccumulator(&root->view());
    13091309
     
    22482248    if (Page* page = frame().page())
    22492249        return &page->chrome();
    2250     return 0;
     2250    return nullptr;
    22512251}
    22522252
     
    24612461    if (m_layoutRoot) {
    24622462        m_layoutRoot->markContainingBlocksForLayout(false);
    2463         m_layoutRoot = 0;
     2463        m_layoutRoot = nullptr;
    24642464    }
    24652465    if (!m_layoutSchedulingEnabled)
     
    25522552    // Just do a full relayout.
    25532553    m_layoutRoot->markContainingBlocksForLayout(false);
    2554     m_layoutRoot = 0;
     2554    m_layoutRoot = nullptr;
    25552555    newRelayoutRoot.markContainingBlocksForLayout(false);
    25562556    InspectorInstrumentation::didInvalidateLayout(frame());
     
    25982598        || (renderView && renderView->needsLayout())
    25992599        || m_layoutRoot
    2600         || (m_deferSetNeedsLayouts && m_setNeedsLayoutWasDeferred);
     2600        || (m_deferSetNeedsLayoutCount && m_setNeedsLayoutWasDeferred);
    26012601}
    26022602
    26032603void FrameView::setNeedsLayout()
    26042604{
    2605     if (m_deferSetNeedsLayouts) {
     2605    if (m_deferSetNeedsLayoutCount) {
    26062606        m_setNeedsLayoutWasDeferred = true;
    26072607        return;
     
    34003400{
    34013401    // FIXME: Walk up the frame tree and look for a scrollable parent frame or RenderLayer.
    3402     return 0;
     3402    return nullptr;
    34033403}
    34043404
     
    36723672{
    36733673    if (!parent())
    3674         return 0;
     3674        return nullptr;
    36753675
    36763676    if (Frame* parentFrame = frame().tree().parent())
    36773677        return parentFrame->view();
    36783678
    3679     return 0;
     3679    return nullptr;
    36803680}
    36813681
     
    37483748    if (needsLayout())
    37493749        layout();
    3750     PlatformGraphicsContext* const noContext = 0;
    3751     GraphicsContext context(noContext);
     3750
     3751    GraphicsContext context((PlatformGraphicsContext*)nullptr);
    37523752    context.setUpdatingControlTints(true);
    37533753    if (platformWidget()) {
     
    41424142    }
    41434143    // Use a context with painting disabled.
    4144     GraphicsContext context((PlatformGraphicsContext*)0);
     4144    GraphicsContext context((PlatformGraphicsContext*)nullptr);
    41454145    renderView->setTruncatedAt(static_cast<int>(floorf(oldBottom)));
    41464146    IntRect dirtyRect(0, static_cast<int>(floorf(oldTop)), renderView->layoutOverflowRect().maxX(), static_cast<int>(ceilf(oldBottom - oldTop)));
     
    44574457    if (frame().document())
    44584458        return frame().document()->existingAXObjectCache();
    4459     return 0;
     4459    return nullptr;
    44604460}
    44614461   
  • trunk/Source/WebCore/page/FrameView.h

    r180063 r180574  
    711711    FloatRect m_exposedRect;
    712712
    713     unsigned m_deferSetNeedsLayouts;
     713    unsigned m_deferSetNeedsLayoutCount;
    714714    bool m_setNeedsLayoutWasDeferred;
    715715
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r180273 r180574  
    108108    : CachedImageClient()
    109109    , m_node(node)
    110     , m_parent(0)
    111     , m_previous(0)
    112     , m_next(0)
     110    , m_parent(nullptr)
     111    , m_previous(nullptr)
     112    , m_next(nullptr)
    113113#ifndef NDEBUG
    114114    , m_hasAXObject(false)
     
    222222{
    223223    if (this == stayWithin)
    224         return 0;
     224        return nullptr;
    225225
    226226    const RenderObject* current = this;
     
    229229        current = current->parent();
    230230        if (!current || current == stayWithin)
    231             return 0;
     231            return nullptr;
    232232    }
    233233    return next;
     
    248248{
    249249    if (this == stayWithin)
    250         return 0;
     250        return nullptr;
    251251
    252252    return previousInPreOrder();
     
    265265    RenderObject* r = firstChildSlow();
    266266    while (r) {
    267         RenderObject* n = 0;
     267        RenderObject* n = nullptr;
    268268        n = r->firstChildSlow();
    269269        if (!n)
     
    278278    RenderObject* r = lastChildSlow();
    279279    while (r) {
    280         RenderObject* n = 0;
     280        RenderObject* n = nullptr;
    281281        n = r->lastChildSlow();
    282282        if (!n)
     
    297297    }
    298298    if (this == stayWithin)
    299         return 0;
     299        return nullptr;
    300300    if (nextSibling()) {
    301301        ASSERT(!stayWithin || nextSibling()->isDescendantOf(stayWithin));
     
    309309        return n->nextSibling();
    310310    }
    311     return 0;
     311    return nullptr;
    312312}
    313313
     
    330330
    331331    if (this == stayWithin)
    332         return 0;
     332        return nullptr;
    333333
    334334    // Now we traverse other nodes if they exist, otherwise
     
    341341        }
    342342        if (!n)
    343             return 0;
     343            return nullptr;
    344344        for (RenderObject* sibling = n->nextSibling(); sibling; sibling = sibling->nextSibling()) {
    345345            overflowType = inclusionFunction(sibling);
     
    355355            currentDepth--;
    356356        } else
    357             return 0;
    358     }
    359     return 0;
     357            return nullptr;
     358    }
     359    return nullptr;
    360360}
    361361
     
    370370
    371371    if (this == stayWithin)
    372         return 0;
     372        return nullptr;
    373373
    374374    for (RenderObject* sibling = nextSibling(); sibling; sibling = sibling->nextSibling()) {
     
    393393                n = n->parent();
    394394            else
    395                 return 0;
    396         }
    397     }
    398     return 0;
     395                return nullptr;
     396        }
     397    }
     398    return nullptr;
    399399}
    400400
     
    524524RenderBlock* RenderObject::firstLineBlock() const
    525525{
    526     return 0;
     526    return nullptr;
    527527}
    528528
     
    12011201        // If we have already found a repaint container then we will repaint into that container only if it is part of the same
    12021202        // flow thread. Otherwise we will need to catch the repaint call and send it to the flow thread.
    1203         RenderFlowThread* repaintContainerFlowThread = repaintContainer ? repaintContainer->flowThreadContainingBlock() : 0;
     1203        RenderFlowThread* repaintContainerFlowThread = repaintContainer ? repaintContainer->flowThreadContainingBlock() : nullptr;
    12041204        if (!repaintContainerFlowThread || repaintContainerFlowThread != parentRenderFlowThread)
    12051205            repaintContainer = parentRenderFlowThread;
     
    15491549#pragma clang diagnostic ignored "-Wundefined-bool-conversion"
    15501550#endif
    1551     // As this function is intended to be used when debugging, the |this| pointer may be 0.
     1551    // As this function is intended to be used when debugging, the |this| pointer may be nullptr.
    15521552    if (!this)
    15531553        return;
     
    15831583{
    15841584    TransformState transformState(TransformState::ApplyTransformDirection, localPoint);
    1585     mapLocalToContainer(0, transformState, mode | ApplyContainerFlip);
     1585    mapLocalToContainer(nullptr, transformState, mode | ApplyContainerFlip);
    15861586    transformState.flatten();
    15871587   
     
    18171817        // as we can.  If we're in the tree, we'll get the root.  If we
    18181818        // aren't we'll get the root of our little subtree (most likely
    1819         // we'll just return 0).
     1819        // we'll just return nullptr).
    18201820        // FIXME: The definition of view() has changed to not crawl up the render tree.  It might
    18211821        // be safe now to use it.
  • trunk/Source/WebCore/rendering/RenderObject.h

    r180273 r180574  
    497497    bool isInlineElementContinuation() const { return isElementContinuation() && isInline(); }
    498498    bool isBlockElementContinuation() const { return isElementContinuation() && !isInline(); }
    499     virtual RenderBoxModelObject* virtualContinuation() const { return 0; }
     499    virtual RenderBoxModelObject* virtualContinuation() const { return nullptr; }
    500500
    501501    bool isFloating() const { return m_bitfields.floating(); }
     
    565565
    566566    // Returns true if this renderer is rooted, and optionally returns the hosting view (the root of the hierarchy).
    567     bool isRooted(RenderView** = 0) const;
    568 
    569     Node* node() const { return isAnonymous() ? 0 : &m_node; }
    570     Node* nonPseudoNode() const { return isPseudoElement() ? 0 : node(); }
     567    bool isRooted(RenderView** = nullptr) const;
     568
     569    Node* node() const { return isAnonymous() ? nullptr : &m_node; }
     570    Node* nonPseudoNode() const { return isPseudoElement() ? nullptr : node(); }
    571571
    572572    // Returns the styled node that caused the generation of this renderer.
     
    576576
    577577    Document& document() const { return m_node.document(); }
    578     Frame& frame() const; // Defined in RenderView.h
     578    Frame& frame() const;
    579579
    580580    bool hasOutlineAnnotation() const;
     
    584584    // If repaintContainer and repaintContainerSkipped are not null, on return *repaintContainerSkipped
    585585    // is true if the renderer returned is an ancestor of repaintContainer.
    586     RenderElement* container(const RenderLayerModelObject* repaintContainer = 0, bool* repaintContainerSkipped = 0) const;
     586    RenderElement* container(const RenderLayerModelObject* repaintContainer = nullptr, bool* repaintContainerSkipped = nullptr) const;
    587587
    588588    RenderBoxModelObject* offsetParent() const;
    589589
    590     void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderElement* newRoot = 0);
     590    void markContainingBlocksForLayout(bool scheduleRelayout = true, RenderElement* newRoot = nullptr);
    591591    void setNeedsLayout(MarkingBehavior = MarkContainingBlockChain);
    592592    void clearNeedsLayout();
     
    657657
    658658    // Convert a local quad to absolute coordinates, taking transforms into account.
    659     FloatQuad localToAbsoluteQuad(const FloatQuad& quad, MapCoordinatesFlags mode = 0, bool* wasFixed = 0) const
    660     {
    661         return localToContainerQuad(quad, 0, mode, wasFixed);
     659    FloatQuad localToAbsoluteQuad(const FloatQuad& quad, MapCoordinatesFlags mode = 0, bool* wasFixed = nullptr) const
     660    {
     661        return localToContainerQuad(quad, nullptr, mode, wasFixed);
    662662    }
    663663    // Convert an absolute quad to local coordinates.
     
    665665
    666666    // Convert a local quad into the coordinate system of container, taking transforms into account.
    667     WEBCORE_EXPORT FloatQuad localToContainerQuad(const FloatQuad&, const RenderLayerModelObject* repaintContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0) const;
    668     WEBCORE_EXPORT FloatPoint localToContainerPoint(const FloatPoint&, const RenderLayerModelObject* repaintContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0) const;
     667    WEBCORE_EXPORT FloatQuad localToContainerQuad(const FloatQuad&, const RenderLayerModelObject* repaintContainer, MapCoordinatesFlags = 0, bool* wasFixed = nullptr) const;
     668    WEBCORE_EXPORT FloatPoint localToContainerPoint(const FloatPoint&, const RenderLayerModelObject* repaintContainer, MapCoordinatesFlags = 0, bool* wasFixed = nullptr) const;
    669669
    670670    // Return the offset from the container() renderer (excluding transforms). In multi-column layout,
    671671    // different offsets apply at different points, so return the offset that applies to the given point.
    672     virtual LayoutSize offsetFromContainer(RenderElement&, const LayoutPoint&, bool* offsetDependsOnPoint = 0) const;
     672    virtual LayoutSize offsetFromContainer(RenderElement&, const LayoutPoint&, bool* offsetDependsOnPoint = nullptr) const;
    673673    // Return the offset from an object up the container() chain. Asserts that none of the intermediate objects have transforms.
    674674    LayoutSize offsetFromAncestorContainer(RenderElement&) const;
     
    686686
    687687    // Build an array of quads in absolute coords for line boxes
    688     virtual void absoluteQuads(Vector<FloatQuad>&, bool* /*wasFixed*/ = 0) const { }
     688    virtual void absoluteQuads(Vector<FloatQuad>&, bool* /*wasFixed*/ = nullptr) const { }
    689689
    690690    virtual void absoluteFocusRingQuads(Vector<FloatQuad>&);
     
    710710        TextDecorationStyle& underlineStyle, TextDecorationStyle& overlineStyle, TextDecorationStyle& linethroughStyle, bool firstlineStyle = false);
    711711
    712     // Return the RenderLayerModelObject in the container chain which is responsible for painting this object, or 0
     712    // Return the RenderLayerModelObject in the container chain which is responsible for painting this object, or nullptr
    713713    // if painting is root-relative. This is the container that should be passed to the 'forRepaint'
    714714    // methods.
    715715    RenderLayerModelObject* containerForRepaint() const;
    716716    // Actually do the repaint of rect r for this object which has been computed in the coordinate space
    717     // of repaintContainer. If repaintContainer is 0, repaint via the view.
     717    // of repaintContainer. If repaintContainer is nullptr, repaint via the view.
    718718    void repaintUsingContainer(const RenderLayerModelObject* repaintContainer, const LayoutRect&, bool shouldClipToLayer = true) const;
    719719   
     
    734734    LayoutRect absoluteClippedOverflowRect() const
    735735    {
    736         return clippedOverflowRectForRepaint(0);
     736        return clippedOverflowRectForRepaint(nullptr);
    737737    }
    738738    WEBCORE_EXPORT IntRect pixelSnappedAbsoluteClippedOverflowRect() const;
    739739    virtual LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const;
    740740    virtual LayoutRect rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const;
    741     virtual LayoutRect outlineBoundsForRepaint(const RenderLayerModelObject* /*repaintContainer*/, const RenderGeometryMap* = 0) const { return LayoutRect(); }
     741    virtual LayoutRect outlineBoundsForRepaint(const RenderLayerModelObject* /*repaintContainer*/, const RenderGeometryMap* = nullptr) const { return LayoutRect(); }
    742742
    743743    // Given a rect in the object's coordinate space, compute a rect suitable for repainting
     
    745745    void computeAbsoluteRepaintRect(LayoutRect& r, bool fixed = false) const
    746746    {
    747         computeRectForRepaint(0, r, fixed);
     747        computeRectForRepaint(nullptr, r, fixed);
    748748    }
    749749    // Given a rect in the object's coordinate space, compute a rect suitable for repainting
     
    778778    // A single rectangle that encompasses all of the selected objects within this object.  Used to determine the tightest
    779779    // possible bounding box for the selection.
    780     LayoutRect selectionRect(bool clipToVisibleContent = true) { return selectionRectForRepaint(0, clipToVisibleContent); }
     780    LayoutRect selectionRect(bool clipToVisibleContent = true) { return selectionRectForRepaint(nullptr, clipToVisibleContent); }
    781781    virtual LayoutRect selectionRectForRepaint(const RenderLayerModelObject* /*repaintContainer*/, bool /*clipToVisibleContent*/ = true) { return LayoutRect(); }
    782782
     
    793793     * useful for character range rect computations
    794794     */
    795     virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* extraWidthToEndOfLine = 0);
     795    virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* extraWidthToEndOfLine = nullptr);
    796796
    797797    // When performing a global document tear-down, the renderer of the document is cleared.  We use this
     
    822822    virtual int nextOffset(int current) const;
    823823
    824     virtual void imageChanged(CachedImage*, const IntRect* = 0) override;
    825     virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) { }
     824    virtual void imageChanged(CachedImage*, const IntRect* = nullptr) override;
     825    virtual void imageChanged(WrappedImagePtr, const IntRect* = nullptr) { }
    826826
    827827    SelectionSubtreeRoot& selectionRoot() const;
     
    834834    // Map points and quads through elements, potentially via 3d transforms. You should never need to call these directly; use
    835835    // localToAbsolute/absoluteToLocal methods instead.
    836     virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0) const;
     836    virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = nullptr) const;
    837837    virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) const;
    838838
     
    844844    void getTransformFromContainer(const RenderObject* container, const LayoutSize& offsetInContainer, TransformationMatrix&) const;
    845845   
    846     virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint& /* additionalOffset */, const RenderLayerModelObject* /* paintContainer */ = 0) { };
     846    virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint& /* additionalOffset */, const RenderLayerModelObject* /* paintContainer */ = nullptr) { };
    847847
    848848    LayoutRect absoluteOutlineBounds() const
    849849    {
    850         return outlineBoundsForRepaint(0);
     850        return outlineBoundsForRepaint(nullptr);
    851851    }
    852852
  • trunk/Source/WebCore/rendering/RenderView.cpp

    r179143 r180574  
    8181    RenderObject* next()
    8282    {
    83         RenderObject* currentSpan = m_spannerStack.isEmpty() ? 0 : m_spannerStack.last()->spanner();
     83        RenderObject* currentSpan = m_spannerStack.isEmpty() ? nullptr : m_spannerStack.last()->spanner();
    8484        m_current = m_current->nextInPreOrder(currentSpan);
    8585        checkForSpanner();
     
    9797    : RenderBlockFlow(document, WTF::move(style))
    9898    , m_frameView(*document.view())
    99     , m_selectionUnsplitStart(0)
    100     , m_selectionUnsplitEnd(0)
     99    , m_selectionUnsplitStart(nullptr)
     100    , m_selectionUnsplitEnd(nullptr)
    101101    , m_selectionUnsplitStartPos(-1)
    102102    , m_selectionUnsplitEndPos(-1)
     
    108108    , m_layoutState(nullptr)
    109109    , m_layoutStateDisableCount(0)
    110     , m_renderQuoteHead(0)
     110    , m_renderQuoteHead(nullptr)
    111111    , m_renderCounterCount(0)
    112112    , m_selectionWasCaret(false)
     
    416416void RenderView::mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed) const
    417417{
    418     // If a container was specified, and was not 0 or the RenderView,
     418    // If a container was specified, and was not nullptr or the RenderView,
    419419    // then we should have found it by now.
    420420    ASSERT_ARG(repaintContainer, !repaintContainer || repaintContainer == this);
     
    437437const RenderObject* RenderView::pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap) const
    438438{
    439     // If a container was specified, and was not 0 or the RenderView,
     439    // If a container was specified, and was not nullptr or the RenderView,
    440440    // then we should have found it by now.
    441441    ASSERT_ARG(ancestorToStopAt, !ancestorToStopAt || ancestorToStopAt == this);
     
    454454        geometryMap.pushView(this, scrollOffset);
    455455
    456     return 0;
     456    return nullptr;
    457457}
    458458
     
    682682void RenderView::computeRectForRepaint(const RenderLayerModelObject* repaintContainer, LayoutRect& rect, bool fixed) const
    683683{
    684     // If a container was specified, and was not 0 or the RenderView,
     684    // If a container was specified, and was not nullptr or the RenderView,
    685685    // then we should have found it by now.
    686686    ASSERT_ARG(repaintContainer, !repaintContainer || repaintContainer == this);
     
    734734{
    735735    if (!object)
    736         return 0;
     736        return nullptr;
    737737
    738738    RenderObject* child = object->childAt(offset);
     
    11271127bool RenderView::rootBackgroundIsEntirelyFixed() const
    11281128{
    1129     RenderElement* rootObject = document().documentElement() ? document().documentElement()->renderer() : 0;
     1129    RenderElement* rootObject = document().documentElement() ? document().documentElement()->renderer() : nullptr;
    11301130    if (!rootObject)
    11311131        return false;
  • trunk/Source/WebCore/rendering/RenderView.h

    r178689 r180574  
    244244
    245245protected:
    246     virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0) const override;
     246    virtual void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = nullptr) const override;
    247247    virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const override;
    248248    virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) const override;
Note: See TracChangeset for help on using the changeset viewer.