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

634 Commits

Author SHA1 Message Date
Simon Sapin
0c89a73a47 Navigator: clip links outside the page. 2012-07-03 15:10:46 +02:00
Simon Sapin
477b849363 Navigator: add links to some example pages 2012-07-03 15:10:25 +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
80af286655 Merge branch 'float' into 'master' 2012-06-29 11:40:00 +02:00
Simon Sapin
edfbd90566 W3C test suite runner: render in an iframe
In case rendering fails with an exception, the Werkzeug
debugger is in the iframe. The browser’s rendering and
the HTML source are still visible.
2012-06-29 11:38:57 +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
cf822b981f Use the Acid2 version from webstandards.org
It uses http://www.webstandards.org/404/ instead of
http://www.damowmow.com/404/ and thus does not have
network problems.

Also, using the new get_png_pages() API we can get
each page separately. No custom stylesheet is needed
anymore.
2012-06-28 17:41:42 +02:00
Simon Sapin
45a09df4a8 Set the network timeout to 1 second for Acid2
Acid2 uses http://www.damowmow.com/404/ which apparently has
a broken IPv6 setup.
2012-06-28 14:01:03 +02:00
Simon Sapin
f808cacd09 Fix waiting_floats with spans 2012-06-28 14:00:27 +02:00
Simon Sapin
f0b04a8e37 Merge branch 'master' into float 2012-06-28 13:30:23 +02:00
Simon Sapin
f65619f452 Fix whitespace collapsing across not-in-normal-flow boxes. 2012-06-28 13:29:12 +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
Simon Sapin
5e61048014 Remove import of a removed module. 2012-06-28 11:59:36 +02:00
Guillaume Ayoub
85753abc7f Re-add a test that was failing 2012-06-28 09:09: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
d3eb130fc0 Fix *again* the split_inline_box calls in the tests 2012-06-26 00:21:50 +02:00
Guillaume Ayoub
19d0a6aff5 Merge branch 'master' into float 2012-06-25 23:55:54 +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
Simon Sapin
f01e714192 Tag v0.10 2012-06-25 16:12:04 +02:00
Simon Sapin
6eee86dadf Fix Navigator tests on Py2.6 2012-06-25 16:09:40 +02:00
Guillaume Ayoub
8c4cf4118d Remove print 2012-06-25 12:51:13 +02:00
Guillaume Ayoub
f15cb85d1d Merge branch 'master' into float 2012-06-25 12:48:11 +02:00
Guillaume Ayoub
683afe9f3a Fix tests 2012-06-25 12:47:15 +02:00
Simon Sapin
c2375d2f5c Do not require JavaScript in Navigator
And other niceties.
2012-06-25 10:57:38 +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
1c9a910c5f Merge branch 'master' of github.com:Kozea/WeasyPrint 2012-06-23 11:50:38 +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
Simon Sapin
78461b81f1 Test the Navigator 2012-06-23 04:58:14 +02:00
Simon Sapin
18cc2958b2 Move the Navigator startup out of exception handling.
Otherwise, any other traceback would be prefixed with:

Traceback (most recent call last):
  File "weasyprint/navigator.py", line 160, in run
    from werkzeug.serving import run_simple
ImportError: No module named werkzeug.serving

During handling of the above exception, another exception occurred:
2012-06-23 04:22:10 +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
03a0ee1079 Add a PDF button to Navigator. 2012-06-22 19:01:21 +02:00
Simon Sapin
6483c69e02 Rewrite Navigator to run without Flask. 2012-06-22 18:48:52 +02:00
Simon Sapin
712a219803 Only disable anti-aliasing on PNG output.
And, for borders, if the width is more than 1 device unit.
2012-06-22 15:18:46 +02:00
Simon Sapin
4f801d61b4 Bug fix: list + tuple in find_earlier_break() 2012-06-22 14:34:36 +02:00
Guillaume Ayoub
ab5ecd8346 Fix some tests 2012-06-22 11:40:15 +02:00
Simon Sapin
541214ee71 Add a resolution parameter for PNG output in the public API.
The resolution is counted in PNG pixels per CSS inch.
Note however that CSS pixels are always 1/96 CSS inch.
With the default resolution of 96, CSS pixels match PNG pixels.
2012-06-22 08:49:48 +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
040eb765df Remove backends in favor of methods on Document
This much genericity was not that useful.
2012-06-21 17:22:01 +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
07c1596746 Merge branch 'master' into float 2012-06-21 16:12:08 +02:00
Guillaume Ayoub
2ba67841ba Use a base URL for w3 server (fixes images) 2012-06-21 16:09:39 +02:00
Guillaume Ayoub
e12880b113 Handle float in inline as almost normal boxes 2012-06-21 16:03:29 +02:00
Guillaume Ayoub
c163f8e8eb Merge remote-tracking branch 'origin/master' into float
Conflicts:
	weasyprint/document.py
	weasyprint/tests/w3_test_suite/web.py
2012-06-21 15:28:22 +02:00
Simon Sapin
a10e691d4d Nicer test runner for the W3C suite
* Show each page separately with a box-shadow
* Add line numbers to the source view
2012-06-21 12:04:43 +02:00
Simon Sapin
fc2fdb622c Add get_png_pages to the public API 2012-06-21 11:33:19 +02:00
Simon Sapin
5bf6172ac5 Disable anti-aliasing on underline and other text decrations. 2012-06-20 16:29:14 +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
3dde680a23 Rename WeasyPrint Browser to Navigator 2012-06-20 12:59:48 +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
d71ad36580 Merge branch 'master' into float 2012-06-19 14:53:40 +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
Simon Sapin
4c8b3f7030 Updated the list of properties that apply to table wrappers.
Removed line-height: it applies implicitly as it is inherited
Added counter-increment, counter-reset, opacity

