2012-05-10 Antoine Labour Sync with impl thread when removing references to external textures https://bugs.webkit.org/show_bug.cgi?id=86054 We want to ensure the client side is safe to release textures, so we sync with the impl thread when: - we change the texture (and we had one) - the layer is removed from the tree (and we had a texture) - the layer is destroyed (and we had a texture) Reviewed by James Robinson. Test: TextureLayerChromiumTest. * platform/graphics/chromium/TextureLayerChromium.cpp: (WebCore::TextureLayerChromium::~TextureLayerChromium): (WebCore::TextureLayerChromium::setTextureId): (WebCore::TextureLayerChromium::setLayerTreeHost): (WebCore): * platform/graphics/chromium/TextureLayerChromium.h: (TextureLayerChromium): 2012-05-10 Kent Tamura [Chromium] attempt to build fix for Chromium-mac. r116697 introduced an override of a system function. It's intentional and WebCoreTextFieldCell should be in the whitelist. * WebCore.gyp/WebCore.gyp: 2012-05-10 Anders Carlsson PDF files won't scroll in Safari when using Adobe plug-in https://bugs.webkit.org/show_bug.cgi?id=86167 Reviewed by Sam Weinig. * page/scrolling/ScrollingCoordinator.cpp: (WebCore::computeNonFastScrollableRegion): Loop over the frame view children looking for plug-in views that want wheel events and add them to the non-fast scrollable region. Ideally, the plug-ins should be added to the set of scrollable areas, but PluginView in WebKit2 is not a ScrollableArea yet. * plugins/PluginViewBase.h: (PluginViewBase): (WebCore::PluginViewBase::wantsWheelEvents): 2012-05-10 Alexey Proskuryakov Crash in 3rd party WebKit apps that disable cache at a wrong time https://bugs.webkit.org/show_bug.cgi?id=86027 Reviewed by Antti Koivisto. Added an API test. The fix is to use CachedResourceHandle throughout MemoryCache, which will certainly keep the resource alive. Also removed earlier fixes. * css/CSSImageSetValue.cpp: (WebCore::CSSImageSetValue::cachedImageSet): * css/CSSImageValue.cpp: (WebCore::CSSImageValue::cachedImage): * css/WebKitCSSShaderValue.cpp: (WebCore::WebKitCSSShaderValue::cachedShader): * history/PageCache.cpp: (WebCore::PageCache::releaseAutoreleasedPagesNow): * loader/ImageLoader.cpp: (WebCore::ImageLoader::updateFromElement): * loader/TextTrackLoader.cpp: (WebCore::TextTrackLoader::load): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestImage): (WebCore::CachedResourceLoader::requestFont): (WebCore::CachedResourceLoader::requestTextTrack): (WebCore::CachedResourceLoader::requestShader): (WebCore::CachedResourceLoader::requestCSSStyleSheet): (WebCore::CachedResourceLoader::requestUserCSSStyleSheet): (WebCore::CachedResourceLoader::requestScript): (WebCore::CachedResourceLoader::requestXSLStyleSheet): (WebCore::CachedResourceLoader::requestSVGDocument): (WebCore::CachedResourceLoader::requestLinkResource): (WebCore::CachedResourceLoader::requestRawResource): (WebCore::CachedResourceLoader::requestResource): (WebCore::CachedResourceLoader::revalidateResource): (WebCore::CachedResourceLoader::loadResource): (WebCore::CachedResourceLoader::requestPreload): * loader/cache/CachedResourceLoader.h: (CachedResourceLoader): * loader/cache/MemoryCache.h: (WebCore::MemoryCache::setPruneEnabled): * loader/cache/CachedResourceHandle.h: (WebCore::CachedResourceHandle::CachedResourceHandle): (WebCore::CachedResourceHandle::operator=): Teach CachedResourceHandle how to make CachedResourceHandle from a handle to subclass. 2012-05-10 Tien-Ren Chen Eliminate duplicated code for culled line box in RenderInline https://bugs.webkit.org/show_bug.cgi?id=85725 This patch extracts the common part of culledInlineBoundingBox() / culledInlineAbsoluteRects() / culledInlineAbsoluteQuads() to become a template function generateCulledLineBoxRects(). The template function accepts a new parameter, GeneratorContext functor, which will be invoked everytime a new line box rect has been generated. The generated rect will be in local coordinate. The functor will be responsible for appropriate transformation, then appending to vector or union with existing bounding box. Reviewed by Eric Seidel. No new tests. No change in behavior. * rendering/RenderInline.cpp: (WebCore): (WebCore::RenderInline::generateLineBoxRects): (WebCore::RenderInline::generateCulledLineBoxRects): (WebCore::RenderInline::absoluteRects): (WebCore::RenderInline::absoluteQuads): (WebCore::RenderInline::linesBoundingBox): (WebCore::RenderInline::culledInlineVisualOverflowBoundingBox): (WebCore::RenderInline::addFocusRingRects): * rendering/RenderInline.h: (RenderInline): 2012-05-10 Abhishek Arya Crash in swapInNodePreservingAttributesAndChildren. https://bugs.webkit.org/show_bug.cgi?id=85197 Reviewed by Ryosuke Niwa. Keep the children in a ref vector before adding them to newNode. They can get destroyed due to mutation events. No new tests because we don't have a reduction. * editing/ReplaceNodeWithSpanCommand.cpp: (WebCore::swapInNodePreservingAttributesAndChildren): 2012-05-10 Shinya Kawanaka [Refactoring] Move Selection from DOMWindow to TreeScope. https://bugs.webkit.org/show_bug.cgi?id=82699 Reviewed by Ryosuke Niwa. Since ShadowRoot will also manage its own version of DOMSelection, we would like to share the code among Document and DOMSelection. This patch moves DOMSelection from DOMWindow to TreeScope so that ShadowRoot can also use it. No new tests, should covered by existing tests. * dom/Document.cpp: (WebCore::Document::updateFocusAppearanceTimerFired): * dom/Document.h: (Document): * dom/ShadowRoot.cpp: (WebCore::ShadowRoot::selection): * do/mTreeScope.cpp: (WebCore::TreeScope::~TreeScope): (WebCore::TreeScope::getSelection): (WebCore): * dom/TreeScope.h: (WebCore): (TreeScope): * page/DOMSelection.cpp: (WebCore::DOMSelection::DOMSelection): (WebCore::DOMSelection::clearTreeScope): (WebCore): * page/DOMSelection.h: (WebCore): (WebCore::DOMSelection::create): (DOMSelection): (WebCore::DOMSelection::frame): * page/DOMWindow.cpp: (WebCore::DOMWindow::~DOMWindow): (WebCore::DOMWindow::clearDOMWindowProperties): (WebCore::DOMWindow::getSelection): * page/DOMWindow.h: (DOMWindow): 2012-05-10 Kent Tamura Unreviewed, rolling out r116594. http://trac.webkit.org/changeset/116594 https://bugs.webkit.org/show_bug.cgi?id=86013 r116594 might have made some composition tests flaky. * platform/graphics/chromium/LayerChromium.cpp: (WebCore::LayerChromium::addAnimation): * platform/graphics/chromium/cc/CCLayerAnimationController.cpp: (WebCore::CCLayerAnimationController::pushNewAnimationsToImplThread): * platform/graphics/chromium/cc/CCLayerTreeHost.cpp: (WebCore::CCLayerTreeHost::finishCommitOnImplThread): (WebCore::CCLayerTreeHost::didBecomeInvisibleOnImplThread): * platform/graphics/chromium/cc/CCLayerTreeHost.h: (CCLayerTreeHost): * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp: (WebCore::CCLayerTreeHostImpl::CCLayerTreeHostImpl): * platform/graphics/chromium/cc/CCProxy.h: (CCProxy): * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp: (WebCore::CCSingleThreadProxy::CCSingleThreadProxy): (WebCore::CCSingleThreadProxy::doComposite): * platform/graphics/chromium/cc/CCSingleThreadProxy.h: (WebCore): * platform/graphics/chromium/cc/CCThreadProxy.h: (CCThreadProxy): 2012-05-10 Michael Nordman [chromium] DomStorage events handling needs TLC (2) https://bugs.webkit.org/show_bug.cgi?id=85221 Alter the StorageArea virtual interface such that the mutators no longer return old values. This is to allow implementations of the interface to operate more asynchronously. Reviewed by Adam Barth. No new tests. Existing tests cover this. * storage/StorageArea.h: Alter the interface so the mutators no longer return previous values * storage/StorageAreaImpl.cpp: (WebCore::StorageAreaImpl::disabledByPrivateBrowsingInFrame): removed an unneeded PLATFORM(CHROMIUM) guard (WebCore::StorageAreaImpl::setItem): no longer return the old value (WebCore::StorageAreaImpl::removeItem): no longer return the old value (WebCore::StorageAreaImpl::clear): no longer return whether something was cleared * storage/StorageAreaImpl.h: match StorageArea's virtual interface 2012-05-10 Beth Dakin https://bugs.webkit.org/show_bug.cgi?id=86158 Overlay scrollbars without layers never paint in overflow regions in tiled drawing mode -and corresponding- Reviewed by Darin Adler. RenderLayers paint scrollbars that do not have their own layers by running a second pass through the layer tree after the layer tree has painted. This ensures that the scrollbars always paint on top of content. However, this mechanism was relying on FrameView::paintContents() as a choke-point for all painting to trigger the second painting pass. That is not a reasonable choke-point in tiled drawing, so this patch adds similar code to RenderLayerBacking. Only opt into the second painting pass for scrollbars that do not have their own layers. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintOverflowControls): A layer that paints into its backing cannot return early here if it has overlay scrollbars to paint. (WebCore::RenderLayer::paintLayer): This replicates code in FrameView::paintContents(). After painting the owning layer, do a second pass if there are overlay scrollbars to paint. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintIntoLayer): 2012-05-10 Anders Carlsson Well, at least fixing the GTK+ build is something! * platform/gtk/LocalizedStringsGtk.cpp: (WebCore::insecurePluginVersionText): (WebCore): 2012-05-10 Anders Carlsson Add insecurePluginVersionText stubs. * platform/blackberry/LocalizedStringsBlackBerry.cpp: (WebCore::insecurePluginVersionText): (WebCore): * platform/efl/LocalizedStringsEfl.cpp: (WebCore::insecurePluginVersionText): (WebCore): * platform/qt/LocalizedStringsQt.cpp: (WebCore::insecurePluginVersionText): (WebCore): 2012-05-10 Sheriff Bot Unreviewed, rolling out r116677. http://trac.webkit.org/changeset/116677 https://bugs.webkit.org/show_bug.cgi?id=86159 This patch causes linker error to some mac bots (Requested by jianli_ on #webkit). * WebCore.exp.in: * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::Node::traverseNextNode): (WebCore::Node::traverseNextSibling): * dom/Node.h: (Node): 2012-05-10 Abhishek Arya Crash in FontCache::releaseFontData due to infinite float size. https://bugs.webkit.org/show_bug.cgi?id=86110 Reviewed by Andreas Kling. New callers always forget to clamp the font size, which overflows to infinity on multiplication. It is best to clamp it at the end to avoid getting greater than std::numeric_limits::max(). Test: fast/css/large-font-size-crash.html * platform/graphics/FontDescription.h: (WebCore::FontDescription::setComputedSize): (WebCore::FontDescription::setSpecifiedSize): 2012-05-10 Beth Dakin https://bugs.webkit.org/show_bug.cgi?id=82131 [Mac] REGRESSION (r110480): Text field that specifies background-color (or is auto-filled) gets un-themed border -and corresponding- Reviewed by Maciej Stachowiak. This change rolls out r110480 which is what caused styled text fields to get the un-themed border, and it does a bunch of work to make sure we get the pretty, new version of the NSTextField art whenever possible. We do this differently for post-Lion OS's since there is now a way to opt into it all the time. Lion and SnowLeopard can only use the new art in HiDPI mode when the background color of the text field is just white. RenderThemeMac::textField() takes a boolean paramter used to determine if the new gradient will be used. * rendering/RenderThemeMac.h: (RenderThemeMac): This is the post-Lion workaround. This code has no effect on Lion and SnowLeopard. This allows up to opt into a version of [NSTextField drawWithFrame:] that will only draw the frame of the text field; without this, it will draw the frame and the background, which creates a number of problems with styled text fields and text fields in HiDPI. There is a less comprehesive workaround for Lion and SnowLeopard in place in RenderThemeMac::textField(). * rendering/RenderThemeMac.mm: (-[WebCoreTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:]): This is the roll-out of r110480. (WebCore::RenderThemeMac::isControlStyled): See the comments for a full explanation, but this is mostly code for Lion and SnowLeopard to determine if we can opt into the new artwork. (WebCore::RenderThemeMac::paintTextField): (WebCore::RenderThemeMac::textField): 2012-05-10 Anders Carlsson WebKit1: Add a way to blacklist specific plug-ins/plug-in versions https://bugs.webkit.org/show_bug.cgi?id=86150 Reviewed by Sam Weinig. * English.lproj/Localizable.strings: Update. * loader/SubframeLoader.cpp: (WebCore::SubframeLoader::loadPlugin): It is possible that the client has already set the unavailability reason so don't try to set it twice. * platform/LocalizedStrings.cpp: (WebCore::insecurePluginVersionText): * platform/LocalizedStrings.h: Add insecure plug-in version text. * rendering/RenderEmbeddedObject.cpp: (WebCore::RenderEmbeddedObject::unavailablePluginReplacementText): * rendering/RenderEmbeddedObject.h: Add InsecurePluginVersion unavailability reason. 2012-05-10 Eric Seidel Make IFRAME_SEAMLESS child documents inherit styles from their parent iframe element https://bugs.webkit.org/show_bug.cgi?id=85940 Reviewed by Ojan Vafai. The HTML5