Use is<>() / downcast<>() for RenderBlock objects
https://bugs.webkit.org/show_bug.cgi?id=137512

Reviewed by Darin Adler.

Source/WebCore:

Use is<>() / downcast<>() for RenderBlock objects and clean up the
surrounding code.

No new tests, no behavior change.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::firstChildConsideringContinuation):
(WebCore::lastChildConsideringContinuation):
(WebCore::AccessibilityRenderObject::firstChild):
(WebCore::startOfContinuations):
(WebCore::endOfContinuations):
(WebCore::childBeforeConsideringContinuations):
(WebCore::AccessibilityRenderObject::previousSibling):
(WebCore::AccessibilityRenderObject::nextSibling):
(WebCore::nextContinuation):
(WebCore::AccessibilityRenderObject::renderParentObject):
(WebCore::AccessibilityRenderObject::anchorElement):
(WebCore::AccessibilityRenderObject::setValue):
* bindings/objc/DOMUIKitExtensions.mm:
(-[DOMNode containsOnlyInlineObjects]):
(-[DOMNode isSelectableBlock]):
(-[DOMHTMLElement structuralComplexityContribution]):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForGridTrackList):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded):
* editing/TextIterator.cpp:
(WebCore::TextIterator::shouldRepresentNodeOffsetZero):
* page/ios/FrameIOS.mm:
(WebCore::Frame::preferredHeight):
* rendering/LogicalSelectionOffsetCaches.h:
(WebCore::containingBlockForFixedPosition):
(WebCore::containingBlockForAbsolutePosition):
(WebCore::containingBlockForObjectInFlow):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::styleWillChange):
(WebCore::RenderBlock::continuationBefore):
(WebCore::RenderBlock::splitBlocks):
(WebCore::RenderBlock::addChildIgnoringContinuation):
(WebCore::canMergeAnonymousBlock):
(WebCore::canMergeContiguousAnonymousBlocks):
(WebCore::RenderBlock::collapseAnonymousBoxChild):
(WebCore::RenderBlock::removeChild):
(WebCore::RenderBlock::blockElementContinuation):
(WebCore::RenderBlock::blockSelectionGaps):
(WebCore::RenderBlock::blockBeforeWithinSelectionRoot):
(WebCore::isChildHitTestCandidate):
(WebCore::RenderBlock::firstLineBlock):
(WebCore::findFirstLetterBlock):
(WebCore::RenderBlock::childBecameNonInline):
(WebCore::RenderBlock::hasMarginBeforeQuirk):
(WebCore::RenderBlock::hasMarginAfterQuirk):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::marginBeforeEstimateForChild):
(WebCore::RenderBlockFlow::estimateLogicalTopPosition):
(WebCore::RenderBlockFlow::adjustBlockChildForPagination):
(WebCore::RenderBlockFlow::positionNewFloats):
(WebCore::RenderBlockFlow::markSiblingsWithFloatsForLayout):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::positionNewFloatOnLine):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):
(WebCore::RenderBox::availableLogicalHeightUsing):
(WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
(WebCore::RenderBox::containingBlockLogicalHeightForPositioned):
(WebCore::computeInlineStaticDistance):
(WebCore::RenderBox::computePositionedLogicalWidth):
(WebCore::RenderBox::computePositionedLogicalHeight):
* rendering/RenderBoxModelObject.cpp:
(WebCore::accumulateInFlowPositionOffsets):
(WebCore::RenderBoxModelObject::moveChildTo):
(WebCore::RenderBoxModelObject::moveChildrenTo):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::propagateStyleToAnonymousChildren):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent):
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::unwrapRenderer):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::inlineElementContinuation):
(WebCore::updateStyleOfAnonymousBlockContinuations):
(WebCore::RenderInline::styleDidChange):
(WebCore::nextContinuation):
(WebCore::RenderInline::splitFlow):
(WebCore::RenderInline::positionForPoint):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateScrollbarsAfterLayout):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderListItem.cpp:
(WebCore::getParentOfFirstLineBox):
(WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
(WebCore::RenderListItem::positionListMarker):
* rendering/RenderNamedFlowFragment.cpp:
(WebCore::RenderNamedFlowFragment::maxPageLogicalHeight):
* rendering/RenderObject.cpp:
(WebCore::includeNonFixedHeight):
(WebCore::RenderObject::checkBlockPositionedObjectsNeedLayout):
(WebCore::RenderObject::containingBlock):
(WebCore::RenderObject::handleDynamicFloatPositionChange):
(WebCore::RenderObject::removeAnonymousWrappersForInlinesIfNecessary):
(WebCore::RenderObject::getTextDecorationColors):
* rendering/RenderRuby.cpp:
(WebCore::rubyBeforeBlock):
(WebCore::rubyAfterBlock):
* rendering/RenderRubyBase.cpp:
(WebCore::RenderRubyBase::moveInlineChildren):
(WebCore::RenderRubyBase::moveBlockChildren):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
* rendering/TextAutosizer.cpp:
(WebCore::TextAutosizer::processSubtree):
(WebCore::TextAutosizer::processContainer):
(WebCore::TextAutosizer::measureDescendantTextWidth):
(WebCore::TextAutosizer::findDeepestBlockContainingAllText):
(WebCore::TextAutosizer::findFirstTextLeafNotInCluster):
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::layout):

