Bug 118012
| Summary: | Do not consider title from non-css stylesheet for preferred set | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> |
| Component: | CSS | Assignee: | Ryosuke Niwa <rniwa> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | ahmad.saleem792, ap, bfulgham, kling, koivisto, rniwa, simon.fraser, vitor.roriz, webkit-bug-importer, zalan |
| Priority: | P2 | Keywords: | BlinkMergeCandidate, InRadar |
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Ryosuke Niwa
Consider merging 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.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Ahmad Saleem
I took test cases from the Chrome / Blink commit:
Test Case - style-preferred-stylesheet-01.html - https://jsfiddle.net/v9t5rf81/show
*** Safari 15.6.1 on macOS 12.5.1 ***
Text is shown in red
*** Safari Technology Preview 151 ***
Text is shown in red
*** Chrome Canary 106 ***
Text is shown in "black" - Expected result
*** Firefox Nightly 105 ***
Text is shown in "black" - Expected result
____
Test Case - style-preferred-stylesheet-02.html - https://jsfiddle.net/yxLba59v/show
*** Safari 15.6.1 on macOS 12.5.1 ***
Text is shown in "green" - Expected result
*** Safari Technology Preview 151 ***
Text is shown in "green" - Expected result
*** Chrome Canary 106 ***
Text is shown in "green" - Expected result
*** Firefox Nightly 105 ***
Text is shown in "green" - Expected result
______
Safari is failing one of the two test. Just wanted to share updated results. Thanks!
Radar WebKit Bug Importer
<rdar://problem/98934685>
Brent Fulgham
@Vitor: could you look into this one?
Ahmad Saleem
Webkit GitHub Source:
https://github.com/WebKit/WebKit/blob/a39b520b8e0ca63489db7a45fe19181a33fac903/Source/WebCore/style/StyleScope.cpp#L373
_____
if (!enabledViaScript && !title.isEmpty() && m_preferredStylesheetSetName.isEmpty()) {
___
Blink Patch modifying:
if (!enabledViaScript && sheet && !title.isEmpty()) {
Ryosuke Niwa
Pull request: https://github.com/WebKit/WebKit/pull/3512
EWS
Committed 253632@main (4e99fbf6f75a): <https://commits.webkit.org/253632@main>
Reviewed commits have been landed. Closing PR #3512 and removing active labels.