[qt/qt/qttools-litehtml]: Summary of bulk changes made

KDE Git Services - Bulk Change <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git repository change summary for qt/qt/qttools-litehtml
Pushed by mirror-service into branch 'upstream/master'.
Changed from eb1c8f3656142d60ef5e1bff4016159406ddb448 to b9e89f0b9494ff9a5f008800af35503efabddf59
Acknowledgement was received that this change introduces only existing code that has been pushed to another public open source repository.

This change contains the following new commits:

Git commit 4536da18ac2e9ad52ac8a454813df342816f50c8 by Yuri Kobets (on behalf of n0madic) on 31/07/2026 at 22:16..
Support @layer, @supports, :where() and non-rendered pseudo-elements

An unrecognized at-rule is discarded together with its whole block, and an
unrecognized pseudo-class or pseudo-element invalidates the entire selector
list of a rule. Stylesheets produced by current CSS tooling hit both cases
constantly and lose rules that litehtml is able to apply:

  @layer base { ... }                    whole block dropped
  @supports (display: flex) { ... }      whole block dropped
  :where(.a) { ... }                     rule dropped
  .btn, ::file-selector-button { ... }   rule dropped, including .btn
  :root, :host { --c: red }              rule dropped, including :root

@layer: cascade layers are not implemented, so a layer statement is ignored
and the rules of a layer block are used as if they were not layered.

@supports: a condition is evaluated by parsing the declaration with the same
code that parses a style block, so (display: flex) is true and (display: grid)
is false, and a not/and/or fallback chain now selects the branch that can
actually be rendered.

:where() matches like :is() and adds no specificity.

:host and the pseudo-elements for which no box is generated (::first-line,
::first-letter, ::selection, ::marker, ::placeholder, ::backdrop,
::file-selector-button) are parsed and never match, which is what they
already do today when they are the only selector of a rule.
https://invent.kde.org/qt/qt/qttools-litehtml/-/commit/4536da18ac2e9ad52ac8a454813df342816f50c8

Git commit c1f3295b05c7b46f19bdb092aaa7c853f528ce20 by Yuri Kobets (on behalf of n0madic) on 31/07/2026 at 22:16..
Invalidate a selector with a pseudo-element that is not in its last compound

"Only the last compound selector of a complex selector may contain a
pseudo-element", so `p::before p` and `p::first-line + p` are invalid and,
being part of a selector list, invalidate the whole rule.

This was already wrong for ::before and ::after: `p::before p, #p1` styled #p1.
It became visible for ::first-line and ::first-letter now that they parse
(css21/pseudo-001, pseudo-015 and pseudo-016).
https://invent.kde.org/qt/qt/qttools-litehtml/-/commit/c1f3295b05c7b46f19bdb092aaa7c853f528ce20

Git commit b9e89f0b9494ff9a5f008800af35503efabddf59 by Yuri Kobets (on behalf of n0madic) on 31/07/2026 at 22:26..
Allow building a document from an externally created element tree

A document can only be created by parsing an HTML string with gumbo. An
application that already has its own tree (another HTML parser, or a UI tree
that is not HTML) has to serialize it to HTML just so that litehtml can parse
it back, and there is no way to set the document mode for a tree it did not
parse itself.

Move the part of createFromString that runs after parsing into
finalize_from_external_root(), so the same finalization - stylesheets, computed
styles, render tree - can be applied to a tree built with create_element() and
element::appendChild(). Add set_document_mode(), because the mode has to be set
before elements are created (html_tag::set_attr uses it).

createFromString now calls finalize_from_external_root() and is otherwise
unchanged.
https://invent.kde.org/qt/qt/qttools-litehtml/-/commit/b9e89f0b9494ff9a5f008800af35503efabddf59
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.