Consistently use lowercase HTML tag names

Unlike HTML, XHTML is case-sensitive.
This commit is contained in:
Matthias Schiffer
2018-08-18 12:46:59 +02:00
parent 26cc0a3ded
commit 321166849b
15 changed files with 20 additions and 20 deletions

View File

@@ -132,7 +132,7 @@ class Overlay extends BaseObject {
* @protected * @protected
* @type {HTMLElement} * @type {HTMLElement}
*/ */
this.element = document.createElement('DIV'); this.element = document.createElement('div');
this.element.className = options.className !== undefined ? this.element.className = options.className !== undefined ?
options.className : 'ol-overlay-container ' + CLASS_SELECTABLE; options.className : 'ol-overlay-container ' + CLASS_SELECTABLE;
this.element.style.position = 'absolute'; this.element.style.position = 'absolute';

View File

@@ -244,7 +244,7 @@ class PluggableMap extends BaseObject {
* @private * @private
* @type {!HTMLElement} * @type {!HTMLElement}
*/ */
this.viewport_ = document.createElement('DIV'); this.viewport_ = document.createElement('div');
this.viewport_.className = 'ol-viewport' + (TOUCH ? ' ol-touch' : ''); this.viewport_.className = 'ol-viewport' + (TOUCH ? ' ol-touch' : '');
this.viewport_.style.position = 'relative'; this.viewport_.style.position = 'relative';
this.viewport_.style.overflow = 'hidden'; this.viewport_.style.overflow = 'hidden';
@@ -258,7 +258,7 @@ class PluggableMap extends BaseObject {
* @private * @private
* @type {!HTMLElement} * @type {!HTMLElement}
*/ */
this.overlayContainer_ = document.createElement('DIV'); this.overlayContainer_ = document.createElement('div');
this.overlayContainer_.className = 'ol-overlaycontainer'; this.overlayContainer_.className = 'ol-overlaycontainer';
this.viewport_.appendChild(this.overlayContainer_); this.viewport_.appendChild(this.overlayContainer_);
@@ -266,7 +266,7 @@ class PluggableMap extends BaseObject {
* @private * @private
* @type {!HTMLElement} * @type {!HTMLElement}
*/ */
this.overlayContainerStopEvent_ = document.createElement('DIV'); this.overlayContainerStopEvent_ = document.createElement('div');
this.overlayContainerStopEvent_.className = 'ol-overlaycontainer-stopevent'; this.overlayContainerStopEvent_.className = 'ol-overlaycontainer-stopevent';
const overlayEvents = [ const overlayEvents = [
EventType.CLICK, EventType.CLICK,

View File

@@ -62,7 +62,7 @@ class Attribution extends Control {
* @private * @private
* @type {HTMLElement} * @type {HTMLElement}
*/ */
this.ulElement_ = document.createElement('UL'); this.ulElement_ = document.createElement('ul');
/** /**
* @private * @private
@@ -232,7 +232,7 @@ class Attribution extends Control {
// append the attributions // append the attributions
for (let i = 0, ii = attributions.length; i < ii; ++i) { for (let i = 0, ii = attributions.length; i < ii; ++i) {
const element = document.createElement('LI'); const element = document.createElement('li');
element.innerHTML = attributions[i]; element.innerHTML = attributions[i];
this.ulElement_.appendChild(element); this.ulElement_.appendChild(element);
} }

View File

@@ -55,7 +55,7 @@ class MousePosition extends Control {
const options = opt_options ? opt_options : {}; const options = opt_options ? opt_options : {};
const element = document.createElement('DIV'); const element = document.createElement('div');
element.className = options.className !== undefined ? options.className : 'ol-mouse-position'; element.className = options.className !== undefined ? options.className : 'ol-mouse-position';
super({ super({

View File

@@ -140,7 +140,7 @@ class OverviewMap extends Control {
* @type {HTMLElement} * @type {HTMLElement}
* @private * @private
*/ */
this.ovmapDiv_ = document.createElement('DIV'); this.ovmapDiv_ = document.createElement('div');
this.ovmapDiv_.className = 'ol-overviewmap-map'; this.ovmapDiv_.className = 'ol-overviewmap-map';
/** /**
@@ -164,7 +164,7 @@ class OverviewMap extends Control {
}).bind(this)); }).bind(this));
} }
const box = document.createElement('DIV'); const box = document.createElement('div');
box.className = 'ol-overviewmap-box'; box.className = 'ol-overviewmap-box';
box.style.boxSizing = 'border-box'; box.style.boxSizing = 'border-box';

View File

@@ -72,7 +72,7 @@ class ScaleLine extends Control {
const className = options.className !== undefined ? options.className : 'ol-scale-line'; const className = options.className !== undefined ? options.className : 'ol-scale-line';
super({ super({
element: document.createElement('DIV'), element: document.createElement('div'),
render: options.render || render, render: options.render || render,
target: options.target target: options.target
}); });
@@ -81,7 +81,7 @@ class ScaleLine extends Control {
* @private * @private
* @type {HTMLElement} * @type {HTMLElement}
*/ */
this.innerElement_ = document.createElement('DIV'); this.innerElement_ = document.createElement('div');
this.innerElement_.className = className + '-inner'; this.innerElement_.className = className + '-inner';
this.element.className = className + ' ' + CLASS_UNSELECTABLE; this.element.className = className + ' ' + CLASS_UNSELECTABLE;

View File

@@ -10,7 +10,7 @@
* @return {CanvasRenderingContext2D} The context. * @return {CanvasRenderingContext2D} The context.
*/ */
export function createCanvasContext2D(opt_width, opt_height) { export function createCanvasContext2D(opt_width, opt_height) {
const canvas = /** @type {HTMLCanvasElement} */ (document.createElement('CANVAS')); const canvas = /** @type {HTMLCanvasElement} */ (document.createElement('canvas'));
if (opt_width) { if (opt_width) {
canvas.width = opt_width; canvas.width = opt_width;
} }

View File

@@ -47,7 +47,7 @@ export const DEVICE_PIXEL_RATIO = window.devicePixelRatio || 1;
export const CANVAS_LINE_DASH = function() { export const CANVAS_LINE_DASH = function() {
let has = false; let has = false;
try { try {
has = !!document.createElement('CANVAS').getContext('2d').setLineDash; has = !!document.createElement('canvas').getContext('2d').setLineDash;
} catch (e) { } catch (e) {
// pass // pass
} }

View File

@@ -57,7 +57,7 @@ class WebGLMapRenderer extends MapRenderer {
* @type {HTMLCanvasElement} * @type {HTMLCanvasElement}
*/ */
this.canvas_ = /** @type {HTMLCanvasElement} */ this.canvas_ = /** @type {HTMLCanvasElement} */
(document.createElement('CANVAS')); (document.createElement('canvas'));
this.canvas_.style.width = '100%'; this.canvas_.style.width = '100%';
this.canvas_.style.height = '100%'; this.canvas_.style.height = '100%';
this.canvas_.style.display = 'block'; this.canvas_.style.display = 'block';

View File

@@ -43,7 +43,7 @@ class IconImage extends EventTarget {
* @type {HTMLCanvasElement} * @type {HTMLCanvasElement}
*/ */
this.canvas_ = color ? this.canvas_ = color ?
/** @type {HTMLCanvasElement} */ (document.createElement('CANVAS')) : /** @type {HTMLCanvasElement} */ (document.createElement('canvas')) :
null; null;
/** /**

View File

@@ -323,7 +323,7 @@ let HAS = false;
//TODO Remove side effects //TODO Remove side effects
if (typeof window !== 'undefined' && 'WebGLRenderingContext' in window) { if (typeof window !== 'undefined' && 'WebGLRenderingContext' in window) {
try { try {
const canvas = /** @type {HTMLCanvasElement} */ (document.createElement('CANVAS')); const canvas = /** @type {HTMLCanvasElement} */ (document.createElement('canvas'));
const gl = getContext(canvas, {failIfMajorPerformanceCaveat: true}); const gl = getContext(canvas, {failIfMajorPerformanceCaveat: true});
if (gl) { if (gl) {
HAS = true; HAS = true;

View File

@@ -8,7 +8,7 @@ describe('ol.control.Control', function() {
map = new Map({ map = new Map({
target: document.createElement('div') target: document.createElement('div')
}); });
const element = document.createElement('DIV'); const element = document.createElement('div');
control = new Control({element: element}); control = new Control({element: element});
control.setMap(map); control.setMap(map);
}); });

View File

@@ -14,7 +14,7 @@ import {createElementNS, parse} from '../../../../src/ol/xml.js';
const readGeometry = function(format, text, opt_options) { const readGeometry = function(format, text, opt_options) {
const doc = parse(text); const doc = parse(text);
// we need an intermediate node for testing purposes // we need an intermediate node for testing purposes
const node = document.createElement('PRE'); const node = document.createElement('pre');
node.appendChild(doc.documentElement); node.appendChild(doc.documentElement);
return format.readGeometryFromNode(node, opt_options); return format.readGeometryFromNode(node, opt_options);
}; };

View File

@@ -15,7 +15,7 @@ describe('ol.MapBrowserEventHandler', function() {
beforeEach(function() { beforeEach(function() {
clock = sinon.useFakeTimers(); clock = sinon.useFakeTimers();
target = document.createElement('DIV'); target = document.createElement('div');
handler = new MapBrowserEventHandler(new Map({ handler = new MapBrowserEventHandler(new Map({
target: target target: target
})); }));

View File

@@ -397,7 +397,7 @@ import {WEBGL} from '../src/ol/has.js';
image.addEventListener('load', function() { image.addEventListener('load', function() {
expect(image.width).to.be(width); expect(image.width).to.be(width);
expect(image.height).to.be(height); expect(image.height).to.be(height);
const referenceCanvas = document.createElement('CANVAS'); const referenceCanvas = document.createElement('canvas');
referenceCanvas.width = image.width; referenceCanvas.width = image.width;
referenceCanvas.height = image.height; referenceCanvas.height = image.height;
const referenceContext = referenceCanvas.getContext('2d'); const referenceContext = referenceCanvas.getContext('2d');