Permalink
Browse files

Add white-space vendor prefixed values

  • Loading branch information...
1 parent a9c6f1b commit 5acd9b24bb3189fd3b0d5f2b01b71dd3fba844cb @nschonni committed Nov 20, 2012
View
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-/* Version v@VERSION@, Build time: 19-November-2012 08:31:03 */
+/* Version v@VERSION@, Build time: 19-November-2012 10:07:25 */
var parserlib = {};
(function(){
@@ -931,7 +931,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-/* Version v@VERSION@, Build time: 19-November-2012 08:31:03 */
+/* Version v@VERSION@, Build time: 19-November-2012 10:07:25 */
(function(){
var EventTarget = parserlib.util.EventTarget,
TokenStreamBase = parserlib.util.TokenStreamBase,
@@ -3933,7 +3933,7 @@ var Properties = {
"volume" : 1,
//W
- "white-space" : "normal | pre | nowrap | pre-wrap | pre-line | inherit",
+ "white-space" : "normal | pre | nowrap | pre-wrap | pre-line | inherit | -pre-wrap | -o-pre-wrap | -moz-pre-wrap | -hp-pre-wrap", //http://perishablepress.com/wrapping-content/
"white-space-collapse" : 1,
"widows" : "<integer> | inherit",
"width" : "<length> | <percentage> | auto | inherit" ,
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-/* Version v@VERSION@, Build time: 19-November-2012 08:31:03 */
+/* Version v@VERSION@, Build time: 19-November-2012 10:07:25 */
var parserlib = {};
(function(){
@@ -931,7 +931,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-/* Version v@VERSION@, Build time: 19-November-2012 08:31:03 */
+/* Version v@VERSION@, Build time: 19-November-2012 10:07:25 */
(function(){
var EventTarget = parserlib.util.EventTarget,
TokenStreamBase = parserlib.util.TokenStreamBase,
@@ -3933,7 +3933,7 @@ var Properties = {
"volume" : 1,
//W
- "white-space" : "normal | pre | nowrap | pre-wrap | pre-line | inherit",
+ "white-space" : "normal | pre | nowrap | pre-wrap | pre-line | inherit | -pre-wrap | -o-pre-wrap | -moz-pre-wrap | -hp-pre-wrap", //http://perishablepress.com/wrapping-content/
"white-space-collapse" : 1,
"widows" : "<integer> | inherit",
"width" : "<length> | <percentage> | auto | inherit" ,
View
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-/* Version v@VERSION@, Build time: 19-November-2012 08:31:03 */
+/* Version v@VERSION@, Build time: 19-November-2012 10:07:25 */
var parserlib = {};
(function(){
View
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-/* Version v@VERSION@, Build time: 19-November-2012 08:31:03 */
+/* Version v@VERSION@, Build time: 19-November-2012 10:07:25 */
(function(){
var EventTarget = parserlib.util.EventTarget,
TokenStreamBase = parserlib.util.TokenStreamBase,
@@ -3023,7 +3023,7 @@ var Properties = {
"volume" : 1,
//W
- "white-space" : "normal | pre | nowrap | pre-wrap | pre-line | inherit",
+ "white-space" : "normal | pre | nowrap | pre-wrap | pre-line | inherit | -pre-wrap | -o-pre-wrap | -moz-pre-wrap | -hp-pre-wrap", //http://perishablepress.com/wrapping-content/
"white-space-collapse" : 1,
"widows" : "<integer> | inherit",
"width" : "<length> | <percentage> | auto | inherit" ,
View
@@ -1560,6 +1560,22 @@
Assert.areEqual(2, event.value.parts[0].line, "First part line should be 2.");
});
var result = parser.parse(".foo {\n; color: #fff;\n}");
+ },
+
+ "Test rule vendor prefix value": function(){
+ var parser = new Parser({ strict: true});
+ parser.addListener("property", function(event){
+ Assert.areEqual("white-space", event.property.toString());
+ Assert.areEqual("-moz-pre-wrap", event.value.toString());
+ Assert.areEqual(5, event.property.col, "Property column should be 5.");
+ Assert.areEqual(2, event.property.line, "Property line should be 2.");
+ Assert.areEqual(5, event.col, "Event column should be 5.");
+ Assert.areEqual(2, event.line, "Event line should be 2.");
+ Assert.areEqual(18, event.value.parts[0].col, "First part column should be 18.");
+ Assert.areEqual(2, event.value.parts[0].line, "First part line should be 2.");
+ Assert.areEqual("-moz-pre-wrap", event.value.parts[0].text, "The vendor prefixed value should be intact.");
+ });
+ var result = parser.parse(".foo {\n; white-space: -moz-pre-wrap;\n}");
}
}));
View
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-/* Version v@VERSION@, Build time: 19-November-2012 08:31:03 */
+/* Version v@VERSION@, Build time: 19-November-2012 10:07:25 */
var parserlib = {};
(function(){
@@ -931,7 +931,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-/* Version v@VERSION@, Build time: 19-November-2012 08:31:03 */
+/* Version v@VERSION@, Build time: 19-November-2012 10:07:25 */
(function(){
var EventTarget = parserlib.util.EventTarget,
TokenStreamBase = parserlib.util.TokenStreamBase,
@@ -3933,7 +3933,7 @@ var Properties = {
"volume" : 1,
//W
- "white-space" : "normal | pre | nowrap | pre-wrap | pre-line | inherit",
+ "white-space" : "normal | pre | nowrap | pre-wrap | pre-line | inherit | -pre-wrap | -o-pre-wrap | -moz-pre-wrap | -hp-pre-wrap", //http://perishablepress.com/wrapping-content/
"white-space-collapse" : 1,
"widows" : "<integer> | inherit",
"width" : "<length> | <percentage> | auto | inherit" ,
View
@@ -467,7 +467,7 @@ var Properties = {
"volume" : 1,
//W
- "white-space" : "normal | pre | nowrap | pre-wrap | pre-line | inherit",
+ "white-space" : "normal | pre | nowrap | pre-wrap | pre-line | inherit | -pre-wrap | -o-pre-wrap | -moz-pre-wrap | -hp-pre-wrap", //http://perishablepress.com/wrapping-content/
"white-space-collapse" : 1,
"widows" : "<integer> | inherit",
"width" : "<length> | <percentage> | auto | inherit" ,
View
@@ -1560,6 +1560,22 @@
Assert.areEqual(2, event.value.parts[0].line, "First part line should be 2.");
});
var result = parser.parse(".foo {\n; color: #fff;\n}");
+ },
+
+ "Test rule vendor prefix value": function(){
+ var parser = new Parser({ strict: true});
+ parser.addListener("property", function(event){
+ Assert.areEqual("white-space", event.property.toString());
+ Assert.areEqual("-moz-pre-wrap", event.value.toString());
+ Assert.areEqual(5, event.property.col, "Property column should be 5.");
+ Assert.areEqual(2, event.property.line, "Property line should be 2.");
+ Assert.areEqual(5, event.col, "Event column should be 5.");
+ Assert.areEqual(2, event.line, "Event line should be 2.");
+ Assert.areEqual(18, event.value.parts[0].col, "First part column should be 18.");
+ Assert.areEqual(2, event.value.parts[0].line, "First part line should be 2.");
+ Assert.areEqual("-moz-pre-wrap", event.value.parts[0].text, "The vendor prefixed value should be intact.");
+ });
+ var result = parser.parse(".foo {\n; white-space: -moz-pre-wrap;\n}");
}
}));

0 comments on commit 5acd9b2

Please sign in to comment.