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

Changeset 242515 in webkit


Ignore:
Timestamp:
Mar 5, 2019, 3:12:51 PM (7 years ago)
Author:
Said Abou-Hallawa
Message:

SVGPathSegList.insertItemBefore() should fail if the newItem belongs to an animating animPathSegList
https://bugs.webkit.org/show_bug.cgi?id=195333
<rdar://problem/48475802>

Reviewed by Simon Fraser.

Source/WebCore:

Because the SVG1.1 specs states that the newItem should be removed from
its original list before adding it to another list,
SVGPathSegList.insertItemBefore() should fail if the new item belongs to
an animating animPathSegList since it is read-only.

Test: svg/dom/SVGPathSegList-insert-from-animating-animPathSegList.svg

  • svg/SVGPathSegList.cpp:

(WebCore::SVGPathSegList::processIncomingListItemValue):

LayoutTests:

  • svg/dom/SVGPathSegList-insert-from-animating-animPathSegList-expected.txt: Added.
  • svg/dom/SVGPathSegList-insert-from-animating-animPathSegList.svg: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r242467 r242515  
     12019-03-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        SVGPathSegList.insertItemBefore() should fail if the newItem belongs to an animating animPathSegList
     4        https://bugs.webkit.org/show_bug.cgi?id=195333
     5        <rdar://problem/48475802>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * svg/dom/SVGPathSegList-insert-from-animating-animPathSegList-expected.txt: Added.
     10        * svg/dom/SVGPathSegList-insert-from-animating-animPathSegList.svg: Added.
     11
    1122019-03-05  Ryan Haddad  <ryanhaddad@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r242508 r242515  
     12019-03-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        SVGPathSegList.insertItemBefore() should fail if the newItem belongs to an animating animPathSegList
     4        https://bugs.webkit.org/show_bug.cgi?id=195333
     5        <rdar://problem/48475802>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Because the SVG1.1 specs states that the newItem should be removed from
     10        its original list before adding it to another list,
     11        SVGPathSegList.insertItemBefore() should fail if the new item belongs to
     12        an animating animPathSegList since it is read-only.
     13
     14        Test: svg/dom/SVGPathSegList-insert-from-animating-animPathSegList.svg
     15
     16        * svg/SVGPathSegList.cpp:
     17        (WebCore::SVGPathSegList::processIncomingListItemValue):
     18
    1192019-03-05  Zalan Bujtas  <zalan@apple.com>
    220
  • trunk/Source/WebCore/svg/SVGPathSegList.cpp

    r229830 r242515  
    8686    RefPtr<SVGAnimatedPathSegListPropertyTearOff> propertyTearOff = static_pointer_cast<SVGAnimatedPathSegListPropertyTearOff>(animatedPropertyOfItem);
    8787    int indexToRemove = propertyTearOff->findItem(newItem.get());
    88     ASSERT(indexToRemove != -1);
     88
     89    // If newItem does not exist in the propertyTearOff baseVal() list, it has to be
     90    // in its animVal() list and it has to be animating.
     91    if (indexToRemove == -1) {
     92        ASSERT(propertyTearOff->isAnimating());
     93        ASSERT(propertyTearOff->animVal()->findItem(newItem.get()) != -1);
     94        return false;
     95    }
    8996
    9097    // Do not remove newItem if already in this list at the target index.
Note: See TracChangeset for help on using the changeset viewer.