[iOS] Simplify test fallback paths for iOS Simulator testing
https://bugs.webkit.org/show_bug.cgi?id=137830

Reviewed by Zalan Bujtas.

Make the fallback paths be:
    ios-simulator -> generic
    ios-simulator-wk2->ios-simulator -> generic

so don't include mac in the fallback path. Also remove the
version handling for simplicity.

* Scripts/webkitpy/port/ios.py:
(IOSSimulatorPort):
(IOSSimulatorPort.default_baseline_search_path):

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

Reviewed by Andreas Kling.

Use is<>() / downcast<>() for StyleImage and clean up the surrouding
code.

No new tests, no behavior change.

* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::detachPendingImage):
(WebCore::CSSCursorImageValue::cachedImage):
(WebCore::CSSCursorImageValue::cachedImageURL):
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::detachPendingImage):
(WebCore::CSSImageSetValue::~CSSImageSetValue):
(WebCore::CSSImageSetValue::cachedImageSet):
(WebCore::CSSImageSetValue::hasFailedOrCanceledSubresources):
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::detachPendingImage):
(WebCore::CSSImageValue::cachedImage):
(WebCore::CSSImageValue::hasFailedOrCanceledSubresources):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::loadPendingShapeImage):
(WebCore::StyleResolver::loadPendingImages):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::retrieveResourcesForProperties):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
* rendering/style/StyleCachedImage.h:
* rendering/style/StyleCachedImageSet.h:
* rendering/style/StyleGeneratedImage.h:
* rendering/style/StyleImage.h:
* rendering/style/StylePendingImage.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174836 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the build with the public SDK.

* WebCoreSupport/WebSelectionServiceController.mm:
We should transition all this SPI to real SPI headers as soon as possible.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174837 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make a better use of the available registers when compiling nested selector lists
https://bugs.webkit.org/show_bug.cgi?id=137802

Reviewed by Andreas Kling.

Source/WebCore:

Previously, when compiling a nested selector list, the compiler would start by pushing all
the allocated registers to the stack to free them for the compiled selector list.
While neat to ensure register allocation is correct, this is very inefficient.

This patch brings the first step for reducing the overhead. Instead of pushing everything
to the stack, we just push as many registers as we need for compiling the selector list.

In most cases, we have so many registers that we don't even need to push anything to the stack.

Test: fast/selectors/nth-child-of-register-requirement.html

* cssjit/SelectorCompiler.cpp:
Add an explicit type for SelectorList to keep information aggregated from all
SelectorFragmentList inside it.

SelectorFragmentList is also extended to include its register and stack requirements.
This information is then used to create a SelectorList and to compile the SelectorFragmentList.

(WebCore::SelectorCompiler::hasAnyCombinators):
We only change the elementAddressRegister when moving over combinators. This is used to detect
if a selector list clobber the elementAddressRegister or leave it untouched.

(WebCore::SelectorCompiler::computeBacktrackingMemoryRequirements):
(WebCore::SelectorCompiler::computeBacktrackingInformation):
Instead of returning a BacktrackingMemoryRequirements, update the SelectorFragmentList and SelectorList directly.

(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesSelectorList):
This is where the fun happen.
First step is keep the input untouched. For now it is simply pushed on the stack. This can be improved later.

Then we find how many allocated registers we need to save to compile the input selector list. We push those registers
to the stack and give them back to the register allocator.

With enough registers we can now compile the nested selector list. The code has changed a bit for efficiency. Instead
of creating a shortcut for success case, the code now exit on error and proceed on success. This is the general pattern
of SelectorCompiler and it is quite a bit more efficient in the common cases.

Finally, we reallocate the registers and get their values back from the stack. The "tail" is duplicated but that's fine
because in the vast majority of cases it is 1 or 2 pop.

(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
* cssjit/StackAllocator.h:
(WebCore::StackAllocator::push):

LayoutTests:

The register pressure cases are already well covered by fast/selectors/nth-child-of-boundaries-*.
The new test covers the maximum register pressure inside :nth-child(of) and having the selector with
max pressure inside a selector list instead of being alone/first.

* fast/selectors/nth-child-of-register-requirement-expected.txt: Added.
* fast/selectors/nth-child-of-register-requirement.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174838 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Get rid of wrapperContext() in DOM bindings.
<https://webkit.org/b/137834>

Reviewed by Chris Dumez.

The "wrapper context" is always the DOMWrapperWorld, and since we're passing that around
already, we don't need a separate mechanism to get at the context.

The context is extra data stored in the DOM object's JSC::Weak (the wrapper GC object.)

* bindings/js/JSDOMBinding.h:
(WebCore::setInlineCachedWrapper):
(WebCore::cacheWrapper):
(WebCore::wrapperContext): Deleted.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):

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

Reviewed by Andreas Kling.

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

Source/WebCore:

