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

Changeset 242856 in webkit


Ignore:
Timestamp:
Mar 13, 2019, 1:24:34 AM (7 years ago)
Author:
bshafiei@apple.com
Message:

Cherry-pick r242515. rdar://problem/48839275

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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242515 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-607-branch
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-607-branch/LayoutTests/ChangeLog

    r242851 r242856  
     12019-03-13  Babak Shafiei  <bshafiei@apple.com>
     2
     3        Cherry-pick r242515. rdar://problem/48839275
     4
     5    SVGPathSegList.insertItemBefore() should fail if the newItem belongs to an animating animPathSegList
     6    https://bugs.webkit.org/show_bug.cgi?id=195333
     7    <rdar://problem/48475802>
     8   
     9    Reviewed by Simon Fraser.
     10   
     11    Source/WebCore:
     12   
     13    Because the SVG1.1 specs states that the newItem should be removed from
     14    its original list before adding it to another list,
     15    SVGPathSegList.insertItemBefore() should fail if the new item belongs to
     16    an animating animPathSegList since it is read-only.
     17   
     18    Test: svg/dom/SVGPathSegList-insert-from-animating-animPathSegList.svg
     19   
     20    * svg/SVGPathSegList.cpp:
     21    (WebCore::SVGPathSegList::processIncomingListItemValue):
     22   
     23    LayoutTests:
     24   
     25    * svg/dom/SVGPathSegList-insert-from-animating-animPathSegList-expected.txt: Added.
     26    * svg/dom/SVGPathSegList-insert-from-animating-animPathSegList.svg: Added.
     27   
     28   
     29    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242515 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     30
     31    2019-03-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
     32
     33            SVGPathSegList.insertItemBefore() should fail if the newItem belongs to an animating animPathSegList
     34            https://bugs.webkit.org/show_bug.cgi?id=195333
     35            <rdar://problem/48475802>
     36
     37            Reviewed by Simon Fraser.
     38
     39            * svg/dom/SVGPathSegList-insert-from-animating-animPathSegList-expected.txt: Added.
     40            * svg/dom/SVGPathSegList-insert-from-animating-animPathSegList.svg: Added.
     41
    1422019-03-13  Babak Shafiei  <bshafiei@apple.com>
    243
  • branches/safari-607-branch/Source/WebCore/ChangeLog

    r242853 r242856  
     12019-03-13  Babak Shafiei  <bshafiei@apple.com>
     2
     3        Cherry-pick r242515. rdar://problem/48839275
     4
     5    SVGPathSegList.insertItemBefore() should fail if the newItem belongs to an animating animPathSegList
     6    https://bugs.webkit.org/show_bug.cgi?id=195333
     7    <rdar://problem/48475802>
     8   
     9    Reviewed by Simon Fraser.
     10   
     11    Source/WebCore:
     12   
     13    Because the SVG1.1 specs states that the newItem should be removed from
     14    its original list before adding it to another list,
     15    SVGPathSegList.insertItemBefore() should fail if the new item belongs to
     16    an animating animPathSegList since it is read-only.
     17   
     18    Test: svg/dom/SVGPathSegList-insert-from-animating-animPathSegList.svg
     19   
     20    * svg/SVGPathSegList.cpp:
     21    (WebCore::SVGPathSegList::processIncomingListItemValue):
     22   
     23    LayoutTests:
     24   
     25    * svg/dom/SVGPathSegList-insert-from-animating-animPathSegList-expected.txt: Added.
     26    * svg/dom/SVGPathSegList-insert-from-animating-animPathSegList.svg: Added.
     27   
     28   
     29    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242515 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     30
     31    2019-03-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
     32
     33            SVGPathSegList.insertItemBefore() should fail if the newItem belongs to an animating animPathSegList
     34            https://bugs.webkit.org/show_bug.cgi?id=195333
     35            <rdar://problem/48475802>
     36
     37            Reviewed by Simon Fraser.
     38
     39            Because the SVG1.1 specs states that the newItem should be removed from
     40            its original list before adding it to another list,
     41            SVGPathSegList.insertItemBefore() should fail if the new item belongs to
     42            an animating animPathSegList since it is read-only.
     43
     44            Test: svg/dom/SVGPathSegList-insert-from-animating-animPathSegList.svg
     45
     46            * svg/SVGPathSegList.cpp:
     47            (WebCore::SVGPathSegList::processIncomingListItemValue):
     48
    1492019-03-13  Babak Shafiei  <bshafiei@apple.com>
    250
  • branches/safari-607-branch/Source/WebCore/svg/SVGPathSegList.cpp

    r229830 r242856  
    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.