From d7b7ea763c393f88c72a594f81d3e0c36557a2b3 Mon Sep 17 00:00:00 2001 From: nebulon42 Date: Thu, 25 May 2017 22:39:53 +0200 Subject: [PATCH] remove deprecated name attribute handling and husl, husla functions, update documentation, fixes #463 --- docs-generator/index._ | 2 +- docs/2.0.0.md | 2 +- docs/2.0.1.md | 2 +- docs/2.0.2.md | 2 +- docs/2.1.0.md | 4 ++-- docs/2.1.1.md | 4 ++-- docs/2.2.0.md | 4 ++-- docs/2.3.0.md | 4 ++-- docs/3.0.0.md | 8 ++++---- docs/3.0.3.md | 8 ++++---- docs/3.0.6.md | 8 ++++---- lib/carto/functions.js | 8 -------- lib/carto/renderer.js | 8 ++------ test/errorhandling/issue165.result | 2 +- 14 files changed, 27 insertions(+), 39 deletions(-) diff --git a/docs-generator/index._ b/docs-generator/index._ index 73f467e7f..43b892e2f 100644 --- a/docs-generator/index._ +++ b/docs-generator/index._ @@ -9,7 +9,7 @@ Below is a list of values and an explanation of any expression that can be appli ### Color -CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva (husl and husla are deprecated). It also supports the predefined HTML colors names, like `yellow` and `blue`. +CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. It also supports the predefined HTML colors names, like `yellow` and `blue`. ``` css #line { diff --git a/docs/2.0.0.md b/docs/2.0.0.md index e5d23d5a9..1e288b652 100644 --- a/docs/2.0.0.md +++ b/docs/2.0.0.md @@ -1242,7 +1242,7 @@ Below is a list of values and an explanation of any expression that can be appli ### Color -CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva (husl and husla are deprecated). It also supports the predefined HTML colors names, like `yellow` and `blue`. +CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. It also supports the predefined HTML colors names, like `yellow` and `blue`. ``` css #line { diff --git a/docs/2.0.1.md b/docs/2.0.1.md index e5d23d5a9..1e288b652 100644 --- a/docs/2.0.1.md +++ b/docs/2.0.1.md @@ -1242,7 +1242,7 @@ Below is a list of values and an explanation of any expression that can be appli ### Color -CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva (husl and husla are deprecated). It also supports the predefined HTML colors names, like `yellow` and `blue`. +CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. It also supports the predefined HTML colors names, like `yellow` and `blue`. ``` css #line { diff --git a/docs/2.0.2.md b/docs/2.0.2.md index e5d23d5a9..1e288b652 100644 --- a/docs/2.0.2.md +++ b/docs/2.0.2.md @@ -1242,7 +1242,7 @@ Below is a list of values and an explanation of any expression that can be appli ### Color -CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva (husl and husla are deprecated). It also supports the predefined HTML colors names, like `yellow` and `blue`. +CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. It also supports the predefined HTML colors names, like `yellow` and `blue`. ``` css #line { diff --git a/docs/2.1.0.md b/docs/2.1.0.md index e0b33a971..83f1fff88 100644 --- a/docs/2.1.0.md +++ b/docs/2.1.0.md @@ -1569,7 +1569,7 @@ The text's horizontal alignment from its centerpoint Default Value: auto -_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives)_ +_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives)_ Define how text is justified * * * @@ -1641,7 +1641,7 @@ Below is a list of values and an explanation of any expression that can be appli ### Color -CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva (husl and husla are deprecated). It also supports the predefined HTML colors names, like `yellow` and `blue`. +CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. It also supports the predefined HTML colors names, like `yellow` and `blue`. ``` css #line { diff --git a/docs/2.1.1.md b/docs/2.1.1.md index 65372b09b..954f70150 100644 --- a/docs/2.1.1.md +++ b/docs/2.1.1.md @@ -1580,7 +1580,7 @@ The text's horizontal alignment from its centerpoint Default Value: auto -_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives)_ +_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives)_ Define how text is justified * * * @@ -1652,7 +1652,7 @@ Below is a list of values and an explanation of any expression that can be appli ### Color -CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva (husl and husla are deprecated). It also supports the predefined HTML colors names, like `yellow` and `blue`. +CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. It also supports the predefined HTML colors names, like `yellow` and `blue`. ``` css #line { diff --git a/docs/2.2.0.md b/docs/2.2.0.md index 00d69fef0..b50d99766 100644 --- a/docs/2.2.0.md +++ b/docs/2.2.0.md @@ -1767,7 +1767,7 @@ The text's horizontal alignment from its centerpoint Default Value: auto -_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives)_ +_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives)_ Define how text is justified * * * @@ -1853,7 +1853,7 @@ Below is a list of values and an explanation of any expression that can be appli ### Color -CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva (husl and husla are deprecated). It also supports the predefined HTML colors names, like `yellow` and `blue`. +CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. It also supports the predefined HTML colors names, like `yellow` and `blue`. ``` css #line { diff --git a/docs/2.3.0.md b/docs/2.3.0.md index 37bb44112..5c65c68c5 100644 --- a/docs/2.3.0.md +++ b/docs/2.3.0.md @@ -1822,7 +1822,7 @@ The text's horizontal alignment from its centerpoint. Default Value: auto -_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives.)_ +_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives.)_ Define how text is justified * * * @@ -1908,7 +1908,7 @@ Below is a list of values and an explanation of any expression that can be appli ### Color -CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva (husl and husla are deprecated). It also supports the predefined HTML colors names, like `yellow` and `blue`. +CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. It also supports the predefined HTML colors names, like `yellow` and `blue`. ``` css #line { diff --git a/docs/3.0.0.md b/docs/3.0.0.md index 84dc97639..d78a7d846 100644 --- a/docs/3.0.0.md +++ b/docs/3.0.0.md @@ -541,7 +541,7 @@ The width of the stroke around the marker, in pixels. This is positioned on the Default Value: 1 -_(Color is fully opaque. This property will also set the `stroke-opacity` of elements in an SVG loaded from a file.)_ +_(Color is fully opaque. This property will also set the `stroke-opacity` of elements in an SVG loaded from a file.)_ The opacity of a line. * * * @@ -2105,7 +2105,7 @@ The text's horizontal alignment from it's centerpoint. If `placement` is set to Default Value: auto -_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives.)_ +_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives.)_ Define how text is justified. * * * @@ -2182,7 +2182,7 @@ Composite operation. This defines how this symbolizer should behave relative to Default Value: -_(Default set of typographic features recommended by OpenType specification. Ligatures are turned off by default when `character-spacing` is greater than zero.)_ +_(Default set of typographic features recommended by OpenType specification. Ligatures are turned off by default when `character-spacing` is greater than zero.)_ Comma separated list of OpenType typographic features. The syntax and semantics conforms to `font-feature-settings` from W3C CSS. * * * @@ -2317,7 +2317,7 @@ Below is a list of values and an explanation of any expression that can be appli ### Color -CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva (husl and husla are deprecated). It also supports the predefined HTML colors names, like `yellow` and `blue`. +CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. It also supports the predefined HTML colors names, like `yellow` and `blue`. ``` css #line { diff --git a/docs/3.0.3.md b/docs/3.0.3.md index 36510ce7f..e3dfece37 100644 --- a/docs/3.0.3.md +++ b/docs/3.0.3.md @@ -541,7 +541,7 @@ The width of the stroke around the marker, in pixels. This is positioned on the Default Value: 1 -_(Color is fully opaque. This property will also set the `stroke-opacity` of elements in an SVG loaded from a file.)_ +_(Color is fully opaque. This property will also set the `stroke-opacity` of elements in an SVG loaded from a file.)_ The opacity of a line. * * * @@ -2105,7 +2105,7 @@ The text's horizontal alignment from it's centerpoint. If `placement` is set to Default Value: auto -_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives.)_ +_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives.)_ Define how text is justified. * * * @@ -2182,7 +2182,7 @@ Composite operation. This defines how this symbolizer should behave relative to Default Value: -_(Default set of typographic features recommended by OpenType specification. Ligatures are turned off by default when `character-spacing` is greater than zero.)_ +_(Default set of typographic features recommended by OpenType specification. Ligatures are turned off by default when `character-spacing` is greater than zero.)_ Comma separated list of OpenType typographic features. The syntax and semantics conforms to `font-feature-settings` from W3C CSS. * * * @@ -2317,7 +2317,7 @@ Below is a list of values and an explanation of any expression that can be appli ### Color -CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva (husl and husla are deprecated). It also supports the predefined HTML colors names, like `yellow` and `blue`. +CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. It also supports the predefined HTML colors names, like `yellow` and `blue`. ``` css #line { diff --git a/docs/3.0.6.md b/docs/3.0.6.md index 36510ce7f..e3dfece37 100644 --- a/docs/3.0.6.md +++ b/docs/3.0.6.md @@ -541,7 +541,7 @@ The width of the stroke around the marker, in pixels. This is positioned on the Default Value: 1 -_(Color is fully opaque. This property will also set the `stroke-opacity` of elements in an SVG loaded from a file.)_ +_(Color is fully opaque. This property will also set the `stroke-opacity` of elements in an SVG loaded from a file.)_ The opacity of a line. * * * @@ -2105,7 +2105,7 @@ The text's horizontal alignment from it's centerpoint. If `placement` is set to Default Value: auto -_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives.)_ +_(Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives.)_ Define how text is justified. * * * @@ -2182,7 +2182,7 @@ Composite operation. This defines how this symbolizer should behave relative to Default Value: -_(Default set of typographic features recommended by OpenType specification. Ligatures are turned off by default when `character-spacing` is greater than zero.)_ +_(Default set of typographic features recommended by OpenType specification. Ligatures are turned off by default when `character-spacing` is greater than zero.)_ Comma separated list of OpenType typographic features. The syntax and semantics conforms to `font-feature-settings` from W3C CSS. * * * @@ -2317,7 +2317,7 @@ Below is a list of values and an explanation of any expression that can be appli ### Color -CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva (husl and husla are deprecated). It also supports the predefined HTML colors names, like `yellow` and `blue`. +CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. It also supports the predefined HTML colors names, like `yellow` and `blue`. ``` css #line { diff --git a/lib/carto/functions.js b/lib/carto/functions.js index 59e761533..d29239319 100644 --- a/lib/carto/functions.js +++ b/lib/carto/functions.js @@ -53,14 +53,6 @@ tree.functions = { return new tree.Color(hsl, a, false); }, - husl: function (h, s, l) { - console.warn('Warning: husl() is deprecated and will be removed in 1.0.0. Use hsluv() instead.'); - return this.hsluv(h, s, l); - }, - husla: function (h, s, l, a) { - console.warn('Warning: husla() is deprecated and will be removed in 1.0.0. Use hsluva() instead.'); - return this.hsluva(h, s, l, a); - }, hsluv: function (h, s, l) { return this.hsluva(h, s, l, 1.0); }, diff --git a/lib/carto/renderer.js b/lib/carto/renderer.js index 6fa10f69c..c905047ad 100644 --- a/lib/carto/renderer.js +++ b/lib/carto/renderer.js @@ -117,16 +117,12 @@ carto.Renderer.prototype.render = function render(m) { l = m.Layer[i]; styles = []; - if (_.has(l, 'name')) { // remove in 1.0.0 - l.layerId = l.name; - console.warn('Warning: using the name attribute for layers (like ' + l.name + ' here) is deprecated and will be removed in 1.0.0. Use id instead.'); - } - else if (_.has(l, 'id')) { + if (_.has(l, 'id')) { l.layerId = l.id; } else { l.layerId = ''; - var e = new Error("Either name (deprecated) or id attributes are required for layers.\n"); + var e = new Error("The id attribute is required for layers.\n"); e.stack = null; // do not show stack trace throw e; } diff --git a/test/errorhandling/issue165.result b/test/errorhandling/issue165.result index d270134f9..f0c125186 100644 --- a/test/errorhandling/issue165.result +++ b/test/errorhandling/issue165.result @@ -1 +1 @@ -Either name (deprecated) or id attributes are required for layers. +The id attribute is required for layers.