kdelibs/khtml/html

Peter Kelly pmk at kde.org
Mon Aug 18 21:45:22 CEST 2003


On Mon, 18 Aug 2003, Dirk Mueller wrote:

> On Sam, 16 Aug 2003, Peter Kelly wrote:
> 
> > KHTML treats the disabled property as meaning "this stylesheet _can_ be 
> > used" rather than "this stylesheet _is_ used". Thus, when you set disabled
> > to false on a sheet it becomes available for use but is not actually used 
> > until the user selects the sheet from the menu.
> 
> Ok, if thats indeed the case then the implementation has to be fixed. I was 
> under the assumption from reading the Safari tree that the disabled state is 
> an additional "never use this" option. 
> 
> This will probably simplify the code. 
> 
> > > > -            if (isLoading() && m_isDisabled && (!m_alternate || m_oldisDisabled))
> > > > +            if (isLoading() && m_isDisabled)
> > > >                  getDocument()->styleSheetLoaded();
> > > 
> 
> Still doesn't explain this commit though. 

I think what happened was an alternate stylesheet was being added to the 
pending count for some reason (I'm still not sure why this is), and then 
not being decremented when it finished loading because it was marked as 
alternate. Looking at the code directly below I see this:

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

which seems wrong... it should only by added if it is _not_ disabled. 

Also, the check for m_oldisDisabled would never be true since it's 
guaranteed that m_isDisabled != m_oldisDisabled inside that block of code 
(which wasn't causing a problem in itself but it was reduntant).

I need to think about this a bit more... I'll try and put together a patch 
which fixes the stylsheet usage based on the disabled property and fixes 
this problem at the same time.

> 
> 
> 

-- 
Peter Kelly
pmk at kde.org



More information about the Khtml-devel mailing list