Skip to content

[Mvc] CSS isolation fails with some HTML constructs #32542

Closed
@javiercn

Description

@javiercn

For the provided markup:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>@ViewData["Title"] - tmp</title>
    <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
    <link rel="stylesheet" href="~/css/site.css" />

    <link rel="stylesheet" href="tmp.styles.css" />
</head>

We produce:

<!DOCTYPE html>
 b-0pr8yvohll<html b-0pr8yvohll lang="en">
<head>
    <meta b-0pr8yvohll charset="utf-8" />
    <meta b-0pr8yvohll name="viewport" content="width=device-width, initial-scale=1.0" />
    <title b-0pr8yvohll>Home Page - tmp</title>
    <link rel="stylesheet" href="/lib/bootstrap/dist/css/bootstrap.min.css" />
    <link rel="stylesheet" href="/css/site.css" />

    <link b-0pr8yvohll rel="stylesheet" href="tmp.styles.css" />
</head>
  • We should fix adding the scope after the doctype declaration
  • We should stay away from applying the scope to meta, title, and other tags that appear only within the HEAD

Metadata

Metadata

Assignees

Labels

DoneThis issue has been fixedarea-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesbugThis issue describes a behavior which is not expected - a bug.feature-css-isolationThis issue is related to CSS Isolation feature

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions