Repository navigation
SVG: apply CSS rules with id, compound and descendant selectors - #2201
Open
RavSinghChandan wants to merge 2 commits into
Open
RavSinghChandan wants to merge 2 commits into
RavSinghChandan wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mermaid styles flowcharts with rules such as
#mermaid-svg .node rect { fill: #ECECFF; stroke: #9370DB }. fpdf2 only reads class, element and*selectors, so these rules are ignored and every node of a Mermaid flowchart is drawn as a black box.Selectors made of element names, ids and classes, joined by descendant or child combinators (
#m .node rect,rect#a.b,g.node > rect), now apply. The rules of an element are applied by specificity, then in order, as in CSS; class, element and*rules behave as before. Selectors with pseudo-classes, attribute selectors or sibling combinators are still ignored. What is known about each element is kept, so matching takes linear time in the number of elements, even for a long selector over deeply nested groups.test_svg_css_selectors_with_ids_and_combinatorsandtest_svg_css_descendant_selectors_linear_timecover these; they fail without the change. None of the 258 SVGs with a<style>I tried fails where it did not before.