Title: [295150] trunk
- Revision
- 295150
- Author
- [email protected]
- Date
- 2022-06-02 15:33:31 -0700 (Thu, 02 Jun 2022)
Log Message
[WK2] Sharing services picker button in Mail does not appear after scrolling.
https://bugs.webkit.org/show_bug.cgi?id=240260
<rdar://problem/91492622>
Reviewed by Tim Horton.
Adjust CSS for image controls button to make sure it scrolls with the image in the case
where the image is larger than the Mail compose window.
First we need to remove 'overflow: hidden' from the container div in order for sticky to work.
This seems fine because we never crop or adjust the image-controls container div, it is always
set to the size of the image, even when the image is cropped or the size is adjusted.
Then we add position: sticky and replace 'right: 0px' with 'float: right' because sticky will ignore
any position specification after 'top: 0px' due to its implementation.
* LayoutTests/fast/images/mac/image-controls-sticky-scrolling-expected.txt: Added.
Observing that the RenderButton layer has scrolled to (1978,500) tests this behavior.
* LayoutTests/fast/images/mac/image-controls-sticky-scrolling.html: Added.
* Source/WebCore/html/shadow/mac/imageControlsMac.css:
(#if defined(ENABLE_SERVICE_CONTROLS) && ENABLE_SERVICE_CONTROLS):
(button#image-controls-button):
Canonical link: https://commits.webkit.org/251239@main
Modified Paths
Added Paths
Diff
Added: trunk/LayoutTests/fast/images/mac/image-controls-sticky-scrolling-expected.txt (0 => 295150)
--- trunk/LayoutTests/fast/images/mac/image-controls-sticky-scrolling-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/images/mac/image-controls-sticky-scrolling-expected.txt 2022-06-02 22:33:31 UTC (rev 295150)
@@ -0,0 +1,14 @@
+layer at (0,0) size 2008x2020
+ RenderView at (0,0) size 785x585
+layer at (0,0) size 785x2020
+ RenderBlock {HTML} at (0,0) size 785x2020
+ RenderBody {BODY} at (8,8) size 769x2004
+ RenderBlock (anonymous) at (0,0) size 769x2004
+ RenderImage {IMG} at (0,0) size 2000x2000
+ RenderText {#text} at (0,0) size 0x0
+ RenderBlock {DIV} at (0,2004) size 769x0
+layer at (8,8) size 2000x2000
+ RenderBlock (relative positioned) {DIV} at (0,0) size 2000x2000 [color=#00000000]
+layer at (1978,500) size 28x26
+ RenderButton {BUTTON} at (1970,2) size 28x26 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+scrolled to 0,500
Added: trunk/LayoutTests/fast/images/mac/image-controls-sticky-scrolling.html (0 => 295150)
--- trunk/LayoutTests/fast/images/mac/image-controls-sticky-scrolling.html (rev 0)
+++ trunk/LayoutTests/fast/images/mac/image-controls-sticky-scrolling.html 2022-06-02 22:33:31 UTC (rev 295150)
@@ -0,0 +1,35 @@
+<!DOCTYPE html><!-- webkit-test-runner [ AttachmentElementEnabled=true ] -->
+<html>
+<head>
+<script>
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+}
+if (window.internals) {
+ internals.settings.setImageControlsEnabled(true);
+}
+</script>
+</head>
+<body>
+<img id="target" src="" width="2000" height ="2000">
+<div id="log">
+<script>
+ function hasImageControls(elem)
+ {
+ if (window.internals)
+ return internals.hasImageControls(elem);
+ return false;
+ }
+
+ var elem = document.getElementById("target");
+ var ID = HTMLAttachmentElement.getAttachmentIdentifier(elem);
+
+ setInterval(() => {
+ if (hasImageControls(elem)) {
+ window.scrollTo(0, 500);
+ testRunner.notifyDone();
+ }
+ }, 200);
+</script>
+</body>
+</html>
Modified: trunk/Source/WebCore/html/shadow/mac/imageControlsMac.css (295149 => 295150)
--- trunk/Source/WebCore/html/shadow/mac/imageControlsMac.css 2022-06-02 22:12:04 UTC (rev 295149)
+++ trunk/Source/WebCore/html/shadow/mac/imageControlsMac.css 2022-06-02 22:33:31 UTC (rev 295150)
@@ -28,7 +28,6 @@
div#image-controls {
display: inline-block;
position: relative;
- overflow: hidden;
color: transparent;
user-select: none;
pointer-events: none;
@@ -35,9 +34,9 @@
}
button#image-controls-button {
- position: absolute;
+ position: sticky;
top: 0px;
- right: 0px;
+ float: right;
display: block;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes