Bug 260129
| Summary: | Use 'FrozenArray' for 'thresholds' in IntersectionObserver | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
| Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | ashvayka, cdumez, ntim, rniwa, webkit-bug-importer |
| Priority: | P2 | Keywords: | BrowserCompat, InRadar, WPTImpact |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| URL: | http://wpt.live/intersection-observer/idlharness.window.html | ||
Ahmad Saleem
Hi Team,
Currently we are failing one IDLHarness test for Intersection Observer API, it is to use 'FrozenArray' for thresholds.
WPT Test Case: https://wpt.fyi/results/intersection-observer/idlharness.window.html?label=experimental&label=master&aligned
Test Case Live Link: http://wpt.live/intersection-observer/idlharness.window.html
Failing Test -> IntersectionObserver interface: observer must inherit property "thresholds" with the proper type
___
Web-Spec: https://www.w3.org/TR/intersection-observer/#intersection-observer-interface
In Spec: readonly attribute FrozenArray<double> thresholds;
We have: readonly attribute sequence<double> thresholds; & (double or sequence<double>) threshold = 0.0;
___
Just wanted to raise, so we can fix this as well. Might be difficult for me right away to do so if someone else can do it, good to take it up.
Thanks!
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Ahmad Saleem
Web-Spec issue: https://github.com/w3c/IntersectionObserver/issues/114
Ahmad Saleem
I get following error:
/Users/ahmadsaleem/Documents/GitHub-Webkit-origin/Webkit/WebKitBuild/Release/DerivedSources/WebCore/JSIntersectionObserver.cpp:297:135: error:
no member named 'thresholds' in 'WebCore::IntersectionObserver'
...*thisObject.globalObject(), throwScope, impl.thresholds())));
by doing following changes:
> Source/WebCore/page/IntersectionObserver.idl
Change to: readonly attribute FrozenArray<double> thresholds;
and delete: (double or sequence<double>) threshold = 0.0;
> Source/WebCore/page/IntersectionObserver.h:
Delete: const Vector<double>& thresholds() const { return m_thresholds; }
> Source/WebCore/page/IntersectionObserver.cpp:
Line 425: Changing 'thresholds()' to 'm_thresholds'
Tim Nguyen (:ntim)
(In reply to Ahmad Saleem from comment #2)
> I get following error:
>
> /Users/ahmadsaleem/Documents/GitHub-Webkit-origin/Webkit/WebKitBuild/Release/
> DerivedSources/WebCore/JSIntersectionObserver.cpp:297:135: error:
> no member named 'thresholds' in 'WebCore::IntersectionObserver'
> ...*thisObject.globalObject(), throwScope, impl.thresholds())));
>
I think this change is the source of your issue:
> > Source/WebCore/page/IntersectionObserver.h:
>
> Delete: const Vector<double>& thresholds() const { return m_thresholds; }
Ahmad Saleem
(In reply to Tim Nguyen (:ntim) from comment #3)
> (In reply to Ahmad Saleem from comment #2)
> > I get following error:
> >
> > /Users/ahmadsaleem/Documents/GitHub-Webkit-origin/Webkit/WebKitBuild/Release/
> > DerivedSources/WebCore/JSIntersectionObserver.cpp:297:135: error:
> > no member named 'thresholds' in 'WebCore::IntersectionObserver'
> > ...*thisObject.globalObject(), throwScope, impl.thresholds())));
> >
>
> I think this change is the source of your issue:
>
> > > Source/WebCore/page/IntersectionObserver.h:
> >
> > Delete: const Vector<double>& thresholds() const { return m_thresholds; }
Indeed! Without doing this and just modifying IDL, I do progress the test. Should I do PR?
Ahmad Saleem
PR - https://github.com/WebKit/WebKit/pull/16653
EWS
Committed 266857@main (37667adc938e): <https://commits.webkit.org/266857@main>
Reviewed commits have been landed. Closing PR #16653 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/113830183>