2014-12-18 Babak Shafiei Merge r177566. 2014-12-18 Jeremy Jones dispatch to main thread before accessing playerController() in WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse https://bugs.webkit.org/show_bug.cgi?id=139809 Reviewed by Dan Bernstein. This prevents a race in playerController(). * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: (WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse): 2014-12-17 Babak Shafiei Merge build fix for r177375. 2014-12-16 Jer Noble Unreviewed build fix after r177375; explicitly cast to NSUInteger. * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: (WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions): (WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions): 2014-12-17 Babak Shafiei Merge patch for r177375. 2014-12-16 Jer Noble [iOS] Crash in WebKit::WebPageProxy::dispatchViewStateChange() tapping a link from another app while playing a video https://bugs.webkit.org/show_bug.cgi?id=139550 Reviewed by Anders Carlsson. The existing "dispatch to WebThread, then release" model is insufficient and still can result in RefPtr race conditions between the main thread and the web thread. Make WebVideoFullscreenInterfaceAVKit a thread-safe ref-counted class, which eliminates the necessity of disptaching back to the web thread before releasing. * platform/ios/WebVideoFullscreenInterfaceAVKit.h: * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: (WebVideoFullscreenInterfaceAVKit::setDuration): Use a strongThis model. (WebVideoFullscreenInterfaceAVKit::setCurrentTime): Ditto. (WebVideoFullscreenInterfaceAVKit::setRate): Ditto. (WebVideoFullscreenInterfaceAVKit::setVideoDimensions): Ditto. (WebVideoFullscreenInterfaceAVKit::setSeekableRanges): Ditto. (mediaSelectionOptions): Return a RetainPtr object. (WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions): Use a strongThis model. (WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions): Ditto. (WebVideoFullscreenInterfaceAVKit::setExternalPlayback): Ditto. (WebVideoFullscreenInterfaceAVKit::setupFullscreen): Ditto. (WebVideoFullscreenInterfaceAVKit::enterFullscreen): Ditto. (WebVideoFullscreenInterfaceAVKit::exitFullscreen): Ditto. (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen): Ditto. (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): Added utility function. Lets us use the implied this pointer rather than an explicit strongThis. (WebVideoFullscreenInterfaceAVKit::enterFullscreenOptimized): Ditto. (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard): Ditto. (WebVideoFullscreenInterfaceAVKit::exitFullscreenInternal): Ditto. (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal): Ditto. (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): Use a strongThis model. 2014-12-10 Babak Shafiei Merge r176803. 2014-12-04 Oliver Hunt Serialization of MapData object provides unsafe access to internal types https://bugs.webkit.org/show_bug.cgi?id=138653 Reviewed by Geoffrey Garen. We now keep the value portion of the key/value pair in MapData as a separate stack. This allows us to maintain the spec semantic of "atomic" serialisation of the key/value pair without retaining the use of a potentially invalid iterator. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::serialize): 2014-12-10 Babak Shafiei Merge r175974. 2014-11-11 David Kilzer Protect Document in ProcessingInstruction::setXSLStyleSheet() Reviewed by Andreas Kling. The patch is inspired by the following Blink revision by : * dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::setXSLStyleSheet): 2014-12-10 Babak Shafiei Merge r175347. 2014-10-29 Alexey Proskuryakov Notify Settings object when its Page object goes away. https://bugs.webkit.org/show_bug.cgi?id=138183 rdar://problem/18786900 Reviewed by Andreas Kling. I could not make a test for this issue. * page/Page.cpp: (WebCore::Page::~Page): * page/Settings.cpp: (WebCore::setImageLoadingSettings): (WebCore::Settings::Settings): (WebCore::Settings::setTextAutosizingEnabled): (WebCore::Settings::setTextAutosizingWindowSizeOverride): (WebCore::Settings::setTextAutosizingFontScaleFactor): (WebCore::Settings::setMediaTypeOverride): (WebCore::Settings::setScriptEnabled): (WebCore::Settings::setUserStyleSheetLocation): (WebCore::Settings::setMinDOMTimerInterval): (WebCore::Settings::minDOMTimerInterval): (WebCore::Settings::domTimerAlignmentInterval): (WebCore::Settings::setUsesPageCache): (WebCore::Settings::setScreenFontSubstitutionEnabled): (WebCore::Settings::setFontRenderingMode): (WebCore::Settings::setDNSPrefetchingEnabled): (WebCore::Settings::setStorageBlockingPolicy): (WebCore::Settings::setBackgroundShouldExtendBeyondPage): (WebCore::Settings::setScrollingPerformanceLoggingEnabled): (WebCore::Settings::setHiddenPageDOMTimerThrottlingEnabled): (WebCore::Settings::setHiddenPageCSSAnimationSuspensionEnabled): (WebCore::Settings::setFontFallbackPrefersPictographs): * page/Settings.h: (WebCore::Settings::pageDestroyed): 2014-12-10 Babak Shafiei Merge r175345. 2014-10-29 Zalan Bujtas Remove invalid float from RootInlineBox. https://bugs.webkit.org/show_bug.cgi?id=137707 Reviewed by Antti Koivisto. In certain cases, floating boxes get attached to the last (root) inline box. When this particular floating box gets destroyed, it also needs to be detached from the last inline box. 1. Introduce RootInlineBox::removeFloat() (vs. RootInlineBox::appendFloat()) 2. Ensure that it is called when the floating box is being destroyed. Test: fast/inline/crash-when-inline-box-has-invalid-float.html * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::removeFloatingObject): (WebCore::RenderBlockFlow::markAllDescendantsWithFloatsForLayout): During style recalc, while tearing down the render tree, we can get to a state where a block element has both inline and block children. It happens when the style change on an element makes sibling anonymous block wrappers detached. In that case the markAllDescendantsWithFloatsForLayout() call does not get propagated down on the block child elements as we return early at the childrenInline() check. * rendering/RootInlineBox.h: (WebCore::RootInlineBox::removeFloat): 2014-12-10 Babak Shafiei Merge r175197. 2014-10-24 Said Abou-Hallawa Clamp wordSpacing percentage value. https://bugs.webkit.org/show_bug.cgi?id=129350. Reviewed by Zalan Bujtas. When the CSS wordSpacing property is percentage, its value has to be within the pre-defined min/max values for the CSS length type. This is done the same way the wordSpacing of type is handled. Tests: css3/infinite-word-spacing.html. Move the definitions of minValueForCssLength and maxValueForCssLength from the .cpp file to the .h file. * css/CSSPrimitiveValue.cpp: * css/CSSPrimitiveValue.h: Clamp the wordSpacing value to minValueForCssLength and maxValueForCssLength when its type is percentage. * css/DeprecatedStyleBuilder.cpp: (WebCore::ApplyPropertyWordSpacing::applyValue): 2014-12-10 Babak Shafiei Merge r176735. 2014-12-03 Dana Burkart Fix merge-related build failure. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::blockSelectionGaps): 2014-12-10 Babak Shafiei Merge r176295. 2014-11-18 David Hyatt REGRESSION (r167210): Invalid cast in WebCore::RenderBlock::blockSelectionGaps https://bugs.webkit.org/show_bug.cgi?id=137590 Reviewed by Dean Jackson. Added fast/block/selection-block-gaps-crash.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::blockSelectionGaps): Check that we really are a RenderBlock before recurring. 2014-12-10 Babak Shafiei Merge r175074. 2014-10-22 Said Abou-Hallawa SVG loaded through html can't request to load any external resources. https://bugs.webkit.org/show_bug.cgi?id=137762. Reviewed by Daniel Bates. SVG images have unique security rules that prevent them from loading any external resources. This patch enforces these rules in CachedResourceLoader::canRequest for all non-data-uri resources. The fix and the tests are ported but modified a little from the chromium fix: http://src.chromium.org/viewvc/blink?view=rev&rev=176084 Test: http/tests/security/svg-image-with-cached-remote-image.html http/tests/security/svg-image-with-css-cross-domain.html For the SVG image, prevent loading any external sub-resource except for data urls. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::canRequest): 2014-12-10 Babak Shafiei Merge r174946. 2014-10-21 Manuel Rego Casasnovas ASSERTION FAILED: !gridWasPopulated() in WebCore::RenderGrid::placeItemsOnGrid https://bugs.webkit.org/show_bug.cgi?id=136939 Reviewed by Darin Adler. In some particular situations computeIntrinsicLogicalWidths() is called in the middle of layoutGridItems(). In these cases we do not need to populate the grid again, so we should avoid calling placeItemsOnGrid(). In addition, we do not need to clean the grid either, as that will be done later by layoutGridItems(). Test: fast/css-grid-layout/grid-was-populated-assert.html * rendering/RenderGrid.cpp: (WebCore::RenderGrid::computeIntrinsicLogicalWidths): Avoid calls to placeItemsOnGrid() and clearGrid() if the grid was already populated. * rendering/RenderGrid.h: Move gridWasPopulated() header out of the debug ifdefs. 2014-12-10 Babak Shafiei Merge r174922. 2014-10-17 Jeffrey Pfau Ensure attached frame count doesn't exceed the maximum allowed frames https://bugs.webkit.org/show_bug.cgi?id=136457 Reviewed by Alexey Proskuryakov. Test: fast/frames/exponential-frames.html * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::isURLAllowed): 2014-12-10 Babak Shafiei Merge r173845. 2014-09-22 David Hyatt Bad cast in isValidColumnSpanner. https://bugs.webkit.org/show_bug.cgi?id=133380. Reviewed by Simon Fraser. Added fast/multicol/multicol-crazy-nesting.html * rendering/RenderMultiColumnFlowThread.cpp: (WebCore::isValidColumnSpanner): The crawl up the chain looking for unsplittable objects should use containing blocks and not be casting to parent boxes. You can have an inline in the parent chain, so this was not the right way to walk up the tree. 2014-12-10 Babak Shafiei Merge r173843. 2014-09-22 David Hyatt ASSERT in RenderMultiColumnSet::requiresBalancing. https://bugs.webkit.org/show_bug.cgi?id=136376. Reviewed by David Kilzer. Added fast/multicol/multicol-selection.html. * rendering/RenderMultiColumnFlowThread.cpp: (WebCore::isValidColumnSpanner): Don't allow an object to become a spanner if it does not have the flow thread as its containing block. Otherwise the flow thread won't get notified of spanner placeholder insertions, and so the spanner ends up orphaned. 2014-12-10 Babak Shafiei Merge r173738. 2014-09-18 Daniel Bates REGRESSION (r168921): SVG elements may be unnecessarily rebuilt https://bugs.webkit.org/show_bug.cgi?id=136373 Reviewed by David Kilzer. Fixes an issue where a SVG element may be unnecessarily rebuilt. In particular, it is unnecessary to rebuild a SVG element that will be removed from the document. Test: svg/custom/remove-subtree-including-use-with-child-textpath-that-references-earlier-path.html * svg/SVGDocumentExtensions.cpp: (WebCore::SVGDocumentExtensions::removeAllElementReferencesForTarget): Modified to remove a SVG element from the list of elements to be rebuilt. 2014-12-10 Babak Shafiei Merge r173424. 2014-09-08 Mihnea Ovidenie [CSSRegions]Incorrect layout for multicol element transformed into region https://bugs.webkit.org/show_bug.cgi?id=136459 Reviewed by David Hyatt. Until we will support the multicolumn region functionality, a multicolumn element that also has flow-from style is not transformed into a region (https://bugs.webkit.org/show_bug.cgi?id=135153). However, when a multicolumn element with flow-from style dynamically loses its multicolumn style while keeping the flow-from style, we have to transform the element into a region by detaching and attaching the associated DOM node, in the same way we are proceeding when an element receives a different flow-from style. Test: fast/regions/multicol/nested-multicol-into-region-dynamic.html * style/StyleResolveTree.cpp: (WebCore::Style::determineChange): 2014-12-09 Babak Shafiei Merge r173061. 2014-08-28 Mihnea Ovidenie [CSSRegions] Incorrect selection clearing on a document without regions https://bugs.webkit.org/show_bug.cgi?id=134901 Reviewed by David Hyatt. When we select all the content of document with named flows but without regions, the start and end points of selection is cached in RenderView. However, since the document has named flows, the selection is split between the subtrees. During the split, it is possible that the cached end-points of the original selection are not included in any of the resulting subtree selection and they are not marked accordingly. In order to process the selection clearing correctly, we have to take the original selection end-points into account. Test: fast/regions/selection/select-all-without-regions.html * rendering/RenderObject.cpp: (WebCore::RenderObject::isSelectionBorder): 2014-12-09 Babak Shafiei Merge r173046. 2014-08-27 Daniel Bates Scrollbar corner can be drawn outside containing frame https://bugs.webkit.org/show_bug.cgi?id=133131 Reviewed by Simon Fraser. Merged from Blink (patch by Levi Weintraub): Fixes an issue where the scroll corner may be painted outside the rectangle of its associated frame by setting a clip rectangle before painting the scroll bar(s) and scroll corner. Test: scrollbars/custom-scrollbars-paint-outside-iframe.html * platform/ScrollView.cpp: (WebCore::ScrollView::paint): 2014-12-09 Babak Shafiei Merge r171849. 2014-07-31 Andrei Bucur [CSS Multicolumn] Clear the lines when switching to multi-column layout https://bugs.webkit.org/show_bug.cgi?id=135127 Reviewed by Alexandru Chiculita. When switching an element to multi-column layout it becomes a container of block children. When this happens the existing line boxes must be deleted in addition to clearing the hasInlineChildren flag. Tests: fast/multicol/inline-container-to-multicol.html fast/multicol/inline-container-to-multicol-float.html fast/multicol/inline-container-to-multicol-positioned.html * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::createMultiColumnFlowThread): 2014-10-27 Babak Shafiei Merge r175158. 2014-10-23 Zalan Bujtas WebContent crash at WebCore::RenderTextControl::textFormControlElement const. https://bugs.webkit.org/show_bug.cgi?id=138035 Reviewed by Antti Koivisto. NULL-check element().renderer() before using it. * html/SearchInputType.cpp: (WebCore::SearchInputType::didSetValueByUserEdit): 2014-10-23 Babak Shafiei Merge r174827. 2014-10-17 Alexey Proskuryakov [iOS] Crash when load is canceled while waiting for the user to type HTTP authentication credentials https://bugs.webkit.org/show_bug.cgi?id=137826 rdar://problem/17329599 Reviewed by Brady Eidson. No new tests, as we don't have a way to simulate details of user interaction with an auth dialog. * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::ResourceHandle::receivedCredential): (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential): (WebCore::ResourceHandle::receivedRequestToPerformDefaultHandling): (WebCore::ResourceHandle::receivedChallengeRejection): Added null checks before passing m_connection for CFNetwork functions, making this match what Mac code does when sending a message to a nil receiver. 2014-10-23 Babak Shafiei Merge r174846. 2014-10-17 Simon Fraser [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): 2014-10-23 Babak Shafiei Merge r174787. 2014-10-16 Alexey Proskuryakov Crashes in ResourceHandleCFURLConnectionDelegateWithOperationQueue due to unimplemented retain/release https://bugs.webkit.org/show_bug.cgi?id=137779 rdar://problem/18679320 Reviewed by Brady Eidson. * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp: (WebCore::ResourceHandleCFURLConnectionDelegate::retain): (WebCore::ResourceHandleCFURLConnectionDelegate::release): (WebCore::ResourceHandleCFURLConnectionDelegate::makeConnectionClient): * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h: Implemented retain/release. They are necessary, as ResourceHandle goes away when it's canceled, and there is noone else to keep the client object alive but CFURLConnection itself. * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp: (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest): (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse): (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData): (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading): (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail): (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse): (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveChallenge): (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData): (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace): (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveDataArray): Added a FIXME about potential improvements that I spotted while invsestigating this. 2014-10-22 Babak Shafiei Merge r173974. 2014-09-25 Jeremy Jones Race in ref pointer for WebVideoFullscreenInterfaceAVKit. https://bugs.webkit.org/show_bug.cgi?id=137123 Reviewed by Eric Carlson. Add WebThreadRun to prevent race with RefPtr of WebVideoFullscreenInterfaceAVKit. * platform/ios/WebVideoFullscreenControllerAVKit.mm: (-[WebVideoFullscreenController didSetupFullscreen]): add WebThreadRun * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: (WebVideoFullscreenInterfaceAVKit::setDuration): ditto (WebVideoFullscreenInterfaceAVKit::setCurrentTime): ditto (WebVideoFullscreenInterfaceAVKit::setRate): ditto (WebVideoFullscreenInterfaceAVKit::setVideoDimensions): ditto (WebVideoFullscreenInterfaceAVKit::setSeekableRanges): ditto (WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions): ditto (WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions): ditto (WebVideoFullscreenInterfaceAVKit::setExternalPlayback): ditto (WebVideoFullscreenInterfaceAVKit::setupFullscreen): ditto (WebVideoFullscreenInterfaceAVKit::enterFullscreen): ditto (WebVideoFullscreenInterfaceAVKit::exitFullscreen): ditto (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen): ditto (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): ditto 2014-10-22 Babak Shafiei Merge r173848. 2014-09-22 Alexey Proskuryakov WebSocket crash when a connection is closed from server side https://bugs.webkit.org/show_bug.cgi?id=137009 rdar://problem/18333977 rdar://problem/12708225 Reviewed by Brady Eidson. I don't think that this can be tested with our test server. * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::WebSocketChannel): Added logging. (WebCore::WebSocketChannel::~WebSocketChannel): Ditto. (WebCore::WebSocketChannel::close): Protect self, because startClosingHandshake can release the last reference. (WebCore::WebSocketChannel::fail): Added an assertion that the channel is always closed after this function. (WebCore::WebSocketChannel::startClosingHandshake): Protect self, and don't change the stack from closed back to closing if after failing to send closing handshake. (WebCore::WebSocketChannel::processOutgoingFrameQueue): Protect self. 2014-10-19 Babak Shafiei Merge r174651. 2014-10-13 Jer Noble [iOS] Stop listening for wireless playback target availability when the default controls are hidden. https://bugs.webkit.org/show_bug.cgi?id=137633 Reviewed by Dean Jackson. In order to minimize the excess bandwidth and power consumption required for actively listening for wireless playback target availablity, unregister for those notifications while the controls are hidden due to playback, or when the element's document is hidden. * Modules/mediacontrols/mediaControlsiOS.js: (ControllerIOS.prototype.createBase): Register for document visiblity change notfications. (ControllerIOS.prototype.setControlsType): Call updateShouldListenForPlaybackTargetAvailabilityEvent() instead of setShouldListenForPlaybackTargetAvailabilityEvent() (ControllerIOS.prototype.hideControls): Ditto. (ControllerIOS.prototype.showControls): Ditto. (ControllerIOS.prototype.updateStatusDisplay): Ditto. (ControllerIOS.prototype.handleVisibilityChange): Ditto. (ControllerIOS.prototype.updateShouldListenForPlaybackTargetAvailabilityEvent): Added. Only listen for target availability when the video has no errors, is not in the initial "big play button" controls state, and when the controls are not hidden. * platform/audio/ios/MediaSessionManagerIOS.mm: (-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]): Explicitly set the discoveryMode to "disabled" rather than waiting for the autoreleasepool to destroy our routing controller. 2014-10-19 Babak Shafiei Merge r174073. 2014-09-29 Eric Carlson [iOS] Optimize media controls AirPlay discovery https://bugs.webkit.org/show_bug.cgi?id=137180 Reviewed by Darin Adler. AirPlay discovery mode uses increases power consumption, so don't enable it when there is no chance an AirPlay target picker will be useful. * Modules/mediacontrols/mediaControlsiOS.js: (ControllerIOS): Initialize isListeningForPlaybackTargetAvailabilityEvent. (ControllerIOS.prototype.addVideoListeners): Don't enable register wireless playback event listeners, it isn't possible to show the target picker until there is an inline controller. (ControllerIOS.prototype.removeVideoListeners): Call setShouldListenForPlaybackTargetAvailabilityEvent. (ControllerIOS.prototype.setControlsType): Add wireless event listers on when not showing the one button controller. (ControllerIOS.prototype.updateStatusDisplay): Unregister wireless event listeners when the media element is in an error state. (ControllerIOS.prototype.setShouldListenForPlaybackTargetAvailabilityEvent): New, add or remove event listeners. 2014-10-03 Babak Shafiei Merge r174277. 2014-10-03 Jer Noble [iOS] Back-to-back fullscreen videos result in incorrectly sized videos https://bugs.webkit.org/show_bug.cgi?id=137380 Reviewed by Eric Carlson. During a normal workflow, a