@@ -56,6 +56,7 @@ describe("Document to SVG conversion", function () {
56
56
document2svg . getSvgForDocument ( doc , aRenderSize ( ) , defaultZoomLevel ) . then ( function ( svgCode ) {
57
57
expect ( svgCode ) . toMatch ( new RegExp (
58
58
'<svg xmlns="http://www.w3.org/2000/svg" .*>' +
59
+ '.*' +
59
60
'<foreignObject .*>' +
60
61
'<html xmlns="http://www.w3.org/1999/xhtml">' +
61
62
'<head>' +
@@ -83,6 +84,7 @@ describe("Document to SVG conversion", function () {
83
84
canonicalXML = svgCode . replace ( / + \/ > / , '/>' ) ;
84
85
expect ( canonicalXML ) . toMatch ( new RegExp (
85
86
'<svg xmlns="http://www.w3.org/2000/svg" .*>' +
87
+ '.*' +
86
88
'<foreignObject .*>' +
87
89
'<html xmlns="http://www.w3.org/1999/xhtml">' +
88
90
'<head>' +
@@ -107,6 +109,7 @@ describe("Document to SVG conversion", function () {
107
109
document2svg . getSvgForDocument ( doc , aRenderSize ( 123 , 987 , 200 , 1000 , 2 , 7 ) , defaultZoomLevel ) . then ( function ( svgCode ) {
108
110
expect ( svgCode ) . toMatch ( new RegExp (
109
111
'<svg xmlns="http://www.w3.org/2000/svg" width="123" height="987"[^>]*>' +
112
+ '.*' +
110
113
'<foreignObject x="-2" y="-7" width="200" height="1000".*>' +
111
114
'<html xmlns="http://www.w3.org/1999/xhtml">' +
112
115
'<head>' +
@@ -132,6 +135,7 @@ describe("Document to SVG conversion", function () {
132
135
document2svg . getSvgForDocument ( doc , aRenderSize ( 123 , 987 , 12 , 99 ) , zoomFactor ) . then ( function ( svgCode ) {
133
136
expect ( svgCode ) . toMatch ( new RegExp (
134
137
'<svg xmlns="http://www.w3.org/2000/svg" width="123" height="987"[^>]*>' +
138
+ '.*' +
135
139
'<foreignObject x="0" y="0" width="12" height="99" transform="scale\\(10\\)".*>' +
136
140
'<html xmlns="http://www.w3.org/1999/xhtml">' +
137
141
'<head>' +
@@ -168,6 +172,7 @@ describe("Document to SVG conversion", function () {
168
172
document2svg . getSvgForDocument ( doc , aRenderSizeWithRootFontSize ( '42px' ) , defaultZoomLevel ) . then ( function ( svgCode ) {
169
173
expect ( svgCode ) . toMatch ( new RegExp (
170
174
'<svg xmlns="http://www.w3.org/2000/svg" [^>]*font-size="42px"[^>]*>' +
175
+ '.*' +
171
176
'<foreignObject .*>' +
172
177
'<html xmlns="http://www.w3.org/1999/xhtml"[^>]*>' +
173
178
'<head>' +
@@ -250,7 +255,7 @@ describe("Document to SVG conversion", function () {
250
255
} ) ;
251
256
} ) ;
252
257
253
- it ( "should not work around WebKit's EM media query issue" , function ( done ) {
258
+ it ( "should not work around EM media query if no issue exists " , function ( done ) {
254
259
var doc = document . implementation . createHTMLDocument ( "" ) ;
255
260
setUpNeedsEmWorkaroundToReturn ( false ) ;
256
261
@@ -260,6 +265,24 @@ describe("Document to SVG conversion", function () {
260
265
done ( ) ;
261
266
} ) ;
262
267
} ) ;
268
+
269
+ it ( "should hide scrollbars on Chrome under Linux" , function ( done ) {
270
+ var doc = document . implementation . createHTMLDocument ( "" ) ;
271
+ doc . body . innerHTML = "Test content" ;
272
+
273
+ document2svg . getSvgForDocument ( doc , aRenderSize ( ) , defaultZoomLevel ) . then ( function ( svgCode ) {
274
+ expect ( svgCode ) . toMatch ( new RegExp (
275
+ '<svg xmlns="http://www.w3.org/2000/svg" .*>' +
276
+ '<style scoped="">html::-webkit-scrollbar { display: none; }</style>' +
277
+ '<foreignObject .*>' +
278
+ '.*' +
279
+ '</foreignObject>' +
280
+ '</svg>'
281
+ ) ) ;
282
+
283
+ done ( ) ;
284
+ } ) ;
285
+ } ) ;
263
286
} ) ;
264
287
265
288
describe ( "drawDocumentAsSvg" , function ( ) {
0 commit comments