No new tests, no behavior change.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
(WebCore::AccessibilityRenderObject::accessibilityHitTest):
(WebCore::AccessibilityRenderObject::getScrollableAreaIfScrollable):
(WebCore::AccessibilityRenderObject::scrollTo):
* bindings/objc/DOMHTML.mm:
(-[DOMHTMLElement scrollYOffset]):
(-[DOMHTMLElement setScrollXOffset:scrollYOffset:adjustForIOSCaret:]):
* bindings/objc/DOMUIKitExtensions.mm:
(-[DOMNode borderRadii]):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::sizingBox):
(WebCore::computedTransform):
(WebCore::zoomAdjustedPaddingOrMarginPixelValue):
(WebCore::ComputedStyleExtractor::propertyValue):
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::getLowerRightCorner):
* dom/Document.cpp:
(WebCore::Document::webkitWillEnterFullScreenForElement):
* dom/Element.cpp:
(WebCore::Element::scrollByUnits):
* dom/Node.cpp:
(WebCore::Node::defaultEventHandler):
* dom/Position.cpp:
(WebCore::endsOfNodeAreVisuallyDistinctPositions):
* editing/DeleteButtonController.cpp:
(WebCore::isDeletableElement):
* editing/EditorCommand.cpp:
(WebCore::verticalScrollDistance):
* editing/FrameSelection.cpp:
(WebCore::CaretBase::paintCaret):
* editing/TextIterator.cpp:
(WebCore::fullyClipsContents):
(WebCore::shouldEmitExtraNewlineForNode):
* editing/htmlediting.cpp:
(WebCore::absoluteBoundsForLocalCaretRect):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::isFocusable):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::checkSizeChangeForSnapshotting):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::setPositionFromPoint):
* inspector/InspectorOverlay.cpp:
(WebCore::buildObjectForElementInfo):
* page/AutoscrollController.cpp:
(WebCore::AutoscrollController::updateAutoscrollRenderer):
* page/EventHandler.cpp:
(WebCore::EventHandler::startPanScrolling):
* page/FrameView.cpp:
(WebCore::FrameView::embeddedContentBox):
* page/GestureTapHighlighter.cpp:
* page/SpatialNavigation.cpp:
(WebCore::isScrollableNode):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
* platform/efl/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::baselinePosition):
* plugins/PluginView.cpp:
(WebCore::PluginView::invalidateWindowlessPluginRect):
* rendering/InlineBox.cpp:
(WebCore::InlineBox::logicalHeight):
(WebCore::InlineBox::adjustPosition):
* rendering/InlineElementBox.cpp:
(WebCore::InlineElementBox::deleteLine):
(WebCore::InlineElementBox::extractLine):
(WebCore::InlineElementBox::attachLine):
(WebCore::InlineElementBox::paint):
(WebCore::InlineElementBox::nodeAtPoint):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::addToLine):
(WebCore::InlineFlowBox::addReplacedChildOverflow):
* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::simplifiedNormalFlowLayout):
(WebCore::RenderBlock::markFixedPositionObjectForLayoutIfNeeded):
(WebCore::RenderBlock::clearPercentHeightDescendantsFrom):
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
(WebCore::RenderBlock::addFocusRingRects):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
(WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::computeInlineDirectionPositionsForLine):
(WebCore::RenderBlockFlow::layoutLineBoxes):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::findAutoscrollable):
(WebCore::computeBlockStaticDistance):
(WebCore::RenderBox::positionForPoint):
(WebCore::RenderBox::layoutOverflowRectForPropagation):
* rendering/RenderBox.h:
(WebCore::RenderBox::previousSiblingBox):
(WebCore::RenderBox::nextSiblingBox):
(WebCore::RenderBox::parentBox):
(WebCore::RenderBox::firstChildBox):
(WebCore::RenderBox::lastChildBox):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent):
(WebCore::RenderBoxModelObject::computeStickyPositionConstraints):
(WebCore::RenderBoxModelObject::constrainingRectForStickyPosition):
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::removeChildInternal):
(WebCore::RenderElement::styleWillChange):
(WebCore::RenderElement::repaintAfterLayoutIfNeeded):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::layout):
* rendering/RenderFieldset.cpp:
(WebCore::RenderFieldset::findLegend):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::adjustedPositionRelativeToOffsetParent):
(WebCore::RenderFlowThread::currentActiveRenderBox):
* rendering/RenderFlowThread.h:
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::unwrapRenderer):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::layoutShadowControls):
(WebCore::RenderImage::computeIntrinsicRatioInformation):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::absoluteRects):
(WebCore::RenderInline::addFocusRingRects):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPosition):
(WebCore::RenderLayer::perspectiveTransform):
(WebCore::RenderLayer::perspectiveOrigin):
(WebCore::parentLayerCrossFrame):
(WebCore::RenderLayer::enclosingScrollableLayer):
(WebCore::RenderLayer::resize):
(WebCore::RenderLayer::scrollsOverflow):
(WebCore::computeReferenceBox):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateTransform):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::resetContentsRect):
(WebCore::RenderLayerBacking::positionOverflowControlsLayers):
(WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage):
(WebCore::RenderLayerBacking::contentsBox):
(WebCore::RenderLayerBacking::backgroundBoxForPainting):
(WebCore::RenderLayerBacking::startAnimation):
(WebCore::RenderLayerBacking::startTransition):
* rendering/RenderLineBoxList.cpp:
(WebCore::RenderLineBoxList::rangeIntersectsRect):
* rendering/RenderMediaControlElements.cpp:
(WebCore::RenderMediaVolumeSliderContainer::layout):
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::firstColumnSetOrSpanner):
(WebCore::RenderMultiColumnFlowThread::nextColumnSetOrSpannerSiblingOf):
(WebCore::RenderMultiColumnFlowThread::previousColumnSetOrSpannerSiblingOf):
(WebCore::RenderMultiColumnFlowThread::resolveMovedChild):
(WebCore::isValidColumnSpanner):
(WebCore::RenderMultiColumnFlowThread::handleSpannerRemoval):
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::getRanges):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::computeRectForRepaint):
(WebCore::RenderObject::showRegionsInformation):
(WebCore::RenderObject::showRenderObject):
(WebCore::RenderObject::mapLocalToContainer):
(WebCore::RenderObject::pushMappingToContainer):
(WebCore::RenderObject::mapAbsoluteToLocalPoint):
(WebCore::RenderObject::addAnnotatedRegions):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::nodeAtPoint):
* rendering/RenderTextControlMultiLine.cpp:
(WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::baselinePosition):
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::baselinePosition):
(WebCore::centerRectVerticallyInParentInputElement):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::baselinePosition):
* rendering/RenderThemeSafari.cpp:
(WebCore::RenderThemeSafari::baselinePosition):
* rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::paintSearchFieldCancelButton):
(WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
(WebCore::RenderThemeWin::paintSearchFieldResultsButton):
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):
(WebCore::externalRepresentation):
* rendering/RenderView.cpp:
(WebCore::RenderView::paintBoxDecorations):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::setLineBreakInfo):
* rendering/line/BreakingContextInlineHeaders.h:
(WebCore::BreakingContext::handleOutOfFlowPositioned):
(WebCore::BreakingContext::handleFloat):
(WebCore::BreakingContext::handleReplaced):
* rendering/line/LineBreaker.cpp:
(WebCore::LineBreaker::skipTrailingWhitespace):
(WebCore::LineBreaker::skipLeadingWhitespace):
* rendering/mathml/RenderMathMLUnderOver.cpp:
(WebCore::RenderMathMLUnderOver::layout):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::embeddedContentBox):

