[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

hyatt hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:44:17 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit cba80606ea36a6552c83c1342fe4c0215fc4ef9c
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jun 5 19:05:32 2003 +0000

    	Fix for 3281030, stylesheets can't be enabled properly via
    	script.  Test case from Dirk.  The fix is to make the setting
    	of the state happen independently of the attribute setting.
    
            Reviewed by john
    
            * khtml/dom/html_head.cpp:
            (HTMLLinkElement::setDisabled):
            * khtml/html/html_headimpl.cpp:
            (HTMLLinkElementImpl::setDisabledState):
            (HTMLLinkElementImpl::parseAttribute):
            * khtml/html/html_headimpl.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4488 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 0e48999..92b2719 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,18 @@
+2003-06-05  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3281030, stylesheets can't be enabled properly via
+	script.  Test case from Dirk.  The fix is to make the setting
+	of the state happen independently of the attribute setting.
+	
+        Reviewed by john
+
+        * khtml/dom/html_head.cpp:
+        (HTMLLinkElement::setDisabled):
+        * khtml/html/html_headimpl.cpp:
+        (HTMLLinkElementImpl::setDisabledState):
+        (HTMLLinkElementImpl::parseAttribute):
+        * khtml/html/html_headimpl.h:
+
 2003-06-05  Chris Blumenberg  <cblu at apple.com>
 
         Fixed: <rdar://problem/3268751>: REGRESSION: crash in KWQValueListImpl selecting connection speed at news.com
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 0e48999..92b2719 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,18 @@
+2003-06-05  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3281030, stylesheets can't be enabled properly via
+	script.  Test case from Dirk.  The fix is to make the setting
+	of the state happen independently of the attribute setting.
+	
+        Reviewed by john
+
+        * khtml/dom/html_head.cpp:
+        (HTMLLinkElement::setDisabled):
+        * khtml/html/html_headimpl.cpp:
+        (HTMLLinkElementImpl::setDisabledState):
+        (HTMLLinkElementImpl::parseAttribute):
+        * khtml/html/html_headimpl.h:
+
 2003-06-05  Chris Blumenberg  <cblu at apple.com>
 
         Fixed: <rdar://problem/3268751>: REGRESSION: crash in KWQValueListImpl selecting connection speed at news.com
diff --git a/WebCore/khtml/dom/html_head.cpp b/WebCore/khtml/dom/html_head.cpp
index 2afa520..baf5d27 100644
--- a/WebCore/khtml/dom/html_head.cpp
+++ b/WebCore/khtml/dom/html_head.cpp
@@ -115,11 +115,10 @@ bool HTMLLinkElement::disabled() const
 
 void HTMLLinkElement::setDisabled( bool _disabled )
 {
-    if (disabled() == _disabled)
-        return;
-        
-    if(impl)
+    if(impl) {
         ((ElementImpl *)impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
+        ((HTMLLinkElementImpl*)impl)->setDisabledState(_disabled);
+    }
 }
 
 DOMString HTMLLinkElement::charset() const
diff --git a/WebCore/khtml/html/html_headimpl.cpp b/WebCore/khtml/html/html_headimpl.cpp
index 02d94a7..96c07f4 100644
--- a/WebCore/khtml/html/html_headimpl.cpp
+++ b/WebCore/khtml/html/html_headimpl.cpp
@@ -127,6 +127,44 @@ NodeImpl::Id HTMLLinkElementImpl::id() const
     return ID_LINK;
 }
 
+void HTMLLinkElementImpl::setDisabledState(bool _disabled)
+{
+    int oldDisabledState = m_disabledState;
+    m_disabledState = _disabled ? 2 : 1;
+    if (oldDisabledState != m_disabledState) {
+        // If we change the disabled state while the sheet is still loading, then we have to
+        // perform three checks:
+        if (isLoading()) {
+            // Check #1: If the sheet becomes disabled while it was loading, and if it was either
+            // a main sheet or a sheet that was previously enabled via script, then we need
+            // to remove it from the list of pending sheets.
+            if (m_disabledState == 2 && (!m_alternate || oldDisabledState == 1))
+                getDocument()->stylesheetLoaded();
+
+            // Check #2: An alternate sheet becomes enabled while it is still loading.
+            if (m_alternate && m_disabledState == 1)
+                getDocument()->addPendingSheet();
+
+            // Check #3: A main sheet becomes enabled while it was still loading and
+            // after it was disabled via script.  It takes really terrible code to make this
+            // happen (a double toggle for no reason essentially).  This happens on
+            // virtualplastic.net, which manages to do about 12 enable/disables on only 3
+            // sheets. :)
+            if (!m_alternate && m_disabledState == 1 && oldDisabledState == 2)
+                getDocument()->addPendingSheet();
+
+            // If the sheet is already loading just bail.
+            return;
+        }
+
+        // Load the sheet, since it's never been loaded before.
+        if (!m_sheet && m_disabledState == 1)
+            process();
+        else
+            getDocument()->updateStyleSelector(); // Update the style selector.
+    }
+}
+
 void HTMLLinkElementImpl::parseAttribute(AttributeImpl *attr)
 {
     switch (attr->id())
@@ -147,43 +185,9 @@ void HTMLLinkElementImpl::parseAttribute(AttributeImpl *attr)
         m_media = attr->value().string().lower();
         process();
         break;
-    case ATTR_DISABLED: {
-        int oldDisabledState = m_disabledState;
-        m_disabledState = (attr->val() != 0) ? 2 : 1;
-        if (oldDisabledState != m_disabledState) {
-            // If we change the disabled state while the sheet is still loading, then we have to
-            // perform three checks:
-            if (isLoading()) {
-                // Check #1: If the sheet becomes disabled while it was loading, and if it was either
-                // a main sheet or a sheet that was previously enabled via script, then we need
-                // to remove it from the list of pending sheets.
-                if (m_disabledState == 2 && (!m_alternate || oldDisabledState == 1))
-                    getDocument()->stylesheetLoaded();
-                    
-                // Check #2: An alternate sheet becomes enabled while it is still loading.
-                if (m_alternate && m_disabledState == 1)
-                    getDocument()->addPendingSheet();
-    
-                // Check #3: A main sheet becomes enabled while it was still loading and
-                // after it was disabled via script.  It takes really terrible code to make this
-                // happen (a double toggle for no reason essentially).  This happens on
-                // virtualplastic.net, which manages to do about 12 enable/disables on only 3
-                // sheets. :)
-                if (!m_alternate && m_disabledState == 1 && oldDisabledState == 2)
-                    getDocument()->addPendingSheet();
-
-                // If the sheet is already loading just bail.
-                break;
-            }
-            
-            // Load the sheet, since it's never been loaded before.
-            if (!m_sheet && m_disabledState == 1)
-                process();
-            else
-                getDocument()->updateStyleSelector(); // Update the style selector.
-        }
+    case ATTR_DISABLED:
+        setDisabledState(attr->val() != 0);
         break;
-    }
     default:
         HTMLElementImpl::parseAttribute(attr);
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list