[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 06:49:16 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit a59ddd5e804b9cb53626a9c8235e2e2a3e56b648
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Oct 14 07:19:35 2002 +0000

    	Implementing the ability to individually enable/disable
    	both preferred and alternate stylesheets.  Enabling/disabling
    	sheets via the disabled property of the <link> element overrides
    	whether or not a sheet happens to be alternate or preferred.
    
    	This new implementation of sheet disabling/enabling was a missing
    	piece of our HTML4 compliance, and was used by the Wired
    	site to implement its text sizing mechanism.
    
            * khtml/html/html_headimpl.cpp:
            (HTMLLinkElementImpl::HTMLLinkElementImpl):
            (HTMLLinkElementImpl::parseAttribute):
            (HTMLLinkElementImpl::process):
            * khtml/html/html_headimpl.h:
            * khtml/xml/dom_docimpl.cpp:
            (DocumentImpl::recalcStyleSelector):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2314 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index d0029eb..9915257 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,22 @@
+2002-10-14  David Hyatt  <hyatt at apple.com>
+
+	Implementing the ability to individually enable/disable
+	both preferred and alternate stylesheets.  Enabling/disabling
+	sheets via the disabled property of the <link> element overrides
+	whether or not a sheet happens to be alternate or preferred.
+
+	This new implementation of sheet disabling/enabling was a missing
+	piece of our HTML4 compliance, and was used by the Wired 
+	site to implement its text sizing mechanism.
+	
+        * khtml/html/html_headimpl.cpp:
+        (HTMLLinkElementImpl::HTMLLinkElementImpl):
+        (HTMLLinkElementImpl::parseAttribute):
+        (HTMLLinkElementImpl::process):
+        * khtml/html/html_headimpl.h:
+        * khtml/xml/dom_docimpl.cpp:
+        (DocumentImpl::recalcStyleSelector):
+
 2002-10-11  Richard Williamson   <rjw at apple.com>
 
         Remove debugging.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index d0029eb..9915257 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,22 @@
+2002-10-14  David Hyatt  <hyatt at apple.com>
+
+	Implementing the ability to individually enable/disable
+	both preferred and alternate stylesheets.  Enabling/disabling
+	sheets via the disabled property of the <link> element overrides
+	whether or not a sheet happens to be alternate or preferred.
+
+	This new implementation of sheet disabling/enabling was a missing
+	piece of our HTML4 compliance, and was used by the Wired 
+	site to implement its text sizing mechanism.
+	
+        * khtml/html/html_headimpl.cpp:
+        (HTMLLinkElementImpl::HTMLLinkElementImpl):
+        (HTMLLinkElementImpl::parseAttribute):
+        (HTMLLinkElementImpl::process):
+        * khtml/html/html_headimpl.h:
+        * khtml/xml/dom_docimpl.cpp:
+        (DocumentImpl::recalcStyleSelector):
+
 2002-10-11  Richard Williamson   <rjw at apple.com>
 
         Remove debugging.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index d0029eb..9915257 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,22 @@
+2002-10-14  David Hyatt  <hyatt at apple.com>
+
+	Implementing the ability to individually enable/disable
+	both preferred and alternate stylesheets.  Enabling/disabling
+	sheets via the disabled property of the <link> element overrides
+	whether or not a sheet happens to be alternate or preferred.
+
+	This new implementation of sheet disabling/enabling was a missing
+	piece of our HTML4 compliance, and was used by the Wired 
+	site to implement its text sizing mechanism.
+	
+        * khtml/html/html_headimpl.cpp:
+        (HTMLLinkElementImpl::HTMLLinkElementImpl):
+        (HTMLLinkElementImpl::parseAttribute):
+        (HTMLLinkElementImpl::process):
+        * khtml/html/html_headimpl.h:
+        * khtml/xml/dom_docimpl.cpp:
+        (DocumentImpl::recalcStyleSelector):
+
 2002-10-11  Richard Williamson   <rjw at apple.com>
 
         Remove debugging.
diff --git a/WebCore/khtml/html/html_headimpl.cpp b/WebCore/khtml/html/html_headimpl.cpp
index 58c0d44..4878280 100644
--- a/WebCore/khtml/html/html_headimpl.cpp
+++ b/WebCore/khtml/html/html_headimpl.cpp
@@ -112,6 +112,7 @@ HTMLLinkElementImpl::HTMLLinkElementImpl(DocumentPtr *doc)
     m_loading = false;
     m_cachedSheet = 0;
     m_alternate = false;
+    m_disabledState = 0;
 }
 
 HTMLLinkElementImpl::~HTMLLinkElementImpl()
