Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consolidate specs for @-moz-document and add deprecation warnings
See sass/sass#2529
- Loading branch information
Showing
27 changed files
with
364 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
`@-moz-document` is a Firefox-specific at-rule that was originally based on a | ||
draft of the [CSS Conditional Rules][] module. It's syntactically unusual in | ||
that it defines a url-prefix() "function" that takes an unquoted URL. This can't | ||
be parsed using Sass's normal unknown-at-rule parsing, since it may contain the | ||
characters `//` that should not be interpreted as a single-line comment. | ||
|
||
[CSS Conditional Rules]: https://www.w3.org/TR/css3-conditional/ | ||
|
||
However, support for `@-moz-document` is [being removed from Firefox][] for | ||
security concerns. Sass support for them should be deprecated and eventually | ||
removed; see [issue 2529][] for details. These specs track deprecated support | ||
for the old syntax, as well as the special case of `@-moz-document url-prefix()` | ||
which is still supported at time of writing as a hack for targeting CSS at | ||
Firefox only. | ||
|
||
[being removed from Firefox]: https://www.fxsitecompat.com/en-CA/docs/2018/moz-document-support-has-been-dropped-except-for-empty-url-prefix/ | ||
[issue 2529]: https://github.com/sass/sass/issues/2529 |
17 changes: 17 additions & 0 deletions
17
spec/css/moz_document/empty_prefix/expected_output-libsass.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@-moz-document url-prefix() { | ||
a { | ||
b: c; | ||
} | ||
} | ||
|
||
@-moz-document url-prefix("") { | ||
a { | ||
b: c; | ||
} | ||
} | ||
|
||
@-moz-document url-prefix('') { | ||
a { | ||
b: c; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
spec/css/moz_document/empty_prefix/expected_output-ruby-sass.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@-moz-document url-prefix() { | ||
a { | ||
b: c; | ||
} | ||
} | ||
@-moz-document url-prefix("") { | ||
a { | ||
b: c; | ||
} | ||
} | ||
@-moz-document url-prefix('') { | ||
a { | ||
b: c; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@-moz-document url-prefix() { | ||
a { | ||
b: c; | ||
} | ||
} | ||
@-moz-document url-prefix("") { | ||
a { | ||
b: c; | ||
} | ||
} | ||
@-moz-document url-prefix("") { | ||
a { | ||
b: c; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// An empty url-prefix() should not be deprecated yet, as it's still supported | ||
// in Firefox's release channel at time of writing. | ||
|
||
@-moz-document url-prefix() { | ||
a {b: c} | ||
} | ||
|
||
@-moz-document url-prefix("") { | ||
a {b: c} | ||
} | ||
|
||
@-moz-document url-prefix('') { | ||
a {b: c} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
DEPRECATION WARNING on line 1, column 1 of /sass/spec/css/moz_document/functions/interpolated/input.scss: | ||
@-moz-document is deprecated and support will be removed from Sass in a future | ||
relase. For details, see http://bit.ly/moz-document. | ||
|
||
@-moz-document url(#{"sass-lang.com"}) { | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
DEPRECATION WARNING on line 4, column 1 of /sass/spec/css/moz_document/functions/interpolated/input.scss: | ||
@-moz-document is deprecated and support will be removed from Sass in a future | ||
relase. For details, see http://bit.ly/moz-document. | ||
|
||
@-moz-document url(#{sa + ss}-lang.com) { | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
DEPRECATION WARNING on line 7, column 1 of /sass/spec/css/moz_document/functions/interpolated/input.scss: | ||
@-moz-document is deprecated and support will be removed from Sass in a future | ||
relase. For details, see http://bit.ly/moz-document. | ||
|
||
@-moz-document url("#{sa + ss}-lang.com") { | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
DEPRECATION WARNING on line 11, column 1 of /sass/spec/css/moz_document/functions/interpolated/input.scss: | ||
@-moz-document is deprecated and support will be removed from Sass in a future | ||
relase. For details, see http://bit.ly/moz-document. | ||
|
||
@-moz-document url-prefix(#{"http://sass-lang.com/docs"}) { | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
DEPRECATION WARNING on line 14, column 1 of /sass/spec/css/moz_document/functions/interpolated/input.scss: | ||
@-moz-document is deprecated and support will be removed from Sass in a future | ||
relase. For details, see http://bit.ly/moz-document. | ||
|
||
@-moz-document url-prefix(#{ht + tp}://sass-lang.com/docs) { | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
DEPRECATION WARNING on line 17, column 1 of /sass/spec/css/moz_document/functions/interpolated/input.scss: | ||
@-moz-document is deprecated and support will be removed from Sass in a future | ||
relase. For details, see http://bit.ly/moz-document. | ||
|
||
@-moz-document url-prefix("#{ht + tp}://sass-lang.com/docs") { | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
DEPRECATION WARNING on line 21, column 1 of /sass/spec/css/moz_document/functions/interpolated/input.scss: | ||
@-moz-document is deprecated and support will be removed from Sass in a future | ||
relase. For details, see http://bit.ly/moz-document. | ||
|
||
@-moz-document domain(#{"sass-lang.com"}) { | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
DEPRECATION WARNING on line 24, column 1 of /sass/spec/css/moz_document/functions/interpolated/input.scss: | ||
@-moz-document is deprecated and support will be removed from Sass in a future | ||
relase. For details, see http://bit.ly/moz-document. | ||
|
||
@-moz-document domain(#{sa + ss}-lang.com) { | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
DEPRECATION WARNING on line 27, column 1 of /sass/spec/css/moz_document/functions/interpolated/input.scss: | ||
@-moz-document is deprecated and support will be removed from Sass in a future | ||
relase. For details, see http://bit.ly/moz-document. | ||
|
||
@-moz-document domain("#{sa + ss}-lang.com") { | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
DEPRECATION WARNING on line 31, column 1 of /sass/spec/css/moz_document/functions/interpolated/input.scss: | ||
@-moz-document is deprecated and support will be removed from Sass in a future | ||
relase. For details, see http://bit.ly/moz-document. | ||
|
||
@-moz-document regexp("#{ht + tp}s:.*") { | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
50 changes: 50 additions & 0 deletions
50
spec/css/moz_document/functions/interpolated/expected_output.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
@-moz-document url(sass-lang.com) { | ||
a { | ||
type: unquoted full url; | ||
} | ||
} | ||
@-moz-document url(sass-lang.com) { | ||
a { | ||
type: unquoted partial url; | ||
} | ||
} | ||
@-moz-document url("sass-lang.com") { | ||
a { | ||
type: quoted partial url; | ||
} | ||
} | ||
@-moz-document url-prefix(http://sass-lang.com/docs) { | ||
a { | ||
type: unquoted full url-prefix; | ||
} | ||
} | ||
@-moz-document url-prefix(http://sass-lang.com/docs) { | ||
a { | ||
type: unquoted partial url-prefix; | ||
} | ||
} | ||
@-moz-document url-prefix("http://sass-lang.com/docs") { | ||
a { | ||
type: quoted partial url-prefix; | ||
} | ||
} | ||
@-moz-document domain(sass-lang.com) { | ||
a { | ||
type: unquoted full domain; | ||
} | ||
} | ||
@-moz-document domain(sass-lang.com) { | ||
a { | ||
type: unquoted partial domain; | ||
} | ||
} | ||
@-moz-document domain("sass-lang.com") { | ||
a { | ||
type: quoted partial domain; | ||
} | ||
} | ||
@-moz-document regexp("https:.*") { | ||
a { | ||
type: regexp; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@-moz-document url(#{"sass-lang.com"}) { | ||
a {type: unquoted full url} | ||
} | ||
@-moz-document url(#{sa + ss}-lang.com) { | ||
a {type: unquoted partial url} | ||
} | ||
@-moz-document url("#{sa + ss}-lang.com") { | ||
a {type: quoted partial url} | ||
} | ||
|
||
@-moz-document url-prefix(#{"http://sass-lang.com/docs"}) { | ||
a {type: unquoted full url-prefix} | ||
} | ||
@-moz-document url-prefix(#{ht + tp}://sass-lang.com/docs) { | ||
a {type: unquoted partial url-prefix} | ||
} | ||
@-moz-document url-prefix("#{ht + tp}://sass-lang.com/docs") { | ||
a {type: quoted partial url-prefix} | ||
} | ||
|
||
@-moz-document domain(#{"sass-lang.com"}) { | ||
a {type: unquoted full domain} | ||
} | ||
@-moz-document domain(#{sa + ss}-lang.com) { | ||
a {type: unquoted partial domain} | ||
} | ||
@-moz-document domain("#{sa + ss}-lang.com") { | ||
a {type: quoted partial domain} | ||
} | ||
|
||
@-moz-document regexp("#{ht + tp}s:.*") { | ||
a {type: regexp} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
:todo: | ||
- libsass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
DEPRECATION WARNING on line 1, column 1 of /sass/spec/css/moz_document/functions/static/input.scss: | ||
@-moz-document is deprecated and support will be removed from Sass in a future | ||
relase. For details, see http://bit.ly/moz-document. | ||
|
||
@-moz-document url(sass-lang.com) { | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
DEPRECATION WARNING on line 4, column 1 of /sass/spec/css/moz_document/functions/static/input.scss: | ||
@-moz-document is deprecated and support will be removed from Sass in a future | ||
relase. For details, see http://bit.ly/moz-document. | ||
|
||
@-moz-document url("sass-lang.com") { | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
DEPRECATION WARNING on line 8, column 1 of /sass/spec/css/moz_document/functions/static/input.scss: | ||
@-moz-document is deprecated and support will be removed from Sass in a future | ||
relase. For details, see http://bit.ly/moz-document. | ||
|
||
@-moz-document url-prefix(http://sass-lang.com/docs) { | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
DEPRECATION WARNING on line 11, column 1 of /sass/spec/css/moz_document/functions/static/input.scss: | ||
@-moz-document is deprecated and support will be removed from Sass in a future | ||
relase. For details, see http://bit.ly/moz-document. | ||
|
||
@-moz-document url-prefix("http://sass-lang.com/docs") { | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
DEPRECATION WARNING on line 15, column 1 of /sass/spec/css/moz_document/functions/static/input.scss: | ||
@-moz-document is deprecated and support will be removed from Sass in a future | ||
relase. For details, see http://bit.ly/moz-document. | ||
|
||
@-moz-document domain(sass-lang.com) { | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
DEPRECATION WARNING on line 18, column 1 of /sass/spec/css/moz_document/functions/static/input.scss: | ||
@-moz-document is deprecated and support will be removed from Sass in a future | ||
relase. For details, see http://bit.ly/moz-document. | ||
|
||
@-moz-document domain("sass-lang.com") { | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
DEPRECATION WARNING on line 22, column 1 of /sass/spec/css/moz_document/functions/static/input.scss: | ||
@-moz-document is deprecated and support will be removed from Sass in a future | ||
relase. For details, see http://bit.ly/moz-document. | ||
|
||
@-moz-document regexp("https:.*") { | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
35 changes: 35 additions & 0 deletions
35
spec/css/moz_document/functions/static/expected_output.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@-moz-document url(sass-lang.com) { | ||
a { | ||
type: unquoted url; | ||
} | ||
} | ||
@-moz-document url("sass-lang.com") { | ||
a { | ||
type: quoted url; | ||
} | ||
} | ||
@-moz-document url-prefix(http://sass-lang.com/docs) { | ||
a { | ||
type: unquoted url-prefix; | ||
} | ||
} | ||
@-moz-document url-prefix("http://sass-lang.com/docs") { | ||
a { | ||
type: quoted url-prefix; | ||
} | ||
} | ||
@-moz-document domain(sass-lang.com) { | ||
a { | ||
type: unquoted domain; | ||
} | ||
} | ||
@-moz-document domain("sass-lang.com") { | ||
a { | ||
type: quoted domain; | ||
} | ||
} | ||
@-moz-document regexp("https:.*") { | ||
a { | ||
type: regexp; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@-moz-document url(sass-lang.com) { | ||
a {type: unquoted url} | ||
} | ||
@-moz-document url("sass-lang.com") { | ||
a {type: quoted url} | ||
} | ||
|
||
@-moz-document url-prefix(http://sass-lang.com/docs) { | ||
a {type: unquoted url-prefix} | ||
} | ||
@-moz-document url-prefix("http://sass-lang.com/docs") { | ||
a {type: quoted url-prefix} | ||
} | ||
|
||
@-moz-document domain(sass-lang.com) { | ||
a {type: unquoted domain} | ||
} | ||
@-moz-document domain("sass-lang.com") { | ||
a {type: quoted domain} | ||
} | ||
|
||
@-moz-document regexp("https:.*") { | ||
a {type: regexp} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
DEPRECATION WARNING on line 1, column 1 of /sass/spec/css/moz_document/multi_function/input.scss: | ||
@-moz-document is deprecated and support will be removed from Sass in a future | ||
relase. For details, see http://bit.ly/moz-document. | ||
|
||
@-moz-document url(http://www.w3.org/), | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@-moz-document url(http://www.w3.org/), | ||
url-prefix(http://www.w3.org/Style/), | ||
domain(mozilla.org), | ||
regexp("https:.*") { | ||
a { | ||
b: c; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@-moz-document url(http://www.w3.org/), | ||
url-prefix(http://www.w3.org/Style/), | ||
domain(mozilla.org), | ||
regexp("https:.*") { | ||
a {b: c} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
:warning_todo: | ||
- libsass | ||
- ruby-sass |
Oops, something went wrong.