Bug 68930 - CSS property page-break-[before/after/inside] isn't supported for printing
Summary: CSS property page-break-[before/after/inside] isn't supported for printing
Status: RESOLVED DUPLICATE of bug 57803
Alias: None
Product: konqueror
Classification: Applications
Component: khtml printing (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-24 13:20 UTC by Tomas Simonaitis
Modified: 2011-06-19 23:54 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
HTML test page for page-break-inside, <div>s and <p>s (10.68 KB, text/html)
2005-02-06 18:22 UTC, Nicolas Girard
Details
br tag with page-break-after (297 bytes, text/html)
2005-05-28 13:31 UTC, missive
Details
page-break-before and page-break-after css page (422 bytes, text/html)
2005-08-17 01:47 UTC, missive
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Simonaitis 2003-11-24 13:20:12 UTC
Version:            (using KDE KDE 3.1.4)
Installed from:    Debian testing/unstable Packages

CSS properties page-break-after (-before, -inside) should insert page break when printing html.
This works with mozilla/opera, but doesn't seem to be supported by khtml.

Simple example page: http://www.chamisplace.com/dl/tips/052898I/pgbreak.htm
Comment 1 Stephan Kulow 2003-11-26 10:42:52 UTC
printing isn't khtml's biggest strength ;(
Comment 2 Luke-Jr 2003-12-10 20:37:44 UTC
Note that the example page lacks a semicolon at the end of the CSS line, which might make it invalid. KHTML doesn't support this even when it is valid, though. :(
Comment 3 Dylan Mills 2004-01-23 20:01:22 UTC
I have the same issue, does anyone know if this will be fixed in 3.2?  
Comment 4 Allan Sandfeld 2004-10-07 14:53:25 UTC
CVS commit by carewolf: 

WebCore/125-merge of page-break-before, -after and -inside attributes.

CCMAIL: 68930-done@bugs.kde.org


  M +18 -8     ChangeLog   1.291
  M +11 -3     khtmlview.cpp   1.666
  M +48 -2     css/cssstyleselector.cpp   1.317
  M +31 -1     rendering/render_block.cpp   1.43
  M +2 -0      rendering/render_block.h   1.18
  M +25 -0     rendering/render_canvas.cpp   1.153
  M +6 -8      rendering/render_canvas.h   1.56
  M +1 -1      rendering/render_list.cpp   1.96
  M +11 -3     rendering/render_style.cpp   1.72
  M +35 -4     rendering/render_style.h   1.105
  M +2 -2      rendering/render_text.cpp   1.251



Comment 5 Nicolas Girard 2005-02-06 18:20:56 UTC
I'm afraid this bug should be reopened.

Please check out the test file I'm about to attach ; here konqueror fails to take into account "page-break-inside: avoid", both when dealing with <div>s and <p>s ; I can also provide further tests that show the same happens with <dd>s and <dt>s.

I'm using a Mandrakelinux Cooker version of konqueror (currently 3.3.2 + some patches from the 3.4 branch)
Comment 6 Nicolas Girard 2005-02-06 18:22:55 UTC
Created attachment 9449 [details]
HTML test page for page-break-inside, <div>s and <p>s
Comment 7 Allan Sandfeld 2005-02-07 00:17:34 UTC
Yes, only page-break-before was implemented by the safari merge. 
Comment 8 missive 2005-05-28 03:11:57 UTC
I was trying to use the page-break-before on a br tag, but that does not work on 3.4.0. Also, using it on a singleton p tag does not work (but I am not really sure that is a legal tag...)

Actually, I was trying page-break-after (which seemed more natural to me) but found this bug and saw that I can use page-break-before to get my page working properly for now.
Comment 9 Luke-Jr 2005-05-28 04:38:45 UTC
FWIW, page-break-before/after seem broken in CVS where it previously worked
Comment 10 Allan Sandfeld 2005-05-28 12:44:28 UTC
My previous comment was wrong. Both page-break-before and page-break-after was implemented. Seems there have been regressions.

Test case?
Comment 11 missive 2005-05-28 13:31:56 UTC
Created attachment 11230 [details]
br tag with page-break-after
Comment 12 Allan Sandfeld 2005-07-13 19:35:28 UTC
The bug is the same as #57803

*** This bug has been marked as a duplicate of 57803 ***
Comment 13 Allan Sandfeld 2005-08-16 22:58:18 UTC
The test-case is wrong. Page-break-after only applies to block-level elements, <br> is inline.
Comment 14 missive 2005-08-17 01:47:52 UTC
Created attachment 12243 [details]
page-break-before and page-break-after css page

New test with block-level tag instead of inline tag.
Comment 15 Gérard Talbot (no longer involved) 2011-01-22 19:55:45 UTC
This bug should be REOPENED and based on page-break-* testcases from CSS 2.1 test suite (Release Candidate 5) build on January 11th 2011. 

CSS 2.1 testcases on chapter 13.3.1 Page break properties: 'page-break-before', 'page-break-after', 'page-break-inside'
http://test.csswg.org/suites/css2.1/20110111/html4/chapter-13.html#s13.3.1

From my testing, the latest stable available Konqueror version (4.5.5) fails a very large majority of testcases involving page-break-*.

A bunch of page-break testcases have been updated, some removed, some are considered blocking (not passed by 2 browser implementors: therefore blocking CSS 2.1), some are considered invalid, etc.

Updated testcases for RC5
------------------------
allowed-page-breaks-001a
allowed-page-breaks-001c
allowed-page-breaks-002
allowed-page-breaks-003
allowed-page-breaks-004
forced-page-breaks-000
forced-page-breaks-001
first-page-selectors-003
first-page-selectors-004


Invalid ones
-----------
page-break-after-010
page-break-before-003
page-break-before-005


Testcases with issues: http://wiki.csswg.org/test/css2.1/issues

Invalid testcases: http://wiki.csswg.org/test/css2.1/invalid

Blocking testcases: http://wiki.csswg.org/test/css2.1/blocking

regards, Gérard
Comment 16 Gérard Talbot (no longer involved) 2011-06-19 23:54:27 UTC
CSS 2.1 testcases on chapter 13.3.1 Page break properties: 'page-break-before',
'page-break-after', 'page-break-inside':

http://test.csswg.org/suites/css2.1/latest/html4/chapter-13.html#s13.3.1

The link will be redirected to latest stable version of CSS 2.1 test suite.


---------------


Test results for allowed-page-breaks-* testcases:
http://www.gtalbot.org/BrowserBugsSection/Konqueror4Bugs/Konq-IR-CSS21TestSuite-03.html


Test results for forced-page-breaks-* testcases:
http://www.gtalbot.org/BrowserBugsSection/Konqueror4Bugs/Konq-IR-CSS21TestSuite-57.html


Test results for page-break-[after|before|inside|margins]-* testcases:
http://www.gtalbot.org/BrowserBugsSection/Konqueror4Bugs/Konq-IR-CSS21TestSuite-79.html


---------------


The meaning of page-break-[after|before]: always
" Always force a page break before (after) the generated box." 
is NOT absolute, is NOT 100% ensured, guaranteed.

User agents are allowed to suppress the generation of content-empty (blank) pages [1] despite and even if 'page-break-[after|before]: always' has been declared. 
This is actually mentioned in CSS3 Module: Paged Media, section 5.5 Forced page breaks [2] but it is not currently mentioned in CSS 2.1, section 13.3.1 [3]. I have requested that this gets updated in the errata and this should get done eventually.


[1] http://lists.w3.org/Archives/Public/public-css-testsuite/2010Oct/0324.html
[2] CSS3 Module: Paged Media, section 5.5 Forced page breaks
http://www.w3.org/TR/css3-page/#forced-pg-brk
[3] CSS 2.1, section 13.3.1 Page break properties: 'page-break-before', 'page-break-after', 'page-break-inside'
http://www.w3.org/TR/CSS21/page.html#page-break-props

regards, Gérard