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
Simon Sapin
972045c63f
Accept both unicode and bytes filenames.
2012-06-02 08:04:24 +02:00
Simon Sapin
1f6ba609ba
Bind to sys.stdin/stdout later.
2012-06-02 06:28:44 +02:00
Simon Sapin
1bb70b09c8
Fix the test runner.
2012-06-01 20:05:18 +02:00
Simon Sapin
95e0ad2707
Warn instead of crash on missing on #foo without id="foo"
2012-06-01 18:32:43 +02:00
Simon Sapin
2179957e4a
Fix lines vs. anonymous blocks in precence of floats.
2012-06-01 17:08:54 +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
f890c3ecb0
Fix zero-width / zero-height images.
2012-06-01 10:02:48 +02:00
Simon Sapin
a30996c30a
Fix counter-increment interference with display: list-item
2012-06-01 09:56:19 +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
Simon Sapin
60625282f1
Add a script to run all W3C tests and check for exceptions.
2012-05-31 20:10:04 +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
Simon Sapin
ffd03a578b
Merge branch 'master' into float
2012-05-31 17:56:31 +02:00
Simon Sapin
40af5c156c
Test and fix (a little) stacking contexts.
2012-05-31 17:54:43 +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
Simon Sapin
4f4c99e35c
Remove unused imports.
2012-05-31 14:41:01 +02:00
Simon Sapin
b7cf69dc66
Download HTML URLs with the same mechanism as everything else.
...
Previously we passed the URLs to lxml.
lxml does not support as many protocols, and did not send
any User-Agent HTTP header.
2012-05-31 14:38: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
Guillaume Ayoub
69c43e6d6c
Allow the preferred minimum width of inline elements to get only the first line
2012-05-31 02:05:35 +02:00
Guillaume Ayoub
bc27971ac6
Typo fixes
2012-05-31 01:14:15 +02:00
Guillaume Ayoub
3bb002e61f
Correcly handle float elements in inline blocks
2012-05-31 00:22:14 +02:00
Guillaume Ayoub
ea7993e4eb
Fix a lot of things for float boxes
2012-05-30 23:40:54 +02:00
Simon Sapin
ba2481b075
Fix internal and relative URIs without a base URI in CSS.
2012-05-30 20:21:36 +02:00
Simon Sapin
740160df00
Allow internal links without a base URI
...
... only for links in HTML attributes: <a href="#foo">
TODO: same for links in CSS: -weasy-link: url(#foo)
2012-05-30 20:06:44 +02:00
Guillaume Ayoub
a225f194e8
Handle the clearance for non-float block-level boxes
2012-05-30 19:27:44 +02:00
Simon Sapin
037e4b955c
Merge branch 'master' into float
2012-05-30 19:08:48 +02:00
Simon Sapin
728e0aadbb
Fix character encoding on W3C tests source.
2012-05-30 19:08:35 +02:00
Simon Sapin
f743567544
Draw page borders.
2012-05-30 19:06:30 +02:00
Simon Sapin
c8d6066ace
Fix the available width for shrink-to-fit on absolutes.
2012-05-30 19:06:09 +02:00
Simon Sapin
a9512c12b6
Fix the available width for shrink-to-fit on floats.
2012-05-30 19:05:35 +02:00
Guillaume Ayoub
6a6757a52c
That's much better
2012-05-30 04:19:24 +02:00
Guillaume Ayoub
d4ccf3db63
Remove monkey patches about float
2012-05-30 03:36:37 +02:00
Guillaume Ayoub
6449ee4cbf
Absolute doesn't work yet, but much better than before
2012-05-30 03:27:08 +02:00
Guillaume Ayoub
6e56816727
Use utf-8 as encoding for w3 tests
2012-05-30 00:50:17 +02:00
Simon Sapin
773700dd73
Fix abspos test: do not account for vertical-align
2012-05-29 19:50:01 +02:00
Simon Sapin
cb76c822f2
Use the testing UA stylesheet for PDF tests.
2012-05-29 19:40:38 +02:00
Simon Sapin
17b55f309d
An empty anchor is not an anchor, fragments can be %-encoded.
2012-05-29 19:11:10 +02:00
Simon Sapin
68cc901687
Attr name is only an anchor on <a>
2012-05-29 19:11:10 +02:00
Simon Sapin
a394ab5762
Work around cairo to make sure SVG image stay vectors.
2012-05-29 19:11:10 +02:00
Guillaume Ayoub
51a809fa37
Add the missing file :p
2012-05-29 18:51:40 +02:00
Guillaume Ayoub
44adb875e3
Add basic management of float elements
2012-05-29 18:51:40 +02:00
Guillaume Ayoub
e648919f81
Fix absolute in inline relative
2012-05-29 18:50:36 +02:00
Guillaume Ayoub
35363cefee
Add a test about counter scopes
2012-05-29 17:56:46 +02:00
Guillaume Ayoub
377ae0b801
Handle inline-blocks with position: relative ( fixes #806 )
...
Establishes a new containing block for absolute descendants
2012-05-29 17:36:50 +02:00
Simon Sapin
2baa8a617b
Add a TODO on margins at page breaks.
2012-05-28 11:20:01 +02:00
Guillaume Ayoub
6d07a9fe21
Remove the top margin of the boxes too big to be drawn on one page
2012-05-28 00:05:09 +02:00
Simon Sapin
34f9ae32db
Fix the initial containing block
2012-05-25 18:16:26 +02:00
Simon Sapin
0142ffe08e
Fix static pos for block-level/inline-level abspos.
2012-05-25 17:33:43 +02:00
Simon Sapin
7cc5992fc9
Remove obsolete code.
2012-05-25 17:21:38 +02:00
Simon Sapin
b69ce3b6f3
Fix containing block on absolute tables.
2012-05-25 17:13:38 +02:00
Simon Sapin
edc72bc572
More navigation links in the test runner.
2012-05-25 16:45:58 +02:00
Simon Sapin
6e8f96ea9c
Add prev/next button in the the test suit runner.
2012-05-25 16:29:46 +02:00
Simon Sapin
9a3ec6fc81
Many fixes for the W3C test suite.
2012-05-25 15:57:13 +02:00
Simon Sapin
60f8285ee2
Handle absolute replaced boxes.
2012-05-25 14:08:35 +02:00
Simon Sapin
3592cf0063
Oops. Forgot to paint absolute placeholders.
2012-05-25 12:17:37 +02:00
Simon Sapin
26937a315b
Fix all the bugs for absolute positioning (maybe)
...
When an absolutly-positioned box is taken out of the flow,
leave a "placeholder" instead.
This should fix the bugs related to .translate() with absolutes.
2012-05-25 12:04:08 +02:00
Simon Sapin
16c015a974
Only configure logging if it is not configured already.
2012-05-24 17:44:38 +02:00
Simon Sapin
76430b5269
Also accept a parsed lxml tree for the HTML class.
2012-05-24 17:41:05 +02:00
Simon Sapin
647b2c965b
Warn for relative URI references without a base URI.
2012-05-24 16:06:58 +02:00
Simon Sapin
e88401f333
Get bookmark labels after white-space processing.
2012-05-24 15:29:42 +02:00
Simon Sapin
1154f47a53
Fix -weasy-link: attr(...) with a non-existing attribute.
2012-05-23 15:13:57 +02:00
Simon Sapin
14dc5e7aff
Make urlopen() extensible
...
There is a global dict mapping URI schemes to opener functions,
and a decorator to add such a function.
Expected usage:
from weasyprint.urls import register_opener
@register_opener('foo')
def git_urlopen(url):
url = urlparse.urlsplit(url)
assert url.scheme == 'foo'
# ...
return fileobj, mimetype, charset
2012-05-23 15:13:57 +02:00
Simon Sapin
d694a98350
Rename the utils module to 'urls'
2012-05-23 15:13:57 +02:00
Simon Sapin
982f9dbf91
Simplify capture_logs()
...
Now that we don’t use cssutils we only care about one logger.
2012-05-23 15:13:57 +02:00
Guillaume Ayoub
f978dd6963
Add untested support for position: fixed
2012-05-23 11:30:52 +02:00
Simon Sapin
64786ed5e9
Fix % or auto margins on tables.
2012-05-22 17:32:00 +02:00
Simon Sapin
b6ea3821b8
Remove unused imports
2012-05-22 16:34:41 +02:00
Simon Sapin
61dc177573
Refactor the PNG/PDF differences into a new 'backends' module.
2012-05-22 16:19:09 +02:00
Simon Sapin
ec91ed5ae4
Remove cached_property
...
Use normal properties with an explicit cache instead.
2012-05-22 15:04:20 +02:00
Simon Sapin
848bf33f87
Have PDF readers display the bookmarks by default.
...
... although evince seems to just ignore it.
2012-05-22 14:47:50 +02:00
Simon Sapin
267010a930
Rename destinations to anchors for internal hyperlinks.
2012-05-22 12:37:48 +02:00
Simon Sapin
d7676f8081
Test hyperlinks, fix internal hyperlink parsing.
2012-05-21 18:43:08 +02:00
Simon Sapin
280dcbd121
Test bookmark labels and positions.
2012-05-21 14:56:10 +02:00
Simon Sapin
866efdf62c
Do not repeat bookmarks on a fragmented box
...
Also a better way not to repeat margin/padding/border and list markers.
2012-05-21 14:22:32 +02:00
Simon Sapin
6420d1aab6
Merge branch 'links'
2012-05-21 11:48:21 +02:00
Simon Sapin
33cd706f0d
Refactor the metadata stuff into the pdf module.
2012-05-20 17:04:22 +02:00
Simon Sapin
1b3f7d478f
Test the PDF parser (but not writer)
2012-05-20 16:11:50 +02:00
Simon Sapin
b1b5d85b41
Write bookmarks and links with the new PDF module.
2012-05-20 15:55:57 +02:00
Simon Sapin
8b994c2ec6
Use the new pdf module.
2012-05-20 13:56:04 +02:00
Simon Sapin
699af8a9f5
Remove the old pdf module.
2012-05-20 13:55:07 +02:00
Simon Sapin
c4706538e0
PDF: nicer bytes formatting
2012-05-20 13:44:38 +02:00
Simon Sapin
6b37dbd0f3
Python 2.6 compat.
2012-05-20 13:05:38 +02:00
Simon Sapin
6498c3fb00
Refactor PDF dictionaries.
2012-05-20 13:00:39 +02:00
Simon Sapin
6e7ef6b62a
New PDF: add support for (over)writing objects.
2012-05-20 12:46:33 +02:00
Simon Sapin
5da826520b
Start a more robust PDF parser.
2012-05-19 15:03:07 +02:00
Simon Sapin
d974d410b7
Fix URL quoting on Python 2.6
2012-05-18 17:54:10 +02:00
Simon Sapin
c828f3835d
Avoid using OrderedDict (for Python 2.6).
2012-05-18 17:18:58 +02:00
Simon Sapin
383f7b642b
PDF: use a line iterator instead of .pop(0)
2012-05-18 16:31:39 +02:00
Guillaume Ayoub
525f1030c5
Useless typo
2012-05-18 16:23:08 +02:00
Guillaume Ayoub
9211fa570d
Remove borders around links
2012-05-18 16:08:18 +02:00
Guillaume Ayoub
bfeb102c98
Test bookmarks
2012-05-18 15:38:57 +02:00
Simon Sapin
8c3f16fc8c
Fix URI encoding per RFC 3986 and 3987.
2012-05-18 09:13:09 +02:00
Guillaume Ayoub
64cb7b4104
Handle the bookmarks as a tree
2012-05-17 22:46:03 +02:00
Guillaume Ayoub
111932edf5
Add first-level bookmarks, use floats for XY positions, fix little things
2012-05-15 19:29:54 +02:00
Simon Sapin
1ea79c9e9e
Fix importing urllib.quote on Py 2.x
2012-05-15 18:16:25 +02:00
Simon Sapin
1ff949b888
Have the PDF post-process run on Python3 (links are broken)
2012-05-15 13:40:36 +02:00
Guillaume Ayoub
76c15235e6
Replace the PDF class by a function
2012-05-15 03:29:57 +02:00
Guillaume Ayoub
488a6a99c9
Remove the "active" attribute
2012-05-15 01:56:19 +02:00
Guillaume Ayoub
ff8d50ce3e
Remove a useless attribute
2012-05-15 01:28:09 +02:00
Guillaume Ayoub
65a286f12f
Stupid typo
2012-05-15 01:16:39 +02:00
Guillaume Ayoub
bb2727417f
Write the PDF without the second iteration on initial lines
2012-05-15 01:15:07 +02:00
Guillaume Ayoub
34c12fe3ef
Remove a useless continue
2012-05-15 00:32:19 +02:00
Guillaume Ayoub
b38ce4f0a3
Clean again the pdf module
2012-05-15 00:30:20 +02:00
Guillaume Ayoub
6848846b8e
Add a docstring
2012-05-14 23:59:24 +02:00
Guillaume Ayoub
802a7351d8
Clean and document the pdf module
2012-05-14 23:58:18 +02:00
Guillaume Ayoub
42f2cf4e0e
Display correctly unknown links
2012-05-14 23:34:07 +02:00
Guillaume Ayoub
da08226ccd
Use bytes in the whole pdf module
2012-05-14 23:24:27 +02:00
Guillaume Ayoub
ba75a84e95
Don't add another sharp for inner links
2012-05-14 23:18:20 +02:00
Guillaume Ayoub
22635c0c71
Initial support of internal links
2012-05-14 19:40:38 +02:00
Guillaume Ayoub
9ea53bf466
Add initial support of external hyperlinks
2012-05-14 18:31:51 +02:00
Simon Sapin
1bfdce6b8c
Do not crash on letter-spacing: normal
2012-05-14 11:57:55 +02:00
Simon Sapin
0c80b77f31
Handle absolute tables
2012-05-14 08:15:52 +02:00
Simon Sapin
bf95751558
Fix outside list marker position on absolute list-items.
2012-05-11 20:50:28 +02:00
Simon Sapin
ea18e88fdc
Crash fix: skip absolute boxes that are not laid out yet in various places.
2012-05-11 20:39:56 +02:00
Guillaume Ayoub
15790dc51e
Handle inline absolute elements
2012-05-11 19:31:31 +02:00
Guillaume Ayoub
f795cccb58
Don't display the "option" elements
2012-05-11 16:20:14 +02:00
Guillaume Ayoub
b3a91e4e26
Fix the width repartition between columns when sum(preferred_widths) = 0
2012-05-11 16:17:23 +02:00
Guillaume Ayoub
f1da53a32a
Fix the z-index
2012-05-11 16:07:14 +02:00
Guillaume Ayoub
475a924e89
Fix the stacking contexts
2012-05-11 14:10:11 +02:00
Simon Sapin
2b7bb4108e
Special treatement for page boxes in StackingContext
2012-05-11 10:49:52 +02:00
Simon Sapin
10627f6f6d
Sort stacking contexts by z-index.
2012-05-11 10:27:48 +02:00
Guillaume Ayoub
632f57dff5
Fix angles in transform
2012-05-10 22:10:29 +02:00
Guillaume Ayoub
e963367e98
Typos
2012-05-10 22:09:04 +02:00
Guillaume Ayoub
3f4113fa5f
Add a StackingContext in preparation for z-index drawing.
2012-05-10 20:57:29 +02:00
Guillaume Ayoub
8d1b86c40f
Layout in place absolute boxes
2012-05-10 20:12:47 +02:00
Guillaume Ayoub
7eb3ba187e
Add tests for absolute boxes
2012-05-10 16:10:04 +02:00
Guillaume Ayoub
b20022ee11
Fix some little things about absolute blocks
2012-05-10 13:56:21 +02:00
Guillaume Ayoub
1fc2da2a5c
Add initial support of position: absolute, missing z-index
2012-05-10 05:57:06 +02:00
Guillaume Ayoub
2ea63210bf
Add a list of absolute elements
2012-05-09 19:01:32 +02:00
Guillaume Ayoub
994e6a933a
Handle not-in-flow elements in inline boxes
2012-05-09 17:08:23 +02:00
Guillaume Ayoub
d9056d9a4f
Remove a useless monkey patch in tests about inline blocks
2012-05-09 17:08:23 +02:00
Guillaume Ayoub
369faf4d7b
Fix relative positioning for inline boxes
2012-05-09 17:07:01 +02:00
Guillaume Ayoub
fcf7d1ff2c
Add untested support of relative
2012-05-09 13:15:13 +02:00
Guillaume Ayoub
449ca2db07
Remove useless space
2012-05-08 03:40:27 +02:00
Simon Sapin
e1040a8d66
Next is 0.9
2012-05-07 18:32:07 +02:00