Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: third_party/WebKit/LayoutTests/svg/text/bbox-with-glyph-overflow.html

Issue 1505713002: Include glyph overflow in SVG text bounding boxes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compute and store glyph overflow per-fragment Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/svg/text/bbox-with-glyph-overflow.html
diff --git a/third_party/WebKit/LayoutTests/svg/text/bbox-with-glyph-overflow.html b/third_party/WebKit/LayoutTests/svg/text/bbox-with-glyph-overflow.html
new file mode 100644
index 0000000000000000000000000000000000000000..d33e21c7994599c9b022c3d7fdf561914ddfe3b4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/svg/text/bbox-with-glyph-overflow.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<style>
+ text {
+ font-size: 50px;
+ font-style: italic;
+ }
+ rect {
+ stroke-width: 1px;
+ stroke: green;
+ fill: transparent;
+ }
+ #middleGlyphOverhang {
+ font-family: cursive;
+ }
+</style>
+No glyphs should extend outside the rects.<br>
+<svg id="svg" width="700" height="500">
+ <text id="simpleText" x="50" y="50">ffffffff</text>
+ <text id="textWithSpan" x="50" y="150">ffffff<tspan>ffffff</tspan></text>
+ <text id="textWithDifferentSizes" x="50" y="250"><tspan font-size="30px">ffffff</tspan><tspan font-size="80px">ffffff</tspan></text>
+ <text id="rotatedText" x="50" y="350" rotate="20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260, 280, 300, 320, 340, 360, 380">fffffffffffffffffff</text>
+ <text id="middleGlyphOverhang" x="50" y="475">'faQ'</text>
+</svg>
+<script>
+ [simpleText, textWithSpan, textWithDifferentSizes, rotatedText, middleGlyphOverhang].forEach(function (textElement) {
+ var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
+ rect.setAttribute('x', textElement.getBBox().x);
+ rect.setAttribute('y', textElement.getBBox().y);
+ rect.setAttribute('width', textElement.getBBox().width);
+ rect.setAttribute('height', textElement.getBBox().height);
+ document.getElementById('svg').appendChild(rect);
+ });
+</script>

Powered by Google App Engine
This is Rietveld 408576698