2015-04-08 Carlos Garcia Campos [GTK] Crash in DOMObjectCache when a wrapped object owned by the cache is unreffed by the user https://bugs.webkit.org/show_bug.cgi?id=143521 Reviewed by Martin Robinson. This is a case we claim to support, but it only works if the object has only one reference. In that case, when the user unrefs it, the weak ref notify callback removes the object from the cache. However, if the object has more than one ref, the cache doesn't know the user unreffed it, and when clearing the cache we try to remove more references than what the object actually has, causing a crash in g_object_unref. * bindings/gobject/DOMObjectCache.cpp: (WebKit::DOMObjectCacheData::clearObject): 2015-02-17 Carlos Garcia Campos Use HashMap::add instead of get/contains + set in DOMObjectCache https://bugs.webkit.org/show_bug.cgi?id=141558 Rubber-stamped by Žan Doberšek. * bindings/gobject/DOMObjectCache.cpp: (WebKit::getOrCreateDOMObjectCacheFrameObserver): (WebKit::DOMObjectCache::put): 2015-03-26 Zalan Bujtas Inline continuation code should not take anonymous containing wrapper granted. https://bugs.webkit.org/show_bug.cgi?id=133312 Reviewed by Dave Hyatt. It's wrong to assume that when RenderInline is part of an inline continuation, its containing block is an anonymous wrapper and its sibling might be a block level renderer. When the inline continuation is no longer needed, for example when the block level renderer that initiated the continuation is detached from the render tree, the inline renderes still continue to form continuation.(however they no longer require anonymous wrappers) Test: fast/inline/crash-when-position-property-is-changed-and-no-longer-in-continuation.html * rendering/RenderInline.cpp: (WebCore::updateStyleOfAnonymousBlockContinuations): (WebCore::RenderInline::styleDidChange): 2015-02-12 Chris Dumez Drop the quirks-mode exception for CSS MIME types https://bugs.webkit.org/show_bug.cgi?id=141501 Reviewed by Alexey Proskuryakov. Drop the quirks-mode exception for CSS MIME types. This matches Firefox's behavior. This patch is based on the following Blink revision: http://src.chromium.org/viewvc/blink?view=revision&revision=189669 Tests: - http/tests/misc/css-accept-any-type.html - http/tests/security/cross-origin-css.html * css/StyleSheetContents.cpp: (WebCore::StyleSheetContents::parseAuthorStyleSheet): * dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::setCSSStyleSheet): * inspector/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::cachedResourceContent): * loader/cache/CachedCSSStyleSheet.cpp: (WebCore::CachedCSSStyleSheet::sheetText): (WebCore::CachedCSSStyleSheet::canUseSheet): * loader/cache/CachedCSSStyleSheet.h: 2015-03-19 Enrica Casucci REGRESSION (r109593): Clicking after last inline element could cause a crash. https://bugs.webkit.org/show_bug.cgi?id=142880 rdar://problem/17222294 Reviewed by Ryosuke Niwa. Test: editing/selection/click-after-last-inline-crash.html * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::closestLeafChildForLogicalLeftPosition): 2015-03-18 Manuel Rego Casasnovas Flex and grid items should be painted as inline-blocks https://bugs.webkit.org/show_bug.cgi?id=142266 Reviewed by Darin Adler. Based on Blink r157004 by . https://src.chromium.org/viewvc/blink?revision=157004&view=revision Both flexbox and grid specs define that the painting order of flex/grid items is the same as inline blocks. See http://dev.w3.org/csswg/css-flexbox/#painting and http://dev.w3.org/csswg/css-grid/#z-order. Extracted inline blocks painting code from InlineElementBox and moved to a helper method that will be reused for flexboxes and grids. Tests: css3/flexbox/flex-item-text-background-not-interleaved.html fast/css-grid-layout/grid-item-text-background-not-interleaved.html * rendering/InlineElementBox.cpp: (WebCore::InlineElementBox::paint): Move code to RenderElement::paintAsInlineBlock(). * rendering/RenderBlock.cpp: (WebCore::RenderBlock::paintChild): Add new argument to paint children as inline blocks. * rendering/RenderBlock.h: Define PaintType enmu and modify paintChild() signature to add the new argument. * rendering/RenderElement.cpp: (WebCore::paintPhase): Paint element in a phase. (WebCore::RenderElement::paintAsInlineBlock): Code extracted from InlineElementBox::paint(). * rendering/RenderElement.h: Add new method signature. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::paintChildren): Call RenderBlock::paintChild() with the new argument. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::paintChildren): Ditto. 2015-03-20 Carlos Garcia Campos [GTK] Crash due to empty drag image during drag-and-drop https://bugs.webkit.org/show_bug.cgi?id=142671 Reviewed by Philippe Normand. Return early from ImageBuffer constructor if an empty size is given. This is a speculative fix for a crash while starting a drag and drop operation, that I haven't been able to reproduce. * platform/graphics/cairo/ImageBufferCairo.cpp: (WebCore::ImageBuffer::ImageBuffer): 2015-03-16 Joanmarie Diggs AX: Crash viewing http://www.last.fm/ https://bugs.webkit.org/show_bug.cgi?id=142309 Reviewed by Chris Fleizach. The crash occurs when a not-yet-rendered object emits a children-changed signal. If an assistive technology is listening, AT-SPI2 will attempt to create and cache the state set for the child being added and the creation of the state set assumes a rendered object. Test: platform/gtk/accessibility/no-notification-for-unrendered-iframe-children.html * accessibility/atk/AXObjectCacheAtk.cpp: (WebCore::AXObjectCache::attachWrapper): 2015-03-16 Brady Eidson Addressing additional review feedback after http://trac.webkit.org/changeset/181565 https://bugs.webkit.org/show_bug.cgi?id=142604 Reviewed by Darin Adler. * loader/icon/IconController.cpp: (WebCore::IconController::startLoader): Null check page() 2015-03-16 Brady Eidson URLs visited during private browsing show up in WebpageIcons.db rdar://problem/11254910 and https://bugs.webkit.org/show_bug.cgi?id=142733 Patch by Sam Weinig. Reviewed by Brady Eidson. * loader/icon/IconController.cpp: (WebCore::IconController::startLoader): Bail early here if the page is using an ephemeral session. (WebCore::IconController::continueLoadWithDecision): Instead of here. 2015-03-12 Sebastian Dröge Stop using single-include headers that are only available since GStreamer >= 1.2. https://bugs.webkit.org/show_bug.cgi?id=142537 Reviewed by Philippe Normand. * platform/audio/gstreamer/AudioDestinationGStreamer.cpp: * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp: * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp: * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: * platform/graphics/gstreamer/GStreamerUtilities.cpp: * platform/graphics/gstreamer/GStreamerUtilities.h: * platform/graphics/gstreamer/ImageGStreamer.h: Instead of using single-include headers for the GStreamer libraries, directly include the headers we need. The single-include headers were only added in 1.2, and this would be the only reason why we would depend on 1.2. 2015-02-27 Andreas Kling Use NeverDestroyed for JS wrapper owners. Reviewed by Chris Dumez. Using NeverDestroyed puts these objects in BSS which is preferable since that prevents them from pinning down entire malloc pages forever. * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL. * bindings/scripts/test/JS/*: Rebaseline bindings tests for this change. 2015-02-27 Zalan Bujtas Use after free in WebCore::RenderNamedFlowFragment::restoreRegionObjectsOriginalStyle https://bugs.webkit.org/show_bug.cgi?id=138366 Reviewed by Dave Hyatt. This patch ensures that we clean up RenderNamedFlowFragment::m_renderObjectRegionStyle when embedded flow content is getting destroyed. In m_renderObjectRegionStyle hash map, we store style information about the named flow's descendant children. When a child is being detached from the tree, it removes itself from this hashmap. We do it by traversing up on the ancestor chain and call removeFlowChildInfo() on the parent flow. However in case of embedded flows (for example multicolumn content inside a region), we need to check whether the parent flow is inside a flow too and continue the cleanup accordingly. Test: fast/regions/region-with-multicolumn-embedded-crash.html * rendering/RenderObject.cpp: (WebCore::RenderObject::removeFromRenderFlowThreadIncludingDescendants): 2015-02-23 Philippe Normand [GStreamer] Redundant track language notifications https://bugs.webkit.org/show_bug.cgi?id=141908 Reviewed by Žan Doberšek. Invoke languageChanged only if the language code actually changed. * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp: (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged): 2015-02-18 Zalan Bujtas REGRESSION(r174761) Dangling spanner pointer in RenderMultiColumnSpannerPlaceholder. https://bugs.webkit.org/show_bug.cgi?id=138224 Reviewed by Dave Hyatt. It's wrong to call flowThreadRelativeWillBeRemoved(child). RenderMultiColumnFlowThread::removeFlowChildInfo() does not mean that the child is actually about to be removed. Should this introduce any regressions, we need to deal with those separately. Test: fast/multicol/crash-when-spanner-gets-moved-around.html * rendering/RenderMultiColumnFlowThread.cpp: (WebCore::RenderMultiColumnFlowThread::removeFlowChildInfo): Deleted. * rendering/RenderMultiColumnFlowThread.h: 2015-03-02 Carlos Garcia Campos [SOUP] Use SoupMessage::starting instead of SoupSession::request-started https://bugs.webkit.org/show_bug.cgi?id=142164 Reviewed by Sergio Villar Senin. SoupSession::request-started is deprecated in libsoup 2.50. Both signals are equivalent, but SoupMessage::starting is also emitted for resources loaded from the disk cache. This fixes web timing calculations for cached resources, since we were not initializing m_requestStart. * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::startingCallback): (WebCore::createSoupMessageForHandleAndRequest): * platform/network/soup/SoupNetworkSession.cpp: (WebCore::SoupNetworkSession::SoupNetworkSession): 2015-03-04 Philippe Normand [GStreamer] the GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED should be wrapped by a ifdef https://bugs.webkit.org/show_bug.cgi?id=142274 Reviewed by Carlos Garcia Campos. Don't handle scheduling queries if building against versions of GStreamer older than 1.2.0. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcQueryWithParent): 2015-02-16 Milan Crha [GTK] Loading page into WebView shows g_closure_unref warning https://bugs.webkit.org/show_bug.cgi?id=127474 Reviewed by Carlos Garcia Campos. * bindings/gobject/GObjectEventListener.cpp: (WebCore::GObjectEventListener::gobjectDestroyed): 2015-03-05 Carlos Garcia Campos [SOUP] Check TLS errors as soon as they are set in the SoupMessage https://bugs.webkit.org/show_bug.cgi?id=142244 Reviewed by Sergio Villar Senin. Connect to the notify::tls-errors signal of SoupMessage to cancel the load earlier in case of TLS failure, preventing any private data from being sent to the server before the TLS errors are checked. * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::tlsErrorsChangedCallback): (WebCore::gotHeadersCallback): (WebCore::createSoupMessageForHandleAndRequest): 2015-03-03 Carlos Garcia Campos [SOUP] Synchronous XMLHttpRequests can time out when we reach the max connections limit https://bugs.webkit.org/show_bug.cgi?id=141508 Reviewed by Sergio Villar Senin. Use SOUP_MESSAGE_IGNORE_CONNECTION_LIMITS flag when loading a synchronous message instead of increasing the maximum number of connections allowed if the soup version is recent enough. The current solution of increasing/decreasing the limits doesn't always work, because connections are not marked as IDLE in libsoup until the message is unqueued, but we don't wait for the message to be unqueued to finish our loads in WebKit, we finish them as soon as we have finished reading the stream. This causes that synchronous loads keep blocked in the nested main loop until the timeout of 10 seconds is fired and the load fails. Also marked WebCoreSynchronousLoader class as final, the virtual methods as override and removed the unsused method isSynchronousClient. * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::createSoupMessageForHandleAndRequest): (WebCore::WebCoreSynchronousLoader::WebCoreSynchronousLoader): (WebCore::WebCoreSynchronousLoader::isSynchronousClient): Deleted. (WebCore::WebCoreSynchronousLoader::didReceiveResponse): (WebCore::WebCoreSynchronousLoader::didReceiveData): (WebCore::WebCoreSynchronousLoader::didReceiveBuffer): (WebCore::WebCoreSynchronousLoader::didFinishLoading): (WebCore::WebCoreSynchronousLoader::didFail): (WebCore::WebCoreSynchronousLoader::didReceiveAuthenticationChallenge): (WebCore::WebCoreSynchronousLoader::shouldUseCredentialStorage): 2015-03-17 Carlos Garcia Campos [GTK] Wrong transfer annotations used in GObject DOM bindings https://bugs.webkit.org/show_bug.cgi?id=142780 Reviewed by Gustavo Noronha Silva. We are using transfer none for all methods returning a GObject DOM Object. That's not true. Only objects derived from Node are automatically released by the DOM object cache and can be transfer none. All other objects are added to the cache only to avoid creating the same wrapper twice for the same core object, but caller should release the returned reference. * bindings/gobject/WebKitDOMCustomUnstable.h: * bindings/scripts/CodeGeneratorGObject.pm: (GetTransferTypeForReturnType): (GenerateFunction): 2015-03-17 Carlos Garcia Campos [GTK] WebKitDOM objects leaking https://bugs.webkit.org/show_bug.cgi?id=118788 Reviewed by Darin Adler and Sergio Villar Senin. Use a DOMwindowObserver class, derived from DOMWindowProperty to be notified when the window object is detached from the frame to clear the DOM objects associated to that frame in that case too. * bindings/gobject/DOMObjectCache.cpp: 2015-02-17 Carlos Garcia Campos [GTK] GObject DOM bindings object are cached forever https://bugs.webkit.org/show_bug.cgi?id=141558 Reviewed by Sergio Villar Senin. Rework the DOMObjectCache to avoid having to manually clear the objects when the frame is destroyed, using a FrameDestructionObserver instead. When a new object associated to a Frame is added to the cache, a FrameDestructionObserver is created for the frame if needed, and the DOM object is tracked by the observer too. When the frame is detached from the page all its objects are cleared, and if the aren't additional references, the object is finalized and removed from the cache normally. This patch also simplifies and modernizes the code to make it easier to read an maintain. * bindings/gobject/DOMObjectCache.cpp: (WebKit::DOMObjectCacheData::DOMObjectCacheData): Add constructor to initialize its members and simplify the callers. (WebKit::DOMObjectCacheData::clearObject): Remove the references added by the cache, ensuring the GObject is not finalized until the method returns. (WebKit::DOMObjectCacheData::refObject): Adds a reference owned by the cache. (WebKit::domObjectCacheFrameObservers): Map a frame to a FrameDestructionObserver. (WebKit::getOrCreateDOMObjectCacheFrameObserver): Create a new FrameDestructionObserver for the given Frame or return the existing one. (WebKit::domObjects): Map wrapped object to wrapper object. (WebKit::DOMObjectCache::forget): Remove the wrapped object from the cache. (WebKit::DOMObjectCache::get): Return the wrapped object if it is in the cache, increasing the cache references. (WebKit::DOMObjectCache::put): Add the wrapper object to the cache for the given wrapped object. If it's a Node and has a frame add the node to the FrameDestructionObserver corresponding to the frame. (WebKit::getFrameFromHandle): Deleted. (WebKit::weakRefNotify): Deleted. (WebKit::DOMObjectCache::clearByFrame): Deleted. (WebKit::DOMObjectCache::~DOMObjectCache): Deleted. * bindings/gobject/DOMObjectCache.h: 2015-03-19 Carlos Garcia Campos [GTK] Scrollbars look bad with GTK+ 3.16 https://bugs.webkit.org/show_bug.cgi?id=140800 Reviewed by Sergio Villar Senin. Take margin into account when rendering scrollbars. This fixes the huge scrollbars rendered with GTK+ 3.16. We don't need to check the GTK+ version because in previous versions the marging were 0, so the same code just works. * platform/gtk/ScrollbarThemeGtk.cpp: (WebCore::adjustRectAccordingToMargin): (WebCore::ScrollbarThemeGtk::paintTrackBackground): (WebCore::ScrollbarThemeGtk::paintThumb): 2015-03-31 Carlos Garcia Campos [GTK] DnD icon/widget has odd background https://bugs.webkit.org/show_bug.cgi?id=143217 Reviewed by Martin Robinson. Remove DragIcon class since it's no longer needed with GTK+3 and the GTK+2 code there is unused. GTK+ knows what to do with a cairo surface, I guess we migrated the GTK+2 code to GTK+3 without realizing that using the surface was enough. * PlatformGTK.cmake: * platform/gtk/DragIcon.cpp: Removed. * platform/gtk/DragIcon.h: Removed. 2015-02-10 Carlos Garcia Campos [GTK] GMutexLocker build issue https://bugs.webkit.org/show_bug.cgi?id=141381 Reviewed by Žan Doberšek. Use always WTF::GMutexLocker because newer glib versions have a GMutexLocker in the public API. * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp: (WebCore::AudioSourceProviderGStreamer::provideInput): (WebCore::AudioSourceProviderGStreamer::handleAudioBuffer): (WebCore::AudioSourceProviderGStreamer::clearAdapters): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize): (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint): (WebCore::MediaPlayerPrivateGStreamerBase::paint): * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: (webkitVideoSinkTimeoutCallback): (webkitVideoSinkRender): (unlockSampleMutex): (webkitVideoSinkUnlockStop): (webkitVideoSinkStart): * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcGetProperty): (webKitWebSrcStop): (webKitWebSrcStart): (webKitWebSrcChangeState): (webKitWebSrcQueryWithParent): (webKitWebSrcGetUri): (webKitWebSrcSetUri): (webKitWebSrcNeedDataMainCb): (webKitWebSrcNeedDataCb): (webKitWebSrcEnoughDataMainCb): (webKitWebSrcEnoughDataCb): (webKitWebSrcSeekDataCb): (webKitWebSrcSetMediaPlayer): (StreamingClient::createReadBuffer): (StreamingClient::handleResponseReceived): (StreamingClient::handleDataReceived): (StreamingClient::handleNotifyFinished): (ResourceHandleStreamingClient::wasBlocked): (ResourceHandleStreamingClient::cannotShowURL): 2015-01-26 Michael Catanzaro [GTK] gtkdoc does not appear in DevHelp https://bugs.webkit.org/show_bug.cgi?id=139369 Reviewed by Philippe Normand. * PlatformGTK.cmake: Include the API version in the gtkdoc filenames. 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. 2015-01-09 Zalan Bujtas Calling clearSelection on a detached RenderObject leads to segfault. https://bugs.webkit.org/show_bug.cgi?id=140275 Reviewed by Simon Fraser. We collect selection rects and compute selection gaps in order to paint/clear selection. With certain content, we need to be able to walk the tree up to a particular container to compute the selection rect. However this container might not be available when the selection is part of a detached tree. This is a null-check fix to ensure we don't crash in such cases, but in the long run selection gaps and rect should be cached between two layouts so that we don't need to keep collecting/recomputing them. Tracked here: webkit.org/b/140321 Test: editing/selection/clearselection-on-detached-subtree-crash.html * rendering/RenderBox.cpp: (WebCore::RenderBox::containingBlockLogicalWidthForContent): (WebCore::RenderBox::containingBlockLogicalHeightForContent): * rendering/RenderView.cpp: (WebCore::RenderView::clearSelection): 2014-12-18 Chris Fleizach AX: Recursive crash at WebCore::accessibleNameForNode https://bugs.webkit.org/show_bug.cgi?id=139616 Reviewed by Mario Sanchez Prada. An image that uses aria-labelledby to reference its own parent can lead to a recursion crash. There needs to be some information we can pass through these methods to ensure we don't hit this case. Test: accessibility/accessibility-description-crash.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::alternativeText): (WebCore::AccessibilityNodeObject::textUnderElement): (WebCore::accessibleNameForNode): (WebCore::AccessibilityNodeObject::accessibilityDescriptionForElements): * accessibility/AccessibilityObject.h: (WebCore::AccessibilityTextUnderElementMode::AccessibilityTextUnderElementMode): 2014-12-18 Joseph Pecoraro Web Inspector: ASSERT seen closing/opening multiple inspectors https://bugs.webkit.org/show_bug.cgi?id=139783 Reviewed by Timothy Hatcher. * inspector/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::nodeForObjectId): 2014-12-16 Chris Dumez REGRESSION (r163928): Animated GIFs are not resumed when translated into view using -webkit-transform https://bugs.webkit.org/show_bug.cgi?id=139672 Reviewed by Antti Koivisto. After r163928, animated GIFs were not resumed when translated into view using '-webkit-transform' CSS property. This broke animated gifs on the mobile version of weibo.com (which is one of the most popular blogging sites in China) on iPhone. e.g. http://m.weibo.cn/page/tpl?containerid=1005052150182731_-_WEIBO_SECOND_PROFILE_WEIBO&itemid=&title=全部微博 This patch calls FrameView::resumeVisibleImageAnimationsIncludingSubframes() after style recalc so that we resume animated images if they become visible after the style has changed. Doing so after layout wouldn't work because no layout happens in this case. Test: fast/images/animated-gif-webkit-transform.html * dom/Document.cpp: (WebCore::Document::recalcStyle): 2014-12-12 Simon Fraser REGRESSION (r168217): Images are cropped out during animation at jetblue.com https://bugs.webkit.org/show_bug.cgi?id=136410 rdar://problem/18188533 Reviewed by Dean Jackson. During GraphicsLayer flushing, for tiled layers we can compute a visible rect using the current state of an animation, which is obtained via the AnimationController. If that animation was running in a subframe, AnimationController could use a stale beginAnimationUpdateTime since no-one called its beginAnimationUpdate(). That resulted in an incorrect computation of the visible rect, resulting in missing tiles. There are two parts to this fix. First, add an assertion that beginAnimationUpdateTime() is being called inside an animation update block. This required moving m_beginAnimationUpdateCount into AnimationControllerPrivate, and changes to endAnimationUpdate(). The second is adding a AnimationUpdateBlock to getAnimatedStyleForRenderer(), which can be called outside of style resolution. We also need some in other API functions. Testing revealed that layout can call via layoutOverflowRectForPropagation(), suggesting that we should have an animation batch inside FrameView::layout(). In addition, a single resolveStyle/layout should use the same animationBeginTime, so we add a batch to updateLayoutAndStyleIfNeededRecursive(). Identical to the patch that was rolled out in r177269 with the addition of a Ref protector(m_frame) in AnimationControllerPrivate::animationTimerFired() that ensures that the AnimationControllerPrivate is kept alive for the scope of the AnimationPrivateUpdateBlock, when a transitionEnd event destroys an iframe. No test because it's timing-dependent. Existing tests exercise the new assertion. * css/CSSComputedStyleDeclaration.cpp: (WebCore::computeRenderStyleForProperty): * page/FrameView.cpp: (WebCore::FrameView::layout): (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): * page/animation/AnimationController.cpp: (WebCore::AnimationPrivateUpdateBlock::AnimationPrivateUpdateBlock): (WebCore::AnimationPrivateUpdateBlock::~AnimationPrivateUpdateBlock): (WebCore::AnimationControllerPrivate::AnimationControllerPrivate): (WebCore::AnimationControllerPrivate::animationTimerFired): (WebCore::AnimationControllerPrivate::suspendAnimationsForDocument): (WebCore::AnimationControllerPrivate::resumeAnimationsForDocument): (WebCore::AnimationControllerPrivate::beginAnimationUpdateTime): (WebCore::AnimationControllerPrivate::beginAnimationUpdate): (WebCore::AnimationControllerPrivate::endAnimationUpdate): (WebCore::AnimationControllerPrivate::getAnimatedStyleForRenderer): (WebCore::AnimationController::AnimationController): (WebCore::AnimationController::notifyAnimationStarted): (WebCore::AnimationController::pauseAnimationAtTime): (WebCore::AnimationController::pauseTransitionAtTime): (WebCore::AnimationController::resumeAnimationsForDocument): (WebCore::AnimationController::startAnimationsIfNotSuspended): (WebCore::AnimationController::beginAnimationUpdate): (WebCore::AnimationController::endAnimationUpdate): * page/animation/AnimationController.h: * page/animation/AnimationControllerPrivate.h: 2014-12-12 Simon Fraser REGRESSION (r168217): Images are cropped out during animation at jetblue.com https://bugs.webkit.org/show_bug.cgi?id=136410 Reviewed by Dean Jackson. We were hitting the new assertion under Page::setPageScaleFactor(), which calls recalcStyle(), so move the AnimationUpdateBlock from updateStyleIfNeeded() to recalcStyle(). * dom/Document.cpp: (WebCore::Document::recalcStyle): (WebCore::Document::updateStyleIfNeeded): 2014-12-15 Xavier Claessens [GStreamer] the webkitwebsrc element can stale https://bugs.webkit.org/show_bug.cgi?id=138425 Reviewed by Philippe Normand. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (removeTimeoutSources): (webKitWebSrcStart): (webKitWebSrcChangeState): 2014-12-14 Ryosuke Niwa REGRESSION(r160182): Fragment parser doesn't close a form element with a close tag https://bugs.webkit.org/show_bug.cgi?id=139561 Reviewed by Darin Adler. The bug was caused by us not setting the form pointer in insertHTMLFormElement. Since we already avoid associating a form inside HTMLConstructionSite::createHTMLElement, we didn't need this code at all. Fixed the bug by partially reverting r160182. Test: fast/dom/dom-parse-close-form.html * html/parser/HTMLConstructionSite.cpp: (WebCore::HTMLConstructionSite::insertHTMLFormElement): (WebCore::HTMLConstructionSite::insideTemplateElement): Deleted. * html/parser/HTMLConstructionSite.h: 2014-12-11 Alexey Proskuryakov Initialize m_ownsGeneratedFile when decoding a FormDataElement https://bugs.webkit.org/show_bug.cgi?id=139566 Reviewed by Tim Horton. No tests, because it's random, and I couldn't reproduce an assertion failure in controlled circumstances. * platform/network/FormData.h: (WebCore::FormDataElement::decode): A newly created FormDataElement by definition doesn't own the file. 2014-12-10 Dean Jackson InstancedArray crashes attempting to draw out of bounds https://bugs.webkit.org/show_bug.cgi?id=139521 Reviewed by Simon Fraser. We were not doing index validation correctly for instancing. Test: fast/canvas/webgl/angle-instanced-arrays-out-of-bounds.html * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::validateVertexAttributes): We need to check the number of instances drawn against the amount of instance data that has been provided, taking into account the number of repeats (the divisor). (WebCore::WebGLRenderingContext::drawArrays): Added some whitespace to make it more clear. (WebCore::WebGLRenderingContext::validateDrawElements): This needs to take a primcount parameter so that it can correctly validate the call (when used from drawElementsInstanced). (WebCore::WebGLRenderingContext::drawElements): New signature to validate. (WebCore::WebGLRenderingContext::drawArraysInstanced): Rearrange this a bit. The primcount validation is already being done by the validateDrawArrays call. Also, there was a bogus UNUSED_PARAM hanging around. (WebCore::WebGLRenderingContext::drawElementsInstanced): Similar rearrangement. Use the primcount parameter. * html/canvas/WebGLRenderingContext.h: 2014-12-11 Alexey Proskuryakov REGRESSION (Async Text Input): Text input method state is not reset when reloading a page https://bugs.webkit.org/show_bug.cgi?id=139504 rdar://problem/19034674 Reviewed by Enrica Casucci. Explicitly notify EditorClient when a composition is voluntarily canceled by WebCore. These are almost certainly not all the places where this happens, but this fixes the bug, and lays the groundwork for using this new client call instead of didChangeSelection hacks. * editing/Editor.cpp: (WebCore::Editor::clear): (WebCore::Editor::cancelComposition): * loader/EmptyClients.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::willTransitionToCommitted): * page/EditorClient.h: 2014-12-10 Chris Dumez http://omfgdogs.info/ only animates when you resize the window https://bugs.webkit.org/show_bug.cgi?id=139435 Reviewed by Simon Fraser. After r163928, we would fail to animate a gif if: - it is used as a background image of a 0-height html element - it is used as a background image of a 0-height body element whose background is delegated to the root (because the root has no background). This is because in such cases, shouldRepaintForImageAnimation() should use the background rect instead of the renderer's overflow rect to determine if the image is inside the viewport. Both cases are addressed in this patch. Tests: fast/images/animated-gif-body-delegated-background-image.html fast/images/animated-gif-body-outside-viewport.html fast/images/animated-gif-html-background-image.html * rendering/RenderElement.cpp: (WebCore::shouldRepaintForImageAnimation): * testing/Internals.cpp: (WebCore::Internals::hasPausedImageAnimations): * testing/Internals.h: * testing/Internals.idl: 2014-12-10 Zalan Bujtas Continuously repainting large parts of Huffington Post. https://bugs.webkit.org/show_bug.cgi?id=139468 Reviewed by Antti Koivisto. This patch eliminates redundant repaint requests for inlines when neither the parent block flow nor any of the inline children are dirty. Previously, 1. simple line layout always recalculated inline content positions regardless of whether the content needed relayout at all; as a result, it always triggered full repaint. 2. inline tree layout ignored the needslayout flag on the last line and treated it dirty (unless it broke cleanly (
foo
)). This was an ancient workaround for an editing/insert use case, but it seems not to be the case anymore. Tests: fast/repaint/implicitly-positioned-block-repaint-complex-line-layout.html fast/repaint/implicitly-positioned-block-repaint-simple-line-layout.html * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutInlineChildren): (WebCore::RenderBlockFlow::layoutSimpleLines): Check if we need to trigger layout at all. * rendering/RenderBlockFlow.h: * rendering/RenderBlockLineLayout.cpp: (WebCore::RenderBlockFlow::determineStartPosition): Remove the last line dirty hack. If it happens to introduce regression, we should fix it at the caller site to make the line dirty. 2014-12-10 Ryosuke Niwa REGRESSION(r164329): Input fields are not honoring the maxlength attribute https://bugs.webkit.org/show_bug.cgi?id=139447 Reviewed by Benjamin Poulain. The bug was caused by String::substring being called with the selection's end offset in the second argument instead of the selection's length in handleBeforeTextInsertedEvent. Fixed the bug by passing the right second argument to String::substring. Test: fast/forms/input-maxlength-inserting-in-middle.html * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::handleBeforeTextInsertedEvent): 2014-12-10 Antti Koivisto Crash when creating CSSCalcBinaryOperation https://bugs.webkit.org/show_bug.cgi?id=134886 rdar://problem/17663561 Reviewed by Chris Dumez. Test: fast/css/calc-binary-operation-crash.html * css/CSSCalculationValue.cpp: (WebCore::determineCategory): Ensure that both axis are within the addSubtractResult table. Remove unneeded CalcOther test. The call site guarantees it doesn't happen and the normal cases would handle it anyway. Also strengthen some asserts. 2014-12-09 Myles C. Maxfield Scrolling to anchor tags does nothing in vertical-rl writing mode https://bugs.webkit.org/show_bug.cgi?id=137838 Reviewed by David Hyatt. Scroll to a particular tag, and make sure the viewport is rendered as expected. Tests: fast/events/scroll-to-anchor-vertical-lr-writing-mode.html fast/events/scroll-to-anchor-vertical-writing-mode-contained-2.html fast/events/scroll-to-anchor-vertical-writing-mode-contained.html fast/events/scroll-to-anchor-vertical-writing-mode.html * page/FrameView.cpp: (WebCore::FrameView::scrollToAnchor): * rendering/ScrollBehavior.cpp: * rendering/ScrollBehavior.h: 2014-12-09 Bem Jones-Bey REGRESSION(r155906): Page content disappears on Tuaw article after loading https://bugs.webkit.org/show_bug.cgi?id=138100 Reviewed by Simon Fraser. Test: ManualTests/float-layer-not-painting.html * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::insertFloatingObject): If a layout happens, it can change whether the float's renderer has a self painting layer. So in that case, we need to update the flag on the FloatingObject instance for that float. 2014-12-09 Alberto Garcia convertToUTF8String converts null string to empty string https://bugs.webkit.org/show_bug.cgi?id=133904 Reviewed by Carlos Garcia Campos. Test added to Tools/TestWebKitAPI/Tests/WebKit2Gtk/DOMNodeTest.cpp Return 0 if the string is null. * bindings/gobject/ConvertToUTF8String.cpp: (convertToUTF8String): 2014-12-09 Alberto Garcia [Media][GTK][EFL] Reduce style updates (painting) in controls https://bugs.webkit.org/show_bug.cgi?id=137773 Reviewed by Carlos Garcia Campos. Don't update media controls if they are not visible, and initialize slider to a zero value. * Modules/mediacontrols/mediaControlsBase.js: (Controller.prototype.createControls): (Controller.prototype.handleDurationChange): (Controller.prototype.updateProgress): (Controller.prototype.updateTime): * Modules/mediacontrols/mediaControlsGtk.js: (ControllerGtk.prototype.updateTime): 2014-12-08 Myles C. Maxfield Inline elements whose parents have small line-height are laid out too low https://bugs.webkit.org/show_bug.cgi?id=139375 Reviewed by Dave Hyatt. This is a port of the Blink patch at https://src.chromium.org/viewvc/blink?revision=155253&view=revision. When laying out inline elements, we try to align leaf children's parents' baselines across the entire line. However, if you set line-height: 0px on a span, the entire InlineBox which represents that span will have a height of 0, and therefore be laid out entirely on the baseline. In addition, we will try to vertically center the leaf text in the span's InlineBox, which means the leaf text will be vertically centered on the baseline. All the other major browsers do not have this behavior; instead, they line up the boxes as you would expect. This bug led to a rendering problem on the front page of the New York Times. Here is the ChangeLog from the Blink patch: Fix baseline position when it is outside the element's box Specifically, we shouldn't force the baseline to be inside the element. IE and FF don't do this, and it's incompatible with the CSS spec: "The baseline of an 'inline-block' is the baseline of its last line box in the normal flow, unless it has either no in-flow line boxes or if its 'overflow' property has a computed value other than 'visible', in which case the baseline is the bottom margin edge." -- http://www.w3.org/TR/CSS21/visudet.html#leading It doesn't have a special case for "baseline is outside of the element's margin box". Test: fast/text/small-line-height.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::baselinePosition): 2014-12-08 Doron Wloschowsky Webkit using Harfbuzz does not display Arabic script correctly https://bugs.webkit.org/show_bug.cgi?id=136337 Reviewed by Carlos Garcia Campos. Using reinterpret_cast to convert hb_codepoint_t* into UChar* doesn't work on big endian systems. * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: (WebCore::harfBuzzGetGlyph): 2014-12-08 Sebastian Dröge [GStreamer] Add video/flv to the list of supported mimetypes https://bugs.webkit.org/show_bug.cgi?id=139344 Reviewed by Gustavo Noronha Silva. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::mimeTypeCache): Add video/flv additional to video/x-flv to the list of supported mimetypes. It's used on some websites, e.g. http://www.jwplayer.com/html5/formats/ 2014-12-08 Sebastian Dröge [GStreamer] Add application/x-mpegurl to the list of supported mimetypes. https://bugs.webkit.org/show_bug.cgi?id=139343 Reviewed by Gustavo Noronha Silva. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::mimeTypeCache): It's an alternative mimetype for the already supported application/vnd.apple.mpegurl (aka HLS) and adding it allows all streams on http://www.jwplayer.com/html5/hls/ to be played. 2014-12-07 Gwang Yoon Hwang [TextureMapper] Normalize pattern transform for pattern compositing https://bugs.webkit.org/show_bug.cgi?id=139374 Reviewed by Martin Robinson. In CoordGfx/TexMapGL, pattern compositing (for background image) uses the patternTransform shader uniform. However, current implementation miscalculates its transform matrix. It uses simple rectToRect transformationMatrix which produces unnormalized garbage term. This causes unexpected behavior at the fragmentation stage in some mobile GPUs. It should calculate its scale based on tileSize and contentSize, and its position based on tilePhase and contentSize. No new tests because the bug only occurs on some mobile GPUs. * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::computePatternTransformIfNeeded): 2014-12-07 Youenn Fablet [Soup][Curl] HTTP header values should be treated as latin1, not UTF-8 https://bugs.webkit.org/show_bug.cgi?id=128739 Reviewed by Martin Robinson. Removed UTF-8 conversion of HTTP header values (SOUP and CURL). Removed unnecessary UTF-8 conversion of HTTP header names (SOUP). Changed conversion of HTTP method from UTF-8 to ASCII (SOUP and CURL). Added explicit UTF-8 conversion of Content-Disposition header to compute download suggested filename. Test: http/tests/xmlhttprequest/response-special-characters.html * platform/network/curl/CurlDownload.cpp: (WebCore::CurlDownload::headerCallback): Removed header conversion. * platform/network/curl/ResourceHandleManager.cpp: (WebCore::headerCallback): Ditto. (WebCore::ResourceHandleManager::initializeHandle): Changed HTTP method conversion to ASCI. * platform/network/soup/ResourceRequestSoup.cpp: (WebCore::ResourceRequest::updateFromSoupMessageHeaders): Removed header conversion. (WebCore::ResourceRequest::updateSoupMessage): Changed HTTP method conversion to ASCII. (WebCore::ResourceRequest::toSoupMessage): Ditto. (WebCore::ResourceRequest::updateFromSoupMessage): * platform/network/soup/ResourceResponseSoup.cpp: (WebCore::ResourceResponse::updateFromSoupMessageHeaders): Rmoved header conversion. (WebCore::ResourceResponse::platformSuggestedFilename): Added explicit conversion of contentDisposition to UTF-8. 2014-12-05 Myles C. Maxfield Directional single quotation marks are not rotated in vertical text https://bugs.webkit.org/show_bug.cgi?id=138526 Reviewed by Darin Adler. In vertical text, directional single quotation marks are not rotated along with the rest of the letters. Test: fast/text/vertical-quotation-marks.html * platform/graphics/FontGlyphs.cpp: (WebCore::shouldIgnoreRotation): 2014-12-05 Zalan Bujtas Issue repaint at setUnavailablePluginIndicatorIsHidden() only when embedded object's indicator status changes. https://bugs.webkit.org/show_bug.cgi?id=139311 Reviewed by Tim Horton. Not testable. * rendering/RenderEmbeddedObject.cpp: (WebCore::RenderEmbeddedObject::setUnavailablePluginIndicatorIsHidden): 2014-12-04 Adenilson Cavalcanti Groove/inset/outset borders show solid if the color is black https://bugs.webkit.org/show_bug.cgi?id=58608 Reviewed by Simon Fraser. Test: fast/borders/mixed-border-style2.html This patch will lighten/darken the border side colors, handling border decoration in a similar way as Firefox does. * rendering/RenderObject.cpp: (WebCore::RenderObject::drawLineForBoxSide): (WebCore::RenderObject::calculateBorderStyleColor): * rendering/RenderObject.h: 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-03 Myles C. Maxfield List markers in RTL languages do not draw the first character. https://bugs.webkit.org/show_bug.cgi?id=139244 Reviewed by Simon Fraser. Off-by-one error when reversing the string (from LTR to RTL) Test: fast/lists/rtl-marker.html * rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::paint): 2014-12-03 Zalan Bujtas ASSERTION: RenderMultiColumnFlowThread::processPossibleSpannerDescendant() when column spanner's parent is not a RenderBlockFlow. https://bugs.webkit.org/show_bug.cgi?id=139188 rdar://problem/18502182 Reviewed by David Hyatt. This patch ensures that the validation check for spanner in isValidColumnSpanner() is in synch with the expectation in RenderMultiColumnFlowThread::processPossibleSpannerDescendant(). (descendant's parent is expected to be a RenderBlockFlow) Test: fast/multicol/svg-content-as-column-spanner-crash.html * rendering/RenderMultiColumnFlowThread.cpp: (WebCore::isValidColumnSpanner): 2014-12-01 Zalan Bujtas Twitter avatar moves when hovering/unhovering the "follow" button. https://bugs.webkit.org/show_bug.cgi?id=139147 rdar://problem/19096508 Reviewed by Simon Fraser. This patch ensures that the out of flow positioned render boxes (RenderReplaced) do not get repositioned when their inline box wrappers move. Ideally, out of flow positioned renderers do not have inline wrappers by the time we start placing inline boxes, but in certain case (optimized code path for descendantsHaveSameLineHeightAndBaseline()), they are still part of the inline box tree. This patch prevents those renderer boxes from getting positioned as part of the inline box placement. They will get removed later at RenderBlockFlow::computeBlockDirectionPositionsForLine(). Test: fast/inline/out-of-flow-positioned-render-replaced-box-moves.html * rendering/InlineBox.cpp: (WebCore::InlineBox::adjustPosition): 2014-11-26 Philippe Normand [GStreamer] HTTP source element lacks SCHEDULING query support https://bugs.webkit.org/show_bug.cgi?id=139064 Reviewed by Carlos Garcia Campos. No new tests, covered by http/tests/media/hls. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcQueryWithParent): Make the element handle SCHEDULING queries with the BANDWIDTH_LIMITED flag. This helps uridecodebin to configure itself for adaptive streaming playback scenarios. 2014-11-27 Antti Koivisto CrashTracer: com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::HTMLPlugInImageElement::updateSnapshot + 108 https://bugs.webkit.org/show_bug.cgi?id=139057 Reviewed by Anders Carlsson. No test, don't know how to repro. * html/HTMLPlugInImageElement.cpp: (WebCore::HTMLPlugInImageElement::updateSnapshot): Null check the renderer. 2014-11-25 Philippe Normand [GStreamer] gstmpegts is not initialized https://bugs.webkit.org/show_bug.cgi?id=139039 Reviewed by Carlos Garcia Campos. * platform/graphics/gstreamer/GStreamerUtilities.cpp: (WebCore::initializeGStreamer): Initialize the gstmpegts library. 2014-11-21 Chris Dumez Crash when setting 'transition-delay' CSS property to a calculated value https://bugs.webkit.org/show_bug.cgi?id=138784 Reviewed by Sam Weinig. Update CSSPrimitiveValue::computeTime() to use primitiveType() instead of m_primitiveUnitType so that it properly handles calculated values. Without this, we would hit the ASSERT_NOT_REACHED() assertion in computeTime() for calculated values. Test: fast/css/transition-delay-calculated-value.html * css/CSSPrimitiveValue.h: (WebCore::CSSPrimitiveValue::computeTime): 2014-11-16 Chris Dumez Crash when setting 'order' CSS property to a calculated value https://bugs.webkit.org/show_bug.cgi?id=138780 Reviewed by Darin Adler. CSS Calculated values were not handled by the CSS parser for 'order' CSS property. As a result, using calculated values wouldn't work in release builds and would hit an assertion in debug builds. This patch updates the CSS parser to directly convert the CSS Calculated value into a simple integer CSSPrimitiveValue for 'order' property. We could have marked CSS Calculated values as valid in the CSS Parser instead but this would have brought issues: - The calculated value needs to be adjusted to INT_MIN + 2 if it is less than that. This would force us to calculate the expression anyway. - The StyleBuilder would need updating to properly handle CSS Calculated values for 'order'. Test: fast/css/order-calculated-value.html * css/CSSParser.cpp: (WebCore::CSSParser::parseValue): 2014-11-21 Chris Dumez Crash when setting 'font' CSS property to 'calc(2 * 3)' https://bugs.webkit.org/show_bug.cgi?id=138933 Reviewed by Darin Adler. The CSS Parser was not handling calculated values when parsing the font weight. This would lead us to hit an assertion when parsing a font property whose weight is set to a calculated value. This patch updates parseFontWeight() to properly handle calculated values. Test: fast/css/font-calculated-value.html * css/CSSParser.cpp: (WebCore::CSSParser::parseFontWeight): 2014-11-20 Zalan Bujtas REGRESSION (174986): CSS clip property is ignored when border-radius is present. https://bugs.webkit.org/show_bug.cgi?id=138935 rdar://problem/18965984 Reviewed by Simon Fraser. Revert back to r163382 and fix bug 127729 properly. Save the graphics context when paint and clip rects are the same, but the clip rect has radius. Each iteration on ::clipRect() from r163382 onwards just introduced yet another regression. Test: fast/clip/css-clip-does-not-work-when-border-radius-is-present.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::clipToRect): 2014-11-20 Antti Koivisto REGRESSION (r172854): Web Viewer in FileMaker does not render a Base64 encoded animated-GIF https://bugs.webkit.org/show_bug.cgi?id=138807 Reviewed by Simon Fraser. Animation gets paused because WebKit thinks the GIF is outside of the view. * page/FrameView.cpp: (WebCore::FrameView::windowClipRect): We need to convert to window coordinates in paintsEntireContents mode too so these functions are consistent. This matters with some WK1 API clients. 2014-11-18 Chris Dumez Crash when setting 'z-index' / 'flex-shrink' CSS properties to a calculated value https://bugs.webkit.org/show_bug.cgi?id=138783 Reviewed by Andreas Kling. Update operators converting CSSPrimitiveValue to integer / floating point types to properly handle calculated values (e.g. 'calc(2 * 3)'). Previously, this was not working in release builds and we would hit an ASSERT_NOT_REACHED() in debug builds. Tests: fast/css/flex-shrink-calculated-value.html fast/css/z-index-calculated-value.html * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::operator unsigned short): (WebCore::CSSPrimitiveValue::operator int): (WebCore::CSSPrimitiveValue::operator unsigned): (WebCore::CSSPrimitiveValue::operator float): 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-11-18 David Hyatt REGRESSION(r152313): Inline-block element doesn't wrap properly https://bugs.webkit.org/show_bug.cgi?id=138846 - Reviewed by Simon Fraser. Added fast/inline-block/inline-block-empty-spans.html * rendering/line/BreakingContextInlineHeaders.h: (WebCore::BreakingContext::canBreakAtThisPosition): 2014-11-18 Myles C. Maxfield Multicolumn layout with negative line spacing and orphans causes pieces of letters to be shown at the bottom of columns https://bugs.webkit.org/show_bug.cgi?id=138204 Reviewed by Dave Hyatt. This code is responsible for pushing block elements to the next column if the "orphans" CSS property is triggered. The mechanism by which this is achieved is to push the block down such that the origin of the block is at the origin of the next column. However, if there is negative line spacing, the top portion of the text might actually be on top of the origin of the block. Therefore, the block wasn't being pushed down enough to entirely contain its text, so the top pieces were being drawn on the previous column. Test: fast/multicol/orphans-negative-line-spacing.html * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::adjustLinePositionForPagination): 2014-11-19 Philippe Normand Missing NULL-check in VideoTrack::setLanguage https://bugs.webkit.org/show_bug.cgi?id=138867 Reviewed by Jer Noble. * html/track/VideoTrack.cpp: (WebCore::VideoTrack::setLanguage): Prevent change event creation on an empty video track list. 2014-11-18 Philippe Normand start/stop method for AudioBufferSourceNodes and OscillatorNodes can take no args https://bugs.webkit.org/show_bug.cgi?id=138739 Reviewed by Darin Adler. The patch is inspired by the following Blink revision by : Test: webaudio/dom-exceptions.html * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::start): (WebCore::AudioBufferSourceNode::startPlaying): (WebCore::AudioBufferSourceNode::noteGrainOn): (WebCore::AudioBufferSourceNode::startGrain): Deleted. * Modules/webaudio/AudioBufferSourceNode.h: * Modules/webaudio/AudioBufferSourceNode.idl: * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::start): (WebCore::AudioScheduledSourceNode::stop): * Modules/webaudio/AudioScheduledSourceNode.h: * Modules/webaudio/OscillatorNode.idl: 2014-11-18 Philippe Normand HRTFDatabaseLoader is not an absolute condition to run audioContext https://bugs.webkit.org/show_bug.cgi?id=138829 Reviewed by Jer Noble. This patch is a port of the following Blink revision by : * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::AudioContext): (WebCore::AudioContext::isRunnable): Deleted. * Modules/webaudio/AudioContext.h: (WebCore::AudioContext::hrtfDatabaseLoader): Deleted. * Modules/webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::render): * Modules/webaudio/OfflineAudioDestinationNode.cpp: (WebCore::OfflineAudioDestinationNode::offlineRender): * Modules/webaudio/PannerNode.cpp: (WebCore::PannerNode::PannerNode): (WebCore::PannerNode::process): (WebCore::PannerNode::initialize): (WebCore::PannerNode::setPanningModel): * Modules/webaudio/PannerNode.h: * Modules/webaudio/RealtimeAnalyser.cpp: * Modules/webaudio/RealtimeAnalyser.h: * platform/audio/HRTFDatabaseLoader.cpp: (WebCore::HRTFDatabaseLoader::createAndLoadAsynchronouslyIfNecessary): 2014-11-18 Joanmarie Diggs AX: [ATK] Crash getting the orientation of a MenuListOption after the MenuList was removed from the document https://bugs.webkit.org/show_bug.cgi?id=138727 Reviewed by Chris Fleizach. AccessibilityMenuListOption::elementRect() returns the value of the grandparent MenuList, asserting that the grandparent exists with that role. But it is possible to have an existing MenuListOption and remove the element which had been backing that MenuList from the document. Adding null checks prior to the assertions prevents our crashing if the parent or grandparent was removed. Test: platform/gtk/accessibility/combobox-descendants-orientation-crash.html * accessibility/AccessibilityMenuListOption.cpp: (WebCore::AccessibilityMenuListOption::elementRect): 2014-11-16 Chris Dumez Assertion hit when setting a very large value to 'border-width' / 'font-size' CSS properties https://bugs.webkit.org/show_bug.cgi?id=138770 Reviewed by Darin Adler. When setting a very large value to a CSS property, it is represented internally as infinity. r166114 already tried to deal with this by adding an std::isinf() check in CSSValuePool::createValue() and returning an identifier CSSPrimitiveValue with CSSValueInvalid value in such case. The issue is that doing leads to the StyleBuilder getting a CSSValueInvalid CSSPrimitive value as input, which is not handled and leads to assertions. This patch updates the CSSParser to detect cases where the double value is infinity earlier (in CSSParser::validUnit() and parseSimpleLengthValue()), so that we mark the value as invalid and actually drop it. As a result, CSSPrimitiveValues with CSSValueInvalid value no longer make their way to the StyleBuilder. Test: fast/css/style-builder-infinite-value.html fast/css/infinite-floating-value.html * css/CSSParser.cpp: (WebCore::parseSimpleLengthValue): (WebCore::CSSParser::validUnit): * css/CSSValuePool.cpp: (WebCore::CSSValuePool::createValue): 2014-11-16 Shivakumar JM Attribute text in HTMLAnchorElement should behave as per specification. https://bugs.webkit.org/show_bug.cgi?id=138557 Reviewed by Darin Adler. attribute text in HTMLAnchorElement should not be readonly as per specification http://www.w3.org/TR/html/text-level-semantics.html#dom-a-text. It should behave as textContent attribute. Also This matches the behavior of Chrome 38 and FireFox. Test: fast/dom/HTMLAnchorElement/anchor-text-attribute.html * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::text): (WebCore::HTMLAnchorElement::setText): * html/HTMLAnchorElement.h: * html/HTMLAnchorElement.idl: 2014-11-16 Joanmarie Diggs AX: [ATK] REGRESSION(r166288): Accessible values are no longer accessible via AT-SPI2 https://bugs.webkit.org/show_bug.cgi?id=138776 Reviewed by Chris Fleizach. r166288 used #if...#else instead of #if...#endif, thus disabling the old AtkValue support. Unfortunately AT-SPI2 doesn't yet have support for the new AtkValue API. Thus r166288 broke access to value-holding elements for AT-SPI2 assistive technologies. Replacing #else with #endif fixes things. No new tests because catching this regression would require AT-SPI2. * accessibility/atk/WebKitAccessibleInterfaceValue.cpp: (webkitAccessibleValueGetMinimumIncrement): (webkitAccessibleValueInterfaceInit): 2014-11-11 David Hyatt Table rows repaint entire table when their background color changes. https://bugs.webkit.org/show_bug.cgi?id=26662 Reviewed by Simon Fraser. Added fast/repaint/table-row-repaint.html * rendering/RenderTableCell.h: * rendering/RenderTableRow.cpp: (WebCore::RenderTableRow::clippedOverflowRectForRepaint): Improve table row's function to unite with the cell rects that can possibly have the the row's background color painted behind them. 2014-11-14 Carlos Garcia Campos [SOUP] Use GMainLoopSource for request timeout in ResourceHandle https://bugs.webkit.org/show_bug.cgi?id=138695 Reviewed by Sergio Villar Senin. We are currently using soup_timeout_add() that simply creates a GSource and attaches it to the given context. Using GMainLoopSource we simplify the code and fix any potential problem of converting the double value into milliseconds. * platform/network/ResourceHandleInternal.h: * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::cleanupSoupRequestOperation): (WebCore::ResourceHandle::sendPendingRequest): (WebCore::ResourceHandle::platformSetDefersLoading): (WebCore::requestTimeoutCallback): Deleted. 2014-11-13 Dan Bernstein Policy client not called for navigations through the page cache https://bugs.webkit.org/show_bug.cgi?id=138703 Reviewed by Alexey Proskuryakov. Test added to TestWebKitAPI/Tests/WebKit2Cocoa/Navigation.mm. * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadDifferentDocumentItem): When using a cached page, which already has a document loader, set the document loader’s triggering action (so that the policy client sees that this is a back/forward navigation) and clear its last checked request (so that the policy client gets called). 2014-11-12 Jon Honeycutt REGRESSION (r172826): Password field placeholder text is missing if placeholder attribute precedes type attribute When the placeholder attribute is encountered, a shadow tree is created to include the placeholder element. When the type attribute is encountered, the previous shadow tree is destroyed, and a new shadow tree is created. TextFieldInputType::createShadowSubtree() did not handle creating the placeholder element. This regressed in r172826 because prior to r172826, the placeholder element would be recreated when HTMLTextFormControlElement::updatePlaceholderVisibility() was called. In r172826, updatePlaceholderVisibility() was changed to only show or hide the placeholder element if it exists. Reviewed by Benjamin Poulain. * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::createShadowSubtree): Call updatePlaceholderVisibility() to insert the placeholder element (after the inner text element has been inserted, as it appears before it in the shadow DOM). 2014-11-11 Daniel Bates [Frame Flattening] ASSERT(transaction->view == &view()) fails in RenderBlock::removeFromUpdateScrollInfoAfterLayoutTransaction() https://bugs.webkit.org/show_bug.cgi?id=138615 Reviewed by David Hyatt. Fixes an issue where we always expected that the RenderView associated with the RenderBlock called in RenderBlock::removeFromUpdateScrollInfoAfterLayoutTransaction() is the same as the RenderView associated with the top transaction in the UpdateScrollInfoAfterLayoutTransaction stack regardless of frame flattening. This expectation is only true when frame flattening is disabled. Test: fast/frames/flattening/iframe-flattening-inside-flexbox-with-delayed-scroll-update.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::removeFromUpdateScrollInfoAfterLayoutTransaction): 2014-11-10 Csaba Osztrogonác Crash in WebCore::Node::getFlag https://bugs.webkit.org/show_bug.cgi?id=137961 Reviewed by Antti Koivisto. * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::applyBlockStyle): Null pointer check added. 2014-11-10 Mihnea Ovidenie ASSERTION FAILED: !object || !object->parent()->isRuby() || is(*object) || (object->isInline() && (object->isBeforeContent() || object->isAfterContent())) || (object->isAnonymous() && ... ) in WebCore::isAnonymousRubyInlineBlock https://bugs.webkit.org/show_bug.cgi?id=137958 Reviewed by Chris Dumez. When a ruby element, with block behavior, dynamically changes its style from multicol to without multicol, we have to remove its special children, RenderMultiColumnFlowThread and RenderMultiColumnSet, the normal way using the method in RenderBlockFlow base class. This patch adds both RenderMultiColumnFlowThread and RenderMultiColumnSet to the list of RenderRuby children removed normally and adds a new function - isRubyChildForNormalRemove - to test the condition and use it in the assertion in RenderRuby*::removeChild method. Test: fast/multicol/newmulticol/ruby-from-multicol-to-auto.html * rendering/RenderRuby.cpp: (WebCore::isRubyChildForNormalRemove): (WebCore::RenderRubyAsInline::removeChild): (WebCore::RenderRubyAsBlock::removeChild): 2014-11-13 Joanmarie Diggs AX: [ATK] Do not return ATK_ROLE_UNKNOWN for null or otherwise invalid accessible objects https://bugs.webkit.org/show_bug.cgi?id=137867 Reviewed by Chris Fleizach. Return ATK_ROLE_INVALID for null or otherwise invalid accessible objects. Test: platform/gtk/accessibility/detached-object-role.html * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (webkitAccessibleGetRole): 2014-11-13 Joanmarie Diggs AX: [ATK] Accessible focus events are emitted when the selection is changed in non-focused combo boxes https://bugs.webkit.org/show_bug.cgi?id=137866 Reviewed by Mario Sanchez Prada. Check that the AccessibilityMenuList is really focused before notifying the platform that it is focused. Likewise, only notify the platform of an AccessibilityMenuListOption focus gain if the AccessibilityMenuList containing that option is expanded. Test: platform/gtk/accessibility/menu-list-unfocused-notifications.html * accessibility/atk/AXObjectCacheAtk.cpp: (WebCore::notifyChildrenSelectionChange): (WebCore::AXObjectCache::postPlatformNotification): 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-11-05 Shivakumar JM splitText API does not match DOM specification. https://bugs.webkit.org/show_bug.cgi?id=138405 Reviewed by Chris Dumez. Make the offset argument for splitText API as mandatory (and thus throw if it is omitted) and stop throwing if the offset argument is negative (and wraps to a valid index) as per specification: https://w3c.github.io/dom/#interface-text. Also This matches the behavior of both Firefox 33 and Chrome 38. Test: fast/dom/Text/splitText.html * dom/Text.idl: 2014-11-05 Chris Dumez Assertion hit DOMTimer::updateTimerIntervalIfNecessary() https://bugs.webkit.org/show_bug.cgi?id=138440 Reviewed by Geoffrey Garen. We sometimes hit the ASSERT(repeatInterval() == previousInterval) assertion in DOMTimer::updateTimerIntervalIfNecessary() when visiting the following pages: http://lifehacker.com/the-healthiest-foods-for-one-handed-snacking-while-gami-1654728164 http://longform.org/posts/like-something-the-lord-made After debugging, the issue turned out to be that we are comparing floating point numbers using ==, and the check sometimes fails even though the values really close to each other. This patch updates the DOMTimer code to use WTF::withinEpsilon() instead of operator==() to compare the floating point intervals. I confirmed manually that the assertion is no longer hit. * page/DOMTimer.cpp: (WebCore::DOMTimer::updateTimerIntervalIfNecessary): * platform/graphics/FloatQuad.cpp: (WebCore::FloatQuad::isRectilinear): (WebCore::withinEpsilon): Deleted. 2014-11-05 Chris Dumez Stop special-casing the empty string in HTMLInputElement.type setter https://bugs.webkit.org/show_bug.cgi?id=138403 Reviewed by Ryosuke Niwa. Stop special-casing the empty string in HTMLInputElement.type setter. Previously, if input.type is set to "", we would remove the type attribute. This is inconsistent with the specification and the behavior of other browsers (tested Firefox 33 and Chrome 38). Instead, we should set the attribute to the empty string. Also stop treating null as a null string to align with the specification and other browsers (tested Firefox 33 and Chrome 38). Finally, update HTMLInputElement::setType() to take an AtomicString in argument instead of a String as it ends up calling setAttribute(), and thus needing an AtomicString. Test: fast/dom/HTMLInputElement/input-type-attribute.html * html/FileInputType.cpp: (WebCore::UploadButtonElement::UploadButtonElement): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::setType): * html/HTMLInputElement.h: * html/HTMLInputElement.idl: 2014-11-04 Chris Dumez Avoid double hash table lookup in SpaceSplitStringData::create() https://bugs.webkit.org/show_bug.cgi?id=138396 Reviewed by Ryosuke Niwa. Avoid double hash table lookup in SpaceSplitStringData::create() by calling HashMap::add() and using the AddResult, instead of calling HashMap::get() then HashMap::add(). No new tests, no behavior change. * dom/SpaceSplitString.cpp: (WebCore::SpaceSplitStringData::create): 2014-11-04 Andreas Kling RenderBox shouldn't need a pre-destructor hook. Reviewed by Antti Koivisto. Move teardown logic from willBeDestroyed() to the regular ~RenderBox() destructor since none of it depends on being in-tree or having a fully constructed vtable. * rendering/RenderBox.cpp: (WebCore::RenderBox::~RenderBox): (WebCore::RenderBox::willBeDestroyed): Deleted. * rendering/RenderBox.h: 2014-11-04 Andreas Kling RenderQuote shouldn't need a pre-destructor hook. Reviewed by Antti Koivisto. The willBeDestroyed() hook in RenderQuote came from the time when it was potential unsafe to access the RenderView from a renderer destructor. Move the code to the plain ol' destructor instead. * rendering/RenderQuote.cpp: (WebCore::RenderQuote::~RenderQuote): (WebCore::RenderQuote::willBeDestroyed): Deleted. * rendering/RenderQuote.h: 2014-11-03 Philippe Normand [LEAK] [GStreamer] Removing video element will not free assigned memory https://bugs.webkit.org/show_bug.cgi?id=46560 Reviewed by Eric Carlson. Moved the ::extraMemoryCost() implementation to the MediaPlayerPivateInterface base class. This default implementation is now shared between the various MediaPlayerPrivate backends, excepted the AVF MediaSource player which still reports no extra memory cost. * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::totalBytes): Make totalBytes() part of the MediaPlayerPrivate interface. (WebCore::MediaPlayerPrivateInterface::extraMemoryCost): Default implementation. * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::extraMemoryCost): Deleted. * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: 2014-11-04 Nikos Andronikos Fix animation of orient attribute on marker element https://bugs.webkit.org/show_bug.cgi?id=137942 Reviewed by Dirk Schulze. Fixed implementation of SVG animated angles and the SVG marker element orient attribute. SVG animated angle was missing the logic to support animation from auto to a numeric angle value - this is now added. The SVG marker element getter for orientType was not returning the animated value for orientType so in some cases (i.e. when the initial value and the animated values were of different types) the animation was not being rendered - although it was running. Tests: svg/animations/animate-marker-orienttype-1.html svg/animations/animate-marker-orienttype-2.html svg/animations/animate-marker-orienttype-3.html * svg/SVGAnimatedAngle.cpp: (WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue): Added logic to support auto to angle animation. * svg/SVGMarkerElement.cpp: (WebCore::SVGMarkerElement::orientType): This method now returns the animated value if an animation is running. * svg/SVGMarkerElement.h: 2014-11-03 Andreas Kling RenderCounter shouldn't need a pre-destructor hook. Reviewed by Antti Koivisto. RenderCounter will automatically register/unregister itself with the RenderView when constructed/destroyed. It was using a willBeDestroyed() hook because it used to be that you couldn't get to the RenderView in the destructor. That's no longer an issue as Document promises that RenderView is the last render tree node to go away. * rendering/RenderCounter.cpp: (WebCore::RenderCounter::~RenderCounter): (WebCore::RenderCounter::willBeDestroyed): Deleted. * rendering/RenderCounter.h: 2014-11-03 Alexey Proskuryakov REGRESSION: Using a media element changes window.name https://bugs.webkit.org/show_bug.cgi?id=138278 rdar://problem/18704134 Apply the same fix to mediaControlsBase.js. I do not know who uses this file, but there is no reason to have the bug there. * Modules/mediacontrols/mediaControlsBase.js: (Controller.prototype.addVideoListeners): (Controller.prototype.removeVideoListeners): (Controller.prototype.disconnectControls): 2014-11-03 Andreas Kling RenderLayerModelObject shouldn't need a pre-destructor hook. Reviewed by Antti Koivisto. Move code from the willBeDestroyed() pre-destructor hook to the regular ~RenderLayerModelObject() destructor. We just need to unregister the renderer from the FrameView's set of viewport-constrained objects. That doesn't require being able to walk the render tree or call virtuals, which is the main reason you'd use willBeDestroyed(). * rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::~RenderLayerModelObject): (WebCore::RenderLayerModelObject::willBeDestroyed): Deleted. * rendering/RenderLayerModelObject.h: 2014-11-02 Chris Dumez Reduce the cost of argumentCount checks in the JS bindings https://bugs.webkit.org/show_bug.cgi?id=138289 Reviewed by Sam Weinig. Slightly reduce the cost of argumentCount checks in the JS bindings by hinting to the compiler that it is UNLIKELY that those methods are called with too few arguments. I see a 3% progression on PerformanceTests/DOM/DOMDivWalk.html performance test. No new tests, no behavior change. * bindings/scripts/CodeGeneratorJS.pm: (GenerateArgumentsCountCheck): 2014-10-31 Benjamin Poulain Pseudo classes with an escaped parenthesis generate invalid rules https://bugs.webkit.org/show_bug.cgi?id=138266 Reviewed by Antti Koivisto. Since the functional pseudo classes are part of the list of PseudoClassAndCompatibilityElement, they could be created by the rule pseudo: ':' IDENT if the parenthesis is escaped. For example, with ":not\\(", the IDENT would be "not(", CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector would find a pseudo class type of PseudoClassNot, and the action would create an invalid CSSSelector for a :not() without nested selector. This patch fixes the issue by detecting the function case in CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector(). An other solution would be to split PseudoClassAndCompatibilityElement into simple pseudo class and functional pseudo classes. We may do that some day but at the moment it is a lot of work with a little benefit. Tests: fast/css/crash-on-incomplete-webkit-any.html fast/css/pseudo-escaped-parenthesis.html fast/selectors/invalid-functional-pseudo-class.html * css/CSSParserValues.cpp: (WebCore::CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector): 2014-10-30 Simon Fraser Short-circuit repaints with empty rects https://bugs.webkit.org/show_bug.cgi?id=138234 Reviewed by Zalan Bujtas. Repaints with an empty rectangle are common enough that it's worth short-circuiting them. * rendering/RenderObject.cpp: (WebCore::RenderObject::repaintUsingContainer): 2014-10-24 Philippe Normand [GStreamer] Video resolution changes trigger a crash in the TextureMapper https://bugs.webkit.org/show_bug.cgi?id=137065 Reviewed by Gustavo Noronha Silva. Switch to GstSample for buffer+caps communication between the video sink and the player. Using a single object type for this avoid issues where the caps might not correctly describe the buffer contents anymore, for example when the video resolution is changed. * platform/graphics/gstreamer/ImageGStreamer.h: Use GstSample instead of GstBuffer+GstCaps. (WebCore::ImageGStreamer::createImage): * platform/graphics/gstreamer/ImageGStreamerCairo.cpp: Ditto. (ImageGStreamer::ImageGStreamer): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::mediaPlayerPrivateRepaintCallback): The repaint signal now uses a GstSample instead of a GstBuffer. (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase): Store the current sample instead of a buffer. Also renamed the mutex protecting access to the sample. (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): Ditto. (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize): Return early if no sample is available. The caps used to get the video size are store in the sample. (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Use GstSample instead of GstBuffer. (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint): Ditto. (WebCore::MediaPlayerPrivateGStreamerBase::paint): Ditto. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: Now store a GstSample internally. Also removed the now useless current-caps property. (_WebKitVideoSinkPrivate::_WebKitVideoSinkPrivate): Renamed the mutex protecting access to the sample. (_WebKitVideoSinkPrivate::~_WebKitVideoSinkPrivate): Ditto. (webkit_video_sink_init): Disable last-sample in basesink since we already store one in our sink anyway. (webkitVideoSinkTimeoutCallback): Switch to GstSample. (webkitVideoSinkRender): Ditto. (unlockSampleMutex): Ditto. (webkitVideoSinkUnlock): Ditto. (webkitVideoSinkUnlockStop): Ditto. (webkitVideoSinkStop): Ditto! (webkitVideoSinkStart): Ditto. (webkit_video_sink_class_init): Drop current-caps property. (webkitVideoSinkGetProperty): Deleted. (unlockBufferMutex): Deleted. 2014-10-29 Said Abou-Hallawa ASSERTION NOT REACHED because RenderStyle::setWordSpacing() does not handle a Length value of type 'Calculated'. https://bugs.webkit.org/show_bug.cgi?id=138054. Reviewed by Zalan Bujtas. A Length of type 'Calculated' can be generated from blending two lengths of different types. Setting the wordSpacing of the render style should be handled correctly when the type of the new value is 'Calculated'. Tests: css3/calculated-word-spacing.html. Add a case for setting the render style wordSpacing to a of type 'Calculated'. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::setWordSpacing): 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-10-24 Zalan Bujtas Replace INT_MIN/MAX / kFixedPointDenominator with intMin/MaxForLayoutUnit. https://bugs.webkit.org/show_bug.cgi?id=138047 Reviewed by Andreas Kling. No change in functionality. * css/CSSPrimitiveValue.cpp: 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-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-10-24 Jeffrey Pfau FrameProgressTracker expects Page to not have detached https://bugs.webkit.org/show_bug.cgi?id=138061 Reviewed by Alexey Proskuryakov. In some cases, a Page may be detached from a Frame before its FrameLoader is torn down, causing FrameProgressTracker's destructor to hit a null pointer. No new tests; it is impossible to reliably simulate the null pointer case without intrusive code changes. * loader/FrameLoader.cpp: (WebCore::FrameLoader::FrameProgressTracker::~FrameProgressTracker): 2014-10-27 Chris Fleizach AX: input type=hidden is being exposed when aria-hidden=false https://bugs.webkit.org/show_bug.cgi?id=138106 Reviewed by Benjamin Poulain. If an input type=hidden was inside an aria-hidden=false, it would appear because the lack of a RenderObject behind that object was not blocking its adoption into the AX tree. We should explicity check for whether the type is hidden and then return an appropriate role. Test: accessibility/input-type-hidden-in-aria-hidden-false.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::determineAccessibilityRole): (WebCore::AccessibilityNodeObject::computeAccessibilityIsIgnored): 2014-10-29 Chris Dumez Crash in CachedRawResource::canReuse() when reloading http://dnd.wizards.com/dungeons-and-dragons/story https://bugs.webkit.org/show_bug.cgi?id=138164 Reviewed by Andreas Kling. This patch fixes a crash when reloading the following URL: http://dnd.wizards.com/dungeons-and-dragons/story We were crashing in CachedRawResource::canReuse() because header.key would sometimes be a null String and we would call HashMap::get(nullString). The real issue was that header.key was null in the first place, which means that even though the HTTPHeaderMap iterator is valid, it->key is a null String, which should never happen. There was a bug in the HTTPHeaderMapConstIterator() constructor that would cause the iterator key/value pair to not get initialized if the HTTPHeaderMap contained *only* uncommon HTTP headers. This patch updates the constructor so that we fall back to updating the key/value from the uncommon header map, if we failed to initialized from the common header map (because it was empty). Test: http/tests/cache/xhr-uncommon-header.html * platform/network/HTTPHeaderMap.h: (WebCore::HTTPHeaderMap::HTTPHeaderMapConstIterator::HTTPHeaderMapConstIterator): 2014-10-27 Chris Dumez Use separate HashMaps for common and uncommon headers in HTTPHeaderMap https://bugs.webkit.org/show_bug.cgi?id=138079 Reviewed by Anders Carlsson. Use separate HashMaps for common and uncommon headers in HTTPHeaderMap: - a (faster) HashMap for common HTTP headers - a HashMap for uncommon ones This avoids having to construct Strings from HTTPHeaderMap values for storing. This also means we have less isolated String copies to do when creating cross-thread data. The common headers HashMap should also be a bit more efficient due to faster hashing and faster key comparison in case of collision. Some calls sites can also benefit from having direct access to common headers of the request in HTTPHeaderName type. This patch adds a new HTTPHeaderMapConstIterator iterator type for HTTPHeaderMap so that call sites that do not need / want to distinguish common / uncommon headers still do not need to. They can keep using modern C++ loops over HTTPHeaderMap objects and get key/value pairs. No new tests, no behavior change. * loader/CrossOriginAccessControl.cpp: (WebCore::isOnAccessControlSimpleRequestHeaderWhitelist): Have isOnAccessControlSimpleRequestHeaderWhitelist() take a HTTPHeaderName in argument instead of a String as only common headers are in the whitelist. (WebCore::isSimpleCrossOriginAccessRequest): Call isOnAccessControlSimpleRequestHeaderWhitelist() only for common HTTP headers. * loader/CrossOriginAccessControl.h: Have isOnAccessControlSimpleRequestHeaderWhitelist() take a HTTPHeaderName in argument instead of a String as only common headers are in the whitelist. * loader/CrossOriginPreflightResultCache.cpp: (WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginHeaders): Call isOnAccessControlSimpleRequestHeaderWhitelist() only for common HTTP headers. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::responseReceived): Call httpHeaderFields().commonHeaders().find() instead of httpHeaderFields().find() as we are looking for a common header. HTTPHeaderMap::find(HTTPHeaderName) was removed now that we have a HashMap dedicated to common headers. * loader/cache/CachedRawResource.cpp: (WebCore::shouldIgnoreHeaderForCacheReuse): Update argument type to be a HTTPHeaderName instead of a String as only common HTTP headers can be ignored for cache reuse. The implementation already dealt with HTTPHeaderName type and had to call findHTTPHeaderName(). This is no longer needed now that the call site now has direct access to common headers in HTTPHeaderName type. (WebCore::CachedRawResource::canReuse): - Only call shouldIgnoreHeaderForCacheReuse() for common HTTP headers. - Slightly optimize the second loop (the one over oldHeaderMap) to only check that the key is present in newHeaderMap, without actually comparing the String values. If the String values were different, the first loop would have seen it already and we would have returned early. 2014-10-27 Zan Dobersek Shrink MathMLOperatorDictionary::dictionary table https://bugs.webkit.org/show_bug.cgi?id=137914 Reviewed by Darin Adler. Improve packing of the Entry structure that's used for elements of the MathMLOperatorDictionary::dictionary table. This drops the size of the struct from 16 bytes to just 4 bytes, and shrinks the size of the dictionary table from rougly 16 kB down to 4 kB. * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::MathMLOperatorDictionary::ExtractKey): (WebCore::RenderMathMLOperator::setOperatorProperties): * rendering/mathml/RenderMathMLOperator.h: 2014-10-26 Benjamin Poulain Images with usemap should not have a link state https://bugs.webkit.org/show_bug.cgi?id=138071 Reviewed by Andreas Kling. Image tags were incorrectly getting a link state if a usemap is defined. The of the usemap is supposed to get the link state, but never the image. Unfortunately, the Accessibility code was relying on the wrong behavior to set the ImageMapRole, most of the patch is updating that code to get the correct role without the link state. Test: fast/selectors/images-with-usemap-should-not-match-link.html The accessibility code is covered by a few tests in accessibility/. The test accessibility/aria-used-on-image-maps.html ensure the elements also get the correct role. * dom/Node.h: (WebCore::Node::setIsLink): (WebCore::Node::clearIsLink): Deleted. Unused code. (WebCore::Node::isLink): Move with its setter for clarity. * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::parseAttribute): This is the bug. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::determineAccessibilityRole): Here the branches for the role ImageMap where behind isLink() which would never be valid after the fix. My fix here was to use the same definition previously set by HTMLImageElement::parseAttribute(), any usemap attribute qualifies the node for ImageMapRole. (WebCore::AccessibilityRenderObject::anchorElement): (WebCore::AccessibilityRenderObject::linkedUIElements): (WebCore::AccessibilityRenderObject::url): * accessibility/AccessibilityObject.h: (WebCore::AccessibilityObject::isAnchor): Deleted. Something funny I discovered is the Accessibility code worked around the bug by defining isAnchor() that exclude images from isLink(). Since isLink() will no longer be true for images, the hack can be removed. * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::anchorElement): (WebCore::AccessibilityNodeObject::isAnchor): Deleted. * accessibility/AccessibilityNodeObject.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]): 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 Myles C. Maxfield Carets in GMail and iCloud compositions are the foreground text color https://bugs.webkit.org/show_bug.cgi?id=138029 Reviewed by Simon Fraser. Previously, we were only checking whether the background colors of the foreground and background elements were the same, rather than taking validity and opacity into consideration. Test: editing/caret/color-span-inside-editable-background.html * editing/FrameSelection.cpp: (WebCore::disappearsIntoBackground): (WebCore::CaretBase::paintCaret): 2014-10-23 Krzysztof Czech AX: Do the early return when role is different than UnknownRole https://bugs.webkit.org/show_bug.cgi?id=137880 Reviewed by Chris Fleizach. We do not need to call ariaRoleAttribute() to check whether m_ariaRole is different than UnknownRole. Just check m_ariaRole instead. No new tests, no behavior change, just some cleanup * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::determineAccessibilityRole): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::determineAccessibilityRole): * accessibility/AccessibilityTableRow.cpp: (WebCore::AccessibilityTableRow::determineAccessibilityRole): 2014-10-23 Milan Crha RenderThemeGtk::mediaControlsScript() is not defined when VIDEO is disabled. . Reviewed by Carlos Garcia Campos. * rendering/RenderThemeGtk.cpp: 2014-10-22 Milan Crha Do not include GraphicsContext3D.h when 3D_GRAPHICS is not used. . Reviewed by Carlos Garcia Campos. * platform/graphics/cairo/GraphicsContext3DCairo.cpp: 2014-10-22 Milan Crha Do not build WidgetBackingStoreGtkX11 when not used. . Reviewed by Carlos Garcia Campos. * platform/gtk/WidgetBackingStoreGtkX11.cpp: * platform/gtk/WidgetBackingStoreGtkX11.h: 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-10-22 Shivakumar JM XMLHttpRequest should support attribute responseURL as per latest XHR spec. https://bugs.webkit.org/show_bug.cgi?id=136938 Reviewed by Alexey Proskuryakov. Tests: http/tests/xmlhttprequest/basic-auth-responseURL.html http/tests/xmlhttprequest/cross-origin-redirect-responseURL.html http/tests/xmlhttprequest/redirect-credentials-responseURL.html http/tests/xmlhttprequest/xmlhttprequest-responseURL.html XMLHttpRequest should support attribute responseURL * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::responseURL): * xml/XMLHttpRequest.h: * xml/XMLHttpRequest.idl: 2014-10-22 Tibor Meszaros Match spec for font-weight: bolder|lighter https://bugs.webkit.org/show_bug.cgi?id=137919 Reviewed by Andreas Kling. This patch is a merge of Blink's https://chromiumcodereview.appspot.com/15994009 Currently, bolder and lighter change font-weight in a non-compliant way. The spec (http://www.w3.org/TR/css3-fonts/#bolderlighter) defines exactly what the computed values should be given the inherited weight values, so we should match those. The removed FIXME's for selecting the next lightest/heaviest weight from the used font family seems to refer to behaviour from CSS1 (http://www.w3.org/TR/CSS1/#font-weight), while this is replaced with a simpler procedure for resolving bolder and lighter in font weights in CSS2 (http://www.w3.org/TR/CSS2/fonts.html#propdef-font-weight) and CSS3 (link above). and https://codereview.chromium.org/137813004 According to http://dev.w3.org/csswg/css-fonts/#font-weight-prop, the computed weight of 'lighter' and 'bolder' are based on the inherited 'font-weight', so set that inherited weight before calculating 'lighter' and 'bolder'. Tests: css3/font-weight-multiple-selectors.html css3/font-weight.html * css/DeprecatedStyleBuilder.cpp: (WebCore::ApplyPropertyFontWeight::applyValue): * platform/graphics/FontDescription.cpp: (WebCore::FontDescription::lighterWeight): (WebCore::FontDescription::bolderWeight): 2014-10-21 Joanmarie Diggs AX: [ATK] CSS-generated text content not exposed to assistive technologies https://bugs.webkit.org/show_bug.cgi?id=137669 Reviewed by Chris Fleizach. Do not use a text iterator to get the text for elements which include pseudo elements. Test: accessibility/css-content-attribute.html * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::textUnderElement): 2014-10-21 Zalan Bujtas REGRESSION: Google Search (mobile) video thumbnails are too large. https://bugs.webkit.org/show_bug.cgi?id=137895 Reviewed by Simon Fraser. This patch fixes layer clipping when an ancestor layer has border-radius clipping. In cases, where the current layer has non-radius cliprect, while an ancestor layer has border-radius clipping, we only use the border-radius rect to clip. Test: fast/clip/overflow-hidden-with-border-radius-overflow-clipping-parent.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::clipToRect): (WebCore::RenderLayer::restoreClip): (WebCore::RenderLayer::collectFragments): (WebCore::RenderLayer::calculateClipRects): * rendering/RenderLayer.h: (WebCore::ClipRect::ClipRect): (WebCore::ClipRect::effectedByRadius): (WebCore::ClipRect::setEffectedByRadius): (WebCore::ClipRect::operator==): (WebCore::ClipRect::operator!=): (WebCore::ClipRect::intersect): (WebCore::ClipRect::hasRadius): Deleted. (WebCore::ClipRect::setHasRadius): Deleted. 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-10-20 Youenn Fablet Tighten XMLHttpRequest setRequestHeader value check https://bugs.webkit.org/show_bug.cgi?id=128593 Reviewed by Darin Adler. Test: http/tests/xmlhttprequest/set-bad-headervalue.html * platform/network/HTTPParsers.cpp: (WebCore::isValidHTTPHeaderValue): Updated header values check according RFC 7230. (WebCore::isValidHTTPToken): Renamed variable name and updated RFC related comment. 2014-10-20 Roger Fong Use glFlush instead of glFinish when drawing WebGL output to screen. https://bugs.webkit.org/show_bug.cgi?id=137897. Reviewed by Brent Fulgham. Passes all conformance tests. Performance tested by http://threejs.org/examples/#webgl_performance and Unity WebGL performance tests. * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: (WebCore::GraphicsContext3D::prepareTexture): Use glFlush instead of glFinish. glFinish is a blocking operation pushed out queued up WebGL operations and then waits until every operation has completed before returning and every pixel has been updated. This causes severe performance problems, about a 10 fps difference on http://threejs.org/examples/#webgl_performance. glFlush, like glFinish, forces all queued WebGL operations to take place, but returns immediately. Switching to glFlush does not seem make our rendering quality any worse for the handful of sites I've tested and makes our performance on WebGL much better. However, we should continue to be on the watch for any potential rendering issues after this lands. 2014-10-19 Roger Fong Unreviewed. Style fix following r174855. * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp: (WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary): 2014-10-16 Roger Fong Calling glReadPixels with BGRA format on an NVIDIA machine with an opaque context returns the wrong alpha values. https://bugs.webkit.org/show_bug.cgi?id=137793. Reviewed by Dean Jackson. This fixes conformance test context/context-attribute-preserve-drawing-buffer.html. * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp: (WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary): On an NVIDIA machine, when the context has alpha turned off, call glReadPixels with RGBA format and then convert to RGBA. 2014-10-16 Adrien Destugues Missing RefPtr.release() calls in TextureMapper https://bugs.webkit.org/show_bug.cgi?id=137777 Reviewed by Chris Dumez. No new tests: no functional change, cleanup/optimization. Avoids useless ref/deref cycle when returning from functions. * platform/graphics/texmap/TextureMapper.cpp: (WebCore::TextureMapper::acquireTextureFromPool): * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::paintIntoSurface): 2014-10-15 Andrei Bucur ASSERTION FAILED in WebCore::RenderFlowThread::getRegionRangeForBox https://bugs.webkit.org/show_bug.cgi?id=135563 Reviewed by David Hyatt. The new multi-column code doesn't work correctly when the document contains nested fragmentation contexts. The problem is the current flow thread concept that can store only one RenderFlowThread at a time and use it during layout. The stored flow thread is always correct for regions because named flow threads are absolutley positioned so every child renderer is contained inside them (with the expcetion of fixed positioned elements which are treated separately). For multi-column elements this is no longer the case. An absolutely positioned element inside a static multi-column element will be contained by a block outside the fragmentation context. It can even be contained by a different multi-column element in the case of nested flow threads. The patch below explores a solution that's not based on a current flow thread stored globally. The proposed patch makes every block to store a pointer to its fragmentation context and a flag that states if this pointer needs to be updated or not. If the renderer is not a block it will get its flow thread from the containing block. Once the containing flow thread is requested for the block, the pointer is computed and cached until invalidated: - when a subtree is removed from a flow thread - when the position property of an element inside a flow thread changes The process is recursive and it doesn't affect elements that are not nested inside a flow thread. If a block changes position from relative to static, any element that was contained by it can only be contained by an ancestor of the block. This ancestor will still be outside of any flow thread. This ensures that non-fragmentation code is not affected from a performance perspective. The patch affects the results of the performance tests: - the regions layout tests have a decreased performance raging from 2% to 5-6% - the regions selection tests have an increased performance raging from 1-2% to 10% - the multicolumn layout tests (now pending review in b137687) have an increased performance raging from 1.8% to 5% Tests: fast/multicol/multicol-all-positioned-crash.html fast/multicol/multicol-transform-containing-block.html * rendering/FlowThreadController.cpp: (WebCore::FlowThreadController::FlowThreadController): * rendering/FlowThreadController.h: (WebCore::FlowThreadController::currentRenderFlowThread): Deleted. (WebCore::FlowThreadController::setCurrentRenderFlowThread): Deleted. * rendering/LayoutState.h: (WebCore::LayoutState::currentRenderFlowThread): (WebCore::LayoutState::setCurrentRenderFlowThread): * rendering/RenderBlock.cpp: (WebCore::RenderBlockRareData::RenderBlockRareData): (WebCore::RenderBlock::styleWillChange): (WebCore::RenderBlock::styleDidChange): (WebCore::RenderBlock::collapseAnonymousBoxChild): (WebCore::RenderBlock::cachedFlowThreadContainingBlock): (WebCore::RenderBlock::cachedFlowThreadContainingBlockNeedsUpdate): (WebCore::RenderBlock::setCachedFlowThreadContainingBlockNeedsUpdate): (WebCore::RenderBlock::updateCachedFlowThreadContainingBlock): (WebCore::RenderBlock::locateFlowThreadContainingBlock): * rendering/RenderBlock.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::styleWillChange): * rendering/RenderBox.cpp: (WebCore::RenderBox::borderBoxRectInRegion): * rendering/RenderFlowThread.cpp: (WebCore::RenderFlowThread::layout): (WebCore::RenderFlowThread::updateAllLayerToRegionMappings): (WebCore::RenderFlowThread::repaintRectangleInRegions): (WebCore::CurrentRenderFlowThreadMaintainer::CurrentRenderFlowThreadMaintainer): Deleted. (WebCore::CurrentRenderFlowThreadMaintainer::~CurrentRenderFlowThreadMaintainer): Deleted. (WebCore::CurrentRenderFlowThreadDisabler::CurrentRenderFlowThreadDisabler): Deleted. (WebCore::CurrentRenderFlowThreadDisabler::~CurrentRenderFlowThreadDisabler): Deleted. * rendering/RenderFlowThread.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintLayer): (WebCore::RenderLayer::hitTestLayer): (WebCore::RenderLayer::mapLayerClipRectsToFragmentationLayer): (WebCore::RenderLayer::calculateClipRects): * rendering/RenderObject.cpp: (WebCore::RenderObject::showRegionsInformation): (WebCore::RenderObject::insertedIntoTree): (WebCore::RenderObject::removeFromRenderFlowThread): (WebCore::RenderObject::removeFromRenderFlowThreadIncludingDescendants): (WebCore::RenderObject::invalidateFlowThreadContainingBlockIncludingDescendants): (WebCore::RenderObject::currentRenderNamedFlowFragment): (WebCore::RenderObject::locateFlowThreadContainingBlock): (WebCore::RenderObject::locateFlowThreadContainingBlockNoCache): Deleted. (WebCore::RenderObject::removeFromRenderFlowThreadRecursive): Deleted. * rendering/RenderObject.h: (WebCore::RenderObject::flowThreadContainingBlock): * rendering/RenderRegion.cpp: (WebCore::RenderRegion::computeOverflowFromFlowThread): * rendering/RenderView.cpp: (WebCore::RenderView::pushLayoutStateForCurrentFlowThread): (WebCore::RenderView::popLayoutStateForCurrentFlowThread): * rendering/RenderView.h: 2014-10-14 Dean Jackson Crash in WebCore::UserGestureIndicator::processingUserGesture with WebWorkers https://bugs.webkit.org/show_bug.cgi?id=137676 Reviewed by Alexey Proskuryakov. Remove the code I added that tracks the timestamp of the most recent user gesture from the event handling dispatch, as it was both a silly place to do it and it originally crashed when events were fired from Worker threads (although this was fixed in r152238). It's now recorded by going through UserGestureIndicator, which is good because it knows when a user has triggered an event. Its constructor now takes a pointer to Document, and updates the timestamp there if necessary. Not all UserGestureIndicator instances needed to reset the timestamp; Those did not have to pass along the Document. This is untestable due to the fix mentioned above. * WebCore.exp.in: Change constructor signature. * accessibility/AccessibilityNodeObject.cpp: Pass a pointer to the Document into the UserGestureIndicator. (WebCore::AccessibilityNodeObject::increment): (WebCore::AccessibilityNodeObject::decrement): * accessibility/AccessibilityObject.cpp: Ditto. (WebCore::AccessibilityObject::press): * dom/Document.cpp: (WebCore::Document::updateLastHandledUserGestureTimestamp): Renamed. * dom/Document.h: * dom/EventTarget.cpp: Remove the code to update the timestamp. (WebCore::EventTarget::fireEventListeners): * dom/UserGestureIndicator.cpp: (WebCore::UserGestureIndicator::UserGestureIndicator): If there is a Document and this is a user gesture, then reset the timestamp. * dom/UserGestureIndicator.h: * page/EventHandler.cpp: Pass a pointer to the Document. (WebCore::EventHandler::handleMousePressEvent): (WebCore::EventHandler::handleMouseDoubleClickEvent): (WebCore::EventHandler::handleMouseReleaseEvent): (WebCore::EventHandler::keyEvent): (WebCore::EventHandler::handleTouchEvent): * rendering/HitTestResult.cpp: Ditto. (WebCore::HitTestResult::toggleMediaFullscreenState): (WebCore::HitTestResult::enterFullscreenForVideo): 2014-10-14 Alejandro G. Castro Changes in the stretchy attribute do not update rendering https://bugs.webkit.org/show_bug.cgi?id=136883 Reviewed by Darin Adler. Test: mathml/presentation/mo-stretch-update.html We need to relayout when a change in the stretchy attribute happens. * mathml/MathMLTextElement.cpp: (WebCore::MathMLTextElement::parseAttribute): Parse the modifications of the stretchy attribute. * mathml/MathMLTextElement.h: * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::setOperatorFlagAndScheduleLayoutIfNeeded): Add function that receives the value instead of looking for it and checks if the change should schedule a layout. (WebCore::RenderMathMLOperator::setOperatorFlagFromAttribute): (WebCore::RenderMathMLOperator::setOperatorFlagFromAttributeValue): Add function that receives the value instead of looking for it. * rendering/mathml/RenderMathMLOperator.h: 2014-10-12 Mike West Referrer Policy: Update values to match the spec https://bugs.webkit.org/show_bug.cgi?id=137635 Reviewed by Jochen Eisinger. The Referrer Policy specification ([Working Draft][WD], [Editor's draft[ED]) defines different keywords than we originally implemented. We should support them in the interests of clarity and interoperability with other browsers implementing the specification. [WD]: http://www.w3.org/TR/referrer-policy/#referrer-policy-delivery-meta [ED]: http://w3c.github.io/webappsec/specs/referrer-policy/#referrer-policy-delivery-meta This patch is a port of Blink's https://codereview.chromium.org/607433002/ Tests: http/tests/security/referrer-policy-conflicting-policies.html http/tests/security/referrer-policy-https-no-referrer-when-downgrade.html http/tests/security/referrer-policy-https-no-referrer.html http/tests/security/referrer-policy-https-unsafe-url.html http/tests/security/referrer-policy-no-referrer-when-downgrade.html http/tests/security/referrer-policy-no-referrer.html * dom/Document.cpp: (WebCore::Document::processReferrerPolicy): 2014-10-09 Said Abou-Hallawa RenderMathMLUnderOver adds spacing to the child operator indefinitely when resizing the window. https://bugs.webkit.org/show_bug.cgi?id=137330 Reviewed by Darin Adler. The layout for the math object happens in two separate passes. The first pass runs the layout for the two children and then calculates the maximum child width. It then sets the stretch size for the math operator child. And finally it runs the second layout pass by calling the base class layout() function. The base class function then runs the layout for the children rendering blocks. In the operator child function computePreferredLogicalWidths(), the stretch size is used to adjust the width (or the height) of the operator. Then it adds the leading and trailing spaces and the total will be the operator child width. When resizing or zooming the window, the render objects are just invalidated but marked as 'needs- Layout'. The problem is happening because the stretch size of the math operator is not reset before running the layout. The old logical width (or height) of the the math operator child which is equal to the stretch size plus the leading and trailing spaces for is compared with the glyph size if the old logical width ( or height) is larger, it is set to be the stretch size. When it is used again because of invalidation, new leading and trailing spaces are included in the new logical width. So with every zooming-in or out or window resizing, new leading and trailing spaces are added to the logical width of the math operator child or the math object. Ensure the stretch size of the math operator render object is reset before running its layout. Running the layout means either the page is just loaded or it's invalidated which means, no layout stall data should be used. Test: mathml/opentype/munderover-window-resize.html * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::resetStretchSize): * rendering/mathml/RenderMathMLOperator.h: resetStretchSize() sets the stretch size to its original value when the class is created. * rendering/mathml/RenderMathMLUnderOver.cpp: (WebCore::RenderMathMLUnderOver::layout): Make sure the operator stretch size is reset before calling its layout. Also make sure the new maximum stretch size to the operator objects that were invalid and needsLayout. 2014-09-22 Simon Fraser Move nodeFromPoint() back to Document where it belongs https://bugs.webkit.org/show_bug.cgi?id=137012 Reviewed by Zalan Bujtas. nodeFromPoint() was moved into TreeScope for ShadowDOM work, but now we can move it back to its logical place. Make versions of elementFromPoint and caretRangeFromPoint that take LayoutPoints, and change the current scale/offset code to be in layout units (which results in a small behavior change). elementFromPoint(int, int) and caretRangeFromPoint(int, int) are still required for bindings code. * dom/Document.cpp: (WebCore::Document::nodeFromPoint): (WebCore::Document::elementFromPoint): (WebCore::Document::caretRangeFromPoint): * dom/Document.h: (WebCore::Document::elementFromPoint): Move logic from TreeScope::elementFromPoint() here. * dom/TreeScope.cpp: (WebCore::nodeFromPoint): Deleted. (WebCore::TreeScope::elementFromPoint): Deleted. * dom/TreeScope.h: 2014-09-19 Chris Dumez Allow DOM methods to return references instead of pointers https://bugs.webkit.org/show_bug.cgi?id=136931 Reviewed by Sam Weinig. It is common practice in WebKit to have methods return a reference instead of a pointer if the pointer can never be null. However, this unfortunately did not work for DOM methods (functions called by JS bindings). This prevented further refactoring. This patch brings support for having DOM methods to return references instead of pointers when the pointer cannot be null. The generated bindings were calling WTF::getPtr() on the pointer type returned by the implementation already (in case it was a smart pointer type). This patch leverages this by having WTF::getPtr() convert reference arguments into raw pointers. This patch also updates a few DOM methods on Document and Element classes to return a reference instead of a pointer, to test the change. There are likely more DOM methods that can be updated though. No new tests, no behavior change. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::classList): * bindings/js/JSDOMBinding.h: (WTF::getPtr): Deleted. * dom/Document.cpp: (WebCore::Document::implementation): (WebCore::Document::webkitGetNamedFlows): (WebCore::Document::namedFlows): (WebCore::Document::setXMLVersion): (WebCore::Document::setXMLStandalone): (WebCore::Document::securityPolicy): (WebCore::Document::styleSheets): * dom/Document.h: (WebCore::Document::timing): * dom/Element.cpp: (WebCore::Element::classList): (WebCore::Element::dataset): * dom/Element.h: * html/shadow/MediaControlElements.cpp: (WebCore::MediaControlPanelElement::setPosition): (WebCore::MediaControlPanelElement::resetPosition): (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay): * html/track/VTTRegion.cpp: (WebCore::VTTRegion::displayLastTextTrackCueBox): (WebCore::VTTRegion::willRemoveTextTrackCueBox): * inspector/InspectorCSSAgent.cpp: (WebCore::InspectorCSSAgent::getAllStyleSheets): (WebCore::InspectorCSSAgent::getNamedFlowCollection): * page/PerformanceTiming.cpp: (WebCore::PerformanceTiming::documentTiming): * rendering/FlowThreadController.cpp: (WebCore::FlowThreadController::ensureRenderFlowThreadWithName): 2014-10-17 Chris Dumez Avoid unnecessary isSVGFont() check in SimpleFontData::applyTransforms() https://bugs.webkit.org/show_bug.cgi?id=137836 Reviewed by Andreas Kling. Avoid unnecessary isSVGFont() check in SimpleFontData::applyTransforms(). This function is only called from WidthIterator::applyFontTransforms(), which already makes sure to call applyTransforms() if isSVGFont() returns false. This patch replaces the check with a simple assertion. No new tests, no behavior change. * platform/graphics/SimpleFontData.h: * svg/SVGFontData.h: 2014-10-16 Alexey Proskuryakov REGRESSION (r169024): Undetermined text is not displayed in the search field of Adobe Help Website https://bugs.webkit.org/show_bug.cgi?id=137679 rdar://problem/18450335 Reviewed by Enrica Casucci. Test: platform/mac/editing/input/selected-composed-text-painting.html * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): We do not paint selection beckground for unconfirmed text with underlines, so we should use a regular style for text painting, as well. 2014-10-14 Jer Noble REGRESSION (r159208): Crash when clicking scrubber after navigating away/back to video https://bugs.webkit.org/show_bug.cgi?id=137715 Reviewed by Darin Adler. Simple null-check of m_player in refreshCachedTime. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::refreshCachedTime): 2014-10-14 Zalan Bujtas REGRESSION (Safari 7.1/8.0): Border-radius and overflow hidden renders incorrectly. https://bugs.webkit.org/show_bug.cgi?id=137205 Reviewed by Simon Fraser. Child layer should not reset radius clipping behaviour. Test: fast/layers/parent-clipping-overflow-is-overwritten-by-child-clipping.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects): 2014-10-14 Dan Bernstein URLs that start with http:/// and https:/// lose two slashes when parsed, causing assertion failure and inconsistent behavior https://bugs.webkit.org/show_bug.cgi?id=137718 Reviewed by Alexey Proskuryakov. Added cases to fast/loader/url-parse-1.html. * platform/URL.cpp: (WebCore::URL::parse): In hierarchical schemes other than file:, ignore any additional slashes after the ://, as prescribed by the authority-ignore-slashes state in the current URL spec. 2014-10-16 Chris Dumez Leverage the new RenderElement::m_isCSSAnimating flag in more places https://bugs.webkit.org/show_bug.cgi?id=137786 Reviewed by Simon Fraser. Leverage the new RenderElement::m_isCSSAnimating flag that was introduced in r174703 in more places, for performance. This avoids doing extra work for renderers on which we are not running animations on. This patch also updates the API a bit to use more references instead of pointers, making it clear the RenderElement cannot be null and thus avoiding unnecessary null checks. No new tests, no behavior change. * css/CSSComputedStyleDeclaration.cpp: (WebCore::computeRenderStyleForProperty): * page/animation/AnimationController.cpp: (WebCore::AnimationControllerPrivate::ensureCompositeAnimation): (WebCore::AnimationControllerPrivate::clear): (WebCore::AnimationControllerPrivate::updateAnimationTimerForRenderer): (WebCore::AnimationControllerPrivate::isRunningAnimationOnRenderer): (WebCore::AnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer): (WebCore::AnimationControllerPrivate::pauseAnimationAtTime): (WebCore::AnimationControllerPrivate::pauseTransitionAtTime): (WebCore::AnimationControllerPrivate::getAnimatedStyleForRenderer): (WebCore::AnimationController::cancelAnimations): (WebCore::AnimationController::updateAnimations): (WebCore::AnimationController::getAnimatedStyleForRenderer): (WebCore::AnimationController::notifyAnimationStarted): (WebCore::AnimationController::isRunningAnimationOnRenderer): (WebCore::AnimationController::isRunningAcceleratedAnimationOnRenderer): * page/animation/AnimationController.h: * page/animation/AnimationControllerPrivate.h: * rendering/RenderElement.cpp: (WebCore::RenderElement::willBeDestroyed): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::currentTransform): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateGeometry): (WebCore::RenderLayerBacking::notifyAnimationStarted): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::requiresCompositingForAnimation): (WebCore::RenderLayerCompositor::isRunningAcceleratedTransformAnimation): 2014-10-14 Chris Dumez Introduce an isCSSAnimated flag on RenderElement for performance https://bugs.webkit.org/show_bug.cgi?id=137583 Reviewed by Simon Fraser. I noticed when profiling the ebay.com page load that isRunningAnimationOnRenderer() and isRunningAcceleratedAnimationOnRenderer() were called frequently, causing ~4.7 millions m_compositeAnimations HashMap lookups. This patch introduces an isCSSAnimated flag on RenderElement to return early if there is no animation on the renderer, thus avoiding HashMap lookups. This reduces the number of HashMap lookups from ~4.7 millions to ~68k. On my machine, I see the following performance improvements: - isRunning*AnimationOnRenderer() / computeCompositingRequirements() - before: ~45ms / ~90ms - after: ~4ms / ~30ms No new tests, no behavior change. * page/animation/AnimationController.cpp: (WebCore::AnimationControllerPrivate::ensureCompositeAnimation): (WebCore::AnimationControllerPrivate::clear): (WebCore::AnimationControllerPrivate::isRunningAnimationOnRenderer): (WebCore::AnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer): (WebCore::AnimationController::isRunningAnimationOnRenderer): (WebCore::AnimationController::isRunningAcceleratedAnimationOnRenderer): * rendering/RenderElement.cpp: (WebCore::RenderElement::RenderElement): * rendering/RenderElement.h: (WebCore::RenderElement::isCSSAnimating): (WebCore::RenderElement::setIsCSSAnimating): 2014-10-14 Youenn Fablet [XHR] Abort method execution when m_loader->cancel() in internalAbort() caused reentry https://bugs.webkit.org/show_bug.cgi?id=126975 Reviewed by Alexey Proskuryakov. Merging https://chromium.googlesource.com/chromium/blink/+/0d75daf2053631518606ae15daaece701a25b2c4 Ensuring new test from https://codereview.chromium.org/76133002/ is passing. Test: http/tests/xmlhttprequest/reentrant-cancel-abort.html * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::open): exit early if internalAbort asks so (WebCore::XMLHttpRequest::abort): exit early if internalAbort asks so (WebCore::XMLHttpRequest::internalAbort): ask calling function to exit early if a new loader is created during the cancellation of the loader (potential reentrant case through window.onload callback) (WebCore::XMLHttpRequest::didTimeout): exit early if internalAbort asks so * xml/XMLHttpRequest.h: 2014-10-09 Simon Fraser Revert part of r174543 that broke grid layout tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::specifiedValueForGridTrackBreadth): 2014-10-09 Dean Jackson Computed style for clip is wrong with respect to auto https://bugs.webkit.org/show_bug.cgi?id=137567 Reviewed by Simon Fraser. Make sure that the computed style of clip returns the correct value when the input is "auto", or in this case "rect(auto, auto, auto, auto)". Before this patch it returned "rect(0px, 0px, 0px, 0px)" which was completely wrong. Test: fast/css/computed-clip-with-auto-rect.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::autoOrZoomAdjustedValue): Helper function to make the correct keyword or length. (WebCore::specifiedValueForGridTrackBreadth): It can use the helper too. (WebCore::ComputedStyleExtractor::propertyValue): If the top/right/bottom/left is "auto", add that identifier to the output rectangle. 2014-10-09 Bear Travis [CSS Font Loading] Decrement the font loading count before notifying callbacks https://bugs.webkit.org/show_bug.cgi?id=137401 Reviewed by Alexey Proskuryakov. In the callbacks, it should appear that font load has completed. This is accessed through loading(), which relies on the current number of fonts loading via JS and CSS. Unskipping the failing test http/tests/webfont/fontloader-loading-attribute.html test which tests this. * css/FontLoader.cpp: (WebCore::LoadFontCallback::notifyLoaded): 2014-10-08 Myles C. Maxfield Text drawn with an SVG font has no spaces when word-rounding hacks are enabled https://bugs.webkit.org/show_bug.cgi?id=137463 Reviewed by Darin Adler. When rounding hacks are enabled, we use the "adjusted space width" instead of the regular space width. However, the SVG-font-specific implementation of the SimpleFontData constructor doesn't initialize this value, so it was getting set to an undefined value (which happened to be close to 0 in my tests). Test: svg/text/svg-font-word-rounding-hacks-spaces.html * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::getFontData): (WebCore::CSSFontFaceSource::ensureFontData): * loader/cache/CachedFont.cpp: (WebCore::CachedFont::ensureCustomFontData): (WebCore::CachedFont::getSVGFontById): * platform/graphics/SimpleFontData.h: * svg/SVGFontData.cpp: (WebCore::SVGFontData::initializeFontData): 2014-10-08 Darin Adler ASSERTION FAILED: underlyingStringIsValid() https://bugs.webkit.org/show_bug.cgi?id=137502 Reviewed by Anders Carlsson. * rendering/RenderTreeAsText.cpp: (WebCore::quoteAndEscapeNonPrintables): Take a StringView instead of a String. (WebCore::writeTextRun): Ditto. (WebCore::writeSimpleLine): Ditto. * rendering/RenderTreeAsText.h: Removed unneeded include, tweaked formatting, changed quoteAndEscapeNonPrintables to take a StringView. * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::paintFlow): Tighten code using a modern for loop. (WebCore::SimpleLineLayout::showLineLayoutForFlow): Update to work with a StringView result for SimpleLineLayout::RunResolver::Run::text. * rendering/SimpleLineLayoutResolver.h: (WebCore::SimpleLineLayout::RunResolver::Run::text): Changed return type to StringView to fix the lifetime bug and also to improve performance by getting rid of the need to allocate and destroy a StringImpl object. 2014-10-07 Martin Hock Defer resolution of viewport size. https://bugs.webkit.org/show_bug.cgi?id=137376 rdar://problem/18558094 Reviewed by Benjamin Poulain. ViewportConfiguration should resolve the viewport size on configuration update. * dom/Document.cpp: (WebCore::Document::processViewport): Defer resolution of viewport size. * dom/ViewportArguments.cpp: (WebCore::finalizeViewportArguments): Deleted. * dom/ViewportArguments.h: * page/ViewportConfiguration.cpp: (WebCore::ViewportConfiguration::updateConfiguration): Resolve viewport size. (WebCore::ViewportConfiguration::viewportArgumentsLength): Resolves width or height based on viewport arguments. * page/ViewportConfiguration.h: 2014-10-06 David Hyatt REGRESSION (Simple Line Layout): Inline block baselines computed incorrectly https://bugs.webkit.org/show_bug.cgi?id=137461 Reviewed by Simon Fraser. Added fast/inline-block/simple-line-layout.html * rendering/SimpleLineLayoutFunctions.h: (WebCore::SimpleLineLayout::computeFlowFirstLineBaseline): (WebCore::SimpleLineLayout::computeFlowLastLineBaseline): Fix the baseline computation functions in simple line layout to use lineCount rather than runCount. 2014-10-06 Chris Fleizach AX: Performance: Certain Web site causes Safari to hang completely while entering form data https://bugs.webkit.org/show_bug.cgi?id=137420 Reviewed by Mario Sanchez Prada. If a website has multiple nested tables that are not "accessibility" tables, the performance of accessibility slows to a crawl because: 1) We are re-computing accessibilityIsIgnored many times. As a solution, we can enable the isIgnoredCache when updating children. 2) When asking if an object isTableCell, we'd go up the parent chain, asking each of those parents the same question, which exploded into calling this many times. As a solution, I've changed our determination of isTableCell to instead check if the parent is an accessibiltyTable which should be much faster. No new functionality. Existing tests cover changes. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::updateChildrenIfNecessary): (WebCore::AccessibilityObject::accessibilityIsIgnored): * accessibility/AccessibilityTableCell.cpp: (WebCore::AccessibilityTableCell::parentTable): (WebCore::AccessibilityTableCell::isTableCell): 2014-10-19 Carlos Garcia Campos [GTK] Move GtkDragAndDropHelper from Platform to WebKit2 https://bugs.webkit.org/show_bug.cgi?id=137422 Reviewed by Martin Robinson. Remove ClipboardUtilitiesGtk and GtkDragAndDropHelper. * PlatformGTK.cmake: * platform/gtk/ClipboardUtilitiesGtk.cpp: Removed. * platform/gtk/ClipboardUtilitiesGtk.h: Removed. * platform/gtk/GtkDragAndDropHelper.cpp: Removed. * platform/gtk/GtkDragAndDropHelper.h: Removed. 2014-10-05 Lorenzo Tilve [GTK] Fix build when DRAG_SUPPORT is disabled https://bugs.webkit.org/show_bug.cgi?id=137361 Reviewed by Carlos Garcia Campos. Flag out unbuildable code without DRAG_SUPPORT. * platform/gtk/GtkDragAndDropHelper.cpp: * platform/gtk/GtkDragAndDropHelper.h: 2014-10-03 Tim Horton WKWebView snapshot of Daring Fireball has the wrong color in the obscured inset https://bugs.webkit.org/show_bug.cgi?id=137383 Reviewed by Sam Weinig. * rendering/RenderView.cpp: (WebCore::RenderView::paintBoxDecorations): Use documentBackgroundColor instead of baseBackgroundColor if backgroundShouldExtendBeyondPage is set. 2014-10-03 Bear Travis REGRESSION (r173531): Use after free in WebCore::RenderStyle::fontMetrics / WebCore::CSSPrimitiveValue::computeLengthDouble https://bugs.webkit.org/show_bug.cgi?id=136864 Reviewed by Andreas Kling. FontLoader previously called updateDocumentStyleIfNeeded, which would reset styles currently in use as part of the tabIndex calculation. The FontLoader should instead wait for pending stylesheets to load. Tests: fast/css/fontloader-tab-index.html * css/FontLoader.cpp: (WebCore::FontLoader::notifyWhenFontsReady): Do not immediately call loadingDone(). (WebCore::FontLoader::loadingDone): Wait for stylesheets to finish loading rather than updating document styles. * css/FontLoader.h: (WebCore::FontLoader::loading): Include JS font loads when testing for the loading state. 2014-10-02 Chris Dumez XMLHttpRequestProgressEventThrottle shouldn't throttle / defer progress events if there are no listeners https://bugs.webkit.org/show_bug.cgi?id=137346 Reviewed by Alexey Proskuryakov. Previously XMLHttpRequestProgressEventThrottle would throttle / defer progress events, which involves queueing events and starting timers, even if there were no listeners for those events (which is fairly common case). This patch updates XMLHttpRequestProgressEventThrottle to make sure there are actual progress event listeners *before* attempting to throttle and do extra processing, to avoid doing unnecessary work. This patch also makes XMLHttpRequestProgressEventThrottle::dispatchEvent() private as this method is only called from other dispatch methods of the class and never from the outside. No new tests, no behavior change. * xml/XMLHttpRequestProgressEventThrottle.cpp: (WebCore::XMLHttpRequestProgressEventThrottle::dispatchThrottledProgressEvent): (WebCore::XMLHttpRequestProgressEventThrottle::dispatchProgressEvent): 2014-10-02 Krzysztof Czech AX: Default orientation for aria scrollbars should be vertical https://bugs.webkit.org/show_bug.cgi?id=137341 Reviewed by Chris Fleizach. Default orientation for aria scrollbars regarding w3c spec should be vertical No new tests, covering by existing one. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::orientation): 2014-10-02 Eva Balazsfalvi Fix minimal build warnings https://bugs.webkit.org/show_bug.cgi?id=137066 Reviewed by Daniel Bates. No new tests, no behavior change. * css/CSSParser.cpp: (WebCore::isValidKeywordPropertyAndValue): * html/parser/HTMLPreloadScanner.cpp: (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): * page/Page.cpp: (WebCore::Page::setPageScaleFactor): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::glyphDataForCharacter): * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::prepareGraphicsContextForTextPainting): 2014-09-30 Yusuke Suzuki CSS JIT: Enable multiple stack references allocation by allocateUninitialized https://bugs.webkit.org/show_bug.cgi?id=135293 Reviewed by Benjamin Poulain. * cssjit/StackAllocator.h: (WebCore::StackAllocator::stackTop): Add stackTop method to check references are allocated easily. (WebCore::StackAllocator::allocateUninitialized): 2014-09-29 Brian J. Burg Web Inspector: InspectorValues should use references for out parameters https://bugs.webkit.org/show_bug.cgi?id=137190 Reviewed by Joseph Pecoraro. Clean up some call sites to explicitly check for cast success, and simplify some exceptional control flows. No new tests, no behavior changed. * inspector/CommandLineAPIHost.cpp: (WebCore::CommandLineAPIHost::inspectImpl): * inspector/InspectorCSSAgent.cpp: (WebCore::computePseudoClassMask): * inspector/InspectorDOMAgent.cpp: (WebCore::parseColor): (WebCore::parseConfigColor): (WebCore::parseQuad): (WebCore::InspectorDOMAgent::performSearch): (WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject): (WebCore::InspectorDOMAgent::innerHighlightQuad): (WebCore::InspectorDOMAgent::highlightFrame): * inspector/InspectorDOMStorageAgent.cpp: (WebCore::InspectorDOMStorageAgent::findStorageArea): * inspector/InspectorIndexedDBAgent.cpp: Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL. * inspector/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::didClearWindowObjectInWorld): * inspector/InspectorReplayAgent.cpp: (WebCore::InspectorReplayAgent::replayToPosition): * inspector/InspectorResourceAgent.cpp: (WebCore::InspectorResourceAgent::willSendRequest): * inspector/InspectorStyleSheet.cpp: (WebCore::InspectorStyle::styleWithProperties): * inspector/InspectorStyleSheet.h: (WebCore::InspectorCSSId::InspectorCSSId): * inspector/InspectorTimelineAgent.cpp: (WebCore::InspectorTimelineAgent::startFromConsole): (WebCore::InspectorTimelineAgent::stopFromConsole): * inspector/InspectorWorkerAgent.cpp: 2014-10-17 Carlos Garcia Campos [GLIB] Add API to GMainLoopSource to schedule sources after a delay in microseconds https://bugs.webkit.org/show_bug.cgi?id=137782 Reviewed by Sergio Villar Senin. * platform/gtk/SharedTimerGtk.cpp: (WebCore::setSharedTimerFireInterval): Use microseconds instead of milliseconds. 2014-10-21 Carlos Garcia Campos [GTK] Several labels are white instead of black https://bugs.webkit.org/show_bug.cgi?id=137803 Reviewed by Martin Robinson. Recent GTK+ versions require to explicitly set the state before getting a color. * rendering/RenderThemeGtk.cpp: (WebCore::styleColor): Helper function to get a color from a GtkStylecontext that explicitly sets the state before getting the color. (WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor): Use styleColor(). (WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor): Ditto. (WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor): Ditto. (WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor): Ditto. (WebCore::RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor): Ditto. (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor): Ditto. (WebCore::RenderThemeGtk::platformActiveListBoxSelectionForegroundColor): Ditto. (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor): Ditto. (WebCore::RenderThemeGtk::systemColor): Ditto. 2014-10-11 Carlos Garcia Campos [GLIB] Split GMainLoopSource moving thread safe implementation to its own class GThreadSafeMainLoopSource https://bugs.webkit.org/show_bug.cgi?id=137485 Reviewed by Sergio Villar Senin. Use GThreadSafeMainLoopSource for GStreamer sources, since they can be used from different threads. Also update GMutexLocker usages, since it's now a template. * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp: (WebCore::AudioFileReader::createBus): * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint): (WebCore::MediaPlayerPrivateGStreamerBase::paint): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: * platform/graphics/gstreamer/VideoSinkGStreamer.cpp: (webkitVideoSinkTimeoutCallback): (webkitVideoSinkRender): (unlockBufferMutex): (webkitVideoSinkUnlockStop): (webkitVideoSinkStart): * platform/graphics/gstreamer/WebKitMediaSourceGStreamer.cpp: * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcGetProperty): (webKitWebSrcStop): (webKitWebSrcStart): (webKitWebSrcChangeState): (webKitWebSrcQueryWithParent): (webKitWebSrcGetUri): (webKitWebSrcSetUri): (webKitWebSrcNeedDataMainCb): (webKitWebSrcNeedDataCb): (webKitWebSrcEnoughDataMainCb): (webKitWebSrcEnoughDataCb): (webKitWebSrcSeekDataCb): (webKitWebSrcSetMediaPlayer): (StreamingClient::createReadBuffer): (StreamingClient::handleResponseReceived): (StreamingClient::handleDataReceived): (StreamingClient::handleNotifyFinished): (ResourceHandleStreamingClient::wasBlocked): (ResourceHandleStreamingClient::cannotShowURL): 2014-10-05 Carlos Garcia Campos [GTK] Do not generate a symlink in derived sources for every header in WebCore/bindings/gobject https://bugs.webkit.org/show_bug.cgi?id=137389 Reviewed by Martin Robinson. We only need a symlink for static sources that are included in public generated headers, because they are added with as so they need to be inside a webkitdom directory. Also use proper targets and commands to create the symlinks only when needed instead of for every build. * PlatformGTK.cmake: 2014-09-30 Carlos Garcia Campos [GTK] Move GtkPopupMenu implementation to WebPopupMenuProxyGtk https://bugs.webkit.org/show_bug.cgi?id=137193 Reviewed by Gustavo Noronha Silva. Remove GtkPopupMenu from platform. * PlatformGTK.cmake: * platform/gtk/GtkPopupMenu.cpp: Removed. * platform/gtk/GtkPopupMenu.h: Removed. 2014-09-29 Carlos Garcia Campos [GTK] Remove MainFrameScrollbarGtk.cpp https://bugs.webkit.org/show_bug.cgi?id=137211 Reviewed by Philippe Normand. This was only used by WebKit1. * PlatformGTK.cmake: * platform/gtk/MainFrameScrollbarGtk.cpp: Removed. * platform/gtk/MainFrameScrollbarGtk.h: Removed. 2014-09-29 Carlos Garcia Campos [GTK] Remove IntPointGtk.cpp and IntRectGtk.cpp https://bugs.webkit.org/show_bug.cgi?id=137209 Reviewed by Philippe Normand. IntPointGtk is unused and IntRectGtk is only required by GTK+2 and only used when building with GTK+2 in GtkInputMethodFilter.cpp that can be easily replaced. * PlatformGTK.cmake: * platform/graphics/IntPoint.h: * platform/graphics/IntRect.h: * platform/graphics/gtk/IntPointGtk.cpp: Removed. * platform/graphics/gtk/IntRectGtk.cpp: Removed. * platform/gtk/GtkInputMethodFilter.cpp: (WebCore::GtkInputMethodFilter::setCursorRect): 2014-09-29 Carlos Garcia Campos Unreviewed. Move sources not using GTK+ from WebCorePlatformGTK_SOURCES to WebCore_SOURCES. * PlatformGTK.cmake: 2014-09-28 Carlos Garcia Campos Unreviewed. Move RenderThemeGtk.h from platform/gtk to rendering. I forgot to move this file in r173111. * rendering/RenderThemeGtk.h: Renamed from Source/WebCore/platform/gtk/RenderThemeGtk.h. 2014-09-28 Carlos Garcia Campos [ATK] WebKitAccessibleWrapperAtk should not depend on GTK https://bugs.webkit.org/show_bug.cgi?id=137177 Reviewed by Martin Robinson. It's used to get the web view widget, but there's no GtkWidget in the web process and platformPageClient is always NULL. * PlatformGTK.cmake: Move accessibility sources to the WebCore sources list. * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (atkParentOfRootObject): Remove code to get view GtkWidget. * editing/atk/FrameSelectionAtk.cpp: Remove unneeded header include. 2014-09-28 Carlos Garcia Campos [GTK] Remove unused GtkPluginWidget https://bugs.webkit.org/show_bug.cgi?id=137176 Reviewed by Csaba Osztrogonác. It was only used by WebKit1. * PlatformGTK.cmake: * platform/gtk/GtkPluginWidget.cpp: Removed. * platform/gtk/GtkPluginWidget.h: Removed. 2014-09-28 Carlos Garcia Campos [cairo] GraphicsContext should not depend on GTK+ https://bugs.webkit.org/show_bug.cgi?id=137175 Reviewed by Martin Robinson. Remove the unused methods depending on GDK and simplify GraphicsContext::drawFocusRing() using only cairo API. * PlatformGTK.cmake: Move GraphicsContextCairo.cpp to the webcore sources. * platform/graphics/GraphicsContext.h: * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::drawFocusRing): Iterate the rectangles instead of creating a region for the rectangles and call gdk_cairo_region(). (WebCore::GraphicsContext::setGdkExposeEvent): Deleted. (WebCore::GraphicsContext::gdkExposeEvent): Deleted. (WebCore::GraphicsContext::gdkWindow): Deleted. * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h: (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate): 2014-10-01 Chris Dumez Add basic caching for Document.cookie API https://bugs.webkit.org/show_bug.cgi?id=137225 Reviewed by Alexey Proskuryakov. While profiling the load of nytimes.com, I noticed that the site is accessing ~250 times document.cookie, just during page load. Accessing document.cookie is currently slow because we: - Call WebPlatformStrategies::cookiesForDOM() virtual function - Send a sync IPC message to the Network process to retrieve the cookies - The Network process gets the list of cookies from CFNetwork then serializes the result to send it back to the WebProcess - We unserialize the cookies into an NSList of cookies - We filter-out the cookies that are 'httpOnly' and construct a new NSList of cookies - We create a WTF String out of the cookies NSList In the case of nytimes.com, it turns out that up to 100 calls to document.cookie() are made in the same event loop iteration. This patch thus caches / freezes the cookies until we return to the event loop so that consecutive calls to document.cookie() are extremely fast. Doing so seems to be sufficient to achieve a ~87% cache hit for nytimes.com page load. The cookies cache is invalidated whenever: - document.cookie is set - we return to the event loop - a network resource is loaded synchronously as it may cause cookies to be set before we return to the event loop Test: http/tests/cookies/sync-xhr-set-cookie-invalidates-cache.html * dom/Document.cpp: (WebCore::Document::Document): (WebCore::Document::open): (WebCore::Document::cookie): (WebCore::Document::setCookie): (WebCore::Document::setCookieURL): (WebCore::Document::initSecurityContext): (WebCore::Document::setDOMCookieCache): (WebCore::Document::invalidateDOMCookieCache): (WebCore::Document::domCookieCacheExpiryTimerFired): (WebCore::Document::didLoadResourceSynchronously): * dom/Document.h: (WebCore::Document::domCookieCache): (WebCore::Document::isDOMCookieCacheValid): (WebCore::Document::setCookieURL): Deleted. * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::didLoadResourceSynchronously): * dom/ScriptExecutionContext.h: * loader/ThreadableLoader.cpp: (WebCore::ThreadableLoader::loadResourceSynchronously): 2014-09-30 Said Abou-Hallawa Stack overflow with enormous SVG filter https://bugs.webkit.org/show_bug.cgi?id=63290 Prevent building an SVG filter if it has more than 200 FilterEffect nodes in its map regardless whether they will be connected to its lastEffect or not. Also discard any filter which has more 100 contributing FilterEffect nodes in its tree. Reviewed by Dean Jackson. Tests: svg/filters/svg-deeply-nested-crash.html * platform/graphics/filters/FilterEffect.cpp: (WebCore::collectEffects): (WebCore::FilterEffect::totalNumberOfEffectInputs): * platform/graphics/filters/FilterEffect.h: -- Add a method to return the total number of input FilterEffect's contributing to a FilterEffect. * rendering/svg/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::buildPrimitives): -- Do not build a filter if it has more than 200 FilterEffects in its map. (WebCore::RenderSVGResourceFilter::applyResource): -- Discard a filter after it was built if it has more than 100 FilterEffects in its tree. 2014-09-30 David Hyatt Remove a multicolumn ASSERT and replace with a guard. https://bugs.webkit.org/show_bug.cgi?id=137272 Reviewed by Alexey Proskuryakov. * rendering/RenderMultiColumnFlowThread.cpp: (WebCore::isValidColumnSpanner): For now remove the assert that is tripping and replace it with a guard until we can figure out why it's getting hit. 2014-08-01 Sergio Villar Senin Caret not shown at the end of line in overtype mode https://bugs.webkit.org/show_bug.cgi?id=135508 Reviewed by Ryosuke Niwa. When overtype mode is enabled we usually replace the 'normal' blinking caret shown in contenteditable elements by a block cursor that covers the next character to be replaced. The exception is the end of line where we fallback to the blinking caret even in overtype mode (as there is no next character to replace). We were not showing anything at the end of lines in overtype mode because the detection of the end of line was incorrect and not very understandable. Replaced the old code with a proper and clean end of line detection mechanism compatible with bidi text. Tests: editing/selection/block-cursor-overtype-mode-end-of-line-rtl.html editing/selection/block-cursor-overtype-mode-end-of-line.html * editing/FrameSelection.cpp: (WebCore::FrameSelection::updateAppearance): * editing/VisibleUnits.cpp: (WebCore::isLogicalEndOfLine): * editing/VisibleUnits.h: 2014-09-29 David Hyatt REGRESSION (r168046): Confused column spans when combined with dynamic animations https://bugs.webkit.org/show_bug.cgi?id=134048. Reviewed by Dean Jackson. Added fast/multicol/multicol-fieldset-span-changes.html * rendering/RenderMultiColumnFlowThread.cpp: (WebCore::RenderMultiColumnFlowThread::processPossibleSpannerDescendant): Refactor handling of insertions into the multicolumn flow thread into a helper function, processPossibleSpannerDescendant. This makes it easier to call the code from more than one place. (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted): Modify the nested columns span shifting code to avoid problems. The new code suppresses notifications and does the move of the spanner back into the original spot *before* removing the placeholder. This ensures that the placeholder parent still exists. The stale placeholder is then removed and destroyed after the spanner has been put back into place. (WebCore::RenderMultiColumnFlowThread::handleSpannerRemoval): (WebCore::RenderMultiColumnFlowThread::flowThreadRelativeWillBeRemoved): Refactor the removal notifications for spanners into a helper function so that it can be called to do cleanup from the code that cleans up stale placeholders on a shift. * rendering/RenderMultiColumnFlowThread.h: Modified to add the new helpers. 2014-09-29 Chris Fleizach AX: in an aria-labelledby computation, do not traverse into elements whose nameFrom value does not include 'contents' https://bugs.webkit.org/show_bug.cgi?id=136714 Reviewed by Darin Adler. There are certain ARIA elements that tell us we should not query their children when determining the name of the object. Those ones have the "nameFrom" property set to "author" instead of "contents." WebKit needs to honor that status. Test: accessibility/aria-namefrom-author.html Modified: accessibility/aria-labelledby-with-descendants.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::shouldUseAccessiblityObjectInnerText): (WebCore::shouldAddSpaceBeforeAppendingNextElement): (WebCore::appendNameToStringBuilder): (WebCore::AccessibilityNodeObject::textUnderElement): (WebCore::accessibleNameForNode): (WebCore::AccessibilityNodeObject::accessibilityDescriptionForElements): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::accessibleNameDerivesFromContent): (WebCore::initializeRoleMap): * accessibility/AccessibilityObject.h: 2014-09-27 Chris Dumez HTMLPlugInElement::isUserObservable() is causing layout https://bugs.webkit.org/show_bug.cgi?id=137156 Reviewed by Ryosuke Niwa. While profiling the page load of nytimes.com, I noticed that we were spending ~4-5% of cpu time in HTMLPlugInElement::isUserObservable(). The reason is that the function calls pluginWidget(), which causes a layout update in HTMLObjectElement::renderWidgetForJSBindings(), to make sure the plugin is loaded and its renderer is created. HTMLPlugInElement::isUserObservable() shouldn't need to do a layout. This patch does the following to address the problem: - Rename renderWidgetForJSBindings() to renderWidgetLoadingPlugin() because this function is not always called from the JS Bindings nowadays. The new name makes it clearer that this will load the plugin if needed (to make sure the renderer is created, and by doing a layout). - Add a PluginLoadingPolicy argument to HTMLPlugInElement::pluginWidget() to let the caller control if the plugin should be loaded or not. - Update the call to pluginWidget() in isUserObservable() so that we do not attempt to load the plugin (thus not causing a layout). No new tests, no behavior change. * WebCore.exp.in: * WebCore.order: * html/HTMLAppletElement.cpp: (WebCore::HTMLAppletElement::renderWidgetLoadingPlugin): (WebCore::HTMLAppletElement::renderWidgetForJSBindings): Deleted. * html/HTMLAppletElement.h: * html/HTMLEmbedElement.cpp: (WebCore::HTMLEmbedElement::renderWidgetLoadingPlugin): (WebCore::HTMLEmbedElement::renderWidgetForJSBindings): Deleted. * html/HTMLEmbedElement.h: * html/HTMLObjectElement.cpp: (WebCore::HTMLObjectElement::renderWidgetLoadingPlugin): (WebCore::HTMLObjectElement::renderWidgetForJSBindings): Deleted. * html/HTMLObjectElement.h: * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::pluginWidget): (WebCore::HTMLPlugInElement::isUserObservable): * html/HTMLPlugInElement.h: 2014-09-26 Brian J. Burg StorageTracker::deleteOrigin being called off the main thread (ASSERTs in inspector/test-harness-trivially-works.html test) https://bugs.webkit.org/show_bug.cgi?id=129642 Apply post-review comments from Alexey Proskuryakov. * storage/StorageAreaSync.cpp: (WebCore::StorageAreaSync::deleteEmptyDatabase): Make a thread-safe isolated copy of the string. 2014-09-25 Brian J. Burg StorageTracker::deleteOrigin being called off the main thread (ASSERTs in inspector/test-harness-trivially-works.html test) https://bugs.webkit.org/show_bug.cgi?id=129642 Reviewed by Brady Eidson. When tearing down the inspector frontend's page, we trigger a threading violation in StorageAreaSync's final sync code underneath StorageAreaSync::deleteEmptyDatabase(). No new tests. Regression is covered by inspector/test-harness-trivially-works.html. * storage/StorageAreaSync.cpp: (WebCore::StorageAreaSync::deleteEmptyDatabase): add a missing callOnMainThread() when calling StorageTracker::deleteOriginWithIdentifier(). 2014-09-25 Javier Fernandez ASSERTION FAILED: columnCount in WebCore::CSSParser::parseGridTemplateAreasRow https://bugs.webkit.org/show_bug.cgi?id=136945 Reviewed by Sergio Villar Senin. Checking out whether the grid-template-areas value contains a white-space only string, which is not valid as it does not produce a cell token. Test: fast/css-grid-layout/grid-template-areas-empty-string-crash.html * css/CSSParser.cpp: (WebCore::CSSParser::parseGridTemplateAreasRow): 2014-09-24 Christophe Dumez Use tighter typing for render objects in RenderGeometryMap https://bugs.webkit.org/show_bug.cgi?id=137102 Reviewed by Ryosuke Niwa. Use tighter typing for render objects in RenderGeometryMap for clarity and efficiency. In particular, using RenderElement type instead of RenderObject in canMapBetweenRenderers() allows us to call the faster RenderElement::style() instead of RenderObject::style(). No new tests, no behavior change. * rendering/RenderGeometryMap.cpp: (WebCore::canMapBetweenRenderers): (WebCore::RenderGeometryMap::pushMappingsToAncestor): 2014-09-24 Darin Adler Old Turkic characters behave as left-to-right instead of right-to-left, because they are encoded as surrogate pairs. https://bugs.webkit.org/show_bug.cgi?id=70029 Reviewed by Dan Bernstein. Test: fast/text/international/old-turkic-direction.html * CMakeLists.txt: Added InlineIterator.cpp. * WebCore.vcxproj/WebCore.vcxproj: Ditto. * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * rendering/RenderingAllInOne.cpp: Ditto. * rendering/InlineIterator.cpp: Added. (WebCore::InlineIterator::surrogateTextDirection): New function used to compute the direction when a surrogate pair is involved. * rendering/InlineIterator.h: Made the characterAt function private. (WebCore::InlineIterator::previousInSameNode): Took out unneeded range check. A zero will underflow and become a large number and the characterAt function will return 0 in that case. (WebCore::InlineIterator::direction): Added code to check U16_IS_SINGLE before calling u_charDirection, and call surrogateTextDirection instead. 2014-09-24 Christophe Dumez Unreviewed build fix after r173941. Rename shadow to m_shadow. * rendering/TextPainter.h: (WebCore::ShadowApplier::shadowIsCompletelyCoveredByText): 2014-09-22 Myles C. Maxfield REGRESSION: Text with a zero offset, zero blur shadow vanishes https://bugs.webkit.org/show_bug.cgi?id=136801 Reviewed by Darin Adler. This patch performs some cleanup regarding TextPainter's shadow logic and handles an additional case of empty shadows. Previously, there was tight coupling between applyShadowToGraphicalContext() and paintTextWithShadows(), as they both used a collection of variables to determine how shadows are to be drawn. This complexity has been moved into a helper class, ShadowApplier, which performs what applyShadowToGraphicsContext() used to do, and cleans up correctly in its destructor. This removes the tight coupling mentioned earlier. Test: fast/text/empty-shadow.html * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::applyShadowToGraphicsContext): Moved to ShadowApplier. * rendering/InlineTextBox.h: Deleted applyShadowToGraphicsContext signature. * rendering/TextPainter.cpp: (WebCore::ShadowApplier::ShadowApplier): Perform the contents of applyShadowToGraphicsContext() (WebCore::ShadowApplier::~ShadowApplier): Undo the work done previously (WebCore::paintTextWithShadows): Create a ShadowApplier to do the relevant shadow work. In addition, refactor some boolean flags to more meaningful ones with relation to the computation at hand. (WebCore::isEmptyShadow): Moved to TextPainter.h, named shadowIsCompletelyCoveredByText() * rendering/TextPainter.h: (WebCore::ShadowApplier::ShadowApplier): Moved from InlineTextBox::applyShadowToGraphicsContext(). (WebCore::ShadowApplier::extraOffset): Getter. (WebCore::ShadowApplier::~ShadowApplier): Moved from TextPainter::paintTextWithShadows(). (WebCore::isLastShadowIteration): Helper function. (WebCore::shadowIsCompletelyCoveredByText): Determines whether or not we should not draw the shadow. * rendering/svg/SVGInlineTextBox.cpp: (WebCore::SVGInlineTextBox::paintTextWithShadows): Update to use ShadowApplier. 2014-09-23 Benjamin Poulain The style resolution cache applies properties incorrectly whenever direction != ltr https://bugs.webkit.org/show_bug.cgi?id=137052 Reviewed by Andreas Kling. The optimization r135021 introduced a bug whenever the direction of subtree is not uniform in the whole page. When StyleResolver::applyMatchedProperties() resolves the style, some properties are resolved differently based on the writing-mode and the direction. In isCacheableInMatchedPropertiesCache(), the cases for writing-mode are already handled by not caching any style with anything else than the default. The direction was ignored, causing the bugs solved here. Tests: css3/flexbox/flex-flow-2.html fast/css/style-resolver-cache-direction-1.html fast/css/style-resolver-cache-direction-2.html fast/css/style-resolver-cache-direction-3.html * css/StyleResolver.cpp: (WebCore::isCacheableInMatchedPropertiesCache): 2014-09-22 Simon Fraser Ensure that layout is up-to-date before hit-testing via RenderView https://bugs.webkit.org/show_bug.cgi?id=136651 Reviewed by David Hyatt. Ensure that layout is up-to-date before we do hit-testing via the RenderView. Previously, RenderLayer::hitTest() called updateLayout(), but it's better to push that responsibility onto RenderView before entering the RenderLayer tree. Make callers a little more consistent in getting the RenderView via Frame::contentRenderer(), though perhaps we should remove that and just call Document::renderView() everywhere. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::press): Hit test via the RenderView, rather than doing so on the RenderView's layer, to ensure that we updateLayout(). * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::accessibilityHitTest): This code calls hitTest() on arbitrary layers, so needs to explicitly update layout. * editing/FrameSelection.cpp: (WebCore::FrameSelection::contains): * page/EventHandler.cpp: (WebCore::EventHandler::eventMayStartDrag): (WebCore::EventHandler::updateSelectionForMouseDrag): (WebCore::EventHandler::hitTestResultAtPoint): The explicit updateLayout() is no longer needed. (WebCore::EventHandler::updateCursor): (WebCore::EventHandler::handleWheelEvent): (WebCore::EventHandler::hoverTimerFired): (WebCore::hitTestResultInFrame): * page/Frame.cpp: (WebCore::Frame::contentRenderer): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::hitTest): * rendering/RenderView.cpp: (WebCore::RenderView::hitTest): Here's where we ensure that layout is up-to-date. 2014-09-19 Brent Fulgham Latching in iframes is not working as expected https://bugs.webkit.org/show_bug.cgi?id=136729 Reviewed by Simon Fraser. Test: platform/mac/fast/scrolling/scrolling-iframe-100pct.html Correct latching behavior by moving the concept of latching from the event handler to the main frame. The event handlers are per-document, and can improperly latch to the iframe element (rather than the scrollable content of the iframe) resulting in incorrect behavior. Also move the wheel event delta tracking to the main frame, as this is similarly "top-level" in nature. * WebCore.vcxproj/WebCore.vcxproj: Add new LatchedState class. * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto. * WebCore.xcodeproj/project.pbxproj: Ditto. * page/EventHandler.cpp: (WebCore::EventHandler::EventHandler): Update constructor after moving some members to the new LatchedState object. (WebCore::EventHandler::clear): Call 'clear' on the LatchedState class. (WebCore::EventHandler::platformRecordWheelEvent): Update for new LatchedState class. (WebCore::EventHandler::handleWheelEvent): Ditto. (WebCore::EventHandler::clearLatchedState): Ditto. (WebCore::EventHandler::defaultWheelEventHandler): Ditto. * page/EventHandler.h: * page/LatchedState.cpp: Added. (WebCore::LatchedState::LatchedState): (WebCore::LatchedState::~LatchedState): (WebCore::LatchedState::clear): (WebCore::LatchedState::setWheelEventElement): (WebCore::LatchedState::setWidgetIsLatched): (WebCore::LatchedState::setPreviousWheelScrolledElement): (WebCore::LatchedState::setScrollableContainer): * page/LatchedState.h: Added. (WebCore::LatchedState::wheelEventElement): (WebCore::LatchedState::frame): (WebCore::LatchedState::setFrame): (WebCore::LatchedState::widgetIsLatched): (WebCore::LatchedState::previousWheelScrolledElement): (WebCore::LatchedState::scrollableContainer): (WebCore::LatchedState::startedGestureAtScrollLimit): (WebCore::LatchedState::setStartedGestureAtScrollLimit): * page/MainFrame.cpp: (WebCore::MainFrame::MainFrame): Update for new members (LatchedState and WheelEventDeltaTracker) * page/MainFrame.h: * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::platformPrepareForWheelEvents): Use mainFrame-located latching information. (WebCore::EventHandler::platformRecordWheelEvent): Use mainFrame-located wheel event delta tracking. (WebCore::EventHandler::platformCompleteWheelEvent): Make sure to use the latched frame as well as the latched element so that events get routed properly. (WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent): Update for new mainFrame location for latched state information. 2014-09-19 Simon Fraser Provide a default argument for the most commonly used HitTestRequest variant https://bugs.webkit.org/show_bug.cgi?id=136653 Reviewed by Darin Adler. Make the default HitTestRequest flags be ReadOnly | Active | DisallowShadowContent and change call sites using the default flags to use a HitTestRequest temporary. * dom/TreeScope.cpp: (WebCore::nodeFromPoint): * editing/FrameSelection.cpp: (WebCore::FrameSelection::contains): * page/DragController.cpp: (WebCore::elementUnderMouse): * page/EventHandler.cpp: (WebCore::EventHandler::handleMouseDraggedEvent): (WebCore::EventHandler::handleMousePressEvent): * rendering/HitTestRequest.h: (WebCore::HitTestRequest::HitTestRequest): 2014-09-19 Chris Dumez Minimize virtual function calls in MarkupAccumulator https://bugs.webkit.org/show_bug.cgi?id=136957 Reviewed by Benjamin Poulain. This patch minimizes the number of virtual function calls in MarkupAccumulator by: - De-virtualizing MarkupAccumulator::appendString(), which is never overridden - Having MarkupAccumulator::appendEndTag() virtual function take an Element in argument instead of a Node, as it only applies to Element. Also add a non-virtual overload that takes a Node in argument and that does the isElementNode() check so that we don't need to explicitly do the check at each call site. No new tests, no behavior change. * editing/MarkupAccumulator.cpp: (WebCore::MarkupAccumulator::appendEndTag): (WebCore::MarkupAccumulator::shouldSelfClose): (WebCore::MarkupAccumulator::appendEndMarkup): * editing/MarkupAccumulator.h: (WebCore::MarkupAccumulator::appendEndTag): * page/PageSerializer.cpp: (WebCore::SerializerMarkupAccumulator::appendEndTag): 2014-09-19 Benjamin Poulain Add a size check for CSSSelector https://bugs.webkit.org/show_bug.cgi?id=136882 Reviewed by Christophe Dumez. * css/CSSSelector.cpp: 2014-10-07 Carlos Garcia Campos [SOUP] TLS errors should take precedence over HTTP authentication https://bugs.webkit.org/show_bug.cgi?id=137300 Reviewed by Sergio Villar Senin. Handle TLS errors in got-headers callback to make sure it happens before starting the authentication process. * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::handleUnignoredTLSErrors): Refactored to receive the soup message. (WebCore::gotHeadersCallback): Return early and cancel the request in case of TLS errors. (WebCore::sendRequestCallback): Do not handle TLS errors here, the request should have already been cancelled at this point in case of TLS errors. 2014-09-19 Dean Jackson Multithreaded WebGL is a bad idea - remove it https://bugs.webkit.org/show_bug.cgi?id=136964 Reviewed by Brent Fulgham. We should not allow multithreaded GL access. Remove the feature. * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::create): * page/Settings.in: * platform/graphics/GraphicsContext3D.h: (WebCore::GraphicsContext3D::Attributes::Attributes): * platform/graphics/mac/GraphicsContext3DMac.mm: (WebCore::GraphicsContext3D::GraphicsContext3D): 2014-09-26 Lorenzo Tilve [GTK] Fix support for the initial-letter CSS property to first-letter https://bugs.webkit.org/show_bug.cgi?id=137108 Reviewed by Alejandro G. Castro. Add support for cap-height to the font system. * platform/graphics/freetype/SimpleFontDataFreeType.cpp: (WebCore::SimpleFontData::platformInit): 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-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-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-09-22 Eva Balazsfalvi REGRESSION(r173631): It broke the !ENABLE(VIDEO) build https://bugs.webkit.org/show_bug.cgi?id=136946 Reviewed by Jer Noble. No new tests required, no new functionality. * page/DragController.cpp: (WebCore::DragController::startDrag): 2014-09-22 Mihnea Ovidenie [CSS Regions] Assertion failure and null dereference crash when using animations and regions https://bugs.webkit.org/show_bug.cgi?id=136918 Reviewed by Andrei Bucur. In some situations, for instance when an image has an attached animation, the style change caused by the animation triggers a geometry update for the backing store associated with the image's layer. This may occur before the layout for the image has finished. Moreover, if the image in such situation - having a composited layer - is displayed in a region, sicne the layout did not finish yet, the mappings between the layers of the elements collected in the named flow and the regions associated with the named flow are not updated and cannot be used. Therefore in those situations, we have to bail out early and use these mappings only after the layout has finished. This patch also changes RenderLayerBacking method updateAfterDescendents -> updateAfterDescendants. Test: fast/regions/animated-image-in-region.html * rendering/RenderFlowThread.cpp: (WebCore::RenderFlowThread::cachedRegionForCompositedLayer): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateAfterDescendants): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): (WebCore::RenderLayerCompositor::updateLayerTreeGeometry): (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry): 2014-09-21 Christophe Dumez Fix post-mortem nits for r173724 https://bugs.webkit.org/show_bug.cgi?id=136986 Reviewed by Darin Adler. Fix post-mortem nits for r173724. No new tests, no behavior change. * editing/EditingStyle.cpp: (WebCore::HTMLAttributeEquivalent::attributeValueAsCSSValue): (WebCore::HTMLFontSizeEquivalent::attributeValueAsCSSValue): Use nullptr instead of 0. * editing/SplitElementCommand.cpp: (WebCore::SplitElementCommand::doUnapply): Use getIdAttribute() / setIdAttribute(). * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::computePreferredLogicalWidths): Use fastHasAttribute() for nowrap and do an early return to avoid calling styleOrColLogicalWidth() if the nowrap attribute is missing. 2014-09-19 Eva Balazsfalvi REGRESSION(r173464): It broke the !ENABLE(PICTURE_SIZES) build https://bugs.webkit.org/show_bug.cgi?id=136942 Reviewed by Simon Fraser. * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::parseAttribute): 2014-09-17 Philippe Normand [GStreamer] Cannot play Vimeo video https://bugs.webkit.org/show_bug.cgi?id=134969 Reviewed by Sergio Villar Senin. Ensure the GStreamer HTTP source element also sends cookies when it's sending its requests. Some streaming platforms such as Vimeo do server-side cookie checks on incoming requests before serving media data. Test: http/tests/media/hls/video-cookie.html * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcStart): Set first-party cookie URL to the request so the ResourceLoader properly sets cookies in the HTTP request. 2014-09-18 Carlos Garcia Campos [GTK] Dot not allow to create delete-on-destroy GMainLoopSources https://bugs.webkit.org/show_bug.cgi?id=136923 Reviewed by Gustavo Noronha Silva. * platform/gtk/GtkDragAndDropHelper.cpp: (WebCore::GtkDragAndDropHelper::handleDragLeave): Use GMainLoopSource::scheduleAndDeleteOnDestroy(). 2014-09-18 Roger Fong [Windows] Media tests all fail because they cannot find localized strings. * rendering/RenderThemeSafari.cpp: (WebCore::RenderThemeSafari::mediaControlsScript): Make sure to use localized strings files in RenderThemeSafari. 2014-09-18 Simon Fraser Remove generator/yield terminology in RenderInline's GeneratorContext https://bugs.webkit.org/show_bug.cgi?id=119278 Reviewed by Sam Weinig. Get rid of the icky Generator/yield syntax used for collecting rects in RenderInline. Just replace the operator() with an explicit addRect(). Also some drive-by nullptr cleanup, and removing default arguments from addChildIgnoringContinuation() calls. * rendering/RenderInline.cpp: (WebCore::RenderInline::willBeDestroyed): (WebCore::RenderInline::styleDidChange): (WebCore::RenderInline::splitInlines): (WebCore::RenderInline::addChildToContinuation): (WebCore::RenderInline::generateLineBoxRects): (WebCore::RenderInline::generateCulledLineBoxRects): * rendering/RenderInline.h: 2014-09-18 Jeremy Jones Improve fullscreen video rotation animation. https://bugs.webkit.org/show_bug.cgi?id=136870 Reviewed by Simon Fraser. Instead of setting the frame on the video layer, set position and bounds separately. This allows the position to be synchronized with the rest of the animation. When using a fencePort to synchronize animations, if the fence times out, pivoting around the center provides a better fallback. * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: (-[WebAVVideoLayer setVideoSublayer:]): added (-[WebAVVideoLayer videoSublayer]): added (-[WebAVVideoLayer setBounds:]): set position and bounds insted of frame. (WebVideoFullscreenInterfaceAVKit::setupFullscreen): use setVideoSublayer * platform/ios/WebVideoFullscreenModelVideoElement.mm: (WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer): set bounds and anchorPoint instead of frame (WebVideoFullscreenModelVideoElement::setVideoLayerFrame): set bounds instead of frame. 2014-09-17 Myles C. Maxfield Text laid out with the SVG -> OTF font converter does not have the same metrics as with the SVG font code path https://bugs.webkit.org/show_bug.cgi?id=136907 Reviewed by Darin Adler. There are three things that are causing text laid out with the SVG -> OTF font converter to not have metrics that measure our existing SVG codepath. They are: 1. Creating a font with a 0 ascent or descent makes OS X think that something is wrong with the font, and take a different codepath when trying to parse ascent and descent information. This patch checks for this condition and sets the ascent/descent to 1 FUnit instead (which is generally much smaller than a pixel). 2. Our SVG font codepath hardcodes a line gap of 1/10th of the font size for every font. This patch makes the font converter obey this. 3. The converter was not allowing for default glyph advances as per the SVG font specification. This patch does so. No new tests yet, but they will come soon! I promise! * svg/SVGToOTFFontConversion.cpp: (WebCore::SVGToOTFFontConverter::appendHHEATable): (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): 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-09-18 Joseph Pecoraro Unreviewed rollout r173731. Broke multiple builds. * WebCore.exp.in: * inspector/InspectorController.cpp: (WebCore::InspectorController::connectFrontend): (WebCore::InspectorController::show): * inspector/InspectorController.h: * page/PageDebuggable.cpp: (WebCore::PageDebuggable::connect): * page/PageDebuggable.h: * testing/Internals.cpp: (WebCore::Internals::openDummyInspectorFrontend): 2014-09-18 Beth Dakin ASSERT in RenderBox::instrinsicScrollbarLogicalWidth opening the inspector https://bugs.webkit.org/show_bug.cgi?id=136929 Reviewed by Simon Fraser. This is a regression from http://trac.webkit.org/changeset/173668 This code is wrong after that change because it assumes that overflow:scroll will always have a scrollbar. That is no longer the case. We need to check to make sure it’s an overflow:scroll that does NOT have overflow:auto behavior. * rendering/RenderBox.cpp: (WebCore::RenderBox::instrinsicScrollbarLogicalWidth): 2014-09-18 Joseph Pecoraro Web Inspector: Should be able to attach a debugger to a JSContext before anything is executed https://bugs.webkit.org/show_bug.cgi?id=136893 Reviewed by Timothy Hatcher. Automatic inspection is currently disabled for web pages. This just updates the interfaces that changed. * WebCore.exp.in: * inspector/InspectorController.cpp: (WebCore::InspectorController::connectFrontend): (WebCore::InspectorController::show): * inspector/InspectorController.h: * page/PageDebuggable.cpp: (WebCore::PageDebuggable::connect): * page/PageDebuggable.h: * testing/Internals.cpp: (WebCore::Internals::openDummyInspectorFrontend): 2014-09-18 Chris Dumez Use fastHasAttribute() / fastGetAttribute() when possible https://bugs.webkit.org/show_bug.cgi?id=136900 Reviewed by Benjamin Poulain. Use fastHasAttribute() / fastGetAttribute() when possible, that is when the attribute is not SVG-animated or the |style| attribute, to avoid synchronizing attributes unnecessarily. Also avoid calling hasAttribute(xxxAttr) then getAttribute(xxxAttr) as it causes 2 linear searches. It is best to call getAttribute(xxxAttr) directly and check if it returns the nullAtom. No new tests, no behavior change. Element::fastAttributeLookupAllowed() is there as a safety set for debug builds. * accessibility/AccessibilityListBoxOption.cpp: (WebCore::AccessibilityListBoxOption::isEnabled): * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::alternativeTextForWebArea): (WebCore::AccessibilityNodeObject::hierarchicalLevel): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::contentEditableAttributeIsEnabled): * dom/Document.cpp: (WebCore::Document::hasManifest): * dom/DocumentOrderedMap.cpp: (WebCore::keyMatchesLabelForAttribute): * dom/DocumentStyleSheetCollection.cpp: (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets): * dom/Element.cpp: (WebCore::Element::imageSourceURL): (WebCore::Element::pseudo): (WebCore::Element::spellcheckAttributeState): * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock): * editing/EditingStyle.cpp: (WebCore::HTMLAttributeEquivalent::attributeValueAsCSSValue): (WebCore::HTMLFontSizeEquivalent::attributeValueAsCSSValue): * editing/SplitElementCommand.cpp: (WebCore::SplitElementCommand::doUnapply): * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::draggable): (WebCore::HTMLAnchorElement::sendPings): * html/HTMLAppletElement.cpp: (WebCore::HTMLAppletElement::updateWidget): * html/HTMLBodyElement.cpp: (WebCore::HTMLBodyElement::addSubresourceAttributeURLs): * html/HTMLButtonElement.cpp: (WebCore::HTMLButtonElement::value): * html/HTMLDocument.cpp: (WebCore::HTMLDocument::dir): * html/HTMLEmbedElement.cpp: (WebCore::HTMLEmbedElement::imageSourceURL): (WebCore::HTMLEmbedElement::addSubresourceAttributeURLs): * html/HTMLFieldSetElement.cpp: (WebCore::HTMLFieldSetElement::~HTMLFieldSetElement): (WebCore::updateFromControlElementsAncestorDisabledStateUnder): (WebCore::HTMLFieldSetElement::disabledAttributeChanged): (WebCore::HTMLFieldSetElement::disabledStateChanged): (WebCore::HTMLFieldSetElement::childrenChanged): (WebCore::HTMLFieldSetElement::didMoveToNewDocument): * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor): * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::action): * html/HTMLFrameElement.cpp: (WebCore::HTMLFrameElement::noResize): * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::location): * html/HTMLHRElement.cpp: (WebCore::HTMLHRElement::collectStyleForPresentationAttribute): * html/HTMLHtmlElement.cpp: (WebCore::HTMLHtmlElement::insertedByParser): * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::altText): (WebCore::HTMLImageElement::alt): (WebCore::HTMLImageElement::draggable): (WebCore::HTMLImageElement::src): (WebCore::HTMLImageElement::addSubresourceAttributeURLs): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::finishParsingChildren): (WebCore::HTMLInputElement::altText): (WebCore::HTMLInputElement::reset): * html/HTMLLabelElement.cpp: (WebCore::HTMLLabelElement::control): * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::process): (WebCore::HTMLLinkElement::rel): * html/HTMLMetaElement.cpp: (WebCore::HTMLMetaElement::content): (WebCore::HTMLMetaElement::httpEquiv): * html/HTMLObjectElement.cpp: (WebCore::HTMLObjectElement::imageSourceURL): (WebCore::HTMLObjectElement::addSubresourceAttributeURLs): * html/HTMLOptGroupElement.cpp: (WebCore::HTMLOptGroupElement::groupLabelText): * html/HTMLProgressElement.cpp: (WebCore::HTMLProgressElement::max): * html/HTMLScriptElement.cpp: (WebCore::HTMLScriptElement::sourceAttributeValue): (WebCore::HTMLScriptElement::charsetAttributeValue): (WebCore::HTMLScriptElement::languageAttributeValue): (WebCore::HTMLScriptElement::forAttributeValue): (WebCore::HTMLScriptElement::eventAttributeValue): * html/HTMLTableCellElement.cpp: (WebCore::HTMLTableCellElement::addSubresourceAttributeURLs): * html/HTMLTableElement.cpp: (WebCore::HTMLTableElement::rules): (WebCore::HTMLTableElement::summary): (WebCore::HTMLTableElement::addSubresourceAttributeURLs): * html/HTMLTableSectionElement.cpp: (WebCore::HTMLTableSectionElement::align): (WebCore::HTMLTableSectionElement::ch): (WebCore::HTMLTableSectionElement::vAlign): * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::maxLength): * html/SearchInputType.cpp: (WebCore::SearchInputType::searchEventsShouldBeDispatched): * loader/FormSubmission.cpp: (WebCore::FormSubmission::create): * page/Frame.cpp: (WebCore::Frame::matchLabelsAgainstElement): * page/PageSerializer.cpp: (WebCore::PageSerializer::serializeFrame): * platform/win/PasteboardWin.cpp: (WebCore::Pasteboard::writeImageToDataObject): * rendering/HitTestResult.cpp: (WebCore::HitTestResult::altDisplayString): * rendering/RenderSearchField.cpp: (WebCore::RenderSearchField::autosaveName): * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::computePreferredLogicalWidths): * rendering/svg/RenderSVGResourceClipper.cpp: (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage): 2014-09-18 Chris Dumez Have LiveNodeLists / HTMLCollections's elementMatches() take a reference https://bugs.webkit.org/show_bug.cgi?id=136902 Reviewed by Darin Adler. Have LiveNodeLists / HTMLCollections's elementMatches() take a reference in argument instead of a pointer as the Element can never be null. No new tests, no behavior change. * dom/ClassNodeList.h: (WebCore::ClassNodeList::elementMatches): * dom/DocumentOrderedMap.cpp: (WebCore::keyMatchesWindowNamedItem): (WebCore::keyMatchesDocumentNamedItem): * dom/Element.cpp: (WebCore::Element::updateNameForDocument): (WebCore::Element::updateIdForDocument): * dom/LiveNodeList.cpp: (WebCore::LiveNodeList::namedItem): * dom/LiveNodeList.h: (WebCore::CachedLiveNodeList::collectionBegin): (WebCore::CachedLiveNodeList::collectionLast): (WebCore::CachedLiveNodeList::collectionTraverseForward): (WebCore::CachedLiveNodeList::collectionTraverseBackward): * dom/NameNodeList.h: (WebCore::NameNodeList::elementMatches): * dom/TagNodeList.h: (WebCore::TagNodeList::elementMatches): (WebCore::HTMLTagNodeList::elementMatches): * html/HTMLCollection.cpp: (WebCore::isMatchingElement): * html/HTMLNameCollection.cpp: (WebCore::WindowNameCollection::elementMatchesIfNameAttributeMatch): (WebCore::WindowNameCollection::elementMatches): (WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch): (WebCore::DocumentNameCollection::elementMatchesIfNameAttributeMatch): (WebCore::DocumentNameCollection::elementMatches): * html/HTMLNameCollection.h: * html/LabelsNodeList.cpp: (WebCore::LabelsNodeList::elementMatches): * html/LabelsNodeList.h: * html/RadioNodeList.cpp: (WebCore::RadioNodeList::checkElementMatchesRadioNodeListFilter): (WebCore::RadioNodeList::elementMatches): * html/RadioNodeList.h: 2014-09-18 Carlos Garcia Campos Remove unused methods from MediaPlayerClient https://bugs.webkit.org/show_bug.cgi?id=136884 Reviewed by Eric Carlson. Remove unused methods from MediaPlayerClient that introduce dependencies on WebCore types. * html/HTMLMediaElement.cpp: * html/HTMLMediaElement.h: * platform/graphics/MediaPlayer.h: (WebCore::MediaPlayerClient::mediaPlayerOwningDocument): Deleted. (WebCore::MediaPlayerClient::mediaPlayerHostWindow): Deleted. (WebCore::MediaPlayerClient::mediaPlayerWindowClipRect): Deleted. 2014-09-17 Iago Toral and Zan Dobersek [GTK] Add Wayland support to GLContextEGL https://bugs.webkit.org/show_bug.cgi?id=136829 Reviewed by Martin Robinson. * platform/graphics/egl/GLContextEGL.cpp: (WebCore::sharedEGLDisplay): Special-case the shared EGL display initialization for the GTK port when running under Wayland. In that case the pointer to the native wl_display object should be passed to eglGetDisplay(). If not running under Wayland we should fall back to using the shared X11 display (if support for that display system is enabled) or the EGL_DEFAULT_DISPLAY. 2014-09-17 Daniel Bates Unreviewed, rolling out r173695. Broke building third-party Legacy WebKit apps; will investigate offline Reverted changeset: "[iOS] Make WebCore build with public iOS SDK" https://bugs.webkit.org/show_bug.cgi?id=136487 http://trac.webkit.org/changeset/173695 2014-09-17 Roger Fong Speculative fix for a fast\dom\html-collections-named-getter failing only in Debug builds. * dom/Node.cpp: (WebCore::Document::invalidateNodeListAndCollectionCaches): 2014-09-17 Benjamin Poulain Add parsing for :nth-child(An+B of selector) https://bugs.webkit.org/show_bug.cgi?id=136845 Reviewed by Antti Koivisto. Add support for parsing :nth-child(of). The implementation of selector matching will be in a follow up, there are enough edge cases here already. Spec here: http://dev.w3.org/csswg/selectors4/#the-nth-child-pseudo Test: fast/css/parsing-css-nth-child-of.html * css/CSSParser.cpp: (WebCore::CSSParser::detectFunctionTypeToken): (WebCore::CSSParser::realLex): The parser generate two new kinds of tokens: -NTHCHILDFUNCTION, matching the "nth-child" identifier. -NTHCHILDSELECTORSEPARATOR, matching the "of" keyword separating An+B from the selector list. NTHCHILDFUNCTION is used to extend the new syntax only for :nth-child() and not all the "nth" functions (e.g. :nth-of-type()). NTHCHILDSELECTORSEPARATOR exists for two reasons: -We must clear the "parsingMode" before parsing selectorList. If we failed to do that, the complex selectors would be parsed in NthChildMode, which has all kind of bad side effects. -The second reason is differentiacting "of" for all the other identifiers. Arguably, this could have been done in the grammar, but it is clearer this way since we already need the branches for the parsingMode. * css/CSSGrammar.y.in: Those are pretty much duplicates of the existing FUNCTION rules but supporting the new syntax. * css/CSSParserValues.cpp: (WebCore::selectorListMatchesPseudoElement): (WebCore::CSSParserSelector::matchesPseudoElement): Matching pseudo elements does not make much sense for those selectorList (e.g. :nth-child(2n of ::before)). Add helper function to fail parsing of those cases. * css/CSSParserValues.h: * css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText): * css/CSSSelector.h: (WebCore::CSSSelector::selectorList): Updated serialization code for CSS OM. 2014-09-17 Benjamin Poulain CSS value in whitespace-separated list attribute selector (~=) mishandles tab/newline/etc. https://bugs.webkit.org/show_bug.cgi?id=136807 Reviewed by Antti Koivisto. The spec defines selector lists as token separated by white space. The definition of white space for CSS Selectors is: "White space in Selectors consists of the code points SPACE (U+0020), TAB (U+0009), LINE FEED (U+000A), CARRIAGE RETURN (U+000D), and FORM FEED (U+000C) can occur in whitespace. Other space-like code points, such as EM SPACE (U+2003) and IDEOGRAPHIC SPACE (U+3000), are never part of white space." The old code was only matching SPACE (U+0020) which is buggy. This patch adds support for the other caracters. Tests: fast/selectors/attr-list-01.html fast/selectors/attribute-list-with-whitespace-in-selector.html fast/selectors/attribute-list-with-whitespace-in-value.html * css/SelectorChecker.cpp: (WebCore::attributeValueMatches): * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::constructFragments): (WebCore::SelectorCompiler::attributeValueSpaceSeparetedListContains): Add the missing checks. * html/track/VTTRegion.cpp: (WebCore::VTTRegion::setRegionSettings): (WebCore::VTTRegion::parseSettingValue): * html/track/WebVTTParser.cpp: (WebCore::WebVTTParser::hasRequiredFileIdentifier): (WebCore::WebVTTParser::collectTimingsAndSettings): * html/track/WebVTTParser.h: While looking for affected code, I discovered WebVTT redefines isHTMLSpace(). I cleaned that code. 2014-09-17 Gavin Barraclough Aways have a PageThrottler (sometimes have a UserActivity::Impl) https://bugs.webkit.org/show_bug.cgi?id=136892 Reviewed by Geoffrey Garen. Some instances of Page have a PageThrottler to track activity on the Page, and some do not. (Specifically, those created from WebPage in WK2 do, those related to WK1, SVG & inspector do not). We do this for three reasons: * We do not need to take AppNap assertions on WK1. * Some Pages do not track their visibility correctly, and would always claim to be visible. * Page VisibilityState is not set until after construction, so if we instantiate Creating the entire PageThrottler lazily has the drawback that we have to check for its existence at numerous points throughout the code, and we'll miss activity that occurs between the Page being created & the PageThrottler added to it (really a theoretical problem right now, since they're currently always created pretty much back to back). Instead, Page should always have a PageThrottler, & instead make the UserActivity::Impl on the PageThrottler be added later. * WebCore.exp.in: - createPageThrottler -> enablePageThrottler * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::parseAttribute): - Page::pageThrottler now returns a reference rather than a pointer * loader/FrameLoader.cpp: (WebCore::FrameLoader::started): - Page::pageThrottler now returns a reference rather than a pointer * page/Page.cpp: (WebCore::Page::Page): - instantiate PageThrottler in constructor (WebCore::Page::enablePageThrottler): - renamed from createPageThrottler, instead of creating the PageThrottler this method now instruct PageThrottler to create a UserActivity::Impl (WebCore::Page::setViewState): - m_pageThrottler is not a pointer (WebCore::Page::createPageThrottler): Deleted. - renamed to enablePageThrottler * page/Page.h: (WebCore::Page::pageThrottler): - now returns a reference * page/PageThrottler.cpp: (WebCore::PageThrottler::PageThrottler): - no longer instantiate m_activity (WebCore::PageThrottler::createUserActivity): - lazily instantiate m_activity, call updateUserActivity (WebCore::PageThrottler::updateUserActivity): - m_activity may not yet be instantiated; added early return * page/PageThrottler.h: - m_activity becomes a std::unique_ptr, added createUserActivity 2014-09-17 Daniel Bates [iOS] Make WebCore build with public iOS SDK https://bugs.webkit.org/show_bug.cgi?id=136487 Reviewed by David Kilzer. Add headers that wrap Mac and iOS SPIs and update WebCore source files to include these headers instead of the corresponding actual SPI header(s). * WebCore.vcxproj/WebCore.vcxproj: * WebCore.vcxproj/WebCore.vcxproj.filters: * WebCore.vcxproj/WebCoreCG.props: * WebCore.vcxproj/copyForwardingHeaders.cmd: * WebCore.xcodeproj/project.pbxproj: * bindings/objc/DOMInternal.mm: * bridge/objc/objc_instance.mm: * platform/audio/ios/MediaSessionManagerIOS.mm: * platform/cocoa/DisplaySleepDisablerCocoa.cpp: * platform/cocoa/MemoryPressureHandlerCocoa.mm: * platform/graphics/SimpleFontData.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: * platform/graphics/ca/mac/PlatformCALayerMac.mm: * platform/graphics/cg/BitmapImageCG.cpp: * platform/graphics/cg/ColorCG.cpp: * platform/graphics/cg/GraphicsContextCG.cpp: * platform/graphics/cg/ImageSourceCG.cpp: * platform/graphics/cg/PDFDocumentImage.cpp: * platform/graphics/cocoa/FontPlatformDataCocoa.mm: * platform/graphics/ios/FontCacheIOS.mm: * platform/graphics/ios/FontServicesIOS.mm: * platform/graphics/ios/SimpleFontDataIOS.mm: * platform/graphics/mac/FontMac.mm: * platform/graphics/mac/GlyphPageTreeNodeMac.cpp: * platform/graphics/mac/MediaPlayerProxy.h: * platform/graphics/mac/SimpleFontDataMac.mm: * platform/ios/LegacyTileCache.mm: * platform/ios/LegacyTileGrid.mm: * platform/ios/LegacyTileGridTile.mm: * platform/ios/PlatformEventFactoryIOS.mm: * platform/ios/PlatformScreenIOS.mm: * platform/ios/WebEvent.mm: * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: * platform/ios/wak/WAKAppKitStubs.h: * platform/ios/wak/WAKView.h: * platform/ios/wak/WKGraphics.h: * platform/ios/wak/WKGraphics.mm: * platform/ios/wak/WebCoreThread.mm: * platform/network/ios/QuickLook.mm: * platform/spi/ca/CALayerSPI.h: Added. * platform/spi/ca/CATiledLayerSPI.h: Added. * platform/spi/cf/CFLocaleSPI.h: Modified to use EXTERN_C. * platform/spi/cf/CFNetworkConnectionCacheSPI.h: Ditto. Also changed header visibility from private to project. * platform/spi/cf/CFURLRequestSPI.h: Ditto. Also modified to unconditionally include header . * platform/spi/cg/CGColorTransformSPI.h: Added. * platform/spi/cg/CGContextSPI.h: Added. * platform/spi/cg/CGFloatSPI.h: Added. * platform/spi/cg/CGFontGlyphSupportSPI.h: Added. * platform/spi/cg/CGFontInfoSPI.h: Added. * platform/spi/cg/CGFontRenderingSPI.h: Added. * platform/spi/cg/CGFontUnicodeSupportSPI.h: Added. * platform/spi/cg/CGImageSPI.h: Added. * platform/spi/cg/CGSRegionSPI.h: Added. * platform/spi/cocoa/DispatchSPI.h: Added. * platform/spi/cocoa/IOPMLibSPI.h: Added. * platform/spi/cocoa/MachVMSPI.h: Added. * platform/spi/cocoa/NSFileManagerSPI.h: Added. * platform/spi/cocoa/NSGeometrySPI.h: Added. * platform/spi/cocoa/NSPointerFunctionsSPI.h: Added. * platform/spi/cocoa/dyldSPI.h: Added. * platform/spi/ios/AVPlayerControllerSPI.h: Added. * platform/spi/ios/AVPlayerViewControllerSPI.h: Added. * platform/spi/ios/AVValueTimingSPI.h: Added. * platform/spi/ios/AVVideoLayerSPI.h: Added. * platform/spi/ios/CTFontDescriptorSPI.h: Added. * platform/spi/ios/CTFontSPI.h: Added. * platform/spi/ios/CUICatalogSPI.h: Added. * platform/spi/ios/CUIStyleEffectConfigurationSPI.h: Added. * platform/spi/ios/MPAVRoutingControllerSPI.h: Added. * platform/spi/ios/MobileGestaltSPI.h: Added. * platform/spi/ios/QLPreviewConverterSPI.h: Added. * platform/spi/ios/QuickLookSPI.h: Added. * rendering/RenderThemeIOS.mm: 2014-09-17 Gavin Barraclough DOM timer throttling for hidden plugins https://bugs.webkit.org/show_bug.cgi?id=136197 Reviewed by Geoff Garen & Andreas Kling. For non-visible web pages we slow timers (since they can't be driving animations, etc). We should do the same for plugins. There are a few steps to this: - JSPluginElementFunctions notifies DOMTimer when script interacts with a plugin. - DOMTimerFireState keeps a record of events that occur while a timer is firing. - DOMTimer::fired detects timers that interact with invisible/inaudible plugins, and flags itself for throtting. - DOMTimer::intervalClampedToMinimum sets timer intervals appropriately. * bindings/js/JSPluginElementFunctions.cpp: (WebCore::pluginScriptObject): - notify DOMTimer when script interacts with a plugin. * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::isDetectable): * html/HTMLPlugInElement.h: - added isDetectable, to check for visible / audible plugins. * page/DOMTimer.cpp: (WebCore::DOMTimerFireState::DOMTimerFireState): (WebCore::DOMTimerFireState::~DOMTimerFireState): - track current DOMTimerFireState. (WebCore::DOMTimer::DOMTimer): - initialize m_throttleState. (WebCore::DOMTimer::scriptDidInteractWithPlugin): - if interaction with a plugin occurs while a timer is firing, record on the DOMTimerFireState. (WebCore::DOMTimer::fired): - set DOMTimerFireState, and update m_throttleState accordingly. (WebCore::DOMTimer::updateTimerIntervalIfNecessary): - remove redundant check of maxTimerNestingLevel (covered by intervalClampedToMinimum). (WebCore::DOMTimer::intervalClampedToMinimum): - Also take m_throttleState into account when throttling. * page/DOMTimer.h: - added scriptDidInteractWithPlugin, m_throttleState. * platform/audio/AudioHardwareListener.h: - enum -> enum class. * plugins/PluginViewBase.h: (WebCore::PluginViewBase::audioHardwareActivity): - expose audioHardwareActivity on PluginViewBase (previously available in subclass). 2014-09-16 Gavin Barraclough Exclude page visibility from PageThrottler's hysteresis https://bugs.webkit.org/show_bug.cgi?id=136866 Reviewed by Geoff Garen. Including visibility in the hysteresis mechanism has the effect of prolonging the visually idle timeout, and causing the page hide event to be run at foreground priority. Neither of these are particularly desirable. Instead separate visibility from the rest of the page activities we track (and apply hysteresis to), and feed this directly into determination of the UserActivity state. * page/PageThrottler.cpp: (WebCore::PageThrottler::PageThrottler): - when the PageThrottler is instantiated call updateUserActivity to set initial UserActivity. (WebCore::PageThrottler::incrementActivityCount): - simplified - when m_activityCount becomes non-zero, start m_hysteresis. (WebCore::PageThrottler::decrementActivityCount): - simplified - when m_activityCount becomes zero, stop m_hysteresis. (WebCore::PageThrottler::updateUserActivity): - end the UserActivity (allow AppNap) if visually idle and no page activity is taking place. (WebCore::PageThrottler::setViewState): - when the visually idle state changed call updateUserActivity to update the UserActivity. (WebCore::PageThrottler::started): (WebCore::PageThrottler::stopped): - when the hysteresis state changed call updateUserActivity to update the UserActivity. (WebCore::PageThrottler::updateHysteresis): Deleted. - removed: simplified the hysteresis trigger, we now incorporate visually idle state in updateUserActivity. * page/PageThrottler.h: - removed updateHysteresis, added updateUserActivity. * platform/HysteresisActivity.h: (WebCore::HysteresisActivity::state): - determine the curent state of the HysteresisActivity - started, waiting, or stopped. 2014-09-17 Carlos Garcia Campos [GTK] Fix runtime critical warnings when writing to the clipboard after r173687 https://bugs.webkit.org/show_bug.cgi?id=136891 Reviewed by Philippe Normand. * platform/gtk/PasteboardHelper.cpp: (WebCore::PasteboardHelper::writeClipboardContents): Check passed callback is not null before trying to ref/unref it since g_closure_ref/unref are not null safe. 2014-09-17 Zan Dobersek [GTK] Add a helper function for display system deduction https://bugs.webkit.org/show_bug.cgi?id=136849 Reviewed by Martin Robinson. getDisplaySystemType() is a helper function that checks the type of the default GdkDisplay object and initializes a static variable to the corresponding value. It then returns the value of that variable. When building with the GTK+2 API (still the case with the GTK+2 plugin process) we default to X11. The function is declared and implemented in GtkUtilities files. * platform/gtk/GtkUtilities.cpp: (WebCore::widgetIsOnscreenToplevelWindow): (WebCore::getDisplaySystemType): * platform/gtk/GtkUtilities.h: 2014-09-16 Yusuke Suzuki filterRootById accidentally clears inAdjacentChain flag https://bugs.webkit.org/show_bug.cgi?id=136851 Reviewed by Benjamin Poulain. Test: fast/selectors/filter-root-node-with-selector-contains-adjacents.html * dom/SelectorQuery.cpp: (WebCore::filterRootById): 2014-09-16 Carlos Garcia Campos [GTK] Fix layering violations in PasteboardGtk https://bugs.webkit.org/show_bug.cgi?id=136802 Reviewed by Darin Adler. Refactor the Pasteboard code moving the WebCore parts to the Editor. * PlatformGTK.cmake: Add new file to compilation. * editing/Editor.cpp: (WebCore::Editor::performCutOrCopy): (WebCore::Editor::copyImage): * editing/Editor.h: * editing/gtk/EditorGtk.cpp: Added. (WebCore::createFragmentFromPasteBoardData): (WebCore::Editor::pasteWithPasteboard): (WebCore::getImageAndURLForElement): (WebCore::Editor::writeImageToPasteboard): (WebCore::Editor::writeSelectionToPasteboard): * page/DragController.cpp: (WebCore::DragController::startDrag): * page/gtk/DragControllerGtk.cpp: (WebCore::DragController::declareAndWriteDragImage): * platform/Pasteboard.h: * platform/gtk/DataObjectGtk.cpp: Remove range member, the caller should call setText() + setMarkup() intead. (WebCore::DataObjectGtk::setText): (WebCore::DataObjectGtk::setMarkup): (WebCore::DataObjectGtk::clearText): (WebCore::DataObjectGtk::clearMarkup): (WebCore::DataObjectGtk::clearAllExceptFilenames): * platform/gtk/DataObjectGtk.h: (WebCore::DataObjectGtk::hasText): (WebCore::DataObjectGtk::hasMarkup): (WebCore::DataObjectGtk::clearImage): (WebCore::DataObjectGtk::text): (WebCore::DataObjectGtk::markup): (WebCore::DataObjectGtk::setRange): Deleted. * platform/gtk/GtkDragAndDropHelper.h: * platform/gtk/PasteboardGtk.cpp: (WebCore::PasteboardImage::PasteboardImage): (WebCore::PasteboardImage::~PasteboardImage): (WebCore::Pasteboard::write): (WebCore::Pasteboard::writeSelection): Deleted. (WebCore::getURLForImageElement): Deleted. (WebCore::Pasteboard::writeImage): Deleted. (WebCore::Pasteboard::documentFragment): Deleted. * platform/gtk/PasteboardHelper.cpp: (WebCore::displayFromFrame): Deleted. (WebCore::PasteboardHelper::getPrimarySelectionClipboard): Deleted. * platform/gtk/PasteboardHelper.h: 2014-09-16 Carlos Garcia Campos DragData should not depend on Clipboard, DocumentFragment, and Document https://bugs.webkit.org/show_bug.cgi?id=21358 Reviewed by Darin Adler. Refactor DragData to not depend on Frame, DocumentFragment, Document and Range. DragData::asFragment() has been moved to DragController and implemented in the platform specific file. DragData methods using Frame has been reworked in Mac to not use Frame, since all other ports were ignoreing the frame parameter. * page/DragController.cpp: (WebCore::DragController::documentFragmentFromDragData): Make it a static member to be able to use createFragmentFromDragData(). (WebCore::DragController::performDragOperation): Update to DragData API changes. (WebCore::DragController::dispatchTextInputEventFor): Ditto. (WebCore::DragController::concludeEditDrag): Ditto. (WebCore::documentFragmentFromDragData): Deleted. * page/DragController.h: * page/efl/DragControllerEfl.cpp: (WebCore::DragController::createFragmentFromDragData): Move DragData::asFragment() implementation here. * page/gtk/DragControllerGtk.cpp: (WebCore::DragController::dragOperation): (WebCore::DragController::createFragmentFromDragData): Ditto. * page/mac/DragControllerMac.mm: (WebCore::DragController::dragOperation): (WebCore::DragController::createFragmentFromDragData): Ditto. * page/win/DragControllerWin.cpp: (WebCore::DragController::createFragmentFromDragData): Ditto. * platform/DragData.h: * platform/efl/DragDataEfl.cpp: (WebCore::DragData::asPlainText): Remove Frame parameter. (WebCore::DragData::containsURL): Ditto. (WebCore::DragData::asURL): Ditto. (WebCore::DragData::asFragment): Deleted. * platform/gtk/DragDataGtk.cpp: (WebCore::DragData::asPlainText): Remove Frame parameter. (WebCore::DragData::containsCompatibleContent): (WebCore::DragData::containsURL): Ditto. (WebCore::DragData::asURL): Ditto. (WebCore::DragData::asFragment): Deleted. * platform/mac/DragDataMac.mm: (WebCore::DragData::asPlainText): Same implementation as the Editor. (WebCore::DragData::containsURL): Remove Frame parameter. (WebCore::DragData::asURL): Use URLByCanonicalizingURL() instead of using the Editor client. (WebCore::DragData::asFragment): Deleted. * platform/win/DragDataWin.cpp: (WebCore::DragData::containsURL): Remove Frame parameter. (WebCore::DragData::asURL): Ditto. (WebCore::DragData::asPlainText): Ditto. (WebCore::DragData::containsCompatibleContent): (WebCore::DragData::asFragment): Deleted. 2014-09-16 Chris Dumez Rename Node::childNode(index) to traverseToChildAt(index) for clarity https://bugs.webkit.org/show_bug.cgi?id=136825 Reviewed by Benjamin Poulain. Rename Node::childNode(index) to traverseToChildAt(index) to make it clearer that the method is actually traversing the children and thus potentially expensive. This patch also avoids calling traverseToChildAt() in a couple of easily avoidable cases. No new tests, no behavior change. * WebCore.exp.in: * WebCore.order: Remove symbol for ContainerNode::childNode() as it was renamed. It does not seem we need to expose ContainerNode::traverseToChildAt(). * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::stringForVisiblePositionRange): (WebCore::AccessibilityObject::lengthForVisiblePositionRange): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper arrayOfTextForTextMarkers:attributed:]): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]): Mechanical renaming. * dom/ContainerNode.cpp: (WebCore::ContainerNode::traverseToChildAt): (WebCore::ContainerNode::childNode): Deleted. * dom/ContainerNode.h: (WebCore::Node::traverseToChildAt): (WebCore::Node::childNode): Deleted. * dom/Node.h: - Rename Node / ContainerNode's childNode(index) to traverseToChildAt(index) to make it clear that it is actually traversing the children and thus potentially expensive. - Clean up the implementation of ContainerNode::traverseToChildAt() to avoid the use of an extra |i| variable. * dom/Position.cpp: (WebCore::Position::computeNodeBeforePosition): Avoid calling traverseToChildAt(-1). Relying on the unsigned argument wrapping and the method returning null in this case is a bit obscure and causes unnecessary traversal of all children. (WebCore::Position::computeNodeAfterPosition): (WebCore::Position::previous): (WebCore::Position::next): Mechanical renaming and update variable names to stop using abbreviations as per coding style. * dom/PositionIterator.h: (WebCore::PositionIterator::PositionIterator): * dom/Range.cpp: (WebCore::Range::insertNode): (WebCore::Range::checkNodeWOffset): (WebCore::Range::firstNode): (WebCore::Range::pastLastNode): * dom/RangeBoundaryPoint.h: (WebCore::RangeBoundaryPoint::set): * editing/BreakBlockquoteCommand.cpp: (WebCore::BreakBlockquoteCommand::doApply): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::removeChildrenInRange): * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::handleGeneralDelete): * editing/InsertParagraphSeparatorCommand.cpp: (WebCore::InsertParagraphSeparatorCommand::doApply): * editing/TextIterator.cpp: (WebCore::nextInPreOrderCrossingShadowBoundaries): (WebCore::TextIterator::node): (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): * editing/VisibleUnits.cpp: (WebCore::nextLinePosition): * editing/cocoa/HTMLConverter.mm: (WebCore::editingAttributedStringFromRange): Mechanical renaming. * inspector/DOMPatchSupport.cpp: (WebCore::DOMPatchSupport::innerPatchChildren): Iterate over children while incrementing the |i| variable to avoid calling traverseToChildAt(index) repeatedly and thus traversing the children from the beginning every time. 2014-09-16 Joseph Pecoraro Web Inspector: Reduce a bit of churn setting initial remote inspection state https://bugs.webkit.org/show_bug.cgi?id=136875 Reviewed by Timothy Hatcher. * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::finishCreation): We no longer need to toggle this state. 2014-09-16 Enrica Casucci Should have an editing behavior specific for IOS. https://bugs.webkit.org/show_bug.cgi?id=136876 Reviewed by Sam Weinig. This patch introduces a new editing behavior type to be able to perform editing tasks that are specific to iOS. All the existing EditingBehavior methods return the same boolean value for for Mac and iOS. A new one has been introduced to support a specific behavior in the DeleteSelectionCommand. * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::doApply): * editing/EditingBehavior.h: (WebCore::EditingBehavior::shouldConsiderSelectionAsDirectional): (WebCore::EditingBehavior::shouldCenterAlignWhenSelectionIsRevealed): (WebCore::EditingBehavior::shouldToggleStyleBasedOnStartOfSelection): (WebCore::EditingBehavior::shouldAlwaysGrowSelectionWhenExtendingToBoundary): (WebCore::EditingBehavior::shouldSelectOnContextualMenuClick): (WebCore::EditingBehavior::shouldExtendSelectionByWordOrLineAcrossCaret): (WebCore::EditingBehavior::shouldRebalanceWhiteSpacesInSecureField): * editing/EditingBehaviorTypes.h: * editing/FrameSelection.cpp: (WebCore::FrameSelection::positionForPlatform): * page/Settings.cpp: (WebCore::editingBehaviorTypeForPlatform): * testing/InternalSettings.cpp: (WebCore::InternalSettings::setEditingBehavior): 2014-09-16 Commit Queue Unreviewed, rolling out r173670. https://bugs.webkit.org/show_bug.cgi?id=136871 Creates layering violation (Requested by enrica on #webkit). Reverted changeset: "Move HTMLConverter from editing/cocoa to platform/cocoa." https://bugs.webkit.org/show_bug.cgi?id=136474 http://trac.webkit.org/changeset/173670 2014-09-16 Eric Carlson [Mac] MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput doesn't work with rotated movies https://bugs.webkit.org/show_bug.cgi?id=136872 Reviewed by Tim Horton. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator): Add logging. (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput): Apply the video track preferred transform. 2014-09-16 Enrica Casucci Move HTMLConverter from editing/cocoa to platform/cocoa. https://bugs.webkit.org/show_bug.cgi?id=136474 Reviewed by Benjamin Poulain. This is a platform specific class and it belongs to the platform folder. * WebCore.xcodeproj/project.pbxproj: * editing/cocoa: Removed. * editing/cocoa/HTMLConverter.h: Removed. * editing/cocoa/HTMLConverter.mm: Removed. * platform/cocoa/HTMLConverter.h: Copied from editing/cocoa/HTMLConverter.h. * platform/cocoa/HTMLConverter.mm: Copied from editing/cocoa/HTMLConverter.mm. 2014-09-16 Enrica Casucci Remove PLATFORM(IOS) from WebCore/editing (Part 3). https://bugs.webkit.org/show_bug.cgi?id=136474 Reviewed by Benjamin Poulain. This is the updated version of the patch that was landed in r173340. This patch removes the use of PLATFORM(IOS) from TextAffinity.h and removes the assumption that EAffinity values match NSSelectionAffinity values. It also removes the includes in TextAffinity.h, creating the need to include explicitly the files when necessary. * editing/TextAffinity.h: (kit): Deleted. (core): Deleted. * editing/cocoa/HTMLConverter.mm: * page/mac/WebCoreFrameView.h: 2014-09-16 Beth Dakin overflow:scroll should not leave space for a scroll corner with overlay scrollbars https://bugs.webkit.org/show_bug.cgi?id=136861 Reviewed by Sam Weinig. overflow:scroll should behave like overflow:auto when the scrollbar will render as an overlay scrollbar. Re-name hasAutoVerticalScrollbar()/Horizontal to hasVerticalScrollbarWithAutoBehavior()/Horizontal, and return true for overflow:scroll scrollbars that will render as overlay scrollbars. * rendering/RenderBox.cpp: (WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior): (WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior): * rendering/RenderBox.h: (WebCore::RenderBox::scrollsOverflowX): (WebCore::RenderBox::scrollsOverflowY): (WebCore::RenderBox::hasAutoVerticalScrollbar): Deleted. (WebCore::RenderBox::hasAutoHorizontalScrollbar): Deleted. Re-name overflowRequiresScrollbar() to styleRequiresScrollbar() and also re-name overflowDefinesAutomaticScrollbar() to styleDefinesAutomaticScrollbar(), and make these functions take into account the fact that overflow:scroll should act like overflow:auto when the scrollbar will render as an overlay scrollbar. * rendering/RenderLayer.cpp: (WebCore::styleRequiresScrollbar): (WebCore::styleDefinesAutomaticScrollbar): (WebCore::RenderLayer::updateScrollbarsAfterLayout): (WebCore::RenderLayer::calculateClipRects): 2014-09-16 peavo@outlook.com [Curl] Sometimes incomplete or empty content can be loaded from cache. https://bugs.webkit.org/show_bug.cgi?id=136855 Reviewed by Alex Christensen. Sometimes, when two requests with the same url are started at the same time, there is a possibility of loading incomplete or empty content from the cache. This happens because the method CurlCacheEntry::isLoading() is returning the wrong status in the time period between the headers are received, and the content data is received. This can be fixed by using a flag for the load status, instead of checking whether the content file is open. * platform/network/curl/CurlCacheEntry.cpp: (WebCore::CurlCacheEntry::CurlCacheEntry): Initialize loading flag. (WebCore::CurlCacheEntry::isLoading): Return loading flag. (WebCore::CurlCacheEntry::didFail): Call new method to set loading flag. (WebCore::CurlCacheEntry::didFinishLoading): Ditto. (WebCore::CurlCacheEntry::setIsLoading): Added new method to set loading flag. * platform/network/curl/CurlCacheEntry.h: Added loading flag and new method to set it. * platform/network/curl/CurlCacheManager.cpp: (WebCore::CurlCacheManager::didReceiveResponse): Call new method to set loading flag. 2014-09-16 Chris Dumez Rename Node::nodeIndex() to computeNodeIndex() for clarity https://bugs.webkit.org/show_bug.cgi?id=136826 Reviewed by Benjamin Poulain. Rename Node::nodeIndex() to computeNodeIndex() to make it clear that index is being computed and that calling this method is potentially expensive. No new tests, no behavior change. * WebCore.exp.in: * WebCore.order: Rename exported symbol for Node::nodeIndex() as well. * dom/Document.cpp: (WebCore::Document::caretRangeFromPoint): * dom/Node.cpp: (WebCore::Node::computeNodeIndex): (WebCore::Node::nodeIndex): Deleted. * dom/Node.h: * dom/NodeWithIndex.h: (WebCore::NodeWithIndex::index): Clean up implementation to reduce the scope of the Node variable and to follow coding style (variable naming, spacing, star placement). * dom/Position.cpp: (WebCore::Position::computeOffsetInContainerNode): (WebCore::Position::previous): (WebCore::Position::next): (WebCore::Position::upstream): (WebCore::Position::downstream): * dom/Position.h: (WebCore::positionInParentBeforeNode): (WebCore::positionInParentAfterNode): * dom/Range.cpp: (WebCore::Range::compareNode): (WebCore::Range::intersectsNode): (WebCore::Range::processContents): (WebCore::Range::insertNode): (WebCore::Range::setStartAfter): (WebCore::Range::setEndBefore): (WebCore::Range::setEndAfter): (WebCore::Range::setStartBefore): * dom/RangeBoundaryPoint.h: (WebCore::RangeBoundaryPoint::ensureOffsetIsValid): * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical): (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical): * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::handleGeneralDelete): * editing/Editor.cpp: (WebCore::Editor::avoidIntersectionWithDeleteButtonController): * editing/FrameSelection.cpp: (WebCore::FrameSelection::selectFrameElementInParentIfFullySelected): * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::doApply): * editing/TextIterator.cpp: (WebCore::TextIterator::range): (WebCore::SimplifiedBackwardsTextIterator::handleReplacedElement): (WebCore::SimplifiedBackwardsTextIterator::handleNonTextNode): * editing/htmlediting.cpp: (WebCore::updatePositionForNodeRemoval): * html/HTMLTextFormControlElement.cpp: (WebCore::setContainerAndOffsetForRange): * page/DOMSelection.cpp: (WebCore::DOMSelection::getRangeAt): (WebCore::DOMSelection::containsNode): (WebCore::DOMSelection::shadowAdjustedOffset): * rendering/RenderBlock.cpp: (WebCore::positionForPointRespectingEditingBoundaries): * rendering/RenderTreeAsText.cpp: (WebCore::nodePosition): 2014-09-16 Jer Noble Videos with controls enabled never receive 'dragstart' events. https://bugs.webkit.org/show_bug.cgi?id=136837 Reviewed by Eric Carlson. Fixes a crash regression introduced by r173631. Node::contains() has an interesting property of returning false if `this` is NULL. Rather than depending on this behavior, explicitly NULL-check state.source and bail early. * page/DragController.cpp: (WebCore::DragController::startDrag): 2014-09-16 Csaba Osztrogonác URTBF after r173659. After r173659 convertToIntLength() is used only inside ENABLE(DASHBOARD_SUPPORT), so it became unused function and caused build failure if ENABLE(DASHBOARD_SUPPORT) is false. Source/WebCore/css/StyleResolver.cpp:1471:15: error: 'WebCore::Length WebCore::convertToIntLength(const WebCore::CSSPrimitiveValue*, const WebCore::CSSToLengthConversionData&)' defined but not used [-Werror=unused-function] cc1plus: all warnings being treated as errors * css/StyleResolver.cpp: Missing ENABLE(DASHBOARD_SUPPORT) guard added. 2014-09-14 Darin Adler Scroll snap properties don't handle inherit and initial propertly. https://bugs.webkit.org/show_bug.cgi?id=136643 Reviewed by Beth Dakin. Restructured scroll snap code both to handle inherit and initial, and to reduce the total code size a bit, fixing a few minor bugs along the way. Updated the regression tests to cover the new parts. * css/CSSComputedStyleDeclaration.cpp: (WebCore::addValuesForNamedGridLinesAtIndex): Use a modern for loop. (WebCore::scrollSnapDestination): Changed to take a LengthSize. Also streamlined. (WebCore::scrollSnapPoints): Changed to to take a ScrollSnapPoints. Also streamlined and added code to handle the "uses elements" case; serialize that as an identifier, not the string "elements", fixing a minor bug. (WebCore::scrollSnapCoordinates): Changed to take a Vector. Also streamlined and added code to handle the empty vector case; serialize that as an identifier, not the string "none", fixing a minor bug. (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword): Use nullptr. (WebCore::counterToCSSValue): Use nullptr. (WebCore::ComputedStyleExtractor::styledNode): Use nullptr. (WebCore::ComputedStyleExtractor::propertyValue): Use nullptr. Moved CSS_SCROLL_SNAP to a more appropriate section of the switch statement. Made it just call through to the functions above in a more straightforward way. (WebCore::CSSComputedStyleDeclaration::getPropertyValue): Reversed logic to use early return and to call emptyString. (WebCore::CSSComputedStyleDeclaration::item): Use emptyString. (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand): Use nullptr. (WebCore::CSSComputedStyleDeclaration::parentRule): Use nullptr. (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Use nullptr. (WebCore::CSSComputedStyleDeclaration::getPropertyPriority): Use emptyString. (WebCore::CSSComputedStyleDeclaration::getPropertyShorthand): Use emptyString. * css/DeprecatedStyleBuilder.cpp: (WebCore::ApplyPropertyMarqueeIncrement::applyValue): Use the switch statement for the invalid value as well as for the valid values, rather than a separate if statement. Call convertToLength directly rather than through a StyleResolver static member function. * css/PropertySetCSSStyleDeclaration.cpp: (WebCore::PropertySetCSSStyleDeclaration::getPropertyValue): Fixed a formatting mistake. * css/StyleResolver.cpp: (WebCore::convertToIntLength): Made this function local to this file instead of a static member function. (WebCore::convertToFloatLength): Ditto. (WebCore::StyleResolver::parseSnapCoordinate): Added. Used to keep snap point parsing code small. (WebCore::StyleResolver::parseSnapCoordinatePair): Ditto. (WebCore::StyleResolver::parseSnapPoints): Added. Parses an entire snap points property. (WebCore::StyleResolver::applyProperty): Removed various bits of redundant code that were not using the primitiveValue value already in a local variable. Added the HANDLE_INHERIT_AND_INITIAL to all the scroll snap properties and updated since the RenderStyle structure now more closely matches the CSS properties. * css/StyleResolver.h: Updated for above changes, and removed a redundant "private:". * page/scrolling/AxisScrollSnapOffsets.cpp: (WebCore::appendChildSnapOffsets): Use auto& instead of SnapCoordinate since that type is now gone. Updated since coordinates are now LengthSize. (WebCore::updateFromStyle): Changed to take a reference instead of a pointer and also to fetch the data from RenderStyle in a new way that more closely matches the CSS properties. (WebCore::updateSnapOffsetsForScrollableArea): Ditto. Also moved some memory allocation inside if statements so we don't wastefully allocate and destroy. * rendering/style/RenderStyle.cpp: Added an include of StyleScrollSnapPoints.h now that the header doesn't include them. Moved the conditional includes out of the main include paragraph (even though I don't think conditional includes are usually a good idea). (WebCore::RenderStyle::initialScrollSnapPointsX): Added. (WebCore::RenderStyle::initialScrollSnapPointsY): Added. (WebCore::RenderStyle::initialScrollSnapDestination): Added. (WebCore::RenderStyle::initialScrollSnapCoordinates): Added. (WebCore::RenderStyle::scrollSnapPointsX): Added. (WebCore::RenderStyle::scrollSnapPointsY): Added. (WebCore::RenderStyle::scrollSnapDestination): Added. (WebCore::RenderStyle::scrollSnapCoordinates): Added. (WebCore::RenderStyle::setScrollSnapPointsX): Added. (WebCore::RenderStyle::setScrollSnapPointsY): Added. (WebCore::RenderStyle::setScrollSnapDestination): Added. (WebCore::RenderStyle::setScrollSnapCoordinates): Added. * rendering/style/RenderStyle.h: Replaced the include of StyleScrollSnapPoints.h with a forward declaration of ScrollSnapPoints. Removed getters and setters for the old style properties and replaced them with new ones that match the CSS properties more closely. Tweaked formatting a bit. Added initial value functions for the the scroll snap properties. * rendering/style/StyleRareNonInheritedData.cpp: Added include of StyleScrollSnapPoints.h now that RenderStyle.h doesn't include it. (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): Updated since m_scrollSnapType is now unsigned instead of ScrollSnapType. * rendering/style/StyleRareNonInheritedData.h: Fixed type of m_scrollSnapType to be unsigned instead of ScrollSnapType. This should have been causing problems on Windows, but I think we got lucky and had no detectable problems. * rendering/style/StyleScrollSnapPoints.cpp: (WebCore::ScrollSnapPoints::ScrollSnapPoints): Added. (WebCore::operator==): Added overloads for both ScrollSnapPoints and also for StyleScrollSnapPoints; using a free function for both since both have public data. (WebCore::defaultScrollSnapDestination): Added, replaces a static member function. (WebCore::StyleScrollSnapPoints::StyleScrollSnapPoints): Updated both the default constructor and the copy constructor for the new design. * rendering/style/StyleScrollSnapPoints.h: Added a ScrollSnapPoints struct for the type of the snap-points-x and snap-points-y CSS properties. Changed the data members of StyleScrollSnapPoints to match the various CSS properties rather than breaking out all the data into separate data members. (WebCore::StyleScrollSnapPoints::defaultRepeatOffset): Deleted. Replaced by the default constructor for ScrollSnapPoints. (WebCore::StyleScrollSnapPoints::defaultDestinationOffset): Deleted. Replaced by a function inside the .cpp file. 2014-09-16 Youenn Fablet [GStreamer] http/tests/media/video-auth.html is failing https://bugs.webkit.org/show_bug.cgi?id=126619 Reviewed by Philippe Normand. Test: http/tests/media/video-auth-cors.html Use stored credentials when retrieving videos following image loading behavior (i.e. stored credentials are always used except when in cors anonymous mode), except that requesting credentials from user remains disabled for cross-origin requests. Patch is covered by http/tests/media/video-auth.html. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (CachedResourceStreamingClient::CachedResourceStreamingClient): Enable using stored credentials except when using cors anonymous mode. 2014-09-16 Jinho Bang Add version of drawFocusIfNeeded that take a Path2D parameter. https://bugs.webkit.org/show_bug.cgi?id=136846 Reviewed by Dirk Schulze. Tests: fast/canvas/draw-focus-if-needed-with-path.html * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::drawFocusIfNeeded): (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal): * html/canvas/CanvasRenderingContext2D.h: * html/canvas/CanvasRenderingContext2D.idl: 2014-09-15 Iago Toral and Zan Dobersek [GTK] Add WaylandDisplay https://bugs.webkit.org/show_bug.cgi?id=136216 Reviewed by Martin Robinson. Add the WaylandDisplay class. This class is used in the LayerTreeHostGtk, in the WebProcess, and controls the connection to the nested Wayland compositor in the UIProcess. Only one instance of the class is used in the WebProcess, accessible via the static WaylandDisplay::instance() method. The WaylandDisplay constructor performs the EGL initialization while also querying the Wayland register, resulting in initializing client-side objects that can interact with the wl_compositor and wl_webkitgtk interfaces implemented in the nested Wayland compositor. The single class instance is only deemed properly initialized if it picked up the Wayland interface objects and has properly acquired the EGL display and config. WaylandDisplay::createSurface() is called by the LayerTreeHostGtk during its own initialization. The method creates a new wl_surface object via the wl_compositor interface and a new wl_egl_window object that's based on that surface. For the wl_egl_window object, we fall back to a width or height of 1 in case the passed-in value for either is 0. This avoids problems in Mesa where widths or heights of 0 are not supported. We associate the created surface with the passed-in widget ID, as provided by LayerTreeHostGtk, via the wl_webkitgtk interface. This enables proper mapping of Wayland surfaces and the GtkWidgets in the UIProcess and makes it possible for the nested Wayland compositor to correctly determine which GtkWidget has to be redrawn after some surface has been committed. WaylandDisplay::createSharingGLContext() creates a new GLContextEGL object that's to be used as a sharing context. The method creates a new surface via the wl_compositor interface and uses it to create a dummy native EGL window that's 1x1px in size. The GLContextEGL object is then created through the static GLContextEGL::createWindowContext() method. * PlatformGTK.cmake: * platform/graphics/wayland/WaylandDisplay.cpp: Added. (WebCore::WaylandDisplay::globalCallback): (WebCore::WaylandDisplay::globalRemoveCallback): (WebCore::WaylandDisplay::instance): (WebCore::WaylandDisplay::WaylandDisplay): (WebCore::WaylandDisplay::createSurface): (WebCore::WaylandDisplay::createSharingGLContext): * platform/graphics/wayland/WaylandDisplay.h: Added. (WebCore::WaylandDisplay::nativeDisplay): (WebCore::WaylandDisplay::eglDisplay): * platform/graphics/wayland/WaylandSurface.cpp: (WebCore::WaylandSurface::~WaylandSurface): Assert that the WaylandDisplay instance is present before going on to destroy the surface resources. 2014-09-15 Chris Dumez Rename LiveNodeLists / HTMLCollections's nodeMatches() to elementMatches() https://bugs.webkit.org/show_bug.cgi?id=136844 Reviewed by Sam Weinig. Rename LiveNodeLists / HTMLCollections's nodeMatches() to elementMatches() for clarity as the argument is an Element. No new tests, no behavior change. * dom/ClassNodeList.h: (WebCore::ClassNodeList::elementMatches): (WebCore::ClassNodeList::nodeMatches): Deleted. * dom/DocumentOrderedMap.cpp: (WebCore::keyMatchesWindowNamedItem): (WebCore::keyMatchesDocumentNamedItem): * dom/Element.cpp: (WebCore::Element::updateNameForDocument): (WebCore::Element::updateIdForDocument): * dom/LiveNodeList.cpp: (WebCore::LiveNodeList::namedItem): * dom/LiveNodeList.h: (WebCore::CachedLiveNodeList::collectionBegin): (WebCore::CachedLiveNodeList::collectionLast): (WebCore::CachedLiveNodeList::collectionTraverseForward): (WebCore::CachedLiveNodeList::collectionTraverseBackward): * dom/NameNodeList.h: (WebCore::NameNodeList::elementMatches): (WebCore::NameNodeList::nodeMatches): Deleted. * dom/TagNodeList.h: (WebCore::TagNodeList::elementMatches): (WebCore::HTMLTagNodeList::elementMatches): (WebCore::TagNodeList::nodeMatches): Deleted. (WebCore::HTMLTagNodeList::nodeMatches): Deleted. * html/HTMLCollection.cpp: (WebCore::isMatchingElement): * html/HTMLNameCollection.cpp: (WebCore::WindowNameCollection::elementMatchesIfNameAttributeMatch): (WebCore::WindowNameCollection::elementMatches): (WebCore::DocumentNameCollection::elementMatchesIfIdAttributeMatch): (WebCore::DocumentNameCollection::elementMatchesIfNameAttributeMatch): (WebCore::DocumentNameCollection::elementMatches): (WebCore::WindowNameCollection::nodeMatchesIfNameAttributeMatch): Deleted. (WebCore::WindowNameCollection::nodeMatches): Deleted. (WebCore::DocumentNameCollection::nodeMatchesIfIdAttributeMatch): Deleted. (WebCore::DocumentNameCollection::nodeMatchesIfNameAttributeMatch): Deleted. (WebCore::DocumentNameCollection::nodeMatches): Deleted. * html/HTMLNameCollection.h: * html/LabelsNodeList.cpp: (WebCore::LabelsNodeList::elementMatches): (WebCore::LabelsNodeList::nodeMatches): Deleted. * html/LabelsNodeList.h: * html/RadioNodeList.cpp: (WebCore::RadioNodeList::elementMatches): (WebCore::RadioNodeList::nodeMatches): Deleted. * html/RadioNodeList.h: 2014-09-15 Chris Dumez Use an AtomicString as key for caching ClassNodeList objects https://bugs.webkit.org/show_bug.cgi?id=136830 Reviewed by Benjamin Poulain. Use an AtomicString as key for caching ClassNodeList objects instead of a String. ClassNodeList is the only type using a String instead of an AtomicString as key in the cache HashTable. This brings some complexity. I believe this was done to avoid unnecessarily atomizing the String, for performance reasons. However, at the moment, the String gets atomized anyway when constructing the ClassNodeList object. This is because the ClassNodeList::m_classNames member is of SpaceSplitString type and the SpaceSplitString constructor takes an AtomicString in argument. Using an AtomicString to cache ClassNodeLists simplifies the code quite a bit and decreases the size of NodeListsNodeData as well. Test: fast/dom/getElementsByClassName/conflict-tag-name.html * WebCore.order: Remove symbol corresponding to addCacheWithName() as it was removed. * dom/ClassNodeList.cpp: (WebCore::ClassNodeList::~ClassNodeList): Update the constructor to take an AtomicString in argument instead of a String, for clarity. The String gets atomized when initializing m_classNames anyway. (WebCore::ClassNodeList::ClassNodeList): Call removeCacheWithAtomicName() instead of removeCacheWithName() now that m_originalClassNames is an AtomicString. * dom/ClassNodeList.h: Use AtomicString instead of String type for classNames, in both the constructor argument and the m_originalClassNames data member. * dom/ContainerNode.cpp: (WebCore::ContainerNode::getElementsByClassName): Call addCacheWithAtomicName() instead of addCacheWithName() now that addCacheWithName() has been removed. * dom/Node.cpp: (WebCore::NodeListsNodeData::invalidateCaches): Stop invalidating m_nameCaches as this HashMap no longer exists. * dom/NodeRareData.h: (WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::hash): (WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::equal): (WebCore::NodeListsNodeData::isEmpty): (WebCore::NodeListsNodeData::adoptDocument): (WebCore::NodeListsNodeData::namedNodeListKey): (WebCore::NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList): (WebCore::NodeListsNodeData::addCacheWithName): Deleted. (WebCore::NodeListsNodeData::removeCacheWithName): Deleted. - Drop addCacheWithName() / removeCacheWithName() now that no NodeList uses a String as HashMap key. - Drop m_nameCaches now that ClassNodeLists are cached in m_atomicNameCaches instead. - Remove StringType template parameter and hardcode AtomicString instead. 2014-09-15 Chris Dumez Return early in SelectorChecker::checkOne() if selector.isAttributeSelector() is true https://bugs.webkit.org/show_bug.cgi?id=136838 Reviewed by Benjamin Poulain. Return early in SelectorChecker::checkOne() if selector.isAttributeSelector() is true and the selector matched. Previously, we were only returning early if the selector did not match and we were falling through if it did. This means that we ended up doing the 2 if() checks below in the method unnecessarily: - selector.m_match == CSSSelector::PseudoClass - selector.m_match == CSSSelector::PseudoElement No new tests, no behavior change. * css/SelectorChecker.cpp: (WebCore::SelectorChecker::checkOne): 2014-09-15 Chris Dumez Un-inline the Node constructor https://bugs.webkit.org/show_bug.cgi?id=136842 Reviewed by Benjamin Poulain. Un-inline the Node constructor as it does not seem to impact performance, based on my testing: http://dromaeo.com/?id=226992,226998 This reduces the stripped binary size by ~4Kb. No new tests, no behavior change. * dom/Document.h: (WebCore::Node::Node): Deleted. * dom/Node.cpp: (WebCore::Node::Node): 2014-09-15 Shivakumar JM Web Core: Websocket state should be set to closed in didReceiveMessage call back. https://bugs.webkit.org/show_bug.cgi?id=136219 Reviewed by Alexey Proskuryakov. Set the Websocket state to closed in didReceiveMessage call back. Test: http/tests/websocket/tests/hybi/error-event-ready-state.html * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::didReceiveMessageError): 2014-09-15 Jon Honeycutt Naming clean-up. Rubber-stamped by Andy Estes. * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::requestAutocomplete): (WebCore::HTMLFormElement::finishRequestAutocomplete): Remove superfluous "AutocompleteResult". * html/HTMLFormElement.h: Ditto. 2014-09-15 Alexey Proskuryakov Crash when logging in to optionshouse.com https://bugs.webkit.org/show_bug.cgi?id=136834 Reviewed by Anders Carlsson. No test, because I couldn't make one. I don't have a way to reproduce first-hand. * platform/network/cf/SocketStreamHandleCFNet.cpp: (WebCore::SocketStreamHandle::readStreamCallback): (WebCore::SocketStreamHandle::writeStreamCallback): 2014-09-15 Jer Noble Unreviewed build fix for 32-bit builds. Make casts from unsigned long long -> size_t explicit, rather than implicit. Also make CARingBuffer be protected by USING_MEDIA_TOOLBOX so ports without that flag won't try to compile unused code. * platform/audio/mac/CARingBuffer.cpp: (WebCore::CARingBuffer::fetch): * platform/audio/mac/CARingBuffer.h: * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: (WebCore::AudioSourceProviderAVFObjC::provideInput): 2014-09-15 Jer Noble Unreviewed logic fix from r173631. Logic for includeShadowDOM was reversed. * page/DragController.cpp: (WebCore::DragController::startDrag): 2014-09-15 Jer Noble Videos with controls enabled never receive 'dragstart' events. https://bugs.webkit.org/show_bug.cgi?id=136837 Reviewed by Simon Fraser. When initiating a drag, the DragController checks whether the hit-tested element at a drag location is a child of the drag source, and bails if early if that is not the case. For a