Skip to content

Commit

Permalink
Wrap processed stylesheets (#629)
Browse files Browse the repository at this point in the history
  • Loading branch information
LavrovArtem authored and churkin committed Jun 9, 2016
1 parent 775aa17 commit d84438e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "testcafe-hammerhead",
"description": "A powerful web-proxy used as a core for the TestCafe testing framework (https://github.com/DevExpress/testcafe).",
"version": "9.2.0",
"version": "9.2.1",
"homepage": "https://github.com/DevExpress/testcafe-hammerhead",
"bugs": {
"url": "https://github.com/DevExpress/testcafe-hammerhead/issues"
Expand Down
4 changes: 2 additions & 2 deletions src/processing/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const STYLESHEET_PROCESSING_COMMENTS_RE = new RegExp(`^\\s*${ reEscape(STYLESH

class StyleProcessor {
constructor () {
this.STYLESHEET_TEXT_START_COMMENT = STYLESHEET_PROCESSING_START_COMMENT;
this.STYLESHEET_TEXT_END_COMMENT = STYLESHEET_PROCESSING_END_COMMENT;
this.STYLESHEET_PROCESSING_START_COMMENT = STYLESHEET_PROCESSING_START_COMMENT;
this.STYLESHEET_PROCESSING_END_COMMENT = STYLESHEET_PROCESSING_END_COMMENT;
}

process (css, urlReplacer, isStylesheetTable) {
Expand Down
4 changes: 2 additions & 2 deletions test/client/fixtures/sandbox/node/document-write-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ test('write style', function () {

strictEqual(getElems(iframeForWrite, 'style').length, getElems(iframeForNativeWrite, 'style').length);
strictEqual(innerHTML(getElems(iframeForWrite, 'style')[0], true), innerHTML(getElems(iframeForNativeWrite, 'style')[0]));
strictEqual(innerHTML(getElems(iframeForWrite, 'style')[0]), styleProcessor.STYLESHEET_TEXT_START_COMMENT +
strictEqual(innerHTML(getElems(iframeForWrite, 'style')[0]), styleProcessor.STYLESHEET_PROCESSING_START_COMMENT +
'\n\ndiv {}\n\n' +
styleProcessor.STYLESHEET_TEXT_END_COMMENT);
styleProcessor.STYLESHEET_PROCESSING_END_COMMENT);
strictEqual(innerHTML(getElems(iframeForWrite, 'style')[1], true), innerHTML(getElems(iframeForNativeWrite, 'style')[1]));
strictEqual(innerHTML(getElems(iframeForWrite, 'style')[1]), '');

Expand Down
4 changes: 2 additions & 2 deletions test/client/fixtures/sandbox/node/dom-processor-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ test('stylesheet after innerHTML', function () {
nativeMethods.appendChild.call(document.body, style);

var check = function (cssText) {
strictEqual(cssText.indexOf(styleProcessor.STYLESHEET_TEXT_START_COMMENT), 0);
strictEqual(cssText.indexOf(styleProcessor.STYLESHEET_TEXT_START_COMMENT, 1), -1);
strictEqual(cssText.indexOf(styleProcessor.STYLESHEET_PROCESSING_START_COMMENT), 0);
strictEqual(cssText.indexOf(styleProcessor.STYLESHEET_PROCESSING_START_COMMENT, 1), -1);
strictEqual(cssText.replace(/^[\s\S]+url\(([\s\S]+)\)[\s\S]+$/, '$1'), urlUtils.getProxyUrl('http://domain.com'));
};

Expand Down

0 comments on commit d84438e

Please sign in to comment.