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

Unified Diff: third_party/WebKit/LayoutTests/svg/text/empty-text-node-crash.html

Issue 1806263005: Do not crash when measuring empty SVG text nodes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/svg/text/empty-text-node-crash.html
diff --git a/third_party/WebKit/LayoutTests/svg/text/empty-text-node-crash.html b/third_party/WebKit/LayoutTests/svg/text/empty-text-node-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..ab4a569b4e370e35acf9688c236e12ee9af428c5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/svg/text/empty-text-node-crash.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<svg id="svg">
+<g id="g"></g>
+<text id="text">Fail</text>
+</svg>
+<script>
+test(function() {
+ // Create an empty text node through the editing apis.
+ var oSelection=window.getSelection();
+ document.execCommand('SelectAll', false, false)
+ var oRange = oSelection.getRangeAt(0);
+ oRange.insertNode(g);
+ // Force the text length to be calculated.
+ text.getComputedTextLength();
+ svg.parentElement.removeChild(svg);
+}, 'Empty text nodes should not crash.');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698