Changeset 236416 in webkit


Ignore:
Timestamp:
Sep 24, 2018 11:20:46 AM (6 years ago)
Author:
Simon Fraser
Message:

feMorphology filter in CSS doesn't update when element moves
https://bugs.webkit.org/show_bug.cgi?id=189895

Reviewed by Dean Jackson.

Source/WebCore:

SourceAlpha needs to be invalidated from clearIntermediateResults(),
so get it from the SVGFilterBuilder (which always creates one) and store in
a member variable.

Test: css3/filters/invalidate-sourceAlpha.html

  • rendering/CSSFilter.cpp:

(WebCore::CSSFilter::buildReferenceFilter):
(WebCore::CSSFilter::clearIntermediateResults):

  • rendering/CSSFilter.h:
  • svg/graphics/filters/SVGFilterBuilder.h:

LayoutTests:

Test that moves a box inside a filtered div. Masking is necessary to work
around bugs in feMorphology invalidation (webkit.org/b/189896).

  • css3/filters/invalidate-sourceAlpha-expected.html: Added.
  • css3/filters/invalidate-sourceAlpha.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r236415 r236416  
     12018-09-24  Simon Fraser  <simon.fraser@apple.com>
     2
     3        feMorphology filter in CSS doesn't update when element moves
     4        https://bugs.webkit.org/show_bug.cgi?id=189895
     5
     6        Reviewed by Dean Jackson.
     7       
     8        Test that moves a box inside a filtered div. Masking is necessary to work
     9        around bugs in feMorphology invalidation (webkit.org/b/189896).
     10
     11        * css3/filters/invalidate-sourceAlpha-expected.html: Added.
     12        * css3/filters/invalidate-sourceAlpha.html: Added.
     13
    1142018-09-24  Simon Fraser  <simon.fraser@apple.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r236415 r236416  
     12018-09-24  Simon Fraser  <simon.fraser@apple.com>
     2
     3        feMorphology filter in CSS doesn't update when element moves
     4        https://bugs.webkit.org/show_bug.cgi?id=189895
     5
     6        Reviewed by Dean Jackson.
     7       
     8        SourceAlpha needs to be invalidated from clearIntermediateResults(),
     9        so get it from the SVGFilterBuilder (which always creates one) and store in
     10        a member variable.
     11
     12        Test: css3/filters/invalidate-sourceAlpha.html
     13
     14        * rendering/CSSFilter.cpp:
     15        (WebCore::CSSFilter::buildReferenceFilter):
     16        (WebCore::CSSFilter::clearIntermediateResults):
     17        * rendering/CSSFilter.h:
     18        * svg/graphics/filters/SVGFilterBuilder.h:
     19
    1202018-09-24  Simon Fraser  <simon.fraser@apple.com>
    221
  • trunk/Source/WebCore/rendering/CSSFilter.cpp

    r236413 r236416  
    4141#include "SVGFilterBuilder.h"
    4242#include "SVGFilterPrimitiveStandardAttributes.h"
     43#include "SourceAlpha.h"
    4344#include "SourceGraphic.h"
    4445#include <algorithm>
     
    112113
    113114    auto builder = std::make_unique<SVGFilterBuilder>(&previousEffect);
     115    m_sourceAlpha = builder->getEffectById(SourceAlpha::effectName());
    114116
    115117    for (auto& effectElement : childrenOfType<SVGFilterPrimitiveStandardAttributes>(*filter)) {
     
    356358{
    357359    m_sourceGraphic->clearResult();
     360    if (m_sourceAlpha)
     361        m_sourceAlpha->clearResult();
    358362    for (auto& effect : m_effects)
    359363        effect->clearResult();
  • trunk/Source/WebCore/rendering/CSSFilter.h

    r235644 r236416  
    3838class ReferenceFilterOperation;
    3939class RenderElement;
     40class SourceAlpha;
    4041class SourceGraphic;
    4142
     
    9192    Vector<Ref<FilterEffect>> m_effects;
    9293    Ref<SourceGraphic> m_sourceGraphic;
     94    RefPtr<FilterEffect> m_sourceAlpha;
    9395
    9496    IntRectExtent m_outsets;
  • trunk/Source/WebCore/svg/graphics/filters/SVGFilterBuilder.h

    r226373 r236416  
    4747    void add(const AtomicString& id, RefPtr<FilterEffect>);
    4848
    49     RefPtr<FilterEffect> getEffectById(const AtomicString& id) const;
     49    RefPtr<FilterEffect> getEffectById(const AtomicString&) const;
    5050    FilterEffect* lastEffect() const { return m_lastEffect.get(); }
    5151
Note: See TracChangeset for help on using the changeset viewer.