2016-01-03 Khem Raj WebKit fails to build with musl libc library https://bugs.webkit.org/show_bug.cgi?id=152625 Reviewed by Daniel Bates and Alexey Proskuryakov. malloc_trim is glibc specific API so guard it with __GLIBC__. * platform/linux/MemoryPressureHandlerLinux.cpp: (MemoryPressureHandler::platformReleaseMemory): Guard malloc_trim() call with __GLIBC_. 2016-03-10 Carlos Garcia Campos [GTK] Scrollbars are broken once again with current GTK+ master https://bugs.webkit.org/show_bug.cgi?id=155292 Reviewed by Michael Catanzaro. Most of the trough theming properties have been moved to the scrollbar, and a new gadget "contents" has been added between the scrollbar and its children. * platform/gtk/ScrollbarThemeGtk.cpp: (WebCore::ScrollbarThemeGtk::getOrCreateStyleContext): Add left/bottom style classes to ensure the scrollbars border is taken into account and rendered. (WebCore::ScrollbarThemeGtk::paintTrackBackground): Also create style context for contents gadget. (WebCore::ScrollbarThemeGtk::paintThumb): Ditto. (WebCore::ScrollbarThemeGtk::paintButton): Ditto. (WebCore::ScrollbarThemeGtk::scrollbarThickness): Take the scrollbar border into account. (WebCore::ScrollbarThemeGtk::buttonSize): Also create style context for contents gadget. (WebCore::ScrollbarThemeGtk::getStepperSpacing): Ditto. (WebCore::ScrollbarThemeGtk::minimumThumbLength): Ditto. (WebCore::ScrollbarThemeGtk::thumbFatness): Ditto. (WebCore::ScrollbarThemeGtk::getTroughBorder): Take the scrollbar border into account. 2016-03-04 Carlos Garcia Campos [GTK] Scrollbars are broken again with GTK+ >= 3.19.11 https://bugs.webkit.org/show_bug.cgi?id=154890 Reviewed by Michael Catanzaro. Scrollbar style properties have been deprecated in GTK+, and it seems that now deprecating means keeping the properties but ignoring them. So, this reworks the whole scrollbars theme code again to not cache style properties anymore, but retrieve them from the GtkStyleContext. Previous GTK+ versions still need to query the style properties, so I've added helper functions to get all the style properties with the ifdefs, trying to keep the common render code free of GTK+ versions ifdefs. * platform/gtk/ScrollbarThemeGtk.cpp: (WebCore::ScrollbarThemeGtk::backButtonRect): (WebCore::ScrollbarThemeGtk::forwardButtonRect): (WebCore::ScrollbarThemeGtk::trackRect): (WebCore::ScrollbarThemeGtk::thumbRect): (WebCore::ScrollbarThemeGtk::paintTrackBackground): (WebCore::ScrollbarThemeGtk::paintThumb): (WebCore::ScrollbarThemeGtk::paint): (WebCore::ScrollbarThemeGtk::scrollbarThickness): (WebCore::ScrollbarThemeGtk::buttonSize): (WebCore::ScrollbarThemeGtk::stepperSize): (WebCore::ScrollbarThemeGtk::getStepperSpacing): (WebCore::ScrollbarThemeGtk::troughUnderSteppers): (WebCore::ScrollbarThemeGtk::minimumThumbLength): (WebCore::ScrollbarThemeGtk::thumbFatness): (WebCore::ScrollbarThemeGtk::getTroughBorder): (WebCore::ScrollbarThemeGtk::getOrCreateStyleContext): (WebCore::ScrollbarThemeGtk::updateThemeProperties): (WebCore::ScrollbarThemeGtk::handleMousePressEvent): * platform/gtk/ScrollbarThemeGtk.h: 2016-02-18 Andy Estes Revert to dispatching the popstate event synchronously https://bugs.webkit.org/show_bug.cgi?id=153297 rdar://problem/24092294 Reviewed by Brent Fulgham. r192369 made the popstate event dispatch asynchronously, which matches what the HTML5 spec says to do. However, due to compatibility regressions we need to revert back to dispatching synchronously. This change reverts r192369's changes to Document.cpp, but retains the new tests. Firing popstate synchronously makes both fast/loader/remove-iframe-during-history-navigation-different.html and fast/loader/remove-iframe-during-history-navigation-same.html crash, because their onpopstate handlers remove frames from the document that will later be accessed by HistoryController::recursiveGoToItem(). To prevent the crashes, this change does two things: 1. Keep a reference to the current frame inside FrameLoader::loadSameDocumentItem(), since calling loadInSameDocument() might otherwise delete it. 2. Handle a null frame when iterating a HistoryItem's child frames in HistoryController::recursiveGoToItem(), since calling goToItem() on one frame might cause another frame to be deleted. Covered by existing tests. fast/loader/stateobjects/popstate-is-asynchronous.html was renamed to fast/loader/stateobjects/popstate-is-synchronous.html and modified to expect synchronous dispatch. * dom/Document.cpp: (WebCore::Document::enqueuePopstateEvent): * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadSameDocumentItem): * loader/HistoryController.cpp: (WebCore::HistoryController::recursiveGoToItem): 2015-11-11 Jon Honeycutt popstate event should be dispatched asynchronously https://bugs.webkit.org/show_bug.cgi?id=36202 Based on an original patch by Mihai Parparita . Reviewed by Brent Fulgham. Tests: fast/loader/remove-iframe-during-history-navigation-different.html fast/loader/remove-iframe-during-history-navigation-same.html fast/loader/stateobjects/popstate-is-asynchronous.html * dom/Document.cpp: (WebCore::Document::enqueuePopstateEvent): Use enqueueWindowEvent(). 2016-02-24 Carlos Garcia Campos [GTK] Tearing when entering AC mode https://bugs.webkit.org/show_bug.cgi?id=150955 Reviewed by Michael Catanzaro. * platform/gtk/GtkUtilities.cpp: (WebCore::widgetIsOnscreenToplevelWindow): Allow passing nullptr. 2016-02-19 Philippe Normand [GStreamer] clean-up various leaks https://bugs.webkit.org/show_bug.cgi?id=154285 Reviewed by Carlos Garcia Campos. * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: (webkit_web_audio_src_init): Take full ownership of the GstTask. * platform/graphics/gstreamer/GRefPtrGStreamer.cpp: (WTF::adoptGRef): Null pointer support in ASSERTs. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::initializeGStreamerAndRegisterWebKitElements): Take full ownership of the GstElementFactory pointers. (WebCore::MediaPlayerPrivateGStreamer::isAvailable): Ditto. 2016-02-16 Simon Fraser Every RenderLayer should not have to remove itself from the scrollableArea set https://bugs.webkit.org/show_bug.cgi?id=154311 Reviewed by Zalan Bujtas. A subset of RenderLayers are are scrollable, and get registered on the FrameView, but we pay the cost of a hash lookup for removal on every RenderLayer, which is a waste. Store a bit that tells RenderLayer that it's in the set and needs to be removed. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::RenderLayer): (WebCore::RenderLayer::~RenderLayer): (WebCore::RenderLayer::calculateClipRects): * rendering/RenderLayer.h: 2016-02-16 Simon Fraser Rollout r188659. This broke scrolling of iframes and overflow when navigating back to a page in the page cache. The fix was overly agressive and had no layout test. I will fix the original issue a different way. * history/CachedFrame.cpp: (WebCore::CachedFrame::CachedFrame): * page/FrameView.cpp: (WebCore::FrameView::clearScrollableAreas): Deleted. * page/FrameView.h: 2016-02-16 Carlos Garcia Campos [GTK] No hover-horizontal scrolling available https://bugs.webkit.org/show_bug.cgi?id=122859 Reviewed by Michael Catanzaro. This is a regression of WebKit2, because in WebKit1 we used native widgets for frame scrollbars that handled this automatically. Now we need to also check if the mouse is over frame scrollbars to adjust the wheel event. Test: platform/gtk/scrollbars/main-frame-scrollbar-horizontal-wheel-scroll.html * page/EventHandler.cpp: (WebCore::EventHandler::handleWheelEvent): Pass the adjusted wheel event to platformCompleteWheelEvent(). * page/gtk/EventHandlerGtk.cpp: (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal): Check also frame scrollbars. 2016-02-16 Carlos Garcia Campos Mouse cursor doesn't change when entering scrollbars https://bugs.webkit.org/show_bug.cgi?id=154243 Reviewed by Simon Fraser. If the scrollbar is over or very close to text or a link, when entering the scrollbar the cursor is not changed, keeping the beam or hand cursor when using the scrollbar. Same happens for image documents where the magnifier cursor is used and it remains when entering the scrollbars. We should use pointer cursor always for scrollbars. * page/EventHandler.cpp: (WebCore::EventHandler::updateCursor): Request also to include frame scrollbars in hit test result. (WebCore::EventHandler::selectCursor): Use always pointer cursor for scrollbars. 2016-02-15 Jer Noble Null-deref crash in DefaultAudioDestinationNode::suspend() https://bugs.webkit.org/show_bug.cgi?id=154248 Reviewed by Alex Christensen. Null-check scriptExecutionContext() before deref. * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::resume): (WebCore::DefaultAudioDestinationNode::suspend): (WebCore::DefaultAudioDestinationNode::close): 2016-02-12 Csaba Osztrogonác GCC buildfix in Source/WebCore/svg/SVGToOTFFontConversion.cpp https://bugs.webkit.org/show_bug.cgi?id=154162 Reviewed by Andreas Kling. * svg/SVGToOTFFontConversion.cpp: (WebCore::SVGToOTFFontConverter::finishAppendingKERNSubtable): 2016-02-09 Carlos Garcia Campos [GTK] Toggle buttons are blurry with GTK+ 3.19 https://bugs.webkit.org/show_bug.cgi?id=154007 Reviewed by Michael Catanzaro. Use min-width/min-height style properties when GTK+ >= 3.19.7 to get the size of toggle buttons. * rendering/RenderThemeGtk.cpp: (WebCore::setToggleSize): (WebCore::paintToggle): 2016-02-08 Carlos Garcia Campos [GTK] WebKitWebView should send crossing events to the WebProcess https://bugs.webkit.org/show_bug.cgi?id=153740 Reviewed by Michael Catanzaro. Update the target element under the mouse also when only updating scrollbars, so that if the mouse enters the page when the window is not active, the scroll animator is notified that the mouse entered the scrollable area. * page/EventHandler.cpp: (WebCore::EventHandler::handleMouseMoveEvent): Call updateMouseEventTargetNode() before early returning in case of only updating scrollbars. 2016-02-05 Carlos Garcia Campos [GTK] Scrollbars incorrectly rendered with older versions of GTK+ https://bugs.webkit.org/show_bug.cgi?id=153861 Reviewed by Michael Catanzaro. The theme doesn't really know it's a scrollbar. Older versions of GTK+ require to explicitly add the scrollbar style class to the child GtkStyleContext. * platform/gtk/ScrollbarThemeGtk.cpp: (WebCore::createChildStyleContext): 2016-02-05 Carlos Garcia Campos [GTK] Scrollbars not correctly rendered in non GNOME environments https://bugs.webkit.org/show_bug.cgi?id=153860 Reviewed by Michael Catanzaro. I noticed this in a matchbox environment, where there's no gnome-setting-daemon running. The problem is only with the scrollbars, because we initialize the GtkSettings in RenderThemeGtk and notify the ScrollbarTheme when it changes, but ScrollbarTheme is created before RenderThemeGtk so we initialize the theme properties before the GtkSettings have been initialized. We can just let the ScrollbarTheme monitor the theme itself instead of relying on being notified by the WebCore layer. * platform/gtk/ScrollbarThemeGtk.cpp: (WebCore::themeChangedCallback): (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk): * rendering/RenderThemeGtk.cpp: (WebCore::gtkStyleChangedCallback): Deleted. 2016-02-03 Carlos Garcia Campos Do not show context menu when right clicking on a scrollbar https://bugs.webkit.org/show_bug.cgi?id=153493 Reviewed by Michael Catanzaro. Scrollbars don't currently handle right clicks, but we are showing the context menu when they are right clicked. This is not desired at least in GTK+ and I've checked that it isn't consistent with other applications in Mac either. Test: fast/events/contextmenu-on-scrollbars.html * page/EventHandler.cpp: (WebCore::EventHandler::sendContextMenuEvent): 2016-02-03 Carlos Garcia Campos [GTK] Layout Test http/tests/appcache/different-https-origin-resource-main.html is failing https://bugs.webkit.org/show_bug.cgi?id=145253 Reviewed by Michael Catanzaro. The problem is that when the load is cancelled while the connection is still being established, SoupMessage::notify::tls-errors is emitted and the handler calls ResourceHandleClient::didFail() which can delete the ResourceHandle. * platform/network/soup/ResourceHandleSoup.cpp: (WebCore::tlsErrorsChangedCallback): Protect the ResourceHandle for the scope of the callback because ResourceHandleClient::didFail() could delete the object. 2016-02-03 Zan Dobersek [TexMap] Don't use RELEASE_ASSERT in TextureMapperLayer::computeTransformsRecursive() https://bugs.webkit.org/show_bug.cgi?id=153822 Reviewed by Carlos Garcia Campos. * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::computeTransformsRecursive): Use ASSERT to check that the m_children members are indeed children of the current layer, RELEASE_ASSERT probably slipped in unnoticed at some point. 2016-02-03 Zan Dobersek PlatformPathCairo: Lazily allocate the path surface https://bugs.webkit.org/show_bug.cgi?id=153821 Reviewed by Carlos Garcia Campos. Move the static variable that holds the Cairo surface into the pathSurface() function (previously getPathSurface). This way the surface will only be allocated once the function is called for the first time from the CairoPath surface. No change in functionality, just a cleanup. * platform/graphics/cairo/PlatformPathCairo.cpp: (WebCore::pathSurface): (WebCore::CairoPath::CairoPath): (WebCore::getPathSurface): Deleted. 2016-02-02 Fujii Hironori ASSERTION FAILED: roundedIntPoint(rendererMappedResult) == roundedIntPoint(result) https://bugs.webkit.org/show_bug.cgi?id=153576 Reviewed by Darin Adler. Tests: fast/block/geometry-map-assertion-with-rounding-negative-half.html The results of roundedIntPoint of FloatPoint and LayoutPoint may be different because of the uniqueness of LayoutUnit::round introduced by this bug . Should convert a FloatPoint to a LayoutPoint before rounding. * rendering/RenderGeometryMap.cpp: (WebCore::RenderGeometryMap::mapToContainer): 2016-02-02 Jinyoung Hur WEBGL_debug_shaders should be disabled for OpenGLES backend also https://bugs.webkit.org/show_bug.cgi?id=153788 Reviewed by Darin Adler. WEBGL_debug_shaders extension is disabled for OpenGL backed platform because the implementation is not fully compliant to the spec yet. Because this is not an OpenGL-specific problem, WEBGL_debug_shaders extension should be disabled for OpenGLES backed platforms also. No new tests, already covered by existing tests. * platform/graphics/opengl/Extensions3DOpenGL.cpp: (WebCore::Extensions3DOpenGL::supportsExtension): Deleted. * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp: (WebCore::Extensions3DOpenGLCommon::supports): 2016-02-01 Jer Noble REGRESSION(r195770): Use-after-free in ResourceLoaderOptions::cachingPolicy https://bugs.webkit.org/show_bug.cgi?id=153727 Reviewed by Chris Dumez. The `this` object may be freed after calling deleteIfPossible(). Make the early-return-if- deleted more explicit, and only check allowsCaching() after the deleteIfPossible() return value check. * loader/cache/CachedResource.cpp: (WebCore::CachedResource::removeClient): 2016-01-29 Brent Fulgham [WebGL] Check vertex array bounds before permitting a glDrawArrays to execute https://bugs.webkit.org/show_bug.cgi?id=153643 Reviewed by Dean Jackson. Tested by fast/canvas/webgl/webgl-drawarrays-crash.html. * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::validateDrawArrays): Make sure that we have at least one buffer bound to a program if a drawArray call with a non-zero range of requested data is being made. (WebCore::WebGLRenderingContextBase::validateDrawElements): Drive-by formatting fix. 2016-01-29 ChangSeok Oh [GStreamer] built-in media player doesn't update https://bugs.webkit.org/show_bug.cgi?id=151816 Reviewed by Xabier Rodriguez-Calvar. The timeline of audio controls in media document is not properly updated since it is assumed that the controls are hidden as soon as playing. However, such full page audio always has opacity : 1 declared by video:-webkit-full-page-media::-webkit-media-controls-panel.no-video. i.e. it is not actually hidden. We can fix this by simply returning false for no-video media in controlsAreHidden(); Test: media/audio-controls-timeline-in-media-document.html * Modules/mediacontrols/mediaControlsBase.js: (Controller.prototype.controlsAreAlwaysVisible): (Controller.prototype.controlsAreHidden): 2016-01-27 Nan Wang AX: Crash in AccessibilityTableColumn::headerObject https://bugs.webkit.org/show_bug.cgi?id=153553 Reviewed by Chris Fleizach. Webkit was crashing sometimes when we asked for column headers of a table. The columns vector of the table was reset during the iteration when we were asking for the headerObject of each column. The column's addChildren() function calls elementRect() for each child cell and that sometimes causes the parent table to reset its children. Fixed it by caching the columns vector and moving out the elementRect() logic from AccessibilityTalbeColumn::addChildren(). * accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::columnHeaders): (WebCore::AccessibilityTable::rowHeaders): * accessibility/AccessibilityTableColumn.cpp: (WebCore::AccessibilityTableColumn::elementRect): (WebCore::AccessibilityTableColumn::headerObject): (WebCore::AccessibilityTableColumn::addChildren): * accessibility/AccessibilityTableColumn.h: 2016-01-26 Chris Dumez fast/history/page-cache-webdatabase-no-transaction-db.html flakily crashes https://bugs.webkit.org/show_bug.cgi?id=153525 Reviewed by Andreas Kling. The test was crashing because DatabaseThread::hasPendingDatabaseActivity() was accessing m_openDatabaseSet from the main thread without any locking mechanism. This is an issue because m_openDatabaseSet is altered by the database thread. No new tests, already covered by fast/history/page-cache-webdatabase-no-transaction-db.html. * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseThread::databaseThread): (WebCore::DatabaseThread::recordDatabaseOpen): (WebCore::DatabaseThread::recordDatabaseClosed): (WebCore::DatabaseThread::hasPendingDatabaseActivity): * Modules/webdatabase/DatabaseThread.h: 2016-01-26 Konstantin Tokarev Do not convert GlyphBufferAdvance to FloatSize https://bugs.webkit.org/show_bug.cgi?id=153429 GlyphBufferAdvance is not necessaryly convertible to FloatSize. Also, this code was doing extra work by transforming height value. Reviewed by Antti Koivisto. No new tests needed. * rendering/svg/SVGTextRunRenderingContext.cpp: (WebCore::SVGGlyphToPathTranslator::extents): 2016-01-25 Eric Carlson Media "ended" event incorrectly fires when currentTime is set https://bugs.webkit.org/show_bug.cgi?id=150348 Reviewed by Jer Noble. Test: media/media-ended-fired-once.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::invalidateCachedTime): Always mark m_cachedTime as invalid. 2016-01-25 Carlos Garcia Campos REGRESSION(r192773): [GTK] maps.google.com unresponsive/stalls since r192773 https://bugs.webkit.org/show_bug.cgi?id=153194 Reviewed by Michael Catanzaro. In r192773 we implemented the JavaScriptCore garbage collector timers for the GTK+ port. Those timers schedule sources in the current thread default main context, but JS web worker threads implementation doesn't use WTF::RunLoop, but its own WorkerRunLoop class that doesn't create a GMainContext for the new thread. This means that for web sites using workers, we are now doing garbage collection of worker VMs in the main thread which ends up in a deadlock at some point. We need to ensure that worker threads create a GMainContext and push it as the default one for the thread before the WorkerGlobalScope is created. This way when the worker Heap is created, the GC timers use the right context to schedule their sources. And then we need to check if there are sources pending in the thread main context on every worker run loop iteration. * workers/WorkerRunLoop.cpp: (WebCore::WorkerRunLoop::runInMode): * workers/WorkerThread.cpp: (WebCore::WorkerThread::workerThread): 2016-01-23 Wonchul Lee [GTK] Fix media controls displaying without controls attribute https://bugs.webkit.org/show_bug.cgi?id=152500 Media controls is not displayed without controls attribute by default when the video element has text track. It'll be displayed on fullscreen regardless of controls attribute. Reviewed by Michael Catanzaro. * Modules/mediacontrols/mediaControlsGtk.js: (ControllerGtk.prototype.shouldHaveControls): (ControllerGtk.prototype.reconnectControls): (ControllerGtk.prototype.removeControls): (ControllerGtk.prototype.configureControls): Deleted. 2016-01-21 Dave Hyatt Elements with overflow and border-radius don't show in multicolumn properly. https://bugs.webkit.org/show_bug.cgi?id=152920 Reviewed by Simon Fraser. Added new test in fast/multicol. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::convertToLayerCoords): (WebCore::RenderLayer::offsetFromAncestor): (WebCore::RenderLayer::clipToRect): * rendering/RenderLayer.h: Make sure the crawl up the containing block chain to apply clips properly offsets to account for columns. convertToLayerCoords could already handle this, so offsetFromAncestor now takes the same extra argument (whether or not to adjust for columns) that convertToLayerCoords does. 2016-01-21 Simon Fraser REGRESSION (r168244): Content in horizontal-bt page is offset such that only the end is viewable and there is a white gap at the top https://bugs.webkit.org/show_bug.cgi?id=136019 Reviewed by Dan Bernstein. In horizontal-bt documents (where the page starts scrolled to the bottom, and scrolling up goes into negative scroll positions), the position of the root content layer would be set incorrectly by the scrolling thread, resulting in misplaced content. Fix by having the renamed "yPositionForRootContentLayer" take scroll origin into account, and being more consistent about using scrollOrigin to position this layer. Test: fast/scrolling/programmatic-horizontal-bt-document-scroll.html * page/FrameView.cpp: (WebCore::FrameView::yPositionForFooterLayer): Moved (WebCore::FrameView::positionForRootContentLayer): Take scrollOrigin, and subtract it from the computed value. (WebCore::FrameView::yPositionForRootContentLayer): Renamed. * page/FrameView.h: * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): We've already pushed the new scrollPosition onto the FrameView, so we can just use the member function to compute the positionForContentsLayer. * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition): This is the bug fix; FrameView::positionForRootContentLayer() now takes scrollOrigin into account. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateRootLayerPosition): Rather than using the documentRect, position the root content layer in terms of the scroll origin (which is -documentRect.location()). 2016-01-21 Said Abou-Hallawa A crash reproducible in Path::isEmpty() under RenderSVGShape::paint() https://bugs.webkit.org/show_bug.cgi?id=149613 Reviewed by Darin Adler. When RenderSVGRoot::layout() realizes its layout size has changed and it has resources which have relative sizes, it marks all the clients of the resources for invalidates regardless whether they belong to the same RenderSVGRoot or not. But it reruns the layout only for its children. If one of these clients comes before the current RenderSVGRoot in the render tree, ee end up having renderer marked for invalidation at rendering time. This also prevents scheduling the layout if the same renderer is marked for another invalidation later. We prevent this because we do not want to schedule another layout for a renderer which is already marked for invalidation. This can cause crash if the renderer is an RenderSVGPath. The fix is to mark "only" the clients of a resource which belong to the same RenderSVGRoot of the resource. Also we need to run the layout for all the resources which belong to different RenderSVGRoots before running the layout for an SVG renderer. Tests: svg/custom/filter-update-different-root.html svg/custom/pattern-update-different-root.html * rendering/svg/RenderSVGResourceContainer.cpp: (WebCore::RenderSVGResourceContainer::markAllClientsForInvalidation): We should not mark any client outside the current root for invalidation * rendering/svg/RenderSVGResourceContainer.h: Remove unneeded private keyword. * rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::addResourceForClientInvalidation): Code clean up; use findTreeRootObject() instead of repeating the same code. * rendering/svg/RenderSVGShape.cpp: (WebCore::RenderSVGShape::isEmpty): Avoid crashing if RenderSVGShape::isEmpty() is called before calling RenderSVGShape::layout(). * rendering/svg/RenderSVGText.cpp: (WebCore::RenderSVGText::layout): findTreeRootObject() now returns a pointer. * rendering/svg/SVGRenderSupport.cpp: (WebCore::SVGRenderSupport::findTreeRootObject): I do think nothing guarantees that an SVG renderer has to have an RenderSVGRoot in its ancestors. So change this function to return a pointer. Also Provide the non-const version of this function. (WebCore::SVGRenderSupport::layoutDifferentRootIfNeeded): Runs the layout if needed for all the resources which belong to different RenderSVGRoots. (WebCore::SVGRenderSupport::layoutChildren): Make sure all the renderer's resources which belong to different RenderSVGRoots are laid out before running the layout for this renderer. * rendering/svg/SVGRenderSupport.h: Remove a mysterious comment. * rendering/svg/SVGResources.cpp: (WebCore::SVGResources::layoutDifferentRootIfNeeded): Run the layout for all the resources which belong to different RenderSVGRoots outside the context of their RenderSVGRoots. * rendering/svg/SVGResources.h: (WebCore::SVGResources::clipper): (WebCore::SVGResources::markerStart): (WebCore::SVGResources::markerMid): (WebCore::SVGResources::markerEnd): (WebCore::SVGResources::masker): (WebCore::SVGResources::filter): (WebCore::SVGResources::fill): (WebCore::SVGResources::stroke): Code clean up; use nullptr instead of 0. 2016-01-20 Zalan Bujtas http://victordarras.fr/cssgame/ doesn't work in Safari. https://bugs.webkit.org/show_bug.cgi?id=153285 Reviewed by Tim Horton. This patch adds support for hittesting ClipPathOperation::Reference. Tests: svg/clip-path/hittest-clip-path-reference-miss.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::nodeAtPoint): * rendering/RenderObject.h: (WebCore::RenderObject::isSVGResourceClipper): * rendering/svg/RenderSVGResourceClipper.h: (isType): 2016-01-19 Konstantin Tokarev Fixed compilation of AXObjectCache in case of !HAVE(ACCESSIBILITY). https://bugs.webkit.org/show_bug.cgi?id=153243 Reviewed by Chris Fleizach. No new tests needed. * accessibility/AXObjectCache.h: (WebCore::AXObjectCache::AXObjectCache): (WebCore::nodeHasRole): Deleted. 2016-01-20 Carlos Garcia Campos Unreviewed. Fix compile warning when building with GTK+ < 3.14. * rendering/RenderThemeGtk.cpp: (WebCore::loadThemedIcon): 2016-01-19 Carlos Garcia Campos Unreviewed. Fix GTK+ build with GTK+ < 3.14. Flags GTK_ICON_LOOKUP_DIR_LTR and GTK_ICON_LOOKUP_DIR_RTL were added in GTK+ 3.14. * rendering/RenderThemeGtk.cpp: (WebCore::loadThemedIcon): 2015-09-18 Chris Dumez WebContent crash in WebCore::MemoryPressureHandler::releaseCriticalMemory() with GuardMalloc when preparing to suspend https://bugs.webkit.org/show_bug.cgi?id=149350 Reviewed by Antti Koivisto. in MemoryPressureHandler::releaseCriticalMemory(), iterate over a copy of Document::allDocuments() instead of iterating over allDocuments() directly. Also make sure the Documents are ref'd inside the copy. This is needed because clearing the StyleResolver of a Document may cause Documents to be unref'd and removed from the allDocument() HashSet. No new tests, already covered by existing tests. * platform/MemoryPressureHandler.cpp: (WebCore::MemoryPressureHandler::releaseCriticalMemory): 2016-01-16 Jeremy Huddleston Sequoia Add Platform.cpp to ANGLESupport https://bugs.webkit.org/show_bug.cgi?id=153120 Reviewed by Darin Adler. No new tests, only addresses a build failure. * CMakeLists.txt: 2016-01-15 Jiewen Tan FrameLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame() is never called when loading a main resource from the memory cache https://bugs.webkit.org/show_bug.cgi?id=152520 Reviewed by Andy Estes. Test: http/tests/loading/server-redirect-for-provisional-load-caching.html * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::responseReceived): Dispatch message to notify client that a cached resource was redirected. So, client can make proper actions to treat server side redirection. * loader/cache/CachedRawResource.h: Add a method to tell whether the cached resource was redirected. 2016-01-15 Olivier Blin [GTK] Fix build of RenderThemeGtk without VIDEO by including HTMLInputElement https://bugs.webkit.org/show_bug.cgi?id=153133 Reviewed by Michael Catanzaro. Build was fine with VIDEO enabled, since HTMLInputElement.h was included by transitivity through MediaControlElements.h and MediaControlElementTypes.h. This seems to be broken since r194847. No new tests since this is just a build fix. * rendering/RenderThemeGtk.cpp: 2016-01-15 Zalan Bujtas ASSERTION FAILED: canHaveChildren() || canHaveGeneratedChildren() in WebCore::RenderElement::insertChildInternal https://bugs.webkit.org/show_bug.cgi?id=123331 Reviewed by Darin Adler. Do not set named flow fragment bit on the flow until after the renderer is attached. Setting/resetting it too early could affect the attach/detach process itself (This is similar to attaching a multi column flow thread). Test: fast/regions/input-box-with-region-assert.html * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::willBeDestroyed): (WebCore::RenderBlockFlow::createRenderNamedFlowFragmentIfNeeded): (WebCore::RenderBlockFlow::setRenderNamedFlowFragment): 2016-01-15 Youenn Fablet CORS: Fix the handling of redirected request containing Origin null. https://bugs.webkit.org/show_bug.cgi?id=128816 Reviewed by Brent Fulgham. Merging Blink patch from George Ancil (https://chromiumcodereview.appspot.com/20735002). This patch removes the check for securityOrigin->isUnique() in passesAccessControlCheck(). This check prevented a redirected request with "Origin: null" from being successful even when the response contains "Access-Control-Allow-Origin: null" Tests: http/tests/xmlhttprequest/access-control-sandboxed-iframe-allow-origin-null.html http/tests/xmlhttprequest/redirect-cors-origin-null.html * loader/CrossOriginAccessControl.cpp: (WebCore::passesAccessControlCheck): 2016-01-14 Daniel Bates Disallow use of Geolocation service from unique origins https://bugs.webkit.org/show_bug.cgi?id=153102 Reviewed by Alexey Proskuryakov. Tests: fast/dom/Geolocation/dataURL-getCurrentPosition.html fast/dom/Geolocation/dataURL-watchPosition.html fast/dom/Geolocation/srcdoc-getCurrentPosition.html fast/dom/Geolocation/srcdoc-watchPosition.html http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition.html http/tests/security/sandboxed-iframe-geolocation-watchPosition.html * Modules/geolocation/Geolocation.cpp: (WebCore::Geolocation::securityOrigin): Convenience function to get the SecurityOrigin object associated with this script execution context. (WebCore::Geolocation::startRequest): Notify requester POSITION_UNAVAILABLE when requested from a document with a unique origin. * Modules/geolocation/Geolocation.h: * page/SecurityOrigin.h: (WebCore::SecurityOrigin::canRequestGeolocation): Added. 2016-01-14 Daniel Bates [XSS Auditor] Extract attribute truncation logic and formalize string canonicalization https://bugs.webkit.org/show_bug.cgi?id=152874 Reviewed by Brent Fulgham. Derived from Blink patch (by Tom Sepez ): Extract the src-like and script-like attribute truncation logic into independent functions towards making it more straightforward to re-purpose this logic. Additionally, formalize the concept of string canonicalization as a member function that consolidates the process of decoding URL escape sequences, truncating the decoded string (if applicable), and removing characters that are considered noise. * html/parser/XSSAuditor.cpp: (WebCore::truncateForSrcLikeAttribute): Extracted from XSSAuditor::decodedSnippetForAttribute(). (WebCore::truncateForScriptLikeAttribute): Ditto. (WebCore::XSSAuditor::init): Write in terms of XSSAuditor::canonicalize(). (WebCore::XSSAuditor::filterCharacterToken): Updated to make use of formalized canonicalization methods. (WebCore::XSSAuditor::filterScriptToken): Ditto. (WebCore::XSSAuditor::filterObjectToken): Ditto. (WebCore::XSSAuditor::filterParamToken): Ditto. (WebCore::XSSAuditor::filterEmbedToken): Ditto. (WebCore::XSSAuditor::filterAppletToken): Ditto. (WebCore::XSSAuditor::filterFrameToken): Ditto. (WebCore::XSSAuditor::filterInputToken): Ditto. (WebCore::XSSAuditor::filterButtonToken): Ditto. (WebCore::XSSAuditor::eraseDangerousAttributesIfInjected): Ditto. (WebCore::XSSAuditor::eraseAttributeIfInjected): Updated code to use early return style and avoid an unnecessary string comparison when we know that a src attribute was injected. (WebCore::XSSAuditor::canonicalizedSnippetForTagName): Renamed; formerly known as XSSAuditor::decodedSnippetForName(). Updated to make use of XSSAuditor::canonicalize(). (WebCore::XSSAuditor::snippetFromAttribute): Renamed; formerly known as XSSAuditor::decodedSnippetForAttribute(). Moved truncation logic from here to WebCore::truncateFor{Script, Src}LikeAttribute. (WebCore::XSSAuditor::canonicalize): Added. (WebCore::XSSAuditor::canonicalizedSnippetForJavaScript): Added. (WebCore::canonicalize): Deleted. (WebCore::XSSAuditor::decodedSnippetForName): Deleted. (WebCore::XSSAuditor::decodedSnippetForAttribute): Deleted. (WebCore::XSSAuditor::decodedSnippetForJavaScript): Deleted. * html/parser/XSSAuditor.h: Define enum class for the various attribute truncation styles. 2016-01-14 Daniel Bates [XSS Auditor] Partial bypass when web server collapses path components https://bugs.webkit.org/show_bug.cgi?id=152872 Reviewed by Brent Fulgham. Merged from Blink (patch by Tom Sepez ): Test: http/tests/security/xssAuditor/embed-tag-in-path-unterminated.html * html/parser/XSSAuditor.cpp: (WebCore::isNonCanonicalCharacter): (WebCore::XSSAuditor::init): (WebCore::XSSAuditor::decodedSnippetForName): (WebCore::XSSAuditor::decodedSnippetForAttribute): (WebCore::XSSAuditor::decodedSnippetForJavaScript): (WebCore::fullyDecodeString): Deleted. 2016-01-14 Beth Dakin imported/blink/editing/text-iterator/read-past-cloned-first-letter.html crashes https://bugs.webkit.org/show_bug.cgi?id=153104 -and corresponding- rdar://problem/24155631 Reviewed by Simon Fraser. Though we merged the Blink test, we never merged Blink patch that fixed this bug. So this is a merge of https://github.com/ChromiumWebApps/blink/commit/5a0d23d4368c661f621364339fde66b41ef019e5 * editing/TextIterator.cpp: (WebCore::SimplifiedBackwardsTextIterator::handleFirstLetter): 2016-01-14 Zalan Bujtas ASSERTION FAILED: !newRelayoutRoot.container() || !newRelayoutRoot.container()->needsLayout() in WebCore::FrameView::scheduleRelayoutOfSubtree https://bugs.webkit.org/show_bug.cgi?id=151605#c1 Reviewed by David Hyatt. Do not let RenderMultiColumnSet/RenderFlowThread mark ancestors dirty while updating scrollbars for overflow content. While updating scrollbars, we only layout descendants so marking parents dirty is unnecessary and could lead to an invalid dirty state. Test: fast/multicol/body-stuck-with-dirty-bit-with-columns.html * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutSpecialExcludedChild): * rendering/RenderFlowThread.cpp: (WebCore::RenderFlowThread::invalidateRegions): * rendering/RenderFlowThread.h: * rendering/RenderMultiColumnSet.cpp: (WebCore::RenderMultiColumnSet::prepareForLayout): 2016-01-14 Martin Robinson [GTK] [EFL] Hyphenation can never work in practice due to requirements on lang tags https://bugs.webkit.org/show_bug.cgi?id=147310 Reviewed by Michael Catanzaro. Test: platform/gtk/fast/text/hyphenate-flexible-locales.html * platform/text/hyphen/HyphenationLibHyphen.cpp: Make locale matching for dictionary selection a lot looser by matching case insensitively, matching multiple dictionaries when only the language is specified, and ignoring the difference between '_' and '-' in the locale name. (WebCore::scanDirectoryForDicionaries): Now produce HashMap of Vectors instead of a single path for each locale. Also add alternate entries to handle different ways of specifying the locale. (WebCore::scanTestDictionariesDirectoryIfNecessary): Update to handle the difference in HashMap type. (WebCore::availableLocales): Ditto. (WebCore::canHyphenate): Also look for the lowercased version of the locale. (WebCore::AtomicStringKeyedMRUCache>::createValueForKey): Key on the dictionary path now so that we can load more than one dictionary per locale. (WebCore::lastHyphenLocation): Iterate through each matched dictionary in turn. 2016-01-14 Youenn Fablet Fix problems with cross-origin redirects https://bugs.webkit.org/show_bug.cgi?id=116075 Reviewed by Daniel Bates. Merging https://chromium.googlesource.com/chromium/blink/+/7ea774e478f84f355748108d2aaabca15355d512 by Ken Russell Same origin redirect responses leading to cross-origin requests were checked as cross-origin redirect responses. Introduced ClientRequestedCredentials to manage whether credentials are needed or not in the cross-origin request. In addition to Blink patch, it was needed to update some loaders with the newly introduced ClientRequestedCredentials parameter. Added the clearing of "Accept-Encoding" header from cross-origin requests as Mac HTTP network layer is adding it for same-origin requests. Test: http/tests/xmlhttprequest/access-control-and-redirects-async-same-origin.html * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::startLoadingMainResource): Added new security parameter (from Blink patch). * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::redirectReceived): Updated checks so that same origin redirections are not treated as cross origin redirections (from Blink patch). * loader/MediaResourceLoader.cpp: (WebCore::MediaResourceLoader::start): * loader/NetscapePlugInStreamLoader.cpp: (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader): Added new security parameter. * loader/ResourceLoaderOptions.h: (WebCore::ResourceLoaderOptions::ResourceLoaderOptions): Added new security parameter (from Blink patch). (WebCore::ResourceLoaderOptions::credentialRequest): (WebCore::ResourceLoaderOptions::setCredentialRequest): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestUserCSSStyleSheet): Ditto. (WebCore::CachedResourceLoader::defaultCachedResourceOptions): Ditto. * loader/icon/IconLoader.cpp: (WebCore::IconLoader::startLoading): Added new security parameter. * page/EventSource.cpp: (WebCore::EventSource::connect): Added new security parameter (from Blink patch). * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp: (WebCore::WebCoreAVCFResourceLoader::startLoading): Added new security parameter. * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm: (WebCore::WebCoreAVFResourceLoader::startLoading): Ditto. * platform/network/ResourceHandleTypes.h: Added new security parameter constants (from Blink patch). * platform/network/ResourceRequestBase.cpp: (WebCore::ResourceRequestBase::clearHTTPAcceptEncoding): Function to remove "Accept-Encoding" header. * platform/network/ResourceRequestBase.h: Ditto. * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::createRequest): Added new security parameter. 2016-01-13 Daniel Bates Cleanup: XSS Auditor should avoid re-evaluating the parsed script tag https://bugs.webkit.org/show_bug.cgi?id=152870 Reviewed by Brent Fulgham. Merged from Blink (patch by Tom Sepez ): Although the XSS Auditor caches the decoded start tag of a script as an optimization to avoid decoding it again when filtering the character data of the script, it is sufficient to cache whether the HTTP response contains the decoded start tag of a script. This avoids both decoding the start tag of a script and determining whether the HTTP response contains it again when filtering the character data of the script. Moreover, this removes the need to cache a string object. * html/parser/XSSAuditor.cpp: (WebCore::XSSAuditor::filterCharacterToken): (WebCore::XSSAuditor::filterScriptToken): * html/parser/XSSAuditor.h: 2016-01-13 Daniel Bates [XSS Auditor] Do not include trailing comment characters in JavaScript snippets https://bugs.webkit.org/show_bug.cgi?id=152873 Reviewed by Brent Fulgham. Merged from Blink (patch by Tom Sepez ): Test: http/tests/security/xssAuditor/script-tag-with-injected-comment.html * html/parser/XSSAuditor.cpp: (WebCore::XSSAuditor::decodedSnippetForJavaScript): 2016-01-13 Said Abou-Hallawa Reference cycle between SVGPathElement and SVGPathSegWithContext leaks Document https://bugs.webkit.org/show_bug.cgi?id=151810 Reviewed by Darin Adler. Break the reference cycle between SVGPathElement and SVGPathSegWithContext by changing the back-pointer to be a WeakPtr pointer instead of having it RefPtr. Make sure the SVGPathSegWithContext derived classes handle correctly the case when the SVGPathElement back-pointer is deleted. Also change the SVGPathElement argument to the SVGPathSeg creation functions and constructors to be a const reference instead of having it as a pointer since SVGPathElement is the class factory for all these classes. * svg/SVGPathElement.cpp: (WebCore::SVGPathElement::SVGPathElement): (WebCore::SVGPathElement::createSVGPathSegClosePath): (WebCore::SVGPathElement::createSVGPathSegMovetoAbs): (WebCore::SVGPathElement::createSVGPathSegMovetoRel): (WebCore::SVGPathElement::createSVGPathSegLinetoAbs): (WebCore::SVGPathElement::createSVGPathSegLinetoRel): (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs): (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel): (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs): (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel): (WebCore::SVGPathElement::createSVGPathSegArcAbs): (WebCore::SVGPathElement::createSVGPathSegArcRel): (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs): (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel): (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs): (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel): (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs): (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel): (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs): (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel): (WebCore::SVGPathElement::isSupportedAttribute): * svg/SVGPathElement.h: * svg/SVGPathSegArc.h: (WebCore::SVGPathSegArc::SVGPathSegArc): * svg/SVGPathSegArcAbs.h: (WebCore::SVGPathSegArcAbs::create): (WebCore::SVGPathSegArcAbs::SVGPathSegArcAbs): * svg/SVGPathSegArcRel.h: (WebCore::SVGPathSegArcRel::create): (WebCore::SVGPathSegArcRel::SVGPathSegArcRel): * svg/SVGPathSegClosePath.h: (WebCore::SVGPathSegClosePath::create): (WebCore::SVGPathSegClosePath::SVGPathSegClosePath): * svg/SVGPathSegCurvetoCubic.h: (WebCore::SVGPathSegCurvetoCubic::SVGPathSegCurvetoCubic): * svg/SVGPathSegCurvetoCubicAbs.h: (WebCore::SVGPathSegCurvetoCubicAbs::create): (WebCore::SVGPathSegCurvetoCubicAbs::SVGPathSegCurvetoCubicAbs): * svg/SVGPathSegCurvetoCubicRel.h: (WebCore::SVGPathSegCurvetoCubicRel::create): (WebCore::SVGPathSegCurvetoCubicRel::SVGPathSegCurvetoCubicRel): * svg/SVGPathSegCurvetoCubicSmooth.h: (WebCore::SVGPathSegCurvetoCubicSmooth::SVGPathSegCurvetoCubicSmooth): * svg/SVGPathSegCurvetoCubicSmoothAbs.h: (WebCore::SVGPathSegCurvetoCubicSmoothAbs::create): (WebCore::SVGPathSegCurvetoCubicSmoothAbs::SVGPathSegCurvetoCubicSmoothAbs): * svg/SVGPathSegCurvetoCubicSmoothRel.h: (WebCore::SVGPathSegCurvetoCubicSmoothRel::create): (WebCore::SVGPathSegCurvetoCubicSmoothRel::SVGPathSegCurvetoCubicSmoothRel): * svg/SVGPathSegCurvetoQuadratic.h: (WebCore::SVGPathSegCurvetoQuadratic::SVGPathSegCurvetoQuadratic): * svg/SVGPathSegCurvetoQuadraticAbs.h: (WebCore::SVGPathSegCurvetoQuadraticAbs::create): (WebCore::SVGPathSegCurvetoQuadraticAbs::SVGPathSegCurvetoQuadraticAbs): * svg/SVGPathSegCurvetoQuadraticRel.h: (WebCore::SVGPathSegCurvetoQuadraticRel::create): (WebCore::SVGPathSegCurvetoQuadraticRel::SVGPathSegCurvetoQuadraticRel): * svg/SVGPathSegCurvetoQuadraticSmoothAbs.h: (WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::create): (WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::SVGPathSegCurvetoQuadraticSmoothAbs): * svg/SVGPathSegCurvetoQuadraticSmoothRel.h: (WebCore::SVGPathSegCurvetoQuadraticSmoothRel::create): (WebCore::SVGPathSegCurvetoQuadraticSmoothRel::SVGPathSegCurvetoQuadraticSmoothRel): * svg/SVGPathSegLinetoAbs.h: (WebCore::SVGPathSegLinetoAbs::create): (WebCore::SVGPathSegLinetoAbs::SVGPathSegLinetoAbs): * svg/SVGPathSegLinetoHorizontal.h: (WebCore::SVGPathSegLinetoHorizontal::SVGPathSegLinetoHorizontal): * svg/SVGPathSegLinetoHorizontalAbs.h: (WebCore::SVGPathSegLinetoHorizontalAbs::create): (WebCore::SVGPathSegLinetoHorizontalAbs::SVGPathSegLinetoHorizontalAbs): * svg/SVGPathSegLinetoHorizontalRel.h: (WebCore::SVGPathSegLinetoHorizontalRel::create): (WebCore::SVGPathSegLinetoHorizontalRel::SVGPathSegLinetoHorizontalRel): * svg/SVGPathSegLinetoRel.h: (WebCore::SVGPathSegLinetoRel::create): (WebCore::SVGPathSegLinetoRel::SVGPathSegLinetoRel): * svg/SVGPathSegLinetoVertical.h: (WebCore::SVGPathSegLinetoVertical::SVGPathSegLinetoVertical): * svg/SVGPathSegLinetoVerticalAbs.h: (WebCore::SVGPathSegLinetoVerticalAbs::create): (WebCore::SVGPathSegLinetoVerticalAbs::SVGPathSegLinetoVerticalAbs): * svg/SVGPathSegLinetoVerticalRel.h: (WebCore::SVGPathSegLinetoVerticalRel::create): (WebCore::SVGPathSegLinetoVerticalRel::SVGPathSegLinetoVerticalRel): * svg/SVGPathSegMovetoAbs.h: (WebCore::SVGPathSegMovetoAbs::create): (WebCore::SVGPathSegMovetoAbs::SVGPathSegMovetoAbs): * svg/SVGPathSegMovetoRel.h: (WebCore::SVGPathSegMovetoRel::create): (WebCore::SVGPathSegMovetoRel::SVGPathSegMovetoRel): * svg/SVGPathSegWithContext.h: (WebCore::SVGPathSegWithContext::SVGPathSegWithContext): (WebCore::SVGPathSegWithContext::animatedProperty): (WebCore::SVGPathSegWithContext::contextElement): (WebCore::SVGPathSegWithContext::setContextAndRole): (WebCore::SVGPathSegWithContext::commitChange): (WebCore::SVGPathSegSingleCoordinate::setY): (WebCore::SVGPathSegSingleCoordinate::SVGPathSegSingleCoordinate): * svg/properties/SVGPathSegListPropertyTearOff.cpp: (WebCore::SVGPathSegListPropertyTearOff::clearContextAndRoles): (WebCore::SVGPathSegListPropertyTearOff::replaceItem): (WebCore::SVGPathSegListPropertyTearOff::removeItem): 2016-01-13 YongGeol Jung [TexMap] BitmapTextureGL is not released while scene is updated continuously. https://bugs.webkit.org/show_bug.cgi?id=152524 Reviewed by Žan Doberšek. This patch fixes two issues. First, m_releaseUnusedTexturesTimer is not fired if scene is updated within 0.5s continuously. In this case, BitmapTexturePool will not remove texture even if texture is not used for long time. Second, m_releaseUnusedTexturesTimer is triggered by acquireTexture function only. So, if next scene does not need to use BitmapTexture, remained textures in pool will not removed. No new tests needed. * platform/graphics/texmap/BitmapTexturePool.cpp: (WebCore::BitmapTexturePool::scheduleReleaseUnusedTextures): (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired): 2016-01-12 Daniel Bates XSS Auditor should navigate to empty substitute data on full page block https://bugs.webkit.org/show_bug.cgi?id=152868 Reviewed by David Kilzer and Andy Estes. Derived from Blink patch (by Tom Sepez ): Test: http/tests/security/xssAuditor/block-does-not-leak-that-page-was-blocked-using-empty-data-url.html * html/parser/XSSAuditorDelegate.cpp: (WebCore::XSSAuditorDelegate::didBlockScript): Modified to call NavigationScheduler::schedulePageBlock(). * loader/NavigationScheduler.cpp: (WebCore::ScheduledPageBlock::ScheduledPageBlock): Added. (WebCore::NavigationScheduler::schedulePageBlock): Navigate to empty substitute data with the same URL as the originating document. * loader/NavigationScheduler.h: 2016-01-12 Antti Koivisto Don't reuse memory cache entries with different charset https://bugs.webkit.org/show_bug.cgi?id=110031 rdar://problem/13666418 Reviewed by Andreas Kling. Test: fast/loader/cache-encoding.html * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestResource): (WebCore::logResourceRevalidationDecision): (WebCore::CachedResourceLoader::determineRevalidationPolicy): Pass full CachedResourceRequest to the function. If charset differs don't reuse the cache entry. * loader/cache/CachedResourceLoader.h: 2016-01-11 Carlos Garcia Campos Inconsistencies in main resource load delegates when loading from history https://bugs.webkit.org/show_bug.cgi?id=150927 Reviewed by Michael Catanzaro. When restoring a page from the page cache, even though there isn't an actual load of resources, we are still emitting the load delegates to let the API layer know there are contents being loaded in the web view. This makes the page cache restoring transparent for the API layer. However, when restoring a page from the cache, all the delegates are emitted after the load is committed. This is not consistent with real loads, where we first load the main resource and once we get a response we commit the load. This inconsistency is problematic if the API layer expects to always have a main resource with a response when the load is committed. This is the case of the GTK+ port, for example. So, this patch ensures that when a page is restored from the page cache, the main resource load delegates that are emitted until a response is received in normal loads, are emitted before the load is committed. Test: http/tests/loading/main-resource-delegates-on-back-navigation.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::commitProvisionalLoad): When loading from the page cache, send delegate messages up to didReceiveResponse for the main resource before the load is committed, and the remaining messages afterwards. 2016-01-11 Zalan Bujtas Padding added to table-cell element after font-size change. https://bugs.webkit.org/show_bug.cgi?id=152796 Reviewed by David Hyatt. Do not include intrinsicPaddingBefore value while figuring out the height of a row. In RenderTableSection::calcRowLogicalHeight() we are interested in the height of the content without the additional padding (normal padding is included). Test: fast/table/table-baseline-grows.html * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::calcRowLogicalHeight): 2016-01-09 Zalan Bujtas REGRESSION (r194426): First email field is not autofilled on amazon.com https://bugs.webkit.org/show_bug.cgi?id=152945 Reviewed by Simon Fraser. r194426 missed marking the m_layoutRoot for layout while converting to full layout (it only marked the new layout root). Test: fast/forms/multiple-subtree-layout-failure.html * page/FrameView.cpp: (WebCore::FrameView::scheduleRelayoutOfSubtree): 2016-01-07 Brent Fulgham Correct missing EXT_sRGB Format Handling https://bugs.webkit.org/show_bug.cgi?id=152876 Reviewed by Alex Christensen. Tested by WebGL 1.0.4 suite. * platform/graphics/GraphicsContext3D.cpp: (getDataFormat): Handle missing SRGB and SRGB_ALPHA cases. * platform/graphics/GraphicsContext3D.h: Add missing SRGB_ALPHA value from the Khronos standard. * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp: (WebCore::GraphicsContext3D::texImage2D): Add an assertion that we are not being handed an internal format to a method that works with normal formats. 2016-01-07 Zalan Bujtas Incorrect position: fixed; rendering when child of position:relative/sticky. https://bugs.webkit.org/show_bug.cgi?id=147284 Reviewed by Simon Fraser and David Hyatt. Computing logical left for positioned objects should take the relative positioned ancestors' offset into account. Tests: fast/block/positioning/fixed-container-with-relative-parent.html fast/block/positioning/fixed-container-with-sticky-parent.html * rendering/RenderBox.cpp: (WebCore::computeInlineStaticDistance): 2016-01-07 Chris Dumez Directly-composited animated GIFs never resume once scrolled offscreen https://bugs.webkit.org/show_bug.cgi?id=152817 Reviewed by Daniel Bates. Directly-composited animated GIFs would never resume once scrolled offscreen. This is because calling repaint() in this case would not cause BitmapImage::draw() to be called and the animation would thus not be resumed. To address the problem, repaintForPausedImageAnimationsIfNeeded() now calls RenderBoxModelObject::contentChanged(ImageChanged) in addition to repaint() to make sure the animation actually gets resumed, even in the directly-composited animated GIF case. Test: fast/images/composited-animated-gif-outside-viewport.html * platform/graphics/BitmapImage.h: Make currentFrame() public so it can be exposed via Internals for the purpose of testing. * rendering/RenderElement.cpp: (WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded): Call RenderBoxModelObject::contentChanged(ImageChanged) in addition to calling repaint() to make sure the animation actually gets resumed in the directly-composited animated GIFs case. * testing/Internals.cpp: (WebCore::Internals::imageFrameIndex): * testing/Internals.h: * testing/Internals.idl: Expose new "unsigned long imageFrameIndex(Element)" operation on Internals so layout tests can better check if an image is actually animating. Previously, we would rely on the output of internals.hasPausedImageAnimations(Element) but this is not sufficient to cover this bug as our rendering code believed it has resumed the animations but the GIF was not actually animating due to it being directly-composited. 2016-01-07 Michael Catanzaro [SOUP] Consider reducing max simultaneous connections https://bugs.webkit.org/show_bug.cgi?id=137282 Reviewed by Carlos Garcia Campos. Reduce max simultaneous connections from 35 to 17, because (a) all major browsers except Chrome use 17, and (b) Chrome uses 10. The only reason we previously used 35 was that other browsers were using 35 at the time. * platform/network/soup/SoupNetworkSession.cpp: (WebCore::SoupNetworkSession::SoupNetworkSession): 2016-01-06 Brent Fulgham Port blocking bypass issue using 307 redirect https://bugs.webkit.org/show_bug.cgi?id=152801 Reviewed by Anders Carlsson. Tested by http/tests/security/blocked-on-redirect.html. Make sure that 307 redirects check the requested URL via 'portAllowed'. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::willSendRequest): Confirm that the requested port is valid, and block load if it is not. * loader/FrameLoader.cpp: (WebCore::FrameLoader::reportBlockedPortFailed): Added. (WebCore::FrameLoader::blockedError): Added. * loader/FrameLoader.h: 2016-01-06 Zalan Bujtas Float with media query positioned incorrectly after window resize. https://bugs.webkit.org/show_bug.cgi?id=152558 Reviewed by Simon Fraser and David Hyatt. This patch ensures that when a renderer becomes floated, it is moved to the right containing block. When this floated renderer's previous sibling is an anonymous block, it needs to be reparented so that the float is positioned as if there was no anonymous block at all. Test: fast/block/float/float-with-anonymous-previous-sibling.html * rendering/RenderElement.cpp: (WebCore::RenderElement::styleDidChange): 2016-01-06 Zalan Bujtas isAnonymousInlineBlock() should exclude any ruby content. https://bugs.webkit.org/show_bug.cgi?id=152648 Reviewed by David Hyatt. isAnonymousInlineBlock is designed for the new Block-Inside-Inline Model and all other anonymous inline-block renderers (including Ruby) should bail out of it. (see webkit.org/b/143145) Test: fast/ruby/ruby-inline-margin-collapse-crash.html * rendering/RenderObject.cpp: (WebCore::RenderObject::isAnonymousInlineBlock): * rendering/RenderObject.h: (WebCore::RenderObject::isAnonymousInlineBlock): Deleted. 2016-01-05 Pranjal Jumde Image should not be re-registered if m_form already exists. This leads to an assertion failure. https://bugs.webkit.org/show_bug.cgi?id=152741 Reviewed by Brent Fulgham. * Source/WebCore/html/HTMLImageElement.cpp: Node::InsertionNotificationRequest HTMLImageElement::insertedInto(ContainerNode& insertionPoint) 2016-01-05 Eric Carlson Avoid NULL deference in Page::updateIsPlayingMedia https://bugs.webkit.org/show_bug.cgi?id=152732 No new tests, this fixes a rare crash that I am unable to reproduce. Reviewed by David Kilzer. * page/Page.cpp: (WebCore::Page::updateIsPlayingMedia): frame->document() can return NULL. 2016-01-04 Zan Dobersek Shave off a TransformationMatrix copy if RenderLayer's transparencyClipBox() https://bugs.webkit.org/show_bug.cgi?id=152119 Reviewed by Simon Fraser. * rendering/RenderLayer.cpp: (WebCore::transparencyClipBox): Multiply the transformation matrix returned by layer.transform() directly into the transform object, instead of first multiplying them and then copying the result back into the transform object. 2016-01-02 Max Stepin APNG decoder: only decode the frames up to haltAtFrame https://bugs.webkit.org/show_bug.cgi?id=146205 Reviewed by Michael Catanzaro. No new tests, already covered by existing tests. * platform/image-decoders/png/PNGImageDecoder.cpp: (WebCore::PNGImageReader::close): (WebCore::PNGImageReader::decode): (WebCore::PNGImageDecoder::isSizeAvailable): (WebCore::PNGImageDecoder::frameBufferAtIndex): (WebCore::PNGImageDecoder::pngComplete): (WebCore::PNGImageDecoder::decode): * platform/image-decoders/png/PNGImageDecoder.h: (WebCore::PNGImageDecoder::isComplete): (WebCore::PNGImageDecoder::isCompleteAtIndex): 2015-12-31 Zalan Bujtas Simple line layout: Text with stroke width is not positioned correctly. https://bugs.webkit.org/show_bug.cgi?id=152614 Reviewed by Simon Fraser. Visual overflow should not affect text position. Test: fast/text/simple-line-layout-text-position-with-stroke.html * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::paintFlow): 2015-11-17 Zalan Bujtas Simple line layout: Add letter-spacing support. https://bugs.webkit.org/show_bug.cgi?id=151362 Reviewed by Antti Koivisto. This enables us to use simple line layout on letter-spacing content. (fixme: webkit.org/b/151368 -> Repaint rect is not computed correctly when negative letter-spacing applied) Test: fast/text/simple-line-letterspacing.html * rendering/SimpleLineLayout.cpp: (WebCore::SimpleLineLayout::canUseForStyle): * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::paintFlow): RenderLineBoxList tests vertical intersection only. * rendering/SimpleLineLayoutTextFragmentIterator.cpp: (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth): 2015-12-31 Zalan Bujtas Simple line layout: Nested block with pseudo first-line parent should bail out of simple line layout. https://bugs.webkit.org/show_bug.cgi?id=152599 Reviewed by Simon Fraser. We should bail out of simple line layout if any of the ancestors have pseudo first-line style. (see RenderBlock::firstLineBlock()) Test: fast/block/line-layout/first-line-should-bail-out-of-simple-line-layout.html * rendering/SimpleLineLayout.cpp: (WebCore::SimpleLineLayout::canUseForWithReason): 2015-12-27 Zalan Bujtas Should never be reached failure in WebCore::RenderElement::clearLayoutRootIfNeeded https://bugs.webkit.org/show_bug.cgi?id=151590 Reviewed by Simon Fraser. We should always set the layoutroot when a new subtree layout is requested (and convert it to a full layout when needed). It ensures that renderers are detached cleanly even when they are set as layoutroot. Test: fast/block/assert-when-layout-root-is-not-cleared.html * page/FrameView.cpp: (WebCore::FrameView::scheduleRelayoutOfSubtree): 2015-12-24 Zalan Bujtas ASSERTION FAILED: x2 >= x1 in WebCore::RenderElement::drawLineForBoxSide https://bugs.webkit.org/show_bug.cgi?id=151210 Reviewed by Simon Fraser. "IntRect outer = snappedIntRect(inner)" explicitly converts inner to LayoutRect first and returns a snapped IntRect. When inner (after the inflate) overflows LayoutUnit, the snapped rect might become smaller than the inner rect. This patch also enables outline painting on subpixel positions. Tests: fast/borders/hidpi-outline-on-subpixel-position.html fast/borders/outline-offset-overflow.html * rendering/RenderElement.cpp: (WebCore::RenderElement::paintOutline): 2015-12-23 Simon Fraser REGRESSION (r187593): Scroll position jumps when selecting text in an iframe https://bugs.webkit.org/show_bug.cgi?id=152541 rdar://problem/23886181 Reviewed by Tim Horton. r154382 added code that modifies parentLayer traversal, looking for ancestor scrollable layers. However, it confusingly added another code path in which the ancestor layer traversal cross a frame boundary, when RenderLayer::scrollRectToVisible() already has one. I fixed this new location to adjust the rect coordinates in r187593, but then code that hit both crossing points double-mapped the coordinates, causing autoscroll jumping. Fix by reverting r154382 and r187593, going back to doing the ancestor walk in one place. Re-fix r154382 by implementing RenderLayer::allowsCurrentScroll(), which contains the logic for line clamp, autoscroll and ensuring that overflow:hidden can be programmatically scrolled. Form controls are special; they can have overflow:hidden but still be user-scrollable during autoscroll; this is handled via the confusingly-named canBeProgramaticallyScrolled(). RenderTextControlSingleLine implements this to ensure that readonly text inputs autoscroll (which is exercised by a test). The frame-to-parent-frame rect mapping in RenderLayer::scrollRectToVisible() is fixed to use the coordinate mapping functions from Widget/ScrollView, with the addition of a new utility function contentsToContainingViewContents(). A "Scrolling" logging channel is added with a few log points. Test: fast/events/autoscroll-in-iframe-body.html * page/scrolling/ScrollingCoordinator.cpp: (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame): use contentsToContainingViewContents(). * platform/Logging.h: * platform/ScrollView.cpp: (WebCore::ScrollView::contentsToContainingViewContents): * platform/ScrollView.h: * platform/graphics/IntPoint.cpp: (WebCore::IntPoint::constrainedBetween): New helper to constrain a point between two other points. * platform/graphics/IntPoint.h: (WebCore::IntPoint::expandedTo): (WebCore::IntPoint::shrunkTo): * rendering/RenderBox.cpp: * rendering/RenderLayer.cpp: (WebCore::parentLayerCrossFrame): (WebCore::RenderLayer::enclosingScrollableLayer): (WebCore::frameElementAndViewPermitScroll): (WebCore::RenderLayer::allowsCurrentScroll): (WebCore::RenderLayer::scrollRectToVisible): * rendering/RenderLayer.h: * rendering/RenderTextControlSingleLine.h: 2015-12-22 Simon Fraser Minor cleanup in RenderBox::canBeProgramaticallyScrolled() https://bugs.webkit.org/show_bug.cgi?id=152515 Reviewed by Tim Horton. Remove the scrollsOverflow() check in RenderBox::canBeProgramaticallyScrolled(), since if hasScrollableOverflow is true, scrollsOverflow() must also be true. Factor clientWidth/Height vs. scrollWidth/Height checks into separate functions, and call them from two places. Added a test which is not affected by this particular change, but will verify that a later change doesn't break anything. Test: fast/overflow/overflow-hidden-scroll-into-view.html * rendering/RenderBox.cpp: (WebCore::RenderBox::canBeScrolledAndHasScrollableArea): (WebCore::RenderBox::canBeProgramaticallyScrolled): * rendering/RenderBox.h: (WebCore::RenderBox::hasHorizontalOverflow): (WebCore::RenderBox::hasVerticalOverflow): (WebCore::RenderBox::hasScrollableOverflowX): (WebCore::RenderBox::hasScrollableOverflowY): 2015-12-23 Pranjal Jumde Avoids stack recursion when indexed propertyNames defined using Object.defineProperty are deleted. https://bugs.webkit.org/show_bug.cgi?id=149179 . Reviewed by Filip Pizlo. * runtime/JSObject.cpp: (JSStorage::deletePropertyByIndex was invoking Base::deleteProperty for indexed propertyNames instead of Base::deletePropertyByIndex leading to a stack recursion) 2015-12-20 Michael Catanzaro [SOUP] Performs DNS prefetch when a proxy is configured (information leak) https://bugs.webkit.org/show_bug.cgi?id=145542 Reviewed by Darin Adler. Perform DNS prefetch only when no proxy is configured. No new tests. Test this manually with Wireshark. Run the simple-proxy example program found in libsoup's examples directory, set that as your system HTTP proxy, and see if DNS queries show up in Wireshark when refreshing a page sent over HTTP. They should appear only when the proxy is not configured. * platform/network/DNSResolveQueue.cpp: (WebCore::DNSResolveQueue::DNSResolveQueue): (WebCore::DNSResolveQueue::isUsingProxy): * platform/network/DNSResolveQueue.h: * platform/network/cf/DNSCFNet.cpp: (WebCore::DNSResolveQueue::updateIsUsingProxy): (WebCore::DNSResolveQueue::platformProxyIsEnabledInSystemPreferences): Deleted. * platform/network/soup/DNSSoup.cpp: (WebCore::didResolveProxy): (WebCore::proxyResolvedForHttpUriCallback): (WebCore::proxyResolvedForHttpsUriCallback): (WebCore::DNSResolveQueue::updateIsUsingProxy): (WebCore::DNSResolveQueue::platformProxyIsEnabledInSystemPreferences): Deleted. 2015-12-18 Brent Fulgham Place an upper bound on canvas pixel count https://bugs.webkit.org/show_bug.cgi?id=151825 Reviewed by Simon Fraser (Relanded by Brent Fulgham) Malformed JavaScript can attempt to create lots of canvas contexts. Limit the amount of memory we will use for this purpose to some percentage of system RAM. * html/HTMLCanvasElement.cpp: (WebCore::removeFromActivePixelMemory): Added helper function (WebCore::HTMLCanvasElement::~HTMLCanvasElement): Call new 'releaseImageBufferAndContext' method to ensure ImageBuffer and graphics context state are properly cleaned up. (WebCore::maxActivePixels): Use one quarter of the system RAM, or 2 GB (whichever is more) as an upper bound on active pixel memory. (WebCore::HTMLCanvasElement::getContext): If we are attempting to create a context that will cause us to exceed the allowed active pixel count, fail. (WebCore::HTMLCanvasElement::releaseImageBufferAndContext): Added helper function (WebCore::HTMLCanvasElement::setSurfaceSize): Use the new 'releaseImageBufferAndContext' method to handle active pixel memory counts. (WebCore::HTMLCanvasElement::createImageBuffer): Refuse to create a backing buffer if it will exceed our available pixel memory. 2015-12-16 Beth Dakin Legacy style scrollbars do not change color when you mouse over them if you are scrolled https://bugs.webkit.org/show_bug.cgi?id=152319 -and corresponding- rdar://problem/23317668 Reviewed by Darin Adler. The scrollbar’s frameRect is in window coordinates, so we need to compare a point in window coordinates when we test this. The call to convertFromContainingWindow does not return a point in view coordinates, so we should not call the variable viewPoint. We do still need to call it for subframes. convertFromContainingWindow doesn’t do anything for the root ScrollView (for Mac WK2 at least). * platform/ScrollView.cpp: (WebCore::ScrollView::scrollbarAtPoint): HitTestLocation is in contents coordinates. It needs to be converted to window coordinates * rendering/RenderView.cpp: (WebCore::RenderView::hitTest): 2016-01-04 Sergio Villar Senin REGRESSION(r194143): Float width incorrectly calculated on Wikipedia https://bugs.webkit.org/show_bug.cgi?id=152644 Reviewed by Myles C. Maxfield. The min/max-content contribution computation for non replaced blocks changed in r194143. The implementation was actually more complex than it should be and actually incomplete as it was not considering the case of out of flow elements (because it was directly calling computeLogicalWidthInRegion()). This new implementation simplifies a lot the code and makes it more complete as it relies on min|maxPreferredLogicalWidth() calls which already consider all the different types of boxes. Test: fast/css-intrinsic-dimensions/inlinesize-contribution-floats.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::computeBlockPreferredLogicalWidths): 2015-12-08 Sergio Villar Senin Fix computation of min|max-content contribution of non-replaced blocks https://bugs.webkit.org/show_bug.cgi?id=152004 Reviewed by Darin Adler. WebKit currently always returns the min preferred logical width for the min-content contribution (and the max preferred logical width for the max-content contribution) for non-replaced blocks. That is not correct according to specs https://drafts.csswg.org/css-sizing/#block-intrinsic. The min-content and max-content contributions actually depend on the computed inline size of the block: * for min-content,max-content or definite sizes: min-content and max-content contributions are the inline size plus border, margin and padding. * otherwise: min-content contribution is the min-content size and max-content contribution is the max-content size (in both cases plus border, padding and margin). Tests: fast/css-intrinsic-dimensions/auto-maxcontent-inlinesize-contribution-nonreplaced-blocks.html fast/css-intrinsic-dimensions/auto-mincontent-inlinesize-contribution-nonreplaced-blocks.html fast/css-intrinsic-dimensions/fillavailable-maxcontent-inlinesize-contribution-nonreplaced-blocks.html fast/css-intrinsic-dimensions/fillavailable-mincontent-inlinesize-contribution-nonreplaced-blocks.html fast/css-intrinsic-dimensions/fitcontent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html fast/css-intrinsic-dimensions/fitcontent-mincontent-inlinesize-contribution-nonreplaced-blocks.html fast/css-intrinsic-dimensions/fixed-inlinesize-contribution-nonreplaced-blocks-1.html fast/css-intrinsic-dimensions/fixed-inlinesize-contribution-nonreplaced-blocks-2.html fast/css-intrinsic-dimensions/indefinite-percent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html fast/css-intrinsic-dimensions/indefinite-percent-mincontent-inlinesize-contribution-nonreplaced-blocks.html fast/css-intrinsic-dimensions/maxcontent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html fast/css-intrinsic-dimensions/maxcontent-mincontent-inlinesize-contribution-nonreplaced-blocks.html fast/css-intrinsic-dimensions/mincontent-maxcontent-inlinesize-contribution-nonreplaced-blocks.html fast/css-intrinsic-dimensions/mincontent-mincontent-inlinesize-contribution-nonreplaced-blocks.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::computeBlockPreferredLogicalWidths): 2015-12-13 Zalan Bujtas Clean up absolute positioned map properly. https://bugs.webkit.org/show_bug.cgi?id=152219 rdar://problem/23861165 Reviewed by Simon Fraser. We insert positioned renderers into a static map (RenderBlock::gPositionedDescendantsMap) to keep track of them. Since this static map is at block level, (positioned)inline renderers use their containing block to store their positioned descendants. This patch ensures that when an inline element can no longer hold positioned children, we remove them from the inline's containing block's map. -unless the container itself can hold positioned renderers(see RenderElement::canContainAbsolutelyPositionedObjects). Test: fast/block/positioning/crash-when-positioned-inline-has-positioned-child.html * rendering/RenderInline.cpp: (WebCore::RenderInline::styleWillChange): * rendering/RenderInline.h: 2015-12-11 Zalan Bujtas ASSERTION FAILED: !rect.isEmpty() in WebCore::GraphicsContext::drawRect https://bugs.webkit.org/show_bug.cgi?id=151201 Reviewed by Simon Fraser. Drawing empty rect is a waste. Test: fast/borders/empty-drawrect-assert-after-pixelsnap.html * rendering/RenderElement.cpp: (WebCore::RenderElement::drawLineForBoxSide): 2015-12-11 Jiewen Tan Strip out Referer header when requesting subresources or following links for documents with "Content-Disposition: attachment" https://bugs.webkit.org/show_bug.cgi?id=152102 Reviewed by Andy Estes. Keep the ReferrerPolicy for a document as ReferrerPolicyNever if the document is loaded with "Content-Disposition: attachment". Test: http/tests/contentdispositionattachmentsandbox/subresource-request-not-include-referer-header.html * dom/Document.cpp: (WebCore::Document::processReferrerPolicy): (WebCore::Document::applyContentDispositionAttachmentSandbox): 2016-01-12 Carlos Garcia Campos [GTK] Fix return value of some paint methods in RenderThemeGtk https://bugs.webkit.org/show_bug.cgi?id=153015 Reviewed by Michael Catanzaro. The bool value returned by paint methods in RenderTheme means whether the appearance is supported or not, so we should return true when not supported (so we didn't paint anything) and false when supported (so we actually painted the theme part). * rendering/RenderThemeGtk.cpp: (WebCore::RenderThemeGtk::paintSearchFieldResultsDecorationPart): (WebCore::RenderThemeGtk::paintSearchFieldCancelButton): (WebCore::RenderThemeGtk::paintMediaButton): (WebCore::RenderThemeGtk::paintMediaMuteButton): (WebCore::RenderThemeGtk::paintMediaPlayButton): (WebCore::RenderThemeGtk::paintMediaSliderTrack): (WebCore::RenderThemeGtk::paintMediaVolumeSliderContainer): Deleted. * rendering/RenderThemeGtk.h: 2016-01-11 Carlos Garcia Campos [GTK] Cleanup RenderThemeGtk https://bugs.webkit.org/show_bug.cgi?id=152888 Reviewed by Michael Catanzaro. Use a common path for GTK+ 3.19 and previous versions, simplifying the code and removing a lot of ifdefs. - createStyleContext() now receives a theme part enum value, and an optional parent GtkStyleContext. It encapsulates all the differences between GTK+ 3.19 and previous version leaving the rendering code common and free of ifdefs. - Stock icons support have been removed, simplifying the code that now always renders symbolic icons, updating the colors depending on the current state. - Media button and colors have been removed, because they are unused now that we render the media controls with CSS. - ComboBox separators support has also been removed. In GTK+ 3.19 combo boxes no longer have separators and most of the GTK+ themes don't use the either, so it's better to simple not render them anymore in WebKit either. - Code to paint caps lock indicator has been removed too, since caps lock indicator is now shadow dom and automatically rendered by WebCore. * rendering/RenderThemeGtk.cpp: (WebCore::createStyleContext): (WebCore::loadThemedIcon): (WebCore::gtkIconStateFlags): (WebCore::RenderThemeGtk::adjustRepaintRect): (WebCore::setToggleSize): (WebCore::paintToggle): (WebCore::RenderThemeGtk::setCheckboxSize): (WebCore::RenderThemeGtk::paintCheckbox): (WebCore::RenderThemeGtk::setRadioSize): (WebCore::RenderThemeGtk::paintRadio): (WebCore::RenderThemeGtk::paintButton): (WebCore::getComboBoxMetrics): (WebCore::RenderThemeGtk::popupInternalPaddingLeft): (WebCore::RenderThemeGtk::popupInternalPaddingRight): (WebCore::RenderThemeGtk::popupInternalPaddingTop): (WebCore::RenderThemeGtk::popupInternalPaddingBottom): (WebCore::RenderThemeGtk::paintMenuList): (WebCore::RenderThemeGtk::paintTextField): (WebCore::adjustSearchFieldIconStyle): (WebCore::RenderThemeGtk::adjustSearchFieldResultsDecorationPartStyle): (WebCore::paintIcon): (WebCore::paintEntryIcon): (WebCore::RenderThemeGtk::paintSearchFieldResultsDecorationPart): (WebCore::RenderThemeGtk::adjustSearchFieldCancelButtonStyle): (WebCore::RenderThemeGtk::paintSearchFieldCancelButton): (WebCore::RenderThemeGtk::shouldHaveCapsLockIndicator): (WebCore::RenderThemeGtk::paintSliderTrack): (WebCore::RenderThemeGtk::paintSliderThumb): (WebCore::RenderThemeGtk::adjustSliderThumbSize): (WebCore::RenderThemeGtk::paintProgressBar): (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle): (WebCore::paintSpinArrowButton): (WebCore::RenderThemeGtk::paintInnerSpinButton): (WebCore::styleColor): (WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor): (WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor): (WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor): (WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor): (WebCore::RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor): (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor): (WebCore::RenderThemeGtk::platformActiveListBoxSelectionForegroundColor): (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor): (WebCore::RenderThemeGtk::systemColor): (WebCore::RenderThemeGtk::paintMediaButton): (WebCore::RenderThemeGtk::paintMediaFullscreenButton): (WebCore::RenderThemeGtk::paintMediaMuteButton): (WebCore::RenderThemeGtk::paintMediaPlayButton): (WebCore::RenderThemeGtk::paintMediaSeekBackButton): (WebCore::RenderThemeGtk::paintMediaSeekForwardButton): (WebCore::RenderThemeGtk::paintMediaToggleClosedCaptionsButton): * rendering/RenderThemeGtk.h: 2016-01-11 Carlos Garcia Campos [GTK] Cleanup ScrollbarThemeGtk https://bugs.webkit.org/show_bug.cgi?id=152830 Reviewed by Michael Catanzaro. Use a common path for GTK+ 3.19 and previous versions, simplifying the code and removing a lot of ifdefs. Use always a new GtkStyleContext, but when painting cache the newly created one so all paint methods use that one. We were also caching some theme properties assuming they don't change unless the theme changes, but some of them can have different values depending on the state, for example, when hovered or pressed. Those properties are now only cached when we create a new GtkStyleContext. The method updateScrollbarsFrameThickness() has also been removed, since the Scrollbar constructor already initializes the frame rect using the scrollbarThickness(). This method was not doing anything anyway, since that was called on the constructor of the theme, when there were no scrollbars registered. This also means we no longer need to track registered/unregistered scrollbars. * platform/gtk/ScrollbarThemeGtk.cpp: (WebCore::ScrollbarThemeGtk::backButtonRect): Use the cached GtkStyleContext and properties or create a new. (WebCore::ScrollbarThemeGtk::forwardButtonRect): Ditto. (WebCore::ScrollbarThemeGtk::trackRect): Ditto. (WebCore::orientationStyleClass): (WebCore::ScrollbarThemeGtk::getOrCreateStyleContext): Create a new GtkStyleContext for the scrollbar if there isn't a cached one. Also initialize the properties that depend on the state. (WebCore::createChildStyleContext): Create a new GtkStyleContext from a parent one. (WebCore::ScrollbarThemeGtk::updateThemeProperties): Get the properties that can only change when the theme changes. (WebCore::ScrollbarThemeGtk::thumbRect): Use the cached GtkStyleContext and properties or create a new. (WebCore::adjustRectAccordingToMargin): Use always the GtkStyleContext state instead of receiving it and setting it again. (WebCore::ScrollbarThemeGtk::paintTrackBackground): Get or create a GtkStyleContext for the scrollbar and create a child one for the trough. (WebCore::ScrollbarThemeGtk::paintScrollbarBackground): Use the cached GtkStyleContext or create a new one. (WebCore::ScrollbarThemeGtk::paintThumb): Get or create a GtkStyleContext for the scrollbar and create a child ones for trough and slider. (WebCore::ScrollbarThemeGtk::paintButton): Get or create a GtkStyleContext for the scrollbar and create a child one for the button. (WebCore::ScrollbarThemeGtk::paint): Create a GtkStyleContext and cache it temporarily using TemporaryChange until the method finishes. (WebCore::ScrollbarThemeGtk::scrollbarThickness): Use the cached GtkStyleContext and properties or create a new. (WebCore::ScrollbarThemeGtk::buttonSize): Ditto. * platform/gtk/ScrollbarThemeGtk.h: 2016-01-08 Zalan Bujtas Absolute positioning -webkit-search-cancel-button crashes Safari. https://bugs.webkit.org/show_bug.cgi?id=152847 Reviewed by Simon Fraser. Do not call offsetFromContainer while resolving the painting position for the search/cancel button renderer. It skips the static positioned parent input renderer, when the search/cancel renderer is absolute positioned. This patch also fixes a rendering glitch when the margin-right is > 0. Test: fast/forms/absolute-positioned-custom-search-cancel-crash.html * rendering/RenderTheme.h: (WebCore::RenderTheme::paintSearchFieldCancelButton): (WebCore::RenderTheme::paintSearchFieldResultsDecorationPart): (WebCore::RenderTheme::paintSearchFieldResultsButton): * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::convertToPaintingPosition): (WebCore::RenderThemeMac::paintSearchFieldCancelButton): (WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart): (WebCore::RenderThemeMac::paintSearchFieldResultsButton): (WebCore::RenderThemeMac::convertToPaintingRect): Deleted. 2015-12-22 Michael Catanzaro [GTK] Everything broken in GTK+ 3.19 https://bugs.webkit.org/show_bug.cgi?id=150550 Reviewed by Carlos Garcia Campos. Port RenderThemeGtk and ScrollbarThemeGtk to use CSS nodes. This makes it possible to render stuff with modern GTK+. No new tests. We already have tons of tests for this functionality, but we're running them with GTK+ 3.16, so they cannot have detected this breakage. These fixes require unreleased GTK+, and GTK+ rendering is currently in a state of flux; once things settle down, we can consider upgrading the GTK+ used for our layout tests. * platform/gtk/GRefPtrGtk.cpp: (WTF::refGPtr): (WTF::derefGPtr): * platform/gtk/GRefPtrGtk.h: * platform/gtk/ScrollbarThemeGtk.cpp: (WebCore::ScrollbarThemeGtk::themeChanged): (WebCore::ScrollbarThemeGtk::updateThemeProperties): (WebCore::orientationStyleClass): (WebCore::applyScrollbarStyleContextClasses): (WebCore::ScrollbarThemeGtk::paintTrackBackground): (WebCore::ScrollbarThemeGtk::paintScrollbarBackground): (WebCore::ScrollbarThemeGtk::paintThumb): (WebCore::ScrollbarThemeGtk::paintButton): * rendering/RenderThemeGtk.cpp: (WebCore::createStyleContext): (WebCore::setToggleSize): (WebCore::paintToggle): (WebCore::RenderThemeGtk::paintButton): (WebCore::getComboBoxMetrics): (WebCore::RenderThemeGtk::paintMenuList): (WebCore::RenderThemeGtk::paintTextField): (WebCore::applySliderStyleContextClasses): (WebCore::RenderThemeGtk::paintSliderTrack): (WebCore::RenderThemeGtk::paintSliderThumb): (WebCore::RenderThemeGtk::paintProgressBar): (WebCore::paintSpinArrowButton): (WebCore::styleColor): 2015-12-10 Michael Catanzaro [GTK] RenderThemeGtk::platformActiveSelectionBackgroundColor, et. al. should not clobber state of cached GtkStyleContexts https://bugs.webkit.org/show_bug.cgi?id=151533 Reviewed by Carlos Garcia Campos. Remove the style context cache to simplify the code, drastically reduce the number of expensive save/restore operations performed on style contexts, and avoid unwanted side-effects in RenderThemeGtk::styleColor. This is also a speculative fix for improper button rendering with certain custom themes, and a simplification that will make it easier to fix bug #150550. This change does have performance implications, which I intend to check on the perf bot after landing to ensure that removing the cache does not have a significant negative impact on performance; I have no clue whether this will be a net performance win or loss. However, this is a bit tricky, because the bot is running GTK+ 3.16, whereas I expect save/restore might be much more expensive in GTK+ 3.20, and I do not want to make performance decisions except based on the latest GTK+ due to large changes in the implementation of GtkStyleContext. * rendering/RenderThemeGtk.cpp: (WebCore::createStyleContext): (WebCore::getStockIconForWidgetType): (WebCore::getStockSymbolicIconForWidgetType): (WebCore::RenderThemeGtk::initMediaColors): (WebCore::RenderThemeGtk::adjustRepaintRect): (WebCore::setToggleSize): (WebCore::paintToggle): (WebCore::RenderThemeGtk::setCheckboxSize): (WebCore::RenderThemeGtk::setRadioSize): (WebCore::RenderThemeGtk::paintButton): (WebCore::getComboBoxMetrics): (WebCore::RenderThemeGtk::paintMenuList): (WebCore::RenderThemeGtk::paintTextField): (WebCore::RenderThemeGtk::paintSliderTrack): (WebCore::RenderThemeGtk::paintSliderThumb): (WebCore::RenderThemeGtk::adjustSliderThumbSize): (WebCore::RenderThemeGtk::paintProgressBar): (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle): (WebCore::RenderThemeGtk::paintInnerSpinButton): (WebCore::styleColor): (WebCore::gtkStyleChangedCallback): Deleted. (WebCore::styleContextMap): Deleted. (WebCore::getStyleContext): Deleted. 2015-12-09 Joanmarie Diggs AX: [GTK] Anonymous render block flow elements should be exposed as ATK_ROLE_SECTION; not ATK_ROLE_PANEL https://bugs.webkit.org/show_bug.cgi?id=152070 Reviewed by Mario Sanchez Prada. Map the element to WebCore AccessibilityRole DivRole for GTK. This is being done in the shared layer rather than in the platform layer because we want all subsequent logic to treat anonymous render block flow elements as divs. No new tests. We already have sufficient test coverage. The expectations been updated accordingly. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::determineAccessibilityRole): 2015-12-09 Keith Rollin form.elements should reflect the element ordering after the HTML tree builder algorithm https://bugs.webkit.org/show_bug.cgi?id=148870 rdar://problem/22589879 Reviewed by Ryosuke Niwa. form.elements should return form-associated elements in tree order. However, when presented with an HTML fragment like the following, forms.elements is not built in tree order. Instead, the elements appear in forms.element in the same order they appear in the HTML -- that is in the same order as they are parsed.
The reason why elements appear in forms.elements in parse order is because they register themselves with the designated form when they are created. At this time, they are not in the DOM tree, so the form can only assume that the element will be appended to the DOM tree, with the result that it records the elements in the HTML fragment above as [r1, r2, r0]. However, it's not always the case that the newly-created element will be appended to the current tree. In the HTML fragment above, the r0 input element is hoised out of the table element. It ends up being the preceding sibling of the table element, with the result that the actual tree-order of the input elements is [r0, r1, r2]. Because the problem is due to registering form-associated elements with the form *before* the elements are added to the DOM tree, the solution is to defer that registration until afterwards. With the new element in the tree, the form can now use its current location in the tree to correctly place the element in form.elements. Existing tests now pass: - imported/w3c/web-platform-tests/html/semantics/forms/the-form-element/form-elements-nameditem-02-html * html/FormAssociatedElement.cpp: (WebCore::FormAssociatedElement::FormAssociatedElement): (WebCore::FormAssociatedElement::insertedInto): (WebCore::FormAssociatedElement::removedFrom): (WebCore::FormAssociatedElement::formRemovedFromTree): (WebCore::FormAssociatedElement::formWillBeDestroyed): * html/FormAssociatedElement.h: * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::HTMLFormControlElement): * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::HTMLImageElement): (WebCore::HTMLImageElement::insertedInto): (WebCore::HTMLImageElement::removedFrom): * html/HTMLImageElement.h: * html/HTMLObjectElement.cpp: (WebCore::HTMLObjectElement::HTMLObjectElement): 2015-12-09 Frederic Wang Bad position of large operators inside an munderover element https://bugs.webkit.org/show_bug.cgi?id=151916 Reviewed by Alejandro G. Castro. Test: mathml/opentype/large-operators-munderover.html * rendering/mathml/RenderMathMLOperator.h: (WebCore::RenderMathMLOperator::isVertical): Expose the direction of the operator. * rendering/mathml/RenderMathMLUnderOver.cpp: (WebCore::RenderMathMLUnderOver::layout): Remove call to horizontal stretching for vertical operators. 2015-12-09 Zan Dobersek [TextureMapper] TextureMapperShaderProgram::setMatrix() should use TransformationMatrix::FloatMatrix4 https://bugs.webkit.org/show_bug.cgi?id=152042 Reviewed by Martin Robinson. * platform/graphics/texmap/TextureMapperShaderProgram.cpp: (WebCore::TextureMapperShaderProgram::setMatrix): Instead of manually writing out the complete matrix in a C array, simply use TransformationMatrix::FloatMatrix4 and fill that via the TransformationMatrix::toColumnMajorFloatArray() method called on the passed-in TransformationMatrix. 2015-12-09 Zan Dobersek [Soup] Attach the SocketStreamHandleSoup write-ready source to the thread-default context https://bugs.webkit.org/show_bug.cgi?id=152041 Reviewed by Carlos Garcia Campos. * platform/network/soup/SocketStreamHandleSoup.cpp: (WebCore::SocketStreamHandle::beginWaitingForSocketWritability): Attach the write-ready source to the thread-default context, instead of implicitly relying on the default context for dispatching. 2015-12-09 Zan Dobersek [Soup] SocketStreamHandle should call g_source_destroy() on the write-ready source https://bugs.webkit.org/show_bug.cgi?id=152040 Reviewed by Carlos Garcia Campos. * platform/network/soup/SocketStreamHandleSoup.cpp: (WebCore::SocketStreamHandle::stopWaitingForSocketWritability): Instead of calling the g_source_get_id()-g_source_remove() pair, destroy the source via the g_source_destroy() call. Also use nullptr to clear out the pointer variable. 2015-12-08 Jer Noble Changing