-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementing drawPath delegate for DrawGlyphsRecorder
https://bugs.webkit.org/show_bug.cgi?id=262223 rdar://115721319 Reviewed by Said Abou-Hallawa. After a CoreText update, certain multi-coloured glyphs will no longer be drawn as a glyph (drawGlyphs) but as a path. However, up to now WebKit hasn't implemented the drawPath delegate, so this was making multi-coloured glyphs not to be drawn and thefefore, breaking some our tests. This path implements the drawPath delegate. Some tests were relying on implementation details of COLRv0 by CoreText. Multi-coloured glyphs, like the glyph for unicode "A" in Ahem-COLR.ttf won't be drawn as a glyph but as a path now. Therefore, certain things like line-dashing and strokes aren't supported, which is what COLRv0 expects and it is consistency with other browser engines implementations. For that reason we are rebasilining such tests. It might be that other tests on different platforms not tested here will also need rebaseline. Note: For Apple Platforms, these changes are only for Sonoma, when CoreText was updated. So we are keeping the former behavior for the former MAC OSes baselines. * LayoutTests/fast/text/canvas-color-fonts/linedash-COLR-expected.html: Copied from LayoutTests/fast/text/canvas-color-fonts/stroke-color-COLR-expected.html. * LayoutTests/fast/text/canvas-color-fonts/stroke-color-COLR-expected.html: * LayoutTests/fast/text/canvas-color-fonts/stroke-color-shadow-COLR-expected.html: * LayoutTests/fast/text/canvas-color-fonts/stroke-color-shadow-ctm-COLR-expected.html: * LayoutTests/fast/text/canvas-color-fonts/stroke-gradient-COLR-expected.html: * LayoutTests/fast/text/canvas-color-fonts/stroke-gradient-COLR.html: * LayoutTests/fast/text/glyph-display-lists/glyph-display-list-colr-unshared.html: * LayoutTests/platform/ios-wk2/TestExpectations: * LayoutTests/platform/ios/TestExpectations: * LayoutTests/platform/mac-monterey/fast/text/canvas-color-fonts/linedash-COLR-expected-mismatch.html: Copied from LayoutTests/fast/text/canvas-color-fonts/linedash-COLR-expected-mismatch.html. * LayoutTests/platform/mac-monterey/fast/text/canvas-color-fonts/stroke-color-COLR-expected.html: Copied from LayoutTests/fast/text/canvas-color-fonts/stroke-color-COLR-expected.html. * LayoutTests/platform/mac-monterey/fast/text/canvas-color-fonts/stroke-color-shadow-COLR-expected.html: Copied from LayoutTests/fast/text/canvas-color-fonts/stroke-color-shadow-COLR-expected.html. * LayoutTests/platform/mac-monterey/fast/text/canvas-color-fonts/stroke-color-shadow-ctm-COLR-expected.html: Copied from LayoutTests/fast/text/canvas-color-fonts/stroke-color-shadow-ctm-COLR-expected.html. * LayoutTests/platform/mac-monterey/fast/text/canvas-color-fonts/stroke-gradient-COLR-expected.html: Copied from LayoutTests/fast/text/canvas-color-fonts/stroke-gradient-COLR-expected.html. * LayoutTests/platform/mac-ventura/fast/text/canvas-color-fonts/linedash-COLR-expected-mismatch.html: Renamed from LayoutTests/fast/text/canvas-color-fonts/linedash-COLR-expected-mismatch.html. * LayoutTests/platform/mac-ventura/fast/text/canvas-color-fonts/stroke-color-COLR-expected.html: Copied from LayoutTests/fast/text/canvas-color-fonts/stroke-color-COLR-expected.html. * LayoutTests/platform/mac-ventura/fast/text/canvas-color-fonts/stroke-color-shadow-COLR-expected.html: Copied from LayoutTests/fast/text/canvas-color-fonts/stroke-color-shadow-COLR-expected.html. * LayoutTests/platform/mac-ventura/fast/text/canvas-color-fonts/stroke-color-shadow-ctm-COLR-expected.html: Copied from LayoutTests/fast/text/canvas-color-fonts/stroke-color-shadow-ctm-COLR-expected.html. * LayoutTests/platform/mac-ventura/fast/text/canvas-color-fonts/stroke-gradient-COLR-expected.html: Copied from LayoutTests/fast/text/canvas-color-fonts/stroke-gradient-COLR-expected.html. * LayoutTests/platform/mac-monterey/fast/text/resources/Ahem-COLR.ttf: Added. * LayoutTests/platform/mac-ventura/fast/text/resources/Ahem-COLR.ttf: Added. * LayoutTests/platform/mac-wk2/TestExpectations: * LayoutTests/platform/mac/TestExpectations: * Source/WebCore/PAL/pal/spi/cg/CoreGraphicsSPI.h: * Source/WebCore/platform/graphics/DrawGlyphsRecorder.h: * Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp: (WebCore::drawPath): (WebCore::DrawGlyphsRecorder::createInternalContext): (WebCore::DrawGlyphsRecorder::recordDrawPath): * LayoutTests/platform/gtk/fast/text/canvas-color-fonts/stroke-gradient-COLR-expected.html: Added. * LayoutTests/platform/gtk/fast/text/resources/Ahem-COLR.ttf: Added. * LayoutTests/platform/wpe/fast/text/canvas-color-fonts/stroke-gradient-COLR-expected.html: Added. * LayoutTests/platform/wpe/fast/text/resources/Ahem-COLR.ttf: Added. Canonical link: https://commits.webkit.org/270167@main
- Loading branch information
1 parent
ccfae6e
commit 8434dfb
Showing
30 changed files
with
303 additions
and
97 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
LayoutTests/fast/text/canvas-color-fonts/linedash-COLR-expected.html
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,17 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
</head> | ||
<body> | ||
<canvas id="canvas" width="700" height="500" style="width: 700px; height: 500px;"></canvas> | ||
<script> | ||
let canvas = document.getElementById("canvas"); | ||
let context = canvas.getContext("2d"); | ||
context.fillStyle = "magenta"; | ||
context.fillRect(100, 60, 50, 50); | ||
context.fillStyle = "cyan"; | ||
context.fillRect(110, 60, 10, 50); | ||
</script> | ||
</body> | ||
</html> |
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
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
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
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
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
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
8 changes: 8 additions & 0 deletions
8
LayoutTests/platform/gtk/fast/text/canvas-color-fonts/stroke-gradient-COLR-expected.html
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,8 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
Binary file not shown.
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
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
File renamed without changes.
25 changes: 25 additions & 0 deletions
25
...tTests/platform/mac-monterey/fast/text/canvas-color-fonts/stroke-color-COLR-expected.html
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,25 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<style> | ||
@font-face { | ||
font-family: "WebFont"; | ||
src: url("../resources/Ahem-COLR.ttf") format("truetype"); | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<canvas id="canvas" width="700" height="500" style="width: 700px; height; 500px;"></canvas> | ||
<script> | ||
let canvas = document.getElementById("canvas"); | ||
let context = canvas.getContext("2d"); | ||
context.strokeStyle = "green"; | ||
context.lineWidth = 2; | ||
context.strokeRect(100, 20, 100, 100); | ||
context.strokeRect(200, 20, 100, 100); | ||
context.strokeRect(220, 20, 20, 100); | ||
context.strokeRect(300, 20, 100, 100); | ||
</script> | ||
</body> | ||
</html> |
19 changes: 19 additions & 0 deletions
19
...platform/mac-monterey/fast/text/canvas-color-fonts/stroke-color-shadow-COLR-expected.html
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,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
</head> | ||
<body> | ||
<canvas id="canvas" width="700" height="500" style="width: 700px; height; 500px;"></canvas> | ||
<script> | ||
let canvas = document.getElementById("canvas"); | ||
let context = canvas.getContext("2d"); | ||
context.lineWidth = 2; | ||
context.strokeStyle = "green"; | ||
context.strokeRect(200, 125, 100, 100); | ||
context.strokeRect(300, 125, 100, 100); | ||
context.strokeRect(320, 125, 20, 100); | ||
context.strokeRect(400, 125, 100, 100); | ||
</script> | ||
</body> | ||
</html> |
19 changes: 19 additions & 0 deletions
19
...form/mac-monterey/fast/text/canvas-color-fonts/stroke-color-shadow-ctm-COLR-expected.html
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,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
</head> | ||
<body> | ||
<canvas id="canvas" width="700" height="500" style="width: 700px; height; 500px;"></canvas> | ||
<script> | ||
let canvas = document.getElementById("canvas"); | ||
let context = canvas.getContext("2d"); | ||
context.lineWidth = 2; | ||
context.strokeStyle = "green"; | ||
context.strokeRect(300, 225, 100, 100); | ||
context.strokeRect(400, 225, 100, 100); | ||
context.strokeRect(420, 225, 20, 100); | ||
context.strokeRect(500, 225, 100, 100); | ||
</script> | ||
</body> | ||
</html> |
8 changes: 8 additions & 0 deletions
8
...sts/platform/mac-monterey/fast/text/canvas-color-fonts/stroke-gradient-COLR-expected.html
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,8 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
Binary file not shown.
29 changes: 29 additions & 0 deletions
29
...ts/platform/mac-ventura/fast/text/canvas-color-fonts/linedash-COLR-expected-mismatch.html
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,29 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<style> | ||
@font-face { | ||
font-family: "WebFont"; | ||
src: url("../resources/Ahem-COLR.ttf") format("truetype"); | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<canvas id="canvas" width="700" height="500" style="width: 700px; height; 500px;"></canvas> | ||
<script> | ||
if (window.testRunner) | ||
testRunner.waitUntilDone(); | ||
|
||
let font = "50px 'WebFont'"; | ||
document.fonts.load(font).then(function() { | ||
let canvas = document.getElementById("canvas"); | ||
let context = canvas.getContext("2d"); | ||
context.font = font; | ||
context.strokeText("A", 100, 100); | ||
if (window.testRunner) | ||
testRunner.notifyDone(); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
25 changes: 25 additions & 0 deletions
25
...utTests/platform/mac-ventura/fast/text/canvas-color-fonts/stroke-color-COLR-expected.html
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,25 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<style> | ||
@font-face { | ||
font-family: "WebFont"; | ||
src: url("../resources/Ahem-COLR.ttf") format("truetype"); | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<canvas id="canvas" width="700" height="500" style="width: 700px; height; 500px;"></canvas> | ||
<script> | ||
let canvas = document.getElementById("canvas"); | ||
let context = canvas.getContext("2d"); | ||
context.strokeStyle = "green"; | ||
context.lineWidth = 2; | ||
context.strokeRect(100, 20, 100, 100); | ||
context.strokeRect(200, 20, 100, 100); | ||
context.strokeRect(220, 20, 20, 100); | ||
context.strokeRect(300, 20, 100, 100); | ||
</script> | ||
</body> | ||
</html> |
19 changes: 19 additions & 0 deletions
19
.../platform/mac-ventura/fast/text/canvas-color-fonts/stroke-color-shadow-COLR-expected.html
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,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
</head> | ||
<body> | ||
<canvas id="canvas" width="700" height="500" style="width: 700px; height; 500px;"></canvas> | ||
<script> | ||
let canvas = document.getElementById("canvas"); | ||
let context = canvas.getContext("2d"); | ||
context.lineWidth = 2; | ||
context.strokeStyle = "green"; | ||
context.strokeRect(200, 125, 100, 100); | ||
context.strokeRect(300, 125, 100, 100); | ||
context.strokeRect(320, 125, 20, 100); | ||
context.strokeRect(400, 125, 100, 100); | ||
</script> | ||
</body> | ||
</html> |
19 changes: 19 additions & 0 deletions
19
...tform/mac-ventura/fast/text/canvas-color-fonts/stroke-color-shadow-ctm-COLR-expected.html
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,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
</head> | ||
<body> | ||
<canvas id="canvas" width="700" height="500" style="width: 700px; height; 500px;"></canvas> | ||
<script> | ||
let canvas = document.getElementById("canvas"); | ||
let context = canvas.getContext("2d"); | ||
context.lineWidth = 2; | ||
context.strokeStyle = "green"; | ||
context.strokeRect(300, 225, 100, 100); | ||
context.strokeRect(400, 225, 100, 100); | ||
context.strokeRect(420, 225, 20, 100); | ||
context.strokeRect(500, 225, 100, 100); | ||
</script> | ||
</body> | ||
</html> |
8 changes: 8 additions & 0 deletions
8
...ests/platform/mac-ventura/fast/text/canvas-color-fonts/stroke-gradient-COLR-expected.html
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,8 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
Binary file not shown.
Oops, something went wrong.