1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-05 00:21:15 +03:00
Commit Graph

264 Commits

Author SHA1 Message Date
Simon Sapin
d1971b6e63 Remove unused imports. 2012-08-03 13:32:42 +02:00
Simon Sapin
4abf401f9e Simplify Document and remove magic properties. 2012-08-03 13:00:14 +02:00
Simon Sapin
d401e7241b Kill Document in layout/*.py 2012-07-12 17:13:21 +02:00
Simon Sapin
cca18bdfe9 Kill Document in pdf.py and text.py 2012-07-12 16:14:35 +02:00
Simon Sapin
30a5708373 Kill Document in formatting_structure/build.py and html.py 2012-07-12 15:54:22 +02:00
Simon Sapin
0d3d1f1fd5 Collapsed borders intersections should be rectangles, not squares. 2012-07-12 11:10:18 +02:00
Simon Sapin
e955781b91 Fix border-collapse on multiple pages 2012-07-11 19:23:41 +02:00
Simon Sapin
34fc003c57 Paint collapsed table borders 2012-07-11 18:21:20 +02:00
Simon Sapin
002ed3a99e Ignore border-spacing when border-collapse is 'collapse'
Also remove TODOs in preferred.py:
'when border-collapse: collapse; set outer=False'

build.py sets transparent borders half as wide as the
collapsed border on each cell, so the layout should
just work unchanged.
2012-07-11 15:43:18 +02:00
Simon Sapin
925669d37c Fix floats across pages. 2012-07-06 18:35:23 +02:00
Simon Sapin
22cb02c01a Update page sizing to the current ED
Namely:

* The size sets the page’s containing block
* 'auto' margins are now supported
* The width, min-width, max-width, height, min-height
  and max-height properties are now supported.
2012-07-03 14:54:15 +02:00
Simon Sapin
fb3777b317 Get rid of page.outer_width and outer_height
.margin_width() and .margin_height() can be used instead.
2012-07-03 14:07:39 +02:00
Simon Sapin
b89926284a Fix the Variable Dimension rules, add tests.
This implements the updated algorithm described in
https://github.com/SimonSapin/css/blob/81b5d93d0d/margin-boxes-variable-dimension
2012-07-02 18:15:57 +02:00
Simon Sapin
e28fdb557b Implement a simpler version of Variable Dimension for margin boxes.
https://github.com/SimonSapin/css/blob/8c17fbe/margin-boxes-variable-dimension
2012-07-02 11:07:44 +02:00
Simon Sapin
13184721be Non-auto width is not enough anymore for a page-margin box
The latest ED makes no mention of non-auto widths for
generating page-margin boxes. Only 'content: none' matters:

http://dev.w3.org/csswg/css3-page/#populating-margin-boxes
2012-07-02 11:07:44 +02:00
Simon Sapin
694863ed62 Fix crashes.
* Some fixed boxes did not have any layout
* Validator for the 'float' property masked the builtin,
  float('inf') returned None.
2012-06-29 17:13:10 +02:00
Simon Sapin
6d5e473993 Fix inline floated images. 2012-06-28 19:07:26 +02:00
Simon Sapin
c36d6b6b29 Intrinsic widths: account for floats in inline contexts 2012-06-28 18:46:54 +02:00
Simon Sapin
f808cacd09 Fix waiting_floats with spans 2012-06-28 14:00:27 +02:00
Simon Sapin
c6a9c9a151 Fix a shrink_to_fit call: CB width instead of the CB box 2012-06-28 12:00:15 +02:00
Guillaume Ayoub
01c451b542 Don't collapse margins in table wrappers, remove a double translation
With this version, a lot of tests are OK. The main missing feature is the
unsupported margin collapsing through nested boxes. Once this is fixed, the
branch can be considered as stable.
2012-06-28 04:14:06 +02:00
Guillaume Ayoub
5e270133c8 Use the border height instead of the margin height to find floats with no height
Fixes Acid2
2012-06-28 01:42:28 +02:00
Guillaume Ayoub
228f1e3d77 Fix most of the tests (but not Acid2) 2012-06-28 00:51:24 +02:00
Guillaume Ayoub
9afa96e987 Put floats in the next line when they don't fit on current line 2012-06-25 23:48:21 +02:00
Guillaume Ayoub
762a8db2be Don't detect collisions with 0-height boxes only for float boxes 2012-06-25 23:47:07 +02:00
Guillaume Ayoub
2f68f0f519 Again! 2012-06-25 21:37:15 +02:00
Guillaume Ayoub
b26d35cd96 Don't resolve percentages on tables 2012-06-25 21:35:45 +02:00
Guillaume Ayoub
4c824f7374 Don't create new lines for floats with height = 0 2012-06-25 21:10:00 +02:00
Guillaume Ayoub
6bccfe7514 Fix a lot of things about floats 2012-06-25 19:48:22 +02:00
Guillaume Ayoub
8c4cf4118d Remove print 2012-06-25 12:51:13 +02:00
Guillaume Ayoub
683afe9f3a Fix tests 2012-06-25 12:47:15 +02:00
Guillaume Ayoub
3b740f32a6 Fix stupid bug 2012-06-25 10:21:42 +02:00
Guillaume Ayoub
b61f57b97c Avoid collision of replaced blocks and tables with floats 2012-06-25 10:17:39 +02:00
Guillaume Ayoub
b67bebfb92 Fix the position of line children next to float boxes 2012-06-24 00:03:45 +02:00
Guillaume Ayoub
aee82fd576 Add a todo and fix a little thing about text align for floats in inline 2012-06-23 13:05:08 +02:00
Guillaume Ayoub
a3cc6c62a8 Merge branch 'master' into float 2012-06-23 11:51:05 +02:00
Guillaume Ayoub
6c4f05fb54 Remove useless import 2012-06-23 11:50:10 +02:00
Guillaume Ayoub
e696d2b196 Translate children moved by floats (but no available_width shrink yet) 2012-06-23 11:47:38 +02:00
Guillaume Ayoub
989ae739ef Merge branch 'master' into float
Comment failing tests too :(

Conflicts:
	weasyprint/document.py
	weasyprint/draw.py
2012-06-23 02:00:09 +02:00
Simon Sapin
4f801d61b4 Bug fix: list + tuple in find_earlier_break() 2012-06-22 14:34:36 +02:00
Guillaume Ayoub
cd1e5b3e05 Merge branch 'master' into float
Conflicts:
	weasyprint/layout/preferred.py
	weasyprint/text.py
2012-06-22 01:29:26 +02:00
Simon Sapin
9fde81d006 Fix a corner case in page-break-*: avoid 2012-06-21 19:05:54 +02:00
Guillaume Ayoub
a78c3d2749 Small fixes about floats 2012-06-21 18:12:17 +02:00
Simon Sapin
97f3eee889 Refactor text handling
* Kill the TextFragment class. Use a set of functions instead.
* Pass around an `enable_hinting` boolean rather than a dummy surface
2012-06-21 17:22:01 +02:00
Guillaume Ayoub
e12880b113 Handle float in inline as almost normal boxes 2012-06-21 16:03:29 +02:00
Guillaume Ayoub
c1e495bee1 Add a todo about float blocks and collapse margins 2012-06-20 14:13:25 +02:00
Guillaume Ayoub
7cc8be2f90 Merge branch 'master' into float
Conflicts:
	weasyprint/layout/blocks.py
2012-06-20 13:47:28 +02:00
Guillaume Ayoub
cb068ec111 Add skip to resume_at indexes in find_earlier_page_break 2012-06-20 13:39:44 +02:00
Simon Sapin
d4399ee269 Add support for page-break-{before,after}: avoid 2012-06-20 12:53:22 +02:00
Guillaume Ayoub
36a6b6b6f3 Pass the fixed_boxes argument instead of using current_page
Cherry-picked from 043d71dc29

Conflicts:
	weasyprint/layout/absolute.py
	weasyprint/layout/blocks.py
	weasyprint/layout/float.py
	weasyprint/layout/inlines.py
2012-06-19 18:00:50 +02:00
Guillaume Ayoub
f9e7c40ca2 Fix the drawing order of fixed boxes
Cherry-picked from 568e0aeb70

Conflicts:
	weasyprint/layout/blocks.py
	weasyprint/layout/inlines.py
2012-06-19 17:42:15 +02:00
Guillaume Ayoub
4fe56316f6 Finally fix margin collapsing for blocks with clearance 2012-06-19 14:52:30 +02:00
Guillaume Ayoub
f441f8c810 Increase position_y after clear blocks 2012-06-19 00:00:28 +02:00
Guillaume Ayoub
9cf9e53d0b Fix a little bug with clearance 2012-06-18 19:34:35 +02:00
Guillaume Ayoub
ef76204e99 Fix clearance and margin collapsing 2012-06-18 19:31:24 +02:00
Guillaume Ayoub
b3e3581f48 Remove useless import 2012-06-18 18:04:20 +02:00
Guillaume Ayoub
8a94ff2f9b Strip spaces at the beginning of text fragments to get real line widths 2012-06-18 10:44:54 +02:00
Guillaume Ayoub
d62ba4936a Don't collapse through boxes with clearance 2012-06-18 10:06:18 +02:00
Guillaume Ayoub
e4f9ff5331 Don't collapse through clear boxes 2012-06-15 18:49:40 +02:00
Simon Sapin
f7d765e0c1 Bug fixes and tests on floats… 2012-06-15 17:59:15 +02:00
Simon Sapin
937710bf9c Account for line height when avoiding collisions with floats. 2012-06-15 15:14:43 +02:00
Simon Sapin
2c0abe1483 Merge branch 'master' into float 2012-06-08 18:49:27 +02:00
Simon Sapin
26b4f57292 Implement vertical-align: top/bottom. 2012-06-08 18:49:10 +02:00
Simon Sapin
fd6c5451e0 Merge branch 'master' into float 2012-06-08 17:16:31 +02:00
Guillaume Ayoub
85df2ebe47 Fix the struts and heights of line/inline boxes. (For real this time. Maybe.) 2012-06-08 17:13:45 +02:00
Guillaume Ayoub
6cbdab0799 Fix various tests, remove monkeypatch validation 2012-06-06 12:52:02 +02:00
Simon Sapin
706113c24b Revert "Make the strut have an effect on line boxes"
This reverts commit d88ecbb6ba.
2012-06-06 12:05:59 +02:00
Guillaume Ayoub
043d71dc29 Pass the fixed_boxes argument instead of using current_page 2012-06-06 12:04:09 +02:00
Guillaume Ayoub
568e0aeb70 Fix the drawing order of fixed boxes 2012-06-06 09:49:56 +02:00
Guillaume Ayoub
d88ecbb6ba Make the strut have an effect on line boxes 2012-06-05 17:56:58 +02:00
Guillaume Ayoub
39e503858d Fix margin collapsing with clearance 2012-06-05 17:14:33 +02:00
Guillaume Ayoub
505ee8de26 Handle the mix/max-widths/heights for absolute and float 2012-06-04 19:22:18 +02:00
Guillaume Ayoub
3684c8ed0d Merge branch 'master' into float 2012-06-04 16:09:10 +02:00
Guillaume Ayoub
9836f66d33 Account for the "strut" on block containers.
http://www.w3.org/TR/CSS21/visudet.html#line-height
2012-06-04 16:07:39 +02:00
Guillaume Ayoub
95a74c2abb Merge branch 'master' into float 2012-06-02 13:57:18 +02:00
Guillaume Ayoub
b732ba09d4 Merge branch 'float' of github.com:Kozea/WeasyPrint into float
Conflicts:
	weasyprint/layout/pages.py
2012-06-02 13:56:49 +02:00
Simon Sapin
86bb8eede8 Fix margin boxes positionning. 2012-06-02 13:04:33 +02:00
Simon Sapin
b1361612c6 Fix floating tables. 2012-06-02 08:46:11 +02:00
Simon Sapin
4c5a1a1e2a Fix absolute tables. 2012-06-02 08:45:39 +02:00
Simon Sapin
592caf55e0 Fix calls to preferred after merging the hinting fix.
Conflicts:
	weasyprint/layout/pages.py
	weasyprint/layout/preferred.py
2012-06-02 08:36:56 +02:00
Simon Sapin
81a63a8ca7 Merge branch 'master' into float
Conflicts:
	weasyprint/layout/pages.py
	weasyprint/layout/preferred.py
2012-06-02 08:35:17 +02:00
Simon Sapin
3cd540eaa9 Fix shrink-to-fit in PNG: have the same hinting as in layout. 2012-06-02 08:28:41 +02:00
Guillaume Ayoub
a84d4af491 Merge branch 'master' into float
Conflicts:
	weasyprint/layout/pages.py
2012-06-01 16:08:03 +02:00
Simon Sapin
41d3cd3287 Fix percentage max-height without a containing block height. 2012-06-01 10:47:29 +02:00
Simon Sapin
491299f668 Content-empty pages need layout and margin boxes too. 2012-06-01 10:30:06 +02:00
Simon Sapin
a1ebd260e7 Pango also breaks on U+2029. 2012-06-01 09:45:13 +02:00
Simon Sapin
6b3837f2f9 Fix corner cases in table auto layout. 2012-06-01 09:29:28 +02:00
Guillaume Ayoub
c00881790c Increase the auto height of block formatting context roots 2012-05-31 22:33:28 +02:00
Guillaume Ayoub
2f697b47fd Merge branch 'master' into float 2012-05-31 21:11:08 +02:00
Guillaume Ayoub
d3ea76ffbf Keep float elements to get preferred widths 2012-05-31 21:05:10 +02:00
Guillaume Ayoub
afd1ce9c85 Create a new block formatting context for non-block block containers 2012-05-31 20:03:10 +02:00
Guillaume Ayoub
0ce3237518 Create a block formatting context for absolute elements 2012-05-31 19:55:43 +02:00
Guillaume Ayoub
8eead6332b Don't add the floats in the excluded shapes twice 2012-05-31 19:55:29 +02:00
Simon Sapin
71f94416da Handle preferred widths for inline tables. 2012-05-31 18:34:36 +02:00
Guillaume Ayoub
deb7bac3b2 Set the column_widths attribute for float tables 2012-05-31 18:08:58 +02:00
Guillaume Ayoub
4c55eba456 Don't layout the absolute boxes in the float layout 2012-05-31 16:46:53 +02:00
Simon Sapin
2c3e0e825d Fix Py3k compat: next(iterator) instead of iterator.next() 2012-05-31 14:59:34 +02:00
Guillaume Ayoub
8d42985c76 Remove useless variables for floats 2012-05-31 03:04:51 +02:00
Guillaume Ayoub
ec3e1943d5 Remove the useless float placeholder 2012-05-31 02:45:16 +02:00
Guillaume Ayoub
d747fafe7f Use named parameters when needed in inline_preferred_minimun_width 2012-05-31 02:08:33 +02:00