Changeset 156144 in webkit


Ignore:
Timestamp:
Sep 20, 2013, 1:59:25 AM (11 years ago)
Author:
Antti Koivisto
Message:

Add covariant RenderElement* Element::renderer()
https://bugs.webkit.org/show_bug.cgi?id=121638

Reviewed by Andreas Kling.

Also add isRenderElement() test and casting functions.

Location:
trunk/Source/WebCore
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r156142 r156144  
     12013-09-20  Antti Koivisto  <antti@apple.com>
     2
     3        Add covariant RenderElement* Element::renderer()
     4        https://bugs.webkit.org/show_bug.cgi?id=121638
     5
     6        Reviewed by Andreas Kling.
     7
     8        Also add isRenderElement() test and casting functions.
     9
    1102013-09-19  Anders Carlsson  <andersca@apple.com>
    211
  • trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp

    r155955 r156144  
    3232#include "FrameView.h"
    3333#include "HTMLFrameOwnerElement.h"
     34#include "RenderElement.h"
    3435#include "ScrollView.h"
    3536#include "Widget.h"
  • trunk/Source/WebCore/accessibility/AccessibilitySpinButton.cpp

    r156121 r156144  
    2828
    2929#include "AXObjectCache.h"
    30 #include "RenderObject.h"
     30#include "RenderElement.h"
    3131
    3232namespace WebCore {
  • trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTable.cpp

    r152440 r156144  
    4141#include "HTMLTableCaptionElement.h"
    4242#include "HTMLTableElement.h"
    43 #include "RenderObject.h"
     43#include "RenderElement.h"
    4444#include "WebKitAccessibleInterfaceText.h"
    4545#include "WebKitAccessibleWrapperAtk.h"
     
    216216            HTMLTableCaptionElement* caption = toHTMLTableElement(node)->caption();
    217217            if (caption)
    218                 return AccessibilityObject::firstAccessibleObjectFromNode(caption->renderer()->node())->wrapper();
     218                return AccessibilityObject::firstAccessibleObjectFromNode(caption->renderer()->element())->wrapper();
    219219        }
    220220    }
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm

    r156121 r156144  
    12901290                        push(@customGetterContent, "    if (!IMPL->renderer() || !IMPL->renderer()->isImage())\n");
    12911291                        push(@customGetterContent, "        return nil;\n");
    1292                         $implIncludes{"RenderObject.h"} = 1;
     1292                        $implIncludes{"RenderElement.h"} = 1;
    12931293                    }
    12941294                }
  • trunk/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp

    r155429 r156144  
    3131#include "JSRetainPtr.h"
    3232#include "JavaScript.h"
     33#include "RenderElement.h"
    3334#include "StillImageQt.h"
    3435#include <QBuffer>
  • trunk/Source/WebCore/css/SelectorChecker.cpp

    r156121 r156144  
    4949#include "NodeRenderStyle.h"
    5050#include "Page.h"
    51 #include "RenderObject.h"
     51#include "RenderElement.h"
    5252#include "RenderScrollbar.h"
    5353#include "RenderStyle.h"
  • trunk/Source/WebCore/dom/ContainerNode.h

    r156121 r156144  
    3434
    3535class FloatPoint;
    36    
     36
    3737typedef void (*NodeCallback)(Node*, unsigned);
    3838
  • trunk/Source/WebCore/dom/Element.h

    r156121 r156144  
    4545class Locale;
    4646class PseudoElement;
     47class RenderElement;
    4748class RenderRegion;
    4849class ShadowRoot;
     
    128129#endif
    129130
     131    RenderElement* renderer() const;
     132
    130133    bool hasAttribute(const QualifiedName&) const;
    131134    const AtomicString& getAttribute(const QualifiedName&) const;
  • trunk/Source/WebCore/dom/PseudoElement.cpp

    r156121 r156144  
    3030#include "ContentData.h"
    3131#include "InspectorInstrumentation.h"
    32 #include "RenderObject.h"
     32#include "RenderElement.h"
    3333#include "RenderQuote.h"
    3434
     
    7979void PseudoElement::didAttachRenderers()
    8080{
    81     RenderObject* renderer = this->renderer();
     81    RenderElement* renderer = this->renderer();
    8282    if (!renderer || !renderer->style()->regionThread().isEmpty())
    8383        return;
  • trunk/Source/WebCore/editing/SplitTextNodeContainingElementCommand.cpp

    r156121 r156144  
    2828
    2929#include "Element.h"
     30#include "RenderElement.h"
    3031#include "Text.h"
    31 #include "RenderObject.h"
    3232#include <wtf/Assertions.h>
    3333
     
    5454        return;
    5555
    56     RenderObject* parentRenderer = parent->renderer();
     56    RenderElement* parentRenderer = parent->renderer();
    5757    if (!parentRenderer || !parentRenderer->isInline()) {
    5858        wrapContentsInDummySpan(parent);
  • trunk/Source/WebCore/editing/TypingCommand.cpp

    r156121 r156144  
    3838#include "InsertParagraphSeparatorCommand.h"
    3939#include "InsertTextCommand.h"
    40 #include "RenderObject.h"
     40#include "RenderElement.h"
    4141#include "TextIterator.h"
    4242#include "VisiblePosition.h"
  • trunk/Source/WebCore/html/ImageDocument.cpp

    r156121 r156144  
    4343#include "Page.h"
    4444#include "RawDataDocumentParser.h"
     45#include "RenderElement.h"
    4546#include "ResourceBuffer.h"
    4647#include "Settings.h"
  • trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp

    r155894 r156144  
    5151#include "PingLoader.h"
    5252#include "PlatformStrategies.h"
     53#include "RenderElement.h"
    5354#include "ResourceLoadScheduler.h"
    5455#include "ScriptController.h"
  • trunk/Source/WebCore/page/PageSerializer.cpp

    r156121 r156144  
    5151#include "MarkupAccumulator.h"
    5252#include "Page.h"
     53#include "RenderElement.h"
    5354#include "StyleCachedImage.h"
    5455#include "StyleImage.h"
  • trunk/Source/WebCore/plugins/gtk/PluginViewGtk.cpp

    r154122 r156144  
    5959#include "PluginMainThreadScheduler.h"
    6060#include "PluginPackage.h"
    61 #include "RenderObject.h"
     61#include "RenderElement.h"
    6262#include "Settings.h"
    6363#include "SpatialNavigation.h"
  • trunk/Source/WebCore/rendering/RenderElement.h

    r156121 r156144  
    4848};
    4949
     50inline RenderElement& toRenderElement(RenderObject& object)
     51{
     52    ASSERT_WITH_SECURITY_IMPLICATION(object.isRenderElement());
     53    return static_cast<RenderElement&>(object);
     54}
     55
     56inline const RenderElement& toRenderElement(const RenderObject& object)
     57{
     58    ASSERT_WITH_SECURITY_IMPLICATION(object.isRenderElement());
     59    return static_cast<const RenderElement&>(object);
     60}
     61
     62inline RenderElement* toRenderElement(RenderObject* object)
     63{
     64    ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderElement());
     65    return static_cast<RenderElement*>(object);
     66}
     67
     68inline const RenderElement* toRenderElement(const RenderObject* object)
     69{
     70    ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderElement());
     71    return static_cast<const RenderElement*>(object);
     72}
     73
     74// This will catch anyone doing an unnecessary cast.
     75void toRenderElement(const RenderElement*);
     76void toRenderElement(const RenderElement&);
     77
     78inline RenderElement* Element::renderer() const
     79{
     80    return toRenderElement(Node::renderer());
     81}
     82
    5083} // namespace WebCore
    5184
  • trunk/Source/WebCore/rendering/RenderObject.h

    r156121 r156144  
    343343    bool isPseudoElement() const { return node() && node()->isPseudoElement(); }
    344344
     345    bool isRenderElement() const { return !isText(); }
    345346    virtual bool isBoxModelObject() const { return false; }
    346347    virtual bool isCounter() const { return false; }
  • trunk/Source/WebCore/svg/SVGAnimatedColor.cpp

    r156121 r156144  
    2424
    2525#include "ColorDistance.h"
    26 #include "RenderObject.h"
     26#include "RenderElement.h"
    2727#include "SVGAnimateElement.h"
    2828#include "SVGColor.h"
     
    5353    ASSERT(targetElement);
    5454
    55     if (RenderObject* targetRenderer = targetElement->renderer())
     55    if (RenderElement* targetRenderer = targetElement->renderer())
    5656        color = targetRenderer->style()->visitedDependentColor(CSSPropertyColor);
    5757    else
  • trunk/Source/WebCore/svg/SVGLocatable.cpp

    r156121 r156144  
    2626#include "SVGLocatable.h"
    2727
    28 #include "RenderObject.h"
     28#include "RenderElement.h"
    2929#include "SVGException.h"
    3030#include "SVGGraphicsElement.h"
  • trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp

    r156121 r156144  
    2929#include "Filter.h"
    3030#include "GraphicsContext.h"
    31 #include "RenderObject.h"
     31#include "RenderElement.h"
    3232#include "RenderTreeAsText.h"
    3333#include "SVGElement.h"
     
    7575        srcRect.setSize(m_image->size());
    7676        m_preserveAspectRatio.transformRect(paintRect, srcRect);
    77     } else if (RenderObject* renderer = referencedRenderer())
     77    } else if (RenderElement* renderer = referencedRenderer())
    7878        srcRect = svgFilter->absoluteTransform().mapRect(renderer->repaintRectInLocalCoordinates());
    7979
     
    8585}
    8686
    87 RenderObject* FEImage::referencedRenderer() const
     87RenderElement* FEImage::referencedRenderer() const
    8888{
    8989    if (!m_document)
  • trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.h

    r156121 r156144  
    3232class Document;
    3333class Image;
    34 class RenderObject;
     34class RenderElement;
    3535
    3636class FEImage : public FilterEffect {
     
    5555    FEImage(Filter*, PassRefPtr<Image>, const SVGPreserveAspectRatio&);
    5656    FEImage(Filter*, Document*, const String&, const SVGPreserveAspectRatio&);
    57     RenderObject* referencedRenderer() const;
     57    RenderElement* referencedRenderer() const;
    5858
    5959    RefPtr<Image> m_image;
Note: See TracChangeset for help on using the changeset viewer.