Bug 260129

Summary: Use 'FrozenArray' for 'thresholds' in IntersectionObserver
Product: WebKit Reporter: Ahmad Saleem <ahmad.saleem792>
Component: DOMAssignee: 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
Reported 2023-08-13 13:42:57 PDT
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
Ahmad Saleem
Comment 1 2023-08-13 13:59:52 PDT
Ahmad Saleem
Comment 2 2023-08-13 14:04:33 PDT
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)
Comment 3 2023-08-13 14:18:45 PDT
(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
Comment 4 2023-08-13 14:37:13 PDT
(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
Comment 5 2023-08-13 14:57:51 PDT
EWS
Comment 6 2023-08-13 17:15:07 PDT
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
Comment 7 2023-08-13 17:16:13 PDT
Note You need to log in before you can comment on or make changes to this bug.