Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Handle ::first-letter #407
The feature comes with a couple of small fixes:
If you're interested in this feature, please review before I merge!
The pseudo-element is currently added at the end of the build, but it should be done during the layout as the whitespaces at the beginning of the tags may be skipped.
Tests now mix one and two colons in CSS, but the user agent stylesheet and internal representation of the pseudo-elements now awlays use two colons.
As ::first-letter depends on white space handling, we must create the box after collapsing spaces, not during the build of the box tree. This commit makes WeasyPrint pass most of the W3C tests related to first-letter (and never crash). Known problems left include: - list markers are considered as the first letter, - lines may break between the first letter and the rest of the text (see #163 and #301), - the CSS attributes are all kept, some should probably be removed (the spec doesn't give a whole list). Even if W3C tests makes me quite confident (some of them are crazy), tests must be added in WeasyPrint too.
jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request
Mar 3, 2017
Version 0.36 ------------ Released on 2017-02-25. New features: * `#407 <https://github.com/Kozea/WeasyPrint/pull/407>`_: Handle ::first-letter. * `#423 <https://github.com/Kozea/WeasyPrint/pull/423>`_: Warn user about broken cairo versions. Bug fixes: * `#411 <https://github.com/Kozea/WeasyPrint/pull/411>`_: Typos fixed in command-line help. Version 0.35 ------------ Released on 2017-02-25. Bug fixes: * `#410 <https://github.com/Kozea/WeasyPrint/pull/410>`_: Fix AssertionError in split_text_box.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments.