haikuwebkit/Source/WebCore/page/ScrollLogicalPosition.idl

21 lines
885 B
Plaintext
Raw Permalink Normal View History

Add basic support for ScrollIntoViewOptions https://bugs.webkit.org/show_bug.cgi?id=189258 Patch by Frederic Wang <fwang@igalia.com> on 2018-09-04 Reviewed by Simon Fraser. LayoutTests/imported/w3c: Update test expectations for WPT scrollIntoView tests. * web-platform-tests/css/cssom-view/scrollIntoView-scrollMargin-expected.txt: This is not supported yet but update the error message. * web-platform-tests/css/cssom-view/scrollIntoView-scrollPadding-expected.txt: Ditto. * web-platform-tests/css/cssom-view/scrollIntoView-shadow-expected.txt: Update expectation now that this test passes. * web-platform-tests/css/cssom-view/scrollIntoView-smooth-expected.txt: Ditto. * web-platform-tests/css/cssom-view/scrollintoview-expected.txt: Ditto. Source/WebCore: This patch introduces a new ScrollIntoViewOptions parameter that can be passed into Element.scrollIntoView instead of a boolean. A basic support for scroll alignments is implemented, so that it is closer to the behavior of the CSSOMView spec while still remaining compatible with the current boolean-parameter implementation. Full implementation that takes into account orientation/direction will be handled in bug 161611. This patch is also a preliminary step to support the ScrollBehavior (bug 188043) for ScrollIntoView. Tests: web-platform-tests/css/cssom-view/scrollintoview-html web-platform-tests/css/cssom-view/scrollIntoView-smooth.html * CMakeLists.txt: Add new IDL files. * DerivedSources.make: Ditto. * Sources.txt: Add new generated cpp JS bindings. * WebCore.xcodeproj/project.pbxproj: Add files to build to XCode. * dom/Element.cpp: (WebCore::toScrollAlignment): Convert ScrollLogicalPosition to scroll alignment. Orientation and direction are not implemented yet. (WebCore::Element::scrollIntoView): Implement new scrollIntoView version accepting ScrollIntoViewOptions parameter. * dom/Element.h: Declare new scrollIntoView. * dom/Element.idl: Make scrollIntoView accept a ScrollIntoViewOptions parameter. * page/ScrollIntoViewOptions.h: Added. * page/ScrollIntoViewOptions.idl: Added. * page/ScrollLogicalPosition.h: Added. * page/ScrollLogicalPosition.idl: Added. Source/WebKit: * DOM/DOMElement.mm: Add ScrollIntoViewOptions header so that this file can build despite the new scrollIntoView function. Source/WebKitLegacy/mac: * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp: Add ScrollIntoViewOptions header so that this file can build despite the new scrollIntoView function. Source/WebKitLegacy/win: * DOMCoreClasses.cpp: Add ScrollIntoViewOptions header so that this file can build despite the new scrollIntoView function. LayoutTests: Update test expectations for WPT scrollIntoView tests. * platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom-view/scrollIntoView-smooth-expected.txt: Removed. Canonical link: https://commits.webkit.org/204295@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235659 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-09-05 05:19:58 +00:00
/*
* Copyright (C) 2018 Igalia S.L.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
enum ScrollLogicalPosition { "start", "center", "end", "nearest" };