⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 285785 in webkit


Ignore:
Timestamp:
Nov 13, 2021, 4:19:27 PM (5 years ago)
Author:
Said Abou-Hallawa
Message:

REGRESSION (r285618): [mac-wk1] ASSERTION FAILED: cgContext == [currentContext CGContext]
https://bugs.webkit.org/show_bug.cgi?id=233008
rdar://85311948

Reviewed by Wenson Hsieh.

Source/WebCore:

The assertion fails when loading the expected html page because one of
the elements has a CSS filter named "(#noop)" but the filter "noop" is
not defined.

The reason for the assertion to fail is we switch the PaintInfo to the
context of the CSSFilter::sourceImage() and we do not restore it back.
In fact CSSFilter::buildFilterFunctions() should fail since the filter
has only a reference filter and this reference filter does not exit. The
bug is CSSFilter::buildFilterFunctions() does not fail in this case.

Before r285618, CSSFilter::buildFilterFunctions() was not adding
SourceGraphic to m_functions. It was added as the input of the first
FilterEffect. This was fine since we were applying the lastEffect which
goes backward till it reaches the SourceGraphic.

But the plan is to apply the FilterFunctions from the first to the last
without having to go backward, so we need to add the SourceGraphic to
m_functions explicitly. The bug happens when no FilterFunction is built
successfully and we return 'true' because m_functions is not empty. It
has the SourceGraphic.

The fix is to add the SourceGraphic only when there is at least another
FilterFunction will be added to m_functions.

  • rendering/CSSFilter.cpp:

(WebCore::CSSFilter::buildFilterFunctions):

LayoutTests:

Unskip the test http/tests/css/filters-on-iframes-transform.html which
was skipped in r285656.

  • platform/mac-wk1/TestExpectations:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r285781 r285785  
     12021-11-13  Said Abou-Hallawa  <said@apple.com>
     2
     3        REGRESSION (r285618): [mac-wk1] ASSERTION FAILED: cgContext == [currentContext CGContext]
     4        https://bugs.webkit.org/show_bug.cgi?id=233008
     5        rdar://85311948
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        Unskip the test http/tests/css/filters-on-iframes-transform.html which
     10        was skipped in r285656.
     11
     12        * platform/mac-wk1/TestExpectations:
     13
    1142021-11-13  Simon Fraser  <simon.fraser@apple.com>
    215
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r285743 r285785  
    15171517webkit.org/b/232585 [ Catalina Debug ] media/track/track-element-load-event.html [ Pass Crash ]
    15181518
    1519 webkit.org/b/233008 [ Debug ] http/tests/css/filters-on-iframes-transform.html [ Skip ]
    1520 
    15211519# DumpRenderTree doesn't invoke inspector instrumentation when repainting.
    15221520webkit.org/b/232852 inspector/page/setShowPaintRects.html [ Skip ]
  • trunk/Source/WebCore/ChangeLog

    r285784 r285785  
     12021-11-13  Said Abou-Hallawa  <said@apple.com>
     2
     3        REGRESSION (r285618): [mac-wk1] ASSERTION FAILED: cgContext == [currentContext CGContext]
     4        https://bugs.webkit.org/show_bug.cgi?id=233008
     5        rdar://85311948
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        The assertion fails when loading the expected html page because one of
     10        the elements has a CSS filter named "(#noop)" but the filter "noop" is
     11        not defined.
     12
     13        The reason for the assertion to fail is we switch the PaintInfo to the
     14        context of the CSSFilter::sourceImage() and we do not restore it back.
     15        In fact CSSFilter::buildFilterFunctions() should fail since the filter
     16        has only a reference filter and this reference filter does not exit. The
     17        bug is CSSFilter::buildFilterFunctions() does not fail in this case.
     18
     19        Before r285618, CSSFilter::buildFilterFunctions() was not adding
     20        SourceGraphic to m_functions. It was added as the input of the first
     21        FilterEffect. This was fine since we were applying the lastEffect which
     22        goes backward till it reaches the SourceGraphic.
     23
     24        But the plan is to apply the FilterFunctions from the first to the last
     25        without having to go backward, so we need to add the SourceGraphic to
     26        m_functions explicitly. The bug happens when no FilterFunction is built
     27        successfully and we return 'true' because m_functions is not empty. It
     28        has the SourceGraphic.
     29
     30        The fix is to add the SourceGraphic only when there is at least another
     31        FilterFunction will be added to m_functions.
     32
     33        * rendering/CSSFilter.cpp:
     34        (WebCore::CSSFilter::buildFilterFunctions):
     35
    1362021-11-13  Zalan Bujtas  <zalan@apple.com>
    237
  • trunk/Source/WebCore/rendering/CSSFilter.cpp

    r285654 r285785  
    243243
    244244    RefPtr<FilterEffect> previousEffect = SourceGraphic::create(*this);
    245     m_functions.append({ *previousEffect });
    246 
    247245    RefPtr<SVGFilter> filter;
    248246   
     
    304302        }
    305303
     304        if ((filter || effect) && m_functions.isEmpty()) {
     305            ASSERT(previousEffect->filterType() == FilterEffect::Type::SourceGraphic);
     306            m_functions.append({ *previousEffect });
     307        }
     308       
    306309        if (filter) {
    307310            effect = filter->lastEffect();
Note: See TracChangeset for help on using the changeset viewer.