[patch + test-case] problems with stylesheets + ecma

Luís Pedro Coelho luis at luispedro.org
Sat Nov 15 14:16:18 GMT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Le Friday 14 November 2003 17:42, Dirk Mueller a écrit :
> Wrong. we must not register alternate stylesheets.

Even if they are explicitly set to be enabled (ie not disabled) by script?
The current code does:

<code>

// If we change the disabled state
//  while the sheet is still loading, then we have to
// perform two checks:

// 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 (isLoading() && m_isDisabled)
                getDocument()->styleSheetLoaded();

// Check #2: An alternate sheet becomes enabled while it is still loading.
if (isLoading() && m_alternate && m_isDisabled)
	getDocument()->addPendingSheet();

</code>

Which seems rather overcomplicated to me (the checks are almost the same, 
isn't the second one supposed to read "!m_isDisabled" ?).

Besides, if m_alternate is true, I believe this leads to a straight assertion 
failure on the first styleSheetLoaded() - by setting disabled to true - since 
there was never a matching addPendingSheet().

I can rewrite the patch to keep the above logic as it is, but still avoid an 
assertion failure on some pages by calling the removeRegistered()/
addRegistered() instead of directly calling addPending()/styleSheetLoaded(). 

Still, the logic looks broken to me.

Regards,
- -- 
Luis Pedro Coelho

The carrot tax, see:
http://luispedro.org/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE/tjU5GpBAvyRwXdgRAs5uAJ9L6ELK2pl56qzcIG7LJM9URDhikQCeOzKV
Evb/FrD7oLrwJB1fW36URRs=
=3nfa
-----END PGP SIGNATURE-----




More information about the kfm-devel mailing list