Commit 395fca7a authored by dbates@webkit.org's avatar dbates@webkit.org

[iOS] Upstream WebCore/rendering changes

https://bugs.webkit.org/show_bug.cgi?id=125239

Reviewed by Simon Fraser.

* WebCore.xcodeproj/project.pbxproj:
* rendering/InlineBox.cpp:
(WebCore::InlineBox::previousOnLineExists): Added.
* rendering/InlineBox.h:
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintCompositionBackground): Modified to query RenderStyle
on iOS for the composition fill color. Added FIXME to make this platform-independent.
(WebCore::InlineTextBox::paintDecoration): Added iOS-specific decoration code.
(WebCore::lineStyleForMarkerType):
(WebCore::InlineTextBox::paintDocumentMarkers): Added iOS-specific code. Also, added
FIXME to make this code platform-independent.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paint): Ditto.
(WebCore::positionForPointRespectingEditingBoundaries): Added iOS-specific code.
* rendering/RenderBlock.h: Changed access control of logical{Left, Right}SelectionOffset()
from private to protected so that these methods can be used from RenderImage::collectSelectionRects().
* rendering/RenderBox.cpp:
(WebCore::RenderBox::borderRadii): Added.
(WebCore::RenderBox::paintBoxDecorations): Added iOS-specific workaround. See <rdar://problem/6209763>
for more details.
(WebCore::RenderBox::computeRectForRepaint): Added iOS-specific code.
(WebCore::customContainingBlockWidth): Added; guarded by PLATFORM(IOS).
(WebCore::customContainingBlockHeight): Added; guarded by PLATFORM(IOS).
(WebCore::customContainingBlockLogicalWidth): Added; guarded by PLATFORM(IOS).
(WebCore::customContainingBlockLogicalHeight): Added; guarded by PLATFORM(IOS).
(WebCore::customContainingBlockAvailableLogicalHeight): Added; guarded by PLATFORM(IOS).
(WebCore::RenderBox::availableLogicalHeightUsing): Added iOS-specific code; calls customContainingBlockAvailableLogicalHeight().
(WebCore::RenderBox::containingBlockLogicalWidthForPositioned): Added iOS-specific code; calls customContainingBlockLogicalWidth().
(WebCore::RenderBox::containingBlockLogicalHeightForPositioned): Added iOS-specific code; calls customContainingBlockLogicalHeight().
(WebCore::RenderBox::layoutOverflowRectForPropagation): Added iOS-specific code.
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::stickyPositionOffset): Use FrameView::customFixedPositionLayoutRect()
instead of FrameView::viewportConstrainedVisibleContentRect().
* rendering/RenderButton.cpp:
(WebCore::RenderButton::layout): Added; iOS-specific. Includes FIXME comment.
See <rdar://problem/7675493> for more details.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange): Added iOS-specific code.
(WebCore::RenderElement::styleDidChange): Modified to only call areCursorsEqual() and
EventHandler::scheduleCursorUpdate() on a non-iOS port.
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::allowsAcceleratedCompositing): Added iOS-specific code.
(WebCore::RenderEmbeddedObject::setPluginUnavailabilityReason): This method has an empty implementation for iOS.
(WebCore::RenderEmbeddedObject::setPluginUnavailabilityReasonWithDescription): Ditto.
* rendering/RenderFileUploadControl.cpp:
(WebCore::nodeHeight):
(WebCore::RenderFileUploadControl::maxFilenameWidth): Added iOS-specific code.
(WebCore::RenderFileUploadControl::paintObject): Ditto.
(WebCore::RenderFileUploadControl::fileTextValue): Ditto.
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::positionFrames): Ditto; Also added FIXME comment as this code may not
be specific to iOS.
* rendering/RenderIFrame.h: Added iOS-specific workaround to RenderObject::renderName(). Added
FIXME comment to determine whether this workaround is still applicable.
* rendering/RenderImage.cpp:
(WebCore::RenderImage::collectSelectionRects): Added; guarded by PLATFORM(IOS).
(WebCore::RenderImage::paintAreaElementFocusRing): This method has an empty implementation for iOS.
* rendering/RenderImage.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::absoluteQuadsForSelection): Added; guarded by PLATFORM(IOS).
* rendering/RenderInline.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer): Added iOS-specific member initialization.
(WebCore::RenderLayer::~RenderLayer): Added iOS-specific code.
(WebCore::RenderLayer::willBeDestroyed): Added; iOS-specific.
(WebCore::RenderLayer::hasAcceleratedTouchScrolling): Ditto.
(WebCore::RenderLayer::handleTouchEvent): Ditto.
(WebCore::RenderLayer::registerAsTouchEventListenerForScrolling): Ditto.
(WebCore::RenderLayer::unregisterAsTouchEventListenerForScrolling): Ditto.
(WebCore::RenderLayer::updateNeedsCompositedScrolling): Added iOS-specific code as we use UIKit
to composite our scroll bars.
(WebCore::RenderLayer::scrollTo): Added iOS-specific code.
(WebCore::RenderLayer::scrollRectToVisible): Ditto.
(WebCore::RenderLayer::styleChanged): Modified to make use of the passed StyleDifference on iOS.
(WebCore::RenderLayer::visibleContentRect): Added; iOS-specific.
(WebCore::RenderLayer::didStartScroll): Ditto.
(WebCore::RenderLayer::didEndScroll): Ditto.
(WebCore::RenderLayer::didUpdateScroll): Ditto.
(WebCore::RenderLayer::invalidateScrollbarRect): Added iOS-specific code.
(WebCore::RenderLayer::invalidateScrollCornerRect): Ditto.
(WebCore::RenderLayer::verticalScrollbarWidth): Ditto.
(WebCore::RenderLayer::horizontalScrollbarHeight): Ditto.
(WebCore::RenderLayer::updateScrollableAreaSet): Ditto.
(WebCore::RenderLayer::updateScrollInfoAfterLayout): Add iOS-specific workaround with FIXME. See
<rdar://problem/15579797> for more details.
(WebCore::RenderLayer::paintOverflowControls): Added iOS-specific code.
(WebCore::RenderLayer::calculateClipRects): Ditto.
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer): Modified to not apply page scale on iOS
as we apply a page scale at a different time in the code.
(WebCore::RenderLayerBacking::layerWillBeDestroyed): Added; guarded by PLATFORM(IOS).
(WebCore::layerOrAncestorIsTransformedOrScrolling): Added iOS-specific variant with FIXME comment.
(WebCore::RenderLayerBacking::shouldClipCompositedBounds): Added iOS-specific code.
(WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration): Ditto.
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): Ditto.
(WebCore::RenderLayerBacking::registerScrollingLayers): Ditto.
(WebCore::RenderLayerBacking::updateScrollingLayers): Ditto.
(WebCore::RenderLayerBacking::containsPaintedContent): Call RenderLayer::hasBoxDecorationsOrBackground()
when building on iOS Simulator.
(WebCore::RenderLayerBacking::parentForSublayers): Added iOS-specific code and FIXME comment.
(WebCore::RenderLayerBacking::paintsIntoWindow): Opt-into coordinated graphics code path.
(WebCore::RenderLayerBacking::setContentsNeedDisplayInRect): Added iOS-specific code.
(WebCore::RenderLayerBacking::paintIntoLayer): Compile-out ASSERT_NOT_REACHED for iOS and added FIXME comment.
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::scheduleLayerFlush): Added iOS-specific code.
(WebCore::RenderLayerCompositor::chromeClient): Added; guarded by PLATFORM(IOS).
(WebCore::RenderLayerCompositor::flushPendingLayerChanges): Added iOS-specific code.
(WebCore::scrollbarHasDisplayNone): Added; iOS-specific.
(WebCore::updateScrollingLayerWithClient): Ditto.
(WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush): Ditto.
(WebCore::RenderLayerCompositor::didFlushChangesForLayer): Added iOS-specific code.
(WebCore::RenderLayerCompositor::didChangeVisibleRect): Ditto.
(WebCore::RenderLayerCompositor::addToOverlapMap): Don't apply page scale factor on iOS. We apply
the page scale factor at a different time in the code. Also, added FIXME comment.
(WebCore::RenderLayerCompositor::computeCompositingRequirements): Added iOS-specific workaround.
See <rdar://problem/8348337> for more details.
(WebCore::RenderLayerCompositor::setIsInWindow): Use non-Mac code path for iOS.
(WebCore::RenderLayerCompositor::allowsIndependentlyCompositedFrames): Added iOS-specific code.
(WebCore::RenderLayerCompositor::requiresCompositingLayer): Ditto.
(WebCore::RenderLayerCompositor::requiresOwnBackingStore): Ditto.
(WebCore::RenderLayerCompositor::reasonsForCompositing): Ditto.
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation): Opt-into calling
AnimationController::isRunningAnimationOnRenderer() on iOS.
(WebCore::RenderLayerCompositor::requiresCompositingForScrolling): Added; guarded by PLATFORM(IOS).
(WebCore::isStickyInAcceleratedScrollingLayerOrViewport): Added iOS-specific code.
(WebCore::isViewportConstrainedFixedOrStickyLayer): Ditto.
(WebCore::RenderLayerCompositor::requiresCompositingForPosition): Use FrameView::customFixedPositionLayoutRect()
instead of FrameView::viewportConstrainedVisibleContentRect().
(WebCore::RenderLayerCompositor::contentsScaleMultiplierForNewTiles): Ditto.
(WebCore::RenderLayerCompositor::ensureRootLayer): Ditto.
(WebCore::RenderLayerCompositor::computeFixedViewportConstraints): Use FrameView::customFixedPositionLayoutRect()
instead of FrameView::viewportConstrainedVisibleContentRect().
(WebCore::RenderLayerCompositor::computeStickyViewportConstraints): Ditto.
(WebCore::RenderLayerCompositor::registerOrUpdateViewportConstrainedLayer): This method has an empty implementation for iOS
as we batch update viewport-constrained layers in the iOS-specific method, RenderLayerCompositor::updateCustomLayersAfterFlush().
(WebCore::RenderLayerCompositor::unregisterViewportConstrainedLayer): Ditto.
(WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers): Added; guarded by PLATFORM(IOS).
(WebCore::RenderLayerCompositor::unregisterAllViewportConstrainedLayers): Ditto.
(WebCore::RenderLayerCompositor::registerAllScrollingLayers): Ditto.
(WebCore::RenderLayerCompositor::unregisterAllScrollingLayers): Ditto.
(WebCore::RenderLayerCompositor::scrollingLayerAddedOrUpdated): Ditto.
(WebCore::RenderLayerCompositor::scrollingLayerRemoved): Ditto.
(WebCore::RenderLayerCompositor::startInitialLayerFlushTimerIfNeeded): Ditto.
* rendering/RenderLayerCompositor.h:
* rendering/RenderLayerFilterInfo.h: Added iOS-specific Clang workaround to ignore
an unused private field.
* rendering/RenderMenuList.cpp:
(WebCore::selectedOptionCount): Added; guarded by PLATFORM(IOS).
(WebCore::RenderMenuList::RenderMenuList): On iOS we don't make use of RenderMenuList::m_popupIsVisible.
(WebCore::RenderMenuList::~RenderMenuList): On iOS we don't make use of RenderMenuList::m_popup.
(WebCore::RenderMenuList::adjustInnerStyle): Add iOS-specific code.
(RenderMenuList::updateFromElement): On iOS we don't make use of RenderMenuList::m_popup.
(RenderMenuList::setTextFromOption): Add iOS-specific code.
(RenderMenuList::showPopup): Define RenderMenuList::showPopup() to ASSERT_NOT_REACHED() on iOS as
we don't make use of RenderMenuList::m_popup.
(RenderMenuList::hidePopup): This method has an empty implementation for iOS as we don't make use
of RenderMenuList::m_popup.
(RenderMenuList::popupDidHide): This method has an empty implementation for iOS as we don't make use
of RenderMenuList::m_popupIsVisible.
* rendering/RenderMenuList.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::columnNumberForOffset): Added; guarded by PLATFORM(IOS). Also, added a FIXME comment to
make this function return an unsigned integer instead of a signed integer.
(WebCore::RenderObject::collectSelectionRects): Added; guarded by PLATFORM(IOS).
(WebCore::RenderObject::destroy): Added iOS-specific code.
(WebCore::RenderObject::innerLineHeight): Added.
(WebCore::RenderObject::willRenderImage): Added iOS-specific code.
* rendering/RenderObject.h: Change the access control of RenderObject::drawLineForBoxSide() from protected to
public so that it can be used from RenderThemeIOS::adjustMenuListButtonStyle().
(WebCore::RenderObject::absoluteQuadsForSelection):
* rendering/RenderScrollbar.h: Change the access control of RenderScrollbar::getScrollbarPseudoStyle() from
private to public so that it can be used from the iOS-specific static function, scrollbarHasDisplayNone,
defined in RenderLayerCompositor.cpp.
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::itemText): Added iOS-specific code.
* rendering/RenderText.cpp:
(WebCore::RenderText::collectSelectionRects): Added; guarded by PLATFORM(IOS).
(WebCore::RenderText::setTextInternal): Added iOS-specific code.
* rendering/RenderText.h:
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::adjustInnerTextStyle): Ditto.
(WebCore::RenderTextControl::canScroll): Added; guarded by PLATFORM(IOS).
(WebCore::RenderTextControl::innerLineHeight): Ditto.
* rendering/RenderTextControl.h:
* rendering/RenderTextControlMultiLine.cpp:
(WebCore::RenderTextControlMultiLine::getAvgCharWidth): Compile-out code when building for iOS.
(WebCore::RenderTextControlMultiLine::createInnerTextStyle): Added iOS-specific code.
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::layout): Ditto.
(WebCore::RenderTextControlSingleLine::getAvgCharWidth): Compile-out code when building for iOS.
(WebCore::RenderTextControlSingleLine::preferredContentLogicalWidth): Ditto.
* rendering/RenderTextLineBoxes.cpp:
(WebCore::lineDirectionPointFitsInBox): Ditto.
(WebCore::RenderTextLineBoxes::positionForPoint): Added iOS-specific code.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paintBorderOnly): Ditto.
(WebCore::RenderTheme::paintDecorations): Modified to call the control-specific paint*Decorations().
* rendering/RenderTheme.h:
(WebCore::RenderTheme::paintCheckboxDecorations): Added.
(WebCore::RenderTheme::paintRadioDecorations): Added.
(WebCore::RenderTheme::paintButtonDecorations): Added.
(WebCore::RenderTheme::paintTextFieldDecorations): Added.
(WebCore::RenderTheme::paintTextAreaDecorations): Added.
(WebCore::RenderTheme::paintMenuListDecorations): Added.
(WebCore::RenderTheme::paintPushButtonDecorations): Added.
(WebCore::RenderTheme::paintSquareButtonDecorations): Added.
(WebCore::RenderTheme::paintFileUploadIconDecorations): Added.
(WebCore::RenderTheme::paintSliderThumbDecorations): Added.
(WebCore::RenderTheme::paintSearchFieldDecorations): Added.
* rendering/RenderThemeIOS.h: Added.
* rendering/RenderThemeIOS.mm: Added.
* rendering/RenderThemeMac.h: Don't compile the contents of this file when building for iOS.
* rendering/RenderThemeMac.mm: Ditto.
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::calculateIntrinsicSize): Compile-out code when building for iOS.
* rendering/RenderView.cpp:
(WebCore::RenderView::availableLogicalHeight): Add iOS-specific workaround. See <rdar://problem/7166808>.
(WebCore::fixedPositionOffset): Added; used in iOS-specific code (e.g. RenderView::mapLocalToContainer()).
(WebCore::RenderView::mapLocalToContainer): Use WebCore::fixedPositionOffset() instead of
FrameView::scrollOffsetForFixedPosition().
(WebCore::RenderView::pushMappingToContainer): Ditto.
(WebCore::RenderView::mapAbsoluteToLocalPoint): Ditto.
(WebCore::RenderView::repaintViewRectangle): Ditto.
(WebCore::RenderView::computeRectForRepaint): Ditto.
(WebCore::isFixedPositionInViewport): Added; used in RenderView::hasCustomFixedPosition().
(WebCore::RenderView::hasCustomFixedPosition): Added; guarded by PLATFORM(IOS).
* rendering/RenderView.h:
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::willBeDestroyed): Added iOS-specific code.
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::ascentAndDescentForBox): Ditto.
* rendering/break_lines.cpp: Only include header <CoreServices/CoreServices.h> when building for Mac.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160236 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7b4eb627
2013-12-06 Daniel Bates <dabates@apple.com>
[iOS] Upstream WebCore/rendering changes
https://bugs.webkit.org/show_bug.cgi?id=125239
Reviewed by Simon Fraser.
* WebCore.xcodeproj/project.pbxproj:
* rendering/InlineBox.cpp:
(WebCore::InlineBox::previousOnLineExists): Added.
* rendering/InlineBox.h:
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintCompositionBackground): Modified to query RenderStyle
on iOS for the composition fill color. Added FIXME to make this platform-independent.
(WebCore::InlineTextBox::paintDecoration): Added iOS-specific decoration code.
(WebCore::lineStyleForMarkerType):
(WebCore::InlineTextBox::paintDocumentMarkers): Added iOS-specific code. Also, added
FIXME to make this code platform-independent.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paint): Ditto.
(WebCore::positionForPointRespectingEditingBoundaries): Added iOS-specific code.
* rendering/RenderBlock.h: Changed access control of logical{Left, Right}SelectionOffset()
from private to protected so that these methods can be used from RenderImage::collectSelectionRects().
* rendering/RenderBox.cpp:
(WebCore::RenderBox::borderRadii): Added.
(WebCore::RenderBox::paintBoxDecorations): Added iOS-specific workaround. See <rdar://problem/6209763>
for more details.
(WebCore::RenderBox::computeRectForRepaint): Added iOS-specific code.
(WebCore::customContainingBlockWidth): Added; guarded by PLATFORM(IOS).
(WebCore::customContainingBlockHeight): Added; guarded by PLATFORM(IOS).
(WebCore::customContainingBlockLogicalWidth): Added; guarded by PLATFORM(IOS).
(WebCore::customContainingBlockLogicalHeight): Added; guarded by PLATFORM(IOS).
(WebCore::customContainingBlockAvailableLogicalHeight): Added; guarded by PLATFORM(IOS).
(WebCore::RenderBox::availableLogicalHeightUsing): Added iOS-specific code; calls customContainingBlockAvailableLogicalHeight().
(WebCore::RenderBox::containingBlockLogicalWidthForPositioned): Added iOS-specific code; calls customContainingBlockLogicalWidth().
(WebCore::RenderBox::containingBlockLogicalHeightForPositioned): Added iOS-specific code; calls customContainingBlockLogicalHeight().
(WebCore::RenderBox::layoutOverflowRectForPropagation): Added iOS-specific code.
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::stickyPositionOffset): Use FrameView::customFixedPositionLayoutRect()
instead of FrameView::viewportConstrainedVisibleContentRect().
* rendering/RenderButton.cpp:
(WebCore::RenderButton::layout): Added; iOS-specific. Includes FIXME comment.
See <rdar://problem/7675493> for more details.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange): Added iOS-specific code.
(WebCore::RenderElement::styleDidChange): Modified to only call areCursorsEqual() and
EventHandler::scheduleCursorUpdate() on a non-iOS port.
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::allowsAcceleratedCompositing): Added iOS-specific code.
(WebCore::RenderEmbeddedObject::setPluginUnavailabilityReason): This method has an empty implementation for iOS.
(WebCore::RenderEmbeddedObject::setPluginUnavailabilityReasonWithDescription): Ditto.
* rendering/RenderFileUploadControl.cpp:
(WebCore::nodeHeight):
(WebCore::RenderFileUploadControl::maxFilenameWidth): Added iOS-specific code.
(WebCore::RenderFileUploadControl::paintObject): Ditto.
(WebCore::RenderFileUploadControl::fileTextValue): Ditto.
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::positionFrames): Ditto; Also added FIXME comment as this code may not
be specific to iOS.
* rendering/RenderIFrame.h: Added iOS-specific workaround to RenderObject::renderName(). Added
FIXME comment to determine whether this workaround is still applicable.
* rendering/RenderImage.cpp:
(WebCore::RenderImage::collectSelectionRects): Added; guarded by PLATFORM(IOS).
(WebCore::RenderImage::paintAreaElementFocusRing): This method has an empty implementation for iOS.
* rendering/RenderImage.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::absoluteQuadsForSelection): Added; guarded by PLATFORM(IOS).
* rendering/RenderInline.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer): Added iOS-specific member initialization.
(WebCore::RenderLayer::~RenderLayer): Added iOS-specific code.
(WebCore::RenderLayer::willBeDestroyed): Added; iOS-specific.
(WebCore::RenderLayer::hasAcceleratedTouchScrolling): Ditto.
(WebCore::RenderLayer::handleTouchEvent): Ditto.
(WebCore::RenderLayer::registerAsTouchEventListenerForScrolling): Ditto.
(WebCore::RenderLayer::unregisterAsTouchEventListenerForScrolling): Ditto.
(WebCore::RenderLayer::updateNeedsCompositedScrolling): Added iOS-specific code as we use UIKit
to composite our scroll bars.
(WebCore::RenderLayer::scrollTo): Added iOS-specific code.
(WebCore::RenderLayer::scrollRectToVisible): Ditto.
(WebCore::RenderLayer::styleChanged): Modified to make use of the passed StyleDifference on iOS.
(WebCore::RenderLayer::visibleContentRect): Added; iOS-specific.
(WebCore::RenderLayer::didStartScroll): Ditto.
(WebCore::RenderLayer::didEndScroll): Ditto.
(WebCore::RenderLayer::didUpdateScroll): Ditto.
(WebCore::RenderLayer::invalidateScrollbarRect): Added iOS-specific code.
(WebCore::RenderLayer::invalidateScrollCornerRect): Ditto.
(WebCore::RenderLayer::verticalScrollbarWidth): Ditto.
(WebCore::RenderLayer::horizontalScrollbarHeight): Ditto.
(WebCore::RenderLayer::updateScrollableAreaSet): Ditto.
(WebCore::RenderLayer::updateScrollInfoAfterLayout): Add iOS-specific workaround with FIXME. See
<rdar://problem/15579797> for more details.
(WebCore::RenderLayer::paintOverflowControls): Added iOS-specific code.
(WebCore::RenderLayer::calculateClipRects): Ditto.
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer): Modified to not apply page scale on iOS
as we apply a page scale at a different time in the code.
(WebCore::RenderLayerBacking::layerWillBeDestroyed): Added; guarded by PLATFORM(IOS).
(WebCore::layerOrAncestorIsTransformedOrScrolling): Added iOS-specific variant with FIXME comment.
(WebCore::RenderLayerBacking::shouldClipCompositedBounds): Added iOS-specific code.
(WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration): Ditto.
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): Ditto.
(WebCore::RenderLayerBacking::registerScrollingLayers): Ditto.
(WebCore::RenderLayerBacking::updateScrollingLayers): Ditto.
(WebCore::RenderLayerBacking::containsPaintedContent): Call RenderLayer::hasBoxDecorationsOrBackground()
when building on iOS Simulator.
(WebCore::RenderLayerBacking::parentForSublayers): Added iOS-specific code and FIXME comment.
(WebCore::RenderLayerBacking::paintsIntoWindow): Opt-into coordinated graphics code path.
(WebCore::RenderLayerBacking::setContentsNeedDisplayInRect): Added iOS-specific code.
(WebCore::RenderLayerBacking::paintIntoLayer): Compile-out ASSERT_NOT_REACHED for iOS and added FIXME comment.
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::scheduleLayerFlush): Added iOS-specific code.
(WebCore::RenderLayerCompositor::chromeClient): Added; guarded by PLATFORM(IOS).
(WebCore::RenderLayerCompositor::flushPendingLayerChanges): Added iOS-specific code.
(WebCore::scrollbarHasDisplayNone): Added; iOS-specific.
(WebCore::updateScrollingLayerWithClient): Ditto.
(WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush): Ditto.
(WebCore::RenderLayerCompositor::didFlushChangesForLayer): Added iOS-specific code.
(WebCore::RenderLayerCompositor::didChangeVisibleRect): Ditto.
(WebCore::RenderLayerCompositor::addToOverlapMap): Don't apply page scale factor on iOS. We apply
the page scale factor at a different time in the code. Also, added FIXME comment.
(WebCore::RenderLayerCompositor::computeCompositingRequirements): Added iOS-specific workaround.
See <rdar://problem/8348337> for more details.
(WebCore::RenderLayerCompositor::setIsInWindow): Use non-Mac code path for iOS.
(WebCore::RenderLayerCompositor::allowsIndependentlyCompositedFrames): Added iOS-specific code.
(WebCore::RenderLayerCompositor::requiresCompositingLayer): Ditto.
(WebCore::RenderLayerCompositor::requiresOwnBackingStore): Ditto.
(WebCore::RenderLayerCompositor::reasonsForCompositing): Ditto.
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation): Opt-into calling
AnimationController::isRunningAnimationOnRenderer() on iOS.
(WebCore::RenderLayerCompositor::requiresCompositingForScrolling): Added; guarded by PLATFORM(IOS).
(WebCore::isStickyInAcceleratedScrollingLayerOrViewport): Added iOS-specific code.
(WebCore::isViewportConstrainedFixedOrStickyLayer): Ditto.
(WebCore::RenderLayerCompositor::requiresCompositingForPosition): Use FrameView::customFixedPositionLayoutRect()
instead of FrameView::viewportConstrainedVisibleContentRect().
(WebCore::RenderLayerCompositor::contentsScaleMultiplierForNewTiles): Ditto.
(WebCore::RenderLayerCompositor::ensureRootLayer): Ditto.
(WebCore::RenderLayerCompositor::computeFixedViewportConstraints): Use FrameView::customFixedPositionLayoutRect()
instead of FrameView::viewportConstrainedVisibleContentRect().
(WebCore::RenderLayerCompositor::computeStickyViewportConstraints): Ditto.
(WebCore::RenderLayerCompositor::registerOrUpdateViewportConstrainedLayer): This method has an empty implementation for iOS
as we batch update viewport-constrained layers in the iOS-specific method, RenderLayerCompositor::updateCustomLayersAfterFlush().
(WebCore::RenderLayerCompositor::unregisterViewportConstrainedLayer): Ditto.
(WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers): Added; guarded by PLATFORM(IOS).
(WebCore::RenderLayerCompositor::unregisterAllViewportConstrainedLayers): Ditto.
(WebCore::RenderLayerCompositor::registerAllScrollingLayers): Ditto.
(WebCore::RenderLayerCompositor::unregisterAllScrollingLayers): Ditto.
(WebCore::RenderLayerCompositor::scrollingLayerAddedOrUpdated): Ditto.
(WebCore::RenderLayerCompositor::scrollingLayerRemoved): Ditto.
(WebCore::RenderLayerCompositor::startInitialLayerFlushTimerIfNeeded): Ditto.
* rendering/RenderLayerCompositor.h:
* rendering/RenderLayerFilterInfo.h: Added iOS-specific Clang workaround to ignore
an unused private field.
* rendering/RenderMenuList.cpp:
(WebCore::selectedOptionCount): Added; guarded by PLATFORM(IOS).
(WebCore::RenderMenuList::RenderMenuList): On iOS we don't make use of RenderMenuList::m_popupIsVisible.
(WebCore::RenderMenuList::~RenderMenuList): On iOS we don't make use of RenderMenuList::m_popup.
(WebCore::RenderMenuList::adjustInnerStyle): Add iOS-specific code.
(RenderMenuList::updateFromElement): On iOS we don't make use of RenderMenuList::m_popup.
(RenderMenuList::setTextFromOption): Add iOS-specific code.
(RenderMenuList::showPopup): Define RenderMenuList::showPopup() to ASSERT_NOT_REACHED() on iOS as
we don't make use of RenderMenuList::m_popup.
(RenderMenuList::hidePopup): This method has an empty implementation for iOS as we don't make use
of RenderMenuList::m_popup.
(RenderMenuList::popupDidHide): This method has an empty implementation for iOS as we don't make use
of RenderMenuList::m_popupIsVisible.
* rendering/RenderMenuList.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::columnNumberForOffset): Added; guarded by PLATFORM(IOS). Also, added a FIXME comment to
make this function return an unsigned integer instead of a signed integer.
(WebCore::RenderObject::collectSelectionRects): Added; guarded by PLATFORM(IOS).
(WebCore::RenderObject::destroy): Added iOS-specific code.
(WebCore::RenderObject::innerLineHeight): Added.
(WebCore::RenderObject::willRenderImage): Added iOS-specific code.
* rendering/RenderObject.h: Change the access control of RenderObject::drawLineForBoxSide() from protected to
public so that it can be used from RenderThemeIOS::adjustMenuListButtonStyle().
(WebCore::RenderObject::absoluteQuadsForSelection):
* rendering/RenderScrollbar.h: Change the access control of RenderScrollbar::getScrollbarPseudoStyle() from
private to public so that it can be used from the iOS-specific static function, scrollbarHasDisplayNone,
defined in RenderLayerCompositor.cpp.
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::itemText): Added iOS-specific code.
* rendering/RenderText.cpp:
(WebCore::RenderText::collectSelectionRects): Added; guarded by PLATFORM(IOS).
(WebCore::RenderText::setTextInternal): Added iOS-specific code.
* rendering/RenderText.h:
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::adjustInnerTextStyle): Ditto.
(WebCore::RenderTextControl::canScroll): Added; guarded by PLATFORM(IOS).
(WebCore::RenderTextControl::innerLineHeight): Ditto.
* rendering/RenderTextControl.h:
* rendering/RenderTextControlMultiLine.cpp:
(WebCore::RenderTextControlMultiLine::getAvgCharWidth): Compile-out code when building for iOS.
(WebCore::RenderTextControlMultiLine::createInnerTextStyle): Added iOS-specific code.
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::layout): Ditto.
(WebCore::RenderTextControlSingleLine::getAvgCharWidth): Compile-out code when building for iOS.
(WebCore::RenderTextControlSingleLine::preferredContentLogicalWidth): Ditto.
* rendering/RenderTextLineBoxes.cpp:
(WebCore::lineDirectionPointFitsInBox): Ditto.
(WebCore::RenderTextLineBoxes::positionForPoint): Added iOS-specific code.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paintBorderOnly): Ditto.
(WebCore::RenderTheme::paintDecorations): Modified to call the control-specific paint*Decorations().
* rendering/RenderTheme.h:
(WebCore::RenderTheme::paintCheckboxDecorations): Added.
(WebCore::RenderTheme::paintRadioDecorations): Added.
(WebCore::RenderTheme::paintButtonDecorations): Added.
(WebCore::RenderTheme::paintTextFieldDecorations): Added.
(WebCore::RenderTheme::paintTextAreaDecorations): Added.
(WebCore::RenderTheme::paintMenuListDecorations): Added.
(WebCore::RenderTheme::paintPushButtonDecorations): Added.
(WebCore::RenderTheme::paintSquareButtonDecorations): Added.
(WebCore::RenderTheme::paintFileUploadIconDecorations): Added.
(WebCore::RenderTheme::paintSliderThumbDecorations): Added.
(WebCore::RenderTheme::paintSearchFieldDecorations): Added.
* rendering/RenderThemeIOS.h: Added.
* rendering/RenderThemeIOS.mm: Added.
* rendering/RenderThemeMac.h: Don't compile the contents of this file when building for iOS.
* rendering/RenderThemeMac.mm: Ditto.
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::calculateIntrinsicSize): Compile-out code when building for iOS.
* rendering/RenderView.cpp:
(WebCore::RenderView::availableLogicalHeight): Add iOS-specific workaround. See <rdar://problem/7166808>.
(WebCore::fixedPositionOffset): Added; used in iOS-specific code (e.g. RenderView::mapLocalToContainer()).
(WebCore::RenderView::mapLocalToContainer): Use WebCore::fixedPositionOffset() instead of
FrameView::scrollOffsetForFixedPosition().
(WebCore::RenderView::pushMappingToContainer): Ditto.
(WebCore::RenderView::mapAbsoluteToLocalPoint): Ditto.
(WebCore::RenderView::repaintViewRectangle): Ditto.
(WebCore::RenderView::computeRectForRepaint): Ditto.
(WebCore::isFixedPositionInViewport): Added; used in RenderView::hasCustomFixedPosition().
(WebCore::RenderView::hasCustomFixedPosition): Added; guarded by PLATFORM(IOS).
* rendering/RenderView.h:
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::willBeDestroyed): Added iOS-specific code.
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::ascentAndDescentForBox): Ditto.
* rendering/break_lines.cpp: Only include header <CoreServices/CoreServices.h> when building for Mac.
2013-12-06 Zoltan Horvath <zoltan@webkit.org>
Clean up the includes of RenderBlock.h
......@@ -5439,6 +5439,8 @@
CE7B2DB51586ABAD0098B3FA /* TextAlternativeWithRange.h in Headers */ = {isa = PBXBuildFile; fileRef = CE7B2DB11586ABAD0098B3FA /* TextAlternativeWithRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
CE7B2DB61586ABAD0098B3FA /* TextAlternativeWithRange.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE7B2DB21586ABAD0098B3FA /* TextAlternativeWithRange.mm */; };
CE95208A1811B475007A5392 /* WebSafeIncrementalSweeperIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = C2C4CB1D161A131200D214DA /* WebSafeIncrementalSweeperIOS.h */; };
FED13D520CEA949700D89466 /* RenderThemeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = FED13D500CEA949700D89466 /* RenderThemeIOS.h */; };
C55C7BA11718AFBA001327E4 /* RenderThemeIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = C55C7BA01718AFBA001327E4 /* RenderThemeIOS.mm */; };
CECADFC6153778FF00E37068 /* DictationAlternative.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CECADFC2153778FF00E37068 /* DictationAlternative.cpp */; };
CECADFC7153778FF00E37068 /* DictationAlternative.h in Headers */ = {isa = PBXBuildFile; fileRef = CECADFC3153778FF00E37068 /* DictationAlternative.h */; settings = {ATTRIBUTES = (Private, ); }; };
CECADFC8153778FF00E37068 /* DictationCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CECADFC4153778FF00E37068 /* DictationCommand.cpp */; };
......@@ -12558,6 +12560,8 @@
CE7B2DB01586ABAD0098B3FA /* AlternativeTextUIController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AlternativeTextUIController.mm; path = mac/AlternativeTextUIController.mm; sourceTree = "<group>"; };
CE7B2DB11586ABAD0098B3FA /* TextAlternativeWithRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextAlternativeWithRange.h; path = mac/TextAlternativeWithRange.h; sourceTree = "<group>"; };
CE7B2DB21586ABAD0098B3FA /* TextAlternativeWithRange.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TextAlternativeWithRange.mm; path = mac/TextAlternativeWithRange.mm; sourceTree = "<group>"; };
FED13D500CEA949700D89466 /* RenderThemeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderThemeIOS.h; sourceTree = "<group>"; };
C55C7BA01718AFBA001327E4 /* RenderThemeIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RenderThemeIOS.mm; sourceTree = "<group>"; };
CECADFC2153778FF00E37068 /* DictationAlternative.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DictationAlternative.cpp; sourceTree = "<group>"; };
CECADFC3153778FF00E37068 /* DictationAlternative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictationAlternative.h; sourceTree = "<group>"; };
CECADFC4153778FF00E37068 /* DictationCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DictationCommand.cpp; sourceTree = "<group>"; };
......@@ -21240,6 +21244,8 @@
86FF885F15DE3B8200BD6B28 /* RenderTextTrackCue.h */,
BCEA484A097D93020094C9E4 /* RenderTheme.cpp */,
BCEA484B097D93020094C9E4 /* RenderTheme.h */,
FED13D500CEA949700D89466 /* RenderThemeIOS.h */,
C55C7BA01718AFBA001327E4 /* RenderThemeIOS.mm */,
BCEA4848097D93020094C9E4 /* RenderThemeMac.h */,
BCEA4849097D93020094C9E4 /* RenderThemeMac.mm */,
93955A4203D72932008635CE /* RenderTreeAsText.cpp */,
......@@ -24361,6 +24367,7 @@
439046DE12DA25E800AF80A2 /* RenderMathMLMath.h in Headers */,
439046E012DA25E800AF80A2 /* RenderMathMLOperator.h in Headers */,
439046E212DA25E800AF80A2 /* RenderMathMLRoot.h in Headers */,
FED13D520CEA949700D89466 /* RenderThemeIOS.h in Headers */,
439046E412DA25E800AF80A2 /* RenderMathMLRow.h in Headers */,
439046E612DA25E800AF80A2 /* RenderMathMLSquareRoot.h in Headers */,
0783228518013ED800999E0C /* MediaStreamAudioSource.h in Headers */,
......@@ -28303,6 +28310,7 @@
976D6C7B122B8A3D001FD1F7 /* WebKitBlobBuilder.cpp in Sources */,
150B923915F08DC400E10986 /* WebKitCSSArrayFunctionValue.cpp in Sources */,
A2E8AE3016A48E1C006BB3AA /* WebKitCSSFilterRule.cpp in Sources */,
C55C7BA11718AFBA001327E4 /* RenderThemeIOS.mm in Sources */,
3106036F14327D2E00ABF4BA /* WebKitCSSFilterValue.cpp in Sources */,
31288E720E3005D6003619AE /* WebKitCSSKeyframeRule.cpp in Sources */,
31288E740E3005D6003619AE /* WebKitCSSKeyframesRule.cpp in Sources */,
......@@ -193,6 +193,15 @@ bool InlineBox::nextOnLineExists() const
return m_bitfields.nextOnLineExists();
}
bool InlineBox::previousOnLineExists() const
{
if (!parent())
return false;
if (prevOnLine())
return true;
return parent()->previousOnLineExists();
}
InlineBox* InlineBox::nextLeafChild() const
{
InlineBox* leaf = 0;
......
......@@ -131,6 +131,7 @@ public:
m_prev = prev;
}
bool nextOnLineExists() const;
bool previousOnLineExists() const;
virtual bool isLeaf() const { return true; }
......
......@@ -716,7 +716,13 @@ void InlineTextBox::paintCompositionBackground(GraphicsContext* context, const F
GraphicsContextStateSaver stateSaver(*context);
#if !PLATFORM(IOS)
// FIXME: Is this color still applicable as of Mavericks? for non-Mac ports? We should
// be able to move this color information to RenderStyle.
Color c = Color(225, 221, 85);
#else
Color c = style.compositionFillColor();
#endif
updateGraphicsContext(*context, TextPaintStyle(c, style.colorSpace())); // Don't draw text at all!
......@@ -1001,7 +1007,23 @@ void InlineTextBox::paintDecoration(GraphicsContext& context, const FloatPoint&
// Use a special function for underlines to get the positioning exactly right.
bool isPrinting = renderer().document().printing();
#if !PLATFORM(IOS)
context.setStrokeThickness(textDecorationThickness);
#else
// On iOS we want to draw crisp decorations. The function drawLineForText takes the context's
// strokeThickness and renders that at device pixel scale (i.e. a strokeThickness of 1 will
// produce a 1 device pixel line, so thinner on retina than non-retina). We will also scale
// our thickness based on the size of the font. Since our default size is 16px we'll use that
// as a scale reference.
float pageScale = 1;
if (Page* page = renderer().frame().page())
pageScale = page->pageScaleFactor();
const float textDecorationBaseFontSize = 16;
float fontSizeScaling = renderer().style().fontSize() / textDecorationBaseFontSize;
float strokeThickness = roundf(textDecorationThickness * fontSizeScaling * pageScale);
context.setStrokeThickness(strokeThickness);
#endif
bool linesAreOpaque = !isPrinting && (!(decoration & TextDecorationUnderline) || underline.alpha() == 255) && (!(decoration & TextDecorationOverline) || overline.alpha() == 255) && (!(decoration & TextDecorationLineThrough) || linethrough.alpha() == 255);
......@@ -1164,6 +1186,11 @@ static GraphicsContext::DocumentMarkerLineStyle lineStyleForMarkerType(DocumentM
return GraphicsContext::DocumentMarkerAutocorrectionReplacementLineStyle;
case DocumentMarker::DictationAlternatives:
return GraphicsContext::DocumentMarkerDictationAlternativesLineStyle;
#if PLATFORM(IOS)
case DocumentMarker::DictationPhraseWithAlternatives:
// FIXME: Rename TextCheckingDictationPhraseWithAlternativesLineStyle and remove the PLATFORM(IOS)-guard.
return GraphicsContext::TextCheckingDictationPhraseWithAlternativesLineStyle;
#endif
default:
ASSERT_NOT_REACHED();
return GraphicsContext::DocumentMarkerSpellingLineStyle;
......@@ -1304,6 +1331,10 @@ void InlineTextBox::paintDocumentMarkers(GraphicsContext* pt, const FloatPoint&
case DocumentMarker::CorrectionIndicator:
case DocumentMarker::Replacement:
case DocumentMarker::DictationAlternatives:
#if PLATFORM(IOS)
// FIXME: Remove the PLATFORM(IOS)-guard.
case DocumentMarker::DictationPhraseWithAlternatives:
#endif
if (background)
continue;
break;
......@@ -1334,6 +1365,12 @@ void InlineTextBox::paintDocumentMarkers(GraphicsContext* pt, const FloatPoint&
case DocumentMarker::Grammar:
paintDocumentMarker(pt, boxOrigin, marker, style, font, true);
break;
#if PLATFORM(IOS)
// FIXME: See <rdar://problem/8933352>. Also, remove the PLATFORM(IOS)-guard.
case DocumentMarker::DictationPhraseWithAlternatives:
paintDocumentMarker(pt, boxOrigin, marker, style, font, true);
break;
#endif
case DocumentMarker::TextMatch:
paintTextMatchMarker(pt, boxOrigin, marker, style, font);
break;
......
......@@ -2210,7 +2210,12 @@ void RenderBlock::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
flipForWritingMode(overflowBox);
overflowBox.inflate(maximalOutlineSize(paintInfo.phase));
overflowBox.moveBy(adjustedPaintOffset);
if (!overflowBox.intersects(paintInfo.rect))
if (!overflowBox.intersects(paintInfo.rect)
#if PLATFORM(IOS)
// FIXME: This may be applicable to non-iOS ports.
&& (!hasLayer() || !layer()->isComposited())
#endif
)
return;
}
......@@ -3559,6 +3564,15 @@ VisiblePosition positionForPointRespectingEditingBoundaries(RenderBlock& parent,
// If we can't find an ancestor to check editability on, or editability is unchanged, we recur like normal
if (isEditingBoundary(ancestor, child))
return child.positionForPoint(pointInChildCoordinates);
#if PLATFORM(IOS)
// On iOS we want to constrain VisiblePositions to the editable region closest to the input position, so
// we will allow descent from non-edtiable to editable content.
// FIXME: This constraining must be done at a higher level once we implement contentEditable. For now, if something
// is editable, the whole document will be.
if (childElement->isContentEditable() && !ancestor->element()->isContentEditable())
return child.positionForPoint(pointInChildCoordinates);
#endif
// Otherwise return before or after the child, depending on if the click was to the logical left or logical right of the child
LayoutUnit childMiddle = parent.logicalWidthForChild(child) / 2;
......
......@@ -437,6 +437,9 @@ protected:
void setDesiredColumnCountAndWidth(int, LayoutUnit);
LayoutUnit logicalLeftSelectionOffset(RenderBlock& rootBlock, LayoutUnit position, const LogicalSelectionOffsetCaches&);
LayoutUnit logicalRightSelectionOffset(RenderBlock& rootBlock, LayoutUnit position, const LogicalSelectionOffsetCaches&);
public:
virtual void computeOverflow(LayoutUnit oldClientAfterEdge, bool recomputeFloats = false);
void clearLayoutOverflow();
......@@ -557,9 +560,7 @@ private:
LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& lastLogicalRight, const LogicalSelectionOffsetCaches&, const PaintInfo*);
LayoutRect blockSelectionGap(RenderBlock& rootBlock, const LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
LayoutUnit lastLogicalTop, LayoutUnit lastLogicalLeft, LayoutUnit lastLogicalRight, LayoutUnit logicalBottom, const LogicalSelectionOffsetCaches&, const PaintInfo*);
LayoutUnit logicalLeftSelectionOffset(RenderBlock& rootBlock, LayoutUnit position, const LogicalSelectionOffsetCaches&);
LayoutUnit logicalRightSelectionOffset(RenderBlock& rootBlock, LayoutUnit position, const LogicalSelectionOffsetCaches&);
// FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow
virtual void clipOutFloatingObjects(RenderBlock&, const PaintInfo*, const LayoutPoint&, const LayoutSize&) { };
friend class LogicalSelectionOffsetCaches;
......
......@@ -62,6 +62,10 @@
#include "RenderLayerCompositor.h"
#endif
#if PLATFORM(IOS)
#include "Settings.h"
#endif
namespace WebCore {
using namespace HTMLNames;
......@@ -596,6 +600,18 @@ LayoutUnit RenderBox::constrainContentBoxLogicalHeightByMinMax(LayoutUnit logica
return std::max(logicalHeight, computeContentLogicalHeight(styleToUse.logicalMinHeight()));
}
RoundedRect::Radii RenderBox::borderRadii() const
{
RenderStyle& style = this->style();
LayoutRect bounds = frameRect();
unsigned borderLeft = style.borderLeftWidth();
unsigned borderTop = style.borderTopWidth();
bounds.moveBy(LayoutPoint(borderLeft, borderTop));
bounds.contract(borderLeft + style.borderRightWidth(), borderTop + style.borderBottomWidth());
return style.getRoundedBorderFor(bounds).radii();
}
IntRect RenderBox::absoluteContentBox() const
{
// This is wrong with transforms and flipped writing modes.
......@@ -1159,6 +1175,14 @@ void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& pai
LayoutRect paintRect = borderBoxRectInRegion(paintInfo.renderRegion);
paintRect.moveBy(paintOffset);
#if PLATFORM(IOS)
// Workaround for <rdar://problem/6209763>. Force the painting bounds of checkboxes and radio controls to be square.
if (style().appearance() == CheckboxPart || style().appearance() == RadioPart) {
int width = std::min(paintRect.width(), paintRect.height());
int height = width;
paintRect = IntRect(paintRect.x(), paintRect.y() + (this->height() - height) / 2, width, height); // Vertically center the checkbox, like on desktop
}
#endif
BackgroundBleedAvoidance bleedAvoidance = determineBackgroundBleedAvoidance(paintInfo.context);
// FIXME: Should eventually give the theme control over whether the box shadow should paint, since controls could have
......@@ -2109,9 +2133,15 @@ void RenderBox::computeRectForRepaint(const RenderLayerModelObject* repaintConta
rect.setLocation(topLeft);
if (o->hasOverflowClip()) {
RenderBox* containerBox = toRenderBox(o);
#if PLATFORM(IOS)
if (!containerBox->layer() || !containerBox->layer()->hasAcceleratedTouchScrolling()) {
#endif
containerBox->applyCachedClipAndScrollOffsetForRepaint(rect);
if (rect.isEmpty())
return;
#if PLATFORM(IOS)
}
#endif
}
if (containerSkipped) {
......@@ -2902,6 +2932,33 @@ LayoutUnit RenderBox::availableLogicalHeight(AvailableLogicalHeightType heightTy
return constrainLogicalHeightByMinMax(availableLogicalHeightUsing(style().logicalHeight(), heightType));
}
#if PLATFORM(IOS)
static inline int customContainingBlockWidth(const RenderView& view, const RenderBox& containingBlockBox)
{
return view.frameView().customFixedPositionLayoutRect().width() - containingBlockBox.borderLeft() - containingBlockBox.borderRight() - containingBlockBox.verticalScrollbarWidth();
}
static inline int customContainingBlockHeight(const RenderView& view, const RenderBox& containingBlockBox)
{
return view.frameView().customFixedPositionLayoutRect().height() - containingBlockBox.borderTop() - containingBlockBox.borderBottom() - containingBlockBox.horizontalScrollbarHeight();
}
static int customContainingBlockLogicalWidth(const RenderStyle& style, const RenderView& view, const RenderBox& containingBlockBox)
{
return style.isHorizontalWritingMode() ? customContainingBlockWidth(view, containingBlockBox) : customContainingBlockHeight(view, containingBlockBox);
}
static int customContainingBlockLogicalHeight(const RenderStyle& style, const RenderView& view, const RenderBox& containingBlockBox)
{
return style.isHorizontalWritingMode() ? customContainingBlockHeight(view, containingBlockBox) : customContainingBlockWidth(view, containingBlockBox);
}
static inline int customContainingBlockAvailableLogicalHeight(const RenderStyle& style, const RenderView& view)
{
return style.isHorizontalWritingMode() ? view.frameView().customFixedPositionLayoutRect().height() : view.frameView().customFixedPositionLayoutRect().width();
}
#endif
LayoutUnit RenderBox::availableLogicalHeightUsing(const Length& h, AvailableLogicalHeightType heightType) const
{
// We need to stop here, since we don't want to increase the height of the table
......@@ -2914,9 +2971,21 @@ LayoutUnit RenderBox::availableLogicalHeightUsing(const Length& h, AvailableLogi
}
if (h.isPercent() && isOutOfFlowPositioned() && !isRenderFlowThread()) {
#if PLATFORM(IOS)
RenderBlock* containingBlock = this->containingBlock();
// If we're fixed, and our container is the RenderView, use the custom fixed position rect for sizing.
if (containingBlock->isRenderView()) {
RenderView& view = toRenderView(*containingBlock);
if (view.hasCustomFixedPosition(*this))
return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(h, customContainingBlockAvailableLogicalHeight(containingBlock->style(), view)));
}
return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(h, containingBlock->availableLogicalHeight(heightType)));
#else
// FIXME: This is wrong if the containingBlock has a perpendicular writing mode.
LayoutUnit availableHeight = containingBlockLogicalHeightForPositioned(containingBlock());
return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(h, availableHeight));
#endif
}
LayoutUnit heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(h);
......@@ -2981,8 +3050,15 @@ LayoutUnit RenderBox::containingBlockLogicalWidthForPositioned(const RenderBoxMo
if (containingBlock->isBox()) {
RenderFlowThread* flowThread = flowThreadContainingBlock();
if (!flowThread)
if (!flowThread) {
#if PLATFORM(IOS)
if (view().hasCustomFixedPosition(*this)) {
const RenderBox& containingBlockBox = toRenderBox(*containingBlock);
return customContainingBlockLogicalWidth(containingBlockBox.style(), &view(), containingBlockBox);
}
#endif
return toRenderBox(containingBlock)->clientLogicalWidth();
}
if (containingBlock->isRenderNamedFlowThread() && style().position() == FixedPosition)
return containingBlock->view().clientLogicalWidth();
......@@ -3038,6 +3114,10 @@ LayoutUnit RenderBox::containingBlockLogicalHeightForPositioned(const RenderBoxM
return containingBlockLogicalWidthForPositioned(containingBlock, 0, false);
if (containingBlock->isBox()) {
#if PLATFORM(IOS)
if (view().hasCustomFixedPosition(*this))
return customContainingBlockLogicalHeight(style(), view(), toRenderBox(*containingBlock));
#endif
const RenderBlock* cb = toRenderBlock(containingBlock);
LayoutUnit result = cb->clientLogicalHeight();
RenderFlowThread* flowThread = flowThreadContainingBlock();
......@@ -4460,7 +4540,11 @@ LayoutRect RenderBox::layoutOverflowRectForPropagation(RenderStyle* parentStyle)
rect.unite(layoutOverflowRect());
bool hasTransform = hasLayer() && layer()->transform();
#if PLATFORM(IOS)
if (isInFlowPositioned() || (hasTransform && document().settings()->shouldTransformsAffectOverflow())) {
#else
if (isInFlowPositioned() || hasTransform) {
#endif
// If we are relatively positioned or if we have a transform, then we have to convert
// this rectangle into physical coordinates, apply relative positioning and transforms
// to it, and then convert it back.
......
......@@ -157,6 +157,8 @@ public:
IntRect pixelSnappedBorderBoxRect() const { return IntRect(IntPoint(), m_frameRect.pixelSnappedSize()); }
virtual IntRect borderBoundingBox() const OVERRIDE FINAL { return pixelSnappedBorderBoxRect(); }
RoundedRect::Radii borderRadii() const;
// The content area of the box (excludes padding - and intrinsic padding for table cells, etc... - and border).
LayoutRect contentBoxRect() const { return LayoutRect(borderLeft() + paddingLeft(), borderTop() + paddingTop(), contentWidth(), contentHeight()); }
// The content box in absolute coords. Ignores transforms.
......
......@@ -432,7 +432,11 @@ LayoutSize RenderBoxModelObject::stickyPositionOffset() const
FloatPoint scrollOffset = FloatPoint() + enclosingClippingLayer->scrollOffset();
constrainingRect.setLocation(scrollOffset);
} else {
#if PLATFORM(IOS)
LayoutRect viewportRect = view().frameView().customFixedPositionLayoutRect();