Commit 696e6441 authored by hyatt@apple.com's avatar hyatt@apple.com

Make RenderBlock have a protected constructor..

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

Reviewed by Beth Dakin.

Make sure nobody can create a RenderBlock directly. Make sure RenderBlockFlows
get made when a display:block/inline-block/compact/run-in is seen.

* html/HTMLDetailsElement.cpp:
(WebCore::HTMLDetailsElement::createRenderer):
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::createRenderer):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::createAnonymous):
* rendering/RenderBlock.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::createObject):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155141 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 01a6ea9e
2013-09-05 David Hyatt <hyatt@apple.com>
Make RenderBlock have a protected constructor..
https://bugs.webkit.org/show_bug.cgi?id=120787
Reviewed by Beth Dakin.
Make sure nobody can create a RenderBlock directly. Make sure RenderBlockFlows
get made when a display:block/inline-block/compact/run-in is seen.
* html/HTMLDetailsElement.cpp:
(WebCore::HTMLDetailsElement::createRenderer):
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::createRenderer):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::createAnonymous):
* rendering/RenderBlock.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::createObject):
2013-09-05 David Hyatt <hyatt@apple.com>
Add new RenderBlockFlow class
......@@ -27,7 +27,7 @@
#include "HTMLSummaryElement.h"
#include "LocalizedStrings.h"
#include "MouseEvent.h"
#include "RenderBlock.h"
#include "RenderBlockFlow.h"
#include "ShadowRoot.h"
#include "Text.h"
......@@ -113,7 +113,7 @@ HTMLDetailsElement::HTMLDetailsElement(const QualifiedName& tagName, Document* d
RenderObject* HTMLDetailsElement::createRenderer(RenderArena* arena, RenderStyle*)
{
return new (arena) RenderBlock(this);
return new (arena) RenderBlockFlow(this);
}
void HTMLDetailsElement::didAddUserAgentShadowRoot(ShadowRoot* root)
......
......@@ -30,7 +30,7 @@
#include "MouseEvent.h"
#include "NodeRenderingTraversal.h"
#include "PlatformMouseEvent.h"
#include "RenderBlock.h"
#include "RenderBlockFlow.h"
#include "ShadowRoot.h"
namespace WebCore {
......@@ -68,7 +68,7 @@ HTMLSummaryElement::HTMLSummaryElement(const QualifiedName& tagName, Document* d
RenderObject* HTMLSummaryElement::createRenderer(RenderArena* arena, RenderStyle*)
{
return new (arena) RenderBlock(this);
return new (arena) RenderBlockFlow(this);
}
bool HTMLSummaryElement::childShouldCreateRenderer(const Node* child) const
......
......@@ -237,7 +237,7 @@ RenderBlock::~RenderBlock()
RenderBlock* RenderBlock::createAnonymous(Document* document)
{
RenderBlock* renderer = new (document->renderArena()) RenderBlock(0);
RenderBlock* renderer = new (document->renderArena()) RenderBlockFlow(0);
renderer->setDocumentForAnonymous(document);
return renderer;
}
......
......@@ -89,9 +89,11 @@ public:
template <class> friend struct ValueToString;
#endif
protected:
explicit RenderBlock(ContainerNode*);
virtual ~RenderBlock();
public:
static RenderBlock* createAnonymous(Document*);
RenderObject* firstChild() const { ASSERT(children() == virtualChildren()); return children()->firstChild(); }
......
......@@ -207,7 +207,7 @@ RenderObject* RenderObject::createObject(Element* element, RenderStyle* style)
case COMPACT:
if ((!style->hasAutoColumnCount() || !style->hasAutoColumnWidth()) && document.regionBasedColumnsEnabled())
return new (arena) RenderMultiColumnBlock(element);
return new (arena) RenderBlock(element);
return new (arena) RenderBlockFlow(element);
case LIST_ITEM:
return new (arena) RenderListItem(element);
case TABLE:
......
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