Skip to content

Commit

Permalink
Merge r173046 - Scrollbar corner can be drawn outside containing frame
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=133131
<rdar://problem/16382769>

Reviewed by Simon Fraser.

Source/WebCore:

Merged from Blink (patch by Levi Weintraub):
<https://src.chromium.org/viewvc/blink?revision=170625&view=revision>

Fixes an issue where the scroll corner may be painted outside the rectangle of
its associated frame by setting a clip rectangle before painting the scroll bar(s)
and scroll corner.

Test: scrollbars/custom-scrollbars-paint-outside-iframe.html

* platform/ScrollView.cpp:
(WebCore::ScrollView::paint):

LayoutTests:

Add DRT test that was derived from the test included in
<https://src.chromium.org/viewvc/blink?revision=170625&view=revision>.

* scrollbars/custom-scrollbars-paint-outside-iframe-expected.html: Added.
* scrollbars/custom-scrollbars-paint-outside-iframe.html: Added.
  • Loading branch information
dydz authored and carlosgcampos committed Feb 28, 2016
1 parent 7549f98 commit 9b7db21
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 0 deletions.
14 changes: 14 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
2014-08-27 Daniel Bates <dabates@apple.com>

Scrollbar corner can be drawn outside containing frame
https://bugs.webkit.org/show_bug.cgi?id=133131
<rdar://problem/16382769>

Reviewed by Simon Fraser.

Add DRT test that was derived from the test included in
<https://src.chromium.org/viewvc/blink?revision=170625&view=revision>.

* scrollbars/custom-scrollbars-paint-outside-iframe-expected.html: Added.
* scrollbars/custom-scrollbars-paint-outside-iframe.html: Added.

2015-07-09 Daniel Bates <dabates@apple.com>

Fetching Content Security Policy report URL should respect same origin policy
Expand Down
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<script>
if (window.testRunner)
testRunner.waitUntilDone();

function done()
{
if (window.testRunner)
testRunner.notifyDone();
}
</script>
</head>
<body style="margin: 0px">
<div style="background-color: green; width: 100px; height: 100px"></div>
<p>This tests ensures that themed scrollbars are clipped to their iframe. You should see a green box above.</p>
<iframe style="position: absolute; top: 100px; left: 100px;" width="1" height="1" srcdoc="
<html><head><style>
html,body {width:200px; height:100px;}
::-webkit-scrollbar {height: 1px; width: 1px;}
::-webkit-scrollbar-corner {background-color: red;}
</style></head></html>" onload="done()"></iframe>
</body>
</html>
25 changes: 25 additions & 0 deletions LayoutTests/scrollbars/custom-scrollbars-paint-outside-iframe.html
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<script>
if (window.testRunner)
testRunner.waitUntilDone();

function done()
{
if (window.testRunner)
testRunner.notifyDone();
}
</script>
</head>
<body style="margin: 0px">
<div style="background-color: green; width: 100px; height: 100px"></div>
<p>This tests ensures that themed scrollbars are clipped to their iframe. You should see a green box above.</p>
<iframe style="position: absolute; top: 100px; left: 100px;" width="1" height="1" srcdoc="
<html><head><style>
html,body {width:200px; height:100px;}
::-webkit-scrollbar {height: 200px; width: 200px;}
::-webkit-scrollbar-corner {background-color: red;}
</style></head></html>" onload="done()"></iframe>
</body>
</html>
20 changes: 20 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,23 @@
2014-08-27 Daniel Bates <dabates@apple.com>

Scrollbar corner can be drawn outside containing frame
https://bugs.webkit.org/show_bug.cgi?id=133131
<rdar://problem/16382769>

Reviewed by Simon Fraser.

Merged from Blink (patch by Levi Weintraub):
<https://src.chromium.org/viewvc/blink?revision=170625&view=revision>

Fixes an issue where the scroll corner may be painted outside the rectangle of
its associated frame by setting a clip rectangle before painting the scroll bar(s)
and scroll corner.

Test: scrollbars/custom-scrollbars-paint-outside-iframe.html

* platform/ScrollView.cpp:
(WebCore::ScrollView::paint):

2015-07-09 Daniel Bates <dabates@apple.com>

Fetching Content Security Policy report URL should respect same origin policy
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/platform/ScrollView.cpp
Expand Up @@ -1177,6 +1177,7 @@ void ScrollView::paint(GraphicsContext* context, const IntRect& rect)
scrollViewDirtyRect.intersect(visibleAreaWithScrollbars);
context->translate(x(), y());
scrollViewDirtyRect.moveBy(-location());
context->clip(IntRect(IntPoint(), visibleAreaWithScrollbars.size()));

paintScrollbars(context, scrollViewDirtyRect);
}
Expand Down

0 comments on commit 9b7db21

Please sign in to comment.