Diff
Modified: trunk/LayoutTests/ChangeLog (148257 => 148258)
--- trunk/LayoutTests/ChangeLog 2013-04-12 01:43:23 UTC (rev 148257)
+++ trunk/LayoutTests/ChangeLog 2013-04-12 02:38:32 UTC (rev 148258)
@@ -1,3 +1,23 @@
+2013-04-11 Shezan Baig <[email protected]>
+
+ Selection gaps don't repaint correctly with transforms
+ https://bugs.webkit.org/show_bug.cgi?id=111000
+
+ Reviewed by Simon Fraser.
+
+ * fast/repaint/selection-gap-absolute-child-expected.txt: Added.
+ * fast/repaint/selection-gap-absolute-child.html: Added.
+ * fast/repaint/selection-gap-fixed-child-expected.txt: Added.
+ * fast/repaint/selection-gap-fixed-child.html: Added.
+ * fast/repaint/selection-gap-flipped-absolute-child-expected.txt: Added.
+ * fast/repaint/selection-gap-flipped-absolute-child.html: Added.
+ * fast/repaint/selection-gap-flipped-fixed-child-expected.txt: Added.
+ * fast/repaint/selection-gap-flipped-fixed-child.html: Added.
+ * fast/repaint/selection-gap-transformed-absolute-child-expected.txt: Added.
+ * fast/repaint/selection-gap-transformed-absolute-child.html: Added.
+ * fast/repaint/selection-gap-transformed-fixed-child-expected.txt: Added.
+ * fast/repaint/selection-gap-transformed-fixed-child.html: Added.
+
2013-04-11 Ryosuke Niwa <[email protected]>
Remove passing test expectations for ietestcenter/css3/grid/grid-items-003.htm since it started failing on
Added: trunk/LayoutTests/fast/repaint/selection-gap-absolute-child-expected.txt (0 => 148258)
--- trunk/LayoutTests/fast/repaint/selection-gap-absolute-child-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/repaint/selection-gap-absolute-child-expected.txt 2013-04-12 02:38:32 UTC (rev 148258)
@@ -0,0 +1,8 @@
+Bug 111000: Selection gaps don't repaint correctly with transforms
+This tests that absolute elements are invalidated correctly. The box will be competely green if the selected area was invalidated correctly.
+
+
+(repaint rects
+ (rect 0 0 100 100)
+)
+
Added: trunk/LayoutTests/fast/repaint/selection-gap-absolute-child.html (0 => 148258)
--- trunk/LayoutTests/fast/repaint/selection-gap-absolute-child.html (rev 0)
+++ trunk/LayoutTests/fast/repaint/selection-gap-absolute-child.html 2013-04-12 02:38:32 UTC (rev 148258)
@@ -0,0 +1,24 @@
+<!doctype html>
+<head>
+ <script src=""
+ <script>
+ function repaintTest()
+ {
+ var target = document.getElementById("target");
+ getSelection().setBaseAndExtent(target, 0, target.nextSibling, 1);
+ }
+ </script>
+ <style>
+ body { margin: 0px; }
+ #target::selection { background-color: green; }
+ </style>
+</head>
+<body _onload_="runRepaintTest()">
+ <div style="position: absolute; margin-left: 200px;">
+ <div>Bug <a href="" Selection gaps don't repaint correctly with transforms</div>
+ <div>This tests that absolute elements are invalidated correctly. The box will be competely green if the selected area was invalidated correctly.</div>
+ </div>
+ <div>
+ <div id="target" style="background-color: red; width: 100px; height: 100px; position: absolute;"><br/></div><br/>
+ </div>
+</body>
Added: trunk/LayoutTests/fast/repaint/selection-gap-fixed-child-expected.txt (0 => 148258)
--- trunk/LayoutTests/fast/repaint/selection-gap-fixed-child-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/repaint/selection-gap-fixed-child-expected.txt 2013-04-12 02:38:32 UTC (rev 148258)
@@ -0,0 +1,8 @@
+Bug 111000: Selection gaps don't repaint correctly with transforms
+This tests that fixed elements are invalidated correctly. The box will be competely green if the selected area was invalidated correctly.
+
+
+(repaint rects
+ (rect 0 0 100 100)
+)
+
Added: trunk/LayoutTests/fast/repaint/selection-gap-fixed-child.html (0 => 148258)
--- trunk/LayoutTests/fast/repaint/selection-gap-fixed-child.html (rev 0)
+++ trunk/LayoutTests/fast/repaint/selection-gap-fixed-child.html 2013-04-12 02:38:32 UTC (rev 148258)
@@ -0,0 +1,24 @@
+<!doctype html>
+<head>
+ <script src=""
+ <script>
+ function repaintTest()
+ {
+ var target = document.getElementById("target");
+ getSelection().setBaseAndExtent(target, 0, target.nextSibling, 1);
+ }
+ </script>
+ <style>
+ body { margin: 0px; }
+ #target::selection { background-color: green; }
+ </style>
+</head>
+<body _onload_="runRepaintTest()">
+ <div style="position: absolute; margin-left: 200px;">
+ <div>Bug <a href="" Selection gaps don't repaint correctly with transforms</div>
+ <div>This tests that fixed elements are invalidated correctly. The box will be competely green if the selected area was invalidated correctly.</div>
+ </div>
+ <div>
+ <div id="target" style="background-color: red; width: 100px; height: 100px; position: fixed;"><br/></div><br/>
+ </div>
+</body>
Added: trunk/LayoutTests/fast/repaint/selection-gap-flipped-absolute-child-expected.txt (0 => 148258)
--- trunk/LayoutTests/fast/repaint/selection-gap-flipped-absolute-child-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/repaint/selection-gap-flipped-absolute-child-expected.txt 2013-04-12 02:38:32 UTC (rev 148258)
@@ -0,0 +1,8 @@
+Bug 111000: Selection gaps don't repaint correctly with transforms
+This tests that absolute elements that get flipped are invalidated correctly. The box will be competely green if the selected area was invalidated correctly.
+
+
+(repaint rects
+ (rect 700 0 100 100)
+)
+
Added: trunk/LayoutTests/fast/repaint/selection-gap-flipped-absolute-child.html (0 => 148258)
--- trunk/LayoutTests/fast/repaint/selection-gap-flipped-absolute-child.html (rev 0)
+++ trunk/LayoutTests/fast/repaint/selection-gap-flipped-absolute-child.html 2013-04-12 02:38:32 UTC (rev 148258)
@@ -0,0 +1,24 @@
+<!doctype html>
+<head>
+ <script src=""
+ <script>
+ function repaintTest()
+ {
+ var target = document.getElementById("target");
+ getSelection().setBaseAndExtent(target, 0, target.nextSibling, 1);
+ }
+ </script>
+ <style>
+ body { margin: 0px; }
+ #target::selection { background-color: green; }
+ </style>
+</head>
+<body _onload_="runRepaintTest()">
+ <div style="position: absolute; margin-right: 200px;">
+ <div>Bug <a href="" Selection gaps don't repaint correctly with transforms</div>
+ <div>This tests that absolute elements that get flipped are invalidated correctly. The box will be competely green if the selected area was invalidated correctly.</div>
+ </div>
+ <div style="-webkit-writing-mode: vertical-rl">
+ <div id="target" style="background-color: red; width: 100px; height: 100px; position: absolute;"><br/></div><br/>
+ </div>
+</body>
Added: trunk/LayoutTests/fast/repaint/selection-gap-flipped-fixed-child-expected.txt (0 => 148258)
--- trunk/LayoutTests/fast/repaint/selection-gap-flipped-fixed-child-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/repaint/selection-gap-flipped-fixed-child-expected.txt 2013-04-12 02:38:32 UTC (rev 148258)
@@ -0,0 +1,8 @@
+Bug 111000: Selection gaps don't repaint correctly with transforms
+This tests that fixed elements that get flipped are invalidated correctly. The box will be competely green if the selected area was invalidated correctly.
+
+
+(repaint rects
+ (rect 700 0 100 100)
+)
+
Added: trunk/LayoutTests/fast/repaint/selection-gap-flipped-fixed-child.html (0 => 148258)
--- trunk/LayoutTests/fast/repaint/selection-gap-flipped-fixed-child.html (rev 0)
+++ trunk/LayoutTests/fast/repaint/selection-gap-flipped-fixed-child.html 2013-04-12 02:38:32 UTC (rev 148258)
@@ -0,0 +1,24 @@
+<!doctype html>
+<head>
+ <script src=""
+ <script>
+ function repaintTest()
+ {
+ var target = document.getElementById("target");
+ getSelection().setBaseAndExtent(target, 0, target.nextSibling, 1);
+ }
+ </script>
+ <style>
+ body { margin: 0px; }
+ #target::selection { background-color: green; }
+ </style>
+</head>
+<body _onload_="runRepaintTest()">
+ <div style="position: absolute; margin-right: 200px;">
+ <div>Bug <a href="" Selection gaps don't repaint correctly with transforms</div>
+ <div>This tests that fixed elements that get flipped are invalidated correctly. The box will be competely green if the selected area was invalidated correctly.</div>
+ </div>
+ <div style="-webkit-writing-mode: vertical-rl">
+ <div id="target" style="background-color: red; width: 100px; height: 100px; position: fixed;"><br/></div><br/>
+ </div>
+</body>
Added: trunk/LayoutTests/fast/repaint/selection-gap-transformed-absolute-child-expected.txt (0 => 148258)
--- trunk/LayoutTests/fast/repaint/selection-gap-transformed-absolute-child-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/repaint/selection-gap-transformed-absolute-child-expected.txt 2013-04-12 02:38:32 UTC (rev 148258)
@@ -0,0 +1,8 @@
+Bug 111000: Selection gaps don't repaint correctly with transforms
+This tests that absolute elements that get transformed are invalidated correctly. The box will be completely green if the selected area was invalidated correctly.
+
+
+(repaint rects
+ (rect 50 50 100 100)
+)
+
Added: trunk/LayoutTests/fast/repaint/selection-gap-transformed-absolute-child.html (0 => 148258)
--- trunk/LayoutTests/fast/repaint/selection-gap-transformed-absolute-child.html (rev 0)
+++ trunk/LayoutTests/fast/repaint/selection-gap-transformed-absolute-child.html 2013-04-12 02:38:32 UTC (rev 148258)
@@ -0,0 +1,24 @@
+<!doctype html>
+<head>
+ <script src=""
+ <script>
+ function repaintTest()
+ {
+ var target = document.getElementById("target");
+ getSelection().setBaseAndExtent(target, 0, target.nextSibling, 1);
+ }
+ </script>
+ <style>
+ body { margin: 0px; }
+ #target::selection { background-color: green; }
+ </style>
+</head>
+<body _onload_="runRepaintTest()">
+ <div style="position: absolute; margin-left: 200px;">
+ <div>Bug <a href="" Selection gaps don't repaint correctly with transforms</div>
+ <div>This tests that absolute elements that get transformed are invalidated correctly. The box will be completely green if the selected area was invalidated correctly.</div>
+ </div>
+ <div style="-webkit-transform: translate(50px, 50px);">
+ <div id="target" style="background-color: red; width: 100px; height: 100px; position: absolute;"><br/></div><br/>
+ </div>
+</body>
Added: trunk/LayoutTests/fast/repaint/selection-gap-transformed-fixed-child-expected.txt (0 => 148258)
--- trunk/LayoutTests/fast/repaint/selection-gap-transformed-fixed-child-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/repaint/selection-gap-transformed-fixed-child-expected.txt 2013-04-12 02:38:32 UTC (rev 148258)
@@ -0,0 +1,8 @@
+Bug 111000: Selection gaps don't repaint correctly with transforms
+This tests that fixed elements that get transformed are invalidated correctly. The box will be competely green if the selected area was invalidated correctly.
+
+
+(repaint rects
+ (rect 50 50 100 100)
+)
+
Added: trunk/LayoutTests/fast/repaint/selection-gap-transformed-fixed-child.html (0 => 148258)
--- trunk/LayoutTests/fast/repaint/selection-gap-transformed-fixed-child.html (rev 0)
+++ trunk/LayoutTests/fast/repaint/selection-gap-transformed-fixed-child.html 2013-04-12 02:38:32 UTC (rev 148258)
@@ -0,0 +1,24 @@
+<!doctype html>
+<head>
+ <script src=""
+ <script>
+ function repaintTest()
+ {
+ var target = document.getElementById("target");
+ getSelection().setBaseAndExtent(target, 0, target.nextSibling, 1);
+ }
+ </script>
+ <style>
+ body { margin: 0px; }
+ #target::selection { background-color: green; }
+ </style>
+</head>
+<body _onload_="runRepaintTest()">
+ <div style="position: absolute; margin-left: 200px;">
+ <div>Bug <a href="" Selection gaps don't repaint correctly with transforms</div>
+ <div>This tests that fixed elements that get transformed are invalidated correctly. The box will be competely green if the selected area was invalidated correctly.</div>
+ </div>
+ <div style="-webkit-transform: translate(50px, 50px);">
+ <div id="target" style="background-color: red; width: 100px; height: 100px; position: fixed;"><br/></div><br/>
+ </div>
+</body>
Modified: trunk/Source/WebCore/ChangeLog (148257 => 148258)
--- trunk/Source/WebCore/ChangeLog 2013-04-12 01:43:23 UTC (rev 148257)
+++ trunk/Source/WebCore/ChangeLog 2013-04-12 02:38:32 UTC (rev 148258)
@@ -1,3 +1,25 @@
+2013-04-11 Shezan Baig <[email protected]>
+
+ Selection gaps don't repaint correctly with transforms
+ https://bugs.webkit.org/show_bug.cgi?id=111000
+
+ Reviewed by Simon Fraser.
+
+ When computing offsetFromRepaintContainer, we need to add UseTransforms
+ to the MapCoordinateFlags argument. Note that ApplyContainerFlip is
+ the default value for the flag, so this change effectively only adds
+ the UseTransforms flag.
+
+ Tests: fast/repaint/selection-gap-absolute-child.html
+ fast/repaint/selection-gap-fixed-child.html
+ fast/repaint/selection-gap-flipped-absolute-child.html
+ fast/repaint/selection-gap-flipped-fixed-child.html
+ fast/repaint/selection-gap-transformed-absolute-child.html
+ fast/repaint/selection-gap-transformed-fixed-child.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::selectionGapRectsForRepaint):
+
2013-04-11 Oliver Hunt <[email protected]>
Add more type validation to debug builds
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (148257 => 148258)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2013-04-12 01:43:23 UTC (rev 148257)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2013-04-12 02:38:32 UTC (rev 148258)
@@ -3392,9 +3392,8 @@
if (!shouldPaintSelectionGaps())
return GapRects();
- // FIXME: this is broken with transforms
TransformState transformState(TransformState::ApplyTransformDirection, FloatPoint());
- mapLocalToContainer(repaintContainer, transformState);
+ mapLocalToContainer(repaintContainer, transformState, ApplyContainerFlip | UseTransforms);
LayoutPoint offsetFromRepaintContainer = roundedLayoutPoint(transformState.mappedPoint());
if (hasOverflowClip())