[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:26:02 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit f55d1250099f1d7b890be4c49c017036c39c6cab
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Jul 22 01:55:08 2002 +0000

    Alternate stylesheet support.  Fixed numerous bugs in the handling of alternate sheets and implemented the ability to select alternate sheets per 14.3.2 of the HTML4 spec.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1621 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 4b9d9ac..894f06e 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,29 @@
+2002-07-21  David Hyatt  <hyatt at apple.com>
+
+        * khtml/html/html_headimpl.cpp:
+        (HTMLLinkElementImpl::process):
+	Fix incorrect handling of alternate stylesheets that could
+	cause KHTML to incorrectly interpret alternate representation
+	links (e.g., <link rel=alternate> to a PDF representation)) as 
+	alternate stylesheets instead.
+	
+        * khtml/xml/dom_docimpl.cpp:
+        (DocumentImpl::processHttpEquiv):
+	Add support for the selection of alternate stylesheets and
+	preferred stylesheet sets as specified in section 14.3.2 of
+	the HTML 4.0 spec.  If you want to hook up a UI to expose
+	alternate stylesheets, the back end code is ready to rock. :)
+	
+        (DocumentImpl::recalcStyleSelector):
+	Fixed a bug in recalcStyleSelector that could lead it to
+	pick an alternate stylesheet as a preferred set incorrectly
+	(thus loading alternate stylesheets when it shouldn't).  This
+	is probably the cause of bungled display on some pages with
+	alternate stylesheets (e.g., Eric Meyer's pages).
+
+	On Ian Hickson's simple import test suite, we now pass tests 35 and
+	36 (where before both were failed).
+	
 2002-07-21  Maciej Stachowiak  <mjs at apple.com>
 
         * Makefile.am: Remove products from symroots on `make clean'.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 4b9d9ac..894f06e 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,29 @@
+2002-07-21  David Hyatt  <hyatt at apple.com>
+
+        * khtml/html/html_headimpl.cpp:
+        (HTMLLinkElementImpl::process):
+	Fix incorrect handling of alternate stylesheets that could
+	cause KHTML to incorrectly interpret alternate representation
+	links (e.g., <link rel=alternate> to a PDF representation)) as 
+	alternate stylesheets instead.
+	
+        * khtml/xml/dom_docimpl.cpp:
+        (DocumentImpl::processHttpEquiv):
+	Add support for the selection of alternate stylesheets and
+	preferred stylesheet sets as specified in section 14.3.2 of
+	the HTML 4.0 spec.  If you want to hook up a UI to expose
+	alternate stylesheets, the back end code is ready to rock. :)
+	
+        (DocumentImpl::recalcStyleSelector):
+	Fixed a bug in recalcStyleSelector that could lead it to
+	pick an alternate stylesheet as a preferred set incorrectly
+	(thus loading alternate stylesheets when it shouldn't).  This
+	is probably the cause of bungled display on some pages with
+	alternate stylesheets (e.g., Eric Meyer's pages).
+
+	On Ian Hickson's simple import test suite, we now pass tests 35 and
+	36 (where before both were failed).
+	
 2002-07-21  Maciej Stachowiak  <mjs at apple.com>
 
         * Makefile.am: Remove products from symroots on `make clean'.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 4b9d9ac..894f06e 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,29 @@
+2002-07-21  David Hyatt  <hyatt at apple.com>
+
+        * khtml/html/html_headimpl.cpp:
+        (HTMLLinkElementImpl::process):
+	Fix incorrect handling of alternate stylesheets that could
+	cause KHTML to incorrectly interpret alternate representation
+	links (e.g., <link rel=alternate> to a PDF representation)) as 
+	alternate stylesheets instead.
+	
+        * khtml/xml/dom_docimpl.cpp:
+        (DocumentImpl::processHttpEquiv):
+	Add support for the selection of alternate stylesheets and
+	preferred stylesheet sets as specified in section 14.3.2 of
+	the HTML 4.0 spec.  If you want to hook up a UI to expose
+	alternate stylesheets, the back end code is ready to rock. :)
+	
+        (DocumentImpl::recalcStyleSelector):
+	Fixed a bug in recalcStyleSelector that could lead it to
+	pick an alternate stylesheet as a preferred set incorrectly
+	(thus loading alternate stylesheets when it shouldn't).  This
+	is probably the cause of bungled display on some pages with
+	alternate stylesheets (e.g., Eric Meyer's pages).
+
+	On Ian Hickson's simple import test suite, we now pass tests 35 and
+	36 (where before both were failed).
+	
 2002-07-21  Maciej Stachowiak  <mjs at apple.com>
 
         * Makefile.am: Remove products from symroots on `make clean'.
diff --git a/WebCore/khtml/html/html_headimpl.cpp b/WebCore/khtml/html/html_headimpl.cpp
index 455d3f7..8475c0e 100644
--- a/WebCore/khtml/html/html_headimpl.cpp
+++ b/WebCore/khtml/html/html_headimpl.cpp
@@ -183,7 +183,8 @@ void HTMLLinkElementImpl::process()
 #endif
 
     // Stylesheet
-    if(type.contains("text/css") || rel == "stylesheet" || rel.contains("alternate")) {
+    // This was buggy and would incorrectly match <link rel="alternate">, which has a different specified meaning.
+    if(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/xml/dom_docimpl.cpp b/WebCore/khtml/xml/dom_docimpl.cpp
index b559bd7..bca7404 100644
--- a/WebCore/khtml/xml/dom_docimpl.cpp
+++ b/WebCore/khtml/xml/dom_docimpl.cpp
@@ -1323,7 +1323,17 @@ void DocumentImpl::processHttpEquiv(const DOMString &equiv, const DOMString &con
 
     KHTMLView *v = getDocument()->view();
 
-    if(strcasecmp(equiv, "refresh") == 0 && v->part()->metaRefreshEnabled())
+    if (strcasecmp(equiv, "default-style") == 0) {
+        // The preferred style set has been overridden as per section 
+        // 14.3.2 of the HTML4.0 specification.  We need to update the
+        // sheet used variable and then update our style selector. 
+        // For more info, see the test at:
+        // http://www.hixie.ch/tests/evil/css/import/main/preferred.html
+        // -dwh
+        v->part()->d->m_sheetUsed = content.string();
+        updateStyleSelector();
+    }
+    else if(strcasecmp(equiv, "refresh") == 0 && v->part()->metaRefreshEnabled())
     {
         // get delay and url
         QString str = content.string().stripWhiteSpace();
@@ -1752,12 +1762,28 @@ void DocumentImpl::recalcStyleSelector()
                 if (!l->sheet() || l->isLoading())
                     title = QString::null;
             }
+
+	    // Get the current preferred styleset.  This is the
+	    // set of sheets that will be enabled.
             QString sheetUsed = view()->part()->d->m_sheetUsed;
+
+	    // Check to see if this sheet belongs to a styleset
+	    // (thus making it PREFERRED or ALTERNATE rather than
+	    // PERSISTENT).
             if ( !title.isEmpty() ) {
-                if ( sheetUsed.isEmpty() )
-                    sheetUsed = view()->part()->d->m_sheetUsed = title;
-                if ( !m_availableSheets.contains( title ) )
-                    m_availableSheets.append( title );
+	        // 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 (!rel.contains("alternate")) {
+                      sheetUsed = view()->part()->d->m_sheetUsed = title;
+                      if ( !m_availableSheets.contains( title ) )
+                          m_availableSheets.append( title );
+		  }
+		}
             }
             if ( n->id() == ID_LINK ) {
                 if (title.isEmpty() || title == sheetUsed)
@@ -1765,7 +1791,7 @@ void DocumentImpl::recalcStyleSelector()
             }
             else
                 // <STYLE> element
-                sheet = static_cast<HTMLStyleElementImpl*>(n)->sheet();
+	        sheet = static_cast<HTMLStyleElementImpl*>(n)->sheet();
 	}
 	else if (n->id() == ID_BODY) {
             // <BODY> element (doesn't contain styles as such but vlink="..." and friends

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list