See http://lists.w3.org/Archives/Public/www-style/2012Jun/0396.html
2012-06-16 13:09:09 +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
0485e8e777 Add some tests for float 2012-06-15 15:22:17 +02:00
Simon Sapin
937710bf9c Account for line height when avoiding collisions with floats. 2012-06-15 15:14:43 +02:00
Simon Sapin
8b38b39fa2 Add a favicon for the Browser. (Clients keep requesting it…) 2012-06-15 11:58:13 +02:00
Simon Sapin
b276dbd1d7 Default to HTTP in the Browser rather than relative filenames. 2012-06-15 11:50:53 +02:00
Simon Sapin
a83ff7b0ee Fix #772: Use redirected URLs as base URLs 2012-06-14 22:08:34 +02:00
Simon Sapin
8497a7fc90 Fix the tests on PDF links 2012-06-14 22:06:30 +02:00
Simon Sapin
0b2157a861 Change the default page margin to 75px
This is within 1% of the previous 2cm, but an integer number
of pixels works better for PNG output (eg. in the Browser)
2012-06-14 21:12:21 +02:00
Simon Sapin
34ae5ec116 Remove redundant links on text boxes; Browser polish 2012-06-14 21:09:59 +02:00
Simon Sapin
b98820df5b Switch from margin area to border area for the link "hit box" 2012-06-14 20:11:12 +02:00
Simon Sapin
b1965a1edd Make all decendants of a link clickable too.
Consider an inline <a> containing some text and an image higher than
line-height. The text should be clickable on a zone as high as
line-height but the whole image shoud be clickable too.
2012-06-14 19:43:58 +02:00
Simon Sapin
28e604e346 Nicer-looking address bar for WeasyPrint Browser 2012-06-14 18:07:51 +02:00
Simon Sapin
6e6424e3a1 Add weasyprint.browser.
Start it with python -m weasyprint.browser
Requires Flask (and thus Python 2)
2012-06-14 15:43:35 +02:00
Simon Sapin
d2aeda4372 More properties should apply to table wrappers.
Thanks David Baron for sharing what Gecko does.
2012-06-11 12:34:43 +02:00
Simon Sapin
2c445b75b9 'text-align: top' is implemented, remove a hack for Acid 2. 2012-06-08 18:50:20 +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
09895757ca Now passing Acid 2! 2012-06-08 17:17:19 +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
9b3e66ccbe Ignore tests with dom or interact flag 2012-06-06 15:01:42 +02:00
Simon Sapin
d0a5a0b8f1 Fix borders on inline boxes split by a block inside. 2012-06-06 13:27:50 +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
Simon Sapin
61c335766a Next is 0.10 2012-06-06 11:21:06 +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
Simon Sapin
d4409e8f46 Add the Acid2 test (marked as expected failure). 2012-06-05 13:52:57 +02:00
Simon Sapin
182f1883c9 Disable anti-aliasing on background-color
Prefer crisp edges for the rectangle. I think this only
affects the PNG output, not PDF.
2012-06-05 11:27:51 +02:00
Simon Sapin
1624335b40 Remove useless "computed values" functions. 2012-06-05 10:33:19 +02:00
Guillaume Ayoub
9e30396036 Merge branch 'master' into float 2012-06-04 19:34:01 +02:00
Guillaume Ayoub
505ee8de26 Handle the mix/max-widths/heights for absolute and float 2012-06-04 19:22:18 +02:00
Simon Sapin
4ec6757077 Tag v0.9 2012-06-04 18:57:50 +02:00
Simon Sapin
cad7d5604c Fix tests for the "strut" change on containing blocks. 2012-06-04 18:51:50 +02:00
Simon Sapin
53a05b2aa7 Fix the fix on inline-block painting. 2012-06-04 18:49:13 +02:00
Guillaume Ayoub
5cab59c483 Merge branch 'master' into float 2012-06-04 17:51:26 +02:00
Guillaume Ayoub
c3b2f2f440 Draw the replaced elements into the content box (not padding box) 2012-06-04 17:42:58 +02:00
Guillaume Ayoub
309264a517 Merge branch 'master' into float 2012-06-04 16:37:20 +02:00
Guillaume Ayoub
71fc11ea97 Draw the borders of inline 2012-06-04 16:36:55 +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
aac60c9aee Merge branch 'master' into float
Conflicts:
	weasyprint/stacking.py
2012-06-04 16:06:25 +02:00
Simon Sapin
cfda2f1e20 Fix the painting order of inline-blocks. 2012-06-04 15:09:59 +02:00
Simon Sapin
74cfe8625b Fix painting order of nested stacking contexts. 2012-06-04 12:49:10 +02:00
Simon Sapin
434f510d94 Stacking contexts: dispatch the box itself, not just its children. 2012-06-04 10:46:24 +02:00
Simon Sapin
a8efed1bf1 Do not crash on SVG images without an intrinsic size. 2012-06-04 09:02:47 +02:00
Guillaume Ayoub
10eabe5e18 Insert the absolute boxes before their own children 2012-06-04 01:54:51 +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
5dde5d47e5 Handle degerate rowspan values.
Previously, such values crashed the layout.
2012-06-02 09:02:24 +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
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