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 7 commits into from Feb 16, 2017

Handle ::first-letter #407

merged 7 commits into from Feb 16, 2017


Copy link

@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!

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
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 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 <>`_:
  Handle ::first-letter.
* `#423 <>`_:
  Warn user about broken cairo versions.

Bug fixes:

* `#411 <>`_:
  Typos fixed in command-line help.

Version 0.35

Released on 2017-02-25.

Bug fixes:

* `#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
feature New feature that should be supported
None yet

Successfully merging this pull request may close these issues.

None yet

1 participant