Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
2009-03-09 Simon Fraser <simon.fraser@apple.com>
        Reviewed by Dan Bernstein, Oliver Hunt

        https://bugs.webkit.org/show_bug.cgi?id=24475

        When repainting replaced elements, need to union the selection
        and overflow rects because either may extend outside the other.

        Test: fast/repaint/transform-replaced-shadows.html

        * rendering/RenderReplaced.cpp:
        (WebCore::RenderReplaced::clippedOverflowRectForRepaint):

Canonical link: https://commits.webkit.org/33611@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@41545 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
smfr committed Mar 10, 2009
1 parent b68a954 commit df103f0
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 3 deletions.
13 changes: 13 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
2009-03-09 Simon Fraser <simon.fraser@apple.com>

Reviewed by Dan Bernstein, Oliver Hunt

https://bugs.webkit.org/show_bug.cgi?id=24475

Test for repainting a replaced element with transform and box-shadow.

* fast/repaint/transform-replaced-shadows.html: Added.
* platform/mac/fast/repaint/transform-replaced-shadows-expected.checksum: Added.
* platform/mac/fast/repaint/transform-replaced-shadows-expected.png: Added.
* platform/mac/fast/repaint/transform-replaced-shadows-expected.txt: Added.

2009-03-09 Oliver Hunt <oliver@apple.com>

Reviewed by Gavin Barraclough.
Expand Down
33 changes: 33 additions & 0 deletions LayoutTests/fast/repaint/transform-replaced-shadows.html
@@ -0,0 +1,33 @@
<html>
<head>
<title>Scaling and box-shadow</title>
<style type="text/css" media="screen">
#box {
height: 100px;
width: 100px;
margin: 20px;
background-color: gray;
-webkit-transform-origin: top left;
-webkit-box-shadow: 0px 20px 20px black;
-webkit-transform: scale(2);
}

#box.smaller {
-webkit-transform: scale(1);
}
</style>

<script src="repaint.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
function repaintTest()
{
document.getElementById('box').className = 'smaller';
}
</script>
</head>
<body onload="runRepaintTest()">

<img id="box">

</body>
</html>
@@ -0,0 +1 @@
158602fb51ff2bbc218008a57713fb0b
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,10 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
layer at (28,28) size 120x140
RenderImage {IMG} at (20,20) size 100x100 [bgcolor=#808080]
14 changes: 14 additions & 0 deletions WebCore/ChangeLog
@@ -1,3 +1,17 @@
2009-03-09 Simon Fraser <simon.fraser@apple.com>

Reviewed by Dan Bernstein, Oliver Hunt

https://bugs.webkit.org/show_bug.cgi?id=24475

When repainting replaced elements, need to union the selection
and overflow rects because either may extend outside the other.

Test: fast/repaint/transform-replaced-shadows.html

* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::clippedOverflowRectForRepaint):

2009-03-09 Stephanie Lewis <slewis@apple.com>

Fix build.
Expand Down
6 changes: 3 additions & 3 deletions WebCore/rendering/RenderReplaced.cpp
Expand Up @@ -390,9 +390,9 @@ IntRect RenderReplaced::clippedOverflowRectForRepaint(RenderBoxModelObject* repa
if (style()->visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent())
return IntRect();

// The selectionRect can project outside of the overflowRect, so use
// that for repainting to avoid selection painting glitches
IntRect r = localSelectionRect(false);
// The selectionRect can project outside of the overflowRect, so take their union
// for repainting to avoid selection painting glitches.
IntRect r = unionRect(localSelectionRect(false), overflowRect(false));

RenderView* v = view();
if (v) {
Expand Down

0 comments on commit df103f0

Please sign in to comment.