Title: [111948] releases/WebKitGTK/webkit-1.8

Diff

Modified: releases/WebKitGTK/webkit-1.8/LayoutTests/ChangeLog (111947 => 111948)


--- releases/WebKitGTK/webkit-1.8/LayoutTests/ChangeLog	2012-03-24 00:54:19 UTC (rev 111947)
+++ releases/WebKitGTK/webkit-1.8/LayoutTests/ChangeLog	2012-03-24 00:55:04 UTC (rev 111948)
@@ -1,3 +1,14 @@
+2012-03-23  Antti Koivisto  <[email protected]>
+
+        REGRESSION (r104060): Page contents not painted if inserting a new stylesheet and temporary body node
+        https://bugs.webkit.org/show_bug.cgi?id=76590
+
+        Reviewed by Maciej Stachowiak.
+
+        * fast/css/pending-stylesheet-repaint-expected.png: Added.
+        * fast/css/pending-stylesheet-repaint-expected.txt: Added.
+        * fast/css/pending-stylesheet-repaint.html: Added.
+
 2012-03-23  Kent Tamura  <[email protected]>
 
         REGRESSION(90089): Input type='search' text shakes up and down when the style is changed.

Added: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/css/pending-stylesheet-repaint-expected.txt (0 => 111948)


--- releases/WebKitGTK/webkit-1.8/LayoutTests/fast/css/pending-stylesheet-repaint-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-1.8/LayoutTests/fast/css/pending-stylesheet-repaint-expected.txt	2012-03-24 00:55:04 UTC (rev 111948)
@@ -0,0 +1,7 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x8
+  RenderBlock {HTML} at (0,0) size 800x8
+    RenderBody {BODY} at (8,8) size 784x0
+layer at (8,8) size 32x32
+  RenderBlock (positioned) {DIV} at (8,8) size 32x32 [bgcolor=#008000]
Property changes on: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/css/pending-stylesheet-repaint-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/css/pending-stylesheet-repaint.html (0 => 111948)


--- releases/WebKitGTK/webkit-1.8/LayoutTests/fast/css/pending-stylesheet-repaint.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-1.8/LayoutTests/fast/css/pending-stylesheet-repaint.html	2012-03-24 00:55:04 UTC (rev 111948)
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <title>Test case</title>
+</head>
+
+<body>
+  <div style="background: green; width: 32px; height: 32px; position: absolute"></div>
+
+  <script>
+    window.addEventListener(
+        'DOMContentLoaded',
+        function() {
+          // Must dynamically fetch another stylesheet
+          var el = document.createElement('link');
+          el.href = '';
+          el.type = 'text/css';
+          el.rel = 'stylesheet';
+          document.getElementsByTagName('head')[0].appendChild(el);
+
+          // Based on jQuery pre-1.6.2 code, which creates a temporary <body>
+          // element to do tests on:
+          // https://github.com/jquery/jquery/blob/304dd618b7aa17158446bedd80af330375d8d4d4/src/support.js#L138
+          // The behavior was changed for jQuery 1.6.2 with this commit:
+          // https://github.com/jquery/jquery/commit/ceba855c010c792aad8fc15edc06b86285f71142/
+          var anotherBody = document.createElement('body');
+
+          document.documentElement.insertBefore(
+              anotherBody, document.documentElement.firstChild);
+
+          // Triggering a style recalc here is necessary.
+          anotherBody.offsetHeight;
+
+          anotherBody.parentNode.removeChild(anotherBody);
+        },
+        false);
+  </script>
+</body>
+</html>
Property changes on: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/css/pending-stylesheet-repaint.html
___________________________________________________________________

Added: svn:eol-style

Modified: releases/WebKitGTK/webkit-1.8/Source/WebCore/ChangeLog (111947 => 111948)


--- releases/WebKitGTK/webkit-1.8/Source/WebCore/ChangeLog	2012-03-24 00:54:19 UTC (rev 111947)
+++ releases/WebKitGTK/webkit-1.8/Source/WebCore/ChangeLog	2012-03-24 00:55:04 UTC (rev 111948)
@@ -1,3 +1,18 @@
+2012-03-23  Antti Koivisto  <[email protected]>
+
+        REGRESSION (r104060): Page contents not painted if inserting a new stylesheet and temporary body node
+        https://bugs.webkit.org/show_bug.cgi?id=76590
+
+        Reviewed by Maciej Stachowiak.
+
+        Test: fast/css/pending-stylesheet-repaint.html
+        
+        If there has been a style recalc with a pending stylesheet, the forced repaint will need to be triggered even
+        if the stylesheet doesn't affect the rendering. Otherwise we may end up never painting at all.
+
+        * dom/Document.cpp:
+        (WebCore::Document::styleSelectorChanged):
+
 2012-03-23  Kent Tamura  <[email protected]>
 
         REGRESSION(90089): Input type='search' text shakes up and down when the style is changed.

Modified: releases/WebKitGTK/webkit-1.8/Source/WebCore/dom/Document.cpp (111947 => 111948)


--- releases/WebKitGTK/webkit-1.8/Source/WebCore/dom/Document.cpp	2012-03-24 00:54:19 UTC (rev 111947)
+++ releases/WebKitGTK/webkit-1.8/Source/WebCore/dom/Document.cpp	2012-03-24 00:55:04 UTC (rev 111948)
@@ -3040,20 +3040,21 @@
 #endif
 
     bool stylesheetChangeRequiresStyleRecalc = updateActiveStylesheets(updateFlag);
-    if (!stylesheetChangeRequiresStyleRecalc)
-        return;
 
     if (updateFlag == DeferRecalcStyle) {
         scheduleForcedStyleRecalc();
         return;
     }
-    
+
     if (didLayoutWithPendingStylesheets() && m_pendingStylesheets <= 0) {
         m_pendingSheetLayout = IgnoreLayoutWithPendingSheets;
         if (renderer())
             renderer()->repaint();
     }
 
+    if (!stylesheetChangeRequiresStyleRecalc)
+        return;
+
     // This recalcStyle initiates a new recalc cycle. We need to bracket it to
     // make sure animations get the correct update time
     if (m_frame)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to