Changeset 154430 in webkit


Ignore:
Timestamp:
Aug 21, 2013 5:15:08 PM (11 years ago)
Author:
Simon Fraser
Message:

Setting -webkit-filter: in :active selector causes failure to redraw
https://bugs.webkit.org/show_bug.cgi?id=120135

Source/WebCore:

Reviewed by Jer Noble.

When removing a filter on an inline child of a compositing layer,
the inline loses its RenderLayer and compositing layer, but we fail to
repaint the compositing layer that the inline is now painting into.

This worked correctly for opacity, because opacity toggles cause
layouts (which then paint the correct layer), so do the same for filters.

Test: css3/filters/remove-filter-repaint.html

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::changeRequiresLayout): Return true if we toggled
between having filters and not. Drive-by cleanup, making use of new convenience
function for hasOpacity().

  • rendering/style/StyleRareNonInheritedData.cpp:

(WebCore::StyleRareNonInheritedData::hasFilters): Returns true if we have any
filters.

  • rendering/style/StyleRareNonInheritedData.h:

(WebCore::StyleRareNonInheritedData::hasOpacity): Convenience function that
returns true if opacity is < 1.

LayoutTests:

Reviewed by Jer Noble.

Ref test for removing a filter on an inline.

  • css3/filters/remove-filter-repaint-expected.html: Added.
  • css3/filters/remove-filter-repaint.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r154429 r154430  
     12013-08-21  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Setting -webkit-filter: in :active selector causes failure to redraw
     4        https://bugs.webkit.org/show_bug.cgi?id=120135
     5
     6        Reviewed by Jer Noble.
     7       
     8        Ref test for removing a filter on an inline.
     9
     10        * css3/filters/remove-filter-repaint-expected.html: Added.
     11        * css3/filters/remove-filter-repaint.html: Added.
     12
    1132013-08-21  Yi Shen  <max.hong.shen@gmail.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r154422 r154430  
     12013-08-21  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Setting -webkit-filter: in :active selector causes failure to redraw
     4        https://bugs.webkit.org/show_bug.cgi?id=120135
     5
     6        Reviewed by Jer Noble.
     7       
     8        When removing a filter on an inline child of a compositing layer,
     9        the inline loses its RenderLayer and compositing layer, but we fail to
     10        repaint the compositing layer that the inline is now painting into.
     11       
     12        This worked correctly for opacity, because opacity toggles cause
     13        layouts (which then paint the correct layer), so do the same for filters.
     14
     15        Test: css3/filters/remove-filter-repaint.html
     16
     17        * rendering/style/RenderStyle.cpp:
     18        (WebCore::RenderStyle::changeRequiresLayout): Return true if we toggled
     19        between having filters and not. Drive-by cleanup, making use of new convenience
     20        function for hasOpacity().
     21        * rendering/style/StyleRareNonInheritedData.cpp:
     22        (WebCore::StyleRareNonInheritedData::hasFilters): Returns true if we have any
     23        filters.
     24        * rendering/style/StyleRareNonInheritedData.h:
     25        (WebCore::StyleRareNonInheritedData::hasOpacity): Convenience function that
     26        returns true if opacity is < 1.
     27
    1282013-08-21  Gavin Barraclough  <barraclough@apple.com>
    229
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r154023 r154430  
    598598        return true;
    599599
    600     if ((rareNonInheritedData->opacity == 1 && other->rareNonInheritedData->opacity < 1)
    601         || (rareNonInheritedData->opacity < 1 && other->rareNonInheritedData->opacity == 1)) {
     600    if (rareNonInheritedData->hasOpacity() != other->rareNonInheritedData->hasOpacity()) {
    602601        // FIXME: We would like to use SimplifiedLayout here, but we can't quite do that yet.
    603602        // We need to make sure SimplifiedLayout can operate correctly on RenderInlines (we will need
     
    607606        return true;
    608607    }
     608
     609#if ENABLE(CSS_FILTERS)
     610    if (rareNonInheritedData->hasFilters() != other->rareNonInheritedData->hasFilters())
     611        return true;
     612#endif
    609613
    610614    const QuotesData* quotesDataA = rareInheritedData->quotes.get();
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp

    r153330 r154430  
    327327}
    328328
     329bool StyleRareNonInheritedData::hasFilters() const
     330{
     331    return m_filter.get() && !m_filter->m_operations.isEmpty();
     332}
     333
    329334} // namespace WebCore
  • trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h

    r153330 r154430  
    9191    bool animationDataEquivalent(const StyleRareNonInheritedData&) const;
    9292    bool transitionDataEquivalent(const StyleRareNonInheritedData&) const;
    93 
    94     float opacity; // Whether or not we're transparent.
     93    bool hasFilters() const;
     94    bool hasOpacity() const { return opacity < 1; }
     95
     96    float opacity;
    9597
    9698    float m_aspectRatioDenominator;
Note: See TracChangeset for help on using the changeset viewer.