Changeset 122130 in webkit


Ignore:
Timestamp:
Jul 9, 2012 12:16:12 PM (12 years ago)
Author:
Alexandru Chiculita
Message:

[CSS Filters] Blur filter is not repainted correctly when applied on a parent of a fixed element
https://bugs.webkit.org/show_bug.cgi?id=90087

Reviewed by Simon Fraser.

Source/WebCore:

Added a new method, RenderLayer::hasAncestorWithFilterOutsets, to check that there's no filter with outsets (ie. blur)
applied on top level fixed positioned elements, nor any of its parent layers. In the event of a blur filter we need to
disable the fast scrolling optimization, otherwise the outsets of the filter will be carried around the page and
repainting will not work correctly.

Tests: css3/filters/blur-filter-page-scroll-parents.html

css3/filters/blur-filter-page-scroll-self.html

  • page/FrameView.cpp:

(WebCore::FrameView::scrollContentsFastPath):

  • rendering/RenderLayer.cpp:

(WebCore):
(WebCore::RenderLayer::hasAncestorWithFilterOutsets):

  • rendering/RenderLayer.h:

(RenderLayer):

LayoutTests:

Added two new tests to check that we disable fast path scrolling for fixed positioned
elements that have blur applied on them or any of the parent layers.

  • css3/filters/blur-filter-page-scroll-parents.html: Added.
  • css3/filters/blur-filter-page-scroll-self.html: Added.
  • platform/chromium/css3/filters/blur-filter-page-scroll-parents-expected.png: Added.
  • platform/chromium/css3/filters/blur-filter-page-scroll-parents-expected.txt: Added.
  • platform/chromium/css3/filters/blur-filter-page-scroll-self-expected.png: Added.
  • platform/chromium/css3/filters/blur-filter-page-scroll-self-expected.txt: Added.
  • platform/mac/css3/filters/blur-filter-page-scroll-parents-expected.png: Added.
  • platform/mac/css3/filters/blur-filter-page-scroll-parents-expected.txt: Added.
  • platform/mac/css3/filters/blur-filter-page-scroll-self-expected.png: Added.
  • platform/mac/css3/filters/blur-filter-page-scroll-self-expected.txt: Added.
  • platform/qt/Skipped: Qt needs platform results.
Location:
trunk
Files:
10 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r122127 r122130  
     12012-07-09  Alexandru Chiculita  <achicu@adobe.com>
     2
     3        [CSS Filters] Blur filter is not repainted correctly when applied on a parent of a fixed element
     4        https://bugs.webkit.org/show_bug.cgi?id=90087
     5
     6        Reviewed by Simon Fraser.
     7
     8        Added two new tests to check that we disable fast path scrolling for fixed positioned
     9        elements that have blur applied on them or any of the parent layers.
     10
     11        * css3/filters/blur-filter-page-scroll-parents.html: Added.
     12        * css3/filters/blur-filter-page-scroll-self.html: Added.
     13        * platform/chromium/css3/filters/blur-filter-page-scroll-parents-expected.png: Added.
     14        * platform/chromium/css3/filters/blur-filter-page-scroll-parents-expected.txt: Added.
     15        * platform/chromium/css3/filters/blur-filter-page-scroll-self-expected.png: Added.
     16        * platform/chromium/css3/filters/blur-filter-page-scroll-self-expected.txt: Added.
     17        * platform/mac/css3/filters/blur-filter-page-scroll-parents-expected.png: Added.
     18        * platform/mac/css3/filters/blur-filter-page-scroll-parents-expected.txt: Added.
     19        * platform/mac/css3/filters/blur-filter-page-scroll-self-expected.png: Added.
     20        * platform/mac/css3/filters/blur-filter-page-scroll-self-expected.txt: Added.
     21        * platform/qt/Skipped: Qt needs platform results.
     22
    1232012-07-09  Joshua Bell  <jsbell@chromium.org>
    224
  • trunk/LayoutTests/platform/qt/Skipped

    r122095 r122130  
    21622162css3/filters/composited-during-transition-layertree.html
    21632163css3/filters/composited-during-animation.html
     2164css3/filters/blur-filter-page-scroll.html
     2165css3/filters/blur-filter-page-scroll-self.html
     2166css3/filters/blur-filter-page-scroll-parents.html
    21642167svg/foreignObject/fO-display-none-with-relative-pos-content.svg
    21652168svg/foreignObject/fO-display-none.svg
  • trunk/Source/WebCore/ChangeLog

    r122127 r122130  
     12012-07-09  Alexandru Chiculita  <achicu@adobe.com>
     2
     3        [CSS Filters] Blur filter is not repainted correctly when applied on a parent of a fixed element
     4        https://bugs.webkit.org/show_bug.cgi?id=90087
     5
     6        Reviewed by Simon Fraser.
     7
     8        Added a new method, RenderLayer::hasAncestorWithFilterOutsets, to check that there's no filter with outsets (ie. blur)
     9        applied on top level fixed positioned elements, nor any of its parent layers. In the event of a blur filter we need to
     10        disable the fast scrolling optimization, otherwise the outsets of the filter will be carried around the page and
     11        repainting will not work correctly.
     12
     13        Tests: css3/filters/blur-filter-page-scroll-parents.html
     14               css3/filters/blur-filter-page-scroll-self.html
     15
     16        * page/FrameView.cpp:
     17        (WebCore::FrameView::scrollContentsFastPath):
     18        * rendering/RenderLayer.cpp:
     19        (WebCore):
     20        (WebCore::RenderLayer::hasAncestorWithFilterOutsets):
     21        * rendering/RenderLayer.h:
     22        (RenderLayer):
     23
    1242012-07-09  Joshua Bell  <jsbell@chromium.org>
    225
  • trunk/Source/WebCore/page/FrameView.cpp

    r121920 r122130  
    14781478       
    14791479#if ENABLE(CSS_FILTERS)
    1480         if (layer->parent()) {
    1481             RenderBoxModelObject* renderer = layer->parent()->renderer();
    1482             if (renderer->style()->hasFilterOutsets()) {
    1483                 // If the fixed layer has a blur/drop-shadow filter applied on its parent, we cannot
    1484                 // scroll using the fast path, otherwise the outsets of the filter will be moved around the page.
    1485                 return false;
    1486             }
     1480        if (layer->hasAncestorWithFilterOutsets()) {
     1481            // If the fixed layer has a blur/drop-shadow filter applied on at least one of its parents, we cannot
     1482            // scroll using the fast path, otherwise the outsets of the filter will be moved around the page.
     1483            return false;
    14871484        }
    14881485#endif
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r121926 r122130  
    10891089    ASSERT_NOT_REACHED();
    10901090}
     1091
     1092bool RenderLayer::hasAncestorWithFilterOutsets() const
     1093{
     1094    for (const RenderLayer* curr = this; curr; curr = curr->parent()) {
     1095        RenderBoxModelObject* renderer = curr->renderer();
     1096        if (renderer->style()->hasFilterOutsets())
     1097            return true;
     1098    }
     1099    return false;
     1100}
    10911101#endif
    10921102   
  • trunk/Source/WebCore/rendering/RenderLayer.h

    r121124 r122130  
    472472    RenderLayer* enclosingFilterRepaintLayer() const;
    473473    void setFilterBackendNeedsRepaintingInRect(const LayoutRect&, bool immediate);
     474    bool hasAncestorWithFilterOutsets() const;
    474475#endif
    475476
Note: See TracChangeset for help on using the changeset viewer.