Tighten RenderLayerModelObject subclass constructors to operate on ContainerNodes.
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Jan 2013 21:50:05 +0000 (21:50 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Jan 2013 21:50:05 +0000 (21:50 +0000)
commit60b1856b3420c6112dfd684a1b4ce817533ce52d
tree644f51e8d5792461a27caa76e9acee8b0e32b6c3
parentb3ab835d86a838779ae3eb965e58e5198ee8e08f
Tighten RenderLayerModelObject subclass constructors to operate on ContainerNodes.
https://bugs.webkit.org/show_bug.cgi?id=107041

Reviewed by Simon Fraser.

In rendering code only Nodes that are not ContainerNodes are used by RenderText. Tighter typing is better in general.
It also enables better code generation (especially with Document* moving from Node to ContainerNode).

This patch tightens constuctors for better static type checking. It also overrides node() with a covariant ContainerNode* return type
version in RenderLayerModelObject. RenderObject::createObject() is tightened to take Element*.

This patch does not change Node* usage in non-construction code (expect for the node() override).

With some further work it should be possible to tighten most of the rendering tree to operate on Elements for even less branchiness.

* dom/Document.cpp:
(WebCore::Document::attach):
* html/shadow/SliderThumbElement.cpp:
(WebCore::RenderSliderThumb::RenderSliderThumb):
(WebCore::RenderSliderContainer::RenderSliderContainer):
* html/shadow/SliderThumbElement.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::RenderBlock):
* rendering/RenderBlock.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::RenderBox):
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::RenderBoxModelObject):
* rendering/RenderBoxModelObject.h:
* rendering/RenderButton.cpp:
(WebCore::RenderButton::RenderButton):
* rendering/RenderButton.h:
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::RenderDeprecatedFlexibleBox):
* rendering/RenderDeprecatedFlexibleBox.h:
* rendering/RenderDetailsMarker.cpp:
(WebCore::RenderDetailsMarker::RenderDetailsMarker):
* rendering/RenderDetailsMarker.h:
* rendering/RenderDialog.h:
(WebCore::RenderDialog::RenderDialog):
* rendering/RenderFieldset.cpp:
(WebCore::RenderFieldset::RenderFieldset):
* rendering/RenderFieldset.h:
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::RenderFlexibleBox):
* rendering/RenderFlexibleBox.h:
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::RenderFlowThread):
* rendering/RenderFlowThread.h:
* rendering/RenderFullScreen.cpp:
(RenderFullScreen::RenderFullScreen):
* rendering/RenderFullScreen.h:
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::RenderGrid):
* rendering/RenderGrid.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::RenderImage):
* rendering/RenderImage.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::RenderInline):
* rendering/RenderInline.h:
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::RenderLayerModelObject):
* rendering/RenderLayerModelObject.h:
(WebCore::RenderLayerModelObject::node):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::RenderListItem):
* rendering/RenderListItem.h:
* rendering/RenderMediaControlElements.cpp:
(WebCore::RenderMediaVolumeSliderContainer::RenderMediaVolumeSliderContainer):
(WebCore::RenderMediaControlTimeDisplay::RenderMediaControlTimeDisplay):
(WebCore::RenderTextTrackContainerElement::RenderTextTrackContainerElement):
* rendering/RenderMediaControlElements.h:
* rendering/RenderMultiColumnBlock.cpp:
(WebCore::RenderMultiColumnBlock::RenderMultiColumnBlock):
* rendering/RenderMultiColumnBlock.h:
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::RenderMultiColumnFlowThread):
* rendering/RenderMultiColumnFlowThread.h:
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::RenderMultiColumnSet):
* rendering/RenderMultiColumnSet.h:
(RenderMultiColumnSet):
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::RenderNamedFlowThread):
* rendering/RenderNamedFlowThread.h:
(RenderNamedFlowThread):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::createObject):
* rendering/RenderObject.h:
(RenderObject):
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::RenderRegion):
* rendering/RenderRegion.h:
(RenderRegion):
* rendering/RenderRegionSet.cpp:
(WebCore::RenderRegionSet::RenderRegionSet):
* rendering/RenderRegionSet.h:
(RenderRegionSet):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::RenderReplaced):
* rendering/RenderReplaced.h:
(RenderReplaced):
* rendering/RenderReplica.cpp:
(WebCore::RenderReplica::RenderReplica):
(WebCore::RenderReplica::~RenderReplica):
* rendering/RenderReplica.h:
* rendering/RenderRuby.cpp:
(WebCore::RenderRubyAsInline::RenderRubyAsInline):
(WebCore::RenderRubyAsBlock::RenderRubyAsBlock):
* rendering/RenderRuby.h:
* rendering/RenderRubyBase.cpp:
(WebCore::RenderRubyBase::RenderRubyBase):
* rendering/RenderRubyBase.h:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::RenderRubyRun):
* rendering/RenderRubyRun.h:
(RenderRubyRun):
* rendering/RenderRubyText.cpp:
(WebCore::RenderRubyText::RenderRubyText):
* rendering/RenderRubyText.h:
(RenderRubyText):
* rendering/RenderScrollbarPart.cpp:
(WebCore::RenderScrollbarPart::RenderScrollbarPart):
* rendering/RenderScrollbarPart.h:
(RenderScrollbarPart):
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::RenderSearchField):
* rendering/RenderSearchField.h:
(RenderSearchField):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::RenderTable):
* rendering/RenderTable.h:
(RenderTable):
* rendering/RenderTableCaption.cpp:
(WebCore::RenderTableCaption::RenderTableCaption):
* rendering/RenderTableCaption.h:
(RenderTableCaption):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::RenderTableCell):
* rendering/RenderTableCell.h:
(RenderTableCell):
* rendering/RenderTableCol.cpp:
(WebCore::RenderTableCol::RenderTableCol):
* rendering/RenderTableCol.h:
(RenderTableCol):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::RenderTableRow):
* rendering/RenderTableRow.h:
(RenderTableRow):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::RenderTableSection):
* rendering/RenderTableSection.h:
(RenderTableSection):
* 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/RenderView.h:
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::RenderWidget):
* rendering/RenderWidget.h:
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::RenderMathMLBlock):
* rendering/mathml/RenderMathMLBlock.h:
(WebCore::RenderMathMLTable::RenderMathMLTable):
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::RenderMathMLOperator):
* rendering/mathml/RenderMathMLOperator.h:
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::RenderMathMLRow):
* rendering/mathml/RenderMathMLRow.h:
(RenderMathMLRow):
(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: https://svn.webkit.org/repository/webkit/trunk@139920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
102 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/html/shadow/SliderThumbElement.cpp
Source/WebCore/html/shadow/SliderThumbElement.h
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlock.h
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderBoxModelObject.h
Source/WebCore/rendering/RenderButton.cpp
Source/WebCore/rendering/RenderButton.h
Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
Source/WebCore/rendering/RenderDeprecatedFlexibleBox.h
Source/WebCore/rendering/RenderDetailsMarker.cpp
Source/WebCore/rendering/RenderDetailsMarker.h
Source/WebCore/rendering/RenderDialog.h
Source/WebCore/rendering/RenderFieldset.cpp
Source/WebCore/rendering/RenderFieldset.h
Source/WebCore/rendering/RenderFlexibleBox.cpp
Source/WebCore/rendering/RenderFlexibleBox.h
Source/WebCore/rendering/RenderFlowThread.cpp
Source/WebCore/rendering/RenderFlowThread.h
Source/WebCore/rendering/RenderFullScreen.cpp
Source/WebCore/rendering/RenderFullScreen.h
Source/WebCore/rendering/RenderGrid.cpp
Source/WebCore/rendering/RenderGrid.h
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderImage.h
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderInline.h
Source/WebCore/rendering/RenderLayerModelObject.cpp
Source/WebCore/rendering/RenderLayerModelObject.h
Source/WebCore/rendering/RenderListItem.cpp
Source/WebCore/rendering/RenderListItem.h
Source/WebCore/rendering/RenderMediaControlElements.cpp
Source/WebCore/rendering/RenderMediaControlElements.h
Source/WebCore/rendering/RenderMultiColumnBlock.cpp
Source/WebCore/rendering/RenderMultiColumnBlock.h
Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp
Source/WebCore/rendering/RenderMultiColumnFlowThread.h
Source/WebCore/rendering/RenderMultiColumnSet.cpp
Source/WebCore/rendering/RenderMultiColumnSet.h
Source/WebCore/rendering/RenderNamedFlowThread.cpp
Source/WebCore/rendering/RenderNamedFlowThread.h
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/RenderRegion.cpp
Source/WebCore/rendering/RenderRegion.h
Source/WebCore/rendering/RenderRegionSet.cpp
Source/WebCore/rendering/RenderRegionSet.h
Source/WebCore/rendering/RenderReplaced.cpp
Source/WebCore/rendering/RenderReplaced.h
Source/WebCore/rendering/RenderReplica.cpp
Source/WebCore/rendering/RenderReplica.h
Source/WebCore/rendering/RenderRuby.cpp
Source/WebCore/rendering/RenderRuby.h
Source/WebCore/rendering/RenderRubyBase.cpp
Source/WebCore/rendering/RenderRubyBase.h
Source/WebCore/rendering/RenderRubyRun.cpp
Source/WebCore/rendering/RenderRubyRun.h
Source/WebCore/rendering/RenderRubyText.cpp
Source/WebCore/rendering/RenderRubyText.h
Source/WebCore/rendering/RenderScrollbarPart.cpp
Source/WebCore/rendering/RenderScrollbarPart.h
Source/WebCore/rendering/RenderSearchField.cpp
Source/WebCore/rendering/RenderSearchField.h
Source/WebCore/rendering/RenderTable.cpp
Source/WebCore/rendering/RenderTable.h
Source/WebCore/rendering/RenderTableCaption.cpp
Source/WebCore/rendering/RenderTableCaption.h
Source/WebCore/rendering/RenderTableCell.cpp
Source/WebCore/rendering/RenderTableCell.h
Source/WebCore/rendering/RenderTableCol.cpp
Source/WebCore/rendering/RenderTableCol.h
Source/WebCore/rendering/RenderTableRow.cpp
Source/WebCore/rendering/RenderTableRow.h
Source/WebCore/rendering/RenderTableSection.cpp
Source/WebCore/rendering/RenderTableSection.h
Source/WebCore/rendering/RenderTextControl.cpp
Source/WebCore/rendering/RenderTextControl.h
Source/WebCore/rendering/RenderTextControlMultiLine.cpp
Source/WebCore/rendering/RenderTextControlMultiLine.h
Source/WebCore/rendering/RenderTextControlSingleLine.cpp
Source/WebCore/rendering/RenderTextControlSingleLine.h
Source/WebCore/rendering/RenderTextTrackCue.cpp
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/RenderView.h
Source/WebCore/rendering/RenderWidget.cpp
Source/WebCore/rendering/RenderWidget.h
Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
Source/WebCore/rendering/mathml/RenderMathMLBlock.h
Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
Source/WebCore/rendering/mathml/RenderMathMLOperator.h
Source/WebCore/rendering/mathml/RenderMathMLRow.cpp
Source/WebCore/rendering/mathml/RenderMathMLRow.h
Source/WebCore/rendering/svg/RenderSVGInline.cpp
Source/WebCore/rendering/svg/RenderSVGInline.h
Source/WebCore/rendering/svg/RenderSVGTSpan.cpp
Source/WebCore/rendering/svg/RenderSVGTSpan.h
Source/WebCore/rendering/svg/RenderSVGTextPath.cpp
Source/WebCore/rendering/svg/RenderSVGTextPath.h