Prefer href to xlink href (#1059)

This commit is contained in:
JFH
2025-06-09 16:59:29 +08:00
committed by GitHub
parent 887ad2e39f
commit 865d1bea33
12 changed files with 296 additions and 267 deletions

View File

@@ -55,6 +55,6 @@ describe('check tool shape and image of svg-edit', { testIsolation: false }, fun
// issue with snapshot not being consistent on CI/Interactive
// cy.svgSnapshot()
// so we use typical DOM tests to validate
cy.get('#svg_2').should('have.attr', 'xlink:href').and('equal', './images/logo.svg')
cy.get('#svg_2').should('have.attr', 'href').and('equal', './images/logo.svg')
})
})

View File

@@ -114,8 +114,8 @@ describe('Basic Module', function () {
svgCanvas.setSvgString(
"<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='400' x='300'>" +
"<rect id='the-rect' width='200' height='200'/>" +
"<use id='the-use' xlink:href='#the-rect'/>" +
"<use id='foreign-use' xlink:href='somefile.svg#the-rect'/>" +
"<use id='the-use' href='#the-rect'/>" +
"<use id='foreign-use' href='somefile.svg#the-rect'/>" +
"<use id='no-use'/>" +
'</svg>'
)

View File

@@ -31,7 +31,7 @@ describe('utilities performance', function () {
<!-- Must include this thumbnail view to see some of the performance issues -->
<svg id="overviewMiniView" width="132" height="112.5" x="0" y="0" viewBox="100 100 1000 1000" style="float: right;"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<use x="0" y="0" xlink:href="#svgroot"></use>
<use x="0" y="0" href="#svgroot"></use>
</svg>