Changeset 214915 in webkit


Ignore:
Timestamp:
Apr 4, 2017 5:05:27 PM (7 years ago)
Author:
Brent Fulgham
Message:

Do not assert when CharacterData representing an Attr fires events
https://bugs.webkit.org/show_bug.cgi?id=170454
<rdar://problem/30979320>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Make the NoEventDispatchAssertion in CharacterData::notifyParentAfterChange conditional
since Attr elements should be allowed to fire events.

Tests: fast/dom/no-assert-for-malformed-js-url-attribute.html

  • dom/CharacterData.cpp:

(WebCore::CharacterData::notifyParentAfterChange):

LayoutTests:

  • fast/dom/no-assert-for-malformed-js-url-attribute-expected.txt: Added.
  • fast/dom/no-assert-for-malformed-js-url-attribute.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r214913 r214915  
     12017-04-04  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Do not assert when CharacterData representing an Attr fires events
     4        https://bugs.webkit.org/show_bug.cgi?id=170454
     5        <rdar://problem/30979320>
     6
     7        Reviewed by Ryosuke Niwa.
     8
     9        * fast/dom/no-assert-for-malformed-js-url-attribute-expected.txt: Added.
     10        * fast/dom/no-assert-for-malformed-js-url-attribute.html: Added.
     11
    1122017-04-04  Youenn Fablet  <youenn@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r214913 r214915  
     12017-04-04  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Do not assert when CharacterData representing an Attr fires events
     4        https://bugs.webkit.org/show_bug.cgi?id=170454
     5        <rdar://problem/30979320>
     6
     7        Reviewed by Ryosuke Niwa.
     8
     9        Make the NoEventDispatchAssertion in CharacterData::notifyParentAfterChange conditional
     10        since Attr elements should be allowed to fire events.
     11
     12        Tests: fast/dom/no-assert-for-malformed-js-url-attribute.html
     13
     14        * dom/CharacterData.cpp:
     15        (WebCore::CharacterData::notifyParentAfterChange):
     16
    1172017-04-04  Youenn Fablet  <youenn@apple.com>
    218
  • trunk/Source/WebCore/dom/CharacterData.cpp

    r211965 r214915  
    2323#include "CharacterData.h"
    2424
     25#include "Attr.h"
    2526#include "ElementTraversal.h"
    2627#include "EventNames.h"
     
    209210void CharacterData::notifyParentAfterChange(ContainerNode::ChildChangeSource source)
    210211{
    211     NoEventDispatchAssertion assertNoEventDispatch;
     212#if !ASSERT_DISABLED
     213    auto assertNoEventDispatch = std::make_unique<NoEventDispatchAssertion>();
     214#endif
    212215
    213216    document().incDOMTreeVersion();
     
    222225        source
    223226    };
     227
     228#if !ASSERT_DISABLED
     229    // Attribute CharacterData is expected to fire events.
     230    if (is<Attr>(*parentNode()))
     231        assertNoEventDispatch = nullptr;
     232#endif
     233
    224234    parentNode()->childrenChanged(change);
    225235}
Note: See TracChangeset for help on using the changeset viewer.