Skip to content

Fix Chromium issue 41089999: SVG attribute value matching should be case sensitive when applying style #131

Description

@hjanuschka

Chromium Issue

https://issues.chromium.org/issues/41089999

Description

Fixed a long-standing spec compliance bug where Blink applied ASCII case-insensitive attribute value matching to SVG (and other empty-namespace) elements when it should only apply to HTML elements. Selectors like [color="RED"] were incorrectly matching <circle color="red"> in SVG.

CLs involved

  1. https://chromium-review.googlesource.com/c/chromium/src/+/7956604
    Match SVG attribute values case-sensitively when applying style. Legacy ASCII case-insensitive attribute value matching now requires the element to be an HTML element, not just in an HTML document, so SVG and empty-namespace elements compare attribute values case-sensitively.
  2. https://chromium-review.googlesource.com/c/chromium/src/+/8010611
    Reland of the above with a hot-path fix: attr_case_insensitive is precomputed once in FillMissingData() and stored on the query, avoiding a per-element RuntimeEnabledFeatures lookup and restoring blink_perf.parser/query-selector-all-class performance.

Demo

https://static.januschka.com/i-41089999/

Status

Both CLs merged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions