WebCore:
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Nov 2007 04:53:31 +0000 (04:53 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Nov 2007 04:53:31 +0000 (04:53 +0000)
        Reviewed by Darin Adler.

        - <http://bugs.webkit.org/show_bug.cgi?id=15890>
          Most of www.aol.com still redraws unnecessarily when headline/photo section changes

        Test: fast/repaint/invisible-objects.html

        Avoid repainting invisible blocks if they are enclosed in a layer that
        contains no visible objects.

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::layoutBlock):
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::absoluteClippedOverflowRect):

LayoutTests:

        Reviewed by Darin Adler.

        - no-repaint test for <http://bugs.webkit.org/show_bug.cgi?id=15890>
          Most of www.aol.com still redraws unnecessarily when headline/photo section changes

        * fast/repaint/invisible-objects.html: Added.
        * platform/mac/fast/repaint/invisible-objects-expected.checksum: Added.
        * platform/mac/fast/repaint/invisible-objects-expected.png: Added.
        * platform/mac/fast/repaint/invisible-objects-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27743 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/repaint/invisible-objects.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/invisible-objects-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/invisible-objects-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/repaint/invisible-objects-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/rendering/RenderBlock.cpp
WebCore/rendering/RenderBox.cpp

index 867549c2052196226294e1f940657a6628c4bedd..f0e9689cf12a120c880f5efe6b3ddcfca4a0c862 100644 (file)
@@ -1,3 +1,15 @@
+2007-11-12  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        - no-repaint test for <http://bugs.webkit.org/show_bug.cgi?id=15890>
+          Most of www.aol.com still redraws unnecessarily when headline/photo section changes
+
+        * fast/repaint/invisible-objects.html: Added.
+        * platform/mac/fast/repaint/invisible-objects-expected.checksum: Added.
+        * platform/mac/fast/repaint/invisible-objects-expected.png: Added.
+        * platform/mac/fast/repaint/invisible-objects-expected.txt: Added.
+
 2007-11-12  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Adam Roben.
diff --git a/LayoutTests/fast/repaint/invisible-objects.html b/LayoutTests/fast/repaint/invisible-objects.html
new file mode 100644 (file)
index 0000000..7938bd0
--- /dev/null
@@ -0,0 +1,20 @@
+<html>
+<head>
+    <script src="repaint.js"></script>
+    <script>
+        function repaintTest()
+        {
+            document.getElementById("block").style.height = "100px";
+            document.getElementById("inline").innerText = "is invisible";
+        }
+    </script>
+</head>
+<body onload="runRepaintTest()">
+    <div style="visibility: hidden; position: relative;">
+        <span id="inline">Invisible text</span>
+    </div>
+    <div style="visibility: hidden; position: relative;">
+        <div id="block" style="height: 50px;"></div>
+    </div>
+</body>
+</html>
diff --git a/LayoutTests/platform/mac/fast/repaint/invisible-objects-expected.checksum b/LayoutTests/platform/mac/fast/repaint/invisible-objects-expected.checksum
new file mode 100644 (file)
index 0000000..16de384
--- /dev/null
@@ -0,0 +1 @@
+46831e368893e1b094013111e98d9911
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/repaint/invisible-objects-expected.png b/LayoutTests/platform/mac/fast/repaint/invisible-objects-expected.png
new file mode 100644 (file)
index 0000000..5072367
Binary files /dev/null and b/LayoutTests/platform/mac/fast/repaint/invisible-objects-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/repaint/invisible-objects-expected.txt b/LayoutTests/platform/mac/fast/repaint/invisible-objects-expected.txt
new file mode 100644 (file)
index 0000000..fbd0592
--- /dev/null
@@ -0,0 +1,5 @@
+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
index 2515036fbda05f77b4a0ac24822978bf42d76d47..00187c9c7dfa3398f5a73db5490e5c3fc16c7f95 100644 (file)
@@ -1,3 +1,20 @@
+2007-11-12  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        - <http://bugs.webkit.org/show_bug.cgi?id=15890>
+          Most of www.aol.com still redraws unnecessarily when headline/photo section changes
+
+        Test: fast/repaint/invisible-objects.html
+
+        Avoid repainting invisible blocks if they are enclosed in a layer that
+        contains no visible objects.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::layoutBlock):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::absoluteClippedOverflowRect):
+
 2007-11-12  Timothy Hatcher  <timothy@apple.com>
 
         Reviewed by Mark Rowe.
index 70cb9a3eac7008fbdcd0145a3590f0a376d9bbac..0e63c2a2f08b0b512a5cdedcdf3af5d15cbae4fe 100644 (file)
                1A7CCB250CD946FD00B7B64E /* SQLTransaction.idl in Resources */ = {isa = PBXBuildFile; fileRef = 1A7CCB230CD946FD00B7B64E /* SQLTransaction.idl */; };
                1A7CCB2E0CD9499700B7B64E /* JSSQLTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A7CCB2C0CD9499700B7B64E /* JSSQLTransaction.cpp */; };
                1A7CCB2F0CD9499700B7B64E /* JSSQLTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A7CCB2D0CD9499700B7B64E /* JSSQLTransaction.h */; };
-               F9B9A1AD0CE271DD009F992E /* ResourceResponseBase.h in Headers */ = {isa = PBXBuildFile; fileRef = F9B9A1AC0CE271DC009F992E /* ResourceResponseBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               F9B9A1AF0CE271F6009F992E /* ResourceResponseBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9B9A1AE0CE271F6009F992E /* ResourceResponseBase.cpp */; };
                1A820D910A13EBA600AF843C /* ImageDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A820D8F0A13EBA600AF843C /* ImageDocument.cpp */; };
                1A820D920A13EBA600AF843C /* ImageDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A820D900A13EBA600AF843C /* ImageDocument.h */; };
                1A85B18F0A1B18A200D8C87C /* JSHTMLHtmlElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A85B18D0A1B18A200D8C87C /* JSHTMLHtmlElement.cpp */; };
                6582A16309999D6D00BEEB6D /* SystemTimeMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6582A15509999D6D00BEEB6D /* SystemTimeMac.cpp */; };
                6582A17809999EA000BEEB6D /* DeprecatedStringMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6582A17709999EA000BEEB6D /* DeprecatedStringMac.mm */; };
                658436860AE01B7400E53753 /* FrameLoadRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 658436850AE01B7400E53753 /* FrameLoadRequest.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               F9541E5E0CE35B7800CB14EE /* ResourceResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = F9541E5D0CE35B7800CB14EE /* ResourceResponse.h */; settings = {ATTRIBUTES = (Private, ); }; };
                6588216C0AF4CE1200F01D1F /* ResourceResponseMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 658821690AF4CE1200F01D1F /* ResourceResponseMac.mm */; };
                6593923709AE4346002C531F /* KURL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6593923509AE4346002C531F /* KURL.cpp */; };
                6593923809AE4346002C531F /* KURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 6593923609AE4346002C531F /* KURL.h */; settings = {ATTRIBUTES = (Private, ); }; };
                ED501DC60B249F2900AE18D9 /* EditorMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = ED501DC50B249F2900AE18D9 /* EditorMac.mm */; };
                EDE3A5000C7A430600956A37 /* ColorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = EDE3A4FF0C7A430600956A37 /* ColorMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
                EDEC98030AED7E170059137F /* WebCorePrefix.h in Headers */ = {isa = PBXBuildFile; fileRef = EDEC98020AED7E170059137F /* WebCorePrefix.h */; };
+               F9541E5E0CE35B7800CB14EE /* ResourceResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = F9541E5D0CE35B7800CB14EE /* ResourceResponse.h */; settings = {ATTRIBUTES = (Private, ); }; };
                F971E27FD70F4382BC66D792 /* BidiContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A579C284B928484FB9A446BC /* BidiContext.cpp */; };
+               F9B9A1AD0CE271DD009F992E /* ResourceResponseBase.h in Headers */ = {isa = PBXBuildFile; fileRef = F9B9A1AC0CE271DC009F992E /* ResourceResponseBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               F9B9A1AF0CE271F6009F992E /* ResourceResponseBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F9B9A1AE0CE271F6009F992E /* ResourceResponseBase.cpp */; };
                FAE0418F097596C9000540BE /* SVGImageLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAE0418D097596C9000540BE /* SVGImageLoader.cpp */; };
                FAE04190097596C9000540BE /* SVGImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = FAE0418E097596C9000540BE /* SVGImageLoader.h */; };
 /* End PBXBuildFile section */
                1A7CCB230CD946FD00B7B64E /* SQLTransaction.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SQLTransaction.idl; sourceTree = "<group>"; };
                1A7CCB2C0CD9499700B7B64E /* JSSQLTransaction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLTransaction.cpp; sourceTree = "<group>"; };
                1A7CCB2D0CD9499700B7B64E /* JSSQLTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLTransaction.h; sourceTree = "<group>"; };
-               F9B9A1AC0CE271DC009F992E /* ResourceResponseBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ResourceResponseBase.h; sourceTree = "<group>"; };
-               F9B9A1AE0CE271F6009F992E /* ResourceResponseBase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceResponseBase.cpp; sourceTree = "<group>"; };
                1A820D8F0A13EBA600AF843C /* ImageDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ImageDocument.cpp; sourceTree = "<group>"; };
                1A820D900A13EBA600AF843C /* ImageDocument.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ImageDocument.h; sourceTree = "<group>"; };
                1A85B17D0A1B183600D8C87C /* HTMLHtmlElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLHtmlElement.idl; sourceTree = "<group>"; };
                6582A15509999D6D00BEEB6D /* SystemTimeMac.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SystemTimeMac.cpp; sourceTree = "<group>"; };
                6582A17709999EA000BEEB6D /* DeprecatedStringMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DeprecatedStringMac.mm; sourceTree = "<group>"; };
                658436850AE01B7400E53753 /* FrameLoadRequest.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FrameLoadRequest.h; sourceTree = "<group>"; };
-               F9541E5D0CE35B7800CB14EE /* ResourceResponse.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ResourceResponse.h; sourceTree = "<group>"; };
                658821690AF4CE1200F01D1F /* ResourceResponseMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = ResourceResponseMac.mm; sourceTree = "<group>"; };
                6593923509AE4346002C531F /* KURL.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = KURL.cpp; sourceTree = "<group>"; };
                6593923609AE4346002C531F /* KURL.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KURL.h; sourceTree = "<group>"; };
                F5C2869402846DCD018635CA /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
                F5C2869502846DCD018635CA /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
                F8216299029F4FB501000131 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+               F9541E5D0CE35B7800CB14EE /* ResourceResponse.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ResourceResponse.h; sourceTree = "<group>"; };
+               F9B9A1AC0CE271DC009F992E /* ResourceResponseBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ResourceResponseBase.h; sourceTree = "<group>"; };
+               F9B9A1AE0CE271F6009F992E /* ResourceResponseBase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceResponseBase.cpp; sourceTree = "<group>"; };
                FAE0418D097596C9000540BE /* SVGImageLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SVGImageLoader.cpp; sourceTree = "<group>"; };
                FAE0418E097596C9000540BE /* SVGImageLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGImageLoader.h; sourceTree = "<group>"; };
 /* End PBXFileReference section */
index f608f744b2fd21d590b2670c360088a85ea18541..39e8d42b5af5cbab805062d1a4af8cd468a6ef3f 100644 (file)
@@ -660,7 +660,7 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
     bool didFullRepaint = false;
     if (checkForRepaint)
         didFullRepaint = repaintAfterLayoutIfNeeded(oldBounds, oldOutlineBox);
-    if (!didFullRepaint && repaintTop != repaintBottom) {
+    if (!didFullRepaint && repaintTop != repaintBottom && (style()->visibility() == VISIBLE || enclosingLayer()->hasVisibleContent())) {
         IntRect repaintRect(m_overflowLeft, repaintTop, m_overflowWidth - m_overflowLeft, repaintBottom - repaintTop);
 
         // FIXME: Deal with multiple column repainting.  We have to split the repaint
index 596216424e2ca2825948becde629ac5b0af7a7ab..d8f79a30a803876102a25a501879821df93f024d 100644 (file)
@@ -927,6 +927,9 @@ void RenderBox::deleteLineBoxWrapper()
 
 IntRect RenderBox::absoluteClippedOverflowRect()
 {
+    if (style()->visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent())
+        return IntRect();
+
     IntRect r = overflowRect(false);
 
     if (RenderView* v = view())