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

Unified Diff: LayoutTests/svg/text/text-bbox-of-empty-after-change.html

Issue 1078193002: Clear LayoutSVGText's frame rect if no line boxes are produced (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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 | Source/core/layout/svg/LayoutSVGText.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/svg/text/text-bbox-of-empty-after-change.html
diff --git a/LayoutTests/svg/text/text-bbox-of-empty-after-change.html b/LayoutTests/svg/text/text-bbox-of-empty-after-change.html
new file mode 100644
index 0000000000000000000000000000000000000000..cc9efa4bf0a63280e59ec824b844287b1c43d8ab
--- /dev/null
+++ b/LayoutTests/svg/text/text-bbox-of-empty-after-change.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<svg height="0" font-size="100"><text></text></svg>
+<script>
+test(function() {
+ var text = document.querySelector('text');
+ assert_equals(text.getBBox().width, 0, 'before adding text content');
+ text.textContent = 'MMMMM';
+ assert_greater_than(text.getBBox().width, 0, 'after adding text content');
+ text.textContent = '';
+ assert_equals(text.getBBox().width, 0, 'after clearing text content');
+}, 'Bounding box of <text> changes to empty when text content is changed to empty.');
+</script>
« no previous file with comments | « no previous file | Source/core/layout/svg/LayoutSVGText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698