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

Handle ::first-letter #407

Merged
merged 7 commits into from
Feb 16, 2017
Merged

Handle ::first-letter #407

merged 7 commits into from
Feb 16, 2017

Conversation

liZe
Copy link
Member

@liZe liZe commented Jan 2, 2017

The feature comes with a couple of small fixes:

  • always use :: instead of : for internal representation of pseudo-classes, and
  • rename pseudo_to_box into before_after_to_box to avoid confusion with other pseudo classes.

If you're interested in this feature, please review before I merge!

liZe added 7 commits December 4, 2016 16:12
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.
Use only the punctuation categories listed in the spec.
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.
@liZe liZe added the feature New feature that should be supported label Jan 2, 2017
@liZe liZe self-assigned this Jan 2, 2017
@liZe liZe merged commit d6ab8ff into master Feb 16, 2017
@liZe liZe deleted the first branch February 16, 2017 14:46
jsonn referenced this pull request in jsonn/pkgsrc 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature that should be supported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant