Addressing post-review comment on r174297.
https://bugs.webkit.org/show_bug.cgi?id=137355

Unreviewed.

* rendering/RenderText.cpp:
(WebCore::RenderText::stringView):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174373 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use is<>() / downcast<>() for ScrollingTreeNode subclasses
https://bugs.webkit.org/show_bug.cgi?id=137451

Reviewed by Tim Horton.

Use is<>() / downcast<>() for ScrollingTreeNode subclasses.

No new tests, no behavior change.

* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
(WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling):
(WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* page/scrolling/ScrollingTreeNode.h:
* page/scrolling/ScrollingTreeOverflowScrollingNode.h:
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/mac/ScrollingTreeFixedNode.h:
* page/scrolling/mac/ScrollingTreeStickyNode.h:
* page/scrolling/mac/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add is<>() / downcast<>() support for RenderObject subclasses
https://bugs.webkit.org/show_bug.cgi?id=137424

Reviewed by Benjamin Poulain.

Source/WebCore:

Add is<>() / downcast<>() support for RenderObject subclasses, and
get rid of IsRendererOfType traits struct as we can now rely on the
TypeCastsTraits instead.

toRender*() is still supported for most render objects because I did
not want to remove all usages in this patch, to keep the size small.
For now, only the MathML render objects were ported over to using
is<>() / downcast<>(). Other render objects will be taken care of in
follow-up patches and I will drop support for toRender*()
incrementally.

No new tests, no behavior change.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isMathFenceOperator):
(WebCore::AccessibilityRenderObject::isMathSeparatorOperator):
(WebCore::AccessibilityRenderObject::mathLineThickness):
* dom/make_names.pl:
(printTypeHelpers):
* mathml/MathMLInlineContainerElement.cpp:
(WebCore::MathMLInlineContainerElement::childrenChanged):
* mathml/MathMLTextElement.cpp:
(WebCore::MathMLTextElement::didAttachRenderers):
(WebCore::MathMLTextElement::childrenChanged):
* rendering/RenderAncestorIterator.h:
(WebCore::lineageOfType):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.h:
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.h:
* rendering/RenderButton.h:
* rendering/RenderCombineText.h:
* rendering/RenderCounter.h:
* rendering/RenderDetailsMarker.h:
* rendering/RenderElement.h:
* rendering/RenderEmbeddedObject.h:
* rendering/RenderFieldset.h:
* rendering/RenderFileUploadControl.h:
* rendering/RenderFlexibleBox.h:
* rendering/RenderFlowThread.h:
* rendering/RenderFrame.h:
* rendering/RenderFrameSet.h:
* rendering/RenderFullScreen.h:
* rendering/RenderGrid.h:
* rendering/RenderHTMLCanvas.h:
* rendering/RenderIFrame.h:
* rendering/RenderImage.h:
* rendering/RenderInline.h:
* rendering/RenderIterator.h:
(WebCore::isRendererOfType):
(WebCore::RenderTraversal::firstChild):
(WebCore::RenderTraversal::lastChild):
(WebCore::RenderTraversal::nextSibling):
(WebCore::RenderTraversal::previousSibling):
(WebCore::RenderTraversal::findAncestorOfType):
* rendering/RenderLayerModelObject.h:
* rendering/RenderLineBreak.h:
* rendering/RenderListBox.h:
* rendering/RenderListItem.h:
* rendering/RenderListMarker.h:
* rendering/RenderMedia.h:
* rendering/RenderMenuList.h:
* rendering/RenderMeter.h:
* rendering/RenderMultiColumnFlowThread.h:
* rendering/RenderMultiColumnSet.h:
* rendering/RenderMultiColumnSpannerPlaceholder.h:
* rendering/RenderNamedFlowFragment.h:
* rendering/RenderNamedFlowThread.h:
* rendering/RenderObject.h:
(WebCore::RenderObject>): Deleted.
* rendering/RenderProgress.h:
* rendering/RenderQuote.h:
* rendering/RenderRegion.h:
* rendering/RenderReplaced.h:
* rendering/RenderRubyRun.h:
* rendering/RenderScrollbarPart.h:
* rendering/RenderSearchField.h:
* rendering/RenderSlider.h:
* rendering/RenderSnapshottedPlugIn.h:
* rendering/RenderTable.h:
* rendering/RenderTableCaption.h:
* rendering/RenderTableCell.h:
* rendering/RenderTableCol.h:
* rendering/RenderTableRow.h:
* rendering/RenderTableSection.h:
* rendering/RenderText.h:
* rendering/RenderTextControl.h:
* rendering/RenderTextControlMultiLine.h:
* rendering/RenderTextControlSingleLine.h:
* rendering/RenderTextFragment.h:
* rendering/RenderVideo.h:
* rendering/RenderView.h:
* rendering/RenderWidget.h:
* rendering/mathml/RenderMathMLBlock.h:
* rendering/mathml/RenderMathMLFenced.cpp:
(WebCore::RenderMathMLFenced::updateFromElement):
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::unembellishedOperator):
* rendering/mathml/RenderMathMLFraction.h:
* rendering/mathml/RenderMathMLOperator.h:
* rendering/mathml/RenderMathMLRadicalOperator.h:
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::baseWrapper):
(WebCore::RenderMathMLRoot::radicalWrapper):
(WebCore::RenderMathMLRoot::indexWrapper):
(WebCore::RenderMathMLRoot::radicalOperator):
(WebCore::RenderMathMLRootWrapper::removeChild):
* rendering/mathml/RenderMathMLRoot.h:
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::updateOperatorProperties):
(WebCore::RenderMathMLRow::layout):
* rendering/mathml/RenderMathMLRow.h:
* rendering/mathml/RenderMathMLScripts.cpp:
(WebCore::RenderMathMLScripts::addChildInternal):
(WebCore::RenderMathMLScripts::removeChildInternal):
(WebCore::RenderMathMLScripts::unembellishedOperator):
(WebCore::RenderMathMLScripts::layout):
(WebCore::RenderMathMLScriptsWrapper::addChildInternal):
(WebCore::RenderMathMLScriptsWrapper::addChild):
(WebCore::RenderMathMLScriptsWrapper::removeChildInternal):
(WebCore::RenderMathMLScriptsWrapper::removeChild):
* rendering/mathml/RenderMathMLScripts.h:
* rendering/mathml/RenderMathMLSpace.h:
* rendering/mathml/RenderMathMLSquareRoot.h:
* rendering/mathml/RenderMathMLToken.h:
* rendering/mathml/RenderMathMLUnderOver.cpp:
(WebCore::RenderMathMLUnderOver::unembellishedOperator):
* rendering/svg/RenderSVGContainer.h:
* rendering/svg/RenderSVGGradientStop.h:
* rendering/svg/RenderSVGImage.h:
* rendering/svg/RenderSVGInlineText.h:
* rendering/svg/RenderSVGModelObject.h:
* rendering/svg/RenderSVGPath.h:
* rendering/svg/RenderSVGResourceContainer.h:
* rendering/svg/RenderSVGResourceFilter.h:
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGShape.h:
* rendering/svg/RenderSVGText.h:
* rendering/svg/RenderSVGTextPath.h:
* rendering/svg/RenderSVGViewportContainer.h:

Source/WTF:

Handle correctly calling TypeCastTraits<ExpectedType, ArgType>::isOfType(ArgType&)
with ExpectedType being a base class of ArgType (or the same as ArgType). The
previous template specialization was only meant to support the case where
ExpectedType is the same as ArgType but even that wasn't working as the compiler
would complain about ambiguous partial specializations. Since this is needed by
RenderTraversal functions, this patch adds an extra isBaseType template parameter
to TypeCastTraits to resolve the ambiguity and relies on std::is_base_of for the
detection.

* wtf/TypeCasts.h:


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