[new patch]

Germain Garand germain at ebooksfrance.org
Fri Nov 21 00:48:33 GMT 2003


Hi Dirk,
I'm sorry I didn't reply earlier,
days are overwhelmingly short ;(

Le Vendredi 14 Novembre 2003 17:40, Dirk Mueller a écrit :
> On Friday 14 November 2003 18:03, Germain Garand wrote:
> > mmh, Zeus, I think I just understood something... I assumed "Basic Page
> > Style" meant "No style", because that was the result, but reading the
> > code, I wonder if it wasn't intended as "Default Page Style"? 8)
>
> No, Basic Page Style means "all styles except those which are marked as
> alternate or are disabled". The default page style is not the Basic Page
> style, but the first named nondisabled style (and if its not alternate
> iirc?).

If I correctly parse your sentence 
"all styles except those which are marked as alternate or are disabled"
 then that's exactly what I meant.
 
For instance, on a page with:
- 1 preferred
- 3 persistent
- 5 alternates
- none of the above sheets are disabled

Then "Basic Page Style" should elect:  the preferred + the 3 persistents
(+ the user sheet if any, etc.)
 Do we agree on that? 

But that is not what it currently does, so the  KHTMLPart::slotUseStylesheet()
patch is still needed. I redid it with correct "basicPageStyle" variable name 
and that is attached patch #1.

Now, that doesn't solve the FOUC, so I tried with your proposal:

> Difficult. maybe its enough when recalcStyleSelector resets it when it
> encounters <body> and didn't find the currently selected alternate
> stylesheet yet. 

 and it works very well indeed. (That is attached patch #2)

I can imagine a few cases where a script would change <link> elements after 
<body> has been encountered and after a preferred sheet has been defined, but 
that would only mean losing the sticky sheet and reverting to the preferred, 
which is still correct behaviour.
This solves #63348 and some comments of #54335.

Now, I have a third proposal, that is incremental to patches #1/#2 and that 
solves all remaining issues (a.k.a, comments #7 and #3 of #54335 : khtml 
doesn't obbey to a change of the preferred stylesheet on the same page - also 
true for http://www.kde.org/media/settings.php quite ironically :-} )

See attached patch #3.

The idea is to leave the "Basic Page Style" menu entry selected at first, and 
*not* try to set the part's m_sheetUsed back to the final value from khtml 
once all the sheets are loaded.
That way, the "Basic Page Style" entry acts as the "automatic" setting, like 
for text encoding.
Now, if the user manually choose another sheet in the list, *that* choice will 
be sticky. So the final behaviour is the same, but it fixes all cases where 
the alternate sheet should have been dropped and was not.

Please review,
Germain
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stylesheet_1.diff
Type: text/x-diff
Size: 847 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20031121/bbaa1d2a/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stylesheet_2.diff
Type: text/x-diff
Size: 1370 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20031121/bbaa1d2a/attachment-0001.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stylesheet_3.diff
Type: text/x-diff
Size: 1220 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20031121/bbaa1d2a/attachment-0002.diff>


More information about the kfm-devel mailing list