pypi soupsieve 4.1.4

one hour ago

4.1.4

  • FIX: Names and values from a document, such as tag names, attribute names, and the values of dir, type,
    and contenteditable, are no longer held in memory after the document is released. They were lowered for
    comparison through a cache shared by every call, which limited the number of strings but not their size, so a
    long running process matching untrusted documents could hold many large strings. Names are now cached only for
    the life of a single select(), match(), filter(), or closest() call, and values are not cached. A value
    that is only compared to keywords, such as dir="rtl", is not lowered when it is longer than any keyword, as it
    can't match one, so a long value adds nothing to the cost of matching.
  • FIX: :defined now follows the HTML specification's custom element names in HTML documents, as Chrome and
    Firefox do. Names reserved by HTML, such as font-face, are not custom element names and are matched, while a
    hyphenated name with a colon, such as prefix:my-element, is one and is no longer matched. When the parser records
    namespaces, as html5lib does, hyphenated SVG and MathML elements are matched too, as they can't be custom
    elements (@Muneer320).
  • FIX: :defined in XHTML documents now follows the element's namespace instead of its prefix, as browsers do.
    Previously, an element in the default namespace was treated as prefixed, so custom elements such as <x-foo>
    were matched. Now only elements in the XHTML namespace can be undefined, whatever their prefix. Names with an
    uppercase ASCII letter, and names reserved by HTML, such as font-face, are not custom element names and are
    matched.
  • FIX: :root no longer matches an element that has a top level text sibling made only of non-ASCII white space,
    such as a non-breaking space, as such text was treated as white space. Only HTML white space is ignored, as with
    :empty.
  • FIX: [*|attr] now matches the attribute in any namespace, such as xlink:href for [*|href], and not only
    the attribute without a namespace. When an element has several, such as href and xlink:href, [*|attr=value]
    matches if any of them has the value, and [*|attr!=value] only if none of them does.
  • FIX: Attribute names are only matched without case sensitivity on HTML elements in HTML documents, as the HTML
    specification says and Firefox and Safari do. On SVG and MathML elements in an HTML document, the name must now
    match exactly, so [viewbox] no longer matches an SVG element's viewBox. A document parsed without namespaces,
    such as with html.parser, only has HTML elements, so it is unaffected.
  • FIX: Element names are only matched without case sensitivity on HTML elements in HTML documents, as the HTML
    specification says and Firefox and Safari do. On SVG and MathML elements in an HTML document, the name must now
    match exactly, so lineargradient no longer matches an SVG element's linearGradient. A document parsed without
    namespaces, such as with html.parser, only has HTML elements, so it is unaffected (@Juanna470).

Don't miss a new soupsieve release

NewReleases is sending notifications on new releases.