Closed Bug 1808287 Opened 2 years ago Closed 2 years ago

:has() selector is not eorking in 108

Categories

(Core :: CSS Parsing and Computation, defect)

Firefox 108
defect

Tracking

()

RESOLVED DUPLICATE of bug 418039

People

(Reporter: marko, Unassigned)

Details

Attachments

(1 file)

Attached file test.html

Steps to reproduce:

<!doctype html>
<html lang="en" data-bs-theme="dark">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Test">
<meta name="author" content="">
<title>Test</title>
<link href="favicon.ico" rel="shortcut icon" type="image/x-icon">
</head>
<body>

    <style>
        h1, h2 {
            margin: 0 0 1.0rem 0;
            border:1px solid red;
        }

        h1:has(+ h2) {
            margin: 0 0 0.25rem 0;
            border:1px solid green;
        }

    </style>

    <section>
        <article>
            <h1>Morning Times</h1>
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
        </article>
        <article>
            <h1>Morning Times</h1>
            <h2>Delivering you news every morning</h2>
            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
        </article>
    </section>
</body>

</html>

Actual results:

has() is ignored

Expected results:

Shuld work lake all other normal browsers

The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core
Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Duplicate of bug: has-pseudo
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: