stylesheet loading
David Hyatt
hyatt at apple.com
Tue Jun 3 12:48:57 CEST 2003
On Tuesday, June 3, 2003, at 02:40 AM, Dirk Mueller wrote:
> Hi,
>
> while trying to fix some of the stylesheet loading regressions that
> occurred
> after the FOUC merge, I wondered about this diff chunk in
> html/html_headimpl.cpp :
>
> - if(type.contains("text/css") || rel.contains("stylesheet")) {
> + // This was buggy and would incorrectly match <link
> rel="alternate">,
> // which has a different specified meaning. -dwh
> + if(m_disabledState != 2 && (type.contains("text/css") || rel ==
> "stylesheet" || (rel.contains("alternate") &&
> rel.contains("stylesheet"))))
>
>
> I can't see how the previous code was able to match <link
> rel="alternate">.
>
We are operating off of KDE 3.0.2 remember. In that tree, the code
looked like this.
if(type.contains("text/css") || rel == "stylesheet" ||
rel.contains("alternate"))
It looks like you later fixed it. The above would have incorrectly
matched <link rel="alternate"> (which is used for RSS files).
> My Bloatzilla (1.2.1) behaves like Konqueror previously did, i.e.
>
> <link rel="stupid stylesheet">
>
> will get loaded.
>
We could certainly relax the restriction, especially if Mozilla allows
it.
> Also, this m_disabledState handling seems quite broken to me. it
> stores a
> "modifiedbyJScript" state which is nowhere used.. Anyway, disabling is
> just
> a boolean and you cannot make a triple state from this information
> alone.
> I'm going to remove this code again as it breaks dynamic disabling of
> stylesheets.
>
The state is very much used in order to properly increment and
decrement the pending sheet count when stylesheets get enabled/disabled
dynamically prior to the page having finished loading (or even the
stylesheets having finished loading). See parseAttribute (the
ATTR_DISABLED code).
Can you give me an example of a site that's broken? That will tell me
whether there's a merge problem or a bug in the actual code in Safari.
Thanks!
dave
(hyatt at apple.com)
More information about the Khtml-devel
mailing list