@@ -131,7 +132,7 @@ void HTMLLinkElementImpl::parseAttribute(AttributeImpl *attr)
     {
     case ATTR_REL:
         m_rel = attr->value();
-	process();
+        process();
         break;
     case ATTR_HREF:
         m_url = getDocument()->completeURL( khtml::parseURL(attr->value()).string() );
@@ -143,11 +144,15 @@ void HTMLLinkElementImpl::parseAttribute(AttributeImpl *attr)
         break;
     case ATTR_MEDIA:
         m_media = attr->value().string().lower();
-	process();
+        process();
         break;
-    case ATTR_DISABLED:
-        // ###
+    case ATTR_DISABLED: {
+        int oldDisabledState = m_disabledState;
+        m_disabledState = (attr->val() != 0) ? 2 : 1;
+        if (oldDisabledState != m_disabledState)
+            process();
         break;
+    }
     default:
         HTMLElementImpl::parseAttribute(attr);
     }
@@ -156,7 +161,7 @@ void HTMLLinkElementImpl::parseAttribute(AttributeImpl *attr)
 void HTMLLinkElementImpl::process()
 {
     if (!inDocument())
-	return;
+        return;
 
     QString type = m_type.string().lower();
     QString rel = m_rel.string().lower();
@@ -180,7 +185,7 @@ void HTMLLinkElementImpl::process()
 
     // Stylesheet
     // This was buggy and would incorrectly match <link rel="alternate">, which has a different specified meaning. -dwh
-    if(type.contains("text/css") || rel == "stylesheet" || (rel.contains("alternate") && rel.contains("stylesheet"))) {
+    if(m_disabledState != 2 && (type.contains("text/css") || rel == "stylesheet" || (rel.contains("alternate") && rel.contains("stylesheet")))) {
         // no need to load style sheets which aren't for the screen output
         // ### there may be in some situations e.g. for an editor or script to manipulate
         if( m_media.isNull() || m_media.contains("screen") || m_media.contains("all") || m_media.contains("print") ) {
diff --git a/WebCore/khtml/html/html_headimpl.h b/WebCore/khtml/html/html_headimpl.h
index 00aec62..c371b95 100644
--- a/WebCore/khtml/html/html_headimpl.h
+++ b/WebCore/khtml/html/html_headimpl.h
@@ -89,7 +89,9 @@ public:
     bool isLoading() const;
     void sheetLoaded();
 
-    bool isAlternate() const { return m_alternate; }
+    bool isAlternate() const { return m_disabledState == 0 && m_alternate; }
+    bool isDisabled() const { return m_disabledState == 2; }
+    bool isEnabledViaScript() const { return m_disabledState == 1; }
     
 protected:
     khtml::CachedCSSStyleSheet *m_cachedSheet;
@@ -98,6 +100,7 @@ protected:
     DOMString m_type;
     QString m_media;
     DOMString m_rel;
+    int m_disabledState; // 0=unset(default), 1=enabled via script, 2=disabled
     bool m_loading;
     bool m_alternate;
     QString m_data; // needed for temporarily storing the loaded style sheet data
diff --git a/WebCore/khtml/xml/dom_docimpl.cpp b/WebCore/khtml/xml/dom_docimpl.cpp
index 6f0f12d..d71cde2 100644
--- a/WebCore/khtml/xml/dom_docimpl.cpp
+++ b/WebCore/khtml/xml/dom_docimpl.cpp
@@ -1859,17 +1859,19 @@ void DocumentImpl::recalcStyleSelector()
         else if (n->id() == ID_LINK || n->id() == ID_STYLE) {
             ElementImpl *e = static_cast<ElementImpl *>(n);
             QString title = e->getAttribute( ATTR_TITLE ).string();
+            bool enabledViaScript = false;
             if (n->id() == ID_LINK) {
                 // <LINK> element
                 HTMLLinkElementImpl* l = static_cast<HTMLLinkElementImpl*>(n);
-		if (l->isLoading())
-		  continue;
-		if (!l->sheet())
+                if (l->isLoading() || l->isDisabled())
+                    continue;
+                if (!l->sheet())
                     title = QString::null;
+                enabledViaScript = l->isEnabledViaScript();
             }
 
-	    // Get the current preferred styleset.  This is the
-	    // set of sheets that will be enabled.
+            // Get the current preferred styleset.  This is the
+            // set of sheets that will be enabled.
             QString sheetUsed = view()->part()->d->m_sheetUsed;
             if ( n->id() == ID_LINK )
                 sheet = static_cast<HTMLLinkElementImpl*>(n)->sheet();
@@ -1877,40 +1879,41 @@ void DocumentImpl::recalcStyleSelector()
                 // <STYLE> element
                 sheet = static_cast<HTMLStyleElementImpl*>(n)->sheet();
 
-	    // Check to see if this sheet belongs to a styleset
-	    // (thus making it PREFERRED or ALTERNATE rather than
-	    // PERSISTENT).
-            if ( !title.isEmpty() ) {
-	        // Yes, we have a title.
-	      if ( sheetUsed.isEmpty() ) {
-		  // No preferred set has been established.  If
-		  // we are NOT an alternate sheet, then establish
-		  // us as the preferred set.  Otherwise, just ignore
-		  // this sheet.
-		  QString rel = e->getAttribute( ATTR_REL ).string();
-		  if (n->id() == ID_STYLE || !rel.contains("alternate")) {
-                      sheetUsed = view()->part()->d->m_sheetUsed = title;
-                      m_preferredStylesheetSet = sheetUsed;
-                  }
-              }
+            // Check to see if this sheet belongs to a styleset
+            // (thus making it PREFERRED or ALTERNATE rather than
+            // PERSISTENT).
+            if (!enabledViaScript && !title.isEmpty()) {
+                // Yes, we have a title.
+                if (sheetUsed.isEmpty()) {
+                    // No preferred set has been established.  If
+                    // we are NOT an alternate sheet, then establish
+                    // us as the preferred set.  Otherwise, just ignore
+                    // this sheet.
+                    QString rel = e->getAttribute( ATTR_REL ).string();
+                    if (n->id() == ID_STYLE || !rel.contains("alternate")) {
+                        sheetUsed = view()->part()->d->m_sheetUsed = title;
+                        m_preferredStylesheetSet = sheetUsed;
+                    }
+                }
                       
-              if ( !m_availableSheets.contains( title ) )
-                  m_availableSheets.append( title );
-		      
-              if (title != sheetUsed)
-                  sheet = 0;
+                if (!m_availableSheets.contains( title ) )
+                    m_availableSheets.append( title );
+                
+                if (title != sheetUsed)
+                    sheet = 0;
             }
         }
-	else if (n->id() == ID_BODY) {
-            // <BODY> element (doesn't contain styles as such but vlink="..." and friends
-            // are treated as style declarations)
-	    sheet = static_cast<HTMLBodyElementImpl*>(n)->sheet();
+        else if (n->id() == ID_BODY) {
+                // <BODY> element (doesn't contain styles as such but vlink="..." and friends
+                // are treated as style declarations)
+            sheet = static_cast<HTMLBodyElementImpl*>(n)->sheet();
         }
+            
         if (sheet) {
             sheet->ref();
             m_styleSheets->styleSheets.append(sheet);
         }
-
+    
         // For HTML documents, stylesheets are not allowed within/after the <BODY> tag. So we
         // can stop searching here.
         if (isHTMLDocument() && n->id() == ID_BODY)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list