haikuwebkit/Source/WebCore/page/ScrollToOptions.idl

33 lines
1.6 KiB
Plaintext
Raw Permalink Normal View History

[WebIDL] Add support for having dictionaries in their own IDL file https://bugs.webkit.org/show_bug.cgi?id=162912 Reviewed by Darin Adler. Add support for having dictionaries in their own IDL file so that they can be shared by multiple interfaces. Leverage this new support to merge Element::ScrollToOptions and DOMWindow::ScrollToOptions. No new tests, extended bindings tests. * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * bindings/scripts/CodeGenerator.pm: (ProcessDocument): (IDLFileForInterface): (GetDictionaryByName): (IsDictionaryType): (HasEnumImplementationNameOverride): Deleted. (GetEnumImplementationNameOverride): Deleted. * bindings/scripts/CodeGeneratorJS.pm: (GenerateDictionary): (GetEnumerationClassName): (GenerateEnumerationImplementationContent): (GenerateEnumerationHeaderContent): (GetDictionaryClassName): (GenerateDefaultValue): (GenerateDictionaryHeaderContent): (GenerateDictionariesHeaderContent): (GenerateDictionaryImplementationContent): (GenerateDictionariesImplementationContent): (GenerateHeader): (GenerateImplementation): (GenerateParametersCheck): (GenerateDictionaryHeader): (GenerateDictionaryImplementation): (GenerateCallbackHeader): (GenerateCallbackImplementation): (GetNativeType): (JSValueToNative): (GetNestedClassName): Deleted. (GenerateConversionRuleWithLeadingComma): Deleted. (addIterableProperties): Deleted. * bindings/scripts/preprocess-idls.pl: (containsInterfaceOrExceptionFromIDL): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameter): (WebCore::jsTestObjPrototypeFunctionAttachShadowRoot): Deleted. * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp: Added. (WebCore::convertDictionary<TestStandaloneDictionary>): * bindings/scripts/test/JS/JSTestStandaloneDictionary.h: Added. * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/TestStandaloneDictionary.idl: Added. * dom/Element.h: * dom/Element.idl: * html/HTMLBodyElement.cpp: (WebCore::HTMLBodyElement::scrollTo): * page/DOMWindow.h: * page/DOMWindow.idl: * page/ScrollToOptions.h: Added. * page/ScrollToOptions.idl: Added. Canonical link: https://commits.webkit.org/180930@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-06 20:22:16 +00:00
/*
* Copyright (C) 2016 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
Add support for scroll behavior parsing https://bugs.webkit.org/show_bug.cgi?id=205009 Reviewed by Frédéric Wang. Based on the patch by Frédéric Wang. LayoutTests/imported/w3c: * web-platform-tests/css/cssom-view/inheritance-expected.txt: * web-platform-tests/css/cssom-view/inheritance.html: * web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed-expected.txt: * web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed.html: * web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid-expected.txt: * web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid.html: Source/WebCore: Add support for parsing scroll-behavior css property and ScrollOptions. Tests: LayoutTests/imported/w3c/web-platform-tests/css/cssom-view/inheritance.html LayoutTests/web-platform-tests/css/cssom-view/parsing/scroll-behavior-computed.html LayoutTests/web-platform-tests/css/cssom-view/parsing/scroll-behavior-valid.html * CMakeLists.txt: Add IDL files for ScrollOptions and ScrollBehavior. * DerivedSources.make: * Headers.cmake: Add headers for ScrollBehavor and ScrollOptions. * Sources.txt: Add ScrollBehavor and ScrollOptions implementation. * WebCore.xcodeproj/project.pbxproj: Add files to the build system. * css/CSSComputedStyleDeclaration.cpp: Handle scroll-behavior. (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSProperties.json: Add scroll-behavior. * css/CSSValueKeywords.in: Add keywords for scroll-behavior. * css/parser/CSSParserContext.cpp: Add runtime config for scroll-behavior. (WebCore::CSSParserContext::CSSParserContext): (WebCore::operator==): * css/parser/CSSParserContext.h: Ditto. (WebCore::CSSParserContextHash::hash): * css/parser/CSSParserFastPaths.cpp: Remove scroll-behavior templates. It is handled in the slow path since property can be disabled. (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): (WebCore::CSSParserFastPaths::isKeywordPropertyID): * css/parser/CSSPropertyParser.cpp: (WebCore::consumeScrollBehavior): (WebCore::CSSPropertyParser::parseSingleValue): Parse scroll-behavior (only if enabled). * page/ScrollBehavior.cpp: Added. (WebCore::useSmoothScrolling): Helper funciton to determine the scroll behavior to apply to an element from the CSS and DOM behavior. * page/ScrollBehavior.h: Added. * page/ScrollBehavior.idl: Added. * page/ScrollIntoViewOptions.h: Make this class inherits from ScrollOption. Also remove unnecessary forward declaration. * page/ScrollIntoViewOptions.idl: Make this class inherits from ScrollOption. * page/ScrollOptions.h: Added. * page/ScrollOptions.idl: Added. * page/ScrollToOptions.h: Make this struct inherits from ScrollOptions. (WebCore::ScrollToOptions::ScrollToOptions): (WebCore::normalizeNonFiniteCoordinatesOrFallBackTo): Copy the current ScrollToOptions so that the scroll behavior is preserved. * page/ScrollToOptions.idl: Make this class inherit from ScrollOptions. * page/Settings.yaml: New setting for CSSOM View smooth scrolling. * rendering/style/RenderStyle.h: Handle 'smooth scrolling' boolean data. (WebCore::RenderStyle::useSmoothScrolling const): (WebCore::RenderStyle::setUseSmoothScrolling): (WebCore::RenderStyle::initialUseSmoothScrolling): * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleBuilderConverter.h: (WebCore::Style::BuilderConverter::convertSmoothScrolling): Source/WebKit: Add CSSOM smooth scrolling as an experimental feature. * Shared/WebPreferences.yaml: Source/WebKitLegacy/mac: Add run time flag for CSSOMViewSmoothScrolling. * WebView/WebPreferenceKeysPrivate.h: Handle CSSOMViewSmoothScrolling by. * WebView/WebPreferences.mm: ([WebPreferences initialize]): Disable CSSOMViewSmoothScrolling by default. (-[WebPreferences CSSOMViewSmoothScrollingEnabled]): Getter. (-[WebPreferences setCSSOMViewSmoothScrollingEnabled:]): Setter. * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChanged:]): Source/WebKitLegacy/win: * Interfaces/IWebPreferencesPrivate.idl: Handle smooth scrolling option. * WebPreferenceKeysPrivate.h: Ditto. * WebPreferences.cpp: Ditto. (WebPreferences::initializeDefaultSettings): (WebPreferences::CSSOMViewSmoothScrollingEnabled): (WebPreferences::setCSSOMViewSmoothScrollingEnabled): * WebPreferences.h: Ditto. * WebView.cpp: Ditto. (WebView::notifyPreferencesChanged): Tools: * DumpRenderTree/TestOptions.cpp: (TestOptions::TestOptions): Parse CSSOMViewSmoothScrollingEnabled. * DumpRenderTree/TestOptions.h: Add CSSOMViewSmoothScrollingEnabled, disabled by default. * DumpRenderTree/mac/DumpRenderTree.mm: (enableExperimentalFeatures): (setWebPreferencesForTestOptions): Set CSSOMViewSmoothScrollingEnabled from the test options. Canonical link: https://commits.webkit.org/219530@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254790 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-18 05:49:24 +00:00
dictionary ScrollToOptions : ScrollOptions {
[WebIDL] Add support for having dictionaries in their own IDL file https://bugs.webkit.org/show_bug.cgi?id=162912 Reviewed by Darin Adler. Add support for having dictionaries in their own IDL file so that they can be shared by multiple interfaces. Leverage this new support to merge Element::ScrollToOptions and DOMWindow::ScrollToOptions. No new tests, extended bindings tests. * CMakeLists.txt: * DerivedSources.cpp: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * bindings/scripts/CodeGenerator.pm: (ProcessDocument): (IDLFileForInterface): (GetDictionaryByName): (IsDictionaryType): (HasEnumImplementationNameOverride): Deleted. (GetEnumImplementationNameOverride): Deleted. * bindings/scripts/CodeGeneratorJS.pm: (GenerateDictionary): (GetEnumerationClassName): (GenerateEnumerationImplementationContent): (GenerateEnumerationHeaderContent): (GetDictionaryClassName): (GenerateDefaultValue): (GenerateDictionaryHeaderContent): (GenerateDictionariesHeaderContent): (GenerateDictionaryImplementationContent): (GenerateDictionariesImplementationContent): (GenerateHeader): (GenerateImplementation): (GenerateParametersCheck): (GenerateDictionaryHeader): (GenerateDictionaryImplementation): (GenerateCallbackHeader): (GenerateCallbackImplementation): (GetNativeType): (JSValueToNative): (GetNestedClassName): Deleted. (GenerateConversionRuleWithLeadingComma): Deleted. (addIterableProperties): Deleted. * bindings/scripts/preprocess-idls.pl: (containsInterfaceOrExceptionFromIDL): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameter): (WebCore::jsTestObjPrototypeFunctionAttachShadowRoot): Deleted. * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp: Added. (WebCore::convertDictionary<TestStandaloneDictionary>): * bindings/scripts/test/JS/JSTestStandaloneDictionary.h: Added. * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/TestStandaloneDictionary.idl: Added. * dom/Element.h: * dom/Element.idl: * html/HTMLBodyElement.cpp: (WebCore::HTMLBodyElement::scrollTo): * page/DOMWindow.h: * page/DOMWindow.idl: * page/ScrollToOptions.h: Added. * page/ScrollToOptions.idl: Added. Canonical link: https://commits.webkit.org/180930@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-06 20:22:16 +00:00
unrestricted double left;
unrestricted double top;
};