Bug 54335 - Konqueror 3.1: first alternate CSS stylesheet replaces default stylesheet. Javascript can't change style
Summary: Konqueror 3.1: first alternate CSS stylesheet replaces default stylesheet. Ja...
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml renderer (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR major
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-09 13:49 UTC by Magnus Kessler
Modified: 2003-11-25 02:02 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Kessler 2003-02-09 13:49:10 UTC
Version:            (using KDE KDE 3.1)
Installed from:    Compiled From Sources
Compiler:          gcc (GCC) 3.2 
OS:          Linux

Konqueror uses the first alternate stylesheet instead of the default stylesheet on all (new, after the redesign) pages of http://www.wired.com/. The stylesheets are imported via a section of <link>s looking like this:

<link rel="stylesheet" type="text/css" media="screen" href="http://a1112.g.akamai.net/7/1112/492/2002091423/www.wired.com/news/v/20020914/css/cs6/wnScreen.css" />
<link rel="stylesheet" type="text/css" media="aural,braille,embossed" href="http://a1112.g.akamai.net/7/1112/492/2002091423/www.wired.com/news/v/20020914/css/wnOther.css" />
<link rel="stylesheet" type="text/css" media="print" href="http://a1112.g.akamai.net/7/1112/492/2002091423/www.wired.com/news/v/20020914/css/wnPrint.css" />
<link rel="alternate stylesheet" type="text/css" media="screen,print" href="http://a1112.g.akamai.net/7/1112/492/2002091423/www.wired.com/news/v/20020914/css/wnSm.css" title="Small Text" />
<link rel="alternate stylesheet" type="text/css" media="screen,print" href="http://a1112.g.akamai.net/7/1112/492/2002091423/www.wired.com/news/v/20020914/css/wnLg.css" title="Large Text" />
<link rel="alternate stylesheet" type="text/css" media="screen,print" href="http://a1112.g.akamai.net/7/1112/492/2002091423/www.wired.com/news/v/20020914/css/wnLg2.css" title="Larger Text" />

Mozilla shows 4 available styles in its menu: "Basic Stylesheet", "Small Text", "Large Text" and "Larger Text". Konqueror only the last three. Konqueror switches by default to "Small Text", while Mozilla stays with the "Basic Stylesheet".

A similar behaviour can be observed on http://www.alistapart.com/.

Both pages also offers style switching via JavaScript. This has no effect at all.
Comment 1 Alejandro Exojo 2003-05-23 03:27:47 UTC
I can confirm the same wrong behaviour of khtml, with 3.1.2. 
 
An easy example is in: 
http://www.w3.org/Style 
 
Konqueror loads "blue shadows" by default, but it shouldn't, because that's an alternate 
stylesheet (it's the first stylesheet linked, but that fact, must be ignored). The default 
selected stylesheet, must be "Gold (right, fixed) + navbar", which has the "stylesheet" 
value for "rel" attribute. 
 
The explanation is in the specification ;-) : 
http://www.w3.org/TR/1999/REC-html401-19991224/present/styles.html#style-external 
 
Comment 2 Kai Lahmann 2003-06-14 18:06:01 UTC
both examples wfm. 
Comment 3 Olivier LAHAYE 2003-08-24 10:12:18 UTC
I can confirm the same behaviour (style change has no effect) with 
http://frenchmozilla.org and konqueror 3.1.3 (from kdebase-3.1.3-4tex) 
Comment 4 Jesse 2003-09-06 20:50:00 UTC
This is odd.  With Konq cvs the  http://www.w3.org/Style page works as intended 
and you can switch between the sheets fine. 
 
However, like in bug: 63348, if you go to www.kde.org first and then to w3's style 
page, the style sheets do not get 'chosen' correctly.  You still have the ability to view 
and choose each of them, but the first one that gets loaded is "Basic Page Style" -- 
this is the first one in the list -- not the desired "Gold (right, fixed) + navbar" style. 
 
Seems that it's a matter of Konqueror not selecting the correct style sheet when 
more than one is available. 
Comment 5 Jon Dowland 2003-09-19 14:23:00 UTC
I think this is related. http://toast.debian.net/~jmtd/konq/index.html 
 
This test page has two link tags - the first is an alternate stylesheet, the second a normal 
stylesheet. Konqueror opts for the former rather than the latter. It appears konq does not 
make a distinction between alternate stylesheet and stylesheet, and opts for the first one it 
comes across in the source. 
Comment 6 Matteo 2003-09-27 00:48:08 UTC
Same wrong behaviour of khtml with 3.1.4 on GentooLinux
Comment 7 Sebastian Sauer 2003-10-22 01:48:39 UTC
I could confirm this bug with kde 3.1.4 and KDE-HEAD from 03/10/19 as well. For an example see http://www.dipe.org - just switch there the styles at the top right...
Comment 8 Sebastian Sauer 2003-11-18 16:20:04 UTC
With cvs-head from yesterday there seems to be still some bigger css-problems. As example just take a lookat the url given above with konqi and with moz. I guess this bug is really somewhat major cause there are more and more pages using css in replacment for blind tables, so I mark it as major :-)
Comment 9 Germain Garand 2003-11-25 02:02:45 UTC
Subject: kdelibs/khtml

CVS commit by ggarand: 

- as discussed on kfm-devel: add an Automatic Detection mode  in the 
  "Use Stylesheet" menu. In this mode, the preferred sheet is chosen 
  by the document, following the standard rules of precedence. 
  If another sheet is manually chosen, then it gains a higher precedence
  and overrides the document's choice, thus becoming "sticky".
  
- for manually chosen sheets: if the wanted stylesheet is still missing after
  <body> has been parsed, choose the document's preferred stylesheet until
  parsing ends(#63348).

CCMAIL: 54335-done@bugs.kde.org
CCMAIL: 63348-done@bugs.kde.org


  M +11 -0     ChangeLog   1.112
  M +8 -4      khtml_part.cpp   1.943
  M +9 -4      xml/dom_docimpl.cpp   1.264