Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Do not consider title from non-css stylesheet for preferred set
https://bugs.webkit.org/show_bug.cgi?id=118012 Reviewed by Antti Koivisto. Merge https://chromium.googlesource.com/chromium/blink/+/ac653f351a222c4ee80ddd656aaaf06c07d87125 Do not consider title from non-css stylesheet for preferred set. Title on a style element can be used to select the preferred stylesheet set. If the type attribute of the style element is not text/css, the title should never be set as the key for the preferred stylesheet set. * LayoutTests/fast/css/style-preferred-stylesheet-01-expected.html: Added. * LayoutTests/fast/css/style-preferred-stylesheet-01.html: Added. * LayoutTests/fast/css/style-preferred-stylesheet-02-expected.html: Added. * LayoutTests/fast/css/style-preferred-stylesheet-02.html: Added. * Source/WebCore/style/StyleScope.cpp: (WebCore::Style::Scope::collectActiveStyleSheets): Canonical link: https://commits.webkit.org/253632@main
- Loading branch information
Showing
5 changed files
with
15 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<!DOCTYPE html> | ||
<p>This text should not be red.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<!DOCTYPE html> | ||
<!-- title of a style element with invalid type should never be the preferred stylesheet set --> | ||
<style type="text/invalid" title="preferred"></style> | ||
<link rel="alternate stylesheet" type="text/css" title="preferred" href="data:text/css,p{color:red}"> | ||
<p>This text should not be red.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<!DOCTYPE html> | ||
<p style="color:green">This text should be green.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<!DOCTYPE html> | ||
<!-- title of a style element define the preferred stylesheet set --> | ||
<style type="text/css" title="preferred"></style> | ||
<link rel="alternate stylesheet" type="text/css" title="preferred" href="data:text/css,p{color:green}"> | ||
<p>This text should be green.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters