Implement IntersectionObserver
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Oct 2016 22:12:05 +0000 (22:12 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Oct 2016 22:12:05 +0000 (22:12 +0000)
commit4bb6a51fad6ffc0a595b34383fab5baca01caaf9
treed5ad95a1f30d9ded02d0b24afbc68f05c4dc75bb
parent8ac4464ab0681b62c36381de33b6557f6d8f15cd
Implement IntersectionObserver
https://bugs.webkit.org/show_bug.cgi?id=159475

Reviewed by Ryosuke Niwa.
Source/JavaScriptCore:

Add ENABLE_INTERSECTION_OBSERVER, enabled by default.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Add bindings support for Intersection Observer
<https://wicg.github.io/IntersectionObserver/>

Code is wrapped in ENABLE(INTERSECTION_OBSERVER), and controlled by a runtime
Setting (off by default for now).

A minor bindings change was required to fix the callback code.

IntersectionObserver is just a shell for now.

Tests: intersection-observer/intersection-observer-entry-interface.html
       intersection-observer/intersection-observer-interface.html

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGeneratorJS.pm:
(ShouldPassWrapperByReference):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjConstructor::construct):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefsConstructor::construct):
* page/IntersectionObserver.cpp: Added.
(WebCore::IntersectionObserver::IntersectionObserver):
(WebCore::IntersectionObserver::observe):
(WebCore::IntersectionObserver::unobserve):
(WebCore::IntersectionObserver::disconnect):
(WebCore::IntersectionObserver::takeRecords):
* page/IntersectionObserver.h: Added.
(WebCore::IntersectionObserver::create):
(WebCore::IntersectionObserver::root):
(WebCore::IntersectionObserver::rootMargin):
(WebCore::IntersectionObserver::thresholds):
* page/IntersectionObserver.idl: Added.
* page/IntersectionObserverCallback.h: Added.
(WebCore::IntersectionObserverCallback::~IntersectionObserverCallback):
* page/IntersectionObserverCallback.idl: Added.
* page/IntersectionObserverEntry.cpp: Added.
(WebCore::IntersectionObserverEntry::IntersectionObserverEntry):
* page/IntersectionObserverEntry.h: Added.
(WebCore::IntersectionObserverEntry::create):
(WebCore::IntersectionObserverEntry::time):
(WebCore::IntersectionObserverEntry::rootBounds):
(WebCore::IntersectionObserverEntry::boundingClientRect):
(WebCore::IntersectionObserverEntry::intersectionRect):
(WebCore::IntersectionObserverEntry::target):
(WebCore::IntersectionObserverEntry::intersectionRatio):
* page/IntersectionObserverEntry.idl: Added.
* page/Settings.in:

Source/WebKit2:

Add ENABLE_INTERSECTION_OBSERVER, enabled by default.

* Configurations/FeatureDefines.xcconfig:

Tools:

Add ENABLE_INTERSECTION_OBSERVER, enabled by default.

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

LayoutTests:

Basic interface tests.

* intersection-observer/intersection-observer-entry-interface-expected.txt: Added.
* intersection-observer/intersection-observer-entry-interface.html: Added.
* intersection-observer/intersection-observer-interface-expected.txt: Added.
* intersection-observer/intersection-observer-interface.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208181 268f45cc-cd09-0410-ab3c-d52691b4dbfc
30 files changed:
LayoutTests/ChangeLog
LayoutTests/intersection-observer/intersection-observer-entry-interface-expected.txt [new file with mode: 0644]
LayoutTests/intersection-observer/intersection-observer-entry-interface.html [new file with mode: 0644]
LayoutTests/intersection-observer/intersection-observer-interface-expected.txt [new file with mode: 0644]
LayoutTests/intersection-observer/intersection-observer-interface.html [new file with mode: 0644]
LayoutTests/resources/testharnessreport.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/DerivedSources.make
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp
Source/WebCore/page/IntersectionObserver.cpp [new file with mode: 0644]
Source/WebCore/page/IntersectionObserver.h [new file with mode: 0644]
Source/WebCore/page/IntersectionObserver.idl [new file with mode: 0644]
Source/WebCore/page/IntersectionObserverCallback.h [new file with mode: 0644]
Source/WebCore/page/IntersectionObserverCallback.idl [new file with mode: 0644]
Source/WebCore/page/IntersectionObserverEntry.cpp [new file with mode: 0644]
Source/WebCore/page/IntersectionObserverEntry.h [new file with mode: 0644]
Source/WebCore/page/IntersectionObserverEntry.idl [new file with mode: 0644]
Source/WebCore/page/Settings.in
Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
Source/WebKit2/ChangeLog
Source/WebKit2/Configurations/FeatureDefines.xcconfig
Tools/ChangeLog
Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig