Layer bounds are incorrect for sharing layers that paint with transforms
[WebKit-https.git] / Source / WebCore / ChangeLog
index 202999a..c7c8dca 100644 (file)
@@ -1,3 +1,208 @@
+2019-05-11  Simon Fraser  <simon.fraser@apple.com>
+
+        Layer bounds are incorrect for sharing layers that paint with transforms
+        https://bugs.webkit.org/show_bug.cgi?id=197768
+        <rdar://problem/50695493>
+
+        Reviewed by Zalan Bujtas.
+
+        We don't need to traverse shared layers if the backing-provider has overflow clip,
+        because we know they are containing-block descendants and therefore clipped.
+
+        Note tha the CSS "clip" property doesn't guarantee this, because the clip rect
+        can be larger than the element, so in that case we just traverse shared layers.
+
+        Tests: compositing/shared-backing/sharing-bounds-clip.html
+               compositing/shared-backing/sharing-bounds-non-clipping-shared-layer.html
+               compositing/shared-backing/sharing-bounds-transformed-sharing-layer.html
+               compositing/shared-backing/sharing-bounds.html
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateCompositedBounds):
+
+2019-05-11  Simon Fraser  <simon.fraser@apple.com>
+
+        Translucent gradient rendering bug due to will-change transform
+        https://bugs.webkit.org/show_bug.cgi?id=197654
+        <rdar://problem/50547664>
+
+        Reviewed by Dean Jackson.
+        
+        We failed to re-evaluate 'contentsOpaque' when a background changed, because this
+        happened in updateGeometry() and that doesn't run for background changes.
+        
+        However, 'contentsOpaque' also requires knowing about geometry because we have to
+        turn it off when there's subpixel positioning, and updateConfiguration()
+        runs before updateGeometry().
+        
+        So compute m_hasSubpixelRounding in updateGeometry() and set contentsOpaque in
+        updateAfterDescendants().
+
+        Test: compositing/contents-opaque/background-change-to-transparent.html
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateConfiguration):
+        (WebCore::RenderLayerBacking::updateGeometry):
+        (WebCore::RenderLayerBacking::updateAfterDescendants):
+        * rendering/RenderLayerBacking.h:
+
+2019-05-11  Simon Fraser  <simon.fraser@apple.com>
+
+        When the scroller hosting a shared layer becomes non-scrollable, content disappears
+        https://bugs.webkit.org/show_bug.cgi?id=197766
+        <rdar://problem/50695808>
+
+        Reviewed by Zalan Bujtas.
+
+        RenderLayerCompositor::requiresOwnBackingStore() should return true for a layer that shares
+        its backing store. We always made backing for overlap layers, so even  if the sharing layers
+        have no painted content, this should rarely be a backing store memory regression.
+
+        Test: compositing/shared-backing/overflow-scroll/sharing-layer-becomes-non-scrollable.html
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
+
+2019-05-11  Simon Fraser  <simon.fraser@apple.com>
+
+        Backing-sharing layers with transforms render incorrectly
+        https://bugs.webkit.org/show_bug.cgi?id=197692
+        <rdar://problem/50652127>
+
+        Reviewed by Antti Koivisto.
+
+        Layers that paint into shared backing need to enter the RenderLayer painting code
+        in a way that paints the filters, transforms, opacity and blending.
+        
+        RenderLayerBacking::paintIntoLayer() normally enters at paintLayerContents(), because
+        the effects are rendered via the GraphicsLayer, but shared layers will paint effects.
+        Note that if the backing-provider has effects, it will be the stacking context
+        for the shared layers, so it's correct that sharing layers are impacted by effects
+        on the backing-provider.
+
+        In addition, we have to ensure that we don't over-eagerly make layers shared.
+        Consider:
+        
+        <div class="clipping">
+            <div class="sharing">
+                <div class="inner">
+                </div>
+            </div>
+        </div>
+        
+        Here "clipping" is the provider layer, "sharing" paints into shared backing, but
+        we don't want to also mark "inner" as sharing, since "sharing" will just paint it.
+        This is akin to avoiding unnecessary compositing of z-order descendants when they can just
+        paint.
+        
+        To do this we need to ensure that sharing layers are treated like compositing layers
+        in the overlap map, i.e. when a layer is sharing, we call overlapMap.pushCompositingContainer(),
+        and later overlapMap.popCompositingContainer().
+
+        Tests: compositing/shared-backing/nested-shared-layers-with-opacity.html
+               compositing/shared-backing/shared-layer-has-blending.html
+               compositing/shared-backing/shared-layer-has-filter.html
+               compositing/shared-backing/shared-layer-has-opacity.html
+               compositing/shared-backing/shared-layer-has-reflection.html
+               compositing/shared-backing/shared-layer-has-transform.html
+               compositing/shared-backing/shared-layer-isolates-blending.html
+               compositing/shared-backing/shared-transformed-layer-bounds.html
+               compositing/shared-backing/sharing-layer-becomes-non-scrollable.html
+               compositing/shared-backing/sharing-layer-has-effect.html
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::paintLayer):
+        (WebCore::RenderLayer::paintLayerWithEffects):
+        * rendering/RenderLayer.h:
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::paintIntoLayer):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::CompositingState::stateForPaintOrderChildren const):
+        (WebCore::backingProviderLayerCanIncludeLayer):
+        (WebCore::RenderLayerCompositor::computeCompositingRequirements):
+        (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
+
+2019-05-10  Youenn Fablet  <youenn@apple.com>
+
+        A service worker instance should be terminated when its SWServer is destroyed
+        https://bugs.webkit.org/show_bug.cgi?id=197801
+        <rdar://problem/50587270>
+
+        Reviewed by Chris Dumez.
+
+        On session destruction, the SWServer is destroyed.
+        At that time, it should terminate all its running service workers.
+        Covered by updated API test.
+
+        * workers/service/server/SWServer.cpp:
+        (WebCore::SWServer::~SWServer):
+
+2019-05-10  Eric Carlson  <eric.carlson@apple.com>
+
+        [iOS] HTMLMediaElement sometimes doesn't send 'webkitplaybacktargetavailabilitychanged' event
+        https://bugs.webkit.org/show_bug.cgi?id=197793
+        <rdar://problem/46429187>
+
+        Reviewed by Jer Noble.
+
+        * html/MediaElementSession.cpp:
+        (WebCore::MediaElementSession::MediaElementSession): Initialize m_hasPlaybackTargets.
+
+        * platform/audio/ios/MediaSessionManagerIOS.mm:
+        (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange): Log
+        target availability.
+        (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]): Call the client 
+        externalOutputDeviceAvailableDidChange method after the AVRouteDetector is available.
+
+2019-05-09  Geoffrey Garen  <ggaren@apple.com>
+
+        Downgrade RELEASE_ASSERT TO RELEASE_LOG_FAULT for SQLite Class A files
+        https://bugs.webkit.org/show_bug.cgi?id=197760
+
+        Reviewed by Jer Noble.
+
+        We have all the data we need, and this crash is happening more than
+        expected.
+
+        * platform/sql/SQLiteDatabase.cpp:
+        (WebCore::SQLiteDatabase::open):
+
+2019-05-10  Zalan Bujtas  <zalan@apple.com>
+
+        [iOS] baidu.com: Synthetic bold renders too far apart, appears doubled.
+        https://bugs.webkit.org/show_bug.cgi?id=197781
+        <rdar://problem/48027412>
+
+        Reviewed by Simon Fraser.
+
+        Synthetic bold is essentially two regular glyphs painted with an offset. While on macOS this offset is always 1px (CSS), on iOS larger font produces higher offset value. At paint time, this offset value (in CSS px unit) get converted
+        to a device pixel value taking context scale into account. This conversion ensures that the gap between the 2 regular glyphs won't get wider (in device pixels) as the user pinch zooms in.
+        This works as long as the scale on the context is >= 1. This patch ensures that a scaled down context won't blow up this gap.
+
+        Test: fast/text/large-synthetic-bold-with-scale-transform.html
+
+        * platform/graphics/cocoa/FontCascadeCocoa.mm:
+        (WebCore::FontCascade::drawGlyphs):
+
+2019-05-10  Brent Fulgham  <bfulgham@apple.com>
+
+        Gracefully handle inaccessible font face data
+        https://bugs.webkit.org/show_bug.cgi?id=197762
+        <rdar://problem/50433861>
+
+        Reviewed by Per Arne Vollan.
+
+        Make sure CSS Font Face handling gracefully recovers from
+        missing font data.
+
+        Test: fast/text/missing-font-crash.html
+
+        * css/CSSFontFace.cpp:
+        (WebCore::CSSFontFace::fontLoadEventOccurred):
+        (WebCore::CSSFontFace::timeoutFired):
+        (WebCore::CSSFontFace::fontLoaded):
+        (WebCore::CSSFontFace::font):
+
 2019-05-10  Simon Fraser  <simon.fraser@apple.com>
 
         ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant()) on nytimes.com after r245170