Bug 1436405 [wpt PR 9419] - Update list of properties whitelisted for first-letter, a=testonly

Automatic update from web-platform-tests
CSS Pseudo 4 [1] expands the list of properties that can apply to
::first-letter when compared to CSS Selectors 3. Our list was based
primarily off of CSS Selectors 3; update per Pseudo 4. Also whitelist
variables within ::first-letter.

[1]: https://drafts.csswg.org/css-pseudo-4/#first-letter-styling

Bug: 660026, 715661
Change-Id: I950c7881506f8c36c3b917aff0ed2f1709d194ce
Reviewed-on: https://chromium-review.googlesource.com/899859
Reviewed-by: Alan Cutter <alancutter@chromium.org>
Commit-Queue: Chris Nardi <cnardi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#535045}

<!-- Reviewable:start -->

<!-- Reviewable:end -->

wpt-commits: 5ed12a3d878689b79a43870a18d91e46f516e18e
wpt-pr: 9419
reapplied-commits: 370e267e160568862f1fd9ec246ab5bb840f586e, fe4514c84e7ad28e46bad5da93381deb99b177f3, 7806af854343c043a2645a4034fdc7812f65daad, 9ddfd21554293dec5a4bf2e5375ae4f3c9f2ded0, 75f63c4d1ebc949647184fd60972fc7b9fd4affb, 1f3a5b496acd2288cc8cf0c32af86cb35157ea4e, 88b42bd5847abac58a62c4d6b33c1509bfce5f3d, 15c2e4c690700c6c115f8afe5e44ded10d943538, c8d461ef1437641ae7d4ea1d21e1e60cd62910b0, a6088a5f48ee299386a84d2f771902267d7355b1, 0634cd8f08ebe0905a9188fb1398c7b5f889c5dc, c8ee4a012dae506ae06bb5b2ad50942b04c1aaaa, c2c352456a4cf62dcc12f851138b04397675a445, b93a8879555d2fa7e7d4e00a275513a3a6338b35, b86e1331cb36634fd33677043b61fc0c1d8485bc, 44ddf14fd3346658c3223f13652073fafbfa48fa, a1a5840a6bb53e305ba02bcbeb215659342d0edb, 7465cb110ae5ec2e2ca73182caf5293f0efc8fd5, aad5349b3458bc3414e274b33fa86a1123901ff2, eca0907980d2769c449894a6277c60c1a306792f, 38626987c0cfd6e715cfcc6f4f1a1209191a03c5, e4a67f7ddcde6cd99348e9104bd7ed07074da44a, bb3c9990840a0fae2afc840b5952d7874785b112, 042d7adef0bdb9dc80e825c3997ace7519477c42, 99f1ea44fc7915b8b7b33bce4732fa8765fd3ac2, b81999f30c1516a70c153de51a0331d14c8faead
This commit is contained in:
Chris Nardi 2018-03-06 18:12:47 +00:00 коммит произвёл James Graham
Родитель aef9280bb4
Коммит f7b25472a2
2 изменённых файлов: 92 добавлений и 0 удалений

Просмотреть файл

@ -310084,6 +310084,12 @@
{}
]
],
"css/css-pseudo/first-letter-property-whitelist.html": [
[
"/css/css-pseudo/first-letter-property-whitelist.html",
{}
]
],
"css/css-regions/cssomview-apis-no-region-chain-001.html": [
[
"/css/css-regions/cssomview-apis-no-region-chain-001.html",
@ -498221,6 +498227,10 @@
"5a7a51802925bda01fbb62c8635a0e3205683e51",
"reftest"
],
"css/css-pseudo/first-letter-property-whitelist.html": [
"38d0844f6ef10d214b7d23af45d02c8093d9c00e",
"testharness"
],
"css/css-pseudo/marker-and-other-pseudo-elements-ref.html": [
"73ab862dcf3131ae7d7166ef06e52db0cd0eb7c7",
"support"

Просмотреть файл

@ -0,0 +1,82 @@
<!DOCTYPE html>
<title>CSS Test: Properties allowed on ::first-letter pseudo elements</title>
<link rel="author" title="Chris Nardi" href="mailto:cnardi@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-pseudo-4/#first-letter-styling">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#target::first-letter {}
#target { visibility: hidden; }
</style>
<div id="target">text</div>
<script>
'use strict';
var style;
const target = document.querySelector("#target");
var defaultComputedStyle = getComputedStyle(target);
test(function() {
var styleRule = document.styleSheets[0].cssRules[0];
assert_equals(styleRule.selectorText, '#target::first-letter', 'make sure we have the correct style rule');
style = styleRule.style;
}, 'pre test setup');
var validProperties = {
backgroundAttachment: 'fixed',
backgroundBlendMode: 'hue',
backgroundClip: 'padding-box',
backgroundColor: 'rgb(10, 20, 30)',
backgroundImage: 'linear-gradient(black, white)',
backgroundOrigin: 'border-box',
backgroundPosition: 'left 10px top 20px',
backgroundRepeat: 'no-repeat',
backgroundSize: '10px 20px',
border: '40px dotted rgb(10, 20, 30)',
borderImage: 'linear-gradient(black, white) 10% / 20 / 30px repeat',
borderRadius: '10px 20px',
boxShadow: 'rgb(10, 20, 30) 10px 20px 30px 40px inset',
color: 'rgba(10, 20, 30, 0.4)',
float: 'right',
font: 'italic small-caps 900 normal 10px / 20px sans-serif',
fontFeatureSettings: '"vert" 2',
fontSizeAdjust: '0.5',
fontKerning: 'none',
fontVariationSettings: '"XHGT" 0.7',
letterSpacing: '12px',
margin: '10px 20px 30px 40px',
padding: '10px 20px 30px 40px',
opacity: '0.5',
textDecoration: 'overline wavy rgb(10, 20, 30)',
textJustify: 'inter-word',
textShadow: 'rgb(10, 20, 30) 10px 20px 30px',
textTransform: 'capitalize',
textUnderlinePosition: 'under',
verticalAlign: '12%',
wordSpacing: '12px'
};
var invalidProperties = {
transition: 'transform 1s',
transform: 'rotate(45deg)',
wordBreak: 'break-all'
};
function testFirstLetterProperty(property, rule, expected, reason) {
test(function() {
style[property] = "";
style[property] = rule;
assert_equals(getComputedStyle(target, '::first-letter')[property], expected);
style[property] = "";
}, reason);
}
for (var property in validProperties) {
testFirstLetterProperty(property, validProperties[property], validProperties[property],
"Whitelisted property " + property + " should be applied to first-letter pseudo elements.");
}
for (var property in invalidProperties) {
testFirstLetterProperty(property, invalidProperties[property], defaultComputedStyle[property],
"Non-whitelisted property " + property + " should not be applied to first-letter pseudo elements.");
}
</script>