Diff
Modified: branches/safari-600.1.4.15-branch/LayoutTests/ChangeLog (179298 => 179299)
--- branches/safari-600.1.4.15-branch/LayoutTests/ChangeLog 2015-01-28 22:26:32 UTC (rev 179298)
+++ branches/safari-600.1.4.15-branch/LayoutTests/ChangeLog 2015-01-28 22:35:39 UTC (rev 179299)
@@ -1,5 +1,25 @@
2015-01-28 Lucas Forschler <[email protected]>
+ Merge r178380
+
+ 2015-01-13 Dean Jackson <[email protected]>
+
+ Filters aren't applied to elements in columns after the first
+ https://bugs.webkit.org/show_bug.cgi?id=140331
+ <rdar://problem/19313858>
+
+ Reviewed by Simon Fraser.
+
+ Tests for filters and clipping on a column other
+ than the first.
+
+ * fast/multicol/clip-in-columns-expected.html: Added.
+ * fast/multicol/clip-in-columns.html: Added.
+ * fast/multicol/filter-in-columns-expected.html: Added.
+ * fast/multicol/filter-in-columns.html: Added.
+
+2015-01-28 Lucas Forschler <[email protected]>
+
Merge r178038
2015-01-07 Chris Fleizach <[email protected]>
Copied: branches/safari-600.1.4.15-branch/LayoutTests/fast/multicol/clip-in-columns-expected.html (from rev 178380, trunk/LayoutTests/fast/multicol/clip-in-columns-expected.html) (0 => 179299)
--- branches/safari-600.1.4.15-branch/LayoutTests/fast/multicol/clip-in-columns-expected.html (rev 0)
+++ branches/safari-600.1.4.15-branch/LayoutTests/fast/multicol/clip-in-columns-expected.html 2015-01-28 22:35:39 UTC (rev 179299)
@@ -0,0 +1,30 @@
+<style>
+section {
+ height: 200px;
+ width: 300px;
+ position: relative;
+}
+
+p {
+ padding: 0;
+ margin: 0;
+}
+
+.break-after {
+ page-break-after: always;
+}
+
+.clipped {
+ position: absolute;
+ left: 150px;
+ top: 0;
+ width: 150px;
+ background: blue;
+ color: white;
+ -webkit-clip-path: polygon(5px 5px, 60px 5px, 60px 20px, 5px 20px);
+}
+</style>
+<section>
+<p class="break-after">Hello</p>
+<p class="clipped">World</p>
+</section>
\ No newline at end of file
Copied: branches/safari-600.1.4.15-branch/LayoutTests/fast/multicol/clip-in-columns.html (from rev 178380, trunk/LayoutTests/fast/multicol/clip-in-columns.html) (0 => 179299)
--- branches/safari-600.1.4.15-branch/LayoutTests/fast/multicol/clip-in-columns.html (rev 0)
+++ branches/safari-600.1.4.15-branch/LayoutTests/fast/multicol/clip-in-columns.html 2015-01-28 22:35:39 UTC (rev 179299)
@@ -0,0 +1,27 @@
+<style>
+section {
+ columns: 2;
+ column-gap: 0;
+ height: 200px;
+ width: 300px;
+}
+
+p {
+ padding: 0;
+ margin: 0;
+}
+
+.break-after {
+ page-break-after: always;
+}
+
+.clipped {
+ background: blue;
+ color: white;
+ -webkit-clip-path: polygon(5px 5px, 60px 5px, 60px 20px, 5px 20px);
+}
+</style>
+<section>
+<p class="break-after">Hello</p>
+<p class="clipped">World</p>
+</section>
\ No newline at end of file
Copied: branches/safari-600.1.4.15-branch/LayoutTests/fast/multicol/filter-in-columns-expected.html (from rev 178380, trunk/LayoutTests/fast/multicol/filter-in-columns-expected.html) (0 => 179299)
--- branches/safari-600.1.4.15-branch/LayoutTests/fast/multicol/filter-in-columns-expected.html (rev 0)
+++ branches/safari-600.1.4.15-branch/LayoutTests/fast/multicol/filter-in-columns-expected.html 2015-01-28 22:35:39 UTC (rev 179299)
@@ -0,0 +1,29 @@
+<style>
+section {
+ height: 200px;
+ width: 300px;
+ position: relative;
+}
+
+p {
+ padding: 0;
+ margin: 0;
+}
+
+.break-after {
+ page-break-after: always;
+}
+
+.filtered {
+ position: absolute;
+ left: 150px;
+ top: 0;
+ width: 150px;
+ background: white;
+ -webkit-filter: invert();
+}
+</style>
+<section>
+<p class="break-after">Hello</p>
+<p class="filtered">World</p>
+</section>
\ No newline at end of file
Copied: branches/safari-600.1.4.15-branch/LayoutTests/fast/multicol/filter-in-columns.html (from rev 178380, trunk/LayoutTests/fast/multicol/filter-in-columns.html) (0 => 179299)
--- branches/safari-600.1.4.15-branch/LayoutTests/fast/multicol/filter-in-columns.html (rev 0)
+++ branches/safari-600.1.4.15-branch/LayoutTests/fast/multicol/filter-in-columns.html 2015-01-28 22:35:39 UTC (rev 179299)
@@ -0,0 +1,26 @@
+<style>
+section {
+ columns: 2;
+ column-gap: 0;
+ height: 200px;
+ width: 300px;
+}
+
+p {
+ padding: 0;
+ margin: 0;
+}
+
+.break-after {
+ page-break-after: always;
+}
+
+.filtered {
+ background: white;
+ -webkit-filter: invert();
+}
+</style>
+<section>
+<p class="break-after">Hello</p>
+<p class="filtered">World</p>
+</section>
\ No newline at end of file
Modified: branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog (179298 => 179299)
--- branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog 2015-01-28 22:26:32 UTC (rev 179298)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog 2015-01-28 22:35:39 UTC (rev 179299)
@@ -1,5 +1,34 @@
2015-01-28 Lucas Forschler <[email protected]>
+ Merge r178380
+
+ 2015-01-13 Dean Jackson <[email protected]>
+
+ Filters aren't applied to elements in columns after the first
+ https://bugs.webkit.org/show_bug.cgi?id=140331
+
+ Reviewed by Simon Fraser.
+
+ The important bits of this change came from Simon.
+
+ Filters and clipping were not taking columns into
+ account when using their offset rectangles. The fix
+ is to recalculate the rects if you're in such a
+ situation.
+
+ Tests: fast/multicol/clip-in-columns.html
+ fast/multicol/filter-in-columns.html
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::hasFilterThatIsPainting): New method used
+ to check if we're about to paint a filter.
+ (WebCore::RenderLayer::setupFilters): Use the new helper if possible.
+ (WebCore::RenderLayer::paintLayerContents): If we're in columns,
+ and we either have a clip or a filter, recalculate the offset rectangles.
+ * rendering/RenderLayer.h:
+
+2015-01-28 Lucas Forschler <[email protected]>
+
Merge r178175
2015-01-08 Enrica Casucci <[email protected]>
Modified: branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderLayer.cpp (179298 => 179299)
--- branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderLayer.cpp 2015-01-28 22:26:32 UTC (rev 179298)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderLayer.cpp 2015-01-28 22:35:39 UTC (rev 179299)
@@ -3868,23 +3868,35 @@
#if ENABLE(CSS_FILTERS)
-std::unique_ptr<FilterEffectRendererHelper> RenderLayer::setupFilters(GraphicsContext* context, LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags, const LayoutSize& offsetFromRoot, LayoutRect& rootRelativeBounds, bool& rootRelativeBoundsComputed)
+bool RenderLayer::hasFilterThatIsPainting(GraphicsContext* context, PaintLayerFlags paintFlags) const
{
if (context->paintingDisabled())
- return nullptr;
+ return false;
if (paintFlags & PaintLayerPaintingOverlayScrollbars)
- return nullptr;
+ return false;
FilterInfo* filterInfo = FilterInfo::getIfExists(*this);
bool hasPaintedFilter = filterInfo && filterInfo->renderer() && paintsWithFilters();
if (!hasPaintedFilter)
- return nullptr;
+ return false;
auto filterPainter = std::make_unique<FilterEffectRendererHelper>(hasPaintedFilter);
if (!filterPainter->haveFilterEffect())
+ return false;
+
+ return true;
+}
+
+std::unique_ptr<FilterEffectRendererHelper> RenderLayer::setupFilters(GraphicsContext* context, LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags, const LayoutSize& offsetFromRoot, LayoutRect& rootRelativeBounds, bool& rootRelativeBoundsComputed)
+{
+ if (!hasFilterThatIsPainting(context, paintFlags))
return nullptr;
-
+
+ FilterInfo* filterInfo = FilterInfo::getIfExists(*this);
+ bool hasPaintedFilter = filterInfo && filterInfo->renderer() && paintsWithFilters();
+ auto filterPainter = std::make_unique<FilterEffectRendererHelper>(hasPaintedFilter);
+
LayoutRect filterRepaintRect = filterInfo->dirtySourceRect();
filterRepaintRect.move(offsetFromRoot);
@@ -4005,13 +4017,16 @@
bool needToAdjustSubpixelQuantization = setupFontSubpixelQuantization(context, didQuantizeFonts);
// Apply clip-path to context.
- bool hasClipPath = setupClipPath(context, paintingInfo, offsetFromRoot, rootRelativeBounds, rootRelativeBoundsComputed);
+ LayoutSize columnAwareOffsetFromRoot = offsetFromRoot;
+ if (renderer().flowThreadContainingBlock() && (renderer().hasClipPath() || hasFilterThatIsPainting(context, paintFlags)))
+ columnAwareOffsetFromRoot = toLayoutSize(convertToLayerCoords(paintingInfo.rootLayer, LayoutPoint(), AdjustForColumns));
+ bool hasClipPath = setupClipPath(context, paintingInfo, columnAwareOffsetFromRoot, rootRelativeBounds, rootRelativeBoundsComputed);
LayerPaintingInfo localPaintingInfo(paintingInfo);
GraphicsContext* transparencyLayerContext = context;
#if ENABLE(CSS_FILTERS)
- 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) {
Modified: branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderLayer.h (179298 => 179299)
--- branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderLayer.h 2015-01-28 22:26:32 UTC (rev 179298)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderLayer.h 2015-01-28 22:35:39 UTC (rev 179299)
@@ -981,6 +981,7 @@
bool setupFontSubpixelQuantization(GraphicsContext*, bool& didQuantizeFonts);
bool setupClipPath(GraphicsContext*, const LayerPaintingInfo&, const LayoutSize& offsetFromRoot, LayoutRect& rootRelativeBounds, bool& rootRelativeBoundsComputed);
#if ENABLE(CSS_FILTERS)
+ bool hasFilterThatIsPainting(GraphicsContext*, PaintLayerFlags) const;
std::unique_ptr<FilterEffectRendererHelper> setupFilters(GraphicsContext*, LayerPaintingInfo&, PaintLayerFlags, const LayoutSize& offsetFromRoot, LayoutRect& rootRelativeBounds, bool& rootRelativeBoundsComputed);
GraphicsContext* applyFilters(FilterEffectRendererHelper*, GraphicsContext* originalContext, LayerPaintingInfo&, LayerFragments&);
#endif