This website requires JavaScript.
Explore
Help
Sign In
nephele
/
haikuwebkit
Watch
1
Star
0
Fork
You've already forked haikuwebkit
0
Code
Issues
Releases
Activity
haiku
haikuwebkit
/
LayoutTests
/
intersection-observer
/
target-deleted-expected.txt
4 lines
66 B
Plaintext
Raw
Permalink
Normal View
History
Unescape
Escape
IntersectionObserver doesn't keep target's JS wrapper alive https://bugs.webkit.org/show_bug.cgi?id=190235 Reviewed by Ryosuke Niwa. Source/WebCore: Retain JS wrappers of targets in queued entries using a vector of GCReachableRef owned by IntersectionObserver, which gets cleared after the entries have been delivered. Make IntersectionObserver::takeRecords return a struct which has both the vector of GCReachableRefs for targets and the vector of intersection observer entries, so that the GCReachableRefs survive until the creation of JS wrappers for the entries. Modify IntersectionObserver::hasPendingActivity to keep the observer alive while it has entries to deliver. Tests: intersection-observer/intersection-observer-entry-keeps-js-wrapper-of-target-alive.html intersection-observer/intersection-observer-keeps-js-wrapper-of-target-alive.html intersection-observer/target-deleted.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSIntersectionObserverEntryCustom.cpp: (WebCore::JSIntersectionObserverEntry::visitAdditionalChildren): Keep the target element's wrapper alive while the IntersectionObserverEntry's wrapper is alive. * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::takeRecords): Change return type to include GCReachableRefs for each record's target, so that each target can be kept until a JS wrapper is constructed for its IntersectionObserverEntry. (WebCore::IntersectionObserver::appendQueuedEntry): (WebCore::IntersectionObserver::notify): Erase GCReachableRefs for targets after delivering the corresponding records. (WebCore::IntersectionObserver::hasPendingActivity const): Keep the IntersectionObserver alive until queued entries are delivered. (WebCore::IntersectionObserver::stop): * page/IntersectionObserver.h: * page/IntersectionObserver.idl: * page/IntersectionObserverEntry.h: (WebCore::IntersectionObserverEntry::target const): Make this return a raw pointer instead of a RefPtr so that it can be called in JSIntersectionObserverEntry::visitAdditionalChildren, which runs on the GC thread (it's illegal to ref a Node on a non-main thread). * page/IntersectionObserverEntry.idl: LayoutTests: Add test coverage. Update test that depends on a target getting GC'd to call takeRecords() since targets with pending entries are no logner GC'd. * intersection-observer/intersection-observer-entry-keeps-js-wrapper-of-target-alive-expected.txt: Added. * intersection-observer/intersection-observer-entry-keeps-js-wrapper-of-target-alive.html: Added. * intersection-observer/intersection-observer-keeps-js-wrapper-of-target-alive-expected.txt: Added. * intersection-observer/intersection-observer-keeps-js-wrapper-of-target-alive.html: Added. * intersection-observer/root-element-deleted.html: * intersection-observer/target-deleted-expected.txt: Added. * intersection-observer/target-deleted.html: Added. Canonical link: https://commits.webkit.org/206123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237880 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-06 20:52:51 +00:00
Remove trailing spaces from expected.txt files (excluding WPT for now since that contains too many) https://bugs.webkit.org/show_bug.cgi?id=217016 Reviewed by Zalan Bujtas. Done with this command: find LayoutTests -name '*-expected.txt' | grep -v imported | xargs awk '/^CONSOLE MESSAGE:/ { next }; /^<\?xml/ { nextfile }; { print FILENAME; nextfile }' | xargs perl -i -pe 's/ +$//g' This affects many files, and it's not helpful to clog the change log with a list of them. Canonical link: https://commits.webkit.org/229803@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267644 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-27 02:15:19 +00:00
PASS IntersectionObserver doesn't keep unreachable target alive
IntersectionObserver doesn't keep target's JS wrapper alive https://bugs.webkit.org/show_bug.cgi?id=190235 Reviewed by Ryosuke Niwa. Source/WebCore: Retain JS wrappers of targets in queued entries using a vector of GCReachableRef owned by IntersectionObserver, which gets cleared after the entries have been delivered. Make IntersectionObserver::takeRecords return a struct which has both the vector of GCReachableRefs for targets and the vector of intersection observer entries, so that the GCReachableRefs survive until the creation of JS wrappers for the entries. Modify IntersectionObserver::hasPendingActivity to keep the observer alive while it has entries to deliver. Tests: intersection-observer/intersection-observer-entry-keeps-js-wrapper-of-target-alive.html intersection-observer/intersection-observer-keeps-js-wrapper-of-target-alive.html intersection-observer/target-deleted.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSIntersectionObserverEntryCustom.cpp: (WebCore::JSIntersectionObserverEntry::visitAdditionalChildren): Keep the target element's wrapper alive while the IntersectionObserverEntry's wrapper is alive. * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::takeRecords): Change return type to include GCReachableRefs for each record's target, so that each target can be kept until a JS wrapper is constructed for its IntersectionObserverEntry. (WebCore::IntersectionObserver::appendQueuedEntry): (WebCore::IntersectionObserver::notify): Erase GCReachableRefs for targets after delivering the corresponding records. (WebCore::IntersectionObserver::hasPendingActivity const): Keep the IntersectionObserver alive until queued entries are delivered. (WebCore::IntersectionObserver::stop): * page/IntersectionObserver.h: * page/IntersectionObserver.idl: * page/IntersectionObserverEntry.h: (WebCore::IntersectionObserverEntry::target const): Make this return a raw pointer instead of a RefPtr so that it can be called in JSIntersectionObserverEntry::visitAdditionalChildren, which runs on the GC thread (it's illegal to ref a Node on a non-main thread). * page/IntersectionObserverEntry.idl: LayoutTests: Add test coverage. Update test that depends on a target getting GC'd to call takeRecords() since targets with pending entries are no logner GC'd. * intersection-observer/intersection-observer-entry-keeps-js-wrapper-of-target-alive-expected.txt: Added. * intersection-observer/intersection-observer-entry-keeps-js-wrapper-of-target-alive.html: Added. * intersection-observer/intersection-observer-keeps-js-wrapper-of-target-alive-expected.txt: Added. * intersection-observer/intersection-observer-keeps-js-wrapper-of-target-alive.html: Added. * intersection-observer/root-element-deleted.html: * intersection-observer/target-deleted-expected.txt: Added. * intersection-observer/target-deleted.html: Added. Canonical link: https://commits.webkit.org/206123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237880 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-06 20:52:51 +00:00