WebKit Bugzilla
Attachment 348813 Details for
Bug 189258
: Add basic support for ScrollIntoViewOptions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP Patch
0001-scrollintoviewoptions.patch (text/plain), 21.71 KB, created by
Frédéric Wang (:fredw)
on 2018-09-04 05:32:41 PDT
(
hide
)
Description:
WIP Patch
Filename:
MIME Type:
Creator:
Frédéric Wang (:fredw)
Created:
2018-09-04 05:32:41 PDT
Size:
21.71 KB
patch
obsolete
>From 8a7b17d447726b0cd3d3b46a6e8f79e2691d0f0e Mon Sep 17 00:00:00 2001 >From: Frederic Wang <fwang@igalia.com> >Date: Tue, 4 Sep 2018 12:06:56 +0200 >Subject: [PATCH xserver] scrollintoviewoptions > >--- > Source/WebCore/CMakeLists.txt | 2 + > Source/WebCore/DerivedSources.make | 2 + > Source/WebCore/Sources.txt | 2 + > .../WebCore/WebCore.xcodeproj/project.pbxproj | 24 ++++++++++ > Source/WebCore/dom/Element.cpp | 44 +++++++++++++++++++ > Source/WebCore/dom/Element.h | 2 + > Source/WebCore/dom/Element.idl | 2 +- > Source/WebCore/page/ScrollIntoViewOptions.h | 33 ++++++++++++++ > Source/WebCore/page/ScrollIntoViewOptions.idl | 24 ++++++++++ > Source/WebCore/page/ScrollLogicalPosition.h | 31 +++++++++++++ > Source/WebCore/page/ScrollLogicalPosition.idl | 20 +++++++++ > .../API/gtk/DOM/WebKitDOMElementGtk.cpp | 1 + > 12 files changed, 186 insertions(+), 1 deletion(-) > create mode 100644 Source/WebCore/page/ScrollIntoViewOptions.h > create mode 100644 Source/WebCore/page/ScrollIntoViewOptions.idl > create mode 100644 Source/WebCore/page/ScrollLogicalPosition.h > create mode 100644 Source/WebCore/page/ScrollLogicalPosition.idl > >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index d17ba57de20..8a75209d102 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -831,6 +831,8 @@ set(WebCore_NON_SVG_IDL_FILES > page/PerformanceTiming.idl > page/RemoteDOMWindow.idl > page/Screen.idl >+ page/ScrollIntoViewOptions.idl >+ page/ScrollLogicalPosition.idl > page/ScrollToOptions.idl > page/ShareData.idl > page/VisualViewport.idl >diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make >index 5b753d8fdeb..a940f94e567 100644 >--- a/Source/WebCore/DerivedSources.make >+++ b/Source/WebCore/DerivedSources.make >@@ -796,6 +796,8 @@ JS_BINDING_IDLS = \ > $(WebCore)/page/PerformanceTiming.idl \ > $(WebCore)/page/RemoteDOMWindow.idl \ > $(WebCore)/page/Screen.idl \ >+ $(WebCore)/page/ScrollIntoViewOptions.idl \ >+ $(WebCore)/page/ScrollLogicalPosition.idl \ > $(WebCore)/page/ScrollToOptions.idl \ > $(WebCore)/page/UserMessageHandler.idl \ > $(WebCore)/page/UserMessageHandlersNamespace.idl \ >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index 26fbe219d91..e481672ddd6 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -3059,6 +3059,8 @@ JSSVGZoomEvent.cpp > JSScreen.cpp > JSScreenLuminance.cpp > JSScriptProcessorNode.cpp >+JSScrollIntoViewOptions.cpp >+JSScrollLogicalPosition.cpp > JSScrollToOptions.cpp > JSSecurityPolicyViolationEvent.cpp > JSServiceWorker.cpp >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 5fc76903443..9d6d22b1b9b 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -2336,6 +2336,8 @@ > 833B9E341F508D8500E0E428 /* JSFileSystemEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 833B9E2A1F508D8000E0E428 /* JSFileSystemEntry.h */; }; > 833B9E361F508D8500E0E428 /* JSFileSystemFileEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 833B9E2C1F508D8000E0E428 /* JSFileSystemFileEntry.h */; }; > 83407FC11E8D9C1700E048D3 /* VisibilityChangeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 83407FC01E8D9C1200E048D3 /* VisibilityChangeClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ 834476EF1DA5BC5E002B5EB0 /* JSScrollLogicalPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */; }; >+ 834476EF1DA5BC5E002B5EC1 /* JSScrollIntoViewOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */; }; > 834476EF1DA5BC5E002B6ED2 /* JSScrollToOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */; }; > 8348BFAC1B85729800912F36 /* ClassCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 8348BFAA1B85729500912F36 /* ClassCollection.h */; }; > 834DFAD01F7DAE5D00C2725B /* SharedStringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 834DFACC1F7DAE5600C2725B /* SharedStringHash.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -2408,6 +2410,8 @@ > 83C1D436178D5AB500141E68 /* SVGPathSegMovetoRel.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C1D424178D5AB400141E68 /* SVGPathSegMovetoRel.h */; }; > 83C1F5941EDF69D300410D27 /* QualifiedNameCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C1F5921EDF69D300410D27 /* QualifiedNameCache.h */; }; > 83C45B8E1DC2B68A008871BA /* ValidationBubble.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C45B8D1DC2B67C008871BA /* ValidationBubble.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ 83C5795D1DA5C301006F9C86 /* ScrollLogicalPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ 83C5795D1DA5C301006F9C97 /* ScrollIntoViewOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 83C5795D1DA5C301006FACA8 /* ScrollToOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 8350C3E71DA59B6200356446 /* ScrollToOptions.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 83D35AEC1C7187FA00F70D5A /* XMLHttpRequestEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 83D35AEA1C7187ED00F70D5A /* XMLHttpRequestEventTarget.h */; }; > 83D35AF21C718D9000F70D5A /* JSXMLHttpRequestEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 83D35AF01C718D8400F70D5A /* JSXMLHttpRequestEventTarget.h */; }; >@@ -9789,6 +9793,10 @@ > 834DD4F31BE08989002C9C3E /* PageMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PageMac.mm; sourceTree = "<group>"; }; > 834DFACC1F7DAE5600C2725B /* SharedStringHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SharedStringHash.h; sourceTree = "<group>"; }; > 834DFACE1F7DAE5700C2725B /* SharedStringHash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedStringHash.cpp; sourceTree = "<group>"; }; >+ 8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollLogicalPosition.h; sourceTree = "<group>"; }; >+ 8350C3E81DA59B6200355424 /* ScrollLogicalPosition.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollLogicalPosition.idl; sourceTree = "<group>"; }; >+ 8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollIntoViewOptions.h; sourceTree = "<group>"; }; >+ 8350C3E81DA59B6200355435 /* ScrollIntoViewOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollIntoViewOptions.idl; sourceTree = "<group>"; }; > 8350C3E71DA59B6200356446 /* ScrollToOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollToOptions.h; sourceTree = "<group>"; }; > 8350C3E81DA59B6200356446 /* ScrollToOptions.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScrollToOptions.idl; sourceTree = "<group>"; }; > 83520C7D1A71BFCC006BD2AA /* CSSFontFamily.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFamily.h; sourceTree = "<group>"; }; >@@ -9926,6 +9934,10 @@ > 83E8667D1FBA563F008855C5 /* ServiceWorkerData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServiceWorkerData.h; sourceTree = "<group>"; }; > 83E8667F1FBA5640008855C5 /* ServiceWorkerData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServiceWorkerData.cpp; sourceTree = "<group>"; }; > 83E959E11B8BC22B004D9385 /* NativeNodeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeNodeFilter.h; sourceTree = "<group>"; }; >+ 83E9B3001DA5A51E00FFD8D4 /* JSScrollLogicalPosition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollLogicalPosition.cpp; sourceTree = "<group>"; }; >+ 83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollLogicalPosition.h; sourceTree = "<group>"; }; >+ 83E9B3001DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollIntoViewOptions.cpp; sourceTree = "<group>"; }; >+ 83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollIntoViewOptions.h; sourceTree = "<group>"; }; > 83E9B3001DA5A51E00FFE8F6 /* JSScrollToOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScrollToOptions.cpp; sourceTree = "<group>"; }; > 83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScrollToOptions.h; sourceTree = "<group>"; }; > 83EE598B1F50958B003E8B30 /* JSErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSErrorCallback.h; sourceTree = "<group>"; }; >@@ -19401,6 +19413,10 @@ > BCEC01BA0C274DAC009F4EC9 /* Screen.cpp */, > BCEC01BB0C274DAC009F4EC9 /* Screen.h */, > BCEC01BC0C274DAC009F4EC9 /* Screen.idl */, >+ 8350C3E71DA59B6200355424 /* ScrollLogicalPosition.h */, >+ 8350C3E81DA59B6200355424 /* ScrollLogicalPosition.idl */, >+ 8350C3E71DA59B6200355435 /* ScrollIntoViewOptions.h */, >+ 8350C3E81DA59B6200355435 /* ScrollIntoViewOptions.idl */, > 8350C3E71DA59B6200356446 /* ScrollToOptions.h */, > 8350C3E81DA59B6200356446 /* ScrollToOptions.idl */, > BCD0E0F70E972C3500265DEA /* SecurityOrigin.cpp */, >@@ -24139,6 +24155,10 @@ > 46C376612085176D00C73829 /* JSRemoteDOMWindow.h */, > BCEC01C00C274DDD009F4EC9 /* JSScreen.cpp */, > BCEC01C10C274DDD009F4EC9 /* JSScreen.h */, >+ 83E9B3001DA5A51E00FFD8D4 /* JSScrollLogicalPosition.cpp */, >+ 83E9B3011DA5A51E00FFD8D4 /* JSScrollLogicalPosition.h */, >+ 83E9B3001DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.cpp */, >+ 83E9B3011DA5A51E00FFD8E5 /* JSScrollIntoViewOptions.h */, > 83E9B3001DA5A51E00FFE8F6 /* JSScrollToOptions.cpp */, > 83E9B3011DA5A51E00FFE8F6 /* JSScrollToOptions.h */, > 7C73FB0F191EF6F4007DE061 /* JSUserMessageHandler.cpp */, >@@ -28923,6 +28943,8 @@ > 5E2C436C1BCF071E0001E2BC /* JSRTCTrackEvent.h in Headers */, > BCEC01C30C274DDD009F4EC9 /* JSScreen.h in Headers */, > FDA15ECE12B03F61003A583A /* JSScriptProcessorNode.h in Headers */, >+ 834476EF1DA5BC5E002B5EB0 /* JSScrollLogicalPosition.h in Headers */, >+ 834476EF1DA5BC5E002B5EC1 /* JSScrollIntoViewOptions.h in Headers */, > 834476EF1DA5BC5E002B6ED2 /* JSScrollToOptions.h in Headers */, > CED06AD11C77754800FDFAF1 /* JSSecurityPolicyViolationEvent.h in Headers */, > 5182C2561F3143CD0059BA7C /* JSServiceWorker.h in Headers */, >@@ -30112,6 +30134,8 @@ > 7AAFE8D019CB8672000F56D8 /* ScrollLatchingState.h in Headers */, > F478755419983AFF0024A287 /* ScrollSnapAnimatorState.h in Headers */, > F46729281E0DE68500ACC3D8 /* ScrollSnapOffsetsInfo.h in Headers */, >+ 83C5795D1DA5C301006F9C86 /* ScrollLogicalPosition.h in Headers */, >+ 83C5795D1DA5C301006F9C97 /* ScrollIntoViewOptions.h in Headers */, > 83C5795D1DA5C301006FACA8 /* ScrollToOptions.h in Headers */, > 93C09C860B0657AA005ABD4D /* ScrollTypes.h in Headers */, > BC6D6E2609AF943500F59759 /* ScrollView.h in Headers */, >diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp >index b78da9cd332..3e0971575f5 100644 >--- a/Source/WebCore/dom/Element.cpp >+++ b/Source/WebCore/dom/Element.cpp >@@ -91,6 +91,7 @@ > #include "SVGNames.h" > #include "SVGSVGElement.h" > #include "ScriptDisallowedScope.h" >+#include "ScrollIntoViewOptions.h" > #include "ScrollLatchingState.h" > #include "SelectorQuery.h" > #include "Settings.h" >@@ -651,6 +652,49 @@ void Element::setHovered(bool flag) > renderer()->theme().stateChanged(*renderer(), ControlStates::HoverState); > } > >+// FIXME(webkit.org/b/161611): Take into account orientation/direction. >+inline ScrollAlignment toScrollAlignment(std::optional<ScrollLogicalPosition> position, bool isVertical) >+{ >+ switch (position.value_or(isVertical ? ScrollLogicalPosition::Start : ScrollLogicalPosition::Nearest)) { >+ case ScrollLogicalPosition::Start: >+ return isVertical ? ScrollAlignment::alignTopAlways : ScrollAlignment::alignLeftAlways; >+ case ScrollLogicalPosition::Center: >+ return ScrollAlignment::alignCenterAlways; >+ case ScrollLogicalPosition::End: >+ return isVertical ? ScrollAlignment::alignBottomAlways : ScrollAlignment::alignRightAlways; >+ case ScrollLogicalPosition::Nearest: >+ return ScrollAlignment::alignToEdgeIfNeeded; >+ default: >+ ASSERT_NOT_REACHED(); >+ } >+} >+ >+void Element::scrollIntoView(std::optional<Variant<bool, ScrollIntoViewOptions>>&& arg) >+{ >+ document().updateLayoutIgnorePendingStylesheets(); >+ >+ if (!renderer()) >+ return; >+ >+ bool insideFixed; >+ LayoutRect absoluteBounds = renderer()->absoluteAnchorRect(&insideFixed); >+ >+ // FIXME(webkit.org/b/188043): Support ScrollBehavior. >+ ScrollIntoViewOptions options; >+ if (arg) { >+ auto value = arg.value(); >+ if (WTF::holds_alternative<ScrollIntoViewOptions>(value)) >+ options = WTF::get<ScrollIntoViewOptions>(value); >+ else if (!WTF::get<bool>(value)) >+ options.blockPosition = ScrollLogicalPosition::End; >+ } else >+ options.blockPosition = ScrollLogicalPosition::End; >+ >+ ScrollAlignment blockAlignment = toScrollAlignment(options.blockPosition, true); >+ ScrollAlignment inlineAlignment = toScrollAlignment(options.inlinePosition, false); >+ renderer()->scrollRectToVisible(SelectionRevealMode::Reveal, absoluteBounds, insideFixed, blockAlignment, inlineAlignment, ShouldAllowCrossOriginScrolling::No); >+} >+ > void Element::scrollIntoView(bool alignToTop) > { > document().updateLayoutIgnorePendingStylesheets(); >diff --git a/Source/WebCore/dom/Element.h b/Source/WebCore/dom/Element.h >index f94cce0afe2..d832f8f5994 100644 >--- a/Source/WebCore/dom/Element.h >+++ b/Source/WebCore/dom/Element.h >@@ -53,6 +53,7 @@ class PlatformMouseEvent; > class PlatformWheelEvent; > class PseudoElement; > class RenderTreePosition; >+struct ScrollIntoViewOptions; > class WebAnimation; > struct ElementStyle; > >@@ -141,6 +142,7 @@ public: > unsigned findAttributeIndexByName(const QualifiedName& name) const { return elementData()->findAttributeIndexByName(name); } > unsigned findAttributeIndexByName(const AtomicString& name, bool shouldIgnoreAttributeCase) const { return elementData()->findAttributeIndexByName(name, shouldIgnoreAttributeCase); } > >+ WEBCORE_EXPORT void scrollIntoView(std::optional<Variant<bool, ScrollIntoViewOptions>>&& arg); > WEBCORE_EXPORT void scrollIntoView(bool alignToTop = true); > WEBCORE_EXPORT void scrollIntoViewIfNeeded(bool centerIfNeeded = true); > WEBCORE_EXPORT void scrollIntoViewIfNotVisible(bool centerIfNotVisible = true); >diff --git a/Source/WebCore/dom/Element.idl b/Source/WebCore/dom/Element.idl >index 7df36ec985e..9aed6c95fbb 100644 >--- a/Source/WebCore/dom/Element.idl >+++ b/Source/WebCore/dom/Element.idl >@@ -71,7 +71,7 @@ > // CSSOM-view extensions (https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface). > DOMRectList getClientRects(); > [NewObject] DOMRect getBoundingClientRect(); >- void scrollIntoView(optional boolean alignWithTop = true); // FIXME(webkit.org/b/161611): Parameter type should be (boolean or object). >+ void scrollIntoView(optional (boolean or ScrollIntoViewOptions) arg); > [ImplementedAs=scrollTo] void scroll(optional ScrollToOptions options); > [ImplementedAs=scrollTo] void scroll(unrestricted double x, unrestricted double y); > void scrollTo(optional ScrollToOptions options); >diff --git a/Source/WebCore/page/ScrollIntoViewOptions.h b/Source/WebCore/page/ScrollIntoViewOptions.h >new file mode 100644 >index 00000000000..328d2ec3cf2 >--- /dev/null >+++ b/Source/WebCore/page/ScrollIntoViewOptions.h >@@ -0,0 +1,33 @@ >+/* >+ * 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. >+ */ >+ >+#pragma once >+ >+#include "ScrollLogicalPosition.h" >+ >+namespace WebCore { >+ >+class Element; >+ >+struct ScrollIntoViewOptions { >+ std::optional<ScrollLogicalPosition> blockPosition { ScrollLogicalPosition::Start }; >+ std::optional<ScrollLogicalPosition> inlinePosition { ScrollLogicalPosition::Nearest }; >+}; >+ >+} // namespace WebCore >diff --git a/Source/WebCore/page/ScrollIntoViewOptions.idl b/Source/WebCore/page/ScrollIntoViewOptions.idl >new file mode 100644 >index 00000000000..cf9d1fd7678 >--- /dev/null >+++ b/Source/WebCore/page/ScrollIntoViewOptions.idl >@@ -0,0 +1,24 @@ >+/* >+ * 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. >+ */ >+ >+// FIXME(webkit.org/b/188043): Support ScrollBehavior. >+dictionary ScrollIntoViewOptions { >+ [ImplementedAs=blockPosition] ScrollLogicalPosition block = "start"; >+ [ImplementedAs=inlinePosition] ScrollLogicalPosition inline = "nearest"; >+}; >diff --git a/Source/WebCore/page/ScrollLogicalPosition.h b/Source/WebCore/page/ScrollLogicalPosition.h >new file mode 100644 >index 00000000000..183995d4454 >--- /dev/null >+++ b/Source/WebCore/page/ScrollLogicalPosition.h >@@ -0,0 +1,31 @@ >+/* >+ * 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. >+ */ >+ >+#pragma once >+ >+namespace WebCore { >+ >+enum class ScrollLogicalPosition { >+ Start = 0, >+ Center, >+ End, >+ Nearest >+}; >+ >+} >diff --git a/Source/WebCore/page/ScrollLogicalPosition.idl b/Source/WebCore/page/ScrollLogicalPosition.idl >new file mode 100644 >index 00000000000..d7e59be8fee >--- /dev/null >+++ b/Source/WebCore/page/ScrollLogicalPosition.idl >@@ -0,0 +1,20 @@ >+/* >+ * 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" }; >diff --git a/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp b/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp >index bbce97f6500..24ebffb90dc 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementGtk.cpp >@@ -20,6 +20,7 @@ > #include "config.h" > #include "WebKitDOMElement.h" > >+#include "ScrollIntoViewOptions.h" > #include <WebCore/CSSImportRule.h> > #include <WebCore/DOMException.h> > #include <WebCore/DOMRect.h> >-- >2.18.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189258
:
348810
|
348813
|
348815
|
348828
|
348837
|
348838
|
348849