svg_conform 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.github/workflows/rake.yml +15 -0
- data/.github/workflows/release.yml +23 -0
- data/.github/workflows/svgcheck-compatibility.yml +135 -0
- data/.gitignore +12 -0
- data/.rspec +3 -0
- data/.rubocop.yml +13 -0
- data/.rubocop_todo.yml +183 -0
- data/CODE_OF_CONDUCT.md +132 -0
- data/Gemfile +14 -0
- data/README.adoc +1384 -0
- data/Rakefile +15 -0
- data/config/profiles/base.yml +34 -0
- data/config/profiles/lucid_fix.yml +37 -0
- data/config/profiles/metanorma.yml +212 -0
- data/config/profiles/no_external_css.yml +20 -0
- data/config/profiles/svg_1_2_rfc.yml +284 -0
- data/config/profiles/svg_1_2_rfc_with_rdf.yml +145 -0
- data/config/svgcheck_mapping.yml +180 -0
- data/docs/profiles.adoc +547 -0
- data/docs/rdf_metadata_support.adoc +212 -0
- data/docs/remediation.adoc +732 -0
- data/docs/requirements.adoc +709 -0
- data/examples/demo.rb +116 -0
- data/examples/requirements_demo.rb +240 -0
- data/exe/svg_conform +7 -0
- data/lib/svg_conform/batch_report.rb +70 -0
- data/lib/svg_conform/cli.rb +107 -0
- data/lib/svg_conform/commands/check.rb +390 -0
- data/lib/svg_conform/commands/profiles.rb +118 -0
- data/lib/svg_conform/commands/svgcheck.rb +90 -0
- data/lib/svg_conform/commands/svgcheck_compare.rb +92 -0
- data/lib/svg_conform/commands/svgcheck_compatibility.rb +43 -0
- data/lib/svg_conform/commands/svgcheck_generate.rb +262 -0
- data/lib/svg_conform/compatibility/analysis_context.rb +68 -0
- data/lib/svg_conform/compatibility/comparison_result.rb +147 -0
- data/lib/svg_conform/compatibility/compatibility_analyzer.rb +85 -0
- data/lib/svg_conform/compatibility/file_processor.rb +109 -0
- data/lib/svg_conform/compatibility/pattern_discovery.rb +319 -0
- data/lib/svg_conform/compatibility/report_formatter.rb +359 -0
- data/lib/svg_conform/compatibility/svg_analysis_engine.rb +316 -0
- data/lib/svg_conform/compatibility/validity_analysis.rb +252 -0
- data/lib/svg_conform/compatibility/xml_analysis_engine.rb +198 -0
- data/lib/svg_conform/compatibility_analyzer.rb +285 -0
- data/lib/svg_conform/conformance_report.rb +267 -0
- data/lib/svg_conform/constants.rb +199 -0
- data/lib/svg_conform/css_color.rb +262 -0
- data/lib/svg_conform/document.rb +203 -0
- data/lib/svg_conform/external_checkers/svgcheck/compatibility_engine.rb +166 -0
- data/lib/svg_conform/external_checkers/svgcheck/output_generator.rb +101 -0
- data/lib/svg_conform/external_checkers/svgcheck/parser.rb +200 -0
- data/lib/svg_conform/external_checkers/svgcheck/report_comparator.rb +175 -0
- data/lib/svg_conform/external_checkers/svgcheck/report_generator.rb +82 -0
- data/lib/svg_conform/external_checkers/svgcheck/validation_pipeline.rb +249 -0
- data/lib/svg_conform/external_checkers/svgcheck.rb +56 -0
- data/lib/svg_conform/external_checkers.rb +34 -0
- data/lib/svg_conform/fixer.rb +56 -0
- data/lib/svg_conform/profile.rb +164 -0
- data/lib/svg_conform/profiles.rb +60 -0
- data/lib/svg_conform/remediation_engine.rb +92 -0
- data/lib/svg_conform/remediation_result.rb +36 -0
- data/lib/svg_conform/remediation_runner.rb +225 -0
- data/lib/svg_conform/remediations/base_remediation.rb +165 -0
- data/lib/svg_conform/remediations/color_remediation.rb +226 -0
- data/lib/svg_conform/remediations/font_embedding_remediation.rb +145 -0
- data/lib/svg_conform/remediations/font_remediation.rb +122 -0
- data/lib/svg_conform/remediations/image_embedding_remediation.rb +154 -0
- data/lib/svg_conform/remediations/invalid_id_references_remediation.rb +129 -0
- data/lib/svg_conform/remediations/namespace_attribute_remediation.rb +244 -0
- data/lib/svg_conform/remediations/namespace_remediation.rb +151 -0
- data/lib/svg_conform/remediations/no_external_css_remediation.rb +192 -0
- data/lib/svg_conform/remediations/style_promotion_remediation.rb +93 -0
- data/lib/svg_conform/remediations/viewbox_remediation.rb +127 -0
- data/lib/svg_conform/remediations.rb +40 -0
- data/lib/svg_conform/report_comparator.rb +772 -0
- data/lib/svg_conform/requirements/allowed_elements_requirement.rb +367 -0
- data/lib/svg_conform/requirements/base_requirement.rb +98 -0
- data/lib/svg_conform/requirements/color_restrictions_requirement.rb +126 -0
- data/lib/svg_conform/requirements/element_requirement_config.rb +75 -0
- data/lib/svg_conform/requirements/font_family_requirement.rb +133 -0
- data/lib/svg_conform/requirements/forbidden_content_requirement.rb +60 -0
- data/lib/svg_conform/requirements/id_reference_requirement.rb +133 -0
- data/lib/svg_conform/requirements/invalid_id_references_requirement.rb +132 -0
- data/lib/svg_conform/requirements/link_validation_requirement.rb +55 -0
- data/lib/svg_conform/requirements/namespace_attributes_requirement.rb +211 -0
- data/lib/svg_conform/requirements/namespace_requirement.rb +294 -0
- data/lib/svg_conform/requirements/no_external_css_requirement.rb +132 -0
- data/lib/svg_conform/requirements/no_external_fonts_requirement.rb +121 -0
- data/lib/svg_conform/requirements/no_external_images_requirement.rb +91 -0
- data/lib/svg_conform/requirements/style_promotion_requirement.rb +72 -0
- data/lib/svg_conform/requirements/style_requirement.rb +226 -0
- data/lib/svg_conform/requirements/viewbox_required_requirement.rb +96 -0
- data/lib/svg_conform/requirements.rb +49 -0
- data/lib/svg_conform/semantic_comparator.rb +829 -0
- data/lib/svg_conform/validation_context.rb +408 -0
- data/lib/svg_conform/validation_result.rb +146 -0
- data/lib/svg_conform/validator.rb +91 -0
- data/lib/svg_conform/version.rb +5 -0
- data/lib/svg_conform.rb +68 -0
- data/lib/tasks/fixtures.rake +321 -0
- data/lib/tasks/svgcheck.rake +111 -0
- data/reference-docs/SVG-1.2-RFC.rnc.txt +1676 -0
- data/reference-docs/Scalable Vector Graphics (SVG) 1.1 (Second Edition).html +40764 -0
- data/reference-docs/Scalable Vector Graphics (SVG) Tiny 1.2 Specification.html +44591 -0
- data/reference-docs/rfc7996.txt +2971 -0
- data/sig/svg_conform.rbs +4 -0
- data/spec/fixtures/allowed_elements/inputs/basic_violations.svg +21 -0
- data/spec/fixtures/allowed_elements/repair/basic_violations.svg +18 -0
- data/spec/fixtures/color_restrictions/inputs/basic_violations.svg +23 -0
- data/spec/fixtures/color_restrictions/repair/basic_violations.svg +23 -0
- data/spec/fixtures/comprehensive/inputs/multiple_violations.svg +21 -0
- data/spec/fixtures/comprehensive/repair/multiple_violations.svg +16 -0
- data/spec/fixtures/font_family/inputs/basic_violations.svg +17 -0
- data/spec/fixtures/font_family/repair/basic_violations.svg +17 -0
- data/spec/fixtures/forbidden_content/inputs/basic_violations.svg +27 -0
- data/spec/fixtures/forbidden_content/repair/basic_violations.svg +19 -0
- data/spec/fixtures/id_reference/inputs/basic_violations.svg +17 -0
- data/spec/fixtures/id_reference/repair/basic_violations.svg +15 -0
- data/spec/fixtures/link_validation/inputs/basic_violations.svg +20 -0
- data/spec/fixtures/link_validation/repair/basic_violations.svg +16 -0
- data/spec/fixtures/lucid/inputs/simple.svg +67 -0
- data/spec/fixtures/lucid/repair/simple.svg +63 -0
- data/spec/fixtures/namespace/inputs/basic_violations.svg +20 -0
- data/spec/fixtures/namespace/repair/basic_violations.svg +17 -0
- data/spec/fixtures/namespace_attributes/inputs/basic_violations.svg +16 -0
- data/spec/fixtures/namespace_attributes/repair/basic_violations.svg +15 -0
- data/spec/fixtures/no_external_css/inputs/basic_violations.svg +20 -0
- data/spec/fixtures/no_external_css/repair/basic_violations.svg +18 -0
- data/spec/fixtures/style/inputs/basic_violations.svg +22 -0
- data/spec/fixtures/style/repair/basic_violations.svg +22 -0
- data/spec/fixtures/style_promotion/inputs/basic_test.svg +15 -0
- data/spec/fixtures/style_promotion/repair/basic_test.svg +15 -0
- data/spec/fixtures/svg_1_2_rfc/inputs/allowed_elements_violations.svg +18 -0
- data/spec/fixtures/svg_1_2_rfc/inputs/color_restrictions_violations.svg +23 -0
- data/spec/fixtures/svgcheck/check/DrawBerry-sample-2.svg.code +1 -0
- data/spec/fixtures/svgcheck/check/DrawBerry-sample-2.svg.err +0 -0
- data/spec/fixtures/svgcheck/check/DrawBerry-sample-2.svg.out +23 -0
- data/spec/fixtures/svgcheck/check/IETF-test.svg.code +1 -0
- data/spec/fixtures/svgcheck/check/IETF-test.svg.err +0 -0
- data/spec/fixtures/svgcheck/check/IETF-test.svg.out +20 -0
- data/spec/fixtures/svgcheck/check/circle.svg.code +1 -0
- data/spec/fixtures/svgcheck/check/circle.svg.err +0 -0
- data/spec/fixtures/svgcheck/check/circle.svg.out +2 -0
- data/spec/fixtures/svgcheck/check/colors.svg.code +1 -0
- data/spec/fixtures/svgcheck/check/colors.svg.err +0 -0
- data/spec/fixtures/svgcheck/check/colors.svg.out +13 -0
- data/spec/fixtures/svgcheck/check/dia-sample-svg.svg.code +1 -0
- data/spec/fixtures/svgcheck/check/dia-sample-svg.svg.err +0 -0
- data/spec/fixtures/svgcheck/check/dia-sample-svg.svg.out +76 -0
- data/spec/fixtures/svgcheck/check/example-dot.svg.code +1 -0
- data/spec/fixtures/svgcheck/check/example-dot.svg.err +0 -0
- data/spec/fixtures/svgcheck/check/example-dot.svg.out +11 -0
- data/spec/fixtures/svgcheck/check/full-tiny.svg.code +1 -0
- data/spec/fixtures/svgcheck/check/full-tiny.svg.err +0 -0
- data/spec/fixtures/svgcheck/check/full-tiny.svg.out +5835 -0
- data/spec/fixtures/svgcheck/check/good.svg.code +1 -0
- data/spec/fixtures/svgcheck/check/good.svg.err +0 -0
- data/spec/fixtures/svgcheck/check/good.svg.out +1 -0
- data/spec/fixtures/svgcheck/check/httpbis-proxy20-fig6.svg.code +1 -0
- data/spec/fixtures/svgcheck/check/httpbis-proxy20-fig6.svg.err +0 -0
- data/spec/fixtures/svgcheck/check/httpbis-proxy20-fig6.svg.out +5 -0
- data/spec/fixtures/svgcheck/check/malformed.svg.code +1 -0
- data/spec/fixtures/svgcheck/check/malformed.svg.err +0 -0
- data/spec/fixtures/svgcheck/check/malformed.svg.out +8 -0
- data/spec/fixtures/svgcheck/check/rfc-svg.svg.code +1 -0
- data/spec/fixtures/svgcheck/check/rfc-svg.svg.err +0 -0
- data/spec/fixtures/svgcheck/check/rfc-svg.svg.out +1 -0
- data/spec/fixtures/svgcheck/check/rfc.xml.code +1 -0
- data/spec/fixtures/svgcheck/check/rfc.xml.err +0 -0
- data/spec/fixtures/svgcheck/check/rfc.xml.out +2 -0
- data/spec/fixtures/svgcheck/check/rgb.svg.code +1 -0
- data/spec/fixtures/svgcheck/check/rgb.svg.err +0 -0
- data/spec/fixtures/svgcheck/check/rgb.svg.out +9 -0
- data/spec/fixtures/svgcheck/check/svg-wordle.svg.code +1 -0
- data/spec/fixtures/svgcheck/check/svg-wordle.svg.err +0 -0
- data/spec/fixtures/svgcheck/check/svg-wordle.svg.out +508 -0
- data/spec/fixtures/svgcheck/check/threshold.svg.code +1 -0
- data/spec/fixtures/svgcheck/check/threshold.svg.err +0 -0
- data/spec/fixtures/svgcheck/check/threshold.svg.out +20 -0
- data/spec/fixtures/svgcheck/check/utf8.svg.code +1 -0
- data/spec/fixtures/svgcheck/check/utf8.svg.err +0 -0
- data/spec/fixtures/svgcheck/check/utf8.svg.out +162 -0
- data/spec/fixtures/svgcheck/check/viewBox-both.svg.code +1 -0
- data/spec/fixtures/svgcheck/check/viewBox-both.svg.err +0 -0
- data/spec/fixtures/svgcheck/check/viewBox-both.svg.out +4 -0
- data/spec/fixtures/svgcheck/check/viewBox-height.svg.code +1 -0
- data/spec/fixtures/svgcheck/check/viewBox-height.svg.err +0 -0
- data/spec/fixtures/svgcheck/check/viewBox-height.svg.out +3 -0
- data/spec/fixtures/svgcheck/check/viewBox-none.svg.code +1 -0
- data/spec/fixtures/svgcheck/check/viewBox-none.svg.err +0 -0
- data/spec/fixtures/svgcheck/check/viewBox-none.svg.out +3 -0
- data/spec/fixtures/svgcheck/check/viewBox-width.svg.code +1 -0
- data/spec/fixtures/svgcheck/check/viewBox-width.svg.err +0 -0
- data/spec/fixtures/svgcheck/check/viewBox-width.svg.out +3 -0
- data/spec/fixtures/svgcheck/inputs/DrawBerry-sample-2.svg +28 -0
- data/spec/fixtures/svgcheck/inputs/IETF-test.svg +28 -0
- data/spec/fixtures/svgcheck/inputs/circle.svg +3 -0
- data/spec/fixtures/svgcheck/inputs/colors.svg +18 -0
- data/spec/fixtures/svgcheck/inputs/dia-sample-svg.svg +47 -0
- data/spec/fixtures/svgcheck/inputs/example-dot.svg +75 -0
- data/spec/fixtures/svgcheck/inputs/full-tiny.svg +16194 -0
- data/spec/fixtures/svgcheck/inputs/good.svg +19 -0
- data/spec/fixtures/svgcheck/inputs/httpbis-proxy20-fig6.svg +2 -0
- data/spec/fixtures/svgcheck/inputs/malformed.svg +11 -0
- data/spec/fixtures/svgcheck/inputs/rfc-svg.svg +1028 -0
- data/spec/fixtures/svgcheck/inputs/rfc.xml +37 -0
- data/spec/fixtures/svgcheck/inputs/rgb.svg +9 -0
- data/spec/fixtures/svgcheck/inputs/svg-wordle.svg +330 -0
- data/spec/fixtures/svgcheck/inputs/threshold.svg +26 -0
- data/spec/fixtures/svgcheck/inputs/utf8.svg +448 -0
- data/spec/fixtures/svgcheck/inputs/viewBox-both.svg +3 -0
- data/spec/fixtures/svgcheck/inputs/viewBox-height.svg +3 -0
- data/spec/fixtures/svgcheck/inputs/viewBox-none.svg +3 -0
- data/spec/fixtures/svgcheck/inputs/viewBox-width.svg +3 -0
- data/spec/fixtures/svgcheck/repair/DrawBerry-sample-2.svg.code +1 -0
- data/spec/fixtures/svgcheck/repair/DrawBerry-sample-2.svg.err +0 -0
- data/spec/fixtures/svgcheck/repair/DrawBerry-sample-2.svg.file +0 -0
- data/spec/fixtures/svgcheck/repair/DrawBerry-sample-2.svg.out +23 -0
- data/spec/fixtures/svgcheck/repair/IETF-test.svg.code +1 -0
- data/spec/fixtures/svgcheck/repair/IETF-test.svg.err +0 -0
- data/spec/fixtures/svgcheck/repair/IETF-test.svg.file +29 -0
- data/spec/fixtures/svgcheck/repair/IETF-test.svg.out +20 -0
- data/spec/fixtures/svgcheck/repair/circle.svg.code +1 -0
- data/spec/fixtures/svgcheck/repair/circle.svg.err +0 -0
- data/spec/fixtures/svgcheck/repair/circle.svg.file +4 -0
- data/spec/fixtures/svgcheck/repair/circle.svg.out +2 -0
- data/spec/fixtures/svgcheck/repair/colors.svg.code +1 -0
- data/spec/fixtures/svgcheck/repair/colors.svg.err +0 -0
- data/spec/fixtures/svgcheck/repair/colors.svg.file +19 -0
- data/spec/fixtures/svgcheck/repair/colors.svg.out +13 -0
- data/spec/fixtures/svgcheck/repair/dia-sample-svg.svg.code +1 -0
- data/spec/fixtures/svgcheck/repair/dia-sample-svg.svg.err +0 -0
- data/spec/fixtures/svgcheck/repair/dia-sample-svg.svg.file +47 -0
- data/spec/fixtures/svgcheck/repair/dia-sample-svg.svg.out +76 -0
- data/spec/fixtures/svgcheck/repair/example-dot.svg.code +1 -0
- data/spec/fixtures/svgcheck/repair/example-dot.svg.err +0 -0
- data/spec/fixtures/svgcheck/repair/example-dot.svg.file +69 -0
- data/spec/fixtures/svgcheck/repair/example-dot.svg.out +11 -0
- data/spec/fixtures/svgcheck/repair/good.svg.code +1 -0
- data/spec/fixtures/svgcheck/repair/good.svg.err +0 -0
- data/spec/fixtures/svgcheck/repair/good.svg.file +0 -0
- data/spec/fixtures/svgcheck/repair/good.svg.out +1 -0
- data/spec/fixtures/svgcheck/repair/httpbis-proxy20-fig6.svg.code +1 -0
- data/spec/fixtures/svgcheck/repair/httpbis-proxy20-fig6.svg.err +0 -0
- data/spec/fixtures/svgcheck/repair/httpbis-proxy20-fig6.svg.file +73 -0
- data/spec/fixtures/svgcheck/repair/httpbis-proxy20-fig6.svg.out +5 -0
- data/spec/fixtures/svgcheck/repair/malformed.svg.code +1 -0
- data/spec/fixtures/svgcheck/repair/malformed.svg.err +0 -0
- data/spec/fixtures/svgcheck/repair/malformed.svg.file +9 -0
- data/spec/fixtures/svgcheck/repair/malformed.svg.out +8 -0
- data/spec/fixtures/svgcheck/repair/rfc-svg.svg.code +1 -0
- data/spec/fixtures/svgcheck/repair/rfc-svg.svg.err +0 -0
- data/spec/fixtures/svgcheck/repair/rfc-svg.svg.file +0 -0
- data/spec/fixtures/svgcheck/repair/rfc-svg.svg.out +1 -0
- data/spec/fixtures/svgcheck/repair/rfc.xml.code +1 -0
- data/spec/fixtures/svgcheck/repair/rfc.xml.err +0 -0
- data/spec/fixtures/svgcheck/repair/rfc.xml.file +37 -0
- data/spec/fixtures/svgcheck/repair/rfc.xml.out +2 -0
- data/spec/fixtures/svgcheck/repair/rgb.svg.code +1 -0
- data/spec/fixtures/svgcheck/repair/rgb.svg.err +0 -0
- data/spec/fixtures/svgcheck/repair/rgb.svg.file +10 -0
- data/spec/fixtures/svgcheck/repair/rgb.svg.out +9 -0
- data/spec/fixtures/svgcheck/repair/svg-wordle.svg.code +1 -0
- data/spec/fixtures/svgcheck/repair/svg-wordle.svg.err +0 -0
- data/spec/fixtures/svgcheck/repair/svg-wordle.svg.file +112 -0
- data/spec/fixtures/svgcheck/repair/svg-wordle.svg.out +508 -0
- data/spec/fixtures/svgcheck/repair/threshold.svg.code +1 -0
- data/spec/fixtures/svgcheck/repair/threshold.svg.err +0 -0
- data/spec/fixtures/svgcheck/repair/threshold.svg.file +27 -0
- data/spec/fixtures/svgcheck/repair/threshold.svg.out +20 -0
- data/spec/fixtures/svgcheck/repair/utf8.svg.code +1 -0
- data/spec/fixtures/svgcheck/repair/utf8.svg.err +0 -0
- data/spec/fixtures/svgcheck/repair/utf8.svg.file +381 -0
- data/spec/fixtures/svgcheck/repair/utf8.svg.out +162 -0
- data/spec/fixtures/svgcheck/repair/viewBox-both.svg.code +1 -0
- data/spec/fixtures/svgcheck/repair/viewBox-both.svg.err +0 -0
- data/spec/fixtures/svgcheck/repair/viewBox-both.svg.file +4 -0
- data/spec/fixtures/svgcheck/repair/viewBox-both.svg.out +4 -0
- data/spec/fixtures/svgcheck/repair/viewBox-height.svg.code +1 -0
- data/spec/fixtures/svgcheck/repair/viewBox-height.svg.err +0 -0
- data/spec/fixtures/svgcheck/repair/viewBox-height.svg.file +4 -0
- data/spec/fixtures/svgcheck/repair/viewBox-height.svg.out +3 -0
- data/spec/fixtures/svgcheck/repair/viewBox-none.svg.code +1 -0
- data/spec/fixtures/svgcheck/repair/viewBox-none.svg.err +0 -0
- data/spec/fixtures/svgcheck/repair/viewBox-none.svg.file +4 -0
- data/spec/fixtures/svgcheck/repair/viewBox-none.svg.out +3 -0
- data/spec/fixtures/svgcheck/repair/viewBox-width.svg.code +1 -0
- data/spec/fixtures/svgcheck/repair/viewBox-width.svg.err +0 -0
- data/spec/fixtures/svgcheck/repair/viewBox-width.svg.file +4 -0
- data/spec/fixtures/svgcheck/repair/viewBox-width.svg.out +3 -0
- data/spec/fixtures/viewbox_required/inputs/missing_viewbox.svg +10 -0
- data/spec/fixtures/viewbox_required/repair/missing_viewbox.svg +10 -0
- data/spec/spec_helper.rb +16 -0
- data/spec/svg_conform/batch_report_spec.rb +99 -0
- data/spec/svg_conform/commands/check_command_spec.rb +90 -0
- data/spec/svg_conform/commands/profiles_command_spec.rb +20 -0
- data/spec/svg_conform/commands/svgcheck_compare_command_spec.rb +13 -0
- data/spec/svg_conform/commands/svgcheck_compatibility_command_spec.rb +13 -0
- data/spec/svg_conform/commands/svgcheck_generate_command_spec.rb +14 -0
- data/spec/svg_conform/profiles/base_profile_spec.rb +42 -0
- data/spec/svg_conform/profiles/lucid_fix_profile_spec.rb +46 -0
- data/spec/svg_conform/profiles/lucid_profile_spec.rb +84 -0
- data/spec/svg_conform/profiles/metanorma_profile_spec.rb +62 -0
- data/spec/svg_conform/profiles/no_external_css_profile_spec.rb +66 -0
- data/spec/svg_conform/profiles/svg_1_2_rfc_profile_spec.rb +200 -0
- data/spec/svg_conform/profiles/svg_1_2_rfc_with_rdf_profile_spec.rb +81 -0
- data/spec/svg_conform/remediations/color_remediation_spec.rb +95 -0
- data/spec/svg_conform/remediations/font_embedding_remediation_spec.rb +20 -0
- data/spec/svg_conform/remediations/font_remediation_spec.rb +95 -0
- data/spec/svg_conform/remediations/image_embedding_remediation_spec.rb +20 -0
- data/spec/svg_conform/remediations/invalid_id_references_remediation_spec.rb +97 -0
- data/spec/svg_conform/remediations/namespace_attribute_remediation_spec.rb +97 -0
- data/spec/svg_conform/remediations/namespace_remediation_spec.rb +95 -0
- data/spec/svg_conform/remediations/no_external_css_remediation_spec.rb +97 -0
- data/spec/svg_conform/remediations/style_promotion_remediation_spec.rb +97 -0
- data/spec/svg_conform/remediations/viewbox_remediation_spec.rb +95 -0
- data/spec/svg_conform/requirements/allowed_elements_requirement_spec.rb +118 -0
- data/spec/svg_conform/requirements/color_restrictions_requirement_spec.rb +168 -0
- data/spec/svg_conform/requirements/font_family_requirement_spec.rb +188 -0
- data/spec/svg_conform/requirements/forbidden_content_requirement_spec.rb +195 -0
- data/spec/svg_conform/requirements/id_reference_requirement_spec.rb +78 -0
- data/spec/svg_conform/requirements/invalid_id_references_requirement_spec.rb +78 -0
- data/spec/svg_conform/requirements/link_validation_requirement_spec.rb +78 -0
- data/spec/svg_conform/requirements/namespace_attributes_requirement_spec.rb +86 -0
- data/spec/svg_conform/requirements/namespace_requirement_spec.rb +184 -0
- data/spec/svg_conform/requirements/no_external_css_requirement_spec.rb +78 -0
- data/spec/svg_conform/requirements/no_external_fonts_requirement_spec.rb +20 -0
- data/spec/svg_conform/requirements/no_external_images_requirement_spec.rb +20 -0
- data/spec/svg_conform/requirements/style_promotion_requirement_spec.rb +78 -0
- data/spec/svg_conform/requirements/style_requirement_spec.rb +76 -0
- data/spec/svg_conform/requirements/viewbox_required_requirement_spec.rb +165 -0
- data/spec/svg_conform_spec.rb +32 -0
- data/spec/svgcheck_compatibility_spec.rb +355 -0
- data/svg_conform.gemspec +35 -0
- metadata +436 -0
data/sig/svg_conform.rbs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
3
|
+
version="1.2" baseProfile="tiny" width="100" height="100" viewBox="0 0 100 100">
|
|
4
|
+
<title>Allowed Elements Test</title>
|
|
5
|
+
<desc>Testing allowed elements violations</desc>
|
|
6
|
+
|
|
7
|
+
<!-- Forbidden elements that should be removed -->
|
|
8
|
+
<script type="text/javascript">alert('This script should be removed');</script>
|
|
9
|
+
<clipPath id="clip"><rect x="0" y="0" width="50" height="50"/></clipPath>
|
|
10
|
+
<marker id="arrow" markerWidth="10" markerHeight="10"><path d="M 0 0 L 10 5 L 0 10 z"/></marker>
|
|
11
|
+
|
|
12
|
+
<!-- Valid elements -->
|
|
13
|
+
<g>
|
|
14
|
+
<rect x="10" y="10" width="80" height="80" fill="black" stroke="none"/>
|
|
15
|
+
<circle cx="50" cy="50" r="20" fill="white"/>
|
|
16
|
+
<text x="50" y="55" text-anchor="middle" font-family="serif">Valid</text>
|
|
17
|
+
</g>
|
|
18
|
+
|
|
19
|
+
<!-- Invalid attributes on valid elements -->
|
|
20
|
+
<rect x="5" y="5" width="10" height="10" fill="black" onclick="alert('click')"/>
|
|
21
|
+
</svg>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
3
|
+
version="1.2" baseProfile="tiny" width="100" height="100" viewBox="0 0 100 100">
|
|
4
|
+
<title>Allowed Elements Test</title>
|
|
5
|
+
<desc>Testing allowed elements violations</desc>
|
|
6
|
+
|
|
7
|
+
<!-- Forbidden elements removed -->
|
|
8
|
+
|
|
9
|
+
<!-- Valid elements remain -->
|
|
10
|
+
<g>
|
|
11
|
+
<rect x="10" y="10" width="80" height="80" fill="black" stroke="none"/>
|
|
12
|
+
<circle cx="50" cy="50" r="20" fill="white"/>
|
|
13
|
+
<text x="50" y="55" text-anchor="middle" font-family="serif">Valid</text>
|
|
14
|
+
</g>
|
|
15
|
+
|
|
16
|
+
<!-- Invalid attributes removed -->
|
|
17
|
+
<rect x="5" y="5" width="10" height="10" fill="black"/>
|
|
18
|
+
</svg>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny"
|
|
3
|
+
width="100" height="100" viewBox="0 0 100 100">
|
|
4
|
+
<title>Color Restrictions Test</title>
|
|
5
|
+
<desc>Testing color restrictions - should only allow black and white</desc>
|
|
6
|
+
|
|
7
|
+
<!-- Invalid colors that should be converted -->
|
|
8
|
+
<rect x="10" y="10" width="20" height="20" fill="red"/>
|
|
9
|
+
<rect x="40" y="10" width="20" height="20" fill="blue"/>
|
|
10
|
+
<rect x="70" y="10" width="20" height="20" fill="#00ff00"/>
|
|
11
|
+
<circle cx="25" cy="50" r="10" fill="rgb(255,0,255)"/>
|
|
12
|
+
<circle cx="50" cy="50" r="10" fill="orange"/>
|
|
13
|
+
<circle cx="75" cy="50" r="10" fill="#f0f"/>
|
|
14
|
+
|
|
15
|
+
<!-- Valid colors that should remain -->
|
|
16
|
+
<rect x="10" y="70" width="20" height="20" fill="black"/>
|
|
17
|
+
<rect x="40" y="70" width="20" height="20" fill="white"/>
|
|
18
|
+
<rect x="70" y="70" width="20" height="20" fill="none"/>
|
|
19
|
+
|
|
20
|
+
<!-- Style attributes with invalid colors -->
|
|
21
|
+
<path d="M 10 90 L 90 90" stroke="red" stroke-width="2"/>
|
|
22
|
+
<text x="50" y="45" fill="green" font-family="serif">Colors</text>
|
|
23
|
+
</svg>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny"
|
|
3
|
+
width="100" height="100" viewBox="0 0 100 100">
|
|
4
|
+
<title>Color Restrictions Test</title>
|
|
5
|
+
<desc>Testing color restrictions - should only allow black and white</desc>
|
|
6
|
+
|
|
7
|
+
<!-- Invalid colors converted to black/white -->
|
|
8
|
+
<rect x="10" y="10" width="20" height="20" fill="black"/>
|
|
9
|
+
<rect x="40" y="10" width="20" height="20" fill="black"/>
|
|
10
|
+
<rect x="70" y="10" width="20" height="20" fill="black"/>
|
|
11
|
+
<circle cx="25" cy="50" r="10" fill="black"/>
|
|
12
|
+
<circle cx="50" cy="50" r="10" fill="black"/>
|
|
13
|
+
<circle cx="75" cy="50" r="10" fill="black"/>
|
|
14
|
+
|
|
15
|
+
<!-- Valid colors remain -->
|
|
16
|
+
<rect x="10" y="70" width="20" height="20" fill="black"/>
|
|
17
|
+
<rect x="40" y="70" width="20" height="20" fill="white"/>
|
|
18
|
+
<rect x="70" y="70" width="20" height="20" fill="none"/>
|
|
19
|
+
|
|
20
|
+
<!-- Style colors fixed -->
|
|
21
|
+
<path d="M 10 90 L 90 90" stroke="black" stroke-width="2"/>
|
|
22
|
+
<text x="50" y="45" fill="black" font-family="serif">Colors</text>
|
|
23
|
+
</svg>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
3
|
+
xmlns:custom="http://custom.ns" version="1.2" baseProfile="tiny" width="200" height="150">
|
|
4
|
+
<title>Comprehensive Test</title>
|
|
5
|
+
<desc>Multiple violations combined</desc>
|
|
6
|
+
|
|
7
|
+
<!-- Missing viewBox, invalid colors, fonts, elements, namespaces -->
|
|
8
|
+
<script>alert('test');</script>
|
|
9
|
+
<clipPath id="clip"><rect x="0" y="0" width="100" height="100"/></clipPath>
|
|
10
|
+
|
|
11
|
+
<g custom:layer="test">
|
|
12
|
+
<rect x="10" y="10" width="40" height="30" fill="red" stroke="blue"
|
|
13
|
+
onclick="click()" style="border: 1px solid green"/>
|
|
14
|
+
<text x="70" y="30" font-family="Arial" fill="purple"
|
|
15
|
+
style="background: yellow; font-size: 14px">Bad Text</text>
|
|
16
|
+
<use xlink:href="#missing" custom:attr="invalid"/>
|
|
17
|
+
</g>
|
|
18
|
+
|
|
19
|
+
<circle cx="100" cy="80" r="20" fill="rgb(255,128,0)" style="stroke: #ff00ff"/>
|
|
20
|
+
<path d="M 10 100 Q 50 120 90 100" fill="none" stroke="rainbow"/>
|
|
21
|
+
</svg>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
3
|
+
version="1.2" baseProfile="tiny" width="200" height="150" viewBox="0 0 200 150">
|
|
4
|
+
<title>Comprehensive Test</title>
|
|
5
|
+
<desc>Multiple violations combined</desc>
|
|
6
|
+
|
|
7
|
+
<!-- Fixed: viewBox added, forbidden elements removed -->
|
|
8
|
+
|
|
9
|
+
<g>
|
|
10
|
+
<rect x="10" y="10" width="40" height="30" fill="black" stroke="black"/>
|
|
11
|
+
<text x="70" y="30" font-family="sans-serif" fill="black" font-size="14">Bad Text</text>
|
|
12
|
+
</g>
|
|
13
|
+
|
|
14
|
+
<circle cx="100" cy="80" r="20" fill="black" stroke="black"/>
|
|
15
|
+
<path d="M 10 100 Q 50 120 90 100" fill="none" stroke="black"/>
|
|
16
|
+
</svg>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny"
|
|
3
|
+
width="200" height="100" viewBox="0 0 200 100">
|
|
4
|
+
<title>Font Family Violations</title>
|
|
5
|
+
<desc>Testing font family restrictions - should only allow generic families</desc>
|
|
6
|
+
|
|
7
|
+
<!-- Invalid specific font families -->
|
|
8
|
+
<text x="10" y="20" font-family="Arial">Arial Text</text>
|
|
9
|
+
<text x="10" y="40" font-family="Times New Roman">Times Text</text>
|
|
10
|
+
<text x="10" y="60" font-family="Helvetica, Arial, sans-serif">Mixed Fonts</text>
|
|
11
|
+
<text x="10" y="80" font-family="Comic Sans MS">Comic Sans</text>
|
|
12
|
+
|
|
13
|
+
<!-- Valid generic font families -->
|
|
14
|
+
<text x="120" y="20" font-family="serif">Serif</text>
|
|
15
|
+
<text x="120" y="40" font-family="sans-serif">Sans</text>
|
|
16
|
+
<text x="120" y="60" font-family="monospace">Mono</text>
|
|
17
|
+
</svg>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny"
|
|
3
|
+
width="200" height="100" viewBox="0 0 200 100">
|
|
4
|
+
<title>Font Family Violations</title>
|
|
5
|
+
<desc>Testing font family restrictions - should only allow generic families</desc>
|
|
6
|
+
|
|
7
|
+
<!-- Fixed to generic font families -->
|
|
8
|
+
<text x="10" y="20" font-family="sans-serif">Arial Text</text>
|
|
9
|
+
<text x="10" y="40" font-family="serif">Times Text</text>
|
|
10
|
+
<text x="10" y="60" font-family="sans-serif">Mixed Fonts</text>
|
|
11
|
+
<text x="10" y="80" font-family="sans-serif">Comic Sans</text>
|
|
12
|
+
|
|
13
|
+
<!-- Valid generic font families -->
|
|
14
|
+
<text x="120" y="20" font-family="serif">Serif</text>
|
|
15
|
+
<text x="120" y="40" font-family="sans-serif">Sans</text>
|
|
16
|
+
<text x="120" y="60" font-family="monospace">Mono</text>
|
|
17
|
+
</svg>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny"
|
|
3
|
+
width="100" height="100" viewBox="0 0 100 100">
|
|
4
|
+
<title>Forbidden Content</title>
|
|
5
|
+
<desc>Testing forbidden multimedia, animation, and scripting content</desc>
|
|
6
|
+
|
|
7
|
+
<!-- Forbidden elements -->
|
|
8
|
+
<script type="text/javascript">alert('forbidden');</script>
|
|
9
|
+
<audio src="sound.mp3" controls="true"/>
|
|
10
|
+
<video src="movie.mp4" controls="true"/>
|
|
11
|
+
|
|
12
|
+
<!-- Animation elements -->
|
|
13
|
+
<rect x="10" y="10" width="20" height="20" fill="black">
|
|
14
|
+
<animate attributeName="x" from="10" to="50" dur="2s" repeatCount="indefinite"/>
|
|
15
|
+
</rect>
|
|
16
|
+
|
|
17
|
+
<circle cx="50" cy="50" r="10" fill="white">
|
|
18
|
+
<animateColor attributeName="fill" from="white" to="black" dur="1s"/>
|
|
19
|
+
</circle>
|
|
20
|
+
|
|
21
|
+
<!-- Forbidden event attributes -->
|
|
22
|
+
<rect x="70" y="10" width="20" height="20" fill="black"
|
|
23
|
+
onclick="doSomething()" onmouseover="highlight()"/>
|
|
24
|
+
|
|
25
|
+
<!-- Valid content -->
|
|
26
|
+
<text x="50" y="80" text-anchor="middle" font-family="serif">Valid Text</text>
|
|
27
|
+
</svg>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny"
|
|
3
|
+
width="100" height="100" viewBox="0 0 100 100">
|
|
4
|
+
<title>Forbidden Content</title>
|
|
5
|
+
<desc>Testing forbidden multimedia, animation, and scripting content</desc>
|
|
6
|
+
|
|
7
|
+
<!-- Forbidden elements removed -->
|
|
8
|
+
|
|
9
|
+
<!-- Animation elements without animation -->
|
|
10
|
+
<rect x="10" y="10" width="20" height="20" fill="black"/>
|
|
11
|
+
|
|
12
|
+
<circle cx="50" cy="50" r="10" fill="white"/>
|
|
13
|
+
|
|
14
|
+
<!-- Forbidden event attributes removed -->
|
|
15
|
+
<rect x="70" y="10" width="20" height="20" fill="black"/>
|
|
16
|
+
|
|
17
|
+
<!-- Valid content remains -->
|
|
18
|
+
<text x="50" y="80" text-anchor="middle" font-family="serif">Valid Text</text>
|
|
19
|
+
</svg>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
3
|
+
version="1.2" baseProfile="tiny" width="100" height="100" viewBox="0 0 100 100">
|
|
4
|
+
<title>ID Reference Violations</title>
|
|
5
|
+
<desc>Testing ID reference validation</desc>
|
|
6
|
+
|
|
7
|
+
<defs>
|
|
8
|
+
<rect id="valid-rect" x="0" y="0" width="10" height="10"/>
|
|
9
|
+
</defs>
|
|
10
|
+
|
|
11
|
+
<!-- Invalid ID references -->
|
|
12
|
+
<use xlink:href="#nonexistent" x="10" y="10"/>
|
|
13
|
+
<use xlink:href="#missing-element" x="30" y="10"/>
|
|
14
|
+
|
|
15
|
+
<!-- Valid ID reference -->
|
|
16
|
+
<use xlink:href="#valid-rect" x="50" y="10"/>
|
|
17
|
+
</svg>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
3
|
+
version="1.2" baseProfile="tiny" width="100" height="100" viewBox="0 0 100 100">
|
|
4
|
+
<title>ID Reference Violations</title>
|
|
5
|
+
<desc>Testing ID reference validation</desc>
|
|
6
|
+
|
|
7
|
+
<defs>
|
|
8
|
+
<rect id="valid-rect" x="0" y="0" width="10" height="10"/>
|
|
9
|
+
</defs>
|
|
10
|
+
|
|
11
|
+
<!-- Invalid ID references removed -->
|
|
12
|
+
|
|
13
|
+
<!-- Valid ID reference remains -->
|
|
14
|
+
<use xlink:href="#valid-rect" x="50" y="10"/>
|
|
15
|
+
</svg>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
3
|
+
version="1.2" baseProfile="tiny" width="100" height="100" viewBox="0 0 100 100">
|
|
4
|
+
<title>Link Validation</title>
|
|
5
|
+
<desc>Testing ASCII-only link validation per RFC 7996</desc>
|
|
6
|
+
|
|
7
|
+
<!-- Invalid non-ASCII links -->
|
|
8
|
+
<a xlink:href="http://example.com/ café">
|
|
9
|
+
<text x="10" y="20">Café Link</text>
|
|
10
|
+
</a>
|
|
11
|
+
|
|
12
|
+
<use xlink:href="#元素" x="10" y="40"/>
|
|
13
|
+
|
|
14
|
+
<!-- Valid ASCII links -->
|
|
15
|
+
<a xlink:href="http://example.com/cafe">
|
|
16
|
+
<text x="10" y="60">Valid Link</text>
|
|
17
|
+
</a>
|
|
18
|
+
|
|
19
|
+
<use xlink:href="#element" x="10" y="80"/>
|
|
20
|
+
</svg>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
3
|
+
version="1.2" baseProfile="tiny" width="100" height="100" viewBox="0 0 100 100">
|
|
4
|
+
<title>Link Validation</title>
|
|
5
|
+
<desc>Testing ASCII-only link validation per RFC 7996</desc>
|
|
6
|
+
|
|
7
|
+
<!-- Non-ASCII links removed -->
|
|
8
|
+
<text x="10" y="20">Café Link</text>
|
|
9
|
+
|
|
10
|
+
<!-- Valid ASCII links remain -->
|
|
11
|
+
<a xlink:href="http://example.com/cafe">
|
|
12
|
+
<text x="10" y="60">Valid Link</text>
|
|
13
|
+
</a>
|
|
14
|
+
|
|
15
|
+
<use xlink:href="#element" x="10" y="80"/>
|
|
16
|
+
</svg>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
2
|
+
xmlns:lucid="lucid" width="162" height="180.67">
|
|
3
|
+
<g transform="translate(-379 -209.66666666666669)" lucid:page-tab-id="0_0">
|
|
4
|
+
<path d="M380 216.67a6 6 0 0 1 6-6h148a6 6 0 0 1 6 6v166.66a6 6 0 0 1-6 6H386a6 6 0 0 1-6-6z"
|
|
5
|
+
stroke="#000" stroke-width="2" fill="#fff" />
|
|
6
|
+
<use xlink:href="#a"
|
|
7
|
+
transform="matrix(1,0,0,1,392,222.66666666666669) translate(49.54320987654321 17.77777777777778)" />
|
|
8
|
+
<use xlink:href="#b"
|
|
9
|
+
transform="matrix(1,0,0,1,392,222.66666666666669) translate(68 49.77777777777778)" />
|
|
10
|
+
<use xlink:href="#c"
|
|
11
|
+
transform="matrix(1,0,0,1,392,222.66666666666669) translate(48.46296296296296 81.77777777777777)" />
|
|
12
|
+
<use xlink:href="#b"
|
|
13
|
+
transform="matrix(1,0,0,1,392,222.66666666666669) translate(68 113.77777777777777)" />
|
|
14
|
+
<use xlink:href="#d"
|
|
15
|
+
transform="matrix(1,0,0,1,392,222.66666666666669) translate(42.19753086419753 145.77777777777777)" />
|
|
16
|
+
<defs>
|
|
17
|
+
<path
|
|
18
|
+
d="M130-224c-62 0-78 43-78 106 0 64 16 108 78 108s78-45 78-108-16-106-78-106zm0 228C53 4 15-39 15-118c-1-80 37-120 115-120s115 42 115 120C245-39 207 4 130 4"
|
|
19
|
+
id="e" />
|
|
20
|
+
<path
|
|
21
|
+
d="M125-118c4-37-41-34-68-26v132l23 4v8H8C5-13 21-9 28-12v-141c-7-3-23 1-20-12h47l2 13c31-23 98-29 98 31v109c7 3 23-1 20 12h-72v-8l22-4v-106"
|
|
22
|
+
id="f" />
|
|
23
|
+
<path
|
|
24
|
+
d="M84-170c49 0 66 33 63 87H46c-8 60 38 80 95 63v10C128-2 108 4 88 4 34 4 14-29 14-84c-1-54 22-86 70-86zm33 73c12-57-57-82-69-24-1 7-2 15-2 24h71"
|
|
25
|
+
id="g" />
|
|
26
|
+
<g id="a">
|
|
27
|
+
<use transform="matrix(0.06172839506172839,0,0,0.06172839506172839,0,0)" xlink:href="#e" />
|
|
28
|
+
<use transform="matrix(0.06172839506172839,0,0,0.06172839506172839,15.987654320987653,0)"
|
|
29
|
+
xlink:href="#f" />
|
|
30
|
+
<use transform="matrix(0.06172839506172839,0,0,0.06172839506172839,27.098765432098766,0)"
|
|
31
|
+
xlink:href="#g" />
|
|
32
|
+
</g>
|
|
33
|
+
<path d="M55 0v-9l38-5v-207c-22 1-53 0-70 4l-5 37H7v-56h207v56h-12l-5-37-70-3v206l37 5v9H55"
|
|
34
|
+
id="h" />
|
|
35
|
+
<path
|
|
36
|
+
d="M240-154L185 4h-14l-41-109L90 4H77L20-153c-7-3-23 1-20-12h79v8l-27 4L91-41l40-108h14l40 109 38-113-28-4v-8h63v8"
|
|
37
|
+
id="i" />
|
|
38
|
+
<path
|
|
39
|
+
d="M90-170c52 0 76 32 76 87 0 54-24 87-77 87-51 0-75-34-75-87 0-54 24-87 76-87zM89-10c39 0 46-35 46-73 0-39-7-73-46-73-39 1-44 34-44 73s6 72 44 73"
|
|
40
|
+
id="j" />
|
|
41
|
+
<g id="c">
|
|
42
|
+
<use transform="matrix(0.06172839506172839,0,0,0.06172839506172839,0,0)" xlink:href="#h" />
|
|
43
|
+
<use transform="matrix(0.06172839506172839,0,0,0.06172839506172839,11.975308641975307,0)"
|
|
44
|
+
xlink:href="#i" />
|
|
45
|
+
<use transform="matrix(0.06172839506172839,0,0,0.06172839506172839,27.962962962962962,0)"
|
|
46
|
+
xlink:href="#j" />
|
|
47
|
+
</g>
|
|
48
|
+
<path
|
|
49
|
+
d="M126-119c3-38-42-31-69-25v132l23 4v8H7v-8l21-4v-226l-24-4v-8h53l-1 98c31-22 99-31 99 31v109c7 3 23-1 20 12h-71v-8l22-4v-107"
|
|
50
|
+
id="k" />
|
|
51
|
+
<path
|
|
52
|
+
d="M57-145c16-10 35-24 60-25v45c-19 1-8-30-40-17l-20 6v124l29 4v8H7v-8l21-4v-141c-8-3-24 2-21-12h48"
|
|
53
|
+
id="l" />
|
|
54
|
+
<g id="d">
|
|
55
|
+
<use transform="matrix(0.06172839506172839,0,0,0.06172839506172839,0,0)" xlink:href="#h" />
|
|
56
|
+
<use transform="matrix(0.06172839506172839,0,0,0.06172839506172839,13.518518518518517,0)"
|
|
57
|
+
xlink:href="#k" />
|
|
58
|
+
<use transform="matrix(0.06172839506172839,0,0,0.06172839506172839,24.629629629629626,0)"
|
|
59
|
+
xlink:href="#l" />
|
|
60
|
+
<use transform="matrix(0.06172839506172839,0,0,0.06172839506172839,31.9753086419753,0)"
|
|
61
|
+
xlink:href="#g" />
|
|
62
|
+
<use transform="matrix(0.06172839506172839,0,0,0.06172839506172839,41.79012345679012,0)"
|
|
63
|
+
xlink:href="#g" />
|
|
64
|
+
</g>
|
|
65
|
+
</defs>
|
|
66
|
+
</g>
|
|
67
|
+
</svg>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
2
|
+
width="162" height="180.67" viewBox="0 0 162 180.67">
|
|
3
|
+
<g transform="translate(-379 -209.66666666666669)">
|
|
4
|
+
<path d="M380 216.67a6 6 0 0 1 6-6h148a6 6 0 0 1 6 6v166.66a6 6 0 0 1-6 6H386a6 6 0 0 1-6-6z"
|
|
5
|
+
stroke="#000" stroke-width="2" fill="#fff" />
|
|
6
|
+
<use xlink:href="#a"
|
|
7
|
+
transform="matrix(1,0,0,1,392,222.66666666666669) translate(49.54320987654321 17.77777777777778)" />
|
|
8
|
+
<use xlink:href="#c"
|
|
9
|
+
transform="matrix(1,0,0,1,392,222.66666666666669) translate(48.46296296296296 81.77777777777777)" />
|
|
10
|
+
<use xlink:href="#d"
|
|
11
|
+
transform="matrix(1,0,0,1,392,222.66666666666669) translate(42.19753086419753 145.77777777777777)" />
|
|
12
|
+
<defs>
|
|
13
|
+
<path
|
|
14
|
+
d="M130-224c-62 0-78 43-78 106 0 64 16 108 78 108s78-45 78-108-16-106-78-106zm0 228C53 4 15-39 15-118c-1-80 37-120 115-120s115 42 115 120C245-39 207 4 130 4"
|
|
15
|
+
id="e" />
|
|
16
|
+
<path
|
|
17
|
+
d="M125-118c4-37-41-34-68-26v132l23 4v8H8C5-13 21-9 28-12v-141c-7-3-23 1-20-12h47l2 13c31-23 98-29 98 31v109c7 3 23-1 20 12h-72v-8l22-4v-106"
|
|
18
|
+
id="f" />
|
|
19
|
+
<path
|
|
20
|
+
d="M84-170c49 0 66 33 63 87H46c-8 60 38 80 95 63v10C128-2 108 4 88 4 34 4 14-29 14-84c-1-54 22-86 70-86zm33 73c12-57-57-82-69-24-1 7-2 15-2 24h71"
|
|
21
|
+
id="g" />
|
|
22
|
+
<g id="a">
|
|
23
|
+
<use transform="matrix(0.06172839506172839,0,0,0.06172839506172839,0,0)" xlink:href="#e" />
|
|
24
|
+
<use transform="matrix(0.06172839506172839,0,0,0.06172839506172839,15.987654320987653,0)"
|
|
25
|
+
xlink:href="#f" />
|
|
26
|
+
<use transform="matrix(0.06172839506172839,0,0,0.06172839506172839,27.098765432098766,0)"
|
|
27
|
+
xlink:href="#g" />
|
|
28
|
+
</g>
|
|
29
|
+
<path d="M55 0v-9l38-5v-207c-22 1-53 0-70 4l-5 37H7v-56h207v56h-12l-5-37-70-3v206l37 5v9H55"
|
|
30
|
+
id="h" />
|
|
31
|
+
<path
|
|
32
|
+
d="M240-154L185 4h-14l-41-109L90 4H77L20-153c-7-3-23 1-20-12h79v8l-27 4L91-41l40-108h14l40 109 38-113-28-4v-8h63v8"
|
|
33
|
+
id="i" />
|
|
34
|
+
<path
|
|
35
|
+
d="M90-170c52 0 76 32 76 87 0 54-24 87-77 87-51 0-75-34-75-87 0-54 24-87 76-87zM89-10c39 0 46-35 46-73 0-39-7-73-46-73-39 1-44 34-44 73s6 72 44 73"
|
|
36
|
+
id="j" />
|
|
37
|
+
<g id="c">
|
|
38
|
+
<use transform="matrix(0.06172839506172839,0,0,0.06172839506172839,0,0)" xlink:href="#h" />
|
|
39
|
+
<use transform="matrix(0.06172839506172839,0,0,0.06172839506172839,11.975308641975307,0)"
|
|
40
|
+
xlink:href="#i" />
|
|
41
|
+
<use transform="matrix(0.06172839506172839,0,0,0.06172839506172839,27.962962962962962,0)"
|
|
42
|
+
xlink:href="#j" />
|
|
43
|
+
</g>
|
|
44
|
+
<path
|
|
45
|
+
d="M126-119c3-38-42-31-69-25v132l23 4v8H7v-8l21-4v-226l-24-4v-8h53l-1 98c31-22 99-31 99 31v109c7 3 23-1 20 12h-71v-8l22-4v-107"
|
|
46
|
+
id="k" />
|
|
47
|
+
<path
|
|
48
|
+
d="M57-145c16-10 35-24 60-25v45c-19 1-8-30-40-17l-20 6v124l29 4v8H7v-8l21-4v-141c-8-3-24 2-21-12h48"
|
|
49
|
+
id="l" />
|
|
50
|
+
<g id="d">
|
|
51
|
+
<use transform="matrix(0.06172839506172839,0,0,0.06172839506172839,0,0)" xlink:href="#h" />
|
|
52
|
+
<use transform="matrix(0.06172839506172839,0,0,0.06172839506172839,13.518518518518517,0)"
|
|
53
|
+
xlink:href="#k" />
|
|
54
|
+
<use transform="matrix(0.06172839506172839,0,0,0.06172839506172839,24.629629629629626,0)"
|
|
55
|
+
xlink:href="#l" />
|
|
56
|
+
<use transform="matrix(0.06172839506172839,0,0,0.06172839506172839,31.9753086419753,0)"
|
|
57
|
+
xlink:href="#g" />
|
|
58
|
+
<use transform="matrix(0.06172839506172839,0,0,0.06172839506172839,41.79012345679012,0)"
|
|
59
|
+
xlink:href="#g" />
|
|
60
|
+
</g>
|
|
61
|
+
</defs>
|
|
62
|
+
</g>
|
|
63
|
+
</svg>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
3
|
+
xmlns:custom="http://custom.namespace.com" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
4
|
+
version="1.2" baseProfile="tiny" width="100" height="100" viewBox="0 0 100 100">
|
|
5
|
+
<title>Namespace Violations</title>
|
|
6
|
+
|
|
7
|
+
<!-- Invalid namespace elements -->
|
|
8
|
+
<custom:element custom:attr="value"/>
|
|
9
|
+
<inkscape:layer inkscape:label="Background"/>
|
|
10
|
+
|
|
11
|
+
<!-- Invalid namespace attributes on valid elements -->
|
|
12
|
+
<rect x="10" y="10" width="20" height="20" custom:id="invalid" inkscape:export-filename="test.png"/>
|
|
13
|
+
<g custom:group="test" inkscape:groupmode="layer">
|
|
14
|
+
<circle cx="50" cy="50" r="15"/>
|
|
15
|
+
</g>
|
|
16
|
+
|
|
17
|
+
<!-- Valid namespaces -->
|
|
18
|
+
<use xlink:href="#test" x="10" y="10"/>
|
|
19
|
+
<text xml:space="preserve" x="10" y="90">Valid</text>
|
|
20
|
+
</svg>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
3
|
+
version="1.2" baseProfile="tiny" width="100" height="100" viewBox="0 0 100 100">
|
|
4
|
+
<title>Namespace Violations</title>
|
|
5
|
+
|
|
6
|
+
<!-- Invalid namespace elements removed -->
|
|
7
|
+
|
|
8
|
+
<!-- Invalid namespace attributes removed -->
|
|
9
|
+
<rect x="10" y="10" width="20" height="20"/>
|
|
10
|
+
<g>
|
|
11
|
+
<circle cx="50" cy="50" r="15"/>
|
|
12
|
+
</g>
|
|
13
|
+
|
|
14
|
+
<!-- Valid namespaces remain -->
|
|
15
|
+
<use xlink:href="#test" x="10" y="10"/>
|
|
16
|
+
<text xml:space="preserve" x="10" y="90">Valid</text>
|
|
17
|
+
</svg>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
3
|
+
xmlns:custom="http://custom.namespace.com" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
4
|
+
version="1.2" baseProfile="tiny" width="100" height="100" viewBox="0 0 100 100">
|
|
5
|
+
<title>Namespace Attributes Test</title>
|
|
6
|
+
|
|
7
|
+
<!-- Invalid namespace attributes on valid elements -->
|
|
8
|
+
<rect x="10" y="10" width="20" height="20" custom:id="invalid" inkscape:export-filename="test.png"/>
|
|
9
|
+
<g custom:group="test" inkscape:groupmode="layer">
|
|
10
|
+
<circle cx="50" cy="50" r="15"/>
|
|
11
|
+
</g>
|
|
12
|
+
|
|
13
|
+
<!-- Valid namespace attributes -->
|
|
14
|
+
<use xlink:href="#test" x="10" y="10"/>
|
|
15
|
+
<text xml:space="preserve" x="10" y="90">Valid</text>
|
|
16
|
+
</svg>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
3
|
+
version="1.2" baseProfile="tiny" width="100" height="100" viewBox="0 0 100 100">
|
|
4
|
+
<title>Namespace Attributes Test</title>
|
|
5
|
+
|
|
6
|
+
<!-- Invalid namespace attributes removed -->
|
|
7
|
+
<rect x="10" y="10" width="20" height="20"/>
|
|
8
|
+
<g>
|
|
9
|
+
<circle cx="50" cy="50" r="15"/>
|
|
10
|
+
</g>
|
|
11
|
+
|
|
12
|
+
<!-- Valid namespace attributes remain -->
|
|
13
|
+
<use xlink:href="#test" x="10" y="10"/>
|
|
14
|
+
<text xml:space="preserve" x="10" y="90">Valid</text>
|
|
15
|
+
</svg>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny"
|
|
3
|
+
width="100" height="100" viewBox="0 0 100 100">
|
|
4
|
+
<title>No External CSS Test</title>
|
|
5
|
+
<desc>Testing external CSS restrictions</desc>
|
|
6
|
+
|
|
7
|
+
<defs>
|
|
8
|
+
<style type="text/css">
|
|
9
|
+
@import url("external.css");
|
|
10
|
+
.internal { fill: black; }
|
|
11
|
+
</style>
|
|
12
|
+
</defs>
|
|
13
|
+
|
|
14
|
+
<!-- External stylesheet link -->
|
|
15
|
+
<link rel="stylesheet" href="styles.css"/>
|
|
16
|
+
|
|
17
|
+
<!-- Valid internal styles -->
|
|
18
|
+
<rect x="10" y="10" width="30" height="30" class="internal"/>
|
|
19
|
+
<circle cx="70" cy="25" r="15" style="fill: white; stroke: black"/>
|
|
20
|
+
</svg>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny"
|
|
3
|
+
width="100" height="100" viewBox="0 0 100 100">
|
|
4
|
+
<title>No External CSS Test</title>
|
|
5
|
+
<desc>Testing external CSS restrictions</desc>
|
|
6
|
+
|
|
7
|
+
<defs>
|
|
8
|
+
<style type="text/css">
|
|
9
|
+
.internal { fill: black; }
|
|
10
|
+
</style>
|
|
11
|
+
</defs>
|
|
12
|
+
|
|
13
|
+
<!-- External stylesheet link removed -->
|
|
14
|
+
|
|
15
|
+
<!-- Valid internal styles remain -->
|
|
16
|
+
<rect x="10" y="10" width="30" height="30" class="internal"/>
|
|
17
|
+
<circle cx="70" cy="25" r="15" style="fill: white; stroke: black"/>
|
|
18
|
+
</svg>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny"
|
|
3
|
+
width="150" height="150" viewBox="0 0 150 150">
|
|
4
|
+
<title>Style Violations</title>
|
|
5
|
+
<desc>Testing style attribute validation and property restrictions</desc>
|
|
6
|
+
|
|
7
|
+
<!-- Malformed style syntax -->
|
|
8
|
+
<rect x="10" y="10" width="30" height="30" style="fill:red;stroke"/>
|
|
9
|
+
<rect x="50" y="10" width="30" height="30" style="fill red; stroke: black"/>
|
|
10
|
+
<rect x="90" y="10" width="30" height="30" style="[[invalid-property]]: value"/>
|
|
11
|
+
|
|
12
|
+
<!-- Invalid style properties -->
|
|
13
|
+
<circle cx="25" cy="70" r="15" style="background-color: blue; margin: 10px"/>
|
|
14
|
+
<circle cx="65" cy="70" r="15" style="border: 1px solid red; padding: 5px"/>
|
|
15
|
+
|
|
16
|
+
<!-- Invalid property values -->
|
|
17
|
+
<path d="M 10 110 L 40 130 L 10 130 Z" style="fill: rainbow; stroke-width: auto"/>
|
|
18
|
+
<text x="75" y="125" style="font-family: Arial Black; text-decoration: blink">Invalid</text>
|
|
19
|
+
|
|
20
|
+
<!-- Valid styles -->
|
|
21
|
+
<rect x="10" y="90" width="30" height="20" style="fill: black; stroke: none"/>
|
|
22
|
+
</svg>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny"
|
|
3
|
+
width="150" height="150" viewBox="0 0 150 150">
|
|
4
|
+
<title>Style Violations</title>
|
|
5
|
+
<desc>Testing style attribute validation and property restrictions</desc>
|
|
6
|
+
|
|
7
|
+
<!-- Fixed malformed style syntax -->
|
|
8
|
+
<rect x="10" y="10" width="30" height="30" fill="black"/>
|
|
9
|
+
<rect x="50" y="10" width="30" height="30" fill="black" stroke="black"/>
|
|
10
|
+
<rect x="90" y="10" width="30" height="30"/>
|
|
11
|
+
|
|
12
|
+
<!-- Fixed - invalid properties removed -->
|
|
13
|
+
<circle cx="25" cy="70" r="15"/>
|
|
14
|
+
<circle cx="65" cy="70" r="15"/>
|
|
15
|
+
|
|
16
|
+
<!-- Fixed property values -->
|
|
17
|
+
<path d="M 10 110 L 40 130 L 10 130 Z" fill="black"/>
|
|
18
|
+
<text x="75" y="125" font-family="sans-serif">Invalid</text>
|
|
19
|
+
|
|
20
|
+
<!-- Valid styles remain -->
|
|
21
|
+
<rect x="10" y="90" width="30" height="20" style="fill: black; stroke: none"/>
|
|
22
|
+
</svg>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny"
|
|
3
|
+
width="120" height="80" viewBox="0 0 120 80">
|
|
4
|
+
<title>Style Promotion</title>
|
|
5
|
+
<desc>Testing style property promotion to attributes</desc>
|
|
6
|
+
|
|
7
|
+
<!-- Style properties that should be promoted -->
|
|
8
|
+
<rect x="10" y="10" width="30" height="20" style="fill: black; stroke: none"/>
|
|
9
|
+
<circle cx="60" cy="20" r="10" style="fill: white; stroke: black; stroke-width: 1"/>
|
|
10
|
+
<text x="10" y="50" style="font-family: serif; font-size: 12; fill: black">Text</text>
|
|
11
|
+
<path d="M 10 60 L 40 70 L 10 70 Z" style="fill: none; stroke: black; stroke-width: 2"/>
|
|
12
|
+
|
|
13
|
+
<!-- Mixed style and attribute (style should win) -->
|
|
14
|
+
<rect x="80" y="10" width="20" height="20" fill="white" style="fill: black"/>
|
|
15
|
+
</svg>
|