Bug 140331 - Filters aren't applied to elements in columns after the first
Summary: Filters aren't applied to elements in columns after the first
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dean Jackson
URL:
Keywords: InRadar
Depends on:
Blocks: 144043
  Show dependency treegraph
 
Reported: 2015-01-09 20:58 PST by Simon Fraser (smfr)
Modified: 2015-04-22 08:53 PDT (History)
8 users (show)

See Also:


Attachments
Testcase (2.64 KB, text/html)
2015-01-09 20:59 PST, Simon Fraser (smfr)
no flags Details
Patch (9.74 KB, patch)
2015-01-13 13:48 PST, Dean Jackson
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2015-01-09 20:58:17 PST
Issue with filters and columns.
Comment 1 Simon Fraser (smfr) 2015-01-09 20:59:38 PST
Created attachment 244402 [details]
Testcase
Comment 2 Simon Fraser (smfr) 2015-01-09 21:03:24 PST
rdar://problem/19313858
Comment 3 Simon Fraser (smfr) 2015-01-09 21:10:30 PST
The rootRelativeBounds computed by RenderLayer::setupFilters() doesn't take columns into account.
Comment 4 Simon Fraser (smfr) 2015-01-09 21:16:22 PST
clip-path is similarly broken.
Comment 5 Simon Fraser (smfr) 2015-01-09 21:41:26 PST
Fix is something like this:

diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp
index 1e9f4955775fa120f39cca40126296089e043746..8688273887be2d6dba3d741afe925a02071de05b 100644
--- a/Source/WebCore/rendering/RenderLayer.cpp
+++ b/Source/WebCore/rendering/RenderLayer.cpp
@@ -4094,12 +4094,14 @@ void RenderLayer::paintLayerContents(GraphicsContext* context, const LayerPainti
     bool needToAdjustSubpixelQuantization = setupFontSubpixelQuantization(context, didQuantizeFonts);
 
     // Apply clip-path to context.
-    bool hasClipPath = setupClipPath(context, paintingInfo, offsetFromRoot, rootRelativeBounds, rootRelativeBoundsComputed);
+    LayoutSize columnAwareOffsetFromRoot = toLayoutSize(convertToLayerCoords(paintingInfo.rootLayer, LayoutPoint(), AdjustForColumns));
+    bool hasClipPath = setupClipPath(context, paintingInfo, columnAwareOffsetFromRoot, rootRelativeBounds, rootRelativeBoundsComputed);
 
     LayerPaintingInfo localPaintingInfo(paintingInfo);
 
     GraphicsContext* transparencyLayerContext = context;
-    std::unique_ptr<FilterEffectRendererHelper> filterPainter = setupFilters(context, localPaintingInfo, paintFlags, offsetFromRoot, rootRelativeBounds, rootRelativeBoundsComputed);
+
+    std::unique_ptr<FilterEffectRendererHelper> filterPainter = setupFilters(context, localPaintingInfo, paintFlags, columnAwareOffsetFromRoot, rootRelativeBounds, rootRelativeBoundsComputed);
     if (filterPainter) {
         context = filterPainter->filterContext();
         if (context != transparencyLayerContext && haveTransparency) {
Comment 6 Dean Jackson 2015-01-13 13:48:17 PST
Created attachment 244539 [details]
Patch
Comment 7 Simon Fraser (smfr) 2015-01-13 14:18:38 PST
Comment on attachment 244539 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=244539&action=review

> Source/WebCore/rendering/RenderLayer.cpp:4110
> +    if (renderer().flowThreadContainingBlock() && (renderer().hasClipPath() || hasFilterThatIsPainting(context, paintFlags)))

Is the renderer().flowThreadContainingBlock() permissive enough to handle blocks deeply nested inside columns?
Comment 8 Dean Jackson 2015-01-13 15:05:40 PST
Comment on attachment 244539 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=244539&action=review

>> Source/WebCore/rendering/RenderLayer.cpp:4110
>> +    if (renderer().flowThreadContainingBlock() && (renderer().hasClipPath() || hasFilterThatIsPainting(context, paintFlags)))
> 
> Is the renderer().flowThreadContainingBlock() permissive enough to handle blocks deeply nested inside columns?

I believe so.
Comment 9 Dean Jackson 2015-01-13 15:22:47 PST
Committed r178380: <http://trac.webkit.org/changeset/178380>