Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d8f9ad16e3bd3080f7b263a680a3510b80001095
      
https://github.com/WebKit/WebKit/commit/d8f9ad16e3bd3080f7b263a680a3510b80001095
  Author: Antoine Quint <[email protected]>
  Date:   2024-12-10 (Tue, 10 Dec 2024)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/scroll-timelines/constructor-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/scroll-timelines/source-quirks-mode-expected.txt
    M 
Source/WebCore/SaferCPPExpectations/UncountedLambdaCapturesCheckerExpectations
    M Source/WebCore/SaferCPPExpectations/UncountedLocalVarsCheckerExpectations
    M Source/WebCore/animation/ScrollTimeline.cpp
    M Source/WebCore/animation/ScrollTimeline.h
    M Source/WebCore/animation/ScrollTimeline.idl
    M Source/WebCore/animation/ScrollTimelineOptions.h
    M Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
    M Source/WebCore/bindings/scripts/test/JS/JSTestLegacyFactoryFunction.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

  Log Message:
  -----------
  [scroll-animations] the source of a newly-constructed `ScrollTimeline` should 
default to the document's scrolling element
https://bugs.webkit.org/show_bug.cgi?id=284360
rdar://141206809

Reviewed by Anne van Kesteren.

The specification for the `ScrollTimeline` constructor specifies [0] that "the 
scrollingElement of
the Document associated with the Window that is the current global object" 
should be used if a source
is not explicitly set via the `options` parameter.

Note that the wording of the spec at the time of writing is not clear on this 
topic but the IDL definition
as well as the relevant WPT test 
(scroll-animations/scroll-timelines/constructor.html, fixed by this patch)
clearly identify the expected behavior. An issue [1] was filed to address this.

In order to be able to distinguish a `null` value explicitly set on the 
`source` property of the `options`
parameter, we change `ScrollTimelineOptions.h` to use an `std::optional<>` to 
wrap the `RefPtr<Element>`.

We also need to pass the document to the `ScrollTimeline` constructor to be 
able to get at the scrolling element,
so we add the `CallWith=CurrentDocument` processing directive and fix an 
uncounted issue with the generated
that would result in `JSScrollTimeline.cpp`.

[0] 
https://drafts.csswg.org/scroll-animations-1/#dom-scrolltimeline-scrolltimeline
[1] https://github.com/w3c/csswg-drafts/issues/11340

* 
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/scroll-timelines/constructor-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/scroll-animations/scroll-timelines/source-quirks-mode-expected.txt:
* 
Source/WebCore/SaferCPPExpectations/UncountedLambdaCapturesCheckerExpectations:
* Source/WebCore/SaferCPPExpectations/UncountedLocalVarsCheckerExpectations:
* Source/WebCore/animation/ScrollTimeline.cpp:
(WebCore::ScrollTimeline::create):
(WebCore::ScrollTimeline::ScrollTimeline):
* Source/WebCore/animation/ScrollTimeline.h:
(WebCore::ScrollTimeline::create):
(WebCore::ScrollTimeline::ScrollTimeline): Deleted.
* Source/WebCore/animation/ScrollTimeline.idl:
* Source/WebCore/animation/ScrollTimelineOptions.h:
* Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallWith):
* Source/WebCore/bindings/scripts/test/JS/JSTestLegacyFactoryFunction.cpp:
(WebCore::JSTestLegacyFactoryFunctionLegacyFactoryFunction::construct):
* Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjDOMConstructor::construct):
(WebCore::jsTestObjConstructor_testStaticReadonlyObjGetter):
(WebCore::jsTestObjPrototypeFunction_withCurrentDocumentArgumentBody):
(WebCore::jsTestObjPrototypeFunction_withRelevantDocumentArgumentBody):

Canonical link: https://commits.webkit.org/287657@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to