Source/WebKit/mac:

* WebCoreSupport/WebContextMenuClient.mm:
(WebContextMenuClient::clientFloatRectForNode):
* WebView/WebFrame.mm:
(-[WebFrame renderedSizeOfNode:constrainedToWidth:]):

Source/WebKit/win:

* WebView.cpp:
(WebView::gestureNotify):

Source/WebKit2:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::determinePrimarySnapshottedPlugIn):
(WebKit::WebPage::plugInIsPrimarySize):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::sendTapHighlightForNodeIfNecessary):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174840 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix for 32-bit Yosemite

* WebCoreSupport/WebContextMenuClient.mm:
(WebContextMenuClient::contextMenuForEvent):
Avoid using NSItemProvider in 32-bit, because it doesn't exist.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174841 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix after r174838.

Use StackAllocator::addressOf() instead of the old way of grabbing at a stack reference.

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesSelectorList):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174842 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Re-arrange parentheses for compilation purposes.

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatchesSelectorList):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174843 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix typo: should be ios-simulator-wk2, not ios-simulator_wk2.

* Scripts/webkitpy/port/ios.py:
(IOSSimulatorPort.default_baseline_search_path):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174844 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove run-inspector-perf-tests.py there is no PerformanceTests/inspector anymore
https://bugs.webkit.org/show_bug.cgi?id=137835

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-10-17
Reviewed by Andreas Kling.

* Scripts/run-inspector-perf-tests.py: Removed.
This script is stale, as PerformanceTests/inspector no longer exists.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174845 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Speculative fix for a crash under RenderLayerCompositor::updateScrollCoordinatedLayer()
https://bugs.webkit.org/show_bug.cgi?id=137837
rdar://problem/18545452

Reviewed by Tim Horton.

Crash logs suggest that an iframe's RenderView's RenderLayer's backing can be null
in a call to updateScrollCoordinatedLayer(), so add an assertion (to help find a reproducible case)
and a null check.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::attachScrollingNode):


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