You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A descendant rule ending in :lang() or [lang] never applies #525
CssMerger::mergeDescendantCss() and mergeTableDescendantSelectors() look up tag, class, id, tag.class and tag#id keys, but no LANG>> or tag>>LANG>> key. The parts parse, so the rules are stored, but they are never read.
Measured on gravitypdf at b6a07921, PHP 8.5.4.
Rule
Element
Browser
mPDF
div :lang(fr) {color:green}
<div><p lang="fr">
green
black
div [lang=fr] {color:green}
<div><p lang="fr">
green
black
div p:lang(fr) {color:green}
<div><p lang="fr">
green
black
table :lang(fr) {color:green}
<table><tr><td lang="fr">
green
black
[lang=fr] p {color:green}
<div lang="fr"><p>
green
green
A lang ancestor works: mergeFullCssRules() does look up LANG>> when it lifts subtrees.
Fix. Add the LANG>> and tag>>LANG>> lookups to both methods, with the same fallback from fr-CA to fr that the simple groups use.
Tests. The first four rows, in block content and in a table cell.
Activity
Apply descendant rules that end in :lang() or [lang]