diff --git a/examples/vector-labels.js b/examples/vector-labels.js index 17f0614d0e..baa746fd16 100644 --- a/examples/vector-labels.js +++ b/examples/vector-labels.js @@ -107,7 +107,7 @@ const createTextStyle = function (feature, resolution, dom) { const openSans = document.createElement('link'); openSans.href = 'https://fonts.googleapis.com/css?family=Open+Sans'; openSans.rel = 'stylesheet'; - document.getElementsByTagName('head')[0].appendChild(openSans); + document.head.appendChild(openSans); openSansAdded = true; } const font = weight + ' ' + size + '/' + height + ' ' + dom.font.value; diff --git a/src/ol/net.js b/src/ol/net.js index 3dd14df8a3..5385992ad8 100644 --- a/src/ol/net.js +++ b/src/ol/net.js @@ -39,7 +39,7 @@ export function jsonp(url, callback, opt_errback, opt_callbackParam) { cleanup(); callback(data); }; - document.getElementsByTagName('head')[0].appendChild(script); + document.head.appendChild(script); } export class ResponseError extends Error { diff --git a/test/browser/spec/ol/data/fonts/ubuntu-regular-webfont.woff2 b/test/browser/spec/ol/data/fonts/ubuntu-regular-webfont.woff2 new file mode 100644 index 0000000000..1ab75a4288 Binary files /dev/null and b/test/browser/spec/ol/data/fonts/ubuntu-regular-webfont.woff2 differ diff --git a/test/browser/spec/ol/format/kml.test.js b/test/browser/spec/ol/format/kml.test.js index fc44e39305..53035a9ad8 100644 --- a/test/browser/spec/ol/format/kml.test.js +++ b/test/browser/spec/ol/format/kml.test.js @@ -6,6 +6,7 @@ import GeometryCollection from '../../../../../src/ol/geom/GeometryCollection.js import Icon from '../../../../../src/ol/style/Icon.js'; import IconAnchorUnits from '../../../../../src/ol/style/IconAnchorUnits.js'; import IconOrigin from '../../../../../src/ol/style/IconOrigin.js'; +import ImageState from '../../../../../src/ol/ImageState.js'; import KML, { getDefaultFillStyle, getDefaultImageStyle, @@ -2323,7 +2324,7 @@ describe('ol.format.KML', function () { expect(f).to.be.an(Feature); const styleFunction = f.getStyleFunction(); expect(styleFunction).not.to.be(undefined); - const styleArray = styleFunction(f, 0); + const styleArray = /** @type {Array