Source/WebKit2:

Use is<>() / downcast<>() for RenderBlock objects and clean up the
surrounding code.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::rangeForWebSelectionAtPosition):
(WebKit::WebPage::contractedRangeFromHandle):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174480 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Re-marking fast/hidpi/image-srcset-svg-canvas.html as an expected image failure.

* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174481 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: CSS Pretty Printing fails to wrap long lines of selectors with pseudo classes/elements
https://bugs.webkit.org/show_bug.cgi?id=137413

Reviewed by Timothy Hatcher.

Long line wrapping was breaking as soon as there was a ':' for a psuedo
class or element. Likewise it was counting comment strings as part of
the length of the line even though it would get a newline after it.

* Tools/PrettyPrinting/CodeMirrorFormatters.js:
* Tools/PrettyPrinting/css-tests/basic-expected.css:
(progress, section, summary, time):
* Tools/PrettyPrinting/css-tests/wrapping-expected.css: Added.
(a.tryamacs, a.upgradenows):
(a.tryamacs:hover, a.upgradenows:hover):
* Tools/PrettyPrinting/css-tests/wrapping.css: Added.
(a.browsewebappss,a.businessstores,a.buyiphones,a.buynows,a.buynows-arrow,a.comingsoons,p::before,a.descargarahoras,a.downloadituness,a.downloadnows,a.finds,a.freetrials,a.getstarteds,a.gos,a.howtoapplys,a.howtobuys,a.joinnows,a.learnmores,a.nikebuynows,a.notifymes,a.ordernows,a.preordernows,a.preorders,a.reserves,a.startyoursearchs,a.submits,a.tryamacs,a.upgradenows):
(a.browsewebappss:hover,a.businessstores:hover,a.buyiphones:hover,a.buynows:hover,a.buynows-arrow:hover,a.comingsoons:hover,p::before,a.descargarahoras:hover,a.downloadituness:hover,a.downloadnows:hover,a.finds:hover,a.freetrials:hover,a.getstarteds:hover,a.gos:hover,a.howtoapplys:hover,a.howtobuys:hover,a.joinnows:hover,a.learnmores:hover,a.nikebuynows:hover,a.notifymes:hover,a.ordernows:hover,a.preordernows:hover,a.preorders:hover,a.reserves:hover,a.startyoursearchs:hover,a.submits:hover,a.tryamacs:hover,a.upgradenows:hover):
* Tools/PrettyPrinting/index.html:
* UserInterface/Views/CodeMirrorFormatters.js:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174482 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: CSS Pretty Printing fails to put space between rgb(...) and numbers in minified gradients
https://bugs.webkit.org/show_bug.cgi?id=137414

Reviewed by Timothy Hatcher.

Add whitespace between rgb(...) and a number, possible in gradient
syntax like "linear-gradient(rgb(...)0%,rgb(...)100%)".

* Tools/PrettyPrinting/CodeMirrorFormatters.js:
* Tools/PrettyPrinting/css-tests/gradient-expected.css: Added.
(.dot-nav:nth-child(1n) li a.active):
* Tools/PrettyPrinting/css-tests/gradient.css: Added.
(.dot-nav:nth-child(1n) li a.active):
* Tools/PrettyPrinting/index.html:
* UserInterface/Views/CodeMirrorFormatters.js:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174483 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: CSS Pretty Printing fails to put space between value functions around ending parenthesis
https://bugs.webkit.org/show_bug.cgi?id=137415

Reviewed by Timothy Hatcher.

Add a space after a closing parenthesis if we are still inside a property.
This adds space between space separated function lists such as
-webkit-transform:foo(...)bar(...). Also add a test for keyframe syntax.

* Tools/PrettyPrinting/CodeMirrorFormatters.js:
* Tools/PrettyPrinting/css-tests/keyframes-expected.css: Added.
* Tools/PrettyPrinting/css-tests/keyframes.css: Added.
* Tools/PrettyPrinting/index.html:
* UserInterface/Views/CodeMirrorFormatters.js:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174484 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PopupMenus should indicate if they are using a custom rendering
https://bugs.webkit.org/show_bug.cgi?id=137543
<rdar://problem/18544212>

Reviewed by Beth Dakin.

On Yosemite there is an animation as a popup menu closes. We can't use
this when there is a custom rendering, since the animation doesn't match
the final result. Implement this by hooking into the existing code
for hiding the arrows during animation - a WebKitSystemInterface update
will implement the other side.

* platform/mac/WebCoreSystemInterface.h: Rename parameter to be more clear.
* platform/mac/WebCoreSystemInterface.mm:
* rendering/RenderMenuList.cpp:
(RenderMenuList::menuStyle): We need to check that we are a native-looking
button, not just something with appearance.

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