LayoutTests:
authorbeidson <beidson@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Nov 2006 02:11:54 +0000 (02:11 +0000)
committerbeidson <beidson@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Nov 2006 02:11:54 +0000 (02:11 +0000)
        Reviewed and landed by Brady

        Testcase for:
        http://bugs.webkit.org/show_bug.cgi?id=11590
        Bug 11590: REGRESSION (r17726-r17742): Wikipedia page intermittently loads but doesn't render

        * fast/css/import-rule-regression-11590-expected.txt: Added.
        * fast/css/import-rule-regression-11590.html: Added.
        * fast/css/resources/imports.css: Added.
        * fast/css/resources/style.css: Added.

WebCore:

        Reviewed and landed by Brady

        Fixes http://bugs.webkit.org/show_bug.cgi?id=11590 -
        REGRESSION (r17726-r17742): Wikipedia page intermittently loads but doesn't render
        Fix the regression by setting m_loadCompleted correctly.

        * css/CSSStyleSheet.cpp:
        (WebCore::CSSStyleSheet::checkLoaded):
        * dom/Node.h:
        (WebCore::Node::sheetLoaded):
        * dom/ProcessingInstruction.cpp:
        (WebCore::ProcessingInstruction::sheetLoaded):
        * dom/ProcessingInstruction.h:
        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::sheetLoaded):
        * html/HTMLLinkElement.h:
        * html/HTMLStyleElement.cpp:
        (WebCore::HTMLStyleElement::sheetLoaded):
        * html/HTMLStyleElement.h:

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

14 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/import-rule-regression-11590-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/import-rule-regression-11590.html [new file with mode: 0644]
LayoutTests/fast/css/resources/imports.css [new file with mode: 0644]
LayoutTests/fast/css/resources/style.css [new file with mode: 0644]
WebCore/ChangeLog
WebCore/css/CSSStyleSheet.cpp
WebCore/dom/Node.h
WebCore/dom/ProcessingInstruction.cpp
WebCore/dom/ProcessingInstruction.h
WebCore/html/HTMLLinkElement.cpp
WebCore/html/HTMLLinkElement.h
WebCore/html/HTMLStyleElement.cpp
WebCore/html/HTMLStyleElement.h

index 0de0df21d9cd9f1a5fb915fce16b9774b06e344c..ea61fb3d4ca3ff5fb460df40db4b1fcb6cf8bb5e 100644 (file)
@@ -1,3 +1,16 @@
+2006-11-16  Rob Buis  <buis@kde.org>
+
+        Reviewed and landed by Brady
+
+        Testcase for:
+        http://bugs.webkit.org/show_bug.cgi?id=11590
+        Bug 11590: REGRESSION (r17726-r17742): Wikipedia page intermittently loads but doesn't render
+
+        * fast/css/import-rule-regression-11590-expected.txt: Added.
+        * fast/css/import-rule-regression-11590.html: Added.
+        * fast/css/resources/imports.css: Added.
+        * fast/css/resources/style.css: Added.
+
 2006-11-15  Adele Peterson  <adele@apple.com>
 
         Reviewed by Adam.
