Skip to content
Permalink
Browse files
Backdrop Filter should repaint when changed via script
https://bugs.webkit.org/show_bug.cgi?id=149319
rdar://problem/22749892

Reviewed by Tim Horton.

Source/WebCore:

When backdrop filters change, we need to trigger a recomposite, just as we do
for filters. It's ok to re-use ContextSensitivePropertyFilter because
adjustStyleDifference() does the right thing.

Test: css3/filters/backdrop/dynamic-backdrop-filter-change.html

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayerRepaint):

LayoutTests:

* css3/filters/backdrop/dynamic-backdrop-filter-change-expected.html: Added.
* css3/filters/backdrop/dynamic-backdrop-filter-change.html: Added.

Canonical link: https://commits.webkit.org/174245@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198963 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
smfr committed Apr 2, 2016
1 parent 0e8b266 commit 96e52187eeef35afcedec62a1b4dde9d0e5e6c9c
@@ -1,3 +1,14 @@
2016-04-01 Simon Fraser <simon.fraser@apple.com>

Backdrop Filter should repaint when changed via script
https://bugs.webkit.org/show_bug.cgi?id=149319
rdar://problem/22749892

Reviewed by Tim Horton.

* css3/filters/backdrop/dynamic-backdrop-filter-change-expected.html: Added.
* css3/filters/backdrop/dynamic-backdrop-filter-change.html: Added.

2016-03-31 Zalan Bujtas <zalan@apple.com>

putImageData leaves visible artifacts on retina display
@@ -0,0 +1,27 @@
<!DOCTYPE html>

<html>
<head>
<style>
.background {
height: 100px;
width: 100px;
padding: 50px;
background-image: repeating-linear-gradient(black 0px, black 25px, white 25px, white 50px);
border: 1px solid black;
}

#box {
height: 100px;
width: 100px;
-webkit-backdrop-filter: blur(20px);
}
</style>
</head>
<body>
<div class="background">
<div id="box">
</div>
</div>
</body>
</html>
@@ -0,0 +1,41 @@
<!DOCTYPE html>

<html>
<head>
<style>
.background {
height: 100px;
width: 100px;
padding: 50px;
background-image: repeating-linear-gradient(black 0px, black 25px, white 25px, white 50px);
border: 1px solid black;
}

#box {
height: 100px;
width: 100px;
-webkit-backdrop-filter: blur(0px);
}

#box.changed {
-webkit-backdrop-filter: blur(20px);
}
</style>
<script>
if (window.testRunner)
testRunner.notifyDone();

window.addEventListener('load', function() {
window.setTimeout(function() {
document.getElementById('box').classList.add('changed');
}, 0);
}, false);
</script>
</head>
<body>
<div class="background">
<div id="box">
</div>
</div>
</body>
</html>
@@ -1,3 +1,20 @@
2016-04-01 Simon Fraser <simon.fraser@apple.com>

Backdrop Filter should repaint when changed via script
https://bugs.webkit.org/show_bug.cgi?id=149319
rdar://problem/22749892

Reviewed by Tim Horton.

When backdrop filters change, we need to trigger a recomposite, just as we do
for filters. It's ok to re-use ContextSensitivePropertyFilter because
adjustStyleDifference() does the right thing.

Test: css3/filters/backdrop/dynamic-backdrop-filter-change.html

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayerRepaint):

2016-03-31 Zalan Bujtas <zalan@apple.com>

putImageData leaves visible artifacts on retina display
@@ -789,6 +789,13 @@ bool RenderStyle::changeRequiresLayerRepaint(const RenderStyle& other, unsigned&
// Don't return; keep looking for another change.
}

#if ENABLE(FILTERS_LEVEL_2)
if (rareNonInheritedData->m_backdropFilter != other.rareNonInheritedData->m_backdropFilter) {
changedContextSensitiveProperties |= ContextSensitivePropertyFilter;
// Don't return; keep looking for another change.
}
#endif

if (rareNonInheritedData->m_mask != other.rareNonInheritedData->m_mask
|| rareNonInheritedData->m_maskBoxImage != other.rareNonInheritedData->m_maskBoxImage)
return true;

0 comments on commit 96e5218

Please sign in to comment.