https://bugs.webkit.org/show_bug.cgi?id=68777
Patch by Konstantin Scheglov <scheglov@google.com> on 2011-11-17
Reviewed by Simon Fraser.
Source/WebCore:
First time when we change opacity for parent we don't have layer, so
diff=StyleDifferenceRepaint is used instead of diff=StyleDifferenceRepaintLayer.
Layer is created later, in styleDidChange().
So, when we recalculate later diff, we now check for diff=StyleDifferenceRepaintLayer and
performs repaintIncludingDescendants().
Test: fast/layers/layer-absolute-parent-opacity.html
* rendering/RenderObject.cpp:
(WebCore::RenderObject::setStyle): Call repaintIncludingDescendants() instead of repaint().
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::diff): Add ContextSensitivePropertyOpacity when change opacity.
LayoutTests:
* fast/layers/layer-absolute-parent-opacity-expected.png: Added.
* fast/layers/layer-absolute-parent-opacity-expected.txt: Added.
* fast/layers/layer-absolute-parent-opacity.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@100693
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-11-17 Konstantin Scheglov <scheglov@google.com>
+
+ Absolute child is not repainted when parent opacity changes
+ https://bugs.webkit.org/show_bug.cgi?id=68777
+
+ Reviewed by Simon Fraser.
+
+ * fast/layers/layer-absolute-parent-opacity-expected.png: Added.
+ * fast/layers/layer-absolute-parent-opacity-expected.txt: Added.
+ * fast/layers/layer-absolute-parent-opacity.html: Added.
+
2011-11-17 Adrienne Walker <enne@google.com>
[chromium] Unreviewed, rebaseline tests after r100545.
--- /dev/null
+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
+layer at (8,8) size 100x100
+ RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#00FF00]
+layer at (80,0) size 200x50
+ RenderBlock (positioned) {DIV} at (80,0) size 200x50 [bgcolor=#0000FF]
--- /dev/null
+<!--
+Test for https://bugs.webkit.org/show_bug.cgi?id=68777
+When we change opacity for parent DIV, this should change also opacity for absolute child, which is
+on its own layer. Before fixing this worked only second time, when parent DIV already has its own
+layer.
+-->
+<html>
+ <head>
+ <style>
+ #parentDiv {
+ background: #0f0;
+ width: 100px;
+ height: 100px;
+ }
+ #childDiv {
+ position: absolute;
+ background: #00f;
+ top: 0px;
+ left: 80px;
+ width: 200px;
+ height: 50px;
+ }
+ </style>
+ <script type="text/javascript">
+ function test() {
+ if (window.layoutTestController) {
+ layoutTestController.display();
+ setTimeout(function() {
+ document.getElementById("parentDiv").style.opacity = 0.5;
+ layoutTestController.notifyDone();
+ }, 0);
+ layoutTestController.waitUntilDone();
+ }
+ }
+ </script>
+ </head>
+ <body onload="test()">
+ <div id="parentDiv">
+ <div id="childDiv"/>
+ </div>
+ </body>
+</html>
+
+2011-11-17 Konstantin Scheglov <scheglov@google.com>
+
+ Absolute child is not repainted when parent opacity changes
+ https://bugs.webkit.org/show_bug.cgi?id=68777
+
+ Reviewed by Simon Fraser.
+
+ First time when we change opacity for parent we don't have layer, so
+ diff=StyleDifferenceRepaint is used instead of diff=StyleDifferenceRepaintLayer.
+ Layer is created later, in styleDidChange().
+ So, when we recalculate later diff, we now check for diff=StyleDifferenceRepaintLayer and
+ performs repaintIncludingDescendants().
+
+ Test: fast/layers/layer-absolute-parent-opacity.html
+
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::setStyle): Call repaintIncludingDescendants() instead of repaint().
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::diff): Add ContextSensitivePropertyOpacity when change opacity.
+
2011-11-17 Nate Chapin <japhet@chromium.org>
r100311 dropped a RefPtr that is very
setNeedsSimplifiedNormalFlowLayout();
}
- if (updatedDiff == StyleDifferenceRepaintLayer || updatedDiff == StyleDifferenceRepaint) {
+ if (diff == StyleDifferenceRepaint && updatedDiff == StyleDifferenceRepaintLayer) {
+ // If there was no layer, we ignored StyleDifferenceRepaintLayer and processed it as
+ // StyleDifferenceRepaint, so do layers repaint now.
+ toRenderBoxModelObject(this)->layer()->repaintIncludingDescendants();
+ } else if (updatedDiff == StyleDifferenceRepaintLayer || updatedDiff == StyleDifferenceRepaint) {
// Do a repaint with the new style now, e.g., for example if we go from
// not having an outline to having an outline.
repaint();
// to add a selfNeedsSimplifiedLayout bit in order to not get confused and taint every line).
// In addition we need to solve the floating object issue when layers come and go. Right now
// a full layout is necessary to keep floating object lists sane.
+ changedContextSensitiveProperties |= ContextSensitivePropertyOpacity;
return StyleDifferenceLayout;
}