Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/WebKit/WebKit
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Feb 15, 2025
2 parents 3c241a0 + aae338b commit 3b5adae
Show file tree
Hide file tree
Showing 261 changed files with 3,589 additions and 1,168 deletions.
8 changes: 4 additions & 4 deletions LayoutTests/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -7646,10 +7646,10 @@ imported/w3c/web-platform-tests/css/css-viewport/zoom/text-stroke-width.html [ I
imported/w3c/web-platform-tests/css/css-viewport/zoom/word-spacing.html [ ImageOnlyFailure ]

# has-slotted is not implemeneted - https://bugs.webkit.org/show_bug.cgi?id=280608
imported/w3c/web-platform-tests/css/css-scoping/has-slotted-001.tentative.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-scoping/has-slotted-003.tentative.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-scoping/has-slotted-flattened-001.tentative.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-scoping/has-slotted-flattened-003.tentative.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-scoping/has-slotted-001.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-scoping/has-slotted-003.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-scoping/has-slotted-flattened-001.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-scoping/has-slotted-flattened-003.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-scoping/has-slotted-functional-001.tentative.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-scoping/has-slotted-functional-004.tentative.html [ ImageOnlyFailure ]
imported/w3c/web-platform-tests/css/css-scoping/has-slotted-functional-006.tentative.html [ ImageOnlyFailure ]
Expand Down
26 changes: 26 additions & 0 deletions LayoutTests/editing/caret/caret-position-sideways-lr-expected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
This is a test of writingsideways in vertical text
with multiline text and alongwordthat'slong andanotherword.
Bug 286961 : 62,44,20,1
Click at 5, 5 for left above first line : 17,21,25,1
Click at 5, 275 for right above first line : 17,21,25,1
Click at 25, 5 for left of first line : 17,21,25,1
Click at 25, 275 for right of first line : 17,237,25,1
Click at 45, 5 for left of second line : 42,21,20,1
Click at 45, 275 for right of second line : 42,248,20,1
Click at 65, 5 for left of third line : 62,21,20,1
Click at 65, 275 for right of third line : 62,176,20,1
Click at 85, 5 for left of fourth line : 82,21,20,1
Click at 85, 275 for right of fourth line : 82,262,20,1
Click at 105, 5 for left of fifth line : 102,21,19,1
Click at 105, 275 for right of fifth line : 102,68,19,1
Click at 125, 5 for left of sixth line : 121,21,20,1
Click at 125, 275 for right of sixth line : 121,260,20,1
Click at 145, 5 for left of seventh line : 141,21,20,1
Click at 145, 275 for right of seventh line : 141,200,20,1
Click at 170, 5 for left below last line : 141,200,20,1
Click at 170, 275 for right below last line : 141,200,20,1
Click at 25, 30 for inside first root inline fragment : 17,32,25,1
Click at 125, 30 for inside middle fragment of root inline fragment : 121,32,20,1
Click at 45, 30 for inside middle fragment of non-root inline fragment : 42,32,20,1
Click at 65, 30 for inside last fragment of non-root inline fragment : 62,32,20,1
Click at 85, 220 for inside unfragmented non-root inline : 82,225,20,1
125 changes: 125 additions & 0 deletions LayoutTests/editing/caret/caret-position-sideways-lr.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<html>
<style>
#test {
writing-mode: sideways-lr;
/* If this test ends up being flaky, consider using Ahem. But it's more rigorous not to. */
outline: solid gray 1px;
padding: 1em;
width: 10em;
height: 20ch;
font: 20px/1 monospace;
background: /* Create a 10px grid to help with debugging. */
repeating-linear-gradient(transparent 0em 9px, #FC88 9px 10px),
repeating-linear-gradient(to left, transparent 0px 9px, #FC88 9px 10px);
}
span {
border: 1px solid aqua;
}
</style>

<div id=test contenteditable>
This is a test <span id=first>of writingsideways in vertical text</span><br>
with multiline <span id=second>text</span> and alongwordthat'slong andanotherword.
</div>

<hr>

<ul id="console"></ul>

<script src="../../resources/ui-helper.js"></script>
<script>

var test = document.getElementById('test');
var first = document.getElementById('first');
var second = document.getElementById('second');

var testLeftEdge = test.offsetLeft;
var testTopEdge = test.offsetTop;
var testBottomEdge = test.offsetTop + test.offsetHeight;
var measure = test.offsetHeight;

function stringifyCaret(caretRect) {
// Convert to LTR-relative coords and stringify
return (caretRect.x - testLeftEdge) + ","
+ -(caretRect.y - testBottomEdge) + ","
+ caretRect.width + ","
+ caretRect.height;
}

function log(str) {
var li = document.createElement("li");
li.appendChild(document.createTextNode(str));
var console = document.getElementById("console");
console.appendChild(li);
}

function testCaretPosition(testID, element)
{
element.focus();
var caretRect = window.internals.absoluteCaretBounds();
log(testID + " : " + stringifyCaret(caretRect));
}

async function clickInTest(target, blockCoord, inlineCoord)
{
if (window.eventSender) {
await UIHelper.activateAt(testLeftEdge + blockCoord, testBottomEdge - inlineCoord);
}
else {
log("FAIL: could not send click event");
}
}

// To make it easier to reason about individual tests, this test method
// accepts click coordinates in LTR-relative terms. See helper functions for conversion.
async function testCaretClick(testID, blockCoord, inlineCoord, element)
{
await clickInTest(element, blockCoord, inlineCoord);
testCaretPosition("Click at " + blockCoord + ", " + inlineCoord + " for " + testID, element);
}

async function runTest()
{
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
}

// Tests for bugs that are oddly specific and hard to describe
window.getSelection().collapse(first.firstChild, 24);
await testCaretPosition("Bug 286961", first);

// Check caret insertion
await testCaretClick("left above first line", 5, 5, test);
await testCaretClick("right above first line", 5, measure - 5, test);

await testCaretClick("left of first line", 25, 5, test);
await testCaretClick("right of first line", 25, measure - 5, test);
await testCaretClick("left of second line", 45, 5, test);
await testCaretClick("right of second line", 45, measure - 5, test);
await testCaretClick("left of third line", 65, 5, test);
await testCaretClick("right of third line", 65, measure - 5, test);
await testCaretClick("left of fourth line", 85, 5, test);
await testCaretClick("right of fourth line", 85, measure - 5, test);
await testCaretClick("left of fifth line", 105, 5, test);
await testCaretClick("right of fifth line", 105, measure - 5, test);
await testCaretClick("left of sixth line", 125, 5, test);
await testCaretClick("right of sixth line", 125, measure - 5, test);
await testCaretClick("left of seventh line", 145, 5, test);
await testCaretClick("right of seventh line", 145, measure - 5, test);

await testCaretClick("left below last line", 170, 5, test);
await testCaretClick("right below last line", 170, measure - 5, test);

await testCaretClick("inside first root inline fragment", 25, 30, test);
await testCaretClick("inside middle fragment of root inline fragment", 125, 30, test);
await testCaretClick("inside middle fragment of non-root inline fragment", 45, 30, first);
await testCaretClick("inside last fragment of non-root inline fragment", 65, 30, first);
await testCaretClick("inside unfragmented non-root inline", 85, measure - 60, second);

testRunner.notifyDone();
}

runTest();

</script>
42 changes: 42 additions & 0 deletions LayoutTests/fast/css/color-achromatic-epsilon-expected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

PASS Property color value 'oklch(from white l c h)'
PASS Property color value 'oklch(from black l c h)'
PASS Property color value 'oklch(from grey l c h)'
PASS Property color value 'lch(from white l c h)'
PASS Property color value 'lch(from black l c h)'
PASS Property color value 'lch(from grey l c h)'
PASS Property color value 'oklch(from oklab(0.5 0.0000079 0.0000079) l c h)'
PASS Property color value 'oklch(from oklab(0.5 -0.0000079 -0.0000079) l c h)'
PASS Property color value 'oklch(from oklab(0.5 0.0000079 -0.0000079) l c h)'
PASS Property color value 'oklch(from oklab(0.5 -0.0000079 0.0000079) l c h)'
PASS Property color value 'lch(from lab(50 0.00249 0.00249) l c h)'
PASS Property color value 'lch(from lab(50 -0.00249 -0.00249) l c h)'
PASS Property color value 'lch(from lab(50 0.00249 -0.00249) l c h)'
PASS Property color value 'lch(from lab(50 -0.00249 0.00249) l c h)'
PASS Property color value 'oklch(from #e5f6ff l c h)'
PASS Property color value 'lch(from #e5f6ff l c h)'
PASS Property color value 'oklch(from oklab(0.5 0.000008 0.000008) l c h)'
PASS Property color value 'oklch(from oklab(0.5 -0.0000080 -0.0000080) l c h)'
PASS Property color value 'oklch(from oklab(0.5 0.0000080 -0.0000080) l c h)'
PASS Property color value 'oklch(from oklab(0.5 -0.0000080 0.0000080) l c h)'
PASS Property color value 'oklch(from oklab(0.5 0.1 0.0000080) l c h)'
PASS Property color value 'oklch(from oklab(0.5 -0.1 -0.0000080) l c h)'
PASS Property color value 'oklch(from oklab(0.5 0.1 -0.0000080) l c h)'
PASS Property color value 'oklch(from oklab(0.5 -0.1 0.0000080) l c h)'
PASS Property color value 'oklch(from oklab(0.5 0.0000080 0.1) l c h)'
PASS Property color value 'oklch(from oklab(0.5 -0.0000080 -0.1) l c h)'
PASS Property color value 'oklch(from oklab(0.5 0.0000080 -0.1) l c h)'
PASS Property color value 'oklch(from oklab(0.5 -0.0000080 0.1) l c h)'
PASS Property color value 'lch(from lab(50 0.01 0.01) l c h)'
PASS Property color value 'lch(from lab(50 -0.01 -0.01) l c h)'
PASS Property color value 'lch(from lab(50 0.01 -0.01) l c h)'
PASS Property color value 'lch(from lab(50 -0.01 0.01) l c h)'
PASS Property color value 'lch(from lab(50 25 0.01) l c h)'
PASS Property color value 'lch(from lab(50 -25 -0.01) l c h)'
PASS Property color value 'lch(from lab(50 25 -0.01) l c h)'
PASS Property color value 'lch(from lab(50 -25 0.01) l c h)'
PASS Property color value 'lch(from lab(50 0.01 25) l c h)'
PASS Property color value 'lch(from lab(50 -0.01 -25) l c h)'
PASS Property color value 'lch(from lab(50 0.01 -25) l c h)'
PASS Property color value 'lch(from lab(50 -0.01 25) l c h)'

66 changes: 66 additions & 0 deletions LayoutTests/fast/css/color-achromatic-epsilon.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../../imported/w3c/web-platform-tests/css/support/computed-testcommon.js"></script>
<script src="../../imported/w3c/web-platform-tests/css/support/color-testcommon.js"></script>
</head>
<body>
<div id="container">
<div id="target"></div>
</div>
<script>

// Test achromatic colors do not have a hue.
fuzzy_test_computed_color("oklch(from white l c h)", "oklch(1 0 0)");
fuzzy_test_computed_color("oklch(from black l c h)", "oklch(0 0 0)");
fuzzy_test_computed_color("oklch(from grey l c h)", "oklch(0.599 0 0)");
fuzzy_test_computed_color("lch(from white l c h)", "lch(100 0 0)");
fuzzy_test_computed_color("lch(from black l c h)", "lch(0 0 0)");
fuzzy_test_computed_color("lch(from grey l c h)", "lch(53.585 0 0)");

// Test mostly achromatic (less than epsilon chroma) colors do not have a hue.
// epsilon for oklab/oklch is `0.8 / 100000.0` or `0.000008`
fuzzy_test_computed_color("oklch(from oklab(0.5 0.0000079 0.0000079) l c h)", "oklch(0.5 0 0)");
fuzzy_test_computed_color("oklch(from oklab(0.5 -0.0000079 -0.0000079) l c h)", "oklch(0.5 0 0)");
fuzzy_test_computed_color("oklch(from oklab(0.5 0.0000079 -0.0000079) l c h)", "oklch(0.5 0 0)");
fuzzy_test_computed_color("oklch(from oklab(0.5 -0.0000079 0.0000079) l c h)", "oklch(0.5 0 0)");
// epsilon for lab/lch is `250.0 / 100000.0` or `0.0025`
fuzzy_test_computed_color("lch(from lab(50 0.00249 0.00249) l c h)", "lch(50 0 0)");
fuzzy_test_computed_color("lch(from lab(50 -0.00249 -0.00249) l c h)", "lch(50 0 0)");
fuzzy_test_computed_color("lch(from lab(50 0.00249 -0.00249) l c h)", "lch(50 0 0)");
fuzzy_test_computed_color("lch(from lab(50 -0.00249 0.00249) l c h)", "lch(50 0 0)");

// Test colors that have small chroma (greater than epsilon) do have a hue.
fuzzy_test_computed_color("oklch(from #e5f6ff l c h)", "oklch(0.963 0.022 230.537)");
fuzzy_test_computed_color("lch(from #e5f6ff l c h)", "lch(95.815 7.783 234.717)");
fuzzy_test_computed_color("oklch(from oklab(0.5 0.000008 0.000008) l c h)", "oklch(0.5 0 45)");
fuzzy_test_computed_color("oklch(from oklab(0.5 -0.0000080 -0.0000080) l c h)", "oklch(0.5 0 225)");
fuzzy_test_computed_color("oklch(from oklab(0.5 0.0000080 -0.0000080) l c h)", "oklch(0.5 0 315)");
fuzzy_test_computed_color("oklch(from oklab(0.5 -0.0000080 0.0000080) l c h)", "oklch(0.5 0 135)");
fuzzy_test_computed_color("oklch(from oklab(0.5 0.1 0.0000080) l c h)", "oklch(0.5 0.1 0)");
fuzzy_test_computed_color("oklch(from oklab(0.5 -0.1 -0.0000080) l c h)", "oklch(0.5 0.1 180)");
fuzzy_test_computed_color("oklch(from oklab(0.5 0.1 -0.0000080) l c h)", "oklch(0.5 0.1 360)");
fuzzy_test_computed_color("oklch(from oklab(0.5 -0.1 0.0000080) l c h)", "oklch(0.5 0.1 180)");
fuzzy_test_computed_color("oklch(from oklab(0.5 0.0000080 0.1) l c h)", "oklch(0.5 0.1 90)");
fuzzy_test_computed_color("oklch(from oklab(0.5 -0.0000080 -0.1) l c h)", "oklch(0.5 0.1 270)");
fuzzy_test_computed_color("oklch(from oklab(0.5 0.0000080 -0.1) l c h)", "oklch(0.5 0.1 270)");
fuzzy_test_computed_color("oklch(from oklab(0.5 -0.0000080 0.1) l c h)", "oklch(0.5 0.1 90)");
fuzzy_test_computed_color("lch(from lab(50 0.01 0.01) l c h)", "lch(50 0.014 45)");
fuzzy_test_computed_color("lch(from lab(50 -0.01 -0.01) l c h)", "lch(50 0.014 225)");
fuzzy_test_computed_color("lch(from lab(50 0.01 -0.01) l c h)", "lch(50 0.014 315)");
fuzzy_test_computed_color("lch(from lab(50 -0.01 0.01) l c h)", "lch(50 0.014 135)");
fuzzy_test_computed_color("lch(from lab(50 25 0.01) l c h)", "lch(50 25 0.023)");
fuzzy_test_computed_color("lch(from lab(50 -25 -0.01) l c h)", "lch(50 25 180.022)");
fuzzy_test_computed_color("lch(from lab(50 25 -0.01) l c h)", "lch(50 25 359.977)");
fuzzy_test_computed_color("lch(from lab(50 -25 0.01) l c h)", "lch(50 25 179.977)");
fuzzy_test_computed_color("lch(from lab(50 0.01 25) l c h)", "lch(50 25 89.977)");
fuzzy_test_computed_color("lch(from lab(50 -0.01 -25) l c h)", "lch(50 25 269.977)");
fuzzy_test_computed_color("lch(from lab(50 0.01 -25) l c h)", "lch(50 25 270.023)");
fuzzy_test_computed_color("lch(from lab(50 -0.01 25) l c h)", "lch(50 25 90.023)");

</script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="[email protected]">
<p>Test passes if there is a filled green square.</p>
<div style="width:100px; height:100px; background:green;"></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!doctype html>
<meta charset="utf-8">
<title>:has-slotted</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/pull/10586">
<link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div id="host">
<template shadowrootmode="open">
<style>
slot {
display: block;
width: 100px;
height: 100px;
background-color: red;
}
::slotted(:has(:first-child)) {
display: block;
width: 100px;
height: 100px;
background-color: green;
}
</style>
<slot></slot>
</template>
<div><div></div></div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="[email protected]">
<p>Test passes if there is a filled green square.</p>
<div style="width:100px; height:100px; background:green;"></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!doctype html>
<meta charset="utf-8">
<title>:has-slotted</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/pull/10586">
<link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div id="host">
<template shadowrootmode="open">
<style>
slot {
display: block;
width: 100px;
height: 100px;
background-color: red;
}
::slotted(:has(:last-child)) {
display: block;
width: 100px;
height: 100px;
background-color: green;
}
</style>
<slot></slot>
</template>
<div><div></div></div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="[email protected]">
<p>Test passes if there is a filled green square.</p>
<div style="width:100px; height:100px; background:green;"></div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!doctype html>
<meta charset="utf-8">
<title>:has-slotted</title>
<link rel="help" href="https://github.com/w3c/csswg-drafts/pull/10586">
<link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html">
<p>Test passes if there is a filled green square.</p>
<div id="host">
<template shadowrootmode="open">
<style>
slot {
display: block;
width: 100px;
height: 100px;
background-color: red;
}
::slotted(:has(:first-child:last-child)) {
display: block;
width: 100px;
height: 100px;
background-color: green;
}
</style>
<slot></slot>
</template>
<div><div></div></div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="[email protected]">
<p>Test passes if there is a filled green square.</p>
<div style="width:100px; height:100px; background:green;"></div>
Loading

0 comments on commit 3b5adae

Please sign in to comment.