[CTTE] RenderTableCaption is never anonymous.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Sep 2013 12:18:46 +0000 (12:18 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 13 Sep 2013 12:18:46 +0000 (12:18 +0000)
<https://webkit.org/b/121289>

Reviewed by Antti Koivisto.

Hide element() and provide existingElement() instead, returning an Element&.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155686 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderTableCaption.cpp
Source/WebCore/rendering/RenderTableCaption.h

index 905aec3..1b615ec 100644 (file)
@@ -1,5 +1,14 @@
 2013-09-13  Andreas Kling  <akling@apple.com>
 
+        [CTTE] RenderTableCaption is never anonymous.
+        <https://webkit.org/b/121289>
+
+        Reviewed by Antti Koivisto.
+
+        Hide element() and provide existingElement() instead, returning an Element&.
+
+2013-09-13  Andreas Kling  <akling@apple.com>
+
         [CTTE] RenderTableCol is never anonymous.
         <https://webkit.org/b/121286>
 
index 0668b3f..f37984b 100644 (file)
@@ -225,7 +225,7 @@ RenderObject* RenderObject::createObject(Element* element, RenderStyle* style)
     case TABLE_CELL:
         return new (arena) RenderTableCell(element);
     case TABLE_CAPTION:
-        return new (arena) RenderTableCaption(element);
+        return new (arena) RenderTableCaption(*element);
     case BOX:
     case INLINE_BOX:
         return new (arena) RenderDeprecatedFlexibleBox(element);
index a49ab3d..87a3925 100644 (file)
@@ -24,8 +24,8 @@
 
 namespace WebCore {
 
-RenderTableCaption::RenderTableCaption(Element* element)
-    : RenderBlockFlow(element)
+RenderTableCaption::RenderTableCaption(Element& element)
+    : RenderBlockFlow(&element)
 {
 }
 
index c446790..ba7306c 100644 (file)
@@ -28,11 +28,16 @@ class RenderTable;
 
 class RenderTableCaption FINAL : public RenderBlockFlow {
 public:
-    explicit RenderTableCaption(Element*);
+    explicit RenderTableCaption(Element&);
     virtual ~RenderTableCaption();
+
+    Element& existingElement() const { return *RenderBlockFlow::element(); }
+
     virtual LayoutUnit containingBlockLogicalWidthForContent() const OVERRIDE;
     
 private:
+    void element() const WTF_DELETED_FUNCTION;
+
     virtual bool isTableCaption() const OVERRIDE { return true; }
 
     virtual void insertedIntoTree() OVERRIDE;