Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit 4f1a6ea

Browse files
Overflow scrollIntoView wrong with borders
https://bugs.webkit.org/show_bug.cgi?id=152660 Patch by Martin Robinson <[email protected]> on 2020-10-27 Reviewed by Simon Fraser. Source/WebCore: Tests: fast/overflow/scrollIntoView-nested-in-area-with-border.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollRectToVisible): Offset the exposure rect by the border so that it is relative to the content rectangle. LayoutTests: Added a new test for this fix and renamed a similar test to follow a standard naming convention. This will make the two tests easier to find. * fast/overflow/scrollIntoView-nested-in-area-with-border-expected.html: Added. * fast/overflow/scrollIntoView-nested-in-area-with-border.html: Added. * fast/overflow/scrollIntoView-overflow-hidden-expected.html: Renamed from LayoutTests/fast/overflow/overflow-hidden-scroll-into-view-expected.html. * fast/overflow/scrollIntoView-overflow-hidden.html: Renamed from LayoutTests/fast/overflow/overflow-hidden-scroll-into-view.html. * fast/spatial-navigation/snav-div-overflow-scrol-hidden-expected.txt: Updated expectation. * platform/ios/TestExpectations: Updated test name in expectations. * platform/mac-wk2/editing/input/caret-at-the-edge-of-contenteditable-expected.txt: Updated expectation. * platform/mac-wk2/editing/input/reveal-caret-of-multiline-contenteditable-expected.txt: Ditto. * platform/mac/editing/input/caret-at-the-edge-of-contenteditable-expected.txt: Ditto. * platform/mac/editing/input/reveal-caret-of-multiline-contenteditable-expected.txt: Ditto. * platform/mac/editing/input/reveal-caret-of-multiline-input-expected.txt: Ditto. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@269070 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 9492d7c commit 4f1a6ea

14 files changed

+111
-8
lines changed

LayoutTests/ChangeLog

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
2020-10-27 Martin Robinson <[email protected]>
2+
3+
Overflow scrollIntoView wrong with borders
4+
https://bugs.webkit.org/show_bug.cgi?id=152660
5+
6+
Reviewed by Simon Fraser.
7+
8+
Added a new test for this fix and renamed a similar test to follow a
9+
standard naming convention. This will make the two tests easier to find.
10+
11+
* fast/overflow/scrollIntoView-nested-in-area-with-border-expected.html: Added.
12+
* fast/overflow/scrollIntoView-nested-in-area-with-border.html: Added.
13+
* fast/overflow/scrollIntoView-overflow-hidden-expected.html: Renamed from LayoutTests/fast/overflow/overflow-hidden-scroll-into-view-expected.html.
14+
* fast/overflow/scrollIntoView-overflow-hidden.html: Renamed from LayoutTests/fast/overflow/overflow-hidden-scroll-into-view.html.
15+
* fast/spatial-navigation/snav-div-overflow-scrol-hidden-expected.txt: Updated expectation.
16+
* platform/ios/TestExpectations: Updated test name in expectations.
17+
* platform/mac-wk2/editing/input/caret-at-the-edge-of-contenteditable-expected.txt: Updated expectation.
18+
* platform/mac-wk2/editing/input/reveal-caret-of-multiline-contenteditable-expected.txt: Ditto.
19+
* platform/mac/editing/input/caret-at-the-edge-of-contenteditable-expected.txt: Ditto.
20+
* platform/mac/editing/input/reveal-caret-of-multiline-contenteditable-expected.txt: Ditto.
21+
* platform/mac/editing/input/reveal-caret-of-multiline-input-expected.txt: Ditto.
22+
123
2020-10-27 Tim Horton <[email protected]>
224

325
REGRESSION (r265515): fast/events/touch/ios/touch-events-with-modifiers.html is a frequent failure
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Tests that scrollIntoView() works properly on a target nested inside a scrollable container with a border</title>
5+
<style>
6+
body {
7+
margin: 0;
8+
}
9+
.box {
10+
width: 50px;
11+
height: 50px;
12+
background: green;
13+
margin: 100px;
14+
}
15+
</style>
16+
</head>
17+
18+
<body>
19+
<div class="box">
20+
</body>
21+
</html>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Tests that scrollIntoView() works properly on a target nested inside a scrollable container with a border</title>
5+
<style>
6+
body {
7+
margin: 0;
8+
}
9+
.container {
10+
width: 100px;
11+
height: 100px;
12+
overflow: hidden;
13+
border: solid rgba(0, 0, 0, 0) 100px;
14+
}
15+
16+
.spacer {
17+
height: 1000px;
18+
}
19+
20+
#target {
21+
width: 50px;
22+
height: 50px;
23+
background: green;
24+
}
25+
</style>
26+
</head>
27+
28+
<body>
29+
<div class="container">
30+
<div class="spacer"></div>
31+
<div id="target"></div>
32+
<div class="spacer"></div>
33+
</div>
34+
35+
<script>
36+
function doTest() {
37+
document.getElementById('target').scrollIntoView();
38+
}
39+
window.addEventListener('load', doTest, false);
40+
</script>
41+
</body>
42+
</html>

LayoutTests/fast/spatial-navigation/snav-div-overflow-scrol-hidden-expected.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ PASS gFocusedDocument.activeElement.getAttribute("id") is "f2"
1111
PASS gFocusedDocument.activeElement.getAttribute("id") is "f3"
1212
PASS gFocusedDocument.activeElement.getAttribute("id") is "f3"
1313
PASS gFocusedDocument.activeElement.getAttribute("id") is "f4"
14-
FAIL gFocusedDocument.activeElement.getAttribute("id") should be f4. Was f5.
15-
FAIL gFocusedDocument.activeElement.getAttribute("id") should be f5. Was f6.
14+
PASS gFocusedDocument.activeElement.getAttribute("id") is "f4"
15+
PASS gFocusedDocument.activeElement.getAttribute("id") is "f5"
1616
PASS gFocusedDocument.activeElement.getAttribute("id") is "f6"
1717
PASS gFocusedDocument.activeElement.getAttribute("id") is "f9"
1818
This test is testing that div with overflow:auto would scroll, by div with overflow:hidden would not.

LayoutTests/platform/ios/TestExpectations

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2338,7 +2338,7 @@ fast/css/pseudo-visited-background-color-on-input.html [ ImageOnlyFailure ]
23382338
fast/forms/select-size.html [ ImageOnlyFailure ]
23392339
fast/inline/inline-with-outline-offset.html [ ImageOnlyFailure ]
23402340
fast/inline/outline-corners-with-offset.html [ ImageOnlyFailure ]
2341-
fast/overflow/overflow-hidden-scroll-into-view.html [ Pass ImageOnlyFailure ]
2341+
fast/overflow/scrollIntoView-overflow-hidden.html [ Pass ImageOnlyFailure ]
23422342
fast/sub-pixel/table-with-subpixel-cell-size.html [ ImageOnlyFailure ]
23432343
svg/text/tspan-multiple-outline.svg [ ImageOnlyFailure ]
23442344
fast/animation/height-auto-transition-computed-value.html [ ImageOnlyFailure ]

LayoutTests/platform/mac-wk2/editing/input/caret-at-the-edge-of-contenteditable-expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ layer at (0,0) size 800x72
77
RenderText {#text} at (0,0) size 761x36
88
text run at (0,0) width 761: "When the caret reaches the edge of the input box or content editable div, on the next input if must jump to the center of"
99
text run at (0,18) width 73: "the control."
10-
layer at (8,44) size 82x20 clip at (9,45) size 80x18 scrollX 42 scrollWidth 337
10+
layer at (8,44) size 82x20 clip at (9,45) size 80x18 scrollX 41 scrollWidth 337
1111
RenderBlock {DIV} at (0,36) size 82x20 [border: (1px solid #000000)]
1212
RenderText {#text} at (1,1) size 336x18
1313
text run at (1,1) width 336: "012345678901012345678901234567890123456789"

LayoutTests/platform/mac-wk2/editing/input/reveal-caret-of-multiline-contenteditable-expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ layer at (0,0) size 800x216
66
RenderBlock {DIV} at (0,0) size 784x18
77
RenderText {#text} at (0,0) size 610x18
88
text run at (0,0) width 610: "When the caret is scrolled out, on starting typing it must be brought to the center of the control."
9-
layer at (8,26) size 784x182 clip at (9,27) size 767x165 scrollY 252 scrollHeight 558
9+
layer at (8,26) size 784x182 clip at (9,27) size 767x165 scrollY 251 scrollHeight 558
1010
RenderBlock {DIV} at (0,18) size 784x182 [border: (1px solid #000000)]
1111
RenderText {#text} at (1,1) size 16x18
1212
text run at (1,1) width 16: "00"

LayoutTests/platform/mac/editing/input/caret-at-the-edge-of-contenteditable-expected.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ layer at (0,0) size 800x72
77
RenderText {#text} at (0,0) size 761x36
88
text run at (0,0) width 761: "When the caret reaches the edge of the input box or content editable div, on the next input if must jump to the center of"
99
text run at (0,18) width 73: "the control."
10-
layer at (8,44) size 82x20 clip at (9,45) size 80x18 scrollX 42 scrollWidth 337
10+
layer at (8,44) size 82x20 clip at (9,45) size 80x18 scrollX 41 scrollWidth 337
1111
RenderBlock {DIV} at (0,36) size 82x20 [border: (1px solid #000000)]
1212
RenderText {#text} at (1,1) size 336x18
1313
text run at (1,1) width 336: "012345678901012345678901234567890123456789"

0 commit comments

Comments
 (0)