diff --git a/LayoutTests/fast/css/import-rule-regression-11590-expected.txt b/LayoutTests/fast/css/import-rule-regression-11590-expected.txt
new file mode 100644 (file)
index 0000000..6b72634
--- /dev/null
@@ -0,0 +1,18 @@
+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
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 53x18
+          text run at (0,0) width 53: "Test for "
+        RenderInline {A} at (0,0) size 68x18 [color=#0000EE]
+          RenderText {#text} at (53,0) size 68x18
+            text run at (53,0) width 68: "bug 11590"
+        RenderText {#text} at (121,0) size 569x18
+          text run at (121,0) width 569: ": REGRESSION (r17726-r17742): Wikipedia page intermittently loads but doesn't render."
+      RenderBlock {P} at (0,34) size 784x36
+        RenderText {#text} at (0,0) size 750x36
+          text run at (0,0) width 750: "All four sides of the square below should be present for this test to really pass, and WebKit shouldn't crash for it to pass"
+          text run at (0,18) width 55: "partially."
+      RenderBlock {DIV} at (0,86) size 106x106 [border: (3px solid #000000)]
diff --git a/LayoutTests/fast/css/import-rule-regression-11590.html b/LayoutTests/fast/css/import-rule-regression-11590.html
new file mode 100644 (file)
index 0000000..8c9c1da
--- /dev/null
@@ -0,0 +1,7 @@
+<p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=11590">bug 11590</a>:
+REGRESSION (r17726-r17742): Wikipedia page intermittently loads but doesn't render.</p>
+<p>All four sides of the square below should be present for this test to really pass,
+and WebKit shouldn't crash for it to pass partially.</p>
+<link rel="stylesheet" type="text/css" href="resources/style.css">
+<link rel="stylesheet" type="text/css" href="resources/imports.css">
+<div style="border-top: solid; width: 100px; height: 100px;"></div>
diff --git a/LayoutTests/fast/css/resources/imports.css b/LayoutTests/fast/css/resources/imports.css
new file mode 100644 (file)
index 0000000..d778363
--- /dev/null
@@ -0,0 +1,3 @@
+@import "style.css";
+@import "data:text/css,div { border-right: solid; }";
+div { border-bottom: solid; }
diff --git a/LayoutTests/fast/css/resources/style.css b/LayoutTests/fast/css/resources/style.css
new file mode 100644 (file)
index 0000000..da9bf3b
--- /dev/null
@@ -0,0 +1 @@
+div { border-left: solid; }
index 46348d5bca1f512d7ca413ebc8ee03a4aa2cffd1..f7068bb4618ce5bb738c7a6b7c19f131b449f260 100644 (file)
@@ -1,3 +1,25 @@
+2006-11-16  Rob Buis  <buis@kde.org>
+
+        Reviewed and landed by Brady
+
+        Fixes http://bugs.webkit.org/show_bug.cgi?id=11590 -
+        REGRESSION (r17726-r17742): Wikipedia page intermittently loads but doesn't render
+        Fix the regression by setting m_loadCompleted correctly.
+
+        * css/CSSStyleSheet.cpp:
+        (WebCore::CSSStyleSheet::checkLoaded):
+        * dom/Node.h:
+        (WebCore::Node::sheetLoaded):
+        * dom/ProcessingInstruction.cpp:
+        (WebCore::ProcessingInstruction::sheetLoaded):
+        * dom/ProcessingInstruction.h:
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::sheetLoaded):
+        * html/HTMLLinkElement.h:
+        * html/HTMLStyleElement.cpp:
+        (WebCore::HTMLStyleElement::sheetLoaded):
+        * html/HTMLStyleElement.h:
+
 2006-11-16  David Harrison  <harrison@apple.com>
 
         Reviewed by Beth.
index 76338e43846bb2131fc1f6b162ecaf07aba8a681..c8ed032e6fcedb99f457f29d2b6df60243cdd84e 100644 (file)
@@ -170,9 +170,7 @@ void CSSStyleSheet::checkLoaded()
         return;
     if (parent())
         parent()->checkLoaded();
-    if (m_parentNode)
-        m_parentNode->sheetLoaded();
-    m_loadCompleted = true;
+    m_loadCompleted = m_parentNode ? m_parentNode->sheetLoaded() : true;
 }
 
 DocLoader *CSSStyleSheet::docLoader()
index 0f56e8b29859810d59661788165558a61b2d5a01..506404145f4dd2e6e4bf669b26614e9bf2df7c85 100644 (file)
@@ -202,7 +202,7 @@ public:
     virtual void aboutToUnload() { }
 
     // For <link> and <style> elements.
-    virtual void sheetLoaded() { }
+    virtual bool sheetLoaded() { return true; }
 
     bool hasID() const { return m_hasId; }
     bool hasClass() const { return m_hasClass; }
index 526f6726b1306aeb3a5b099d960694c40ea7d540..481b6bf7a678d7378e45357191b808776ae6d6d3 100644 (file)
@@ -189,10 +189,13 @@ bool ProcessingInstruction::isLoading() const
     return m_sheet->isLoading();
 }
 
-void ProcessingInstruction::sheetLoaded()
+bool ProcessingInstruction::sheetLoaded()
 {
-    if (!isLoading())
+    if (!isLoading()) {
         document()->stylesheetLoaded();
+    return true;
+    }
+    return false;
 }
 
 void ProcessingInstruction::setCSSStyleSheet(const String &url, const String& charset, const String &sheet)
index df94faed19092ae818add2d24bb63d2b469bd511..6e01814921391c0707edcd98565f93baebe39f38 100644 (file)
@@ -62,7 +62,7 @@ public:
 #endif
     void setCSSStyleSheet(CSSStyleSheet*);
     bool isLoading() const;
-    void sheetLoaded();
+    virtual bool sheetLoaded();
     virtual String toString() const;
 
 #ifdef XSLT_SUPPORT
index 596c4e59bb262504fbd89f30a5cf0fa597573b2d..a34035d310dba3bb2115ccf3acc5581f91d632c9 100644 (file)
@@ -235,10 +235,13 @@ bool HTMLLinkElement::isLoading() const
     return static_cast<CSSStyleSheet *>(m_sheet.get())->isLoading();
 }
 
-void HTMLLinkElement::sheetLoaded()
+bool HTMLLinkElement::sheetLoaded()
 {
-    if (!isLoading() && !isDisabled() && !isAlternate())
+    if (!isLoading() && !isDisabled() && !isAlternate()) {
         document()->stylesheetLoaded();
+        return true;
+    }
+    return false;
 }
 
 bool HTMLLinkElement::isURLAttribute(Attribute *attr) const
index b087a619412bbbc3c69e1d801abefa1889cec88a..4b00865527783042f6b808993ad9f9fcdc85ebb8 100644 (file)
@@ -81,7 +81,7 @@ public:
     // from CachedResourceClient
     virtual void setCSSStyleSheet(const String &url, const String& charset, const String &sheet);
     bool isLoading() const;
-    void sheetLoaded();
+    virtual bool sheetLoaded();
 
     bool isAlternate() const { return m_disabledState == 0 && m_alternate; }
     bool isDisabled() const { return m_disabledState == 2; }
index d6d265884deb8ad5243d392970bf15d01294201f..f12a968844a7d723aea0809975f01a161f4b5ab0 100644 (file)
@@ -111,10 +111,13 @@ bool HTMLStyleElement::isLoading() const
     return static_cast<CSSStyleSheet *>(m_sheet.get())->isLoading();
 }
 
-void HTMLStyleElement::sheetLoaded()
+bool HTMLStyleElement::sheetLoaded()
 {
-    if (!isLoading())
+    if (!isLoading()) {
         document()->stylesheetLoaded();
+        return true;
+    }
+    return false;
 }
 
 bool HTMLStyleElement::disabled() const
index b5aedc185dcda6dd92e1fa3d96f21c0cf5318242..39ab8989e27b2601dbc8a804c63f7f58fea2c172 100644 (file)
@@ -47,7 +47,7 @@ public:
     virtual void childrenChanged();
 
     bool isLoading() const;
-    void sheetLoaded();
+    virtual bool sheetLoaded();
 
     bool disabled() const;
     void setDisabled(bool);