Skip to content

Resolve loose comparison in removeDeclarationBlockBySelector() #1330

@JakeQZ

Description

@JakeQZ

This is a method of CSSList (which Document extends).

If it is not passed an array of Selector objects (directly, or indirectly via a DeclarationBlock), then it will construct a new array of Selector objects for use in comparison using ==, comparing the arrays.

AFAIK, any comparison involving objects, even if loose, requires the objects to be the same instances for a match. [Edit: I am seemingly proven wrong, though would like to understand the behaviour better.]

The only current tests for it inovle passing an existing DelcarationBlock; there are no tests that pass selectors as strings. [Edit: tests added in #1335.]

This may be a candidate for removal. @sabberworm, @oliverklee, WDYT? [Edit: it actually, surprisingly, works.]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions