Make renderer constructors take Element where possible
https://bugs.webkit.org/show_bug.cgi?id=107138

Reviewed by David Hyatt.
        
Tighter typing prevents bugs and enables optimizations.

The patch changes how anonymous rendererer are constructed. Previously Document* as the node parameter
indicated that the renderer was anonymous. This forced the code to operate on ContainerNodes (Document
is not an Element). Now anonymous renderers are constructed by passing null and the document is set by
separate setDocumentForAnonymous() call. The patch uses RenderFoo::createAnonymous() pattern consistently.

Most constructors are switched to take Element. RenderBlock still takes ContainerNode due to a few subclasses
(RenderView and RenderFlowThread) that pass in a Document.

* page/FrameView.cpp:
(WebCore::FrameView::updateScrollCorner):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::createAnonymous):
(WebCore::RenderBlock::createReplacementRunIn):
(WebCore::RenderBlock::updateFirstLetterStyle):
(WebCore::RenderBlock::createFirstLetterRenderer):
(WebCore::RenderBlock::createAnonymousWithParentRendererAndDisplay):
(WebCore::RenderBlock::createAnonymousColumnsWithParentRenderer):
(WebCore::RenderBlock::createAnonymousColumnSpanWithParentRenderer):
* rendering/RenderBlock.h:
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::RenderDeprecatedFlexibleBox):
(WebCore::RenderDeprecatedFlexibleBox::createAnonymous):
* rendering/RenderDeprecatedFlexibleBox.h:
(RenderDeprecatedFlexibleBox):
* rendering/RenderDetailsMarker.cpp:
(WebCore::RenderDetailsMarker::RenderDetailsMarker):
* rendering/RenderDetailsMarker.h:
(RenderDetailsMarker):
* rendering/RenderDialog.h:
(WebCore::RenderDialog::RenderDialog):
* rendering/RenderFieldset.cpp:
(WebCore::RenderFieldset::RenderFieldset):
* rendering/RenderFieldset.h:
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::RenderFlexibleBox):
* rendering/RenderFlexibleBox.h:
(RenderFlexibleBox):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::RenderFlowThread):
* rendering/RenderFlowThread.h:
* rendering/RenderFullScreen.cpp:
(RenderFullScreenPlaceholder::RenderFullScreenPlaceholder):
(RenderFullScreen::RenderFullScreen):
(RenderFullScreen::createAnonymous):
(RenderFullScreen::wrapRenderer):
* rendering/RenderFullScreen.h:
(RenderFullScreen):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::RenderGrid):
* rendering/RenderGrid.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::RenderImage):
(WebCore::RenderImage::createAnonymous):
* rendering/RenderImage.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::RenderInline):
(WebCore::RenderInline::createAnonymous):
(WebCore::RenderInline::addChildIgnoringContinuation):
* rendering/RenderInline.h:
(RenderInline):
(WebCore::RenderInline::node):
        
    Add version with covariant Element return type.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateScrollCornerStyle):
(WebCore::RenderLayer::updateResizerStyle):
(WebCore::RenderLayer::createReflection):
(WebCore::RenderListItem::RenderListItem):
(WebCore::RenderListItem::styleDidChange):
* rendering/RenderListItem.h:
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::RenderListMarker):
(WebCore::RenderListMarker::createAnonymous):
* rendering/RenderListMarker.h:
* rendering/RenderMediaControlElements.cpp:
(WebCore::RenderMediaVolumeSliderContainer::RenderMediaVolumeSliderContainer):
(WebCore::RenderMediaControlTimeDisplay::RenderMediaControlTimeDisplay):
(WebCore::RenderTextTrackContainerElement::RenderTextTrackContainerElement):
* rendering/RenderMediaControlElements.h:
(RenderMediaVolumeSliderContainer):
(RenderMediaControlTimeDisplay):
(RenderTextTrackContainerElement):
* rendering/RenderMultiColumnBlock.cpp:
(WebCore::RenderMultiColumnBlock::RenderMultiColumnBlock):
(WebCore::RenderMultiColumnBlock::ensureColumnSets):
* rendering/RenderMultiColumnBlock.h:
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::RenderMultiColumnFlowThread):
* rendering/RenderMultiColumnFlowThread.h:
(RenderMultiColumnFlowThread):
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::RenderMultiColumnSet):
(WebCore::RenderMultiColumnSet::createAnonymous):
* rendering/RenderMultiColumnSet.h:
(RenderMultiColumnSet):
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::RenderNamedFlowThread):
* rendering/RenderNamedFlowThread.h:
(RenderNamedFlowThread):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::RenderObject):
* rendering/RenderObject.h:
        
     Passed in null node indicates that the renderer is anonymous. Remove now unnecessary setIsAnonymous() function.

(WebCore::RenderObject::isAnonymous):
(WebCore::RenderObject::setDocumentForAnonymous):
(WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::RenderRegion):
* rendering/RenderRegion.h:
* rendering/RenderRegionSet.cpp:
(WebCore::RenderRegionSet::RenderRegionSet):
* rendering/RenderRegionSet.h:
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::RenderReplaced):
* rendering/RenderReplaced.h:
* rendering/RenderReplica.cpp:
(WebCore::RenderReplica::RenderReplica):
(WebCore::RenderReplica::createAnonymous):
* rendering/RenderReplica.h:
(RenderReplica):
* rendering/RenderRuby.cpp:
(WebCore::createAnonymousRubyInlineBlock):
(WebCore::RenderRubyAsInline::RenderRubyAsInline):
(WebCore::RenderRubyAsBlock::RenderRubyAsBlock):
* rendering/RenderRuby.h:
(RenderRubyAsInline):
(RenderRubyAsBlock):
* rendering/RenderRubyBase.cpp:
(WebCore::RenderRubyBase::RenderRubyBase):
(WebCore::RenderRubyBase::createAnonymous):
* rendering/RenderRubyBase.h:
(RenderRubyBase):
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::RenderRubyRun):
(WebCore::RenderRubyRun::createRubyBase):
(WebCore::RenderRubyRun::staticCreateRubyRun):
* rendering/RenderRubyRun.h:
* rendering/RenderRubyText.cpp:
(WebCore::RenderRubyText::RenderRubyText):
* rendering/RenderRubyText.h:
* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::updateScrollbarPart):
* rendering/RenderScrollbarPart.cpp:
(WebCore::RenderScrollbarPart::RenderScrollbarPart):
(WebCore::RenderScrollbarPart::createAnonymous):
* rendering/RenderScrollbarPart.h:
(RenderScrollbarPart):
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::RenderSearchField):
* rendering/RenderSearchField.h:
(RenderSearchField):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::RenderTable):
(WebCore::RenderTable::createAnonymousWithParentRenderer):
* rendering/RenderTable.h:
* rendering/RenderTableCaption.cpp:
(WebCore::RenderTableCaption::RenderTableCaption):
* rendering/RenderTableCaption.h:
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::RenderTableCell):
(WebCore::RenderTableCell::createAnonymousWithParentRenderer):
* rendering/RenderTableCell.h:
* rendering/RenderTableCol.cpp:
(WebCore::RenderTableCol::RenderTableCol):
* rendering/RenderTableCol.h:
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::RenderTableRow):
(WebCore::RenderTableRow::createAnonymousWithParentRenderer):
* rendering/RenderTableRow.h:
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::RenderTableSection):
(WebCore::RenderTableSection::createAnonymousWithParentRenderer):
* rendering/RenderTableSection.h:
* rendering/RenderText.cpp:
(WebCore::RenderText::RenderText):
        
    Pass null and use setDocumentForAnonymous() if a RenderText is created with the Document as renderer
    to keep them working. Text renderers should be factored similarly to the rest.

* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::RenderTextControl):
* rendering/RenderTextControl.h:
* rendering/RenderTextControlMultiLine.cpp:
(WebCore::RenderTextControlMultiLine::RenderTextControlMultiLine):
* rendering/RenderTextControlMultiLine.h:
(RenderTextControlMultiLine):
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::RenderTextControlSingleLine):
* rendering/RenderTextControlSingleLine.h:
(RenderTextControlSingleLine):
(WebCore::RenderTextControlInnerBlock::RenderTextControlInnerBlock):
* rendering/RenderTextTrackCue.cpp:
(WebCore::RenderTextTrackCue::RenderTextTrackCue):
* rendering/RenderView.cpp:
(WebCore::RenderView::RenderView):
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::RenderWidget):
* rendering/RenderWidget.h:
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::RenderMathMLBlock):
(WebCore::RenderMathMLBlock::createAnonymousMathMLBlock):
* rendering/mathml/RenderMathMLBlock.h:
* rendering/mathml/RenderMathMLFenced.cpp:
(WebCore::RenderMathMLFenced::createMathMLOperator):
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::RenderMathMLOperator):
(WebCore::RenderMathMLOperator::updateFromElement):
(WebCore::RenderMathMLOperator::createGlyph):
* rendering/mathml/RenderMathMLOperator.h:
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::RenderMathMLRow):
(WebCore::RenderMathMLRow::createAnonymousWithParentRenderer):
* rendering/mathml/RenderMathMLRow.h:
* rendering/style/ContentData.cpp:
(WebCore::ImageContentData::createRenderer):
* rendering/svg/RenderSVGBlock.cpp:
(WebCore::RenderSVGBlock::RenderSVGBlock):
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::RenderSVGInline):
* rendering/svg/RenderSVGInline.h:
* rendering/svg/RenderSVGTSpan.cpp:
(WebCore::RenderSVGTSpan::RenderSVGTSpan):
* rendering/svg/RenderSVGTSpan.h:
* rendering/svg/RenderSVGTextPath.cpp:
(WebCore::RenderSVGTextPath::RenderSVGTextPath):
* rendering/svg/RenderSVGTextPath.h:



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