Pass Document directly to anonymous renderer constructors.
<https://webkit.org/b/122752>
Reviewed by Antti Koivisto.
Added separate constructors for creating anonymous renderers that
take a Document& instead of a null Element*/Text*.
Removed setDocumentForAnonymous() and all createAnonymous() helpers.
...and RenderObject::m_node is now a Node&, wohoo!
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157408 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/rendering/RenderBlockFlow.cpp b/Source/WebCore/rendering/RenderBlockFlow.cpp
index 2978ce2..f66ac8f 100644
--- a/Source/WebCore/rendering/RenderBlockFlow.cpp
+++ b/Source/WebCore/rendering/RenderBlockFlow.cpp
@@ -44,6 +44,7 @@
};
COMPILE_ASSERT(sizeof(RenderBlockFlow::MarginValues) == sizeof(LayoutUnit[4]), MarginValues_should_stay_small);
+COMPILE_ASSERT(sizeof(RenderBlockFlow::MarginInfo) == sizeof(SameSizeAsMarginInfo), MarginInfo_should_stay_small);
// Our MarginInfo state used when laying out block children.
RenderBlockFlow::MarginInfo::MarginInfo(RenderBlockFlow* block, LayoutUnit beforeBorderPadding, LayoutUnit afterBorderPadding)
@@ -78,10 +79,14 @@
m_negativeMargin = (m_canCollapseMarginBeforeWithChildren && !block->mustDiscardMarginBefore()) ? block->maxNegativeMarginBefore() : LayoutUnit();
}
-RenderBlockFlow::RenderBlockFlow(Element* element)
+RenderBlockFlow::RenderBlockFlow(Element& element)
: RenderBlock(element, RenderBlockFlowFlag)
{
- COMPILE_ASSERT(sizeof(RenderBlockFlow::MarginInfo) == sizeof(SameSizeAsMarginInfo), MarginInfo_should_stay_small);
+}
+
+RenderBlockFlow::RenderBlockFlow(Document& document)
+ : RenderBlock(document, RenderBlockFlowFlag)
+{
}
RenderBlockFlow::~RenderBlockFlow()