[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Margins and Stylesheets in khtml
From:       Michael =?iso-8859-1?q?H=E4ckel?= <haeckel () kde ! org>
Date:       2002-02-23 15:15:00
[Download RAW message or body]

Hi,

I currently try to fix the print margins problem and Slashdot and other pages 
that manually set the margin to zero, which was introduced by my change to 
measure the margins from the border of the paper instead of the printable 
area and define them in the default stylesheet.

I think the proper way to do define a print margin is using CSS2
@page { margin:2cm }

currently it is done by
@media print { body { margin:2cm } }

The latter has the disadvantage, that the page can override it even with a not 
printing specific definition. The first one is definitely paged media only 
and therefore doesn't have such a problem and also the real CSS2 way of 
defining a print margin.

My problem is now, how do I find out in KHTHMLView::print(), what is defined 
as @page rule?

I tried to iterate over all style definitions and looking for someting like:
m_part->document().styleSheets().item(nnn).cssRules().item(zzz).type() == 
CSSRule::PAGE_RULE

The problem is, that this does only iterate over the the style sheets that are 
actually in the HMTL code and not also over the khtml default style sheet. 
Also the @page rule is not shown. There is some code for @page in 
css/cssparser.cpp, but somehow it looks incomplete.

Thanks for any suggestions.

Regards,
Michael Häckel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic