Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on parsing functional notation in 'content' #71

Closed
SimonSapin opened this issue Apr 6, 2013 · 1 comment
Closed

Crash on parsing functional notation in 'content' #71

SimonSapin opened this issue Apr 6, 2013 · 1 comment
Labels
bug Existing features not working as expected crash Problems preventing documents from being rendered

Comments

@SimonSapin
Copy link
Member

Thanks to Håkon Wium Lie for the report.

(venv)howcome@uu:~/w/2013/tests$ weasyprint http://people.opera.com/howcome/2013/tests/paged-media.html foo.pdf
Ignored `marks: crop cross` at 11:3, unknown property.
Ignored `bleed: 2mm` at 15:3, unknown property.
Ignored `position: running(header)` at 32:3, invalid value.
Ignored `flow: static(header)` at 33:3, unknown property.
Ignored `content: flow(header)` at 38:5, invalid value.
Ignored `content: element(header)` at 39:5, invalid value.
Ignored `content: flow(header)` at 57:5, invalid value.
Ignored `content: element(header)` at 58:5, invalid value.
Ignored `hyphens: auto` at 83:3, the property is experimental or non-standard, use -weasy-hyphens.
Ignored `column-span: all` at 94:3, unknown property.
Ignored `column-span: all` at 129:3, unknown property.
Ignored `column-count: 2` at 133:3, unknown property.
Ignored `-moz-column-count: 2` at 133:20, unknown property.
Ignored `column-gap: 1.5em` at 134:3, unknown property.
Ignored `-moz-column-gap: 1.5em` at 134:22, unknown property.
Ignored `column-fill: auto` at 135:3, unknown property.
Traceback (most recent call last):
  File "/home/howcome/venv/bin/weasyprint", line 9, in <module>
    load_entry_point('WeasyPrint==0.18', 'console_scripts', 'weasyprint')()
  File "/home/howcome/venv/local/lib/python2.7/site-packages/weasyprint/__main__.py", line 141, in main
    getattr(html, 'write_' + format_)(output, **kwargs)
  File "/home/howcome/venv/local/lib/python2.7/site-packages/weasyprint/__init__.py", line 159, in write_pdf
    return self.render(stylesheets).write_pdf(target, zoom)
  File "/home/howcome/venv/local/lib/python2.7/site-packages/weasyprint/__init__.py", line 131, in render
    return Document._render(self, stylesheets, enable_hinting)
  File "/home/howcome/venv/local/lib/python2.7/site-packages/weasyprint/document.py", line 252, in _render
    for css in stylesheets or []])
  File "/home/howcome/venv/local/lib/python2.7/site-packages/weasyprint/css/__init__.py", line 423, in get_all_computed_styles
    element_tree, device_media_type, url_fetcher))
  File "/home/howcome/venv/local/lib/python2.7/site-packages/weasyprint/css/__init__.py", line 179, in find_stylesheets
    url_fetcher=url_fetcher, media_type=device_media_type)
  File "/home/howcome/venv/local/lib/python2.7/site-packages/weasyprint/__init__.py", line 237, in __init__
    media_type, base_url, self.stylesheet.rules, url_fetcher))
  File "/home/howcome/venv/local/lib/python2.7/site-packages/weasyprint/css/__init__.py", line 339, in preprocess_stylesheet
    base_url, rule.declarations))
  File "/home/howcome/venv/local/lib/python2.7/site-packages/weasyprint/css/validation.py", line 1487, in preprocess_declarations
    result = list(expander_(base_url, name, tokens))
  File "/home/howcome/venv/local/lib/python2.7/site-packages/weasyprint/css/validation.py", line 1438, in validate_non_shorthand
    value = function(tokens, base_url)
  File "/home/howcome/venv/local/lib/python2.7/site-packages/weasyprint/css/validation.py", line 488, in content
    parsed_tokens = [validate_content_token(base_url, v) for v in tokens]
  File "/home/howcome/venv/local/lib/python2.7/site-packages/weasyprint/css/validation.py", line 512, in validate_content_token
    args = [a.value for a in args]
AttributeError: 'FunctionToken' object has no attribute 'value'
@SimonSapin
Copy link
Member Author

The validate_content_token() function does not account for nested functions such as content: target-counter(attr(href), page).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Existing features not working as expected crash Problems preventing documents from being rendered
Projects
None yet
Development

No branches or pull requests

1 participant